Previous 15994 Revisions Next

r1528 Friday 18th January, 2008 at 03:22:44 UTC by Nathan Woods
Updated to MAME 0.122u6 core
[docs]messnew.txt
[src/emu]cheat.c cpuexec.c cpuexec.h cpuintrf.c cpuintrf.h emu.mak inptport.h sndintrf.c sndintrf.h ui.c uimenu.c validity.c video.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/alph8201]alph8201.c
[src/emu/cpu/apexc]apexc.c
[src/emu/cpu/arm]arm.c
[src/emu/cpu/arm7]arm7.c
[src/emu/cpu/asap]asap.c
[src/emu/cpu/ccpu]ccpu.c
[src/emu/cpu/cdp1802]cdp1802.c
[src/emu/cpu/cop400]cop400.h cop410.c cop420.c
[src/emu/cpu/cp1610]cp1610.c
[src/emu/cpu/dsp32]dsp32.c
[src/emu/cpu/dsp56k]dsp56k.c
[src/emu/cpu/e132xs]e132xs.c
[src/emu/cpu/f8]f8.c
[src/emu/cpu/g65816]g65816.c
[src/emu/cpu/h6280]h6280.c h6280ops.h
[src/emu/cpu/h83002]h83002.c
[src/emu/cpu/hd6309]hd6309.c
[src/emu/cpu/i386]i386.c i386dasm.c
[src/emu/cpu/i8039]i8039.c i8039.h
[src/emu/cpu/i8051]i8051.c
[src/emu/cpu/i8085]i8085.c
[src/emu/cpu/i86]i286.c i86.c
[src/emu/cpu/i8x41]i8x41.c i8x41.h
[src/emu/cpu/i960]i960.c
[src/emu/cpu/jaguar]jaguar.c
[src/emu/cpu/konami]konami.c
[src/emu/cpu/lh5801]lh5801.c
[src/emu/cpu/m37710]m37710.c
[src/emu/cpu/m6502]m4510.c m6502.c m6509.c
[src/emu/cpu/m6800]m6800.c
[src/emu/cpu/m68000]m68kmame.c
[src/emu/cpu/m6805]m6805.c m6805.h
[src/emu/cpu/m6809]m6809.c
[src/emu/cpu/mb86233]mb86233.c
[src/emu/cpu/mb88xx]mb88xx.c
[src/emu/cpu/mc68hc11]mc68hc11.c
[src/emu/cpu/minx]minx.c
[src/emu/cpu/mips]mips3com.c mips3com.h mips3drc.c psx.c r3000.c r3000.h
[src/emu/cpu/nec]nec.c
[src/emu/cpu/pdp1]pdp1.c tx0.c
[src/emu/cpu/pic16c5x]pic16c5x.c pic16c5x.h
[src/emu/cpu/powerpc]ppc.c ppcdrc.c
[src/emu/cpu/rsp]rsp.c
[src/emu/cpu/s2650]s2650.c
[src/emu/cpu/saturn]saturn.c
[src/emu/cpu/sc61860]sc61860.c
[src/emu/cpu/se3208]se3208.c
[src/emu/cpu/sh2]sh2.c
[src/emu/cpu/sh4]sh4.c
[src/emu/cpu/sharc]sharc.c
[src/emu/cpu/sm8500]sm8500.c
[src/emu/cpu/spc700]spc700.c
[src/emu/cpu/ssp1610]ssp1610.c
[src/emu/cpu/t11]t11.c
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms32010]tms32010.c tms32010.h
[src/emu/cpu/tms32025]tms32025.c
[src/emu/cpu/tms32031]tms32031.c
[src/emu/cpu/tms32051]tms32051.c
[src/emu/cpu/tms34010]tms34010.c tms34010.h
[src/emu/cpu/tms7000]tms7000.c
[src/emu/cpu/tms9900]99xxcore.h
[src/emu/cpu/upd7810]upd7810.c
[src/emu/cpu/v30mz]v30mz.c
[src/emu/cpu/v60]v60.c
[src/emu/cpu/v810]v810.c
[src/emu/cpu/z180]z180.c
[src/emu/cpu/z80]z80.c
[src/emu/cpu/z8000]z8000.c
[src/emu/cpu/z80gb]z80gb.c
[src/emu/drivers]xtal.h
[src/emu/machine]6522via.c 6532riot.c 6821pia.c 6821pia.h tmp68301.c
[src/emu/sound]5220intf.c scsp.c sound.mak tms5220.c tms5220.h
[src/emu/video]generic.c generic.h tlc34076.c tlc34076.h tms34061.c tms34061.h
[src/mame]mame.mak mamedriv.c tiny.c
[src/mame/audio]astrof.c cage.c carnival.c cchasm.c cinemat.c crbaloon.c dcs.c dkong.c exidy.c gorf.c irem.c mario.c mcr.c n8080.c phoenix.c polepos.c scramble.c segag80r.c segasnd.c seibu.c seibu.h senjyo.c targ.c tx1.c williams.c wow.c
[src/mame/drivers]40love.c acefruit.c alg.c amspdwy.c arcadia.c arkanoid.c artmagic.c astinvad.c astrocde.c astrof.c asuka.c ataxx.c atetris.c bagman.c berzerk.c bigevglf.c bionicc.c bishjan.c bking2.c blmbycar.c bloodbro.c btoads.c bublbobl.c buggychl.c cabal.c capbowl.c carjmbre.c ccastles.c cclimber.c changela.c cloud9.c cojag.c coolpool.c cosmic.c cps3.c crbaloon.c csk.c cvs.c darius.c darkhors.c dcon.c ddayjlc.c ddragon.c deadang.c dec8.c deco156.c decocass.c dlair.c dorachan.c drgnmst.c dunhuang.c dynadice.c dynduke.c enigma2.c eolithsp.c equites.c exerion.c exidy.c exterm.c f1gp.c fcombat.c finalizr.c firebeat.c flstory.c fuukifg2.c gaelco.c gaelco3d.c getrivia.c gladiatr.c goldstar.c goodejan.c gstream.c gsword.c gyruss.c harddriv.c hshavoc.c ikki.c imolagp.c itech8.c jedi.c jpmimpct.c junofrst.c kaneko16.c kchamp.c kickgoal.c kingobox.c kncljoe.c konamigq.c konamigv.c ksayakyu.c ksys573.c ladybug.c lasso.c lastduel.c legionna.c leland.c lethalj.c limenko.c lkage.c looping.c lsasquad.c ltcasino.c m72.c m92.c m92.h markham.c matmania.c maxaflex.c mcr3.c mcr68.c megaplay.c megazone.c merit.c metro.c mexico86.c micro3d.c midas.c midtunit.c midvunit.c midwunit.c midxunit.c midyunit.c midzeus.c missile.c momoko.c mouser.c msisaac.c munchmo.c mustache.c mw8080bw.c namcona1.c namcos10.c namcos11.c namcos12.c naomi.c naughtyb.c nbmj9195.c neogeo.c ninjakid.c ninjaw.c niyanpai.c nmk16.c nss.c nycaptor.c pacman.c pandoras.c paradise.c paranoia.c peplus.c phoenix.c pipeline.c pitnrun.c pkunwar.c playmark.c pturn.c punchout.c pushman.c qix.c quasar.c r2dtank.c raiden.c raiden2.c redalert.c retofinv.c rollerg.c rollrace.c sauro.c segag80v.c segas16a.c segas32.c sengokmj.c seta.c shanghai.c shangkid.c shougi.c sidepckt.c simpsons.c skyarmy.c skychut.c slapfght.c spcforce.c sprint4.c ssingles.c ssv.c stadhero.c strnskil.c subs.c superqix.c suprridr.c system1.c tail2nos.c taitosj.c tatsumi.c tempest.c thayers.c tickee.c tmnt.c tnzs.c toaplan1.c toki.c tp84.c troangel.c tunhunt.c twin16.c twincobr.c uapce.c ultratnk.c vicdual.c victory.c vigilant.c wardner.c wilytowr.c wiping.c wiz.c xain.c xtheball.c yamato.c zac2650.c zaxxon.c zn.c
[src/mame/includes]amiga.h astrocde.h astrof.h berzerk.h crbaloon.h cvs.h eolithsp.h exidy.h itech8.h jaguar.h jedi.h mario.h mcr.h mw8080bw.h phoenix.h seta.h spacefb.h targ.h* victory.h*
[src/mame/machine]amiga.c asic65.c leland.c mcr.c midwunit.c namcos1.c
[src/mame/video]artmagic.c bionicc.c btoads.c buggychl.c capbowl.c carjmbre.c changela.c crbaloon.c csk.c cvs.c darius.c dc.c exidy.c finalizr.c galaxian.c goldstar.c itech8.c jagobj.c jaguar.c jedi.c konamiic.c konamiic.h lethalj.c matmania.c megazone.c mouser.c munchmo.c naughtyb.c nycaptor.c paradise.c phoenix.c pkunwar.c ppu2c0x.c punchout.c redalert.c seta.c skychut.c snk.c tagteam.c tatsumi.c thief.c tiamc1.c tmnt.c troangel.c tunhunt.c vdc.c vdc.h victory.c vigilant.c wiping.c wiz.c xxmissio.c
[src/mess]device.c device.h filemngr.c mess.c mess.mak messcore.mak mesvalid.c mslegacy.c* mslegacy.h muitext.c muitext.h tapectrl.c uimess.c
[src/mess/drivers]aquarius.c nascom1.c
[src/mess/machine]mz700.c nascom1.c pet.c ti99_4x.c
[src/mess/osd/windows]dialog.c menu.c
[src/mess/osd/winui]devview.c messui.c messui.h

src/mame/audio/cchasm.c
r1527r1528
179179    sound_flags = 0;
180180    output[0] = 0; output[1] = 0;
181181
182   ctc_intf.baseclock = machine->drv->cpu[1].clock;
182   ctc_intf.baseclock = cpunum_get_clock(1);
183183   z80ctc_init (0, &ctc_intf);
184184
185185   timer_pulse(attotime_make(0, machine->screen[0].refresh), NULL, 0, cchasm_sh_update);
src/mame/audio/phoenix.c
r1527r1528
4848#define VMIN    0
4949#define VMAX   32767
5050
51static int sound_latch_a;
51static UINT8 sound_latch_a;
5252
5353static sound_stream * channel;
5454
r1527r1528
386386   sound_latch_a = data;
387387}
388388
389SOUND_START( phoenix)
390{
391   state_save_register_global(sound_latch_a);
392}
393
389394WRITE8_HANDLER( phoenix_sound_control_b_w )
390395{
391396   discrete_sound_w(PHOENIX_EFFECT_1_DATA, data & 0x0f);
r1527r1528
420425
421426   channel = stream_create(0, 1, Machine->sample_rate, 0, phoenix_sound_update);
422427
428   state_save_register_global_pointer(poly18, (1ul << (18-5)) );
429
423430   /* a dummy token */
424431   return auto_malloc(1);
425432}
src/mame/audio/wow.c
r1527r1528
175175}
176176
177177
178UINT32 wow_speech_status_r(void *param)
178CUSTOM_INPUT( wow_speech_status_r )
179179{
180180   return !sample_playing(0);
181181}
src/mame/audio/n8080.c
r1527r1528
546546MACHINE_DRIVER_START( spacefev_sound )
547547
548548   /* basic machine hardware */
549   MDRV_CPU_ADD(I8035, 6000000 / I8039_CLOCK_DIVIDER)
549   MDRV_CPU_ADD(I8035, 6000000)
550550   /* audio CPU */
551551   MDRV_CPU_PROGRAM_MAP(n8080_sound_cpu_map, 0)
552552   MDRV_CPU_IO_MAP(n8080_sound_io_map, 0)
r1527r1528
568568MACHINE_DRIVER_START( sheriff_sound )
569569
570570   /* basic machine hardware */
571   MDRV_CPU_ADD(I8035, 6000000 / I8039_CLOCK_DIVIDER)
571   MDRV_CPU_ADD(I8035, 6000000)
572572   /* audio CPU */
573573   MDRV_CPU_PROGRAM_MAP(n8080_sound_cpu_map, 0)
574574   MDRV_CPU_IO_MAP(n8080_sound_io_map, 0)
r1527r1528
590590MACHINE_DRIVER_START( helifire_sound )
591591
592592   /* basic machine hardware */
593   MDRV_CPU_ADD(I8035, 6000000 / I8039_CLOCK_DIVIDER)
593   MDRV_CPU_ADD(I8035, 6000000)
594594   /* audio CPU */
595595   MDRV_CPU_PROGRAM_MAP(n8080_sound_cpu_map, 0)
596596   MDRV_CPU_IO_MAP(helifire_sound_io_map, 0)
src/mame/audio/cinemat.c
r1527r1528
15081508   generic_init(machine, demon_sound_w);
15091509
15101510   /* initialize the CTC interface */
1511   demon_z80ctc_interface.baseclock = machine->drv->cpu[1].clock;
1511   demon_z80ctc_interface.baseclock = cpunum_get_clock(1);
15121512   z80ctc_init(0, &demon_z80ctc_interface);
15131513
15141514   /* reset the FIFO */
src/mame/audio/gorf.c
r1527r1528
180180}
181181
182182
183UINT32 gorf_speech_status_r(void *param)
183CUSTOM_INPUT( gorf_speech_status_r )
184184{
185185   return !sample_playing(0);
186186}
src/mame/audio/astrof.c
r1527r1528
193193
194194/*************************************
195195 *
196 *  Space Fighter
197 *
198 *************************************/
199
200WRITE8_HANDLER( spfghmk2_audio_w )
201{
202   /* nothing yet */
203}
204
205
206MACHINE_DRIVER_START( spfghmk2_audio )
207   /* nothing yet */
208MACHINE_DRIVER_END
209
210
211
212/*************************************
213 *
196214 *  Tomahawk
197215 *
198216 *************************************/
src/mame/audio/cage.c
r1527r1528
161161   memory_set_bankptr(11, memory_region(boot_region + 1));
162162
163163   cage_cpu = mame_find_cpu_index(Machine, "cage");
164   cage_cpu_clock_period = ATTOTIME_IN_HZ(Machine->drv->cpu[cage_cpu].clock);
164   cage_cpu_clock_period = ATTOTIME_IN_HZ(cpunum_get_clock(cage_cpu));
165165   cage_cpu_h1_clock_period = attotime_mul(cage_cpu_clock_period, 2);
166166
167167   dma_timer = timer_alloc(dma_timer_callback, NULL);
src/mame/audio/crbaloon.c
r1527r1528
1/***************************************************************************
2
3    Taito Crazy Balloon hardware
4
5    Analog emulation - Jan 2006, Derrick Renaud
6
7***************************************************************************/
8
19#include "driver.h"
210#include "crbaloon.h"
11#include "sound/sn76477.h"
12#include "sound/discrete.h"
313
414
5/************************************************************************
6* crbaloon Sound System Analog emulation
7* Jan 2006, Derrick Renaud
8************************************************************************/
15/* timing sources */
16#define CRBALOON_16H         (CRBALOON_MASTER_XTAL/2/2/16)
917
18/* enables */
19#define CRBALOON_LAUGH_EN      NODE_01
20#define CRBALOON_MUSIC_EN      NODE_02
21#define CRBALOON_MUSIC_DATA      NODE_03
1022
11/* Timing Sources */
12#define CRBALOON_16H         9987000.0/2/2/16
13
14/* Nodes - Adjusters */
23/* nodes - adjusters */
1524#define CRBALOON_VR2         NODE_05
1625#define CRBALOON_VR3         NODE_06
1726
18/* Nodes - Sounds */
27/* nodes - sounds */
1928#define CRBALOON_LAUGH_SND      NODE_80
2029#define CRBALOON_MUSIC_SND      NODE_81
2130
31
32
33void crbaloon_audio_set_music_freq(UINT8 freq)
34{
35   discrete_sound_w(CRBALOON_MUSIC_DATA, freq);
36}
37
38
39void crbaloon_audio_set_music_enable(int enabled)
40{
41   discrete_sound_w(CRBALOON_MUSIC_EN, enabled);
42}
43
44
45void crbaloon_audio_set_explosion_enable(int enabled)
46{
47   SN76477_enable_w(0, enabled);
48}
49
50
51void crbaloon_audio_set_breath_enable(int enabled)
52{
53   /* changes slf_res to 10k (middle of two 10k resistors)
54       it also puts a tantal capacitor against GND on the output,
55       but this section of the schematics is not readable. */
56   SN76477_slf_res_w(0, enabled ? RES_K(10) : RES_K(20) );
57}
58
59
60void crbaloon_audio_set_appear_enable(int enabled)
61{
62   /* APPEAR is connected to MIXER B */
63   SN76477_mixer_b_w(0, enabled);
64}
65
66
67void crbaloon_audio_set_laugh_enable(int enabled)
68{
69   discrete_sound_w(CRBALOON_LAUGH_EN, enabled);
70}
71
72
73
2274static const discrete_555_desc desc_crbaloon_laugh_osc =
2375{
2476   DISC_555_OUT_SQW | DISC_555_OUT_DC,
r1527r1528
2678   DEFAULT_555_VALUES
2779};
2880
81
2982static const discrete_dac_r1_ladder desc_crbaloon_music_dac =
3083{
3184   3,
r1527r1528
3386   5, RES_K(470), 0, 0
3487};
3588
36DISCRETE_SOUND_START(crbaloon)
3789
90
91static DISCRETE_SOUND_START(crbaloon)
92
3893   /************************************************
3994    * Input register mapping
4095    ************************************************/
r1527r1528
78133   DISCRETE_OUTPUT(NODE_91, 65000.0/12)
79134
80135DISCRETE_SOUND_END
136
137
138
139static const struct SN76477interface sn76477_interface =
140{
141   RES_K( 47),   /*  4 noise_res          */
142   RES_K(330),   /*  5 filter_res         */
143   CAP_P(470),   /*  6 filter_cap         */
144   RES_K(220),   /*  7 decay_res          */
145   CAP_U(1.0),   /*  8 attack_decay_cap   */
146   RES_K(4.7),   /* 10 attack_res         */
147   RES_M(  1),   /* 11 amplitude_res      */
148   RES_K(200),   /* 12 feedback_res       */
149   5.0,      /* 16 vco_voltage        */
150   CAP_P(470),   /* 17 vco_cap            */
151   RES_K(330),   /* 18 vco_res            */
152   5.0,      /* 19 pitch_voltage      */
153   RES_K( 20),   /* 20 slf_res (variable) */
154   CAP_P(420),   /* 21 slf_cap            */
155   CAP_U(1.0),   /* 23 oneshot_cap        */
156   RES_K( 47),   /* 24 oneshot_res        */
157   0,         /* 22 vco                */
158   0,         /* 26 mixer A            */
159   0,         /* 25 mixer B (variable) */
160   1,         /* 27 mixer C            */
161   1,         /* 1  envelope 1         */
162   0,         /* 28 envelope 2         */
163   0         /* 9  enable (variable)  */
164};
165
166
167
168MACHINE_DRIVER_START( crbaloon_audio )
169
170   MDRV_SPEAKER_STANDARD_MONO("mono")
171
172   MDRV_SOUND_ADD(SN76477, 0)
173   MDRV_SOUND_CONFIG(sn76477_interface)
174   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
175
176   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
177   MDRV_SOUND_CONFIG_DISCRETE(crbaloon)
178   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
179MACHINE_DRIVER_END
src/mame/audio/senjyo.c
r1527r1528
6969    int i;
7070
7171   /* z80 ctc init */
72   ctc_intf.baseclock = Machine->drv->cpu[1].clock;
72   ctc_intf.baseclock = cpunum_get_clock(1);
7373   z80ctc_init (0, &ctc_intf);
7474
7575   /* z80 pio init */
src/mame/audio/tx1.c
r1527r1528
275275
276276void *tx1_sh_start(int clock, const struct CustomSound_interface *config)
277277{
278   const int r0[4] = { 390e3, 180e3, 180e3, 180e3 };
279   const int r1[3] = { 180e3, 390e3, 56e3 };
280   const int r2[3] = { 390e3, 390e3, 180e3 };
278   static const int r0[4] = { 390e3, 180e3, 180e3, 180e3 };
279   static const int r1[3] = { 180e3, 390e3, 56e3 };
280   static const int r2[3] = { 390e3, 390e3, 180e3 };
281281
282282
283283   /* Allocate the stream */
src/mame/audio/mcr.c
r1527r1528
2525 *
2626 *************************************/
2727
28#define SSIO_CLOCK         16000000
29#define CSDELUXE_CLOCK      15000000
30#define SOUNDSGOOD_CLOCK   16000000
31#define TURBOCS_CLOCK      8000000
32#define SQUAWKTALK_CLOCK   3580000
28#define SSIO_CLOCK         XTAL_16MHz
29#define CSDELUXE_CLOCK      XTAL_16MHz
30#define SOUNDSGOOD_CLOCK   XTAL_16MHz
31#define TURBOCS_CLOCK      XTAL_8MHz
32#define SQUAWKTALK_CLOCK   XTAL_3_579545MHz
3333
3434
3535
r1527r1528
791791
792792/********* machine driver ***********/
793793MACHINE_DRIVER_START(turbo_chip_squeak)
794   MDRV_CPU_ADD_TAG("tcs", M6809, TURBOCS_CLOCK/4)
794   MDRV_CPU_ADD_TAG("tcs", M6809E, TURBOCS_CLOCK)
795795   MDRV_CPU_PROGRAM_MAP(turbocs_map,0)
796796
797797   MDRV_SPEAKER_STANDARD_MONO("mono")
r1527r1528
818818 *
819819 *  MCR Squawk n Talk communications
820820 *
821 *  MC6802, 2 PIAs, TMS5220, AY8912 (not used), 8-bit DAC (not used)
821 *  MC6802, 2 PIAs, TMS5200, AY8912 (not used), 8-bit DAC (not used)
822822 *
823823 *************************************/
824824
r1527r1528
840840
841841static WRITE8_HANDLER( squawkntalk_portb2_w )
842842{
843   /* bits 0-1 select read/write strobes on the TMS5220 */
843   /* bits 0-1 select read/write strobes on the TMS5200 */
844844   data &= 0x03;
845845
846   /* write strobe -- pass the current command to the TMS5220 */
846   /* write strobe -- pass the current command to the TMS5200 */
847847   if (((data ^ squawkntalk_tms_strobes) & 0x02) && !(data & 0x02))
848848   {
849849      tms5220_data_w(offset, squawkntalk_tms_command);
r1527r1528
853853      pia_1_ca2_w(0, 0);
854854   }
855855
856   /* read strobe -- read the current status from the TMS5220 */
856   /* read strobe -- read the current status from the TMS5200 */
857857   else if (((data ^ squawkntalk_tms_strobes) & 0x01) && !(data & 0x01))
858858   {
859859      pia_1_porta_w(0, tms5220_status_r(offset));
r1527r1528
941941   MDRV_CPU_PROGRAM_MAP(squawkntalk_map,0)
942942
943943   /* only used on Discs of Tron, which is stereo */
944   MDRV_SOUND_ADD_TAG("snt", TMS5220, 640000)
944   MDRV_SOUND_ADD_TAG("snt", TMS5200, 640000)
945945   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.60)
946946   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.60)
947947
src/mame/audio/segasnd.c
r1527r1528
280280MACHINE_DRIVER_START( sega_speech_board )
281281
282282   /* CPU for the speech board */
283   MDRV_CPU_ADD(I8035, SPEECH_MASTER_CLOCK/15)      /* divide by 15 in CPU */
283   MDRV_CPU_ADD(I8035, SPEECH_MASTER_CLOCK)      /* divide by 15 in CPU */
284284   MDRV_CPU_PROGRAM_MAP(speech_map, 0)
285285   MDRV_CPU_IO_MAP(speech_portmap, 0)
286286
r1527r1528
918918MACHINE_DRIVER_START( sega_universal_sound_board )
919919
920920   /* CPU for the usb board */
921   MDRV_CPU_ADD_TAG("usb", I8035, USB_MASTER_CLOCK/15)      /* divide by 15 in CPU */
921   MDRV_CPU_ADD_TAG("usb", I8035, USB_MASTER_CLOCK)      /* divide by 15 in CPU */
922922   MDRV_CPU_PROGRAM_MAP(usb_map, 0)
923923   MDRV_CPU_IO_MAP(usb_portmap, 0)
924924
src/mame/audio/irem.c
r1527r1528
153153MACHINE_DRIVER_START( irem_audio )
154154
155155   /* basic machine hardware */
156   MDRV_CPU_ADD(M6803, 3579545/4)
156   MDRV_CPU_ADD(M6803, XTAL_3_579545MHz/4) /* verified on pcb */
157157   /* audio CPU */
158158   MDRV_CPU_PROGRAM_MAP(irem_sound_readmem,irem_sound_writemem)
159159   MDRV_CPU_IO_MAP(irem_sound_readport,irem_sound_writeport)
r1527r1528
161161   /* sound hardware */
162162   MDRV_SPEAKER_STANDARD_MONO("mono")
163163
164   MDRV_SOUND_ADD(AY8910, 3579545/4)
164   MDRV_SOUND_ADD(AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
165165   MDRV_SOUND_CONFIG(irem_ay8910_interface_1)
166166   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
167167
168   MDRV_SOUND_ADD(AY8910, 3579545/4)
168   MDRV_SOUND_ADD(AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
169169   MDRV_SOUND_CONFIG(irem_ay8910_interface_2)
170170   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
171171
172   MDRV_SOUND_ADD(MSM5205, 384000)
172   MDRV_SOUND_ADD(MSM5205, XTAL_384kHz) /* verified on pcb */
173173   MDRV_SOUND_CONFIG(irem_msm5205_interface_1)
174174   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
175175
176   MDRV_SOUND_ADD(MSM5205, 384000)
176   MDRV_SOUND_ADD(MSM5205, XTAL_384kHz) /* verified on pcb */
177177   MDRV_SOUND_CONFIG(irem_msm5205_interface_2)
178178   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
179179MACHINE_DRIVER_END
src/mame/audio/carnival.c
r1527r1528
302302
303303
304304MACHINE_DRIVER_START( carnival_audio )
305   MDRV_CPU_ADD(I8039,( ( 3579545 / 5 ) / 3 ))
305   MDRV_CPU_ADD(I8039, 3579545)
306306   MDRV_CPU_PROGRAM_MAP(carnival_audio_map,0)
307307   MDRV_CPU_IO_MAP(carnival_audio_io_map,0)
308308
src/mame/audio/dkong.c
r1527r1528
1717 *
1818 ****************************************************************/
1919
20/* Set to 1 to disable DAC and post-mixer filters */
21#define      DK_NO_FILTERS   (0)
22
23
2024#define ACTIVELOW_PORT_BIT(P,A,D)   (((P) & (~(1 << (A)))) | (((D) ^ 1) << (A)))
2125
2226/* Needed for dkongjr ... FIXME */
r1527r1528
99103 *
100104 ****************************************************************/
101105
102/* Variable components */
103
104#define DK_VR1      RES_K(10)
105
106106/* Resistors */
107107
108108#define DK_R1       RES_K(47)
r1527r1528
166166#define DK_C30      CAP_U(10)
167167#define DK_C32      CAP_U(10)
168168#define DK_C34      CAP_N(10)
169#define DK_C160      CAP_N(100)
169#define DK_C159      CAP_N(0)      /* 100nF in Schematics but sound is way off */
170170
171171
172172/*
r1527r1528
215215      {DK_R2, DK_R24, DK_R1, DK_R14},
216216      {0,0,0},   // no variable resistors
217217      {0,0,0},  // no node capacitors
218      0, DK_VR1,
219      DK_C160,
218      0, 0,
219      DK_C159,
220220      DK_C12,
221221      0, 1};
222222
r1527r1528
345345   DISCRETE_FILTER2(NODE_73, 1, NODE_71, 1916, (1.0/0.74), DISC_FILTER_LOWPASS)
346346
347347   /* Adjustment VR2 */
348#if DK_NO_FILTERS
349   DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_71, DS_ADJ_DAC)
350#else
348351   DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_73, DS_ADJ_DAC)
352#endif
349353
350354   /************************************************/
351355   /* Amplifier                                    */
r1527r1528
356360   // Amplifier: internal amplifier
357361   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
358362    DISCRETE_RCINTEGRATE(NODE_294,1,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
359   DISCRETE_CRFILTER(NODE_295,1,NODE_294, 1000, DK_C13)
360   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0 * 3)
363   DISCRETE_CRFILTER(NODE_295,1,NODE_294, RES_K(50), DK_C13)
364   // EZV20 equivalent filter circuit ...
365   DISCRETE_CRFILTER(NODE_296,1,NODE_295, RES_K(1), CAP_U(4.7))
361366
367#if DK_NO_FILTERS
368   DISCRETE_OUTPUT(NODE_288, 32767.0/5.0 * 10)
369#else
370   DISCRETE_OUTPUT(NODE_296, 32767.0/5.0 * 3)
371#endif
372
362373DISCRETE_SOUND_END
363374
364375/****************************************************************
r1527r1528
635646#define JR_R9      RES_K(47)
636647#define JR_R10      RES_K(10)
637648#define JR_R11      RES_K(20)
649#define JR_R12      RES_K(10)
650#define JR_R13      RES_K(47)
638651#define JR_R14      RES_K(30)
639652#define JR_R17      RES_K(47)
640653#define JR_R18      RES_K(100)
r1527r1528
645658#define JR_R27      RES_K(10)
646659#define JR_R28      RES_K(100)
647660
661
648662#define JR_C13      CAP_U(4.7)
649663#define JR_C14      CAP_U(4.7)
650664#define JR_C15      CAP_U(22)
r1527r1528
656670#define JR_C21      CAP_N(56)
657671#define JR_C22      CAP_N(220)
658672#define JR_C23      CAP_U(0.47)
673#define JR_C24      CAP_U(47)
659674#define JR_C25      CAP_U(1)
660675#define JR_C26      CAP_U(47)
661676#define JR_C27      CAP_U(22)
r1527r1528
687702      {JR_R5, JR_R3, JR_R6, JR_R4, JR_R25},
688703      {0,0,0,0,0},   // no variable resistors
689704      {0,0,0,0,0},  // no node capacitors
690      0, RES_M(1), // Dummy,
705      0, 0,
691706      JR_C155,
692707      JR_C161,
693708      0, 1};
694709
695#define JR_R12      RES_K(10)
696#define JR_R13      RES_K(47)
697#define JR_C24      CAP_U(47)
698
699710static const discrete_mixer_desc dkongjr_s1_mixer_desc =
700711   {DISC_MIXER_IS_RESISTOR,
701712      {JR_R13, JR_R12},
r1527r1528
866877   dkong_state *state = machine->driver_data;
867878
868879   state->mcustatus = 0;
869   state->page = 0;
880   state->page = 0x47;
881   state->portT = 0;
870882
871883   I8035_T_W_AL(0,0);
872884   I8035_T_W_AL(1,0);
873   I8035_P1_W(255);
874   I8035_P2_W(255);
885   I8035_P1_W(0xFF);
886   I8035_P2_W(0xFF);
887   soundlatch_w(0,0x0F);
875888}
876889
890static SOUND_RESET( dkongjr )
891{
892   sound_reset_dkong(machine);
893   soundlatch_w(0,0x00);
894}
895
877896/****************************************************************
878897 *
879898 * M58817 Speech
r1527r1528
13111330   MDRV_CPU_IO_MAP(dkongjr_sound_io_map, 0)
13121331
13131332   MDRV_SOUND_START(dkong)
1314   MDRV_SOUND_RESET(dkong)
1333   MDRV_SOUND_RESET(dkongjr)
13151334
13161335   MDRV_SPEAKER_STANDARD_MONO("mono")
13171336
src/mame/audio/seibu.c
r1527r1528
167167   }
168168}
169169
170void *seibu_adpcm_start(int clock, const struct CustomSound_interface *config)
170static void *seibu_adpcm_start(int clock, const struct CustomSound_interface *config)
171171{
172172   int i;
173173
r1527r1528
185185   return NULL;
186186}
187187
188void seibu_adpcm_stop(void *token)
188static void seibu_adpcm_stop(void *token)
189189{
190190   struct seibu_adpcm_state *state = token;
191191   state->allocated = 0;
r1527r1528
478478
479479/***************************************************************************/
480480
481ADDRESS_MAP_START( seibu_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
482   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
483   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
484   AM_RANGE(0x4008, 0x4008) AM_READ(YM3812_status_port_0_r)
485   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
486   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
487   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
488   AM_RANGE(0x6000, 0x6000) AM_READ(OKIM6295_status_0_r)
489   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_BANK1)
490ADDRESS_MAP_END
481const struct YM3812interface seibu_ym3812_interface =
482{
483   seibu_ym3812_irqhandler
484};
491485
492ADDRESS_MAP_START( seibu_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
493   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
494   AM_RANGE(0x2000, 0x27ff) AM_WRITE(MWA8_RAM)
486const struct CustomSound_interface seibu_adpcm_interface =
487{
488   seibu_adpcm_start,
489   seibu_adpcm_stop
490};
491
492const struct YM2151interface seibu_ym2151_interface =
493{
494   seibu_ym2151_irqhandler
495};
496
497const struct YM2203interface seibu_ym2203_interface =
498{
499   0,0,0,0,seibu_ym2203_irqhandler
500};
501
502/***************************************************************************/
503
504ADDRESS_MAP_START( seibu_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
505   AM_RANGE(0x0000, 0x1fff) AM_ROM
506   AM_RANGE(0x2000, 0x27ff) AM_RAM
495507   AM_RANGE(0x4000, 0x4000) AM_WRITE(seibu_pending_w)
496508   AM_RANGE(0x4001, 0x4001) AM_WRITE(seibu_irq_clear_w)
497509   AM_RANGE(0x4002, 0x4002) AM_WRITE(seibu_rst10_ack_w)
498510   AM_RANGE(0x4003, 0x4003) AM_WRITE(seibu_rst18_ack_w)
499511   AM_RANGE(0x4007, 0x4007) AM_WRITE(seibu_bank_w)
500   AM_RANGE(0x4008, 0x4008) AM_WRITE(YM3812_control_port_0_w)
512   AM_RANGE(0x4008, 0x4008) AM_READWRITE(YM3812_status_port_0_r, YM3812_control_port_0_w)
501513   AM_RANGE(0x4009, 0x4009) AM_WRITE(YM3812_write_port_0_w)
502   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
503   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
504   AM_RANGE(0x6000, 0x6000) AM_WRITE(OKIM6295_data_0_w)
505   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
506ADDRESS_MAP_END
507
508ADDRESS_MAP_START( seibu2_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
509   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
510   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
511   AM_RANGE(0x4009, 0x4009) AM_READ(YM2151_status_port_0_r)
512514   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
513515   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
514516   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
515   AM_RANGE(0x6000, 0x6000) AM_READ(OKIM6295_status_0_r)
516   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_BANK1)
517   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
518   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
519   AM_RANGE(0x6000, 0x6000) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w)
520   AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1)
517521ADDRESS_MAP_END
518522
519ADDRESS_MAP_START( seibu2_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
520   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
521   AM_RANGE(0x2000, 0x27ff) AM_WRITE(MWA8_RAM)
523
524ADDRESS_MAP_START( seibu2_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
525   AM_RANGE(0x0000, 0x1fff) AM_ROM
526   AM_RANGE(0x2000, 0x27ff) AM_RAM
522527   AM_RANGE(0x4000, 0x4000) AM_WRITE(seibu_pending_w)
523528   AM_RANGE(0x4001, 0x4001) AM_WRITE(seibu_irq_clear_w)
524529   AM_RANGE(0x4002, 0x4002) AM_WRITE(seibu_rst10_ack_w)
525530   AM_RANGE(0x4003, 0x4003) AM_WRITE(seibu_rst18_ack_w)
526531   AM_RANGE(0x4007, 0x4007) AM_WRITE(seibu_bank_w)
527532   AM_RANGE(0x4008, 0x4008) AM_WRITE(YM2151_register_port_0_w)
528   AM_RANGE(0x4009, 0x4009) AM_WRITE(YM2151_data_port_0_w)
529   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
530   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
531   AM_RANGE(0x6000, 0x6000) AM_WRITE(OKIM6295_data_0_w)
532   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
533ADDRESS_MAP_END
534
535ADDRESS_MAP_START( seibu3_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
536   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
537   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
538   AM_RANGE(0x4008, 0x4008) AM_READ(YM2203_status_port_0_r)
539   AM_RANGE(0x4009, 0x4009) AM_READ(YM2203_read_port_0_r)
533   AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
540534   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
541535   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
542536   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
543   AM_RANGE(0x6008, 0x6008) AM_READ(YM2203_status_port_1_r)
544   AM_RANGE(0x6009, 0x6009) AM_READ(YM2203_read_port_1_r)
545   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_BANK1)
537   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
538   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
539   AM_RANGE(0x6000, 0x6000) AM_READWRITE(OKIM6295_status_0_r, OKIM6295_data_0_w)
540   AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1)
546541ADDRESS_MAP_END
547542
548ADDRESS_MAP_START( seibu3_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
549   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
550   AM_RANGE(0x2000, 0x27ff) AM_WRITE(MWA8_RAM)
543
544
545ADDRESS_MAP_START( seibu3_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
546   AM_RANGE(0x0000, 0x1fff) AM_ROM
547   AM_RANGE(0x2000, 0x27ff) AM_RAM
551548   AM_RANGE(0x4000, 0x4000) AM_WRITE(seibu_pending_w)
552549   AM_RANGE(0x4001, 0x4001) AM_WRITE(seibu_irq_clear_w)
553550   AM_RANGE(0x4002, 0x4002) AM_WRITE(seibu_rst10_ack_w)
554551   AM_RANGE(0x4003, 0x4003) AM_WRITE(seibu_rst18_ack_w)
555552   AM_RANGE(0x4007, 0x4007) AM_WRITE(seibu_bank_w)
556   AM_RANGE(0x4008, 0x4008) AM_WRITE(YM2203_control_port_0_w)
557   AM_RANGE(0x4009, 0x4009) AM_WRITE(YM2203_write_port_0_w)
553   AM_RANGE(0x4008, 0x4008) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
554   AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
555   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
556   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
557   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
558558   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
559559   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
560   AM_RANGE(0x6008, 0x6008) AM_WRITE(YM2203_control_port_1_w)
561   AM_RANGE(0x6009, 0x6009) AM_WRITE(YM2203_write_port_1_w)
562   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
560   AM_RANGE(0x6008, 0x6008) AM_READWRITE(YM2203_status_port_1_r, YM2203_control_port_1_w)
561   AM_RANGE(0x6009, 0x6009) AM_READWRITE(YM2203_read_port_1_r, YM2203_write_port_1_w)
562   AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1)
563563ADDRESS_MAP_END
564564
565ADDRESS_MAP_START( seibu3_adpcm_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
566   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
567   AM_RANGE(0x2000, 0x27ff) AM_WRITE(MWA8_RAM)
565ADDRESS_MAP_START( seibu3_adpcm_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
566   AM_RANGE(0x0000, 0x1fff) AM_ROM
567   AM_RANGE(0x2000, 0x27ff) AM_RAM
568568   AM_RANGE(0x4000, 0x4000) AM_WRITE(seibu_pending_w)
569569   AM_RANGE(0x4001, 0x4001) AM_WRITE(seibu_irq_clear_w)
570570   AM_RANGE(0x4002, 0x4002) AM_WRITE(seibu_rst10_ack_w)
571571   AM_RANGE(0x4003, 0x4003) AM_WRITE(seibu_rst18_ack_w)
572572   AM_RANGE(0x4005, 0x4006) AM_WRITE(seibu_adpcm_adr_1_w)
573573   AM_RANGE(0x4007, 0x4007) AM_WRITE(seibu_bank_w)
574   AM_RANGE(0x4008, 0x4008) AM_WRITE(YM2203_control_port_0_w)
575   AM_RANGE(0x4009, 0x4009) AM_WRITE(YM2203_write_port_0_w)
574   AM_RANGE(0x4008, 0x4008) AM_READWRITE(YM2203_status_port_0_r, YM2203_control_port_0_w)
575   AM_RANGE(0x4009, 0x4009) AM_READWRITE(YM2203_read_port_0_r, YM2203_write_port_0_w)
576   AM_RANGE(0x4010, 0x4011) AM_READ(seibu_soundlatch_r)
577   AM_RANGE(0x4012, 0x4012) AM_READ(seibu_main_data_pending_r)
578   AM_RANGE(0x4013, 0x4013) AM_READ(input_port_0_r)
576579   AM_RANGE(0x4018, 0x4019) AM_WRITE(seibu_main_data_w)
577580   AM_RANGE(0x401a, 0x401a) AM_WRITE(seibu_adpcm_ctl_1_w)
578581   AM_RANGE(0x401b, 0x401b) AM_WRITE(seibu_coin_w)
579582   AM_RANGE(0x6005, 0x6006) AM_WRITE(seibu_adpcm_adr_2_w)
580   AM_RANGE(0x6008, 0x6008) AM_WRITE(YM2203_control_port_1_w)
581   AM_RANGE(0x6009, 0x6009) AM_WRITE(YM2203_write_port_1_w)
583   AM_RANGE(0x6008, 0x6008) AM_READWRITE(YM2203_status_port_1_r, YM2203_control_port_1_w)
584   AM_RANGE(0x6009, 0x6009) AM_READWRITE(YM2203_read_port_1_r, YM2203_write_port_1_w)
582585   AM_RANGE(0x601a, 0x601a) AM_WRITE(seibu_adpcm_ctl_2_w)
583   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
586   AM_RANGE(0x8000, 0xffff) AM_ROMBANK(1)
584587ADDRESS_MAP_END
585
src/mame/audio/seibu.h
r1527r1528
2929#include "sound/okim6295.h"
3030#include "sound/custom.h"
3131
32ADDRESS_MAP_EXTERN(seibu_sound_readmem);
33ADDRESS_MAP_EXTERN(seibu_sound_writemem);
34ADDRESS_MAP_EXTERN(seibu2_sound_readmem);
35ADDRESS_MAP_EXTERN(seibu2_sound_writemem);
36ADDRESS_MAP_EXTERN(seibu3_sound_readmem);
37ADDRESS_MAP_EXTERN(seibu3_sound_writemem);
38ADDRESS_MAP_EXTERN(seibu3_adpcm_sound_writemem);
32ADDRESS_MAP_EXTERN(seibu_sound_map);
33ADDRESS_MAP_EXTERN(seibu2_sound_map);
34ADDRESS_MAP_EXTERN(seibu3_sound_map);
35ADDRESS_MAP_EXTERN(seibu3_adpcm_sound_map);
3936
4037READ16_HANDLER( seibu_main_word_r );
4138READ8_HANDLER( seibu_main_v30_r );
r1527r1528
5956MACHINE_RESET( seibu_sound_2 );
6057void seibu_sound_decrypt(int cpu_region,int length);
6158
62void *seibu_adpcm_start(int clock, const struct CustomSound_interface *config);
63void seibu_adpcm_stop(void *token);
6459void seibu_adpcm_decrypt(int region);
6560WRITE8_HANDLER( seibu_adpcm_adr_1_w );
6661WRITE8_HANDLER( seibu_adpcm_ctl_1_w );
6762WRITE8_HANDLER( seibu_adpcm_adr_2_w );
6863WRITE8_HANDLER( seibu_adpcm_ctl_2_w );
6964
65extern const struct YM3812interface seibu_ym3812_interface;
66extern const struct CustomSound_interface seibu_adpcm_interface;
67extern const struct YM2151interface seibu_ym2151_interface;
68extern const struct YM2203interface seibu_ym2203_interface;
69
7070/**************************************************************************/
7171
7272#define SEIBU_COIN_INPUTS                                 \
r1527r1528
7474   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(4)         \
7575   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(4)
7676
77#define SEIBU_SOUND_SYSTEM_YM3812_HARDWARE                     \
78                                                   \
79static const struct YM3812interface ym3812_interface =            \
80{                                                   \
81   seibu_ym3812_irqhandler                                 \
82};
8377
84#define SEIBU_SOUND_SYSTEM_ADPCM_HARDWARE                     \
85                                                   \
86static const struct CustomSound_interface adpcm_interface =         \
87{                                                   \
88   seibu_adpcm_start,                                    \
89   seibu_adpcm_stop                                    \
90};
91
92#define SEIBU_SOUND_SYSTEM_YM2151_HARDWARE                     \
93                                                   \
94static const struct YM2151interface ym2151_interface =            \
95{                                                   \
96   seibu_ym2151_irqhandler                                 \
97};
98
99#define SEIBU_SOUND_SYSTEM_YM2203_HARDWARE                     \
100                                                   \
101static const struct YM2203interface ym2203_interface =            \
102{                                                   \
103   0,0,0,0,seibu_ym2203_irqhandler                           \
104};
105
10678#define SEIBU_SOUND_SYSTEM_CPU(freq)                        \
10779   MDRV_CPU_ADD(Z80, freq)                                 \
108   /* audio CPU */                           \
109   MDRV_CPU_PROGRAM_MAP(seibu_sound_readmem,seibu_sound_writemem)      \
80   MDRV_CPU_PROGRAM_MAP(seibu_sound_map,0)                     \
11081
11182#define SEIBU2_SOUND_SYSTEM_CPU(freq)                        \
11283   MDRV_CPU_ADD(Z80, freq)                                 \
113   /* audio CPU */                           \
114   MDRV_CPU_PROGRAM_MAP(seibu2_sound_readmem,seibu2_sound_writemem)      \
84   MDRV_CPU_PROGRAM_MAP(seibu2_sound_map,0)                  \
11585
11686#define SEIBU3_SOUND_SYSTEM_CPU(freq)                        \
11787   MDRV_CPU_ADD(Z80, freq)                                 \
118   /* audio CPU */                           \
119   MDRV_CPU_PROGRAM_MAP(seibu3_sound_readmem,seibu3_sound_writemem)      \
88   MDRV_CPU_PROGRAM_MAP(seibu3_sound_map,0)                  \
12089
12190#define SEIBU3A_SOUND_SYSTEM_CPU(freq)                        \
12291   MDRV_CPU_ADD(Z80, freq)                                 \
123   /* audio CPU */                           \
124   MDRV_CPU_PROGRAM_MAP(seibu3_sound_readmem,seibu3_adpcm_sound_writemem)      \
92   MDRV_CPU_PROGRAM_MAP(seibu3_adpcm_sound_map,0)               \
12593
12694#define SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(freq1,freq2,region)      \
12795   MDRV_SPEAKER_STANDARD_MONO("mono")                        \
12896                                                   \
12997   MDRV_SOUND_ADD(YM3812, freq1)                           \
130   MDRV_SOUND_CONFIG(ym3812_interface)                        \
98   MDRV_SOUND_CONFIG(seibu_ym3812_interface)                  \
13199   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)                  \
132100                                                   \
133101   MDRV_SOUND_ADD(OKIM6295, freq2)                           \
r1527r1528
138106   MDRV_SPEAKER_STANDARD_MONO("mono")                        \
139107                                                   \
140108   MDRV_SOUND_ADD(YM3812, freq1)                           \
141   MDRV_SOUND_CONFIG(ym3812_interface)                        \
109   MDRV_SOUND_CONFIG(seibu_ym3812_interface)                  \
142110   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)                  \
143111                                                   \
144112   MDRV_SOUND_ADD(OKIM6295, freq2)                           \
145   MDRV_SOUND_CONFIG(okim6295_interface_region_##region##_pin7high)   \
113   MDRV_SOUND_CONFIG(okim6295_interface_region_##region##_pin7high)\
146114   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)                  \
147115
148116#define SEIBU_SOUND_SYSTEM_YM2151_INTERFACE(freq1,freq2,region)      \
149117   MDRV_SPEAKER_STANDARD_MONO("mono")                        \
150118                                                   \
151119   MDRV_SOUND_ADD(YM2151, freq1)                           \
152   MDRV_SOUND_CONFIG(ym2151_interface)                        \
120   MDRV_SOUND_CONFIG(seibu_ym2151_interface)                  \
153121   MDRV_SOUND_ROUTE(0, "mono", 0.50)                        \
154122   MDRV_SOUND_ROUTE(1, "mono", 0.50)                        \
155123                                                   \
r1527r1528
161129   MDRV_SPEAKER_STANDARD_MONO("mono")                        \
162130                                                   \
163131   MDRV_SOUND_ADD(YM2203, freq)                           \
164   MDRV_SOUND_CONFIG(ym2203_interface)                        \
132   MDRV_SOUND_CONFIG(seibu_ym2203_interface)                  \
165133   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)                  \
166134                                                   \
167135   MDRV_SOUND_ADD(YM2203, freq)                           \
r1527r1528
169137
170138#define SEIBU_SOUND_SYSTEM_ADPCM_INTERFACE                     \
171139   MDRV_SOUND_ADD(CUSTOM, 8000)                            \
172   MDRV_SOUND_CONFIG(adpcm_interface)                        \
140   MDRV_SOUND_CONFIG(seibu_adpcm_interface)                  \
173141   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)                \
174142                                                   \
175143   MDRV_SOUND_ADD(CUSTOM, 8000)                            \
176   MDRV_SOUND_CONFIG(adpcm_interface)                        \
144   MDRV_SOUND_CONFIG(seibu_adpcm_interface)                  \
177145   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)                  \
178146
179147
src/mame/audio/segag80r.c
r1527r1528
821821MACHINE_DRIVER_START( monsterb_sound_board )
822822
823823   /* basic machine hardware */
824   MDRV_CPU_ADD(N7751, 6000000/15)
824   MDRV_CPU_ADD(N7751, 6000000)
825825   MDRV_CPU_PROGRAM_MAP(monsterb_7751_map,0)
826826   MDRV_CPU_IO_MAP(monsterb_7751_portmap,0)
827827
src/mame/audio/williams.c
r1527r1528
189189****************************************************************************/
190190
191191MACHINE_DRIVER_START( williams_cvsd_sound )
192   MDRV_CPU_ADD_TAG("cvsd", M6809E, CVSD_MASTER_CLOCK/4)
192   MDRV_CPU_ADD_TAG("cvsd", M6809E, CVSD_MASTER_CLOCK)
193193   MDRV_CPU_PROGRAM_MAP(williams_cvsd_map,0)
194194
195195   MDRV_SPEAKER_STANDARD_MONO("mono")
r1527r1528
207207
208208
209209MACHINE_DRIVER_START( williams_narc_sound )
210   MDRV_CPU_ADD_TAG("narc1", M6809E, NARC_MASTER_CLOCK/4)
210   MDRV_CPU_ADD_TAG("narc1", M6809E, NARC_MASTER_CLOCK)
211211   MDRV_CPU_PROGRAM_MAP(williams_narc_master_map,0)
212212
213   MDRV_CPU_ADD_TAG("narc2", M6809E, NARC_MASTER_CLOCK/4)
213   MDRV_CPU_ADD_TAG("narc2", M6809E, NARC_MASTER_CLOCK)
214214   MDRV_CPU_PROGRAM_MAP(williams_narc_slave_map,0)
215215
216216   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
r1527r1528
235235
236236
237237MACHINE_DRIVER_START( williams_adpcm_sound )
238   MDRV_CPU_ADD_TAG("adpcm", M6809E, ADPCM_MASTER_CLOCK/4)
238   MDRV_CPU_ADD_TAG("adpcm", M6809E, ADPCM_MASTER_CLOCK)
239239   MDRV_CPU_PROGRAM_MAP(williams_adpcm_map,0)
240240
241241   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/audio/scramble.c
r1527r1528
370370
371371static WRITE8_HANDLER( ad2083_tms5110_ctrl_w )
372372{
373   int tbl[8] = {0,4,2,6,1,5,3,7};
373   static const int tbl[8] = {0,4,2,6,1,5,3,7};
374374
375375   speech_rom_bit = tbl[data & 0x07];
376376   switch (data>>3)
src/mame/audio/mario.c
r1527r1528
1212 *
1313 ****************************************************************/
1414
15#define USE_8039   (0)         /* set to 1 to try 8039 hack */
16
1517#define ACTIVELOW_PORT_BIT(P,A,D)   ((P & (~(1 << A))) | ((D ^ 1) << A))
1618#define ACTIVEHIGH_PORT_BIT(P,A,D)   ((P & (~(1 << A))) | (D << A))
1719
r1527r1528
216218     * Just a 1:n amplifier without filters and no output capacitor
217219     */
218220   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0 * 3 )
219   DISCRETE_WAVELOG2(DS_SOUND7_INV, 32767/5, NODE_110, 32767/5)
220221
221222DISCRETE_SOUND_END
222223
r1527r1528
229230static SOUND_START( mario )
230231{
231232   mario_state   *state = machine->driver_data;
233#if USE_8039
234   UINT8 *SND = memory_region(REGION_CPU2);
232235
236   SND[1] = 0x01;
237#endif
238
233239   state_save_register_global(state->last);
234240   state_save_register_global(state->portT);
235   soundlatch_clear_w(0,0);
236   soundlatch2_clear_w(0,0);
237   soundlatch3_clear_w(0,0);
238   soundlatch4_clear_w(0,0);
239   /*
240     * The code below will play the correct start up sound
241     * However, it is not backed by hardware at all.
242     */
243   //soundlatch_w(0,2);
244241}
245242
246243static SOUND_RESET( mario )
247244{
248245   mario_state   *state = machine->driver_data;
249246
247   soundlatch_clear_w(0,0);
248   soundlatch2_clear_w(0,0);
249   soundlatch3_clear_w(0,0);
250   soundlatch4_clear_w(0,0);
251   I8035_P1_W(0x00); /* Input port */
252   I8035_P2_W(0xff); /* Port is in high impedance state after reset */
253
250254   state->last = 0;
251255}
252256
r1527r1528
263267
264268static READ8_HANDLER( mario_sh_p2_r )
265269{
266   return I8035_P2_R() & 0xE0; /* Bit 4 connected to GND! */
270   return I8035_P2_R() & 0xEF; /* Bit 4 connected to GND! */
267271}
268272
269273static READ8_HANDLER( mario_sh_t0_r )
r1527r1528
276280   return I8035_T_R(1);
277281}
278282
283static READ8_HANDLER( mario_sh_ea_r )
284{
285#if USE_8039
286   return 1;
287#else
288   int p2 = (I8035_P2_R() >> 5) & 1;
289   return p2 ^ 1;
290#endif
291}
292
279293static READ8_HANDLER( mario_sh_tune_r )
280294{
281295   UINT8 *SND = memory_region(REGION_CPU2);
r1527r1528
392406   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(mario_sh_p2_r, mario_sh_p2_w)
393407   AM_RANGE(I8039_t0, I8039_t0) AM_READ(mario_sh_t0_r)
394408   AM_RANGE(I8039_t1, I8039_t1) AM_READ(mario_sh_t1_r)
409   AM_RANGE(I8039_ea, I8039_ea) AM_READ(mario_sh_ea_r)   /* only for documentation purposes right now */
395410ADDRESS_MAP_END
396411
397412static ADDRESS_MAP_START( masao_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
r1527r1528
421436
422437MACHINE_DRIVER_START( mario_audio )
423438
439#if USE_8039
424440   MDRV_CPU_ADD(I8039, I8035_CLOCK)  /* audio CPU */         /* 730 kHz */
441#else
442   MDRV_CPU_ADD(M58715, I8035_CLOCK)  /* audio CPU */         /* 730 kHz */
443#endif
425444   MDRV_CPU_PROGRAM_MAP(mario_sound_map, 0)
426445   MDRV_CPU_IO_MAP(mario_sound_io_map, 0)
427446
src/mame/audio/dcs.c
r1527r1528
19561956   /* calculate how long until we generate an interrupt */
19571957
19581958   /* frequency the time per each bit sent */
1959   attotime sample_period = attotime_mul(ATTOTIME_IN_HZ(Machine->drv->cpu[dcs.cpunum].clock), 2 * (dcs.control_regs[S1_SCLKDIV_REG] + 1));
1959   attotime sample_period = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(dcs.cpunum)), 2 * (dcs.control_regs[S1_SCLKDIV_REG] + 1));
19601960
19611961   /* now put it down to samples, so we know what the channel frequency has to be */
19621962   sample_period = attotime_mul(sample_period, 16 * dcs.channels);
src/mame/audio/polepos.c
r1527r1528
6363   }
6464
6565   /* determine the effective clock rate */
66   clock = (Machine->drv->cpu[0].clock / 16) * ((sample_msb + 1) * 64 + sample_lsb + 1) / (64*64);
66   clock = (cpunum_get_clock(0) / 16) * ((sample_msb + 1) * 64 + sample_lsb + 1) / (64*64);
6767   step = (clock << 12) / OUTPUT_RATE;
6868
6969   /* determine the volume */
src/mame/audio/exidy.c
r1527r1528
55*************************************************************************/
66
77#include "driver.h"
8#include "rescap.h"
89#include "streams.h"
910#include "cpu/m6502/m6502.h"
1011#include "machine/6821pia.h"
1112#include "sound/hc55516.h"
1213#include "sound/5220intf.h"
13#include "sound/discrete.h"
14#include "exidy.h"
14#include "sound/s14001a.h"
15#include "sound/custom.h"
16#include "berzerk.h"
1517
1618
1719
r1527r1528
2123 *
2224 *************************************/
2325
24#define CRYSTAL_OSC         (3579545)
25#define SH8253_CLOCK      (CRYSTAL_OSC/2)
26#define SH6840_CLOCK      (CRYSTAL_OSC/4)
27#define SH6532_CLOCK      (CRYSTAL_OSC/4)
28#define CVSD_CLOCK_FREQ    (1.0 / (0.693 * (RES_K(2.4) + 2.0 * RES_K(20)) * CAP_P(2200)))
29#define BASE_VOLUME         (32767 / 6)
26#define CRYSTAL_OSC            (XTAL_3_579545MHz)
27#define SH8253_CLOCK         (CRYSTAL_OSC/2)
28#define SH6840_CLOCK         (CRYSTAL_OSC/4)
29#define SH6532_CLOCK         (CRYSTAL_OSC/4)
30#define CVSD_CLOCK_FREQ       (1.0 / (0.693 * (RES_K(2.4) + 2.0 * RES_K(20)) * CAP_P(2200)))
31#define BASE_VOLUME            (32767 / 6)
3032
3133enum
3234{
r1527r1528
4345 *
4446 *************************************/
4547
46/* IRQ variables */
47static UINT8 pia_irq_state;
48/* IRQ variable */
4849static UINT8 riot_irq_state;
4950
5051/* 6532 variables */
r1527r1528
8788static UINT32 sh6840_LFSR_3 = 0xffffffff;/* ditto */
8889static UINT32 sh6840_clocks_per_sample;
8990static UINT32 sh6840_clock_count;
91
9092static UINT8 exidy_sfxctrl;
9193
9294/* 8253 variables */
r1527r1528
113115
114116/*************************************
115117 *
116 *  PIA interface
118 *  Interrupt generation helper
117119 *
118120 *************************************/
119121
120static void exidy_irq(int state);
121
122WRITE8_HANDLER(victory_sound_response_w);
123WRITE8_HANDLER(victory_sound_irq_clear_w);
124WRITE8_HANDLER(victory_main_ack_w);
125
126/* PIA 0 */
127static const pia6821_interface pia_0_intf =
122static void update_irq_state(/* unused */ int state)
128123{
129   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
130   /*outputs: A/B,CA/B2       */ pia_1_portb_w, pia_1_porta_w, pia_1_cb1_w, pia_1_ca1_w,
131   /*irqs   : A/B             */ 0, 0
132};
133
134/* PIA 1 */
135static const pia6821_interface pia_1_intf =
136{
137   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
138   /*outputs: A/B,CA/B2       */ pia_0_portb_w, pia_0_porta_w, pia_0_cb1_w, pia_0_ca1_w,
139   /*irqs   : A/B             */ 0, exidy_irq
140};
141
142/* Victory PIA 0 */
143static const pia6821_interface victory_pia_0_intf =
144{
145   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
146   /*outputs: A/B,CA/B2       */ 0, victory_sound_response_w, victory_sound_irq_clear_w, victory_main_ack_w,
147   /*irqs   : A/B             */ 0, exidy_irq
148};
149
150
151
152/*************************************
153 *
154 *  Interrupt generation helpers
155 *
156 *************************************/
157
158INLINE void update_irq_state(void)
159{
160   cpunum_set_input_line(1, M6502_IRQ_LINE, (pia_irq_state | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
124   cpunum_set_input_line(1, M6502_IRQ_LINE, (pia_get_irq_b(1) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
161125}
162126
163127
164static void exidy_irq(int state)
165{
166   pia_irq_state = state;
167   update_irq_state();
168}
169128
170
171
172129/*************************************
173130 *
174131 *  6840 clock counting helper
r1527r1528
390347
391348static TIMER_CALLBACK( riot_interrupt );
392349
393static void *common_start(void)
350static void *common_sh_start(int _has_sh8253, int _has_tms5220)
394351{
395352   int sample_rate = SH8253_CLOCK;
396353   int i;
397354
355   has_sh8253  = _has_sh8253;
356   has_tms5220 = _has_tms5220;
357
398358   /* determine which sound hardware is installed */
399359   has_hc55516 = FALSE;
400   has_tms5220 = FALSE;
401360   for (i = 0; i < MAX_SOUND; i++)
402361   {
403      if (Machine->drv->sound[i].type == SOUND_TMS5220)
404         has_tms5220 = TRUE;
405362      if (Machine->drv->sound[i].type == SOUND_HC55516)
406363         has_hc55516 = TRUE;
407364   }
r1527r1528
409366   /* allocate the stream */
410367   exidy_stream = stream_create(0, 1, sample_rate, NULL, exidy_stream_update);
411368
412   /* Init PIA */
369   /* 6532 */
370    riot_timer = timer_alloc(riot_interrupt, NULL);
371
372   /* 6840 */
373   sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24));
374
375   /* 8253 */
376   freq_to_step = (double)(1 << 24) / (double)sample_rate;
377
378   return auto_malloc(1);
379}
380
381
382
383/*************************************
384 *
385 *  Sound reset routines
386 *
387 *************************************/
388
389static void common_sh_reset(void)
390{
391   /* PIA */
413392   pia_reset();
414393
415   /* Init LFSR */
394   /* LFSR */
416395   sh6840_LFSR_oldxor = 0;
417396   sh6840_LFSR_0 = 0xffffffff;
418397   sh6840_LFSR_1 = 0xffffffff;
419398   sh6840_LFSR_2 = 0xffffffff;
420399   sh6840_LFSR_3 = 0xffffffff;
421400
422   /* Init 6532 */
423    riot_timer = timer_alloc(riot_interrupt, NULL);
424    riot_irq_flag = 0;
425    riot_timer_irq_enable = 0;
401   /* 6532 */
402   riot_irq_flag = 0;
403   riot_timer_irq_enable = 0;
426404   riot_porta_data = 0xff;
427405   riot_portb_data = 0xff;
428    riot_clock_divisor = 1;
429    riot_state = RIOT_IDLE;
406   riot_clock_divisor = 1;
407   riot_state = RIOT_IDLE;
430408
431   /* Init 6840 */
409   /* 6840 */
432410   memset(sh6840_timer, 0, sizeof(sh6840_timer));
433   sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24));
434411   sh6840_MSB = 0;
435412   sh6840_volume[0] = 0;
436413   sh6840_volume[1] = 0;
437414   sh6840_volume[2] = 0;
438415   exidy_sfxctrl = 0;
439416
440   /* Init 8253 */
417   /* 8253 */
441418   memset(sh8253_timer, 0, sizeof(sh8253_timer));
442   freq_to_step = (double)(1 << 24) / (double)sample_rate;
443
444   return auto_malloc(1);
445419}
446420
447421
448void *exidy_sh_start(int clock, const struct CustomSound_interface *config)
449{
450   /* Init PIA */
451   pia_config(0, &pia_0_intf);
452   pia_config(1, &pia_1_intf);
453   has_sh8253 = TRUE;
454   return common_start();
455}
456422
457
458void *victory_sh_start(int clock, const struct CustomSound_interface *config)
459{
460   /* Init PIA */
461   pia_config(0, &victory_pia_0_intf);
462   pia_0_cb1_w(0, 1);
463   has_sh8253 = TRUE;
464   return common_start();
465}
466
467
468void *berzerk_sh_start(int clock, const struct CustomSound_interface *config)
469{
470   has_sh8253 = FALSE;
471   return common_start();
472}
473
474
475
476423/*************************************
477424 *
478425 *  6532 RIOT timer callback
r1527r1528
487434      /* generate the IRQ */
488435      riot_irq_flag |= 0x80;
489436      riot_irq_state = riot_timer_irq_enable;
490      update_irq_state();
437      update_irq_state(0);
491438
492439      /* now start counting clock cycles down */
493440      riot_state = RIOT_POST_COUNT;
r1527r1528
510457 *
511458 *************************************/
512459
513WRITE8_HANDLER( exidy_shriot_w )
460static WRITE8_HANDLER( exidy_shriot_w )
514461{
515   /* mask to the low 7 bits */
516   offset &= 0x7f;
517
518462   /* I/O is done if A2 == 0 */
519463   if ((offset & 0x04) == 0)
520464   {
r1527r1528
568512      if (riot_state != RIOT_COUNT)
569513         riot_irq_flag &= ~0x80;
570514      riot_irq_state = 0;
571      update_irq_state();
515      update_irq_state(0);
572516
573517      /* set the enable from the offset */
574      riot_timer_irq_enable = offset & 0x08;
518      riot_timer_irq_enable = (offset & 0x08) ? 1 : 0;
575519
576520      /* set a new timer */
577521      riot_clock_divisor = divisors[offset & 0x03];
r1527r1528
588532 *
589533 *************************************/
590534
591READ8_HANDLER( exidy_shriot_r )
535static READ8_HANDLER( exidy_shriot_r )
592536{
593   /* mask to the low 7 bits */
594   offset &= 0x7f;
595
596537   /* I/O is done if A2 == 0 */
597538   if ((offset & 0x04) == 0)
598539   {
r1527r1528
624565      int temp = riot_irq_flag;
625566      riot_irq_flag = 0;
626567      riot_irq_state = 0;
627      update_irq_state();
568      update_irq_state(0);
628569      return temp;
629570   }
630571
r1527r1528
660601 *
661602 *************************************/
662603
663WRITE8_HANDLER( exidy_sh8253_w )
604static WRITE8_HANDLER( exidy_sh8253_w )
664605{
665606   int chan;
666607
667608   stream_update(exidy_stream);
668609
669   offset &= 3;
670610   switch (offset)
671611   {
672612      case 0:
r1527r1528
697637}
698638
699639
700READ8_HANDLER( exidy_sh8253_r )
640static READ8_HANDLER( exidy_sh8253_r )
701641{
702    logerror("8253(R): %x\n",offset);
642   logerror("8253(R): %x\n",offset);
643
703644   return 0;
704645}
705646
r1527r1528
711652 *
712653 *************************************/
713654
714READ8_HANDLER( exidy_sh6840_r )
655static READ8_HANDLER( exidy_sh6840_r )
715656{
716657   fatalerror("exidy_sh6840_r - unexpected read");
717    return 0;
658
659   return 0;
718660}
719661
720662
721WRITE8_HANDLER( exidy_sh6840_w )
663static WRITE8_HANDLER( exidy_sh6840_w )
722664{
723665   /* force an update of the stream */
724666   stream_update(exidy_stream);
725667
726   /* only look at the low 3 bits */
727   offset &= 7;
728668   switch (offset)
729669   {
730670      /* offset 0 writes to either channel 0 control or channel 2 control */
r1527r1528
780720 *
781721 *************************************/
782722
783WRITE8_HANDLER( exidy_sfxctrl_w )
723static WRITE8_HANDLER( exidy_sfxctrl_w )
784724{
785725   stream_update(exidy_stream);
786726
787   offset &= 3;
788727   switch (offset)
789728   {
790729      case 0:
r1527r1528
816755
817756/*************************************
818757 *
758 *  Venture, etc.
759 *
760 *************************************/
761
762static const pia6821_interface venture_pia_0_intf =
763{
764   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
765   /*outputs: A/B,CA/B2       */ pia_1_portb_w, pia_1_porta_w, pia_1_cb1_w, pia_1_ca1_w,
766   /*irqs   : A/B             */ 0, 0
767};
768
769
770static const pia6821_interface venture_pia_1_intf =
771{
772   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
773   /*outputs: A/B,CA/B2       */ pia_0_portb_w, pia_0_porta_w, pia_0_cb1_w, pia_0_ca1_w,
774   /*irqs   : A/B             */ 0, update_irq_state
775};
776
777
778static void *venture_sh_start(int clock, const struct CustomSound_interface *config)
779{
780   pia_config(0, &venture_pia_0_intf);
781   pia_config(1, &venture_pia_1_intf);
782
783   return common_sh_start(TRUE, FALSE);
784}
785
786
787static void venture_sh_reset(void *token)
788{
789   common_sh_reset();
790}
791
792
793static const struct CustomSound_interface venture_custom_interface =
794{
795   venture_sh_start,
796   0,
797   venture_sh_reset
798};
799
800
801static ADDRESS_MAP_START( venture_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
802   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )
803   AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0780) AM_RAM
804   AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0780) AM_READWRITE(exidy_shriot_r, exidy_shriot_w)
805   AM_RANGE(0x1000, 0x1003) AM_MIRROR(0x07fc) AM_READWRITE(pia_1_r, pia_1_w)
806   AM_RANGE(0x1800, 0x1803) AM_MIRROR(0x07fc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
807   AM_RANGE(0x2000, 0x27ff) AM_WRITE(exidy_sound_filter_w)
808   AM_RANGE(0x2800, 0x2807) AM_MIRROR(0x07f8) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w)
809   AM_RANGE(0x3000, 0x3003) AM_MIRROR(0x07fc) AM_WRITE(exidy_sfxctrl_w)
810   AM_RANGE(0x5800, 0x7fff) AM_ROM
811ADDRESS_MAP_END
812
813
814MACHINE_DRIVER_START( venture_audio )
815
816   MDRV_CPU_ADD(M6502, 3579545/4)
817   MDRV_CPU_PROGRAM_MAP(venture_audio_map,0)
818
819   MDRV_SPEAKER_STANDARD_MONO("mono")
820
821   MDRV_SOUND_ADD(CUSTOM, 0)
822   MDRV_SOUND_CONFIG(venture_custom_interface)
823   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
824MACHINE_DRIVER_END
825
826
827
828/*************************************
829 *
819830 *  CVSD sound for Mouse Trap
820831 *
821832 *************************************/
822833
823WRITE8_HANDLER( mtrap_voiceio_w )
834static WRITE8_HANDLER( mtrap_voiceio_w )
824835{
825    if (!(offset & 0x10))
826    {
827       hc55516_digit_clock_clear_w(0,data);
828       hc55516_clock_set_w(0,data);
836   if (!(offset & 0x10))
837   {
838      hc55516_digit_clock_clear_w(0,data);
839      hc55516_clock_set_w(0,data);
829840   }
830    if (!(offset & 0x20))
841
842   if (!(offset & 0x20))
831843      riot_portb_data = data & 1;
832844}
833845
834846
835READ8_HANDLER( mtrap_voiceio_r )
847static READ8_HANDLER( mtrap_voiceio_r )
836848{
837849   if (!(offset & 0x80))
838850   {
839       int data = (riot_porta_data & 0x06) >> 1;
840       data |= (riot_porta_data & 0x01) << 2;
841       data |= (riot_porta_data & 0x08);
842       return data;
851      int data = (riot_porta_data & 0x06) >> 1;
852      data |= (riot_porta_data & 0x01) << 2;
853      data |= (riot_porta_data & 0x08);
854
855      return data;
843856   }
844    if (!(offset & 0x40))
845    {
846       attotime curtime = timer_get_time();
847       int clock_pulse = curtime.attoseconds / HZ_TO_ATTOSECONDS(2 * CVSD_CLOCK_FREQ);
848       return (clock_pulse & 1) << 7;
857
858   if (!(offset & 0x40))
859   {
860      attotime curtime = timer_get_time();
861      int clock_pulse = curtime.attoseconds / HZ_TO_ATTOSECONDS(2 * CVSD_CLOCK_FREQ);
862
863      return (clock_pulse & 1) << 7;
849864   }
850865   return 0;
851866}
867
868
869static ADDRESS_MAP_START( cvsd_map, ADDRESS_SPACE_PROGRAM, 8 )
870   ADDRESS_MAP_FLAGS( AMEF_ABITS(14) )
871   AM_RANGE(0x0000, 0x3fff) AM_ROM
872ADDRESS_MAP_END
873
874
875static ADDRESS_MAP_START( cvsd_iomap, ADDRESS_SPACE_IO, 8 )
876   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
877   AM_RANGE(0x00, 0xff) AM_READWRITE(mtrap_voiceio_r, mtrap_voiceio_w)
878ADDRESS_MAP_END
879
880
881MACHINE_DRIVER_START( mtrap_cvsd_audio )
882
883   MDRV_CPU_ADD(Z80, 3579545/2)
884   MDRV_CPU_PROGRAM_MAP(cvsd_map,0)
885   MDRV_CPU_IO_MAP(cvsd_iomap,0)
886
887   /* audio hardware */
888   MDRV_SOUND_ADD(HC55516, 0)
889   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
890MACHINE_DRIVER_END
891
892
893
894/*************************************
895 *
896 *  Victory
897 *
898 *************************************/
899
900#define VICTORY_AUDIO_CPU_CLOCK      (XTAL_3_579545MHz / 4)
901#define VICTORY_LOG_SOUND         0
902
903
904static UINT8 victory_sound_response_ack_clk;   /* 7474 @ F4 */
905
906
907READ8_HANDLER( victory_sound_response_r )
908{
909   UINT8 ret = pia_get_output_b(1);
910
911   if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", activecpu_get_previouspc(), ret);
912
913   pia_set_input_cb1(1, 0);
914
915   return ret;
916}
917
918
919READ8_HANDLER( victory_sound_status_r )
920{
921   UINT8 ret = (pia_get_input_ca1(1) << 7) | (pia_get_input_cb1(1) << 6);
922
923   if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", activecpu_get_previouspc(), ret);
924
925   return ret;
926}
927
928
929static TIMER_CALLBACK( delayed_command_w )
930{
931   pia_set_input_a(1, param, 0);
932   pia_set_input_ca1(1, 0);
933}
934
935WRITE8_HANDLER( victory_sound_command_w )
936{
937   if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", activecpu_get_previouspc(), data);
938
939   timer_call_after_resynch(NULL, data, delayed_command_w);
940}
941
942
943static WRITE8_HANDLER( victory_sound_irq_clear_w )
944{
945   if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound IRQ clear = %02X\n", activecpu_get_previouspc(), data);
946
947   if (!data) pia_set_input_ca1(1, 1);
948}
949
950
951static WRITE8_HANDLER( victory_main_ack_w )
952{
953   if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound Main ACK W = %02X\n", activecpu_get_previouspc(), data);
954
955   if (victory_sound_response_ack_clk && !data)
956      pia_set_input_cb1(1, 1);
957
958   victory_sound_response_ack_clk = data;
959}
960
961
962static const pia6821_interface victory_pia_e5_intf =
963{
964   /*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0,
965   /*outputs: A/B,CA/B2       */ 0, 0, victory_sound_irq_clear_w, victory_main_ack_w,
966   /*irqs   : A/B             */ 0, update_irq_state
967};
968
969
970static void *victory_sh_start(int clock, const struct CustomSound_interface *config)
971{
972   pia_config(1, &victory_pia_e5_intf);
973
974   state_save_register_global(victory_sound_response_ack_clk);
975
976   return common_sh_start(TRUE, TRUE);
977}
978
979
980static void victory_sh_reset(void *token)
981{
982   common_sh_reset();
983
984   /* the flip-flop @ F4 is reset */
985   victory_sound_response_ack_clk = 0;
986   pia_set_input_cb1(1, 1);
987
988   /* these two lines shouldn't be needed, but it avoids the log entry
989       as the sound CPU checks port A before the main CPU ever writes to it */
990   pia_set_input_a(1, 0, 0);
991   pia_set_input_ca1(1, 1);
992}
993
994
995static const struct CustomSound_interface victory_custom_interface =
996{
997   victory_sh_start,
998   0,
999   victory_sh_reset,
1000};
1001
1002
1003static ADDRESS_MAP_START( victory_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
1004   AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0f00) AM_RAM
1005   AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_READWRITE(exidy_shriot_r, exidy_shriot_w)
1006   AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x0ffc) AM_READWRITE(pia_1_r, pia_1_w)
1007   AM_RANGE(0x3000, 0x3003) AM_MIRROR(0x0ffc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
1008   AM_RANGE(0x4000, 0x4fff) AM_NOP
1009   AM_RANGE(0x5000, 0x5007) AM_MIRROR(0x0ff8) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w)
1010   AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x0ffc) AM_WRITE(exidy_sfxctrl_w)
1011   AM_RANGE(0x7000, 0xafff) AM_NOP
1012   AM_RANGE(0xb000, 0xffff) AM_ROM
1013ADDRESS_MAP_END
1014
1015
1016MACHINE_DRIVER_START( victory_audio )
1017
1018   MDRV_CPU_ADD(M6502, VICTORY_AUDIO_CPU_CLOCK)
1019   MDRV_CPU_PROGRAM_MAP(victory_audio_map,0)
1020
1021   MDRV_SPEAKER_STANDARD_MONO("mono")
1022
1023   MDRV_SOUND_ADD(CUSTOM, 0)
1024   MDRV_SOUND_CONFIG(victory_custom_interface)
1025   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1026
1027   MDRV_SOUND_ADD(TMS5220, 640000)
1028   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1029MACHINE_DRIVER_END
1030
1031
1032
1033/*************************************
1034 *
1035 *  Berzerk
1036 *
1037 *  Copyright Alex Judd 1997/98
1038 *  V1.1 for Mame 0.31 13March98
1039 *
1040 *************************************/
1041
1042#define BERZERK_S14001A_CLOCK   (BERZERK_MASTER_CLOCK / 2)
1043
1044
1045static void *berzerk_sh_start(int clock, const struct CustomSound_interface *config)
1046{
1047   return common_sh_start(FALSE, FALSE);
1048}
1049
1050
1051static void berzerk_sh_reset(void *token)
1052{
1053   common_sh_reset();
1054}
1055
1056
1057static const struct S14001A_interface berzerk_s14001a_interface =
1058{
1059   REGION_SOUND1   /* voice data region */
1060};
1061
1062
1063static const struct CustomSound_interface berzerk_custom_interface =
1064{
1065   berzerk_sh_start,
1066   0,
1067   berzerk_sh_reset,
1068};
1069
1070
1071MACHINE_DRIVER_START( berzerk_audio )
1072
1073   MDRV_SPEAKER_STANDARD_MONO("mono")
1074
1075   MDRV_SOUND_ADD(S14001A, BERZERK_S14001A_CLOCK)   /* CPU clock divided by 16 divided by a programmable TTL setup */
1076   MDRV_SOUND_CONFIG(berzerk_s14001a_interface)
1077   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1078
1079   MDRV_SOUND_ADD(CUSTOM, 0)
1080   MDRV_SOUND_CONFIG(berzerk_custom_interface)
1081   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1082MACHINE_DRIVER_END
1083
1084
1085WRITE8_HANDLER( berzerk_audio_w )
1086{
1087   switch (offset)
1088   {
1089   /* offsets 0-3, 5 and 7 write to the 6840 */
1090   case 0:
1091   case 1:
1092   case 2:
1093   case 3:
1094   case 5:
1095   case 7:
1096      exidy_sh6840_w(offset, data);
1097      break;
1098
1099   /* offset 6 writes to the sfxcontrol latch */
1100   case 6:
1101      exidy_sfxctrl_w(data >> 6, data);
1102      break;
1103
1104   /* offset 4 writes to the S14001A */
1105   case 4:
1106      if ((data & 0xc0) == 0x40) /* VSU-1000 control write */
1107      {
1108         /* volume and frequency control goes here */
1109         /* mame_printf_debug("TODO: VSU-1000 Control write (ignored for now)\n");*/
1110        S14001A_set_volume(((data&0x38)>>3)+1);
1111        S14001A_set_rate((16-(data&0x07))*16); /* second LS161 has load triggered by its own TC(when it equals 16) long before the first ls161 will TC and fire again, so effectively it only divides by 15 and not 16. If the clock, as opposed to the E enable, had been tied to the first LS161's TC instead, it would divide by 16 as expected */
1112      }
1113      else if ((data & 0xc0) != 0x00)
1114      {
1115         /* vsu-1000 ignores these writes entirely */
1116         mame_printf_debug("bogus write ignored\n");
1117      }
1118      else
1119      {
1120         /* select word input */
1121         if (S14001A_bsy_0_r()) /* skip if busy... */
1122         {
1123            mame_printf_debug("S14001A busy, ignoring write\n");
1124            break;
1125         }
1126
1127         /* write to the register */
1128         S14001A_reg_0_w(data & 0x3f);
1129         S14001A_rst_0_w(1);
1130         S14001A_rst_0_w(0);
1131      }
1132      break;
1133   }
1134}
1135
1136
1137READ8_HANDLER( berzerk_audio_r )
1138{
1139   return ((offset == 4) && !S14001A_bsy_0_r()) ? 0x40 : 0x00;
1140}
src/mame/audio/targ.c
r1527r1528
11/*************************************************************************
22
3    Exidy 6502 hardware
3    Targ hardware
44
55*************************************************************************/
66
r1527r1528
1212*/
1313
1414#include "driver.h"
15#include "exidy.h"
1615#include "sound/samples.h"
1716#include "sound/dac.h"
17#include "targ.h"
1818
19UINT8 targ_spec_flag;
20static UINT8 targ_sh_ctrl0=0;
21static UINT8 targ_sh_ctrl1=0;
22static UINT8 tone_active;
2319
24#define MAXFREQ_A_TARG 125000
25#define MAXFREQ_A_SPECTAR 525000
2620
27static int sound_a_freq;
21#define SPECTAR_MAXFREQ      525000
22#define TARG_MAXFREQ      125000
23
24
25static int max_freq;
26
27static UINT8 port_1_last;
28static UINT8 port_2_last;
29
30static UINT8 tone_freq;
31static UINT8 tone_active;
2832static UINT8 tone_pointer;
29static UINT8 tone_offset;
3033
31static const UINT8 tone_prom[32] =
32{
33    0xE5,0xE5,0xED,0xED,0xE5,0xE5,0xED,0xED,0xE7,0xE7,0xEF,0xEF,0xE7,0xE7,0xEF,0xEF,
34    0xC1,0xE1,0xC9,0xE9,0xC5,0xE5,0xCD,0xED,0xC3,0xE3,0xCB,0xEB,0xC7,0xE7,0xCF,0xEF
35};
3634
37/* waveforms for the audio hardware */
38static const INT16 waveform1[32] =
35static const INT16 sine_wave[32] =
3936{
40   /* sine-wave */
41   0x0F0F, 0x0F0F, 0x0F0F, 0x0606, 0x0606, 0x0909, 0x0909, 0x0606, 0x0606, 0x0909, 0x0606, 0x0D0D, 0x0F0F, 0x0F0F, 0x0D0D, 0x0000,
42   -0x191A, -0x2122, -0x1E1F, -0x191A, -0x1314, -0x191A, -0x1819, -0x1819, -0x1819, -0x1314, -0x1314, -0x1314, -0x1819, -0x1E1F, -0x1E1F, -0x1819
37    0x0f0f,  0x0f0f,  0x0f0f,  0x0606,  0x0606,  0x0909,  0x0909,  0x0606,  0x0606,  0x0909,  0x0606,  0x0d0d,  0x0f0f,  0x0f0f,  0x0d0d,  0x0000,
38   -0x191a, -0x2122, -0x1e1f, -0x191a, -0x1314, -0x191a, -0x1819, -0x1819, -0x1819, -0x1314, -0x1314, -0x1314, -0x1819, -0x1e1f, -0x1e1f, -0x1819
4339};
4440
41
4542/* some macros to make detecting bit changes easier */
46#define RISING_EDGE(bit)  ((data & bit) && !(targ_sh_ctrl0 & bit))
47#define FALLING_EDGE(bit) (!(data & bit) && (targ_sh_ctrl0 & bit))
43#define RISING_EDGE(bit)  ( (data & bit) && !(port_1_last & bit))
44#define FALLING_EDGE(bit) (!(data & bit) &&  (port_1_last & bit))
4845
4946
50static void targ_tone_generator(int data)
47
48static void adjust_sample(UINT8 freq)
5149{
52   int maxfreq;
50   tone_freq = freq;
5351
52   if ((tone_freq == 0xff) || (tone_freq == 0x00))
53      sample_set_volume(3, 0);
54   else
55   {
56      sample_set_freq(3, 1.0 * max_freq / (0xff - tone_freq));
57      sample_set_volume(3, tone_active);
58   }
59}
5460
55   if (targ_spec_flag) maxfreq = MAXFREQ_A_TARG;
56   else maxfreq = MAXFREQ_A_SPECTAR;
5761
58    sound_a_freq = data;
59    if (sound_a_freq == 0xFF || sound_a_freq == 0x00)
62WRITE8_HANDLER( targ_audio_1_w )
63{
64   /* CPU music */
65   if ((data & 0x01) != (port_1_last & 0x01))
66      DAC_data_w(0,(data & 0x01) * 0xff);
67
68   /* shot */
69   if (FALLING_EDGE(0x02) && !sample_playing(0))  sample_start(0,1,0);
70   if (RISING_EDGE(0x02)) sample_stop(0);
71
72   /* crash */
73   if (RISING_EDGE(0x20))
6074   {
61      sample_set_volume(3,0);
62    }
63    else
75      if (data & 0x40)
76         sample_start(1,2,0);
77      else
78         sample_start(1,0,0);
79   }
80
81   /* Sspec */
82   if (data & 0x10)
83      sample_stop(2);
84   else
6485   {
65      sample_set_freq(3,maxfreq/(0xFF-sound_a_freq));
66      sample_set_volume(3,tone_active*1.0);
86      if ((data & 0x08) != (port_1_last & 0x08))
87      {
88         if (data & 0x08)
89            sample_start(2,3,1);
90         else
91            sample_start(2,4,1);
92      }
6793   }
94
95   /* Game (tone generator enable) */
96   if (FALLING_EDGE(0x80))
97   {
98      tone_pointer = 0;
99      tone_active = 0;
100
101      adjust_sample(tone_freq);
102   }
103
104   if (RISING_EDGE(0x80))
105      tone_active=1;
106
107   port_1_last = data;
68108}
69109
70void targ_sh_start(void)
110
111WRITE8_HANDLER( targ_audio_2_w )
71112{
72   tone_pointer=0;
73   tone_offset=0;
74   tone_active=0;
75   sound_a_freq = 0x00;
76   sample_set_volume(3,0);
77   sample_start_raw(3,waveform1,32,1000,1);
113   if ((data & 0x01) && !(port_2_last & 0x01))
114   {
115      UINT8 *prom = memory_region(TARG_TONE_REGION);
116
117      tone_pointer = (tone_pointer + 1) & 0x0f;
118
119      adjust_sample(prom[((data & 0x02) << 3) | tone_pointer]);
120   }
121
122   port_2_last = data;
78123}
79124
80WRITE8_HANDLER( targ_sh_w )
125
126WRITE8_HANDLER( spectar_audio_2_w )
81127{
82   int maxfreq;
128   adjust_sample(data);
129}
83130
84131
85   if (targ_spec_flag) maxfreq = MAXFREQ_A_TARG;
86   else maxfreq = MAXFREQ_A_SPECTAR;
132static const char *const sample_names[] =
133{
134   "*targ",
135   "expl.wav",
136   "shot.wav",
137   "sexpl.wav",
138   "spslow.wav",
139   "spfast.wav",
140   0
141};
87142
88    if (offset) {
89        if (targ_spec_flag) {
90            if (data & 0x02)
91                tone_offset=16;
92            else
93                tone_offset=0;
94143
95            if ((data & 0x01) && !(targ_sh_ctrl1 & 0x01)) {
96                tone_pointer++;
97                if (tone_pointer > 15) tone_pointer = 0;
98                targ_tone_generator(tone_prom[tone_pointer+tone_offset]);
99            }
100       }
101       else {
102            targ_tone_generator(data);
103       }
104       targ_sh_ctrl1=data;
105    }
106    else
107    {
108        /* cpu music */
109        if ((data & 0x01) != (targ_sh_ctrl0 & 0x01)) {
110            DAC_data_w(0,(data & 0x01) * 0xFF);
111        }
112        /* Shoot */
113        if FALLING_EDGE(0x02) {
114            if (!sample_playing(0))  sample_start(0,1,0);
115        }
116        if RISING_EDGE(0x02) {
117            sample_stop(0);
118        }
144static void common_audio_start(int freq)
145{
146   max_freq = freq;
119147
120        /* Crash */
121        if RISING_EDGE(0x20) {
122            if (data & 0x40) {
123                sample_start(1,2,0); }
124            else {
125                sample_start(1,0,0); }
126        }
148   tone_freq = 0;
149   tone_active = 0;
127150
128        /* Sspec */
129        if (data & 0x10) {
130            sample_stop(2);
131        }
132        else {
133            if ((data & 0x08) != (targ_sh_ctrl0 & 0x08)) {
134            if (data & 0x08) {
135                sample_start(2,3,1); }
136            else {
137                sample_start(2,4,1); }
138            }
139        }
151   sample_set_volume(3, 0);
152   sample_start_raw(3, sine_wave, 32, 1000, 1);
140153
141        /* Game (tone generator enable) */
142        if FALLING_EDGE(0x80) {
143           tone_pointer=0;
144           tone_active=0;
145           if (sound_a_freq == 0xFF || sound_a_freq == 0x00)
146         {
147            sample_set_volume(3,0);
148           }
149           else
150         {
151             sample_set_freq(3,maxfreq/(0xFF-sound_a_freq));
152             sample_set_volume(3,0);
153         }
154        }
155        if RISING_EDGE(0x80) {
156            tone_active=1;
157        }
158        targ_sh_ctrl0 = data;
159    }
154   state_save_register_global(port_1_last);
155   state_save_register_global(port_2_last);
156   state_save_register_global(tone_freq);
157   state_save_register_global(tone_active);
160158}
161159
160
161static void spectar_audio_start(void)
162{
163   common_audio_start(SPECTAR_MAXFREQ);
164}
165
166
167static void targ_audio_start(void)
168{
169   common_audio_start(TARG_MAXFREQ);
170
171   tone_pointer = 0;
172
173   state_save_register_global(tone_pointer);
174}
175
176
177static const struct Samplesinterface spectar_samples_interface =
178{
179   4,   /* number of channel */
180   sample_names,
181   spectar_audio_start
182};
183
184
185static const struct Samplesinterface targ_samples_interface =
186{
187   4,   /* number of channel */
188   sample_names,
189   targ_audio_start
190};
191
192
193MACHINE_DRIVER_START( spectar_audio )
194
195   MDRV_SPEAKER_STANDARD_MONO("mono")
196
197   MDRV_SOUND_ADD(SAMPLES, 0)
198   MDRV_SOUND_CONFIG(spectar_samples_interface)
199   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
200
201   MDRV_SOUND_ADD(DAC, 0)
202   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
203MACHINE_DRIVER_END
204
205
206MACHINE_DRIVER_START( targ_audio )
207
208   MDRV_SPEAKER_STANDARD_MONO("mono")
209
210   MDRV_SOUND_ADD(SAMPLES, 0)
211   MDRV_SOUND_CONFIG(targ_samples_interface)
212   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
213
214   MDRV_SOUND_ADD(DAC, 0)
215   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
216MACHINE_DRIVER_END
src/mame/machine/asic65.c
r1527r1528
538538MACHINE_DRIVER_START( asic65 )
539539
540540   /* ASIC65 */
541   MDRV_CPU_ADD_TAG("asic65", TMS32010, 20000000/TMS32010_CLOCK_DIVIDER)
541   MDRV_CPU_ADD_TAG("asic65", TMS32010, 20000000)
542542   MDRV_CPU_PROGRAM_MAP(asic65_program_map,0)
543543   MDRV_CPU_IO_MAP(asic65_io_map,0)
544544MACHINE_DRIVER_END
src/mame/machine/leland.c
r1527r1528
155155{
156156   /* catch the case where they clear this memory location at PC $1827 and change */
157157   /* the value written to be a 1 */
158   if (safe_activecpu_get_pc() == 0x1827)
158   if (activecpu_get_previouspc() == 0x1827)
159159      *alleymas_kludge_mem = 1;
160160   else
161161      *alleymas_kludge_mem = data;
src/mame/machine/namcos1.c
r1527r1528
11101110#if 0
11111111   // resolves CPU deadlocks caused by sloppy coding(see driver\namcos1.c)
11121112   {
1113      UINT8 target[8] = {0x34,0x37,0x35,0x37,0x96,0x00,0x2e,0xed};
1113      static const UINT8 target[8] = {0x34,0x37,0x35,0x37,0x96,0x00,0x2e,0xed};
11141114      UINT8 *rombase, *srcptr, *endptr, *scanptr;
11151115
11161116      rombase = memory_region(REGION_USER1);
src/mame/machine/amiga.c
r1527r1528
3333 *************************************/
3434
3535/* 715909 Hz for NTSC, 709379 for PAL */
36#define O2_CLOCK               (Machine->drv->cpu[0].clock / 10)
36#define O2_CLOCK               (cpunum_get_clock(0) / 10)
3737
3838/* How many CPU cycles we delay until we fire a pending interrupt */
3939#define AMIGA_IRQ_DELAY_CYCLES      24
r1527r1528
443443 *
444444 *************************************/
445445
446UINT32 amiga_joystick_convert(void *param)
446CUSTOM_INPUT( amiga_joystick_convert )
447447{
448448   UINT8 bits = readinputportbytag(param);
449449   int up = (bits >> 0) & 1;
r1527r1528
11371137
11381138static void custom_reset(void)
11391139{
1140   int clock = Machine->drv->cpu[0].clock;
1140   int clock = cpunum_get_clock(0);
11411141   UINT16   vidmode = (clock == AMIGA_68000_NTSC_CLOCK || clock == AMIGA_68EC020_NTSC_CLOCK ) ? 0x1000 : 0x0000; /* NTSC or PAL? */
11421142
11431143   CUSTOM_REG(REG_DDFSTRT) = 0x18;
r1527r1528
15121512attotime amiga_get_serial_char_period(void)
15131513{
15141514   UINT32 divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1;
1515   UINT32 baud = Machine->drv->cpu[0].clock / 2 / divisor;
1515   UINT32 baud = cpunum_get_clock(0) / 2 / divisor;
15161516   UINT32 numbits = 2 + ((CUSTOM_REG(REG_SERPER) & 0x8000) ? 9 : 8);
15171517   return attotime_mul(ATTOTIME_IN_HZ(baud), numbits);
15181518}
src/mame/machine/midwunit.c
r1527r1528
160160WRITE16_HANDLER( midxunit_unknown_w )
161161{
162162   int offs = offset / 0x40000;
163
164   if (offs == 1 && ACCESSING_LSB)
165      dcs_reset_w(data & 2);
166
163167   if (ACCESSING_LSB && offset % 0x40000 == 0)
164168      logerror("%08X:midxunit_unknown_w @ %d = %02X\n", activecpu_get_pc(), offs, data & 0xff);
165169}
166170
167171
172
168173/*************************************
169174 *
170175 *  General I/O reads
r1527r1528
246251{
247252   /* only signal if not in loopback state */
248253   if (uart[1] != 0x66)
249      cpunum_set_input_line(1, 1, state ? ASSERT_LINE : CLEAR_LINE);
254      cpunum_set_input_line(0, 1, state ? ASSERT_LINE : CLEAR_LINE);
250255}
251256
252257
src/mame/machine/mcr.c
r1527r1528
1515#include "cpu/z80/z80daisy.h"
1616#include "mcr.h"
1717
18#define VERBOSE 1
18#define VERBOSE
1919#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
2020
2121
r1527r1528
267267MACHINE_START( mcr )
268268{
269269   /* initialize the CTC */
270   ctc_intf.baseclock = machine->drv->cpu[0].clock;
270   ctc_intf.baseclock = cpunum_get_clock(0);
271271   z80ctc_init(0, &ctc_intf);
272272
273273   state_save_register_global(mcr_cocktail_flip);
r1527r1528
277277MACHINE_START( nflfoot )
278278{
279279   /* initialize the CTC */
280   ctc_intf.baseclock = machine->drv->cpu[0].clock;
280   ctc_intf.baseclock = cpunum_get_clock(0);
281281   z80ctc_init(0, &ctc_intf);
282282
283   nflfoot_ctc_intf.baseclock = machine->drv->cpu[3].clock;
283   nflfoot_ctc_intf.baseclock = cpunum_get_clock(3);
284284   z80ctc_init(1, &nflfoot_ctc_intf);
285285
286286   z80pio_init(0, &nflfoot_pio_intf);
287287   z80pio_init(1, &nflfoot_pio_intf);
288288
289   nflfoot_sio_intf.baseclock = machine->drv->cpu[3].clock;
289   nflfoot_sio_intf.baseclock = cpunum_get_clock(3);
290290   z80sio_init(0, &nflfoot_sio_intf);
291291
292292   /* allocate a timer for the IPU watchdog */
r1527r1528
364364   }
365365
366366   /* initialize the clock */
367   m6840_internal_counter_period = ATTOTIME_IN_HZ(Machine->drv->cpu[0].clock / 10);
367   m6840_internal_counter_period = ATTOTIME_IN_HZ(cpunum_get_clock(0) / 10);
368368
369369   /* reset cocktail flip */
370370   mcr_cocktail_flip = 0;
src/mame/tiny.c
r1527r1528
4343   DRIVER( alienar )    /* (c) 1985 Duncan Brown */
4444   DRIVER( carpolo )   /* (c) 1977 Exidy */
4545   DRIVER( sidetrac )   /* (c) 1979 Exidy */
46   DRIVER( targ )      /* (c) 1980 Exidy */
47   DRIVER( spectar )   /* (c) 1980 Exidy */
4648   DRIVER( teetert )   /* (c) 1982 Exidy */
4749   DRIVER( circus )   /* (c) 1977 Exidy */
4850   DRIVER( robotbwl )   /* (c) 197? Exidy */
src/mame/mamedriv.c
r1527r1528
40784078   DRIVER( acombat )   /* bootleg */
40794079   DRIVER( acombato )   /* bootleg */
40804080   DRIVER( sstarbtl )   /* bootleg */
4081   DRIVER( spfghmk2 )   /* (c) [1980] Data East Corporation */
4082   DRIVER( spfgmk22 )   /* (c) [1980] Data East Corporation */
40814083   DRIVER( tomahawk )   /* (c) 1980 Data East, Inc. */
40824084   DRIVER( tomahaw1 )   /* (c) 1980 Data East, Inc. */
40834085   DRIVER( progolf )   /* (c) 1981 */
r1527r1528
62626264   DRIVER( heatbrl )   /* (c) 1992 Tad (World) */
62636265   DRIVER( heatbrlo )   /* (c) 1992 Tad (World) */
62646266   DRIVER( heatbrlu )   /* (c) 1992 Tad (US) */
6267   DRIVER( hetbrlu2 )   /* (c) 1992 Tad (US) */
62656268   DRIVER( godzilla )   /* (c) 1993 Banpresto */
62666269   DRIVER( denjinmk )   /* (c) 199? Banpresto */
62676270   DRIVER( sdgndmrb )   /* (c) 1993 Banpresto */
r1527r1528
66226625   DRIVER( ryouran )   /* (c) 1998 Electro Design Co. (Japan) */
66236626   DRIVER( teljan )   /* (c) 1999 Electro Design Co. (Japan) */
66246627
6625   /* Seta games */
6628   /* Seta games (seta.c) */
66266629   DRIVER( hanaawas )   /* (c) SetaKikaku */
66276630   DRIVER( speedatk )   /* CB-0 (c) SetaKikaku */
66286631   DRIVER( srmp1 )      /* UB or UC?? (c) 1987 */
r1527r1528
66786681   DRIVER( sokonuke )   /* (c) 1995 Sammy Industries */
66796682   DRIVER( zombraid )   /* (c) 1995 American Sammy */
66806683   DRIVER( crazyfgt )   /* (c) 1998 Subsino */
6684   DRIVER( inttoote )   /* (c) 1998 Coinmaster */
66816685
6686   /* Seta games (seta2.c) */
66826687   DRIVER( gundamex )   /* (c) 1994 Banpresto */
66836688   DRIVER( grdians )   /* (c) 1995 Banpresto */
66846689   DRIVER( mj4simai )   /* (c) 1996 Maboroshi Ware */
r1527r1528
76397644   DRIVER( eggvntdx )   /* (c) 1997 The Game Room */
76407645   DRIVER( ripribit )   /* (c) 1997 LAI Games */
76417646   DRIVER( cfarm )      /* (c) 1999 LAI Games */
7642   DRIVER( cclown )   /* (c) 1999 LAI Games */
7647   DRIVER( cclownz )   /* (c) 1999 LAI Games */
76437648   DRIVER( rotaryf )
76447649   DRIVER( sbugger )   /* (c) 1981 Game-A-Tron */
76457650   DRIVER( sbuggera )   /* (c) 1981 Game-A-Tron */
r1527r1528
76497654   DRIVER( enigma2a )   /* (c) 1984 Zilec Electronics (bootleg?) */
76507655   DRIVER( ltcasino )   /* (c) 1982 Digital Controls Inc */
76517656   DRIVER( mv4in1 )   /* (c) 1983 Entertainment Enterprises */
7652   DRIVER( ltcasin2 )   /* (c) 1984 Digital Controls Inc */
7657   DRIVER( ltcasinn )   /* (c) 1984 Digital Controls Inc */
76537658   DRIVER( coolmini )   /* (c) 1999 SemiCom */
76547659   DRIVER( luplup )   /* (c) 1999 Omega System */
76557660   DRIVER( luplup29 )   /* (c) 1999 Omega System */
r1527r1528
77317736   DRIVER( phrcraze )   /* (c) 1986 Merit */
77327737   DRIVER( phrcrazs )   /* (c) 1986 Merit */
77337738   DRIVER( bigappg )   /* (c) 1986 Merit */
7739   DRIVER( dodge )      /* (c) 1986 Merit */
77347740   DRIVER( couple )   /* (c) 1988 Merit */
77357741   DRIVER( couplep )   /* (c) 1988 Merit */
77367742   DRIVER( couplei )   /* (c) 1988 Merit */
r1527r1528
78937899   DRIVER( pepp0158 )   /* (c) 1987 IGT - International Gaming Technology */
78947900   DRIVER( pepp0188 )   /* (c) 1987 IGT - International Gaming Technology */
78957901   DRIVER( pepp0516 )   /* (c) 1987 IGT - International Gaming Technology */
7896    DRIVER( pebe0014 )   /* (c) 1994 IGT - International Gaming Technology */
7897    DRIVER( peke1012 )   /* (c) 1994 IGT - International Gaming Technology */
7898    DRIVER( peps0615 )   /* (c) 1996 IGT - International Gaming Technology */
7902   DRIVER( pebe0014 )   /* (c) 1994 IGT - International Gaming Technology */
7903   DRIVER( peke1012 )   /* (c) 1994 IGT - International Gaming Technology */
7904   DRIVER( peps0615 )   /* (c) 1996 IGT - International Gaming Technology */
78997905   DRIVER( peps0716 )   /* (c) 1996 IGT - International Gaming Technology */
7900    DRIVER( pexp0019 )   /* (c) 1995 IGT - International Gaming Technology */
7901    DRIVER( pexs0006 )   /* (c) 1997 IGT - International Gaming Technology */
7906   DRIVER( pexp0019 )   /* (c) 1995 IGT - International Gaming Technology */
7907   DRIVER( pexs0006 )   /* (c) 1997 IGT - International Gaming Technology */
7908   DRIVER( pexmp006 )   /* (c) 1997 IGT - International Gaming Technology */
79027909   DRIVER( mirage )   /* (c) 1994 Mitchell */
79037910   DRIVER( dominob )   /* (c) 1990 Wonwoo Systems */
79047911   DRIVER( jongkyo )   /* (c) 1985 Kiwako */
src/mame/includes/mw8080bw.h
r1527r1528
6060#define INVADERS_P1_CONTROL_PORT_TAG   ("CONTP1")
6161#define INVADERS_P2_CONTROL_PORT_TAG   ("CONTP2")
6262
63UINT32 invaders_in2_control_r(void *param);
63CUSTOM_INPUT( invaders_in2_control_r );
6464UINT8 invaders_is_flip_screen(void);
6565void invaders_set_flip_screen(UINT8 data);
6666int invaders_is_cabinet_cocktail(void);
src/mame/includes/spacefb.h
r1527r1528
1212
1313#define SPACEFB_MASTER_CLOCK         (20160000)
1414#define SPACEFB_MAIN_CPU_CLOCK         (6000000 / 2)
15#define SPACEFB_AUDIO_CPU_CLOCK         (6000000 / 15)   /* this goes to X2, pixel clock goes to X1 */
15#define SPACEFB_AUDIO_CPU_CLOCK         (6000000)   /* this goes to X2, pixel clock goes to X1 */
1616#define SPACEFB_PIXEL_CLOCK            (SPACEFB_MASTER_CLOCK / 2)
1717#define SPACEFB_HTOTAL               (0x280)
1818#define SPACEFB_HBEND               (0x000)
src/mame/includes/jaguar.h
r1527r1528
1212#endif /* MESS */
1313#endif
1414
15#define COJAG_PIXEL_CLOCK      XTAL_14_31818MHz
1516
17
18
1619/*----------- defined in drivers/cojag.c -----------*/
1720
1821extern UINT8 cojag_is_r3000;
src/mame/includes/phoenix.h
r1527r1528
22#include "sound/custom.h"
33
44
5/*----------- video timing  -----------*/
6
7#define MASTER_CLOCK          XTAL_11MHz
8
9#define PIXEL_CLOCK            (MASTER_CLOCK/2)
10#define CPU_CLOCK            (PIXEL_CLOCK/2)
11#define HTOTAL               (512-160)
12#define HBSTART               (256)
13#define HBEND               (0)
14#define VTOTAL               (256)
15#define VBSTART               (208)
16#define VBEND               (0)
17
518/*----------- defined in audio/phoenix.c -----------*/
619
20SOUND_START( phoenix );
21
722DISCRETE_SOUND_EXTERN( phoenix );
823
924WRITE8_HANDLER( phoenix_sound_control_a_w );
r1527r1528
2742extern UINT8 *naughtyb_scrollreg;
2843extern int naughtyb_cocktail;
2944
30WRITE8_HANDLER( naughtyb_videoram2_w );
3145WRITE8_HANDLER( naughtyb_videoreg_w );
3246WRITE8_HANDLER( popflame_videoreg_w );
3347
r1527r1528
4155PALETTE_INIT( phoenix );
4256PALETTE_INIT( pleiads );
4357VIDEO_START( phoenix );
58VIDEO_START( pleiads );
4459VIDEO_UPDATE( phoenix );
4560
4661WRITE8_HANDLER( phoenix_videoram_w );
src/mame/includes/itech8.h
r1527r1528
77
88/*----------- defined in drivers/itech8.c -----------*/
99
10void itech8_update_interrupts(int periodic, int tms34061, int blitter);
10void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter);
1111
1212
1313/*----------- defined in machine/slikshot.c -----------*/
src/mame/includes/cvs.h
r1527r1528
44
55****************************************************************************/
66
7extern mame_bitmap *cvs_collision_bitmap;
8extern mame_bitmap *cvs_collision_background;
9extern int cvs_collision_register;
10
11
12PALETTE_INIT( cvs );
13VIDEO_UPDATE( cvs );
14VIDEO_START( cvs );
15
16WRITE8_HANDLER( cvs_scroll_w );
17WRITE8_HANDLER( cvs_video_fx_w );
18
19READ8_HANDLER( cvs_collision_r );
20READ8_HANDLER( cvs_collision_clear );
21
22
237/*----------- defined in driver/cvs.c -----------*/
248
259extern UINT8 *cvs_color_ram;
r1527r1528
2812extern UINT8 *cvs_palette_ram;
2913extern UINT8 *cvs_character_ram;
3014
15MACHINE_START( cvs );
16
3117READ8_HANDLER( cvs_video_or_color_ram_r );
3218WRITE8_HANDLER( cvs_video_or_color_ram_w );
3319
r1527r1528
4430UINT8 cvs_get_character_banking_mode(void);
4531
4632
47
4833/*----------- defined in video/cvs.c -----------*/
4934
35extern mame_bitmap *cvs_collision_bitmap;
36extern mame_bitmap *cvs_collision_background;
37extern int cvs_collision_register;
38
39PALETTE_INIT( cvs );
40VIDEO_UPDATE( cvs );
41VIDEO_START( cvs );
42
43WRITE8_HANDLER( cvs_scroll_w );
44WRITE8_HANDLER( cvs_video_fx_w );
45
46READ8_HANDLER( cvs_collision_r );
47READ8_HANDLER( cvs_collision_clear );
48
5049void cvs_scroll_stars(void);
5150
src/mame/includes/seta.h
r1527r1528
2626
2727PALETTE_INIT( blandia );
2828PALETTE_INIT( gundhara );
29PALETTE_INIT( inttoote );
2930PALETTE_INIT( jjsquawk );
3031PALETTE_INIT( usclssic );
3132PALETTE_INIT( zingzip );
src/mame/includes/eolithsp.h
r1527r1528
33void eolith_speedup_read(void);
44void init_eolith_speedup(running_machine *machine);
55INTERRUPT_GEN( eolith_speedup );
6UINT32 eolith_speedup_getvblank(void *param);
6CUSTOM_INPUT( eolith_speedup_getvblank );
src/mame/includes/berzerk.h
r1527r1528
55***************************************************************************/
66
77
8#define BERZERK_MASTER_CLOCK   (10000000)
9#define BERZERK_S14001A_CLOCK   (BERZERK_MASTER_CLOCK / 2)
10
11
12/*----------- defined in audio/berzerk.c -----------*/
13
14MACHINE_DRIVER_EXTERN( berzerk_audio );
15WRITE8_HANDLER( berzerk_audio_w );
16READ8_HANDLER( berzerk_audio_r );
8#define BERZERK_MASTER_CLOCK   (XTAL_10MHz)
src/mame/includes/astrocde.h
r1527r1528
4646extern const char *const wow_sample_names[];
4747
4848READ8_HANDLER( wow_speech_r );
49UINT32 wow_speech_status_r(void *param);
49CUSTOM_INPUT( wow_speech_status_r );
5050
5151
5252/*----------- defined in audio/gorf.c -----------*/
r1527r1528
5454extern const char *const gorf_sample_names[];
5555
5656READ8_HANDLER( gorf_speech_r );
57UINT32 gorf_speech_status_r(void *param);
57CUSTOM_INPUT( gorf_speech_status_r );
src/mame/includes/jedi.h
r1527r1528
66
77/*----------- defined in video/jedi.c -----------*/
88
9extern UINT8 *jedi_PIXIRAM;
109extern UINT8 *jedi_backgroundram;
1110extern size_t jedi_backgroundram_size;
1211
r1527r1528
1514
1615WRITE8_HANDLER( jedi_alpha_banksel_w );
1716WRITE8_HANDLER( jedi_paletteram_w );
18WRITE8_HANDLER( jedi_backgroundram_w );
1917WRITE8_HANDLER( jedi_vscroll_w );
2018WRITE8_HANDLER( jedi_hscroll_w );
2119WRITE8_HANDLER( jedi_video_off_w );
src/mame/includes/exidy.h
r1527r1528
77#include "sound/custom.h"
88
99
10#define EXIDY_MASTER_CLOCK            (11289000)
10#define EXIDY_MASTER_CLOCK            (XTAL_11_289MHz)
1111#define EXIDY_CPU_CLOCK               (EXIDY_MASTER_CLOCK / 16)
1212#define EXIDY_PIXEL_CLOCK            (EXIDY_MASTER_CLOCK / 2)
1313#define EXIDY_HTOTAL               (0x150)
r1527r1528
2424
2525/*----------- defined in audio/exidy.c -----------*/
2626
27void *exidy_sh_start(int clock, const struct CustomSound_interface *config);
28void *victory_sh_start(int clock, const struct CustomSound_interface *config);
29void *berzerk_sh_start(int clock, const struct CustomSound_interface *config);
27MACHINE_DRIVER_EXTERN( venture_audio );
3028
31WRITE8_HANDLER( exidy_shriot_w );
32WRITE8_HANDLER( exidy_sfxctrl_w );
33WRITE8_HANDLER( exidy_sh8253_w );
34WRITE8_HANDLER( exidy_sh6840_w );
35WRITE8_HANDLER( exidy_sound_filter_w );
36READ8_HANDLER( exidy_shriot_r );
37READ8_HANDLER( exidy_sh8253_r );
38READ8_HANDLER( exidy_sh6840_r );
29MACHINE_DRIVER_EXTERN( mtrap_cvsd_audio );
3930
40WRITE8_HANDLER( mtrap_voiceio_w );
41READ8_HANDLER( mtrap_voiceio_r );
31MACHINE_DRIVER_EXTERN( victory_audio );
32READ8_HANDLER( victory_sound_response_r );
33READ8_HANDLER( victory_sound_status_r );
34WRITE8_HANDLER( victory_sound_command_w );
4235
36MACHINE_DRIVER_EXTERN( berzerk_audio );
37WRITE8_HANDLER( berzerk_audio_w );
38READ8_HANDLER( berzerk_audio_r );
4339
44/*----------- defined in audio/targ.c -----------*/
4540
46extern UINT8 targ_spec_flag;
47
48void targ_sh_start(void);
49
50WRITE8_HANDLER( targ_sh_w );
51
52
5341/*----------- defined in video/exidy.c -----------*/
5442
5543extern UINT8 *exidy_videoram;
5644extern UINT8 *exidy_characterram;
57
5845extern UINT8 *exidy_color_latch;
46extern UINT8 *exidy_sprite1_xpos;
47extern UINT8 *exidy_sprite1_ypos;
48extern UINT8 *exidy_sprite2_xpos;
49extern UINT8 *exidy_sprite2_ypos;
50extern UINT8 *exidy_spriteno;
51extern UINT8 *exidy_sprite_enable;
5952
6053void exidy_video_config(UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp);
6154VIDEO_START( exidy );
62VIDEO_EOF( exidy );
6355VIDEO_UPDATE( exidy );
6456
6557INTERRUPT_GEN( exidy_vblank_interrupt );
6658INTERRUPT_GEN( teetert_vblank_interrupt );
6759
68WRITE8_HANDLER( exidy_color_w );
69WRITE8_HANDLER( exidy_sprite1_xpos_w );
70WRITE8_HANDLER( exidy_sprite1_ypos_w );
71WRITE8_HANDLER( exidy_sprite2_xpos_w );
72WRITE8_HANDLER( exidy_sprite2_ypos_w );
73WRITE8_HANDLER( exidy_spriteno_w );
74WRITE8_HANDLER( exidy_sprite_enable_w );
75
7660READ8_HANDLER( exidy_interrupt_r );
src/mame/includes/targ.h
r0r1528
1/*************************************************************************
2
3    Targ hardware
4
5*************************************************************************/
6
7
8#define TARG_TONE_REGION   (REGION_USER1)
9
10
11/*----------- defined in audio/targ.c -----------*/
12
13WRITE8_HANDLER( targ_audio_1_w );
14WRITE8_HANDLER( targ_audio_2_w );
15WRITE8_HANDLER( spectar_audio_2_w );
16
17MACHINE_DRIVER_EXTERN( spectar_audio );
18MACHINE_DRIVER_EXTERN( targ_audio );
19
src/mame/includes/victory.h
r0r1528
1/***************************************************************************
2
3    Victory system
4
5****************************************************************************/
6
7
8#define VICTORY_MAIN_CPU_CLOCK      (XTAL_8MHz / 2)
9
10
11/*----------- defined in video/victory.c -----------*/
12
13extern UINT8 *victory_videoram;
14extern UINT8 *victory_charram;
15
16VIDEO_START( victory );
17VIDEO_UPDATE( victory );
18INTERRUPT_GEN( victory_vblank_interrupt );
19
20READ8_HANDLER( victory_video_control_r );
21WRITE8_HANDLER( victory_video_control_w );
22WRITE8_HANDLER( victory_paletteram_w );
src/mame/includes/amiga.h
r1527r1528
379379MACHINE_RESET( amiga );
380380INTERRUPT_GEN( amiga_scanline_callback );
381381
382UINT32 amiga_joystick_convert(void *param);
382CUSTOM_INPUT( amiga_joystick_convert );
383383
384384READ16_HANDLER( amiga_cia_r );
385385WRITE16_HANDLER( amiga_cia_w );
src/mame/includes/astrof.h
r1527r1528
1212WRITE8_HANDLER( astrof_audio_1_w );
1313WRITE8_HANDLER( astrof_audio_2_w );
1414
15MACHINE_DRIVER_EXTERN( spfghmk2_audio );
16WRITE8_HANDLER( spfghmk2_audio_w );
17
1518MACHINE_DRIVER_EXTERN( tomahawk_audio );
1619WRITE8_HANDLER( tomahawk_audio_w );
src/mame/includes/crbaloon.h
r1527r1528
44
55*************************************************************************/
66
7#include "sound/discrete.h"
87
9#define CRBALOON_LAUGH_EN      NODE_01
10#define CRBALOON_MUSIC_EN      NODE_02
11#define CRBALOON_MUSIC_DATA      NODE_03
8#define CRBALOON_MASTER_XTAL   (XTAL_9_987MHz)
129
1310
1411/*----------- defined in audio/crbaloon.c -----------*/
1512
16DISCRETE_SOUND_EXTERN( crbaloon );
13void crbaloon_audio_set_music_freq(UINT8 freq);
14void crbaloon_audio_set_music_enable(int enabled);
15void crbaloon_audio_set_explosion_enable(int enabled);
16void crbaloon_audio_set_breath_enable(int enabled);
17void crbaloon_audio_set_appear_enable(int enabled);
18void crbaloon_audio_set_laugh_enable(int enabled);
1719
20MACHINE_DRIVER_EXTERN( crbaloon_audio );
21
22
1823/*----------- defined in video/crbaloon.c -----------*/
1924
20extern INT8 crbaloon_collision;
25extern UINT8 *crbaloon_videoram;
26extern UINT8 *crbaloon_colorram;
27extern UINT8 *crbaloon_spriteram;
2128
22WRITE8_HANDLER( crbaloon_videoram_w );
23WRITE8_HANDLER( crbaloon_colorram_w );
24WRITE8_HANDLER( crbaloon_spritectrl_w );
25WRITE8_HANDLER( crbaloon_flipscreen_w );
26
2729PALETTE_INIT( crbaloon );
2830VIDEO_START( crbaloon );
2931VIDEO_UPDATE( crbaloon );
3032
33WRITE8_HANDLER( crbaloon_videoram_w );
34WRITE8_HANDLER( crbaloon_colorram_w );
35
36UINT16 crbaloon_get_collision_address(void);
37void crbaloon_set_clear_collision_address(int _crbaloon_collision_address_clear);
38
src/mame/includes/mcr.h
r1527r1528
77#include "cpu/z80/z80daisy.h"
88
99/* constants */
10#define MAIN_OSC_MCR_I      19968000
10#define MAIN_OSC_MCR_I      XTAL_19_968MHz
1111
1212
1313/*----------- defined in drivers/mcr.c -----------*/
src/mame/includes/mario.h
r1527r1528
2626#define Z80_CLOCK            (Z80_MASTER_CLOCK / 2) /* verified on pcb */
2727
2828#define I8035_MASTER_CLOCK      XTAL_11MHz /* verified on pcb: 730Khz */
29#define I8035_DIVIDER         (15)
30#define I8035_CLOCK            (I8035_MASTER_CLOCK/I8035_DIVIDER)
29#define I8035_CLOCK            (I8035_MASTER_CLOCK)
3130
3231#define MARIO_PALETTE_LENGTH   (256)
3332
src/mame/mame.mak
r1527r1528
6666CPUS += I8039
6767CPUS += I8048
6868CPUS += N7751
69CPUS += MB8884
70CPUS += M58715
6971CPUS += I8X41
7072CPUS += I8051
7173CPUS += I8052
r1527r1528
124126CPUS += ARM7
125127CPUS += JAGUAR
126128CPUS += R3000
129CPUS += R3041
127130CPUS += R4600
128131CPUS += R4650
129132CPUS += R4700
r1527r1528
241244SOUNDS += TMS36XX
242245SOUNDS += TMS3615
243246SOUNDS += TMS5110
247SOUNDS += TMC0285
248SOUNDS += TMS5200
244249SOUNDS += TMS5220
245250SOUNDS += VLM5030
246251SOUNDS += ADPCM
r1527r1528
12341239   $(DRIVERS)/snk68.o $(VIDEO)/snk68.o \
12351240
12361241$(MAMEOBJ)/stern.a: \
1237   $(DRIVERS)/astinvad.o $(AUDIO)/astinvad.o $(VIDEO)/astinvad.o \
1238   $(DRIVERS)/berzerk.o $(AUDIO)/berzerk.o \
1242   $(DRIVERS)/astinvad.o \
1243   $(DRIVERS)/berzerk.o \
12391244   $(DRIVERS)/cliffhgr.o $(AUDIO)/cliffhgr.o \
12401245   $(DRIVERS)/mazerbla.o \
12411246   $(DRIVERS)/supdrapo.o \
r1527r1528
16031608   $(DRIVERS)/thayers.o \
16041609   $(DRIVERS)/thedeep.o $(VIDEO)/thedeep.o \
16051610   $(DRIVERS)/tiamc1.o $(VIDEO)/tiamc1.o $(AUDIO)/tiamc1.o \
1606   $(DRIVERS)/tickee.o $(VIDEO)/tickee.o \
1611   $(DRIVERS)/tickee.o \
16071612   $(DRIVERS)/truco.o $(VIDEO)/truco.o \
16081613   $(DRIVERS)/trucocl.o $(VIDEO)/trucocl.o \
16091614   $(DRIVERS)/trvmadns.o \
src/mame/video/nycaptor.c
r1527r1528
77***************************************************************************/
88#include "driver.h"
99
10#ifdef MAME_DEBUG
10#define NYCAPTOR_DEBUG   0
11
12#if NYCAPTOR_DEBUG
1113static  int nycaptor_mask=0;
1214#endif
1315
r1527r1528
5254  if((!nycaptor_spot())&&(pal==6))tileinfo->group=1;
5355   if(((nycaptor_spot()==3)&&(pal==8))||((nycaptor_spot()==1)&&(pal==0xc)))tileinfo->group=2;
5456   if((nycaptor_spot()==1)&&(tileinfo->category==2))tileinfo->group=3;
55#ifdef MAME_DEBUG
57#if NYCAPTOR_DEBUG
5658  if(nycaptor_mask&(1<<tileinfo->category))
5759  {
5860    if(nycaptor_spot())pal=0xe;else pal=4;
r1527r1528
160162         priori=(pr&0xe0)>>5;
161163      if(priori==pri)
162164      {
163#ifdef MAME_DEBUG
165#if NYCAPTOR_DEBUG
164166      if(nycaptor_mask&(1<<(pri+4)))pal=0xd;
165167#endif
166168         flipx = ((nycaptor_spriteram[offs+1]&0x40)>>6);
r1527r1528
192194
193195
194196
195#ifdef MAME_DEBUG
197#if NYCAPTOR_DEBUG
196198/*
197199 Keys :
198200   q/w/e/r - bg priority display select
r1527r1528
226228
227229VIDEO_UPDATE( nycaptor )
228230{
229#ifdef MAME_DEBUG
231#if NYCAPTOR_DEBUG
230232  nycaptor_setmask();
231233  if(nycaptor_mask&0x1000)
232234  {
src/mame/video/tunhunt.c
r1527r1528
5555   tilemap_mark_tile_dirty(fg_tilemap, offset);
5656}
5757
58WRITE8_HANDLER( tunhunt_mott_w )
59{
60   if( spriteram[offset]!=data )
61   {
62      spriteram[offset] = data;
63      dirtybuffer[offset>>4] = 1;
64   }
65}
66
6758static TILE_GET_INFO( get_fg_tile_info )
6859{
6960   int attr = videoram[tile_index];
r1527r1528
8172    We keep track of dirty lines and cache the expanded bitmap.
8273    With max RLE expansion, bitmap size is 256x64.
8374    */
84   dirtybuffer = auto_malloc(64);
85
86   memset( dirtybuffer, 1, 64 );
8775   tmpbitmap = auto_bitmap_alloc( 256, 64, machine->screen[0].format );
8876
8977   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
r1527r1528
226214
227215   for( line=0; line<64; line++ )
228216   {
229      if( dirtybuffer[line] )
217      x = 0;
218      source = &spriteram[line*0x10];
219      for( span=0; span<0x10; span++ )
230220      {
231         dirtybuffer[line] = 0;
232         x = 0;
233         source = &spriteram[line*0x10];
234         for( span=0; span<0x10; span++ )
235         {
236            span_data = source[span];
237            if( span_data == 0xff ) break;
238            color = ((span_data>>6)&0x3)^0x3;
239            count = (span_data&0x1f)+1;
240            while( count-- && x < 256 )
241            {
242               *BITMAP_ADDR16(tmpbitmap, line, x++) = machine->pens[color];
243            }
244         }
245         while( x<256 )
246         {
247            *BITMAP_ADDR16(tmpbitmap, line, x++) = machine->pens[0];
248         }
249      } /* dirty line */
221         span_data = source[span];
222         if( span_data == 0xff ) break;
223         color = ((span_data>>6)&0x3)^0x3;
224         count = (span_data&0x1f)+1;
225         while( count-- && x < 256 )
226            *BITMAP_ADDR16(tmpbitmap, line, x++) = machine->pens[color];
227      }
228      while( x<256 )
229         *BITMAP_ADDR16(tmpbitmap, line, x++) = machine->pens[0];
250230   } /* next line */
251231
252232   switch( tunhunt_ram[VSTRLO] )
src/mame/video/artmagic.c
r1527r1528
88#include "profiler.h"
99#include "cpu/tms34010/tms34010.h"
1010#include "cpu/tms34010/34010ops.h"
11#include "video/tlc34076.h"
1112#include "artmagic.h"
1213
1314
r1527r1528
349350{
350351   offs_t offset = (params->rowaddr << 12) & 0x7ff000;
351352   UINT16 *vram = address_to_vram(&offset);
352   UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
353   UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
354   const rgb_t *pens = tlc34076_get_pens();
353355   int coladdr = params->coladdr << 1;
354356   int x;
355357
356358   vram += offset;
357359   for (x = params->heblnk; x < params->hsblnk; x++)
358      dest[x] = vram[coladdr++ & 0x1ff] & 0xff;
360      dest[x] = pens[vram[coladdr++ & 0x1ff] & 0xff];
359361}
src/mame/video/thief.c
r1527r1528
44
55#include "driver.h"
66
7static mame_bitmap *thief_page0;
8static mame_bitmap *thief_page1;
9
107static UINT8 thief_read_mask, thief_write_mask;
118static UINT8 thief_video_control;
129
r1527r1528
4643/***************************************************************************/
4744
4845WRITE8_HANDLER( thief_video_control_w ){
49   if( (data^thief_video_control)&1 ){
50      /* screen flipped */
51      memset( dirtybuffer, 0x00, 0x2000*2 );
52   }
53
5446   thief_video_control = data;
5547/*
5648    bit 0: screen flip
r1527r1528
9789
9890WRITE8_HANDLER( thief_videoram_w ){
9991   UINT8 *dest = &videoram[offset];
100   if( thief_video_control&0x02 ){
92   if( thief_video_control&0x02 )
10193      dest+=0x2000*4; /* foreground/background */
102      dirtybuffer[offset+0x2000] = 1;
103   }
104   else {
105      dirtybuffer[offset] = 1;
106   }
10794   if( thief_write_mask&0x1 ) dest[0x2000*0] = data;
10895   if( thief_write_mask&0x2 ) dest[0x2000*1] = data;
10996   if( thief_write_mask&0x4 ) dest[0x2000*2] = data;
r1527r1528
115102VIDEO_START( thief ){
116103   memset( &thief_coprocessor, 0x00, sizeof(thief_coprocessor) );
117104
118   thief_page0   = auto_bitmap_alloc( 256,256,machine->screen[0].format );
119   thief_page1   = auto_bitmap_alloc( 256,256,machine->screen[0].format );
120
121105   videoram = auto_malloc( 0x2000*4*2 );
122106   memset( videoram, 0, 0x2000*4*2 );
123107
124   dirtybuffer = auto_malloc( 0x2000*2 );
125   memset( dirtybuffer, 1, 0x2000*2 );
126
127108   thief_coprocessor.image_ram = auto_malloc( 0x2000 );
128109   thief_coprocessor.context_ram = auto_malloc( 0x400 );
129110}
r1527r1528
132113   UINT32 offs;
133114   int flipscreen = thief_video_control&1;
134115   const pen_t *pal_data = machine->pens;
135   UINT8 *dirty = dirtybuffer;
136116   const UINT8 *source = videoram;
137   mame_bitmap *page;
138117
139   if( thief_video_control&4 ){ /* visible page */
140      dirty += 0x2000;
118   if( thief_video_control&4 ) /* visible page */
141119      source += 0x2000*4;
142      page = thief_page1;
143   }
144   else {
145      page = thief_page0;
146   }
147120
148121   for( offs=0; offs<0x2000; offs++ ){
149      if( dirty[offs] ){
150         int ypos = offs/32;
151         int xpos = (offs%32)*8;
152         int plane0 = source[0x2000*0+offs];
153         int plane1 = source[0x2000*1+offs];
154         int plane2 = source[0x2000*2+offs];
155         int plane3 = source[0x2000*3+offs];
156         int bit;
157         if( flipscreen ){
158            for( bit=0; bit<8; bit++ ){
159               *BITMAP_ADDR16(page, 0xff - ypos, 0xff - (xpos+bit)) =
160                  pal_data[
161                     (((plane0<<bit)&0x80)>>7) |
162                     (((plane1<<bit)&0x80)>>6) |
163                     (((plane2<<bit)&0x80)>>5) |
164                     (((plane3<<bit)&0x80)>>4)];
165            }
122      int ypos = offs/32;
123      int xpos = (offs%32)*8;
124      int plane0 = source[0x2000*0+offs];
125      int plane1 = source[0x2000*1+offs];
126      int plane2 = source[0x2000*2+offs];
127      int plane3 = source[0x2000*3+offs];
128      int bit;
129      if( flipscreen ){
130         for( bit=0; bit<8; bit++ ){
131            *BITMAP_ADDR16(bitmap, 0xff - ypos, 0xff - (xpos+bit)) =
132               pal_data[
133                  (((plane0<<bit)&0x80)>>7) |
134                  (((plane1<<bit)&0x80)>>6) |
135                  (((plane2<<bit)&0x80)>>5) |
136                  (((plane3<<bit)&0x80)>>4)];
166137         }
167         else {
168            for( bit=0; bit<8; bit++ ){
169               *BITMAP_ADDR16(page, ypos, xpos+bit) =
170                  pal_data[
171                     (((plane0<<bit)&0x80)>>7) |
172                     (((plane1<<bit)&0x80)>>6) |
173                     (((plane2<<bit)&0x80)>>5) |
174                     (((plane3<<bit)&0x80)>>4)];
175            }
138      }
139      else {
140         for( bit=0; bit<8; bit++ ){
141            *BITMAP_ADDR16(bitmap, ypos, xpos+bit) =
142               pal_data[
143                  (((plane0<<bit)&0x80)>>7) |
144                  (((plane1<<bit)&0x80)>>6) |
145                  (((plane2<<bit)&0x80)>>5) |
146                  (((plane3<<bit)&0x80)>>4)];
176147         }
177         dirty[offs] = 0;
178148      }
179149   }
180   copybitmap(bitmap,page,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
181150   return 0;
182151}
183152
src/mame/video/jedi.c
r1527r1528
1111/* globals */
1212UINT8 *jedi_backgroundram;
1313size_t jedi_backgroundram_size;
14UINT8 *jedi_PIXIRAM;
1514
1615
1716/* local variables */
r1527r1528
1918static UINT32 jedi_hscroll;
2019static UINT32 jedi_alpha_bank;
2120static UINT8 video_off, smooth_table;
22static UINT8 *fgdirty, *bgdirty;
2321static mame_bitmap *fgbitmap, *mobitmap, *bgbitmap, *bgexbitmap;
2422
2523
r1527r1528
3028 *
3129 *************************************/
3230
33static void jedi_postload(void)
34{
35   memset(fgdirty, 1, videoram_size);
36   memset(bgdirty, 1, jedi_backgroundram_size);
37}
38
39
4031VIDEO_START( jedi )
4132{
42   /* allocate dirty buffer for the foreground characters */
43   fgdirty = dirtybuffer = auto_malloc(videoram_size);
44   memset(fgdirty, 1, videoram_size);
45
4633   /* allocate an 8bpp bitmap for the raw foreground characters */
4734   fgbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
4835
r1527r1528
5037   mobitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
5138   fillbitmap(mobitmap, 0, &machine->screen[0].visarea);
5239
53   /* allocate dirty buffer for the background characters */
54   bgdirty = auto_malloc(jedi_backgroundram_size);
55   memset(bgdirty, 1, jedi_backgroundram_size);
56
5740   /* the background area is 256x256, doubled by the hardware*/
5841   bgbitmap = auto_bitmap_alloc(256, 256, machine->screen[0].format);
5942
r1527r1528
6952   state_save_register_global(jedi_alpha_bank);
7053   state_save_register_global(video_off);
7154   state_save_register_global(smooth_table);
72   state_save_register_func_postload(jedi_postload);
7355}
7456
7557
r1527r1528
123105
124106/*************************************
125107 *
126 *  Background access
127 *
128 *************************************/
129
130WRITE8_HANDLER( jedi_backgroundram_w )
131{
132   if (jedi_backgroundram[offset] != data)
133   {
134      bgdirty[offset] = 1;
135      jedi_backgroundram[offset] = data;
136   }
137}
138
139
140
141/*************************************
142 *
143108 *  Foreground banking
144109 *
145110 *************************************/
146111
147112WRITE8_HANDLER( jedi_alpha_banksel_w )
148113{
149   if (jedi_alpha_bank != 2 * (data & 0x80))
150   {
151      jedi_alpha_bank = 2 * (data & 0x80);
152      memset(fgdirty, 1, videoram_size);
153   }
114   jedi_alpha_bank = 2 * (data & 0x80);
154115}
155116
156117
r1527r1528
189150WRITE8_HANDLER( jedi_PIXIRAM_w )
190151{
191152   smooth_table = data & 0x03;
192   memset(bgdirty, 1, jedi_backgroundram_size);
193153}
194154
195155
r1527r1528
200160 *
201161 *************************************/
202162
203static void update_smoothing(int bgtilerow, int first, int last)
163static void update_smoothing(int bgtilerow)
204164{
205165   UINT8 *prom = memory_region(REGION_PROMS) + smooth_table * 0x100;
206166   UINT8 bgscan[2][256];
207167   UINT8 *bgcurr = bgscan[0], *bglast = bgscan[1];
208   int xstart, xstop, x, y;
168   int x, y;
209169
210170   /*
211171        smoothing notes:
r1527r1528
218178            * therefore, if we modify source pixels 8-15, we must update dest pixels 15-31
219179    */
220180
221   /* compute x start/stop in destination coordinates */
222   xstart = first * 16 - 1;
223   xstop = last * 16 + 15;
224
225181   /* extract the previous bg scanline */
226182   extract_scanline8(bgbitmap, 0, ((bgtilerow * 16 - 1) & 0x1ff) / 2, 256, bgcurr);
227183
r1527r1528
239195      extract_scanline8(bgbitmap, 0, curry / 2, 256, bgcurr);
240196
241197      /* loop over columns */
242      for (x = xstart; x <= xstop; x++)
198      for (x = -1; x <= 511; x++)
243199      {
244200         int tr = bglast[((x + 1) & 0x1ff) / 2];
245201         int br = bgcurr[((x + 1) & 0x1ff) / 2];
r1527r1528
269225
270226VIDEO_UPDATE( jedi )
271227{
272   int bgexdirty[32][2];
273228   int offs;
274229
275230
r1527r1528
289244
290245    /* update foreground bitmap as a raw bitmap*/
291246    for (offs = videoram_size - 1; offs >= 0; offs--)
292      if (fgdirty[offs])
293      {
294         int sx = offs % 64;
295         int sy = offs / 64;
247   {
248      int sx = offs % 64;
249      int sy = offs / 64;
296250
297         fgdirty[offs] = 0;
251      drawgfx(fgbitmap, machine->gfx[0], videoram[offs] + jedi_alpha_bank,
252            0, 0, 0, 8*sx, 8*sy, &machine->screen[0].visarea, TRANSPARENCY_NONE_RAW, 0);
253   }
298254
299         drawgfx(fgbitmap, machine->gfx[0], videoram[offs] + jedi_alpha_bank,
300               0, 0, 0, 8*sx, 8*sy, &machine->screen[0].visarea, TRANSPARENCY_NONE_RAW, 0);
301      }
302
303   /* reset the expanded dirty array */
304   for (offs = 0; offs < 32; offs++)
305      bgexdirty[offs][0] = bgexdirty[offs][1] = -1;
306
307255    /* update background bitmap as a raw bitmap */
308256   for (offs = jedi_backgroundram_size / 2 - 1; offs >= 0; offs--)
309      if (bgdirty[offs] || bgdirty[offs + 0x400])
310      {
311         int sx = offs % 32;
312         int sy = offs / 32;
313         int code = (jedi_backgroundram[offs] & 0xFF);
314         int bank = (jedi_backgroundram[offs + 0x400] & 0x0F);
257   {
258      int sx = offs % 32;
259      int sy = offs / 32;
260      int code = (jedi_backgroundram[offs] & 0xFF);
261      int bank = (jedi_backgroundram[offs + 0x400] & 0x0F);
315262
316         /* shuffle the bank bits in */
317         code |= (bank & 0x01) << 8;
318         code |= (bank & 0x08) << 6;
319         code |= (bank & 0x02) << 9;
263      /* shuffle the bank bits in */
264      code |= (bank & 0x01) << 8;
265      code |= (bank & 0x08) << 6;
266      code |= (bank & 0x02) << 9;
320267
321         bgdirty[offs] = bgdirty[offs + 0x400] = 0;
268      drawgfx(bgbitmap, machine->gfx[1], code,
269            0, bank & 0x04, 0, 8*sx, 8*sy, 0, TRANSPARENCY_NONE_RAW, 0);
270   }
322271
323         /* update expanded dirty status (assumes we go right-to-left) */
324         if (bgexdirty[sy][1] == -1)
325            bgexdirty[sy][1] = sx;
326         bgexdirty[sy][0] = sx;
327
328         drawgfx(bgbitmap, machine->gfx[1], code,
329               0, bank & 0x04, 0, 8*sx, 8*sy, 0, TRANSPARENCY_NONE_RAW, 0);
330      }
331
332272   /* update smoothed version of background */
333273   for (offs = 0; offs < 32; offs++)
334      if (bgexdirty[offs][1] != -1)
335         update_smoothing(offs, bgexdirty[offs][0], bgexdirty[offs][1]);
274      update_smoothing(offs);
336275
337276   /* draw the motion objects */
338277    for (offs = 0; offs < 0x30; offs++)
src/mame/video/paradise.c
r1527r1528
166166   /* pixmap */
167167   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
168168
169   /* paletteram and videoram (pixmap) are accessed through CPU ports, that don't
170       get memory automatically allocated for them */
171   paletteram   =   auto_malloc(0x1800);
172   videoram   =   auto_malloc(0x8000);
173
174169   tilemap_set_transparent_pen(tilemap_0,0x0f);
175170   tilemap_set_transparent_pen(tilemap_1,0xff);
176171   tilemap_set_transparent_pen(tilemap_2,0xff);
src/mame/video/mouser.c
r1527r1528
5353   flip_screen_y_set(~data & 1);
5454}
5555
56WRITE8_HANDLER( mouser_spriteram_w )
57{
58   /* Mark the entire row as dirty if row scrollram is written */
59   /* Only used by the MOUSER logo */
60
61   int i;
62
63   if (offset < 32)
64   {
65      for(i=0;i<32;i++)
66      dirtybuffer[offset+i*32] = 1;
67   }
68   spriteram_w(offset, data);
69}
70
71WRITE8_HANDLER( mouser_colorram_w )
72{
73   dirtybuffer[offset] = 1;
74   colorram_w(offset, data);
75}
76
7756VIDEO_UPDATE( mouser )
7857{
7958   int offs;
8059   int sx,sy;
8160   int flipx,flipy;
8261
83   /* for every character in the Video RAM, check if it has been modified */
84   /* since last time and update it accordingly. */
62   /* for every character in the Video RAM  */
8563   for (offs = videoram_size - 1;offs >= 0;offs--)
8664   {
8765      int scrolled_y_position;
8866      int color_offs;
8967
90      if (dirtybuffer[offs])
68      sx = offs % 32;
69      sy = offs / 32;
70
71      if (flip_screen_x)
9172      {
92         dirtybuffer[offs] = 0;
73         sx = 31 - sx;
74      }
9375
94         sx = offs % 32;
95         sy = offs / 32;
76      if (flip_screen_y)
77      {
78         sy = 31 - sy;
79      }
9680
97         if (flip_screen_x)
98         {
99            sx = 31 - sx;
100         }
81      /* This bit of spriteram appears to be for row scrolling */
82      /* Note: this is dependant on flipping in y */
83      scrolled_y_position = (256 + 8*sy - spriteram[offs%32])%256;
84      /* I think we still need to fetch the colorram bits to from the ram underneath, which is not scrolled */
85      /* Ideally we would merge these on a pixel-by-pixel basis, but it's ok to do this char-by-char, */
86      /* Since it's only for the MOUSER logo and it looks fine */
87      /* Note: this is _not_ dependant on flipping */
88      color_offs = offs%32 + ((256 + 8*(offs/32) - spriteram[offs%32])%256)/8*32;
10189
102         if (flip_screen_y)
103         {
104            sy = 31 - sy;
105         }
106
107         /* This bit of spriteram appears to be for row scrolling */
108         /* Note: this is dependant on flipping in y */
109         scrolled_y_position = (256 + 8*sy - spriteram[offs%32])%256;
110         /* I think we still need to fetch the colorram bits to from the ram underneath, which is not scrolled */
111         /* Ideally we would merge these on a pixel-by-pixel basis, but it's ok to do this char-by-char, */
112         /* Since it's only for the MOUSER logo and it looks fine */
113         /* Note: this is _not_ dependant on flipping */
114         color_offs = offs%32 + ((256 + 8*(offs/32) - spriteram[offs%32])%256)/8*32;
115
116         drawgfx(tmpbitmap,machine->gfx[0],
117               videoram[offs] | (colorram[color_offs]>>5)*256 | ((colorram[color_offs]>>4)&1)*512,
118               colorram[color_offs]%16,
119               flip_screen_x,flip_screen_y,
120               8*sx,scrolled_y_position,
121               0,TRANSPARENCY_NONE,0);
122      }
90      drawgfx(bitmap,machine->gfx[0],
91            videoram[offs] | (colorram[color_offs]>>5)*256 | ((colorram[color_offs]>>4)&1)*512,
92            colorram[color_offs]%16,
93            flip_screen_x,flip_screen_y,
94            8*sx,scrolled_y_position,
95            cliprect,TRANSPARENCY_NONE,0);
12396   }
12497
125   copyscrollbitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
126
12798   /* There seem to be two sets of sprites, each decoded identically */
12899
129100   /* This is the first set of 7 sprites */
r1527r1528
153124               spriteram[offs+1]%16,
154125               flipx,flipy,
155126               sx,sy,
156               &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
127               cliprect,TRANSPARENCY_PEN,0);
157128   }
158129
159130   /* This is the second set of 8 sprites */
r1527r1528
183154               spriteram[offs+1]%16,
184155               flipx,flipy,
185156               sx,sy,
186               &machine->screen[0].visarea,TRANSPARENCY_PEN,0);
157               cliprect,TRANSPARENCY_PEN,0);
187158   }
188159
189160   return 0;
src/mame/video/punchout.c
r1527r1528
99#include "driver.h"
1010
1111
12static tilemap *toptilemap;
13static tilemap *bottilemap;
12static tilemap *punchout_topTilemap;
13static tilemap *punchout_botTilemap;
14
1415static tilemap *spr1tilemap;
16static tilemap *spr1alttilemap;
1517static tilemap *spr2tilemap;
1618static tilemap *fgtilemap;
1719
18UINT8 *punchout_videoram2;
19UINT8 *armwrest_videoram3;
20UINT8 *punchout_topTilemap_ram;
21UINT8 *punchout_botTilemap_ram;
22UINT8 *punchout_botTilemap_scroll_ram;
23UINT8 *armwrest_fgTilemap_ram;
2024UINT8 *punchout_bigsprite1ram;
2125UINT8 *punchout_bigsprite2ram;
22UINT8 *punchout_scroll;
2326UINT8 *punchout_bigsprite1;
2427UINT8 *punchout_bigsprite2;
2528UINT8 *punchout_palettebank;
r1527r1528
187190***************************************************************************/
188191static TILE_GET_INFO( top_get_info )
189192{
190   int code = videoram[tile_index*2] + 256 * (videoram[tile_index*2 + 1] & 0x03);
191   int color = ((videoram[tile_index*2 + 1] & 0x7c) >> 2) + 64 * top_palette_bank;
192   int flipx = videoram[tile_index*2 + 1] & 0x80;
193   int code = punchout_topTilemap_ram[tile_index*2] + 256 * (punchout_topTilemap_ram[tile_index*2 + 1] & 0x03);
194   int color = ((punchout_topTilemap_ram[tile_index*2 + 1] & 0x7c) >> 2) + 64 * top_palette_bank;
195   int flipx = punchout_topTilemap_ram[tile_index*2 + 1] & 0x80;
193196   SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0);
194197}
195198
196199static TILE_GET_INFO( bot_get_info )
197200{
198   int code = punchout_videoram2[tile_index*2] + 256 * (punchout_videoram2[tile_index*2 + 1] & 0x03);
199   int color = ((punchout_videoram2[tile_index*2 + 1] & 0x7c) >> 2) + 64 * bottom_palette_bank;
200   int flipx = punchout_videoram2[tile_index*2 + 1] & 0x80;
201   int code = punchout_botTilemap_ram[tile_index*2] + 256 * (punchout_botTilemap_ram[tile_index*2 + 1] & 0x03);
202   int color = ((punchout_botTilemap_ram[tile_index*2 + 1] & 0x7c) >> 2) + 64 * bottom_palette_bank;
203   int flipx = punchout_botTilemap_ram[tile_index*2 + 1] & 0x80;
201204   SET_TILE_INFO(1, code, color, flipx ? TILE_FLIPX : 0);
202205}
203206
r1527r1528
219222
220223VIDEO_START( punchout )
221224{
222   toptilemap = tilemap_create(top_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
223   bottilemap = tilemap_create(bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
224   tilemap_set_scroll_rows(bottilemap, 32);
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);
227   tilemap_set_scroll_rows(punchout_botTilemap, 32);
225228
226229   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);
227231   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
228232
229233   fgtilemap = NULL;
r1527r1528
233237
234238static TILE_GET_INFO( armwrest_top_get_info )
235239{
236   int code = videoram[tile_index*2] + 256 * (videoram[tile_index*2 + 1] & 0x03) +
237                        8 * (videoram[tile_index*2 + 1] & 0x80);
238   int color = ((videoram[tile_index*2 + 1] & 0x7c) >> 2) + 64 * top_palette_bank;
240   int code = punchout_topTilemap_ram[tile_index*2] + 256 * (punchout_topTilemap_ram[tile_index*2 + 1] & 0x03) +
241                        8 * (punchout_topTilemap_ram[tile_index*2 + 1] & 0x80);
242   int color = ((punchout_topTilemap_ram[tile_index*2 + 1] & 0x7c) >> 2) + 64 * top_palette_bank;
239243   SET_TILE_INFO(0, code, color, 0);
240244}
241245
242246static TILE_GET_INFO( armwrest_bot_get_info )
243247{
244   int code = punchout_videoram2[tile_index*2] + 256 * (punchout_videoram2[tile_index*2 + 1] & 0x03);
245   int color = 128 + ((punchout_videoram2[tile_index*2 + 1] & 0x7c) >> 2) + 64 * bottom_palette_bank;
246   int flipx = punchout_videoram2[tile_index*2 + 1] & 0x80;
248   int code = punchout_botTilemap_ram[tile_index*2] + 256 * (punchout_botTilemap_ram[tile_index*2 + 1] & 0x03);
249   int color = 128 + ((punchout_botTilemap_ram[tile_index*2 + 1] & 0x7c) >> 2) + 64 * bottom_palette_bank;
250   int flipx = punchout_botTilemap_ram[tile_index*2 + 1] & 0x80;
247251   SET_TILE_INFO(0, code, color, flipx ? TILE_FLIPX : 0);
248252}
249253
r1527r1528
253257   return (col/halfcols)*(halfcols*num_rows) + row*halfcols + col%halfcols;
254258}
255259
260static TILEMAP_MAPPER( armwrest_bs1alt_scan )
261{
262   int halfcols = num_cols/2;
263   col ^=0x10;
264   return (col/halfcols)*(halfcols*num_rows) + row*halfcols + col%halfcols;
265}
266
267
268
256269static TILE_GET_INFO( armwrest_fg_get_info )
257270{
258   int code = armwrest_videoram3[tile_index*2] + 256 * (armwrest_videoram3[tile_index*2 + 1] & 0x07);
259   int color = ((armwrest_videoram3[tile_index*2 + 1] & 0xf8) >> 3) + 32 * bottom_palette_bank;
260   int flipx = armwrest_videoram3[tile_index*2 + 1] & 0x80;
271   int code = armwrest_fgTilemap_ram[tile_index*2] + 256 * (armwrest_fgTilemap_ram[tile_index*2 + 1] & 0x07);
272   int color = ((armwrest_fgTilemap_ram[tile_index*2 + 1] & 0xf8) >> 3) + 32 * bottom_palette_bank;
273   int flipx = armwrest_fgTilemap_ram[tile_index*2 + 1] & 0x80;
261274   SET_TILE_INFO(1, code, color, flipx ? TILE_FLIPX : 0);
262275}
263276
264277VIDEO_START( armwrest )
265278{
266   toptilemap = tilemap_create(armwrest_top_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
267   bottilemap = tilemap_create(armwrest_bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
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);
268281
269282   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);
270284   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
271285
272286   fgtilemap = tilemap_create(armwrest_fg_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
r1527r1528
275289
276290
277291
278WRITE8_HANDLER( punchout_videoram_w )
292WRITE8_HANDLER( punchout_topTilemap_ram_w )
279293{
280   videoram[offset] = data;
281   tilemap_mark_tile_dirty(toptilemap, offset/2);
294   punchout_topTilemap_ram[offset] = data;
295   tilemap_mark_tile_dirty(punchout_topTilemap, offset/2);
282296}
283297
284WRITE8_HANDLER( punchout_videoram2_w )
298WRITE8_HANDLER( punchout_botTilemap_ram_w )
285299{
286   punchout_videoram2[offset] = data;
287   tilemap_mark_tile_dirty(bottilemap, offset/2);
300   punchout_botTilemap_ram[offset] = data;
301   tilemap_mark_tile_dirty(punchout_botTilemap, offset/2);
288302}
289303
290WRITE8_HANDLER( armwrest_videoram3_w )
304WRITE8_HANDLER( armwrest_fgTilemap_ram_w )
291305{
292   armwrest_videoram3[offset] = data;
306   armwrest_fgTilemap_ram[offset] = data;
293307   tilemap_mark_tile_dirty(fgtilemap, offset/2);
294308}
295309
r1527r1528
297311{
298312   punchout_bigsprite1ram[offset] = data;
299313   tilemap_mark_tile_dirty(spr1tilemap, offset/4);
314   if (spr1alttilemap) tilemap_mark_tile_dirty(spr1alttilemap, offset/4);
300315}
301316
302317WRITE8_HANDLER( punchout_bigsprite2ram_w )
r1527r1528
314329   if (top_palette_bank != ((data >> 1) & 0x01))
315330   {
316331      top_palette_bank = (data >> 1) & 0x01;
317      tilemap_mark_all_tiles_dirty(toptilemap);
332      tilemap_mark_all_tiles_dirty(punchout_topTilemap);
318333   }
319334   if (bottom_palette_bank != ((data >> 0) & 0x01))
320335   {
321336      bottom_palette_bank = (data >> 0) & 0x01;
322337      if (fgtilemap != NULL)
323338         tilemap_mark_all_tiles_dirty(fgtilemap);
324      tilemap_mark_all_tiles_dirty(bottilemap);
339      tilemap_mark_all_tiles_dirty(punchout_botTilemap);
325340      tilemap_mark_all_tiles_dirty(spr1tilemap);
326341      tilemap_mark_all_tiles_dirty(spr2tilemap);
327342   }
r1527r1528
370385   }
371386}
372387
388
389static void armwrest_draw_big_sprite(mame_bitmap *bitmap, const rectangle *cliprect)
390{
391   int zoom;
392
393   zoom = punchout_bigsprite1[0] + 256 * (punchout_bigsprite1[1] & 0x0f);
394   if (zoom)
395   {
396      mame_bitmap *sprbitmap;
397      int sx,sy;
398      UINT32 startx,starty;
399      int incxx,incyy;
400
401      sx = 4096 - (punchout_bigsprite1[2] + 256 * (punchout_bigsprite1[3] & 0x0f));
402      if (sx > 2048) sx -= 4096;
403
404      sy = -(punchout_bigsprite1[4] + 256 * (punchout_bigsprite1[5] & 1));
405      if (sy <= -256 + zoom/0x40) sy += 512;
406      sy += 12;
407
408      incxx = zoom << 6;
409      incyy = zoom << 6;
410
411      startx = -sx * 0x4000;
412      starty = -sy * 0x10000;
413      startx += 3740 * zoom;   /* adjustment to match the screen shots */
414      starty -= 178 * zoom;   /* and make the hall of fame picture nice */
415
416       sprbitmap = tilemap_get_pixmap(spr1tilemap);
417
418      if (punchout_bigsprite1[6] & 1)   /* flip x */
419      {
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;
422         incxx = -incxx;
423      }
424
425      copyrozbitmap(bitmap,sprbitmap,
426         startx,starty + 0x200*(2) * zoom,
427         incxx,0,0,incyy,   /* zoom, no rotation */
428         0,   /* no wraparound */
429         cliprect,TRANSPARENCY_COLOR,1024,0);
430   }
431}
432
373433static void drawbs2(mame_bitmap *bitmap, const rectangle *cliprect)
374434{
375435   mame_bitmap *sprbitmap = tilemap_get_pixmap(spr2tilemap);
r1527r1528
392452{
393453   if (screen == 1)
394454   {
395      tilemap_draw(bitmap, cliprect, toptilemap, 0, 0);
455      tilemap_draw(bitmap, cliprect, punchout_topTilemap, 0, 0);
396456
397457      if (punchout_bigsprite1[7] & 1)   /* display in top monitor */
398458         draw_big_sprite(bitmap, cliprect);
r1527r1528
403463
404464      /* copy the character mapped graphics */
405465      for (offs = 0;offs < 32;offs++)
406         tilemap_set_scrollx(bottilemap, offs, 58 + punchout_scroll[2*offs] + 256 * (punchout_scroll[2*offs + 1] & 0x01));
466         tilemap_set_scrollx(punchout_botTilemap, offs, 58 + punchout_botTilemap_scroll_ram[2*offs] + 256 * (punchout_botTilemap_scroll_ram[2*offs + 1] & 0x01));
407467
408      tilemap_draw(bitmap, cliprect, bottilemap, 0, 0);
468      tilemap_draw(bitmap, cliprect, punchout_botTilemap, 0, 0);
409469
410470      if (punchout_bigsprite1[7] & 2)   /* display in bottom monitor */
411471         draw_big_sprite(bitmap, cliprect);
r1527r1528
419479{
420480   if (screen == 1)
421481   {
422      tilemap_draw(bitmap, cliprect, toptilemap, 0, 0);
482      tilemap_draw(bitmap, cliprect, punchout_topTilemap, 0, 0);
423483
424484      if (punchout_bigsprite1[7] & 1)   /* display in top monitor */
425         draw_big_sprite(bitmap, cliprect);
485         armwrest_draw_big_sprite(bitmap, cliprect);
426486   }
427487   else
428488   {
429      tilemap_draw(bitmap, cliprect, bottilemap, 0, 0);
489      tilemap_draw(bitmap, cliprect, punchout_botTilemap, 0, 0);
430490
431491      if (punchout_bigsprite1[7] & 2)   /* display in bottom monitor */
432         draw_big_sprite(bitmap, cliprect);
492         armwrest_draw_big_sprite(bitmap, cliprect);
433493      drawbs2(bitmap, cliprect);
434494
435495      tilemap_draw(bitmap, cliprect, fgtilemap, 0, 0);
src/mame/video/finalizr.c
r1527r1528
6868
6969VIDEO_START( finalizr )
7070{
71   dirtybuffer = 0;
72   tmpbitmap = 0;
73
74   dirtybuffer = auto_malloc(videoram_size);
75   memset(dirtybuffer,1,videoram_size);
76
7771   tmpbitmap = auto_bitmap_alloc(256,256,machine->screen[0].format);
7872}
7973
r1527r1528
8175
8276WRITE8_HANDLER( finalizr_videoctrl_w )
8377{
84   if (charbank != (data & 3))
85   {
86      charbank = data & 3;
87      memset(dirtybuffer,1,videoram_size);
88   }
78   charbank = data & 3;
8979
9080   spriterambank = data & 8;
9181
r1527r1528
9989   int offs;
10090
10191
102   /* for every character in the Video RAM, check if it has been modified */
103   /* since last time and update it accordingly. */
92   /* for every character in the Video RAM */
10493   for (offs = videoram_size - 1;offs >= 0;offs--)
10594   {
106      if (dirtybuffer[offs])
107      {
108         int sx,sy;
95      int sx,sy;
10996
11097
111         dirtybuffer[offs] = 0;
98      sx = offs % 32;
99      sy = offs / 32;
112100
113         sx = offs % 32;
114         sy = offs / 32;
115
116         drawgfx(tmpbitmap,machine->gfx[0],
117               videoram[offs] + ((colorram[offs] & 0xc0) << 2) + (charbank<<10),
118               (colorram[offs] & 0x0f),
119               colorram[offs] & 0x10,colorram[offs] & 0x20,
120               8*sx,8*sy,
121               0,TRANSPARENCY_NONE,0);
122      }
101      drawgfx(tmpbitmap,machine->gfx[0],
102            videoram[offs] + ((colorram[offs] & 0xc0) << 2) + (charbank<<10),
103            (colorram[offs] & 0x0f),
104            colorram[offs] & 0x10,colorram[offs] & 0x20,
105            8*sx,8*sy,
106            0,TRANSPARENCY_NONE,0);
123107   }
124108
125109
src/mame/video/vdc.c
r1527r1528
9090      /* Check if we need to draw more just the overscan color */
9191      if ( vdc[0].current_segment == STATE_VDW ) {
9292         /* 0 - no sprite and background pixels drawn
93            1 - background pixel drawn
94            otherwise is 2 + sprite# */
93               1 - background pixel drawn
94               otherwise is 2 + sprite# */
9595         UINT8 drawn[VDC_WPF];
9696         /* our line buffer */
9797         UINT16 *line_buffer = BITMAP_ADDR16( vce.bmp, vce.current_bitmap_line, 86 );
r1527r1528
130130      /* Check if we need to draw more just the overscan color */
131131      if ( vdc[0].current_segment == STATE_VDW ) {
132132         /* 0 - no sprite and background pixels drawn
133            1 - background pixel drawn
134            otherwise is 2 + sprite# */
133               1 - background pixel drawn
134               otherwise is 2 + sprite# */
135135         UINT8 drawn[2][512];
136136         UINT16 *line_buffer;
137137         UINT16 temp_buffer[2][512];
r1527r1528
190190                     }
191191                     break;
192192                  case 2: /* BG1 + SP1 => SP1
193                           BG0 + SP1 => BG0
194                           BG0 + BG1 => BG0
195                           BG0 + SP0 => SP0
196                           BG1 + SP0 => BG1
197                           SP0 + SP1 => SP0 */
193                                   BG0 + SP1 => BG0
194                                   BG0 + BG1 => BG0
195                                   BG0 + SP0 => SP0
196                                   BG1 + SP0 => BG1
197                                   SP0 + SP1 => SP0 */
198198                     if ( drawn[0][i] ) {
199199                        if ( drawn[0][i] > 1 ) {
200200                           if ( drawn[1][i] == 1 ) {
r1527r1528
326326         int i;
327327
328328         vdc[which].dvssr_write = 0;
329
329#ifdef MAME_DEBUG
330330         assert(((vdc[which].vdc_data[DVSSR].w<<1) + 512) <= 0x10000);
331
331#endif
332332         for( i = 0; i < 256; i++ ) {
333333            vdc[which].sprite_ram[i] = ( vdc[which].vram[ ( vdc[which].vdc_data[DVSSR].w << 1 ) + i * 2 + 1 ] << 8 ) | vdc[which].vram[ ( vdc[which].vdc_data[DVSSR].w << 1 ) + i * 2 ];
334334         }
r1527r1528
475475               break;
476476
477477            case LENR:
478//               logerror("LENR LSB = %02X\n", data);
478//                  logerror("LENR LSB = %02X\n", data);
479479               break;
480480            case SOUR:
481//               logerror("SOUR LSB = %02X\n", data);
481//                  logerror("SOUR LSB = %02X\n", data);
482482               break;
483483            case DESR:
484//               logerror("DESR LSB = %02X\n", data);
484//                  logerror("DESR LSB = %02X\n", data);
485485               break;
486486         }
487487         break;
r1527r1528
522522               vdc_do_dma( which );
523523               break;
524524            case SOUR:
525//               logerror("SOUR MSB = %02X\n", data);
525//                  logerror("SOUR MSB = %02X\n", data);
526526               break;
527527            case DESR:
528//               logerror("DESR MSB = %02X\n", data);
528//                  logerror("DESR MSB = %02X\n", data);
529529               break;
530530         }
531531         break;
r1527r1528
897897            }
898898
899899            /* 32 pixel wide sprites are counted as 2 sprites and the right half
900               is only drawn if there are 2 open slots.
901            */
900                   is only drawn if there are 2 open slots.
901                */
902902            sprites_drawn++;
903903            if( sprites_drawn > 16 ) {
904904               vdc[which].status |= VDC_OR;
src/mame/video/goldstar.c
r1527r1528
1414size_t goldstar_video_size;
1515UINT8 *goldstar_scroll1, *goldstar_scroll2, *goldstar_scroll3;
1616
17static UINT8 *dirtybuffer1, *dirtybuffer2, *dirtybuffer3;
1817static mame_bitmap *tmpbitmap1, *tmpbitmap2, *tmpbitmap3;
1918static int bgcolor;
2019
r1527r1528
3130
3231   video_start_generic(machine);
3332
34   dirtybuffer1 = auto_malloc(3 * goldstar_video_size * sizeof(UINT8));
35   dirtybuffer2 = dirtybuffer1 + goldstar_video_size;
36   dirtybuffer3 = dirtybuffer2 + goldstar_video_size;
37
3833   /* the background area is half as high as the screen */
3934   tmpbitmap1 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
4035   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
r1527r1528
4742
4843
4944
50WRITE8_HANDLER( goldstar_video1_w )
51{
52   if (goldstar_video1[offset] != data)
53   {
54      dirtybuffer1[offset] = 1;
55      goldstar_video1[offset] = data;
56   }
57}
58WRITE8_HANDLER( goldstar_video2_w )
59{
60   if (goldstar_video2[offset] != data)
61   {
62      dirtybuffer2[offset] = 1;
63      goldstar_video2[offset] = data;
64   }
65}
66WRITE8_HANDLER( goldstar_video3_w )
67{
68   if (goldstar_video3[offset] != data)
69   {
70      dirtybuffer3[offset] = 1;
71      goldstar_video3[offset] = data;
72   }
73}
74
75
76
7745WRITE8_HANDLER( goldstar_fa00_w )
7846{
7947   /* bit 1 toggles continuously - might be irq enable or watchdog reset */
8048
8149   /* bit 2 selects background gfx color (I think) */
82   if (bgcolor != ((data & 0x04) >> 2))
83   {
84      bgcolor = (data & 0x04) >> 2;
85      memset(dirtybuffer1,1,goldstar_video_size);
86      memset(dirtybuffer2,1,goldstar_video_size);
87      memset(dirtybuffer3,1,goldstar_video_size);
88   }
50   bgcolor = (data & 0x04) >> 2;
8951}
9052
9153
r1527r1528
10062   int offs;
10163
10264
103//        if (palette_recalc())
104   {
105      memset(dirtybuffer,1,videoram_size);
106      memset(dirtybuffer1,1,goldstar_video_size);
107      memset(dirtybuffer2,1,goldstar_video_size);
108      memset(dirtybuffer3,1,goldstar_video_size);
109   }
110
11165   for (offs = videoram_size - 1;offs >= 0;offs--)
11266   {
113      if (dirtybuffer[offs])
114      {
115         int sx,sy;
67      int sx,sy;
11668
11769
118         dirtybuffer[offs] = 0;
70      sx = offs % 64;
71      sy = offs / 64;
11972
120         sx = offs % 64;
121         sy = offs / 64;
122
123         drawgfx(tmpbitmap,machine->gfx[0],
124               videoram[offs] + ((colorram[offs] & 0xf0) << 4),
125               colorram[offs] & 0x0f,
126               0,0,
127               8*sx,8*sy,
128               0,TRANSPARENCY_NONE,0);
129      }
73      drawgfx(tmpbitmap,machine->gfx[0],
74            videoram[offs] + ((colorram[offs] & 0xf0) << 4),
75            colorram[offs] & 0x0f,
76            0,0,
77            8*sx,8*sy,
78            0,TRANSPARENCY_NONE,0);
13079   }
13180
13281   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
r1527r1528
13887      int sy = offs / 64;
13988
14089
141      if (dirtybuffer1[offs])
142      {
143         dirtybuffer1[offs] = 0;
90      drawgfx(tmpbitmap1,machine->gfx[1],
91            goldstar_video1[offs],
92            bgcolor,
93            0,0,
94            sx*8,sy*32,
95            0,TRANSPARENCY_NONE,0);
14496
145         drawgfx(tmpbitmap1,machine->gfx[1],
146               goldstar_video1[offs],
147               bgcolor,
148               0,0,
149               sx*8,sy*32,
150               0,TRANSPARENCY_NONE,0);
151      }
97      drawgfx(tmpbitmap2,machine->gfx[1],
98            goldstar_video2[offs],
99            bgcolor,
100            0,0,
101            sx*8,sy*32,
102            0,TRANSPARENCY_NONE,0);
152103
153      if (dirtybuffer2[offs])
154      {
155         dirtybuffer2[offs] = 0;
156
157         drawgfx(tmpbitmap2,machine->gfx[1],
158               goldstar_video2[offs],
159               bgcolor,
160               0,0,
161               sx*8,sy*32,
162               0,TRANSPARENCY_NONE,0);
163      }
164
165      if (dirtybuffer3[offs])
166      {
167         dirtybuffer3[offs] = 0;
168
169         drawgfx(tmpbitmap3,machine->gfx[1],
170               goldstar_video3[offs],
171               bgcolor,
172               0,0,
173               sx*8,sy*32,
174               0,TRANSPARENCY_NONE,0);
175      }
104      drawgfx(tmpbitmap3,machine->gfx[1],
105            goldstar_video3[offs],
106            bgcolor,
107            0,0,
108            sx*8,sy*32,
109            0,TRANSPARENCY_NONE,0);
176110   }
177111
178112   {
src/mame/video/vdc.h
r1527r1528
11
22#include "driver.h"
3#include "video/generic.h"
34
45VIDEO_START( pce );
56VIDEO_UPDATE( pce );
src/mame/video/redalert.c
r1527r1528
9090      (redalert_backcolor[charnum] != backcolor))
9191   {
9292      redalert_dirtyback[charnum] = 1;
93      dirtybuffer[charnum] = 1;
9493      redalert_backcolor[charnum] = backcolor;
9594
9695      redalert_backram[offset] = data;
r1527r1528
166165{
167166   int offs,i;
168167
169   /* for every character in the Video RAM, check if it has been modified */
170   /* since last time and update it accordingly. */
168   /* for every character in the Video RAM  */
171169   for (offs = videoram_size - 1;offs >= 0;offs--)
172170   {
173171      int charcode;
174172      int stat_transparent;
173      int sx,sy,color;
175174
176
177175      charcode = videoram[offs];
178176
179      if (dirtybuffer[offs] || redalert_dirtycharacter[charcode] || redalert_dirtycharacter2[charcode])
177      /* decode modified background */
178      if (redalert_dirtyback[offs] == 1)
180179      {
181         int sx,sy,color;
180         decodechar(machine->gfx[0],offs,redalert_backram);
181         redalert_dirtyback[offs] = 2;
182      }
182183
184      /* decode modified characters */
185      if (redalert_dirtycharacter[charcode] == 1)
186      {
187         if (charcode < 0x80)
188            decodechar(machine->gfx[1],charcode,redalert_characterram);
189         else
190            decodechar(machine->gfx[2],charcode-0x80,redalert_spriteram1);
191         redalert_dirtycharacter[charcode] = 2;
192      }
183193
184         /* decode modified background */
185         if (redalert_dirtyback[offs] == 1)
186         {
187            decodechar(machine->gfx[0],offs,redalert_backram);
188            redalert_dirtyback[offs] = 2;
189         }
194      if (redalert_dirtycharacter2[charcode] == 1)
195      {
196         decodechar(machine->gfx[3],charcode-0x80,redalert_spriteram3);
197         redalert_dirtycharacter2[charcode] = 2;
198      }
190199
191         /* decode modified characters */
192         if (redalert_dirtycharacter[charcode] == 1)
193         {
194            if (charcode < 0x80)
195               decodechar(machine->gfx[1],charcode,redalert_characterram);
196            else
197               decodechar(machine->gfx[2],charcode-0x80,redalert_spriteram1);
198            redalert_dirtycharacter[charcode] = 2;
199         }
200      sx = 31 - offs / 32;
201      sy = offs % 32;
200202
201         if (redalert_dirtycharacter2[charcode] == 1)
202         {
203            decodechar(machine->gfx[3],charcode-0x80,redalert_spriteram3);
204            redalert_dirtycharacter2[charcode] = 2;
205         }
203      stat_transparent = TRANSPARENCY_NONE;
206204
207         dirtybuffer[offs] = 0;
205      /* First layer of color */
206      if (charcode >= 0xC0)
207      {
208         stat_transparent = TRANSPARENCY_COLOR;
208209
209         sx = 31 - offs / 32;
210         sy = offs % 32;
210         color = color_lookup[charcode];
211211
212         stat_transparent = TRANSPARENCY_NONE;
212         drawgfx(tmpbitmap,machine->gfx[2],
213               charcode-0x80,
214               color,
215               0,0,
216               8*sx,8*sy,
217               &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
213218
214         /* First layer of color */
215         if (charcode >= 0xC0)
216         {
217            stat_transparent = TRANSPARENCY_COLOR;
218
219            color = color_lookup[charcode];
220
221            drawgfx(tmpbitmap,machine->gfx[2],
219         if( redalert_dirtycharacter2[charcode] != 0 )
220            drawgfx(tmpbitmap,machine->gfx[3],
222221                  charcode-0x80,
223222                  color,
224223                  0,0,
225224                  8*sx,8*sy,
226                  &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
225                  &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
227226
228            if( redalert_dirtycharacter2[charcode] != 0 )
229               drawgfx(tmpbitmap,machine->gfx[3],
230                     charcode-0x80,
231                     color,
232                     0,0,
233                     8*sx,8*sy,
234                     &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
227      }
235228
236         }
229      /* Second layer - background */
230      color = redalert_backcolor[offs];
231      drawgfx(tmpbitmap,machine->gfx[0],
232            offs,
233            color,
234            0,0,
235            8*sx,8*sy,
236            &machine->screen[0].visarea,stat_transparent,0);
237237
238         /* Second layer - background */
239         color = redalert_backcolor[offs];
240         drawgfx(tmpbitmap,machine->gfx[0],
241               offs,
238      /* Third layer - alphanumerics & sprites */
239      if (charcode < 0x80)
240      {
241         color = color_lookup[charcode];
242         drawgfx(tmpbitmap,machine->gfx[1],
243               charcode,
242244               color,
243245               0,0,
244246               8*sx,8*sy,
245               &machine->screen[0].visarea,stat_transparent,0);
247               &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
248      }
249      else if (charcode < 0xC0)
250      {
251         color = color_lookup[charcode];
252         drawgfx(tmpbitmap,machine->gfx[2],
253               charcode-0x80,
254               color,
255               0,0,
256               8*sx,8*sy,
257               &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
246258
247         /* Third layer - alphanumerics & sprites */
248         if (charcode < 0x80)
249         {
250            color = color_lookup[charcode];
251            drawgfx(tmpbitmap,machine->gfx[1],
252                  charcode,
253                  color,
254                  0,0,
255                  8*sx,8*sy,
256                  &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
257         }
258         else if (charcode < 0xC0)
259         {
260            color = color_lookup[charcode];
261            drawgfx(tmpbitmap,machine->gfx[2],
259         if( redalert_dirtycharacter2[charcode] != 0 )
260            drawgfx(tmpbitmap,machine->gfx[3],
262261                  charcode-0x80,
263262                  color,
264263                  0,0,
265264                  8*sx,8*sy,
266265                  &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
267266
268            if( redalert_dirtycharacter2[charcode] != 0 )
269               drawgfx(tmpbitmap,machine->gfx[3],
270                     charcode-0x80,
271                     color,
272                     0,0,
273                     8*sx,8*sy,
274                     &machine->screen[0].visarea,TRANSPARENCY_COLOR,0);
275
276         }
277
278267      }
279268   }
280269
r1527r1528
294283   }
295284
296285   /* copy the character mapped graphics */
297   copybitmap(bitmap,tmpbitmap,flip,flip,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
286   copybitmap(bitmap,tmpbitmap,flip,flip,0,0,cliprect,TRANSPARENCY_NONE,0);
298287
299288   return 0;
300289}
src/mame/video/wiz.c
r1527r1528
9191   }
9292}
9393
94WRITE8_HANDLER( wiz_attributes_w )
95{
96   if ((offset & 1) && wiz_attributesram[offset] != data)
97   {
98      int i;
99
100
101      for (i = offset / 2;i < videoram_size;i += 32)
102      {
103         dirtybuffer[i] = 1;
104      }
105   }
106
107   wiz_attributesram[offset] = data;
108}
109
11094WRITE8_HANDLER( wiz_palettebank_w )
11195{
112   if (palbank[offset] != (data & 1))
113   {
114      palbank[offset] = data & 1;
115      palette_bank = palbank[0] + 2 * palbank[1];
116
117      memset(dirtybuffer,1,videoram_size);
118   }
96   palbank[offset] = data & 1;
97   palette_bank = palbank[0] + 2 * palbank[1];
11998}
12099
121100WRITE8_HANDLER( wiz_bgcolor_w )
r1527r1528
125104
126105WRITE8_HANDLER( wiz_char_bank_select_w )
127106{
128   if (char_bank[offset] != (data & 1))
129   {
130      char_bank[offset] = data & 1;
131      memset(dirtybuffer,1,videoram_size);
132   }
107   char_bank[offset] = data & 1;
133108}
134109
135110WRITE8_HANDLER( wiz_flipx_w )
136111{
137    if (flipx != data)
138    {
139      flipx = data;
140
141      memset(dirtybuffer, 1, videoram_size);
142    }
112   flipx = data;
143113}
144114
145115
146116WRITE8_HANDLER( wiz_flipy_w )
147117{
148    if (flipy != data)
149    {
150      flipy = data;
151
152      memset(dirtybuffer, 1, videoram_size);
153    }
118   flipy = data;
154119}
155120
156121static void draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int bank, int colortype)
src/mame/video/lethalj.c
r1527r1528
1717static UINT16 blitter_data[8];
1818
1919static UINT16 *screenram;
20static UINT8 vispage;
2021static UINT16 *blitter_base;
2122static int blitter_rows;
2223
r1527r1528
2526
2627
2728
29
2830/*************************************
2931 *
3032 *  Compute X/Y coordinates
3133 *
3234 *************************************/
3335
34INLINE void get_crosshair_xy(int player, int *x, int *y)
36INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
3537{
36   *x = ((readinputport(2 + player * 2) & 0xff) * Machine->screen[0].width) / 255;
37   *y = ((readinputport(3 + player * 2) & 0xff) * Machine->screen[0].height) / 255;
38   int width = machine->screen[0].visarea.max_x + 1 - machine->screen[0].visarea.min_x;
39   int height = machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y;
40   *x = ((readinputport(2 + player * 2) & 0xff) * width) / 255;
41   *y = ((readinputport(3 + player * 2) & 0xff) * height) / 255;
3842}
3943
4044
r1527r1528
5559      case 4:
5660      case 5:
5761         /* latch the crosshair position */
58         get_crosshair_xy(offset - 4, &beamx, &beamy);
62         get_crosshair_xy(Machine, offset - 4, &beamx, &beamy);
5963         gunx = beamx;
6064         guny = beamy;
6165         blank_palette = 1;
6266         break;
6367
6468      case 6:
65         result = gunx/2;
69         result = gunx / 2;
6670         break;
6771
6872      case 7:
r1527r1528
110114{
111115   int dsty = (INT16)blitter_data[1];
112116   int srcx = (UINT16)blitter_data[2];
113   int srcy = (UINT16)blitter_data[3];
117   int srcy = (UINT16)(blitter_data[3] + 1);
114118   int width = (UINT16)blitter_data[5];
115119   int dstx = (INT16)blitter_data[6];
116120   int height = (UINT16)blitter_data[7];
117121   int y;
118
119   if (srcy == 0xffff)
120   {
121      return;
122   }
123
124/*  logerror("blitter data = %04X %04X %04X %04X %04X %04X %04X %04X\n",
122/*
123    logerror("blitter data = %04X %04X %04X %04X %04X %04X %04X %04X\n",
125124            blitter_data[0], blitter_data[1], blitter_data[2], blitter_data[3],
126            blitter_data[4], blitter_data[5], blitter_data[6], blitter_data[7]);*/
127
125            blitter_data[4], blitter_data[5], blitter_data[6], blitter_data[7]);
126*/
128127   /* loop over Y coordinates */
129128   for (y = 0; y <= height; y++, srcy++, dsty++)
130129   {
131      UINT16 *source = blitter_base + srcy * BLITTER_SOURCE_WIDTH;
132      UINT16 *dest = screenram + dsty * BLITTER_DEST_WIDTH;
133
134130      /* clip in Y */
135      if (dsty >= 0 && dsty < BLITTER_DEST_HEIGHT)
131      if (dsty >= 0 && dsty < BLITTER_DEST_HEIGHT/2)
136132      {
133         UINT16 *source = blitter_base + (srcy % blitter_rows) * BLITTER_SOURCE_WIDTH;
134         UINT16 *dest = screenram + (dsty + (vispage ^ 1) * 256) * BLITTER_DEST_WIDTH;
137135         int sx = srcx;
138136         int dx = dstx;
139137         int x;
r1527r1528
151149}
152150
153151
154
155152WRITE16_HANDLER( lethalj_blitter_w )
156153{
157154   /* combine the data */
r1527r1528
160157   /* blit on a write to offset 7, and signal an IRQ */
161158   if (offset == 7)
162159   {
163      do_blit();
164      timer_set(ATTOTIME_IN_USEC(10), NULL, 0, gen_ext1_int);
160      if (blitter_data[6] == 2 && blitter_data[7] == 2)
161         vispage ^= 1;
162      else
163         do_blit();
164
165      timer_set(attotime_mul(ATTOTIME_IN_HZ(XTAL_32MHz), (blitter_data[5] + 1) * (blitter_data[7] + 1)), NULL, 0, gen_ext1_int);
165166   }
166167
167168   /* clear the IRQ on offset 0 */
r1527r1528
179180
180181void lethalj_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
181182{
182   UINT16 *src = &screenram[(params->rowaddr << 9) & 0x3fe00];
183   UINT16 *src = &screenram[(vispage << 17) | ((params->rowaddr << 9) & 0x3fe00)];
183184   UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
184185   int coladdr = params->coladdr << 1;
185186   int x;
src/mame/video/itech8.c
r1527r1528
162162 *
163163 *************************************/
164164
165static void generate_interrupt(int state)
165static void generate_interrupt(running_machine *machine, int state)
166166{
167   itech8_update_interrupts(-1, state, -1);
167   itech8_update_interrupts(machine, -1, state, -1);
168168
169169   if (FULL_LOGGING && state) logerror("------------ DISPLAY INT (%d) --------------\n", video_screen_get_vpos(0));
170170}
r1527r1528
189189VIDEO_START( itech8 )
190190{
191191   /* initialize TMS34061 emulation */
192    tms34061_start(&tms34061intf);
192    tms34061_start(machine, &tms34061intf);
193193
194194   /* get the TMS34061 display state */
195195   tms34061_get_display_state(&tms_state);
r1527r1528
443443{
444444   /* turn off blitting and generate an interrupt */
445445   blit_in_progress = 0;
446   itech8_update_interrupts(-1, -1, 1);
446   itech8_update_interrupts(machine, -1, -1, 1);
447447
448448   if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", video_screen_get_vpos(0));
449449}
r1527r1528
469469   /* a read from offset 3 clears the interrupt and returns the status */
470470   if (offset == 3)
471471   {
472      itech8_update_interrupts(-1, -1, 0);
472      itech8_update_interrupts(Machine, -1, -1, 0);
473473      if (blit_in_progress)
474474         result |= 0x80;
475475      else
r1527r1528
573573{
574574   UINT32 page_offset;
575575   int x, y;
576   const rgb_t *pens = tlc34076_get_pens();
576577
577578   /* first get the current display state */
578579   tms34061_get_display_state(&tms_state);
r1527r1528
592593   {
593594      UINT8 *base0 = &tms_state.vram[(0x00000 + page_offset + y * 256) & 0x3ffff];
594595      UINT8 *base2 = &tms_state.vram[(0x20000 + page_offset + y * 256) & 0x3ffff];
595      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
596      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
596597
597598      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
598599      {
599600         int pix0 = base0[x] & 0x0f;
600         dest[x] = pix0 ? pix0 : base2[x];
601         dest[x] = pens[pix0 ? pix0 : base2[x]];
601602      }
602603   }
603604   return 0;
r1527r1528
608609{
609610   UINT32 page_offset;
610611   int x, y;
612   const rgb_t *pens = tlc34076_get_pens();
611613
612614   /* first get the current display state */
613615   tms34061_get_display_state(&tms_state);
r1527r1528
625627   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
626628   {
627629      UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff];
628      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
630      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
629631
630632      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
631         dest[x] = base[x];
633         dest[x] = pens[base[x]];
632634   }
633635   return 0;
634636}
r1527r1528
638640{
639641   UINT32 page_offset;
640642   int x, y;
643   const rgb_t *pens = tlc34076_get_pens();
641644
642645   /* first get the current display state */
643646   tms34061_get_display_state(&tms_state);
r1527r1528
658661   {
659662      UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff];
660663      UINT8 *latch = &tms_state.latchram[(page_offset + y * 256) & 0x3ffff];
661      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
664      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
662665
663666      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
664667      {
665         dest[x + 0] = (latch[x/2] & 0xf0) | (base[x/2] >> 4);
666         dest[x + 1] = ((latch[x/2] << 4) & 0xf0) | (base[x/2] & 0x0f);
668         dest[x + 0] = pens[(latch[x/2] & 0xf0) | (base[x/2] >> 4)];
669         dest[x + 1] = pens[((latch[x/2] << 4) & 0xf0) | (base[x/2] & 0x0f)];
667670      }
668671   }
669672   return 0;
src/mame/video/galaxian.c
r1527r1528
515515static void video_start_common(running_machine *machine, tilemap_mapper_callback get_memory_offset)
516516{
517517   bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,TILEMAP_TYPE_PEN,8,8,32,32);
518   tilemap_set_scrolldx(bg_tilemap, 0, -128);
519518
520519   tilemap_set_transparent_pen(bg_tilemap,0);
521520
r1527r1528
680679{
681680   video_start_galaxian_plain(machine);
682681
682   tilemap_set_scrolldx(bg_tilemap, 0, 0);
683683   draw_bullets = darkplnt_draw_bullets;
684684}
685685
src/mame/video/snk.c
r1527r1528
6767{
6868   snk_blink_parity = 0;
6969
70   dirtybuffer = auto_malloc( MAX_VRAM_SIZE );
71
7270   tmpbitmap = auto_bitmap_alloc( 512, 512, machine->screen[0].format );
73
74   memset( dirtybuffer, 0xff, MAX_VRAM_SIZE );
7571}
7672
7773/**************************************************************************************/
r1527r1528
9187      tile_number = videoram[offs];
9288      attributes  = videoram[offs+1];
9389
94      if(tile_number != dirtybuffer[offs] || attributes != dirtybuffer[offs+1])
90      if(bg_type == 0)
9591      {
96         dirtybuffer[offs]   = tile_number;
97         dirtybuffer[offs+1] = attributes;
92            /* type tnk3 */
93            tile_number |= (attributes & 0x30) << 4;
94            color = (attributes & 0xf) ^ 8;
95      }
96      else
97      {
98            /* type ikari */
99            tile_number |= (attributes & 0x03) << 8;
100            color = attributes >> 4;
101      }
98102
99         if(bg_type == 0)
100         {
101               /* type tnk3 */
102               tile_number |= (attributes & 0x30) << 4;
103               color = (attributes & 0xf) ^ 8;
104         }
105         else
106         {
107               /* type ikari */
108               tile_number |= (attributes & 0x03) << 8;
109               color = attributes >> 4;
110         }
103      sx = x * 512 / x_size;
104      sy = y * 512 / y_size;
111105
112         sx = x * 512 / x_size;
113         sy = y * 512 / y_size;
114
115         drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
116      }
106      drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
117107   }
118108   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_NONE,0);
119109}
r1527r1528
251241
252242VIDEO_START( sgladiat )
253243{
254   dirtybuffer = auto_malloc( MAX_VRAM_SIZE );
255244   tmpbitmap = auto_bitmap_alloc( 512, 256, machine->screen[0].format );
256   memset( dirtybuffer, 0xff, MAX_VRAM_SIZE );
257245}
258246
259247static void sgladiat_draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
r1527r1528
268256      offs = (x<<5)+y;
269257      tile_number = videoram[offs];
270258
271      if(tile_number != dirtybuffer[offs])
272      {
273         dirtybuffer[offs] = tile_number;
259      color = 0;
260      sx = x << 3;
261      sy = y << 3;
274262
275         color = 0;
276         sx = x << 3;
277         sy = y << 3;
278
279         drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
280      }
263      drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
281264   }
282265   copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect,TRANSPARENCY_NONE,0);
283266}
r1527r1528
391374      tile_number = source[offs];
392375      attributes  = source[offs+1];
393376
394      if(tile_number != dirtybuffer[offs] || attributes != dirtybuffer[offs+1])
395      {
396         dirtybuffer[offs]   = tile_number;
397         dirtybuffer[offs+1] = attributes;
398         tile_number |= (attributes & 0xf) << 8;
377      tile_number |= (attributes & 0xf) << 8;
399378
400         color = attributes >> 4;
401         sx = x << 4;
402         sy = y << 4;
379      color = attributes >> 4;
380      sx = x << 4;
381      sy = y << 4;
403382
404         // intercept overflown tile indices
405         if(tile_number >= gfx->total_elements)
406            plot_box(tmpbitmap, sx, sy, gfx->width, gfx->height, get_black_pen(machine));
407         else
408            drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
409      }
383      // intercept overflown tile indices
384      if(tile_number >= gfx->total_elements)
385         plot_box(tmpbitmap, sx, sy, gfx->width, gfx->height, get_black_pen(machine));
386      else
387         drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
410388   }
411389   copyscrollbitmap(bitmap,tmpbitmap,1,&xscroll,1,&yscroll,cliprect,TRANSPARENCY_NONE,0);
412390}
src/mame/video/troangel.c
r1527r1528
110110   /* screen flip is handled both by software and hardware */
111111   data ^= ~readinputport(4) & 1;
112112
113   if (flipscreen != (data & 1))
114   {
115      flipscreen = data & 1;
116      memset(dirtybuffer,1,videoram_size);
117   }
113   flipscreen = data & 1;
118114
119115   coin_counter_w(0,data & 0x02);
120116   coin_counter_w(1,data & 0x20);
r1527r1528
130126
131127   for (offs = videoram_size - 2;offs >= 0;offs -= 2)
132128   {
133      if (dirtybuffer[offs] || dirtybuffer[offs+1])
134      {
135         int sx,sy,code,attr,flipx,flipy;
129      int sx,sy,code,attr,flipx,flipy;
136130
137131
138         dirtybuffer[offs] = dirtybuffer[offs+1] = 0;
132      sx = (offs/2) % 32;
133      sy = (offs/2) / 32;
139134
140         sx = (offs/2) % 32;
141         sy = (offs/2) / 32;
135      attr = videoram[offs+0];
136      code = videoram[offs+1] | ((attr & 0xc0) << 2);
137      flipx = attr & 0x20;
138      flipy = (attr & 0x10) >> 4;
142139
143         attr = videoram[offs+0];
144         code = videoram[offs+1] | ((attr & 0xc0) << 2);
145         flipx = attr & 0x20;
146         flipy = (attr & 0x10) >> 4;
147
148         if (flipscreen)
149         {
150            sx = 31 - sx;
151            sy = 31 - sy;
152            flipx = !flipx;
153         }
154
155         drawgfx(tmpbitmap,gfx,
156            code,
157            attr & 0x0f,
158            flipx,flipy ^ flipscreen,
159            8*sx,8*sy,
160            0,TRANSPARENCY_NONE,0);
140      if (flipscreen)
141      {
142         sx = 31 - sx;
143         sy = 31 - sy;
144         flipx = !flipx;
161145      }
146
147      drawgfx(tmpbitmap,gfx,
148         code,
149         attr & 0x0f,
150         flipx,flipy ^ flipscreen,
151         8*sx,8*sy,
152         0,TRANSPARENCY_NONE,0);
162153   }
163154
164155   {
src/mame/video/wiping.c
r1527r1528
6464
6565WRITE8_HANDLER( wiping_flipscreen_w )
6666{
67   if (flipscreen != (data & 1))
68   {
69      flipscreen = (data & 1);
70      memset(dirtybuffer,1,videoram_size);
71   }
67   flipscreen = (data & 1);
7268}
7369
7470
r1527r1528
7874
7975   for (offs = videoram_size - 1; offs > 0; offs--)
8076   {
81      if (dirtybuffer[offs])
82      {
83         int mx,my,sx,sy;
77      int mx,my,sx,sy;
8478
85         dirtybuffer[offs] = 0;
79      mx = offs % 32;
80      my = offs / 32;
8681
87           mx = offs % 32;
88         my = offs / 32;
82      if (my < 2)
83      {
84         sx = my + 34;
85         sy = mx - 2;
86      }
87      else if (my >= 30)
88      {
89         sx = my - 30;
90         sy = mx - 2;
91      }
92      else
93      {
94         sx = mx + 2;
95         sy = my - 2;
96      }
8997
90         if (my < 2)
91         {
92            sx = my + 34;
93            sy = mx - 2;
94         }
95         else if (my >= 30)
96         {
97            sx = my - 30;
98            sy = mx - 2;
99         }
100         else
101         {
102            sx = mx + 2;
103            sy = my - 2;
104         }
98      if (flipscreen)
99      {
100         sx = 35 - sx;
101         sy = 27 - sy;
102      }
105103
106         if (flipscreen)
107         {
108            sx = 35 - sx;
109            sy = 27 - sy;
110         }
111
112         drawgfx(tmpbitmap,machine->gfx[0],
113               videoram[offs],
114               colorram[offs] & 0x3f,
115               flipscreen,flipscreen,
116               sx*8,sy*8,
117               &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
118           }
104      drawgfx(bitmap,machine->gfx[0],
105            videoram[offs],
106            colorram[offs] & 0x3f,
107            flipscreen,flipscreen,
108            sx*8,sy*8,
109            cliprect,TRANSPARENCY_NONE,0);
119110   }
120   copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
121111
122112   /* Note, we're counting up on purpose ! */
123113   /* This way the vacuum cleaner is always on top */
src/mame/video/tiamc1.c
r1527r1528
8989PALETTE_INIT( tiamc1 )
9090{
9191   // Voltage computed by Proteus
92   //const float g_v[8]={1.05f,0.87f,0.81f,0.62f,0.44f,0.25f,0.19f,0.00f};
93   //const float r_v[8]={1.37f,1.13f,1.00f,0.75f,0.63f,0.38f,0.25f,0.00f};
94   //const float b_v[4]={1.16f,0.75f,0.42f,0.00f};
92   //static const float g_v[8]={1.05f,0.87f,0.81f,0.62f,0.44f,0.25f,0.19f,0.00f};
93   //static const float r_v[8]={1.37f,1.13f,1.00f,0.75f,0.63f,0.38f,0.25f,0.00f};
94   //static const float b_v[4]={1.16f,0.75f,0.42f,0.00f};
9595
9696   // Voltage adjusted by Shiru
97   const float g_v[8] = { 1.2071f,0.9971f,0.9259f,0.7159f,0.4912f,0.2812f,0.2100f,0.0000f};
98   const float r_v[8] = { 1.5937f,1.3125f,1.1562f,0.8750f,0.7187f,0.4375f,0.2812f,0.0000f};
99   const float b_v[4] = { 1.3523f,0.8750f,0.4773f,0.0000f};
97   static const float g_v[8] = { 1.2071f,0.9971f,0.9259f,0.7159f,0.4912f,0.2812f,0.2100f,0.0000f};
98   static const float r_v[8] = { 1.5937f,1.3125f,1.1562f,0.8750f,0.7187f,0.4375f,0.2812f,0.0000f};
99   static const float b_v[4] = { 1.3523f,0.8750f,0.4773f,0.0000f};
100100
101101   int col;
102102   int r, g, b, ir, ig, ib;
src/mame/video/tmnt.c
r1527r1528
6363
6464static void cuebrick_tile_callback(int layer,int bank,int *code,int *color,int *flags,int *priority)
6565{
66   if (layer == 0)
66   if ((K052109_get_RMRD_line() == CLEAR_LINE) && (layer == 0))
6767   {
6868      *code |= ((*color & 0x01) << 8);
6969      *color = layer_colorbase[layer]  + ((*color & 0x80) >> 5) + ((*color & 0x10) >> 1);
src/mame/video/dc.c
r1527r1528
360360}
361361
362362/* test video start */
363UINT32 dilate0(UINT32 value,int bits) // dilate first "bits" bits in "value"
363static UINT32 dilate0(UINT32 value,int bits) // dilate first "bits" bits in "value"
364364{
365365   UINT32 x,m1,m2,m3;
366366   int a;
r1527r1528
376376   return x;
377377}
378378
379UINT32 dilate1(UINT32 value,int bits) // dilate first "bits" bits in "value"
379static UINT32 dilate1(UINT32 value,int bits) // dilate first "bits" bits in "value"
380380{
381381   UINT32 x,m1,m2,m3;
382382   int a;
r1527r1528
392392   return x;
393393}
394394
395void computedilated(void)
395static void computedilated(void)
396396{
397397   int a,b;
398398
r1527r1528
406406         dilatechose[(b << 3) + a]=3+(a < b ? a : b);
407407}
408408
409void testdrawscreen(bitmap_t *bitmap,const rectangle *cliprect)
409static void testdrawscreen(bitmap_t *bitmap,const rectangle *cliprect)
410410{
411411   int cs,x,y,dx,dy,xi,yi,a;
412412   float iu,iv,u,v;
src/mame/video/jagobj.c
r1527r1528
1212#define LOG_OBJECTS         0
1313
1414
15static UINT16 scanline[360];
15static UINT16 *scanline;
1616static UINT16 *clutbase;
1717static UINT8 *blend_y, *blend_cc;
1818
r1527r1528
900900 *
901901 *************************************/
902902
903static void process_object_list(mame_bitmap *bitmap, const rectangle *cliprect)
903static void process_object_list(int vc, UINT16 *_scanline)
904904{
905   int done = 0, count = 0;
905906   UINT32 *objdata;
906   int y, x, pass;
907907   int logit;
908   int x;
908909
909   /* loop over all scanlines */
910   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
911   {
912      /* erase the scanline first */
913      for (x = 0; x < 336; x++)
914         scanline[x] = gpu_regs[BG];
910   /* erase the scanline first */
911   scanline = _scanline;
912   for (x = 0; x < 336; x++)
913      scanline[x] = gpu_regs[BG];
915914
916915#if LOG_OBJECTS
917      logit = (y == cliprect->min_y);
916   logit = (y == cliprect->min_y);
918917#else
919      logit = 0;
918   logit = 0;
920919#endif
921920
922      /* two passes per scanline */
923      for (pass = 0; pass < 1; pass++)
921   /* fetch the object pointer */
922   objdata = (UINT32 *)get_jaguar_memory((gpu_regs[OLP_H] << 16) | gpu_regs[OLP_L]);
923   while (!done && objdata && count++ < 100)
924   {
925      /* the low 3 bits determine the command */
926      switch (objdata[1] & 7)
924927      {
925         int vc = y * 2 + pass + gpu_regs[VBE];
926         int done = 0, count = 0;
928         /* bitmap object */
929         case 0:
930            if (logit)
931               logerror("bitmap = %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3]);
932            objdata = process_bitmap(objdata, vc, logit);
933            break;
927934
928         /* fetch the object pointer */
929         objdata = (UINT32 *)get_jaguar_memory((gpu_regs[OLP_H] << 16) | gpu_regs[OLP_L]);
930         while (!done && objdata && count++ < 100)
931         {
932            /* the low 3 bits determine the command */
933            switch (objdata[1] & 7)
934            {
935               /* bitmap object */
936               case 0:
937                  if (logit)
938                     logerror("bitmap = %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3]);
939                  objdata = process_bitmap(objdata, vc, logit);
940                  break;
935         /* scaled bitmap object */
936         case 1:
937            if (logit)
938               logerror("scaled = %08X-%08X %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3], objdata[4], objdata[5]);
939            objdata = process_scaled_bitmap(objdata, vc, logit);
940            break;
941941
942               /* scaled bitmap object */
943               case 1:
944                  if (logit)
945                     logerror("scaled = %08X-%08X %08X-%08X %08X-%08X\n", objdata[0], objdata[1], objdata[2], objdata[3], objdata[4], objdata[5]);
946                  objdata = process_scaled_bitmap(objdata, vc, logit);
947                  break;
942         /* branch */
943         case 3:
944            if (logit)
945               logerror("branch = %08X-%08X\n", objdata[0], objdata[1]);
946            objdata = process_branch(objdata, vc, logit);
947            break;
948948
949               /* branch */
950               case 3:
951                  if (logit)
952                     logerror("branch = %08X-%08X\n", objdata[0], objdata[1]);
953                  objdata = process_branch(objdata, vc, logit);
954                  break;
949         /* stop */
950         case 4:
951         {
952            int interrupt = (objdata[1] >> 3) & 1;
953            done = 1;
955954
956               /* stop */
957               case 4:
958               {
959                  int interrupt = (objdata[1] >> 3) & 1;
960                  done = 1;
961
962                  if (logit)
963                     logerror("stop   = %08X-%08X\n", objdata[0], objdata[1]);
964                  if (interrupt)
965                  {
955            if (logit)
956               logerror("stop   = %08X-%08X\n", objdata[0], objdata[1]);
957            if (interrupt)
958            {
966959#ifndef MESS
967                     fprintf(stderr, "stop int=%d\n", interrupt);
960               fprintf(stderr, "stop int=%d\n", interrupt);
968961#endif
969                     cpu_irq_state |= 4;
970                     update_cpu_irq();
971                  }
972                  break;
973               }
974
975               default:
976                  fprintf(stderr, "%08X %08X\n", objdata[0], objdata[1]);
977                  done = 1;
978                  break;
962               cpu_irq_state |= 4;
963               update_cpu_irq();
979964            }
965            break;
980966         }
981      }
982967
983      /* render this scanline */
984      draw_scanline16(bitmap, 0, y, 336, scanline, pen_table, -1);
968         default:
969            fprintf(stderr, "%08X %08X\n", objdata[0], objdata[1]);
970            done = 1;
971            break;
972      }
985973   }
986974}
src/mame/video/bionicc.c
r1527r1528
131131
132132WRITE16_HANDLER( bionicc_paletteram_w )
133133{
134   /* The bottom bits are 'intensity' here, but level 2 of Top Secret shows that even
135    when intensity is zero the colour is not reduced to pure black, (the sky should stay
136    at dark blue rather than absolute black) */
134137   data = COMBINE_DATA(&paletteram16[offset]);
135   paletteram16_RRRRGGGGBBBBIIII_word_w(offset,(data & 0xfff0) | ((data & 0x0007) << 1),0);
138   paletteram16_RRRRGGGGBBBBIIII_word_w(offset,(data & 0xfff0) | ((data & 0x0007) << 1) | 1, 0);
136139}
137140
138141WRITE16_HANDLER( bionicc_scroll_w )
src/mame/video/capbowl.c
r1527r1528
2121 *
2222 *************************************/
2323
24static void generate_interrupt(int state)
24static void generate_interrupt(running_machine *machine, int state)
2525{
2626   cpunum_set_input_line(0, M6809_FIRQ_LINE, state);
2727}
r1527r1528
4545VIDEO_START( capbowl )
4646{
4747   /* initialize TMS34061 emulation */
48    tms34061_start(&tms34061intf);
48    tms34061_start(machine, &tms34061intf);
4949}
5050
5151
r1527r1528
156156 *
157157 *************************************/
158158
159INLINE rgb_t pen_for_pixel(UINT8 *src, UINT8 pix)
160{
161   return MAKE_RGB(pal4bit(src[(pix << 1) + 0] >> 0),
162               pal4bit(src[(pix << 1) + 1] >> 4),
163               pal4bit(src[(pix << 1) + 1] >> 0));
164}
165
166
159167VIDEO_UPDATE( capbowl )
160168{
161169   struct tms34061_display state;
r1527r1528
174182   /* now regenerate the bitmap */
175183   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
176184   {
177      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
178185      UINT8 *src = &state.vram[256 * y];
179      int ybase = 16 * y;
186      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
180187
181      /* first update the palette for this scanline */
182      for (x = 0; x < 16; x++)
183      {
184         palette_set_color_rgb(machine, ybase + x, pal4bit(src[0]), pal4bit(src[1] >> 4), pal4bit(src[1]));
185         src += 2;
186      }
187
188      /* expand row to 8bpp */
189188      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
190189      {
191         int pix = src[x/2];
192         *dest++ = ybase + (pix >> 4);
193         *dest++ = ybase + (pix & 0x0f);
190         UINT8 pix = src[32 + (x / 2)];
191         *dest++ = pen_for_pixel(src, pix >> 4);
192         *dest++ = pen_for_pixel(src, pix & 0x0f);
194193      }
195194   }
196195   return 0;
src/mame/video/darius.c
r1527r1528
6060
6161/***************************************************************************/
6262
63READ16_HANDLER( darius_fg_layer_r )
64{
65   return darius_fg_ram[offset];
66}
67
6863WRITE16_HANDLER( darius_fg_layer_w )
6964{
7065   COMBINE_DATA(&darius_fg_ram[offset]);
src/mame/video/crbaloon.c
r1527r1528
99#include "driver.h"
1010#include "includes/crbaloon.h"
1111
12static UINT8 spritectrl[3];
1312
14INT8 crbaloon_collision;
13UINT8 *crbaloon_videoram;
14UINT8 *crbaloon_colorram;
15UINT8 *crbaloon_spriteram;
1516
17static UINT16 crbaloon_collision_address;
18static UINT8 crbaloon_collision_address_clear;
1619static tilemap *bg_tilemap;
1720
21
1822/***************************************************************************
1923
2024  Convert the color PROMs into a more useable format.
r1527r1528
2731  bit 0 RED
2832
2933***************************************************************************/
34
3035PALETTE_INIT( crbaloon )
3136{
3237   int i;
r1527r1528
3439   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3540
3641
37   for (i = 0;i < machine->drv->total_colors;i++)
42   for (i = 0; i < machine->drv->total_colors; i++)
3843   {
39      int intensity,r,g,b;
44      int h = (~i & 0x08) ? 0xff : 0x55;
4045
46      int r = h * ((~i >> 0) & 1);
47      int g = h * ((~i >> 1) & 1);
48      int b = h * ((~i >> 2) & 1);
4149
42      intensity = (~i & 0x08) ? 0xff : 0x55;
43
44      /* red component */
45      r = intensity * ((~i >> 0) & 1);
46      /* green component */
47      g = intensity * ((~i >> 1) & 1);
48      /* blue component */
49      b = intensity * ((~i >> 2) & 1);
50      palette_set_color(machine,i,MAKE_RGB(r,g,b));
50      palette_set_color(machine, i, MAKE_RGB(r, g, b));
5151   }
5252
53   for (i = 0;i < TOTAL_COLORS(0);i += 2)
53   for (i = 0; i < TOTAL_COLORS(0); i += 2)
5454   {
55      COLOR(0,i) = 15;      /* black background */
56      COLOR(0,i + 1) = i / 2;   /* colored foreground */
55      COLOR(0, i + 0) = 0x0f;      /* black background */
56      COLOR(0, i + 1) = i / 2;   /* colored foreground */
5757   }
5858}
5959
60
6061WRITE8_HANDLER( crbaloon_videoram_w )
6162{
62   videoram[offset] = data;
63   crbaloon_videoram[offset] = data;
6364   tilemap_mark_tile_dirty(bg_tilemap, offset);
6465}
6566
6667WRITE8_HANDLER( crbaloon_colorram_w )
6768{
68   colorram[offset] = data;
69   crbaloon_colorram[offset] = data;
6970   tilemap_mark_tile_dirty(bg_tilemap, offset);
7071}
7172
72WRITE8_HANDLER( crbaloon_spritectrl_w )
73{
74   spritectrl[offset] = data;
75}
76
77WRITE8_HANDLER( crbaloon_flipscreen_w )
78{
79   if (flip_screen != (data & 0x01))
80   {
81      flip_screen_set(data & 0x01);
82      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
83   }
84}
85
8673static TILE_GET_INFO( get_bg_tile_info )
8774{
88   int code = videoram[tile_index];
89   int color = colorram[tile_index] & 0x0f;
75   int code = crbaloon_videoram[tile_index];
76   int color = crbaloon_colorram[tile_index] & 0x0f;
9077
9178   SET_TILE_INFO(0, code, color, 0);
9279}
9380
9481VIDEO_START( crbaloon )
9582{
96   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy,
97      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
83   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
9884
99   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
85   state_save_register_global(crbaloon_collision_address);
86   state_save_register_global(crbaloon_collision_address_clear);
87}
10088
101   state_save_register_global_array(spritectrl);
102   state_save_register_global(crbaloon_collision);
89
90UINT16 crbaloon_get_collision_address(void)
91{
92   return crbaloon_collision_address_clear ? 0xffff : crbaloon_collision_address;
10393}
10494
105static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
95
96void crbaloon_set_clear_collision_address(int _crbaloon_collision_address_clear)
10697{
107   int x,y;
98   crbaloon_collision_address_clear = !_crbaloon_collision_address_clear; /* active LO */
99}
108100
109   /* Check Collision - Draw balloon in background colour, if no */
110    /* collision occured, bitmap will be same as tmpbitmap        */
111101
112   int bx = spritectrl[1];
113   int by = spritectrl[2] - 32;
114102
115   tilemap_draw(tmpbitmap, 0, bg_tilemap, 0, 0);
103static void draw_sprite_and_check_collision(running_machine *machine, mame_bitmap *bitmap)
104{
105   int y;
106   UINT8 code = crbaloon_spriteram[0] & 0x0f;
107   UINT8 color = crbaloon_spriteram[0] >> 4;
108   UINT8 sy = crbaloon_spriteram[2] - 32;
116109
110   UINT8 *gfx = memory_region(REGION_GFX2) + (code << 7);
111
112
117113   if (flip_screen)
114      sy += 32;
115
116   /* assume no collision */
117    crbaloon_collision_address = 0xffff;
118
119   for (y = 0x1f; y >= 0; y--)
118120   {
119      by += 32;
120   }
121      int x;
122      UINT8 data = 0;
123      UINT8 sx = crbaloon_spriteram[1];
121124
122   drawgfx(bitmap,machine->gfx[1],
123         spritectrl[0] & 0x0f,
124         15,
125         0,0,
126         bx,by,
127         cliprect,TRANSPARENCY_PEN,0);
125      for (x = 0x1f; x >= 0; x--)
126      {
127         int bit;
128128
129    crbaloon_collision = 0;
129         if ((x & 0x07) == 0x07)
130            /* get next byte to draw, but no drawing in VBLANK */
131            data = (sy >= 0xe0) ? 0 : gfx[((x >> 3) << 5) | y];
130132
131   for (x = bx; x < bx + machine->gfx[1]->width; x++)
132   {
133      for (y = by; y < by + machine->gfx[1]->height; y++)
134        {
135         if ((x < machine->screen[0].visarea.min_x) ||
136             (x > machine->screen[0].visarea.max_x) ||
137             (y < machine->screen[0].visarea.min_y) ||
138             (y > machine->screen[0].visarea.max_y))
133         bit = data & 0x80;
134
135         /* draw the current pixel, but check collision first */
136         if (bit)
139137         {
140            continue;
141         }
138            if (*BITMAP_ADDR16(bitmap, sy, sx) != 0x0f)
139               /* compute the collision address -- the +1 is via observation
140                       of the game code, probably wrong for cocktail mode */
141               crbaloon_collision_address = ((((sy ^ 0xff) >> 3) << 5) | ((sx ^ 0xff) >> 3)) + 1;
142142
143           if (*BITMAP_ADDR16(bitmap, y, x) != *BITMAP_ADDR16(tmpbitmap, y, x))
144           {
145            crbaloon_collision = -1;
146            break;
143            *BITMAP_ADDR16(bitmap, sy, sx) = color;
147144         }
145
146         sx = sx + 1;
147         data = data << 1;
148148        }
149   }
150149
151
152   /* actually draw the balloon */
153
154   drawgfx(bitmap,machine->gfx[1],
155         spritectrl[0] & 0x0f,
156         (spritectrl[0] & 0xf0) >> 4,
157         0,0,
158         bx,by,
159         cliprect,TRANSPARENCY_PEN,0);
150        sy = sy + 1;
151   }
160152}
161153
154
162155VIDEO_UPDATE( crbaloon )
163156{
164157   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
165   draw_sprites(machine, bitmap, cliprect);
158
159   draw_sprite_and_check_collision(machine, bitmap);
160
166161   return 0;
167162}
src/mame/video/munchmo.c
r1527r1528
3939
4040WRITE8_HANDLER( mnchmobl_palette_bank_w )
4141{
42   if( mnchmobl_palette_bank!=(data&0x3) )
43   {
44      memset( dirtybuffer, 1, 0x100 );
45      mnchmobl_palette_bank = data&0x3;
46   }
42   mnchmobl_palette_bank = data&0x3;
4743}
4844
4945WRITE8_HANDLER( mnchmobl_flipscreen_w )
5046{
51   if( flipscreen!=data )
52   {
53      memset( dirtybuffer, 1, 0x100 );
54      flipscreen = data;
55   }
47   flipscreen = data;
5648}
5749
5850
r1527r1528
6759
6860VIDEO_START( mnchmobl )
6961{
70   dirtybuffer = auto_malloc(0x100);
71   memset( dirtybuffer, 1, 0x100 );
7262   tmpbitmap = auto_bitmap_alloc(512,512,machine->screen[0].format);
7363}
7464
75READ8_HANDLER( mnchmobl_videoram_r )
76{
77   return videoram[offset];
78}
79
80WRITE8_HANDLER( mnchmobl_videoram_w )
81{
82   offset = offset&0xff; /* mirror the two banks? */
83   if( videoram[offset]!=data )
84   {
85      videoram[offset] = data;
86      dirtybuffer[offset] = 1;
87   }
88}
89
9065static void draw_status(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
9166{
9267   const gfx_element *gfx = machine->gfx[0];
r1527r1528
126101
127102   for( offs=0; offs<0x100; offs++ )
128103   {
129      if( dirtybuffer[offs] )
104      int sy = (offs%16)*32;
105      int sx = (offs/16)*32;
106      int tile_number = videoram[offs];
107      int row,col;
108
109      for( row=0; row<4; row++ )
130110      {
131         int sy = (offs%16)*32;
132         int sx = (offs/16)*32;
133         int tile_number = videoram[offs];
134         int row,col;
135         dirtybuffer[offs] = 0;
136         for( row=0; row<4; row++ )
111         for( col=0; col<4; col++ )
137112         {
138            for( col=0; col<4; col++ )
139            {
140               drawgfx( tmpbitmap,gfx,
141                  rom[col+tile_number*4+row*0x400],
142                  mnchmobl_palette_bank,
143                  0,0, /* flip */
144                  sx+col*8, sy+row*8,
145                  0, TRANSPARENCY_NONE, 0 );
146            }
113            drawgfx( tmpbitmap,gfx,
114               rom[col+tile_number*4+row*0x400],
115               mnchmobl_palette_bank,
116               0,0, /* flip */
117               sx+col*8, sy+row*8,
118               0, TRANSPARENCY_NONE, 0 );
147119         }
148120      }
149121   }
src/mame/video/btoads.c
r1527r1528
347347   UINT16 *bg0_base = &btoads_vram_bg0[(fulladdr + (yscroll0 << 10)) & 0x3fc00];
348348   UINT16 *bg1_base = &btoads_vram_bg1[(fulladdr + (yscroll1 << 10)) & 0x3fc00];
349349   UINT8 *spr_base = &vram_fg_display[fulladdr & 0x3fc00];
350   UINT16 *dst = BITMAP_ADDR16(bitmap, scanline, 0);
350   UINT32 *dst = BITMAP_ADDR32(bitmap, scanline, 0);
351   const rgb_t *pens = tlc34076_get_pens();
351352   int coladdr = fulladdr & 0x3ff;
352353   int x;
353354
r1527r1528
369370
370371            if (sprpix && !(sprpix & 0x80))
371372            {
372               dst[x + 0] = sprpix;
373               dst[x + 1] = sprpix;
373               dst[x + 0] = pens[sprpix];
374               dst[x + 1] = pens[sprpix];
374375            }
375376            else
376377            {
r1527r1528
379380               UINT8 sprpix = spr_base[coladdr & 0xff];
380381
381382               if (bg1pix & 0x80)
382                  dst[x + 0] = bg1pix & 0xff;
383                  dst[x + 0] = pens[bg1pix & 0xff];
383384               else if (sprpix)
384                  dst[x + 0] = sprpix;
385                  dst[x + 0] = pens[sprpix];
385386               else if (bg1pix & 0xff)
386                  dst[x + 0] = bg1pix & 0xff;
387                  dst[x + 0] = pens[bg1pix & 0xff];
387388               else
388                  dst[x + 0] = bg0pix & 0xff;
389                  dst[x + 0] = pens[bg0pix & 0xff];
389390
390391               if (bg1pix & 0x8000)
391                  dst[x + 1] = bg1pix >> 8;
392                  dst[x + 1] = pens[bg1pix >> 8];
392393               else if (sprpix)
393                  dst[x + 1] = sprpix;
394                  dst[x + 1] = pens[sprpix];
394395               else if (bg1pix >> 8)
395                  dst[x + 1] = bg1pix >> 8;
396                  dst[x + 1] = pens[bg1pix >> 8];
396397               else
397                  dst[x + 1] = bg0pix >> 8;
398                  dst[x + 1] = pens[bg0pix >> 8];
398399            }
399400         }
400401         break;
r1527r1528
414415
415416            if (sprpix && !(sprpix & 0x80))
416417            {
417               dst[x + 0] = sprpix;
418               dst[x + 1] = sprpix;
418               dst[x + 0] = pens[sprpix];
419               dst[x + 1] = pens[sprpix];
419420            }
420421            else
421422            {
r1527r1528
423424               UINT16 bg1pix = bg1_base[(coladdr + xscroll1) & 0xff];
424425
425426               if (bg0pix & 0xff)
426                  dst[x + 0] = bg0pix & 0xff;
427                  dst[x + 0] = pens[bg0pix & 0xff];
427428               else if (bg1pix & 0x80)
428                  dst[x + 0] = bg1pix & 0xff;
429                  dst[x + 0] = pens[bg1pix & 0xff];
429430               else if (sprpix)
430                  dst[x + 0] = sprpix;
431                  dst[x + 0] = pens[sprpix];
431432               else
432                  dst[x + 0] = bg1pix & 0xff;
433                  dst[x + 0] = pens[bg1pix & 0xff];
433434
434435               if (bg0pix >> 8)
435                  dst[x + 1] = bg0pix >> 8;
436                  dst[x + 1] = pens[bg0pix >> 8];
436437               else if (bg1pix & 0x8000)
437                  dst[x + 1] = bg1pix >> 8;
438                  dst[x + 1] = pens[bg1pix >> 8];
438439               else if (sprpix)
439                  dst[x + 1] = sprpix;
440                  dst[x + 1] = pens[sprpix];
440441               else
441                  dst[x + 1] = bg1pix >> 8;
442                  dst[x + 1] = pens[bg1pix >> 8];
442443            }
443444         }
444445         break;
r1527r1528
456457
457458            if (sprpix)
458459            {
459               dst[x + 0] = sprpix;
460               dst[x + 1] = sprpix;
460               dst[x + 0] = pens[sprpix];
461               dst[x + 1] = pens[sprpix];
461462            }
462463            else
463464            {
r1527r1528
465466               UINT16 bg1pix = bg1_base[(coladdr + xscroll1) & 0xff];
466467
467468               if (bg1pix & 0xff)
468                  dst[x + 0] = bg1pix & 0xff;
469                  dst[x + 0] = pens[bg1pix & 0xff];
469470               else
470                  dst[x + 0] = bg0pix & 0xff;
471                  dst[x + 0] = pens[bg0pix & 0xff];
471472
472473               if (bg1pix >> 8)
473                  dst[x + 1] = bg1pix >> 8;
474                  dst[x + 1] = pens[bg1pix >> 8];
474475               else
475                  dst[x + 1] = bg0pix >> 8;
476                  dst[x + 1] = pens[bg0pix >> 8];
476477            }
477478         }
478479         break;
r1527r1528
493494            UINT8 sprpix = spr_base[coladdr & 0xff];
494495
495496            if (bg1pix & 0x80)
496               dst[x + 0] = bg1pix & 0xff;
497               dst[x + 0] = pens[bg1pix & 0xff];
497498            else if (sprpix & 0x80)
498               dst[x + 0] = sprpix;
499               dst[x + 0] = pens[sprpix];
499500            else if (bg1pix & 0xff)
500               dst[x + 0] = bg1pix & 0xff;
501               dst[x + 0] = pens[bg1pix & 0xff];
501502            else if (sprpix)
502               dst[x + 0] = sprpix;
503               dst[x + 0] = pens[sprpix];
503504            else
504               dst[x + 0] = bg0pix & 0xff;
505               dst[x + 0] = pens[bg0pix & 0xff];
505506
506507            if (bg1pix & 0x8000)
507               dst[x + 1] = bg1pix >> 8;
508               dst[x + 1] = pens[bg1pix >> 8];
508509            else if (sprpix & 0x80)
509               dst[x + 1] = sprpix;
510               dst[x + 1] = pens[sprpix];
510511            else if (bg1pix >> 8)
511               dst[x + 1] = bg1pix >> 8;
512               dst[x + 1] = pens[bg1pix >> 8];
512513            else if (sprpix)
513               dst[x + 1] = sprpix;
514               dst[x + 1] = pens[sprpix];
514515            else
515               dst[x + 1] = bg0pix >> 8;
516               dst[x + 1] = pens[bg0pix >> 8];
516517         }
517518         break;
518519   }
src/mame/video/tagteam.c
r1527r1528
6363   y = offset % 32;
6464   offset = 32 * y + x;
6565
66   return videoram_r(offset);
66   return videoram[offset];
6767}
6868
6969READ8_HANDLER( tagteam_mirrorcolorram_r )
r1527r1528
7575   y = offset % 32;
7676   offset = 32 * y + x;
7777
78   return colorram_r(offset);
78   return colorram[offset];
7979}
8080
8181WRITE8_HANDLER( tagteam_mirrorvideoram_w )
src/mame/video/jaguar.c
r1527r1528
143143#include "jagblit.h"
144144
145145
146#define ENABLE_BORDERS      0
147
146148#define LOG_BLITS         0
147149#define LOG_BAD_BLITS      0
148150#define LOG_BLITTER_STATS   0
r1527r1528
190192static UINT32 blitter_regs[BLITTER_REGS];
191193static UINT16 gpu_regs[GPU_REGS];
192194
193static emu_timer *vi_timer;
195static emu_timer *object_timer;
194196static UINT8 cpu_irq_state;
195197
198static mame_bitmap *screen_bitmap;
199
196200static pen_t *pen_table;
197201
198202
r1527r1528
205209
206210/* from jagobj.c */
207211static void jagobj_init(void);
208static void process_object_list(mame_bitmap *bitmap, const rectangle *cliprect);
212static void process_object_list(int vc, UINT16 *_scanline);
209213
210214/* from jagblit.c */
211215static void generic_blitter(UINT32 command, UINT32 a1flags, UINT32 a2flags);
r1527r1528
229233 *
230234 *************************************/
231235
232INLINE void get_crosshair_xy(int player, int *x, int *y)
236INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
233237{
234   *x = ((readinputport(3 + player * 2) & 0xff) * Machine->screen[0].width) >> 8;
235   *y = ((readinputport(4 + player * 2) & 0xff) * Machine->screen[0].height) >> 8;
238   int width = machine->screen[0].visarea.max_x + 1 - machine->screen[0].visarea.min_x;
239   int height = machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y;
240   *x = machine->screen[0].visarea.min_x + (((readinputport(3 + player * 2) & 0xff) * width) >> 8);
241   *y = machine->screen[0].visarea.min_y + (((readinputport(4 + player * 2) & 0xff) * height) >> 8);
236242}
237243
238244
239245
240246/*************************************
241247 *
248 *  Horizontal display values
249 *
250 *************************************/
251
252INLINE int effective_hvalue(int value)
253{
254   if (!(value & 0x400))
255      return value & 0x3ff;
256   else
257      return (value & 0x3ff) + (gpu_regs[HP] & 0x3ff) + 1;
258}
259
260
261
262/*************************************
263 *
264 *  Object processor timer
265 *
266 *************************************/
267
268INLINE int adjust_object_timer(running_machine *machine, int vc)
269{
270   int hdbpix[2];
271   int hdb = 0;
272
273   /* extract the display begin registers */
274   hdbpix[0] = (gpu_regs[HDB1] & 0x7ff) / 2;
275   hdbpix[1] = (gpu_regs[HDB2] & 0x7ff) / 2;
276
277   /* sort */
278   if (hdbpix[0] > hdbpix[1])
279   {
280      int temp = hdbpix[0];
281      hdbpix[0] = hdbpix[1];
282      hdbpix[1] = temp;
283   }
284
285   /* select the target one */
286   hdb = hdbpix[vc % 2];
287
288   /* if setting the second one in a line, make sure we will ever actually hit it */
289   if (vc % 2 == 1 && (hdbpix[1] == hdbpix[0] || hdbpix[1] >= machine->screen[0].width))
290      return FALSE;
291
292   /* adjust the timer */
293   timer_adjust(object_timer, video_screen_get_time_until_pos(0, vc / 2, hdb), vc | (hdb << 16), attotime_never);
294   return TRUE;
295}
296
297
298
299/*************************************
300 *
242301 *  GPU optimization control
243302 *
244303 *************************************/
r1527r1528
271330}
272331
273332
274static TIMER_CALLBACK( vi_callback )
275{
276   int scanline = param;
277
278   cpu_irq_state |= 1;
279   update_cpu_irq();
280   timer_adjust(vi_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
281}
282
283
284333void jaguar_gpu_cpu_int(void)
285334{
286335   cpu_irq_state |= 2;
r1527r1528
364413        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
365414   };
366415
367   int i, colors = 0;
416   int i;
368417
369418   /* switch off the mode */
370419   switch (vmode & 0x106)
371420   {
372421      /* YCC full */
373422      case 0x000:
374      {
375         /* set color 0 to black */
376         palette_set_color(Machine, colors++, MAKE_RGB(0, 0, 0));
377
378         /* due to the way YCC colorspace maps onto RGB, there are multiple entries for black */
379         /* take advantage of this so we don't have to use all 64k colors */
380423         for (i = 0; i < 65536; i++)
381424         {
382425            UINT8 r = (red_lookup[i >> 8] * (i & 0xff)) >> 8;
383426            UINT8 g = (grn_lookup[i >> 8] * (i & 0xff)) >> 8;
384427            UINT8 b = (blu_lookup[i >> 8] * (i & 0xff)) >> 8;
385
386            if (r == 0 && g == 0 && b == 0)
387               pen_table[i] = 0;
388            else
389            {
390               pen_table[i] = colors;
391               palette_set_color(Machine, colors++, MAKE_RGB(r, g, b));
392            }
428            pen_table[i] = MAKE_RGB(r, g, b);
393429         }
394430         break;
395      }
396431
397432      /* YCC/RGB VARMOD */
398433      case 0x100:
399434      case 0x107:
400      {
401         /* set color 0 to black */
402         palette_set_color(Machine, colors++, MAKE_RGB(0, 0, 0));
403
404         /* due to the way YCC colorspace maps onto RGB, there are multiple entries for black */
405         /* take advantage of this so we don't have to use all 64k colors */
406435         for (i = 0; i < 65536; i++)
407436         {
408437            UINT8 r = (red_lookup[i >> 8] * (i & 0xff)) >> 8;
r1527r1528
419448               g = (g << 3) | (g >> 2);
420449               b = (b << 3) | (b >> 2);
421450            }
422
423            if (r == 0 && g == 0 && b == 0)
424               pen_table[i] = 0;
425            else
426            {
427               pen_table[i] = colors;
428               palette_set_color(Machine, colors++, MAKE_RGB(r, g, b));
429            }
451            pen_table[i] = MAKE_RGB(r, g, b);
430452         }
431453         break;
432      }
433454
434455      /* RGB full */
435456      case 0x006:
436      {
437         /* we cheat a little here to squeeze into 65534 colors */
438         palette_set_color(Machine, colors++, MAKE_RGB(0,  0, 0));
439         palette_set_color(Machine, colors++, MAKE_RGB(0,  8, 0));
440         palette_set_color(Machine, colors++, MAKE_RGB(0, 16, 0));
441         pen_table[0] = 0;
442         pen_table[1] = 1;
443         pen_table[2] = 1;
444         pen_table[3] = 2;
445         pen_table[4] = 2;
446
447         /* map the remaining colors normally */
448         for (i = 5; i < 65536; i++)
449         {
450            pen_table[i] = colors;
451            palette_set_color_rgb(Machine, colors++, pal5bit(i >> 11), pal6bit(i >> 0), pal5bit(i >> 6));
452         }
457         for (i = 0; i < 65536; i++)
458            pen_table[i] = MAKE_RGB(pal5bit(i >> 11), pal6bit(i >> 0), pal5bit(i >> 6));
453459         break;
454      }
455460
456461      /* others */
457462      default:
r1527r1528
637642
638643WRITE16_HANDLER( jaguar_tom_regs_w )
639644{
640   int scanline;
641
642645   if (offset < GPU_REGS)
643646   {
644647      COMBINE_DATA(&gpu_regs[offset]);
645648
646649      switch (offset)
647650      {
648         case VI:
649            scanline = (gpu_regs[VI] - gpu_regs[VBE]) / 2;
650            timer_adjust(vi_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
651            break;
652
653651         case INT1:
654652            cpu_irq_state &= ~(gpu_regs[INT1] >> 8);
655653            update_cpu_irq();
r1527r1528
658656         case VMODE:
659657            jaguar_set_palette(gpu_regs[VMODE]);
660658            break;
659
660         case HP:
661         case HBB:
662         case HBE:
663         case HDB1:
664         case HDB2:
665         case HDE:
666         case VP:
667         case VBB:
668         case VBE:
669         case VDB:
670         case VDE:
671         {
672            int hperiod = 2 * ((gpu_regs[HP] & 0x3ff) + 1);
673            int hbend = effective_hvalue(ENABLE_BORDERS ? gpu_regs[HBE] : MIN(gpu_regs[HDB1], gpu_regs[HDB2]));
674            int hbstart = effective_hvalue(gpu_regs[ENABLE_BORDERS ? HBB : HDE]);
675            int vperiod = (gpu_regs[VP] & 0x7ff) + 1;
676            int vbend = gpu_regs[VBE] & 0x7ff;
677            int vbstart = gpu_regs[VBB] & 0x7ff;
678
679            /* adjust for the half-lines */
680            if (hperiod != 0 && vperiod != 0 && hbend < hbstart && vbend < vbstart && hbstart < hperiod)
681            {
682               rectangle visarea;
683               visarea.min_x = hbend / 2;
684               visarea.max_x = hbstart / 2 - 1;
685               visarea.min_y = vbend / 2;
686               visarea.max_y = vbstart / 2 - 1;
687               video_screen_configure(0, hperiod / 2, vperiod / 2, &visarea, HZ_TO_ATTOSECONDS((double)COJAG_PIXEL_CLOCK * 2 / hperiod / vperiod));
688            }
689            break;
690         }
661691      }
662692   }
663693
r1527r1528
702732   switch (offset)
703733   {
704734      case 0:
705         get_crosshair_xy(1, &beamx, &beamy);
706         beamx += 52;
707         beamy += 17;
735         get_crosshair_xy(Machine, 1, &beamx, &beamy);
708736         return (beamy << 16) | (beamx ^ 0x1ff);
709737
710738      case 1:
711         get_crosshair_xy(0, &beamx, &beamy);
712         beamx += 52;
713         beamy += 17;
739         get_crosshair_xy(Machine, 0, &beamx, &beamy);
714740         return (beamy << 16) | (beamx ^ 0x1ff);
715741
716742      case 2:
r1527r1528
727753 *
728754 *************************************/
729755
756static TIMER_CALLBACK( cojag_scanline_update )
757{
758   int vc = param & 0xffff;
759   int hdb = param >> 16;
760
761   /* only run if video is enabled and we are past the "display begin" */
762   if ((gpu_regs[VMODE] & 1) && vc >= (gpu_regs[VDB] & 0x7ff))
763   {
764      UINT32 *dest = BITMAP_ADDR32(screen_bitmap, vc / 2, 0);
765      int maxx = machine->screen[0].visarea.max_x;
766      int hde = effective_hvalue(gpu_regs[HDE]) / 2;
767      UINT16 scanline[360];
768      int x;
769
770      /* if we are first on this scanline, clear to the border color */
771      if (ENABLE_BORDERS && vc % 2 == 0)
772      {
773         rgb_t border = MAKE_RGB(gpu_regs[BORD1] & 0xff, gpu_regs[BORD1] >> 8, gpu_regs[BORD2] & 0xff);
774         for (x = machine->screen[0].visarea.min_x; x <= machine->screen[0].visarea.max_x; x++)
775            dest[x] = border;
776      }
777
778      /* process the object list for this counter value */
779      process_object_list(vc, scanline);
780
781      /* copy the data to the target, clipping */
782      for (x = 0; x < 360 && hdb <= maxx && hdb < hde; x++, hdb++)
783         dest[hdb] = pen_table[scanline[x]];
784   }
785
786   /* adjust the timer in a loop, to handle missed cases */
787   do
788   {
789      /* handle vertical interrupts */
790      if (vc == gpu_regs[VI])
791      {
792         cpu_irq_state |= 1;
793         update_cpu_irq();
794      }
795
796      /* point to the next counter value */
797      if (++vc / 2 >= machine->screen[0].height)
798         vc = 0;
799
800   } while (!adjust_object_timer(machine, vc));
801}
802
803
730804VIDEO_START( cojag )
731805{
806   object_timer = timer_alloc(cojag_scanline_update, NULL);
807   adjust_object_timer(machine, 0);
808
809   screen_bitmap = auto_bitmap_alloc(720, 512, BITMAP_FORMAT_RGB32);
810
732811   jagobj_init();
733812
734813   pen_table = auto_malloc(65536 * sizeof(pen_t));
735814
736   vi_timer = timer_alloc(vi_callback, NULL);
737
738815   state_save_register_global_pointer(pen_table, 65536);
739816   state_save_register_global_array(blitter_regs);
740817   state_save_register_global_array(gpu_regs);
r1527r1528
760837   }
761838
762839   /* render the object list */
763   process_object_list(bitmap, cliprect);
840   copybitmap(bitmap, screen_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
764841   return 0;
765842}
766843
src/mame/video/cvs.c
r1527r1528
210210
211211VIDEO_UPDATE( cvs )
212212{
213   const int ram_based_char_start_indecies[] = { 0xe0, 0xc0, 0x100, 0x80 };
213   static const int ram_based_char_start_indices[] = { 0xe0, 0xc0, 0x100, 0x80 };
214214   int code;
215215   offs_t offs;
216216   int scroll[8];
r1527r1528
232232   character_banking_mode = cvs_get_character_banking_mode();
233233
234234   /* ROM based tiles first */
235   for (code = 0; code < ram_based_char_start_indecies[character_banking_mode]; code++)
235   for (code = 0; code < ram_based_char_start_indices[character_banking_mode]; code++)
236236      decodechar(machine->gfx[0], code, memory_region(REGION_GFX1));
237237
238238   /* now the RAM based ones */
src/mame/video/seta.c
r1527r1528
608608         colortable[color * 64 + pen + 32*16*2] = ((color * 16 + pen)%(32*16)) + 32*16*2;
609609}
610610
611// color prom
612PALETTE_INIT( inttoote )
613{
614   int x;
615   for (x = 0; x < 0x200 ; x++)
616   {
617      int data = (color_prom[x*2] <<8) | color_prom[x*2+1];
618      palette_set_color_rgb(machine, x, pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
619   }
620}
611621
612
613
614622PALETTE_INIT( usclssic )
615623{
616624   int color, pen;
src/mame/video/carjmbre.c
r1527r1528
5454
5555   if(oldbg!=carjmbre_bgcolor)
5656   {
57      memset(dirtybuffer,1,videoram_size);
58
5957      for (i=0;i<64;i+=4)
6058         palette_set_color_rgb(Machine, i, (carjmbre_bgcolor&0xff)*0x50, (carjmbre_bgcolor&0xff)*0x50, (carjmbre_bgcolor&0xff)!=0?0x50:0);
6159   }
src/mame/video/megazone.c
r1527r1528
8585
8686WRITE8_HANDLER( megazone_flipscreen_w )
8787{
88   if (flipscreen != (data & 1))
89   {
90      flipscreen = data & 1;
91      memset(dirtybuffer,1,videoram_size);
92   }
88   flipscreen = data & 1;
9389}
9490
9591VIDEO_START( megazone )
9692{
97   dirtybuffer = 0;
98   tmpbitmap = 0;
99
100   dirtybuffer = auto_malloc(videoram_size);
101   memset(dirtybuffer,1,videoram_size);
102
10393   tmpbitmap = auto_bitmap_alloc(256,256,machine->screen[0].format);
10494}
10595
r1527r1528
10999   int offs;
110100   int x,y;
111101
112   /* for every character in the Video RAM, check if it has been modified */
113   /* since last time and update it accordingly. */
102   /* for every character in the Video RAM */
114103   for (offs = videoram_size - 1;offs >= 0;offs--)
115104   {
116      if (dirtybuffer[offs])
117      {
118         int sx,sy,flipx,flipy;
105      int sx,sy,flipx,flipy;
119106
120         dirtybuffer[offs] = 0;
121
122         sx = offs % 32;
123         sy = offs / 32;
124         flipx = colorram[offs] & (1<<6);
125         flipy = colorram[offs] & (1<<5);
126         if (flipscreen)
127         {
128            sx = 31 - sx;
129            sy = 31 - sy;
130            flipx = !flipx;
131            flipy = !flipy;
132         }
133
134         drawgfx(tmpbitmap,machine->gfx[0],
135               ((int)videoram[offs]) + ((colorram[offs] & (1<<7) ? 256 : 0) ),
136               (colorram[offs] & 0x0f) + 0x10,
137               flipx,flipy,
138               8*sx,8*sy,
139               0,TRANSPARENCY_NONE,0);
107      sx = offs % 32;
108      sy = offs / 32;
109      flipx = colorram[offs] & (1<<6);
110      flipy = colorram[offs] & (1<<5);
111      if (flipscreen)
112      {
113         sx = 31 - sx;
114         sy = 31 - sy;
115         flipx = !flipx;
116         flipy = !flipy;
140117      }
118
119      drawgfx(tmpbitmap,machine->gfx[0],
120            ((int)videoram[offs]) + ((colorram[offs] & (1<<7) ? 256 : 0) ),
121            (colorram[offs] & 0x0f) + 0x10,
122            flipx,flipy,
123            8*sx,8*sy,
124            0,TRANSPARENCY_NONE,0);
141125   }
142126
143127   /* copy the temporary bitmap to the screen */
src/mame/video/victory.c
r1527r1528
55***************************************************************************/
66
77#include "driver.h"
8#include "victory.h"
89
910
1011/* globally-accessible storage */
12UINT8 *victory_videoram;
1113UINT8 *victory_charram;
1214
1315/* local allocated storage */
16static UINT16 victory_paletteram[0x40];   /* 9 bits used */
1417static UINT8 *bgbitmap;
1518static UINT8 *fgbitmap;
16static UINT8 *bgdirty;
17static UINT8 *chardirty;
18static UINT8 *scandirty;
1919static UINT8 *rram, *gram, *bram;
2020
2121/* interrupt, collision, and control states */
r1527r1528
2323static UINT8 fgcoll, fgcollx, fgcolly;
2424static UINT8 bgcoll, bgcollx, bgcolly;
2525static UINT8 scrollx, scrolly;
26static UINT8 update_complete;
2726static UINT8 video_control;
2827
2928/* microcode state */
r1527r1528
4443/* from what I can tell, this should be divided by 32, not 8  */
4544/* but the interrupt test does some precise timing, and fails */
4645/* if it's not 8 */
47#define MICRO_STATE_CLOCK_PERIOD   ATTOTIME_IN_HZ(11827000/8)
46#define VICTORY_MICRO_STATE_CLOCK   (XTAL_11_289MHz)
47#define MICRO_STATE_CLOCK_PERIOD   ATTOTIME_IN_HZ(VICTORY_MICRO_STATE_CLOCK / 8)
4848
4949
5050/* debugging constants */
r1527r1528
7979   bgbitmap = auto_malloc(256 * 256);
8080   fgbitmap = auto_malloc(256 * 256);
8181
82   /* allocate dirty maps */
83   bgdirty = auto_malloc(32 * 32);
84   chardirty = auto_malloc(256);
85   scandirty = auto_malloc(512);
86
87   /* mark everything dirty */
88   memset(bgdirty, 1, 32 * 32);
89   memset(chardirty, 1, 256);
90   memset(scandirty, 1, 512);
91
9282   /* reset globals */
9383   vblank_irq = 0;
9484   fgcoll = fgcollx = fgcolly = 0;
9585   bgcoll = bgcollx = bgcolly = 0;
9686   scrollx = scrolly = 0;
97   update_complete = 0;
9887   video_control = 0;
9988   memset(&micro, 0, sizeof(micro));
10089   micro.timer = timer_alloc(NULL, NULL);
90
91   /* register for state saving */
92   state_save_register_global_array(victory_paletteram);
10193}
10294
10395
r1527r1528
120112INTERRUPT_GEN( victory_vblank_interrupt )
121113{
122114   vblank_irq = 1;
115
123116   victory_update_irq();
124   logerror("------------- VBLANK ----------------\n");
125117}
126118
127119
128120
129121/*************************************
130122 *
131 *  Video RAM write
123 *  Palette handling
132124 *
133125 *************************************/
134126
135WRITE8_HANDLER( victory_videoram_w )
127WRITE8_HANDLER( victory_paletteram_w )
136128{
137   if (videoram[offset] != data)
138   {
139      videoram[offset] = data;
140      bgdirty[offset] = 1;
141   }
129   victory_paletteram[offset & 0x3f] = ((offset & 0x80) << 1) | data;
142130}
143131
144132
145
146/*************************************
147 *
148 *  Character RAM write
149 *
150 *************************************/
151
152WRITE8_HANDLER( victory_charram_w )
133static void set_palette(running_machine *machine)
153134{
154   if (victory_charram[offset] != data)
135   offs_t offs;
136
137   for (offs = 0; offs < 0x40; offs++)
155138   {
156      victory_charram[offset] = data;
157      chardirty[(offset / 8) % 256] = 1;
139      UINT16 data = victory_paletteram[offs];
140
141      palette_set_color_rgb(machine, offs, pal3bit(data >> 6), pal3bit(data >> 0), pal3bit(data >> 3));
158142   }
159143}
160144
r1527r1528
162146
163147/*************************************
164148 *
165 *  Palette RAM write
166 *
167 *************************************/
168
169WRITE8_HANDLER( victory_paletteram_w )
170{
171   palette_set_color_rgb(Machine, offset & 0x3f, pal3bit(((offset & 0x80) >> 5) | ((data & 0xc0) >> 6)), pal3bit(data >> 0), pal3bit(data >> 3));
172}
173
174
175
176/*************************************
177 *
178149 *  Video control read
179150 *
180151 *************************************/
r1527r1528
185156
186157   switch (offset)
187158   {
188      case 0:      /* 5XFIQ */
159      case 0x00:   /* 5XFIQ */
189160         result = fgcollx;
190161         if (LOG_COLLISION) logerror("%04X:5XFIQ read = %02X\n", activecpu_get_previouspc(), result);
191162         return result;
192163
193      case 1:      /* 5CLFIQ */
164      case 0x01:   /* 5CLFIQ */
194165         result = fgcolly;
195166         if (fgcoll)
196167         {
r1527r1528
200171         if (LOG_COLLISION) logerror("%04X:5CLFIQ read = %02X\n", activecpu_get_previouspc(), result);
201172         return result;
202173
203      case 2:      /* 5BACKX */
174      case 0x02:   /* 5BACKX */
204175         result = bgcollx & 0xfc;
205176         if (LOG_COLLISION) logerror("%04X:5BACKX read = %02X\n", activecpu_get_previouspc(), result);
206177         return result;
207178
208      case 3:      /* 5BACKY */
179      case 0x03:   /* 5BACKY */
209180         result = bgcolly;
210181         if (bgcoll)
211182         {
r1527r1528
215186         if (LOG_COLLISION) logerror("%04X:5BACKY read = %02X\n", activecpu_get_previouspc(), result);
216187         return result;
217188
218      case 4:      /* 5STAT */
189      case 0x04:   /* 5STAT */
219190         // D7 = BUSY (9A1) -- microcode
220191         // D6 = 5FCIRQ (3B1)
221192         // D5 = 5VIRQ
r1527r1528
249220{
250221   switch (offset)
251222   {
252      case 0:      /* LOAD IL */
223      case 0x00:   /* LOAD IL */
253224         if (LOG_MICROCODE) logerror("%04X:IL=%02X\n", activecpu_get_previouspc(), data);
254225         micro.i = (micro.i & 0xff00) | (data & 0x00ff);
255226         break;
256227
257      case 1:      /* LOAD IH */
228      case 0x01:   /* LOAD IH */
258229         if (LOG_MICROCODE) logerror("%04X:IH=%02X\n", activecpu_get_previouspc(), data);
259230         micro.i = (micro.i & 0x00ff) | ((data << 8) & 0xff00);
260231         if (micro.cmdlo == 5)
r1527r1528
264235         }
265236         break;
266237
267      case 2:      /* LOAD CMD */
238      case 0x02:   /* LOAD CMD */
268239         if (LOG_MICROCODE) logerror("%04X:CMD=%02X\n", activecpu_get_previouspc(), data);
269240         micro.cmd = data;
270241         micro.cmdlo = data & 7;
r1527r1528
279250         }
280251         break;
281252
282      case 3:      /* LOAD G */
253      case 0x03:   /* LOAD G */
283254         if (LOG_MICROCODE) logerror("%04X:G=%02X\n", activecpu_get_previouspc(), data);
284255         micro.g = data;
285256         break;
286257
287      case 4:      /* LOAD X */
258      case 0x04:   /* LOAD X */
288259         if (LOG_MICROCODE) logerror("%04X:X=%02X\n", activecpu_get_previouspc(), data);
289260         micro.xp = data;
290261         if (micro.cmdlo == 3)
r1527r1528
294265         }
295266         break;
296267
297      case 5:      /* LOAD Y */
268      case 0x05:   /* LOAD Y */
298269         if (LOG_MICROCODE) logerror("%04X:Y=%02X\n", activecpu_get_previouspc(), data);
299270         micro.yp = data;
300271         if (micro.cmdlo == 4)
r1527r1528
304275         }
305276         break;
306277
307      case 6:      /* LOAD R */
278      case 0x06:   /* LOAD R */
308279         if (LOG_MICROCODE) logerror("%04X:R=%02X\n", activecpu_get_previouspc(), data);
309280         micro.r = data;
310281         break;
311282
312      case 7:      /* LOAD B */
283      case 0x07:   /* LOAD B */
313284         if (LOG_MICROCODE) logerror("%04X:B=%02X\n", activecpu_get_previouspc(), data);
314285         micro.b = data;
315286         if (micro.cmdlo == 2)
r1527r1528
324295         }
325296         break;
326297
327      case 8:      /* SCROLLX */
298      case 0x08:   /* SCROLLX */
328299         if (LOG_MICROCODE) logerror("%04X:SCROLLX write = %02X\n", activecpu_get_previouspc(), data);
329300         scrollx = data;
330301         break;
331302
332      case 9:      /* SCROLLY */
303      case 0x09:   /* SCROLLY */
333304         if (LOG_MICROCODE) logerror("%04X:SCROLLY write = %02X\n", activecpu_get_previouspc(), data);
334305         scrolly = data;
335306         break;
336307
337      case 10:   /* CONTROL */
308      case 0x0a:   /* CONTROL */
338309         // D7 = HLMBK
339310         // D6 = VLMBK
340311         // D5 = BIRQEA
r1527r1528
346317         video_control = data;
347318         break;
348319
349      case 11:   /* CLRVIRQ */
320      case 0x0b:   /* CLRVIRQ */
350321         if (LOG_MICROCODE) logerror("%04X:CLRVIRQ write = %02X\n", activecpu_get_previouspc(), data);
351322         vblank_irq = 0;
352323         victory_update_irq();
r1527r1528
601572   if (micro.cmd & 0x40)
602573      rram[addr] = micro.r;
603574
604   scandirty[addr >> 5] = 1;
605575   count_states(3);
606576   return 0;
607577}
r1527r1528
708678      }
709679   }
710680
711   /* mark scanlines dirty */
712   sy = micro.yp;
713   for (y = 0; y < ycount; y++)
714      scandirty[sy++ & 0xff] = 1;
715
716681   count_states(3 + (2 + 2 * ycount) * xcount);
717682
718683   return micro.cmd & 0x80;
r1527r1528
858823         bram[addr + 1] ^= micro.b << nshift;
859824         rram[addr + 0] ^= micro.r >> shift;
860825         rram[addr + 1] ^= micro.r << nshift;
861         scandirty[y] = 1;
862826
863827         acc += i;
864828         if (acc & 0x100)
r1527r1528
895859         bram[addr + 1] ^= micro.b << nshift;
896860         rram[addr + 0] ^= micro.r >> shift;
897861         rram[addr + 1] ^= micro.r << nshift;
898         scandirty[y] = 1;
899862
900863         acc += i;
901864         if (acc & 0x100)
r1527r1528
962925         bram[daddr] = bram[saddr];
963926      if (micro.cmd & 0x40)
964927         rram[daddr] = rram[saddr];
965
966      scandirty[daddr >> 5] = 1;
967928   }
968929
969930   count_states(3 + 2 * (64 - (micro.r & 31) * 2));
r1527r1528
10471008
10481009   count_states(4);
10491010
1050   scandirty[micro.yp] = 1;
10511011   return micro.cmd & 0x80;
10521012}
10531013
r1527r1528
10621022{
10631023   int x, y, row, offs;
10641024
1065   /* update the background and any dirty characters in it */
10661025   for (y = offs = 0; y < 32; y++)
10671026      for (x = 0; x < 32; x++, offs++)
10681027      {
1069         int code = videoram[offs];
1028         int code = victory_videoram[offs];
10701029
1071         /* see if the videoram or character RAM has changed, redraw it */
1072         if (bgdirty[offs] || chardirty[code])
1030         for (row = 0; row < 8; row++)
10731031         {
1074            for (row = 0; row < 8; row++)
1075            {
1076               UINT8 pix2 = victory_charram[0x0000 + 8 * code + row];
1077               UINT8 pix1 = victory_charram[0x0800 + 8 * code + row];
1078               UINT8 pix0 = victory_charram[0x1000 + 8 * code + row];
1079               UINT8 *dst = &bgbitmap[(y * 8 + row) * 256 + x * 8];
1032            UINT8 pix2 = victory_charram[0x0000 + 8 * code + row];
1033            UINT8 pix1 = victory_charram[0x0800 + 8 * code + row];
1034            UINT8 pix0 = victory_charram[0x1000 + 8 * code + row];
1035            UINT8 *dst = &bgbitmap[(y * 8 + row) * 256 + x * 8];
10801036
1081               *dst++ = ((pix2 & 0x80) >> 5) | ((pix1 & 0x80) >> 6) | ((pix0 & 0x80) >> 7);
1082               *dst++ = ((pix2 & 0x40) >> 4) | ((pix1 & 0x40) >> 5) | ((pix0 & 0x40) >> 6);
1083               *dst++ = ((pix2 & 0x20) >> 3) | ((pix1 & 0x20) >> 4) | ((pix0 & 0x20) >> 5);
1084               *dst++ = ((pix2 & 0x10) >> 2) | ((pix1 & 0x10) >> 3) | ((pix0 & 0x10) >> 4);
1085               *dst++ = ((pix2 & 0x08) >> 1) | ((pix1 & 0x08) >> 2) | ((pix0 & 0x08) >> 3);
1086               *dst++ = ((pix2 & 0x04)     ) | ((pix1 & 0x04) >> 1) | ((pix0 & 0x04) >> 2);
1087               *dst++ = ((pix2 & 0x02) << 1) | ((pix1 & 0x02)     ) | ((pix0 & 0x02) >> 1);
1088               *dst++ = ((pix2 & 0x01) << 2) | ((pix1 & 0x01) << 1) | ((pix0 & 0x01)     );
1089            }
1090            bgdirty[offs] = 0;
1037            *dst++ = ((pix2 & 0x80) >> 5) | ((pix1 & 0x80) >> 6) | ((pix0 & 0x80) >> 7);
1038            *dst++ = ((pix2 & 0x40) >> 4) | ((pix1 & 0x40) >> 5) | ((pix0 & 0x40) >> 6);
1039            *dst++ = ((pix2 & 0x20) >> 3) | ((pix1 & 0x20) >> 4) | ((pix0 & 0x20) >> 5);
1040            *dst++ = ((pix2 & 0x10) >> 2) | ((pix1 & 0x10) >> 3) | ((pix0 & 0x10) >> 4);
1041            *dst++ = ((pix2 & 0x08) >> 1) | ((pix1 & 0x08) >> 2) | ((pix0 & 0x08) >> 3);
1042            *dst++ = ((pix2 & 0x04)     ) | ((pix1 & 0x04) >> 1) | ((pix0 & 0x04) >> 2);
1043            *dst++ = ((pix2 & 0x02) << 1) | ((pix1 & 0x02)     ) | ((pix0 & 0x02) >> 1);
1044            *dst++ = ((pix2 & 0x01) << 2) | ((pix1 & 0x01) << 1) | ((pix0 & 0x01)     );
10911045         }
10921046      }
1093
1094   /* reset the char dirty array */
1095   memset(chardirty, 0, 256);
10961047}
10971048
10981049
r1527r1528
11061057{
11071058   int x, y;
11081059
1109   /* update the foreground's dirty scanlines */
11101060   for (y = 0; y < 256; y++)
1111      if (scandirty[y])
1061   {
1062      UINT8 *dst = &fgbitmap[y * 256];
1063
1064      /* assemble the RGB bits for each 8-pixel chunk */
1065      for (x = 0; x < 256; x += 8)
11121066      {
1113         UINT8 *dst = &fgbitmap[y * 256];
1067         UINT8 g = gram[y * 32 + x / 8];
1068         UINT8 b = bram[y * 32 + x / 8];
1069         UINT8 r = rram[y * 32 + x / 8];
11141070
1115         /* assemble the RGB bits for each 8-pixel chunk */
1116         for (x = 0; x < 256; x += 8)
1117         {
1118            UINT8 g = gram[y * 32 + x / 8];
1119            UINT8 b = bram[y * 32 + x / 8];
1120            UINT8 r = rram[y * 32 + x / 8];
1121
1122            *dst++ = ((r & 0x80) >> 5) | ((b & 0x80) >> 6) | ((g & 0x80) >> 7);
1123            *dst++ = ((r & 0x40) >> 4) | ((b & 0x40) >> 5) | ((g & 0x40) >> 6);
1124            *dst++ = ((r & 0x20) >> 3) | ((b & 0x20) >> 4) | ((g & 0x20) >> 5);
1125            *dst++ = ((r & 0x10) >> 2) | ((b & 0x10) >> 3) | ((g & 0x10) >> 4);
1126            *dst++ = ((r & 0x08) >> 1) | ((b & 0x08) >> 2) | ((g & 0x08) >> 3);
1127            *dst++ = ((r & 0x04)     ) | ((b & 0x04) >> 1) | ((g & 0x04) >> 2);
1128            *dst++ = ((r & 0x02) << 1) | ((b & 0x02)     ) | ((g & 0x02) >> 1);
1129            *dst++ = ((r & 0x01) << 2) | ((b & 0x01) << 1) | ((g & 0x01)     );
1130         }
1131         scandirty[y] = 0;
1071         *dst++ = ((r & 0x80) >> 5) | ((b & 0x80) >> 6) | ((g & 0x80) >> 7);
1072         *dst++ = ((r & 0x40) >> 4) | ((b & 0x40) >> 5) | ((g & 0x40) >> 6);
1073         *dst++ = ((r & 0x20) >> 3) | ((b & 0x20) >> 4) | ((g & 0x20) >> 5);
1074         *dst++ = ((r & 0x10) >> 2) | ((b & 0x10) >> 3) | ((g & 0x10) >> 4);
1075         *dst++ = ((r & 0x08) >> 1) | ((b & 0x08) >> 2) | ((g & 0x08) >> 3);
1076         *dst++ = ((r & 0x04)     ) | ((b & 0x04) >> 1) | ((g & 0x04) >> 2);
1077         *dst++ = ((r & 0x02) << 1) | ((b & 0x02)     ) | ((g & 0x02) >> 1);
1078         *dst++ = ((r & 0x01) << 2) | ((b & 0x01) << 1) | ((g & 0x01)     );
11321079      }
1080   }
11331081}
11341082
11351083
r1527r1528
11451093
11461094/*************************************
11471095 *
1148 *  End-of-frame callback
1149 *
1150 *************************************/
1151
1152VIDEO_EOF( victory )
1153{
1154   int bgcollmask = (video_control & 4) ? 4 : 7;
1155   int count = 0;
1156   int x, y;
1157
1158   /* if we already did it, skip it */
1159   if (update_complete)
1160   {
1161      update_complete = 0;
1162      return;
1163   }
1164   update_complete = 0;
1165
1166   /* update the foreground & background */
1167   update_foreground();
1168   update_background();
1169
1170   /* blend the bitmaps and do collision detection */
1171   for (y = 0; y < 256; y++)
1172   {
1173      int sy = (scrolly + y) & 255;
1174      UINT8 *fg = &fgbitmap[y * 256];
1175      UINT8 *bg = &bgbitmap[sy * 256];
1176
1177      /* do the blending */
1178      for (x = 0; x < 256; x++)
1179      {
1180         int fpix = *fg++;
1181         int bpix = bg[(x + scrollx) & 255];
1182         if (fpix && (bpix & bgcollmask) && count++ < 128)
1183            timer_set(video_screen_get_time_until_pos(0, y, x), NULL, x | (y << 8), bgcoll_irq_callback);
1184      }
1185   }
1186}
1187
1188
1189
1190/*************************************
1191 *
11921096 *  Standard screen refresh callback
11931097 *
11941098 *************************************/
r1527r1528
11991103   int count = 0;
12001104   int x, y;
12011105
1106   /* copy the palette from palette RAM */
1107   set_palette(machine);
1108
12021109   /* update the foreground & background */
12031110   update_foreground();
12041111   update_background();
r1527r1528
12061113   /* blend the bitmaps and do collision detection */
12071114   for (y = 0; y < 256; y++)
12081115   {
1209      int sy = (scrolly + y) & 255;
1116      UINT8 sy = scrolly + y;
12101117      UINT8 *fg = &fgbitmap[y * 256];
12111118      UINT8 *bg = &bgbitmap[sy * 256];
12121119      UINT8 scanline[256];
r1527r1528
12251132      draw_scanline8(bitmap, 0, y, 256, scanline, machine->pens, -1);
12261133   }
12271134
1228   /* indicate that we already did collision detection */
1229   update_complete = 1;
12301135   return 0;
12311136}
src/mame/video/vigilant.c
r1527r1528
4040
4141VIDEO_START( vigilant )
4242{
43   video_start_generic(machine);
44
4543   bg_bitmap = auto_bitmap_alloc(512*4,256,machine->screen[0].format);
4644}
4745
r1527r1528
322320      int color = (attributes & 0xF0) >> 4;
323321      int tile_number = videoram[offs] | ((attributes & 0x0F) << 8);
324322
325      if (dirtybuffer[offs] || dirtybuffer[offs+1])
326      {
327         dirtybuffer[offs] = dirtybuffer[offs+1] = 0;
328
329         drawgfx(tmpbitmap,machine->gfx[0],
330               tile_number,
331               color,
332               0,0,
333               sx,sy,
334               0,TRANSPARENCY_NONE,0);
335      }
323      drawgfx(bitmap,machine->gfx[0],
324            tile_number,
325            color,
326            0,0,
327            sx,sy,
328            cliprect,TRANSPARENCY_NONE,0);
336329   }
337330
338   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
339
340331   draw_sprites(machine,bitmap,cliprect);
341332   return 0;
342333}
src/mame/video/tatsumi.c
r1527r1528
1212UINT16* tatsumi_sprite_control_ram;
1313static UINT16* roundup5_vram;
1414
15extern UINT16 bigfight_a20000[8], bigfight_a40000[2], bigfight_a60000[8];
15extern UINT16 bigfight_a40000[2];
1616static UINT16 bigfight_bank, bigfight_last_bank;
1717
1818static UINT8 roundupt_crt_selected_reg;
src/mame/video/konamiic.c
r1527r1528
22702270   K052109_RMRD_line = state;
22712271}
22722272
2273int K052109_get_RMRD_line(void)
2274{
2275   return K052109_RMRD_line;
2276}
22732277
2278
22742279void K052109_tilemap_update(void)
22752280{
22762281#if 0
src/mame/video/konamiic.h
r1527r1528
7575READ16_HANDLER( K052109_lsb_r );
7676WRITE16_HANDLER( K052109_lsb_w );
7777void K052109_set_RMRD_line(int state);
78int K052109_get_RMRD_line(void);
7879void K052109_tilemap_update(void);
7980int K052109_is_IRQ_enabled(void);
8081void K052109_set_layer_offsets(int layer, int dx, int dy);
src/mame/video/csk.c
r1527r1528
1010
1111#define CPK_VIDEO_SIZE   0x800
1212
13static UINT8 * cpk_colorram;
14static UINT8 * cpk_videoram;
13UINT8 * cpk_colorram;
14UINT8 * cpk_videoram;
15UINT8 * cpk_expram;
1516static UINT8 * cpk_palette;
1617static UINT8 * cpk_palette2;
17static UINT8 * cpk_expram;
1818
19static UINT8 * dirtybuffer1;
20static mame_bitmap *tmpbitmap2;
21
2219static int hopperOK = 0;
2320static int intstate1 = 0;   /* unknown */
2421static int intstate2 = 0;   /* unknown */
r1527r1528
4845
4946/* Video handling */
5047
51READ8_HANDLER( cpk_videoram_r )
52{
53   return cpk_videoram[offset];
54}
55
56WRITE8_HANDLER( cpk_videoram_w )
57{
58   if (cpk_videoram[offset] != data)
59   {
60      cpk_videoram[offset] = data;
61      dirtybuffer[offset] = 1;
62   }
63}
64
65READ8_HANDLER( cpk_colorram_r )
66{
67   return cpk_colorram[offset];
68}
69
70WRITE8_HANDLER( cpk_colorram_w )
71{
72   if (cpk_colorram[offset] != data)
73   {
74      cpk_colorram[offset] = data;
75      dirtybuffer[offset] = 1;
76   }
77}
78
7948READ8_HANDLER( cpk_expansion_r )
8049{
8150   UINT8 * RAM = memory_region(REGION_GFX3);
r1527r1528
8352}
8453
8554
86WRITE8_HANDLER( cpk_expansion_w )
87{
88   if (cpk_expram[offset] != data)
89   {
90      cpk_expram[offset] = data;
91      dirtybuffer1[offset] = 1;
92   }
93}
94
9555/* Machine init/deinit  */
9656
9757VIDEO_START( cska )
9858{
9959   int i;
10060
101   dirtybuffer  = auto_malloc(CPK_VIDEO_SIZE * sizeof(UINT8));
102   dirtybuffer1 = auto_malloc(CPK_VIDEO_SIZE * sizeof(UINT8));
103   cpk_colorram = auto_malloc(CPK_VIDEO_SIZE * sizeof(UINT8));
104   cpk_videoram = auto_malloc(CPK_VIDEO_SIZE * sizeof(UINT8));
105   cpk_expram   = auto_malloc(CPK_VIDEO_SIZE * sizeof(UINT8));
106
10761   cpk_palette  = auto_malloc(0x800 * sizeof(UINT8));
10862   cpk_palette2 = auto_malloc(0x800 * sizeof(UINT8));
10963
110   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
111   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
112
11364   /* leave everything at the default, but map all foreground 0 pens as transparent */
11465   for (i = 0;i < 16;i++)
11566        {
r1527r1528
14495   memset(cpk_videoram, 0, CPK_VIDEO_SIZE);
14596   memset(cpk_colorram, 0, CPK_VIDEO_SIZE);
14697   memset(cpk_expram, 0, CPK_VIDEO_SIZE);
147   memset(dirtybuffer, 1, CPK_VIDEO_SIZE);
148   memset(dirtybuffer1, 0, CPK_VIDEO_SIZE);
14998   memset(cpk_palette, 0, 0x800);
15099   memset(cpk_palette2, 0, 0x800);
151100
r1527r1528
198147//             memset(&palette_used_colors[64 * color + 1],PALETTE_COLOR_USED,63);
199148   }
200149
201   if (abilityflag)
202//                memset(&palette_used_colors[0], PALETTE_COLOR_USED, 64);
203
204//        if (palette_recalc())
205   {
206      memset(dirtybuffer, 1, CPK_VIDEO_SIZE);
207   }
208
209150#if 0
210151   if (keyboard_pressed(KEYCODE_9))
211152   {
r1527r1528
223164   {
224165      for (offs = (CPK_VIDEO_SIZE)-1; offs >= 0; offs--)
225166      {
226         if (dirtybuffer1[offs] || dirtybuffer[offs])
227         {
228            int sx,sy;
167         int sx,sy;
229168
230169
231            dirtybuffer1[offs] = 0;
170         sx = offs % 64;
171         sy = offs / 64;
232172
233            sx = offs % 64;
234            sy = offs / 64;
235
236            drawgfx(tmpbitmap2,machine->gfx[1+(offs % 4)],
237                  cpk_expram[offs],
238                  0,
239                  0,0,
240                  8*sx,32*sy,
241                  0,TRANSPARENCY_NONE,0);
242         }
173         drawgfx(bitmap,machine->gfx[1+(offs % 4)],
174               cpk_expram[offs],
175               0,
176               0,0,
177               8*sx,32*sy,
178               cliprect,TRANSPARENCY_NONE,0);
243179      }
244      copybitmap(bitmap,tmpbitmap2,0,0,0,0,cliprect,TRANSPARENCY_NONE,0);
245180   }
246181
247182   for (offs = CPK_VIDEO_SIZE-1; offs >= 0; offs--)
r1527r1528
249184      int tile = cpk_videoram[offs] + ((cpk_colorram[offs] & 0x1f) << 8);
250185      int color = (tile != 0x1fff) ? (((cpk_colorram[offs] & 0xe0) >> 4) + 1) : 0;
251186
252      if (dirtybuffer[offs])
253      {
254         int sx,sy;
187      int sx,sy;
255188
256189
257         dirtybuffer[offs] = 0;
190      sx = offs % 64;
191      sy = offs / 64;
258192
259         sx = offs % 64;
260         sy = offs / 64;
261
262         drawgfx(tmpbitmap,machine->gfx[0],
263               tile,
264               color,
265               0,0,
266               8*sx,8*sy,
267               0, TRANSPARENCY_NONE, 0);
268      }
193      drawgfx(bitmap,machine->gfx[0],
194            tile,
195            color,
196            0,0,
197            8*sx,8*sy,
198            cliprect,
199            (abilityflag) ? TRANSPARENCY_COLOR : TRANSPARENCY_NONE, 0);
269200   }
270201
271   copybitmap(bitmap,tmpbitmap,0,0,0,0,cliprect, (abilityflag) ? TRANSPARENCY_COLOR : TRANSPARENCY_NONE, 0);
272202   return 0;
273203}
src/mame/video/naughtyb.c
r1527r1528
1212
1313UINT8 *naughtyb_videoram2;
1414
15static int videoreg;
16
1715/* use these to draw charset B */
1816UINT8 *naughtyb_scrollreg;
1917
r1527r1528
150148***************************************************************************/
151149VIDEO_START( naughtyb )
152150{
153   videoreg = palreg = bankreg = 0;
151   palreg = bankreg = 0;
154152
155153   /* Naughty Boy has a virtual screen twice as large as the visible screen */
156   dirtybuffer = auto_malloc(videoram_size);
157   memset(dirtybuffer, 1, videoram_size);
158
159154   tmpbitmap = auto_bitmap_alloc(68*8,28*8,machine->screen[0].format);
160155}
161156
162157
163158
164159
165WRITE8_HANDLER( naughtyb_videoram2_w )
166{
167   if (naughtyb_videoram2[offset] != data)
168   {
169      dirtybuffer[offset] = 1;
170
171      naughtyb_videoram2[offset] = data;
172   }
173}
174
175
176
177160WRITE8_HANDLER( naughtyb_videoreg_w )
178161{
179162   // bits 4+5 control the sound circuit
180163
181164   pleiads_sound_control_c_w(offset,data);
182165
183    if ((videoreg & 0x0f) != (data & 0x0f))
184   {
185      videoreg = data;
186
187      naughtyb_cocktail =
188         ( ( input_port_2_r(0) & 0x80 ) &&   // cabinet == cocktail
189           ( data & 0x01 ) );            // handling player 2
190      palreg  = (data >> 1) & 0x03;         // pallette sel is bit 1 & 2
191      bankreg = (data >> 2) & 0x01;         // banksel is just bit 2
192
193      memset (dirtybuffer, 1, videoram_size);
194   }
166   naughtyb_cocktail =
167      ( ( input_port_2_r(0) & 0x80 ) &&   // cabinet == cocktail
168        ( data & 0x01 ) );            // handling player 2
169   palreg  = (data >> 1) & 0x03;         // pallette sel is bit 1 & 2
170   bankreg = (data >> 2) & 0x01;         // banksel is just bit 2
195171}
196172
197173WRITE8_HANDLER( popflame_videoreg_w )
r1527r1528
200176
201177   pleiads_sound_control_c_w(offset,data);
202178
203    if ((videoreg & 0x0f) != (data & 0x0f))
204   {
205      videoreg = data;
206
207      naughtyb_cocktail =
208         ( ( input_port_2_r(0) & 0x80 ) &&   // cabinet == cocktail
209           ( data & 0x01 ) );            // handling player 2
210      palreg  = (data >> 1) & 0x03;         // pallette sel is bit 1 & 2
211      bankreg = (data >> 3) & 0x01;         // banksel is just bit 3
212
213      memset (dirtybuffer, 1, videoram_size);
214   }
179   naughtyb_cocktail =
180      ( ( input_port_2_r(0) & 0x80 ) &&   // cabinet == cocktail
181        ( data & 0x01 ) );            // handling player 2
182   palreg  = (data >> 1) & 0x03;         // pallette sel is bit 1 & 2
183   bankreg = (data >> 3) & 0x01;         // banksel is just bit 3
215184}
216185
217186
r1527r1528
264233{
265234   int offs;
266235
267   // for every character in the Video RAM, check if it has been modified
268   // since last time and update it accordingly.
236   // for every character in the Video RAM
269237
270238   for (offs = videoram_size - 1;offs >= 0;offs--)
271239   {
272      if (dirtybuffer[offs])
273      {
274         int sx,sy;
240      int sx,sy;
275241
276         dirtybuffer[offs] = 0;
277
278         if ( naughtyb_cocktail )
242      if ( naughtyb_cocktail )
243      {
244         if (offs < 0x700)
279245         {
280            if (offs < 0x700)
281            {
282               sx = 63 - offs % 64;
283               sy = 27 - offs / 64;
284            }
285            else
286            {
287               sx = 64 + ( 3 - (offs - 0x700) % 4 );
288               sy = 27 - (offs - 0x700) / 4;
289            }
246            sx = 63 - offs % 64;
247            sy = 27 - offs / 64;
290248         }
291249         else
292250         {
293            if (offs < 0x700)
294            {
295               sx = offs % 64;
296               sy = offs / 64;
297            }
298            else
299            {
300               sx = 64 + (offs - 0x700) % 4;
301               sy = (offs - 0x700) / 4;
302            }
251            sx = 64 + ( 3 - (offs - 0x700) % 4 );
252            sy = 27 - (offs - 0x700) / 4;
303253         }
254      }
255      else
256      {
257         if (offs < 0x700)
258         {
259            sx = offs % 64;
260            sy = offs / 64;
261         }
262         else
263         {
264            sx = 64 + (offs - 0x700) % 4;
265            sy = (offs - 0x700) / 4;
266         }
267      }
304268
305         drawgfx(tmpbitmap,machine->gfx[0],
306               naughtyb_videoram2[offs] + 256 * bankreg,
307               (naughtyb_videoram2[offs] >> 5) + 8 * palreg,
308               naughtyb_cocktail,naughtyb_cocktail,
309               8*sx,8*sy,
310               0,TRANSPARENCY_NONE,0);
269      drawgfx(tmpbitmap,machine->gfx[0],
270            naughtyb_videoram2[offs] + 256 * bankreg,
271            (naughtyb_videoram2[offs] >> 5) + 8 * palreg,
272            naughtyb_cocktail,naughtyb_cocktail,
273            8*sx,8*sy,
274            0,TRANSPARENCY_NONE,0);
311275
312         drawgfx(tmpbitmap,machine->gfx[1],
313               videoram[offs] + 256*bankreg,
314               (videoram[offs] >> 5) + 8 * palreg,
315               naughtyb_cocktail,naughtyb_cocktail,
316               8*sx,8*sy,
317               0,TRANSPARENCY_PEN,0);
318      }
276      drawgfx(tmpbitmap,machine->gfx[1],
277            videoram[offs] + 256*bankreg,
278            (videoram[offs] >> 5) + 8 * palreg,
279            naughtyb_cocktail,naughtyb_cocktail,
280            8*sx,8*sy,
281            0,TRANSPARENCY_PEN,0);
319282   }
320283
321284   // copy the temporary bitmap to the screen
src/mame/video/phoenix.c
r1527r1528
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011#include "phoenix.h"
1112
12static UINT8 *videoram_pg1;
13static UINT8 *videoram_pg2;
14static UINT8 *current_videoram_pg;
15static int current_videoram_pg_index;
16static int palette_bank;
17static int cocktail_mode;
13static UINT8 *videoram_pg[2];
14static UINT8 videoram_pg_index;
15static UINT8 palette_bank;
16static UINT8 cocktail_mode;
1817static int pleiads_protection_question;
1918static int survival_protection_value;
2019static tilemap *fg_tilemap, *bg_tilemap;
r1527r1528
4241
4342***************************************************************************/
4443
44static const res_net_decode_info phoenix_decode_info =
45{
46   2,      // there may be two proms needed to construct color
47   0,      // start at 0
48   255,   // end at 255
49   //  R,   G,   B,   R,   G,   B
50   {   0,   0,   0, 256, 256, 256},      // offsets
51   {   0,   2,   1,  -1,   1,   0},      // shifts
52   {0x01,0x01,0x01,0x02,0x02,0x02}          // masks
53};
54
55static const res_net_info phoenix_net_info =
56{
57   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_OPEN_COL,
58   {
59      { RES_NET_AMP_NONE, 270, 270, 2, { 270, 1 } },
60      { RES_NET_AMP_NONE, 270, 270, 2, { 270, 1 } },
61      { RES_NET_AMP_NONE, 270, 270, 2, { 270, 1 } }
62   }
63};
64
4565PALETTE_INIT( phoenix )
4666{
4767   int i;
68   int t[4]= {0,1,2,3};
69   rgb_t   *rgb;
4870   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4971
50
51   for (i = 0;i < machine->drv->total_colors;i++)
72   rgb = compute_res_net_all(color_prom, &phoenix_decode_info, &phoenix_net_info);
73   /* native order */
74   for (i=0;i<256;i++)
5275   {
53      int bit0,bit1,r,g,b;
54
55
56      bit0 = (color_prom[0] >> 0) & 0x01;
57      bit1 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
58      r = 0x55 * bit0 + 0xaa * bit1;
59      bit0 = (color_prom[0] >> 2) & 0x01;
60      bit1 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
61      g = 0x55 * bit0 + 0xaa * bit1;
62      bit0 = (color_prom[0] >> 1) & 0x01;
63      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
64      b = 0x55 * bit0 + 0xaa * bit1;
65
66      palette_set_color(machine,i,MAKE_RGB(r,g,b));
67      color_prom++;
76      int col;
77      col = ((t[i & 0x03] << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60);
78      palette_set_color(machine,i,rgb[col]);
6879   }
80   palette_normalize_range(machine->palette, 0, 255, 0, 255);
81   free(rgb);
6982
7083   /* first bank of characters use colors 0x00-0x1f and 0x40-0x5f */
7184   /* second bank of characters use colors 0x20-0x3f and 0x60-0x7f */
72   for (i = 0;i < 0x40;i++)
73   {
74      int col;
75
76
77      col = ((i & 0x1c) >> 2) | ((i & 0x03) << 3) | ((i & 0x20) << 1);
78
79      COLOR(0,i) = col;
80      COLOR(1,i) = col | 0x20;
81   }
8285}
8386
8487PALETTE_INIT( pleiads )
r1527r1528
128131
129132static TILE_GET_INFO( get_fg_tile_info )
130133{
134   int code, col;
135
136   code = videoram_pg[videoram_pg_index][tile_index];
137   col = (code >> 5);
138   col = col | 0x08 | (palette_bank << 4);
139   SET_TILE_INFO(
140         1,
141         code,
142         col,
143         0);
144}
145
146static TILE_GET_INFO( get_bg_tile_info )
147{
148   int code, col;
149
150   code = videoram_pg[videoram_pg_index][tile_index + 0x800];
151   col = (code >> 5);
152   col = col | 0x00 | (palette_bank << 4);
153   SET_TILE_INFO(
154         0,
155         code,
156         col,
157         0);
158}
159
160static TILE_GET_INFO( pleiads_get_fg_tile_info )
161{
131162   int code;
132163
133   code = current_videoram_pg[tile_index];
164   code = videoram_pg[videoram_pg_index][tile_index];
134165   SET_TILE_INFO(
135166         1,
136167         code,
r1527r1528
138169         (tile_index & 0x1f) ? 0 : TILE_FORCE_LAYER0);   /* first row (column) is opaque */
139170}
140171
141static TILE_GET_INFO( get_bg_tile_info )
172static TILE_GET_INFO( pleiads_get_bg_tile_info )
142173{
143174   int code;
144175
145   code = current_videoram_pg[tile_index + 0x800];
176   code = videoram_pg[videoram_pg_index][tile_index + 0x800];
146177   SET_TILE_INFO(
147178         0,
148179         code,
r1527r1528
150181         0);
151182}
152183
153
154184/***************************************************************************
155185
156186  Start the video hardware emulation.
r1527r1528
159189
160190VIDEO_START( phoenix )
161191{
162   videoram_pg1 = auto_malloc(0x1000);
163   videoram_pg2 = auto_malloc(0x1000);
192   videoram_pg[0] = auto_malloc(0x1000);
193   videoram_pg[1] = auto_malloc(0x1000);
164194
165   memory_configure_bank(1, 0, 1, videoram_pg1, 0);
166   memory_configure_bank(1, 1, 1, videoram_pg2, 0);
195   memory_configure_bank(1, 0, 1, videoram_pg[0], 0);
196   memory_configure_bank(1, 1, 1, videoram_pg[1], 0);
167197   memory_set_bank(1, 0);
168198
169    current_videoram_pg_index = -1;
170   current_videoram_pg = videoram_pg1;      /* otherwise, hiscore loading crashes */
199    videoram_pg_index = 0;
171200
172
173201   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
174202   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
175203
176204   tilemap_set_transparent_pen(fg_tilemap,0);
177   tilemap_set_scrolldx(fg_tilemap,0,8);
178   tilemap_set_scrolldy(fg_tilemap,0,48);
179   tilemap_set_scrolldx(bg_tilemap,0,8);
180   tilemap_set_scrolldy(bg_tilemap,0,48);
205
206   tilemap_set_scrolldx(fg_tilemap, 0, (HTOTAL - HBSTART));
207   tilemap_set_scrolldx(bg_tilemap, 0, (HTOTAL - HBSTART));
208   tilemap_set_scrolldy(fg_tilemap, 0, (VTOTAL - VBSTART));
209   tilemap_set_scrolldy(bg_tilemap, 0, (VTOTAL - VBSTART));
210
211   state_save_register_global_pointer(videoram_pg[0], 0x1000);
212   state_save_register_global_pointer(videoram_pg[1], 0x1000);
213   state_save_register_global(videoram_pg_index);
214   state_save_register_global(palette_bank);
215   state_save_register_global(cocktail_mode);
181216}
182217
218VIDEO_START( pleiads )
219{
220   videoram_pg[0] = auto_malloc(0x1000);
221   videoram_pg[1] = auto_malloc(0x1000);
183222
223   memory_configure_bank(1, 0, 1, videoram_pg[0], 0);
224   memory_configure_bank(1, 1, 1, videoram_pg[1], 0);
225   memory_set_bank(1, 0);
226
227   videoram_pg_index = 0;
228
229   fg_tilemap = tilemap_create(pleiads_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
230   bg_tilemap = tilemap_create(pleiads_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
231
232   tilemap_set_transparent_pen(fg_tilemap,0);
233
234   tilemap_set_scrolldx(fg_tilemap, 0, (HTOTAL - HBSTART));
235   tilemap_set_scrolldx(bg_tilemap, 0, (HTOTAL - HBSTART));
236   tilemap_set_scrolldy(fg_tilemap, 0, (VTOTAL - VBSTART));
237   tilemap_set_scrolldy(bg_tilemap, 0, (VTOTAL - VBSTART));
238}
239
184240/***************************************************************************
185241
186242  Memory handlers
r1527r1528
191247{
192248   UINT8 *rom = memory_region(REGION_CPU1);
193249
194   current_videoram_pg[offset] = data;
250   videoram_pg[videoram_pg_index][offset] = data;
195251
196252   if ((offset & 0x7ff) < 0x340)
197253   {
r1527r1528
208264
209265WRITE8_HANDLER( phoenix_videoreg_w )
210266{
211    if (current_videoram_pg_index != (data & 1))
267    if (videoram_pg_index != (data & 1))
212268   {
213269      /* set memory bank */
214      current_videoram_pg_index = data & 1;
215      memory_set_bank(1, current_videoram_pg_index);
216      current_videoram_pg = current_videoram_pg_index ? videoram_pg2 : videoram_pg1;
270      videoram_pg_index = data & 1;
271      memory_set_bank(1, videoram_pg_index);
217272
218      cocktail_mode = current_videoram_pg_index && (input_port_3_r(0) & 0x01);
273      cocktail_mode = videoram_pg_index && (input_port_3_r(0) & 0x01);
219274
220275      tilemap_set_flip(ALL_TILEMAPS, cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
221276      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
r1527r1528
232287
233288WRITE8_HANDLER( pleiads_videoreg_w )
234289{
235    if (current_videoram_pg_index != (data & 1))
290    if (videoram_pg_index != (data & 1))
236291   {
237292      /* set memory bank */
238      current_videoram_pg_index = data & 1;
239      current_videoram_pg = current_videoram_pg_index ? videoram_pg2 : videoram_pg1;
293      videoram_pg_index = data & 1;
294      memory_set_bank(1, videoram_pg_index);
240295
241      cocktail_mode = current_videoram_pg_index && (input_port_3_r(0) & 0x01);
296      cocktail_mode = videoram_pg_index && (input_port_3_r(0) & 0x01);
242297
243298      tilemap_set_flip(ALL_TILEMAPS, cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
244299      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
src/mame/video/ppu2c0x.c
r1527r1528
145145   double Ku = 2.029;
146146   double Kv = 1.140;
147147
148   double brightness[3][4] =
148   static const double brightness[3][4] =
149149   {
150150      { 0.50, 0.75, 1.0, 1.0 },
151151      { 0.29, 0.45, 0.73, 0.9 },
src/mame/video/buggychl.c
r1527r1528
2828
2929VIDEO_START( buggychl )
3030{
31   dirtybuffer = auto_malloc(videoram_size);
3231   dirtychar = auto_malloc(256 * sizeof(*dirtychar));
3332   tmpbitmap1 = auto_bitmap_alloc(256,256,machine->screen[0].format);
3433   tmpbitmap2 = auto_bitmap_alloc(256,256,machine->screen[0].format);
3534
36   memset(dirtybuffer,1,videoram_size);
3735   memset(dirtychar,0xff,256 * sizeof(*dirtychar));
3836}
3937
r1527r1528
114112   {
115113      int code = videoram[0x400+offs];
116114
117      if (dirtybuffer[0x400+offs] || dirtychar[code])
118      {
119         int sx = offs % 32;
120         int sy = offs / 32;
115      int sx = offs % 32;
116      int sy = offs / 32;
121117
122         dirtybuffer[0x400+offs] = 0;
118      if (flip_screen_x) sx = 31 - sx;
119      if (flip_screen_y) sy = 31 - sy;
123120
124         if (flip_screen_x) sx = 31 - sx;
125         if (flip_screen_y) sy = 31 - sy;
126
127         drawgfx(tmpbitmap1,machine->gfx[0],
128               code,
129               2,
130               flip_screen_x,flip_screen_y,
131               8*sx,8*sy,
132               NULL,TRANSPARENCY_NONE,0);
133      }
121      drawgfx(tmpbitmap1,machine->gfx[0],
122            code,
123            2,
124            flip_screen_x,flip_screen_y,
125            8*sx,8*sy,
126            NULL,TRANSPARENCY_NONE,0);
134127   }
135128
136129   /* first copy to a temp bitmap doing column scroll */
src/mame/video/exidy.c
r1527r1528
55*************************************************************************/
66
77#include "driver.h"
8#include "exidy.h"
98
109
1110UINT8 *exidy_videoram;
1211UINT8 *exidy_characterram;
1312UINT8 *exidy_color_latch;
13UINT8 *exidy_sprite1_xpos;
14UINT8 *exidy_sprite1_ypos;
15UINT8 *exidy_sprite2_xpos;
16UINT8 *exidy_sprite2_ypos;
17UINT8 *exidy_spriteno;
18UINT8 *exidy_sprite_enable;
1419
1520static UINT8 collision_mask;
1621static UINT8 collision_invert;
1722static int is_2bpp;
23static UINT8 int_condition;
1824
1925static mame_bitmap *background_bitmap;
2026static mame_bitmap *motion_object_1_vid;
2127static mame_bitmap *motion_object_2_vid;
2228static mame_bitmap *motion_object_2_clip;
2329
24static UINT8 update_complete;
2530
26static UINT8 int_condition;
2731
28static UINT8 spriteno;
29static UINT8 sprite_enable;
30static UINT8 sprite1_xpos;
31static UINT8 sprite1_ypos;
32static UINT8 sprite2_xpos;
33static UINT8 sprite2_ypos;
34
35
36
3732/*************************************
3833 *
3934 *  Video configuration
r1527r1528
113108
114109/*************************************
115110 *
116 *  Palette RAM
111 *  Palette handling
117112 *
118113 *************************************/
119114
r1527r1528
146141
147142/*************************************
148143 *
149 *  Sprite controls
150 *
151 *************************************/
152
153WRITE8_HANDLER( exidy_sprite1_xpos_w )
154{
155   sprite1_xpos = data;
156}
157
158WRITE8_HANDLER( exidy_sprite1_ypos_w )
159{
160   sprite1_ypos = data;
161}
162
163WRITE8_HANDLER( exidy_sprite2_xpos_w )
164{
165   sprite2_xpos = data;
166}
167
168WRITE8_HANDLER( exidy_sprite2_ypos_w )
169{
170   sprite2_ypos = data;
171}
172
173WRITE8_HANDLER( exidy_spriteno_w )
174{
175   spriteno = data;
176}
177
178WRITE8_HANDLER( exidy_sprite_enable_w )
179{
180   sprite_enable = data;
181}
182
183
184
185/*************************************
186 *
187144 *  Background update
188145 *
189146 *************************************/
190147
191static void draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
148static void draw_background(void)
192149{
193150   offs_t offs;
194151
r1527r1528
226183            for (i = 0; i < 8; i++)
227184            {
228185               if (data1 & 0x80)
229                  *BITMAP_ADDR16(bitmap, y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1;
186                  *BITMAP_ADDR16(background_bitmap, y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1;
230187               else
231                  *BITMAP_ADDR16(bitmap, y, x) = off_pen;
188                  *BITMAP_ADDR16(background_bitmap, y, x) = off_pen;
232189
233190               x = x + 1;
234191               data1 = data1 << 1;
r1527r1528
242199
243200            for (i = 0; i < 8; i++)
244201            {
245               *BITMAP_ADDR16(bitmap, y, x) = (data & 0x80) ? on_pen_1 : off_pen;
202               *BITMAP_ADDR16(background_bitmap, y, x) = (data & 0x80) ? on_pen_1 : off_pen;
246203
247204               x = x + 1;
248205               data = data << 1;
r1527r1528
256213
257214
258215
259static TIMER_CALLBACK( collision_irq_callback )
216/*************************************
217 *
218 *  Sprite hardware
219 *
220 *************************************/
221
222INLINE int sprite_1_enabled(void)
260223{
261   /* latch the collision bits */
262   latch_condition(param);
224   /* if the collision_mask is 0x00, then we are on old hardware that always has */
225   /* sprite 1 enabled regardless */
226   return (!(*exidy_sprite_enable & 0x80) || (*exidy_sprite_enable & 0x10) || (collision_mask == 0x00));
227}
263228
264   /* set the IRQ line */
265   cpunum_set_input_line(0, 0, ASSERT_LINE);
229
230static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
231{
232   /* draw sprite 2 first */
233   int sprite_set_2 = ((*exidy_sprite_enable & 0x40) != 0);
234
235   int sx = 236 - *exidy_sprite2_xpos - 4;
236   int sy = 244 - *exidy_sprite2_ypos - 4;
237
238   drawgfx(bitmap, machine->gfx[0],
239         ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1,
240         0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
241
242   /* draw sprite 1 next */
243   if (sprite_1_enabled())
244   {
245      int sprite_set_1 = ((*exidy_sprite_enable & 0x20) != 0);
246
247      sx = 236 - *exidy_sprite1_xpos - 4;
248      sy = 244 - *exidy_sprite1_ypos - 4;
249
250      if (sy < 0) sy = 0;
251
252      drawgfx(bitmap, machine->gfx[0],
253            (*exidy_spriteno & 0x0f) + 16 * sprite_set_1, 0,
254            0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
255   }
256
266257}
267258
268259
269260
270261/*************************************
271262 *
272 *  End-of-frame callback
263 *  Collision detection
273264 *
274265 *************************************/
275266
r1527r1528
285276
286277***************************************************************************/
287278
288INLINE int sprite_1_enabled(void)
279static TIMER_CALLBACK( collision_irq_callback )
289280{
290   /* if the collision_mask is 0x00, then we are on old hardware that always has */
291   /* sprite 1 enabled regardless */
292   return (!(sprite_enable & 0x80) || (sprite_enable & 0x10) || (collision_mask == 0x00));
281   /* latch the collision bits */
282   latch_condition(param);
283
284   /* set the IRQ line */
285   cpunum_set_input_line(0, 0, ASSERT_LINE);
293286}
294287
295VIDEO_EOF( exidy )
288
289static void check_collision(running_machine *machine)
296290{
297   UINT8 enable_set_1 = ((sprite_enable & 0x20) != 0);
298   UINT8 enable_set_2 = ((sprite_enable & 0x40) != 0);
291   UINT8 sprite_set_1 = ((*exidy_sprite_enable & 0x20) != 0);
292   UINT8 sprite_set_2 = ((*exidy_sprite_enable & 0x40) != 0);
299293    static const rectangle clip = { 0, 15, 0, 15 };
300    int bgmask = machine->gfx[0]->color_granularity - 1;
301294    int org_1_x = 0, org_1_y = 0;
302295    int org_2_x = 0, org_2_y = 0;
303296    int sx, sy;
r1527r1528
307300   if (collision_mask == 0)
308301      return;
309302
310   /* update the background if necessary */
311   if (!update_complete)
312      draw_background(machine, background_bitmap, NULL);
313   update_complete = 0;
314
315303   /* draw sprite 1 */
316304   fillbitmap(motion_object_1_vid, 0xff, &clip);
317305   if (sprite_1_enabled())
318306   {
319      org_1_x = 236 - sprite1_xpos - 4;
320      org_1_y = 244 - sprite1_ypos - 4;
307      org_1_x = 236 - *exidy_sprite1_xpos - 4;
308      org_1_y = 244 - *exidy_sprite1_ypos - 4;
321309      drawgfx(motion_object_1_vid, machine->gfx[0],
322         (spriteno & 0x0f) + 16 * enable_set_1, 0,
323         0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
310            (*exidy_spriteno & 0x0f) + 16 * sprite_set_1, 0,
311            0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
324312   }
325313
326314   /* draw sprite 2 */
327315   fillbitmap(motion_object_2_vid, 0xff, &clip);
328   org_2_x = 236 - sprite2_xpos - 4;
329   org_2_y = 244 - sprite2_ypos - 4;
316   org_2_x = 236 - *exidy_sprite2_xpos - 4;
317   org_2_y = 244 - *exidy_sprite2_ypos - 4;
330318   drawgfx(motion_object_2_vid, machine->gfx[0],
331      ((spriteno >> 4) & 0x0f) + 32 + 16 * enable_set_2, 0,
332      0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
319         ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
320         0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
333321
334    /* draw sprite 2 clipped to sprite 1's location */
322   /* draw sprite 2 clipped to sprite 1's location */
335323   fillbitmap(motion_object_2_clip, 0xff, &clip);
336324   if (sprite_1_enabled())
337325   {
338326      sx = org_2_x - org_1_x;
339327      sy = org_2_y - org_1_y;
340328      drawgfx(motion_object_2_clip, machine->gfx[0],
341         ((spriteno >> 4) & 0x0f) + 32 + 16 * enable_set_2, 0,
342         0, 0, sx, sy, &clip, TRANSPARENCY_PEN, 0);
329            ((*exidy_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
330            0, 0, sx, sy, &clip, TRANSPARENCY_PEN, 0);
343331   }
344332
345    /* scan for collisions */
346    for (sy = 0; sy < 16; sy++)
347       for (sx = 0; sx < 16; sx++)
348       {
333   /* scan for collisions */
334   for (sy = 0; sy < 16; sy++)
335      for (sx = 0; sx < 16; sx++)
336      {
349337          if (*BITMAP_ADDR16(motion_object_1_vid, sy, sx) != 0xff)
350          {
351              UINT8 collision_mask = 0;
338         {
339            UINT8 current_collision_mask = 0;
352340
353                /* check for background collision (M1CHAR) */
354            if (((*BITMAP_ADDR16(background_bitmap, org_1_y + sy, org_1_x + sx) - 4) & bgmask) != 0)
355               collision_mask |= 0x04;
341            /* check for background collision (M1CHAR) */
342            if (*BITMAP_ADDR16(background_bitmap, org_1_y + sy, org_1_x + sx) != 0)
343               current_collision_mask |= 0x04;
356344
357                /* check for motion object collision (M1M2) */
345            /* check for motion object collision (M1M2) */
358346            if (*BITMAP_ADDR16(motion_object_2_clip, sy, sx) != 0xff)
359               collision_mask |= 0x10;
347               current_collision_mask |= 0x10;
360348
361349            /* if we got one, trigger an interrupt */
362            if ((collision_mask & collision_mask) && count++ < 128)
363               timer_set(video_screen_get_time_until_pos(0, org_1_x + sx, org_1_y + sy), NULL, collision_mask, collision_irq_callback);
364            }
365            if (*BITMAP_ADDR16(motion_object_2_vid, sy, sx) != 0xff)
366          {
367                /* check for background collision (M2CHAR) */
368            if (((*BITMAP_ADDR16(background_bitmap, org_2_y + sy, org_2_x + sx) - 4) & bgmask) != 0)
369               if ((collision_mask & 0x08) && count++ < 128)
350            if ((current_collision_mask & collision_mask) && (count++ < 128))
351               timer_set(video_screen_get_time_until_pos(0, org_1_x + sx, org_1_y + sy), NULL, current_collision_mask, collision_irq_callback);
352         }
353
354         if (*BITMAP_ADDR16(motion_object_2_vid, sy, sx) != 0xff)
355         {
356            /* check for background collision (M2CHAR) */
357            if (*BITMAP_ADDR16(background_bitmap, org_2_y + sy, org_2_x + sx) != 0)
358               if ((collision_mask & 0x08) && (count++ < 128))
370359                  timer_set(video_screen_get_time_until_pos(0, org_2_x + sx, org_2_y + sy), NULL, 0x08, collision_irq_callback);
371            }
360         }
372361      }
373362}
374363
r1527r1528
382371
383372VIDEO_UPDATE( exidy )
384373{
385   int sx, sy;
386   UINT8 enable_set_2;
387
388374   /* refresh the colors from the palette (static or dynamic) */
389375   set_colors(machine);
390376
391377   /* update the background and draw it */
392   draw_background(machine, background_bitmap, NULL);
378   draw_background();
393379   copybitmap(bitmap, background_bitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
394380
395   /* draw sprite 2 first */
396   enable_set_2 = ((sprite_enable & 0x40) != 0);
381   /* draw the sprites */
382   draw_sprites(machine, bitmap, NULL);
397383
398   sx = 236 - sprite2_xpos - 4;
399   sy = 244 - sprite2_ypos - 4;
384   /* check for collision, this will set the appropriate bits in collision_mask */
385   check_collision(machine);
400386
401   drawgfx(bitmap, machine->gfx[0],
402      ((spriteno >> 4) & 0x0f) + 32 + 16 * enable_set_2, 1,
403      0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
404
405   /* draw sprite 1 next */
406   if (sprite_1_enabled())
407   {
408      UINT8 enable_set_1 = ((sprite_enable & 0x20) != 0);
409
410      sx = 236 - sprite1_xpos - 4;
411      sy = 244 - sprite1_ypos - 4;
412
413      if (sy < 0) sy = 0;
414
415      drawgfx(bitmap, machine->gfx[0],
416         (spriteno & 0x0f) + 16 * enable_set_1, 0,
417         0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
418   }
419
420   /* indicate that we already updated the background */
421   update_complete = 1;
422387   return 0;
423388}
src/mame/video/xxmissio.c
r1527r1528
1414
1515static UINT8 xxmissio_xscroll,xxmissio_yscroll;
1616static UINT8 flipscreen;
17static UINT8 xxmissio_bg_redraw;
1817
1918
2019WRITE8_HANDLER( xxmissio_scroll_x_w )
r1527r1528
2827
2928WRITE8_HANDLER( xxmissio_flipscreen_w )
3029{
31   if ((data & 0x01) != flipscreen)
32   {
33      flipscreen = data & 0x01;
34      xxmissio_bg_redraw = 1;
35   }
30   flipscreen = data & 0x01;
3631}
3732
3833WRITE8_HANDLER( xxmissio_videoram_w )
r1527r1528
4237   offs |= x;
4338
4439   videoram[offs] = data;
45   dirtybuffer[offs & 0x3ff] = 1;
4640}
4741READ8_HANDLER( xxmissio_videoram_r )
4842{
r1527r1528
5650WRITE8_HANDLER( xxmissio_paletteram_w )
5751{
5852   paletteram_BBGGRRII_w(offset,data);
59
60   if (offset >= 0x200)
61      xxmissio_bg_redraw = 1;
6253}
6354
6455/****************************************************************************/
r1527r1528
7162
7263   int size = videoram_size/2;
7364
74   if (xxmissio_bg_redraw==1)
75      memset(dirtybuffer,1,size);
76
7765/* draw BG layer */
7866
7967   for (y=0; y<32; y++)
r1527r1528
8573         if (flipscreen!=0)
8674            offs = (size-1)-offs;
8775
88         if (dirtybuffer[offs] != 0)
89         {
90            dirtybuffer[offs]=0;
76         px = x*16;
77         py = y*8;
9178
92            px = x*16;
93            py = y*8;
79         chr = videoram[ offs ] ;
80         col = videoram[ offs + size];
81         chr = chr + ((col & 0xc0) << 2 );
82         col = col & 0x0f;
9483
95            chr = videoram[ offs ] ;
96            col = videoram[ offs + size];
97            chr = chr + ((col & 0xc0) << 2 );
98            col = col & 0x0f;
99
100            drawgfx(tmpbitmap,machine->gfx[2],
101               chr,
102               col,
103               flipscreen,flipscreen,
104               px,py,
105               &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
106         }
84         drawgfx(tmpbitmap,machine->gfx[2],
85            chr,
86            col,
87            flipscreen,flipscreen,
88            px,py,
89            &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
10790      }
10891   }
10992
r1527r1528
119102   }
120103
121104   copyscrollbitmap(bitmap,tmpbitmap,1,&sx,1,&sy,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
122   xxmissio_bg_redraw = 0;
123105
124106/* draw sprites */
125107
src/mame/video/skychut.c
r1527r1528
138138{
139139   irem_state *state = machine->driver_data;
140140   int offs;
141   int color[4]= { 3, 3, 5, 5};
142   int xpos[4] = { 4*8, 26*8, 7*8, 6*8} ;
141   static const int color[4]= { 3, 3, 5, 5 };
142   static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8};
143143   int i;
144144
145145   fillbitmap(bitmap,machine->pens[7],cliprect);
src/mame/video/matmania.c
r1527r1528
2222size_t matmania_videoram3_size;
2323UINT8 *matmania_scroll;
2424static mame_bitmap *tmpbitmap2;
25static UINT8 *dirtybuffer2;
2625
2726UINT8 *matmania_pageselect;
2827
r1527r1528
125124***************************************************************************/
126125VIDEO_START( matmania )
127126{
128   dirtybuffer = auto_malloc(videoram_size);
129   memset(dirtybuffer,1,videoram_size);
130
131   dirtybuffer2 = auto_malloc(matmania_videoram3_size);
132   memset(dirtybuffer2,1,matmania_videoram3_size);
133
134127   /* Mat Mania has a virtual screen twice as large as the visible screen */
135128   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,2* machine->screen[0].height,machine->screen[0].format);
136129
r1527r1528
140133
141134
142135
143WRITE8_HANDLER( matmania_videoram3_w )
144{
145   if (matmania_videoram3[offset] != data)
146   {
147      dirtybuffer2[offset] = 1;
148
149      matmania_videoram3[offset] = data;
150   }
151}
152
153
154
155WRITE8_HANDLER( matmania_colorram3_w )
156{
157   if (matmania_colorram3[offset] != data)
158   {
159      dirtybuffer2[offset] = 1;
160
161      matmania_colorram3[offset] = data;
162   }
163}
164
165
166136VIDEO_UPDATE( matmania )
167137{
168138   int offs;
r1527r1528
171141   /* Update the tiles in the left tile ram bank */
172142   for (offs = videoram_size - 1;offs >= 0;offs--)
173143   {
174      if (dirtybuffer[offs])
175      {
176         int sx,sy;
144      int sx,sy;
177145
178146
179         dirtybuffer[offs] = 0;
147      sx = 15 - offs / 32;
148      sy = offs % 32;
180149
181         sx = 15 - offs / 32;
182         sy = offs % 32;
183
184         drawgfx(tmpbitmap,machine->gfx[1],
185               videoram[offs] + ((colorram[offs] & 0x08) << 5),
186               (colorram[offs] & 0x30) >> 4,
187               0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
188               16*sx,16*sy,
189               0,TRANSPARENCY_NONE,0);
190      }
150      drawgfx(tmpbitmap,machine->gfx[1],
151            videoram[offs] + ((colorram[offs] & 0x08) << 5),
152            (colorram[offs] & 0x30) >> 4,
153            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
154            16*sx,16*sy,
155            0,TRANSPARENCY_NONE,0);
191156   }
192157
193158   /* Update the tiles in the right tile ram bank */
194159   for (offs = matmania_videoram3_size - 1;offs >= 0;offs--)
195160   {
196      if (dirtybuffer2[offs])
197      {
198161         int sx,sy;
199162
200163
201         dirtybuffer2[offs] = 0;
164      sx = 15 - offs / 32;
165      sy = offs % 32;
202166
203         sx = 15 - offs / 32;
204         sy = offs % 32;
205
206         drawgfx(tmpbitmap2,machine->gfx[1],
207               matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x08) << 5),
208               (matmania_colorram3[offs] & 0x30) >> 4,
209               0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
210               16*sx,16*sy,
211               0,TRANSPARENCY_NONE,0);
212      }
167      drawgfx(tmpbitmap2,machine->gfx[1],
168            matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x08) << 5),
169            (matmania_colorram3[offs] & 0x30) >> 4,
170            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
171            16*sx,16*sy,
172            0,TRANSPARENCY_NONE,0);
213173   }
214174
215175
r1527r1528
268228   /* Update the tiles in the left tile ram bank */
269229   for (offs = videoram_size - 1;offs >= 0;offs--)
270230   {
271      if (dirtybuffer[offs])
272      {
273         int sx,sy;
231      int sx,sy;
274232
275233
276         dirtybuffer[offs] = 0;
234      sx = 15 - offs / 32;
235      sy = offs % 32;
277236
278         sx = 15 - offs / 32;
279         sy = offs % 32;
280
281         drawgfx(tmpbitmap,machine->gfx[1],
282               videoram[offs] + ((colorram[offs] & 0x03) << 8),
283               (colorram[offs] & 0x30) >> 4,
284               0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
285               16*sx,16*sy,
286               0,TRANSPARENCY_NONE,0);
287      }
237      drawgfx(tmpbitmap,machine->gfx[1],
238            videoram[offs] + ((colorram[offs] & 0x03) << 8),
239            (colorram[offs] & 0x30) >> 4,
240            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
241            16*sx,16*sy,
242            0,TRANSPARENCY_NONE,0);
288243   }
289244
290245   /* Update the tiles in the right tile ram bank */
291246   for (offs = matmania_videoram3_size - 1;offs >= 0;offs--)
292247   {
293      if (dirtybuffer2[offs])
294      {
295         int sx,sy;
248      int sx,sy;
296249
297250
298         dirtybuffer2[offs] = 0;
251      sx = 15 - offs / 32;
252      sy = offs % 32;
299253
300         sx = 15 - offs / 32;
301         sy = offs % 32;
302
303         drawgfx(tmpbitmap2,machine->gfx[1],
304               matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x03) << 8),
305               (matmania_colorram3[offs] & 0x30) >> 4,
306               0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
307               16*sx,16*sy,
308               0,TRANSPARENCY_NONE,0);
309      }
254      drawgfx(tmpbitmap2,machine->gfx[1],
255            matmania_videoram3[offs] + ((matmania_colorram3[offs] & 0x03) << 8),
256            (matmania_colorram3[offs] & 0x30) >> 4,
257            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
258            16*sx,16*sy,
259            0,TRANSPARENCY_NONE,0);
310260   }
311261
312262
src/mame/video/pkunwar.c
r1527r1528
1414
1515WRITE8_HANDLER( pkunwar_flipscreen_w )
1616{
17   if (flipscreen[0] != (data & 1))
18   {
19      flipscreen[0] = data & 1;
20      memset(dirtybuffer,1,videoram_size);
21   }
22   if (flipscreen[1] != (data & 2))
23   {
24      flipscreen[1] = data & 2;
25      memset(dirtybuffer,1,videoram_size);
26   }
17   flipscreen[0] = data & 1;
18   flipscreen[1] = data & 2;
2719}
2820
2921
r1527r1528
3325   int offs;
3426
3527
36   /* for every character in the Video RAM, check if it has been modified */
37   /* since last time and update it accordingly. */
28   /* for every character in the Video RAM */
3829   for (offs = videoram_size - 1;offs >= 0;offs--)
3930   {
40      if (dirtybuffer[offs])
41      {
42         int sx,sy;
31      int sx,sy;
4332
4433
45         dirtybuffer[offs] = 0;
34      sx = offs % 32;
35      sy = offs / 32;
36      if (flipscreen[0]) sx = 31 - sx;
37      if (flipscreen[1]) sy = 31 - sy;
4638
47         sx = offs % 32;
48         sy = offs / 32;
49         if (flipscreen[0]) sx = 31 - sx;
50         if (flipscreen[1]) sy = 31 - sy;
51
52         drawgfx(tmpbitmap,machine->gfx[0],
53               videoram[offs] + ((colorram[offs] & 0x07) << 8),
54               (colorram[offs] & 0xf0) >> 4,
55               flipscreen[0],flipscreen[1],
56               8*sx,8*sy,
57               &machine->screen[0].visarea,TRANSPARENCY_NONE,0);
58      }
39      drawgfx(bitmap,machine->gfx[0],
40            videoram[offs] + ((colorram[offs] & 0x07) << 8),
41            (colorram[offs] & 0xf0) >> 4,
42            flipscreen[0],flipscreen[1],
43            8*sx,8*sy,
44            cliprect,TRANSPARENCY_NONE,0);
5945   }
6046
61   /* copy the character mapped graphics */
62   copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
6347
64
6548   /* Draw the sprites. */
6649   for (offs = 0;offs < spriteram_size;offs += 32)
6750   {
src/mame/video/changela.c
r1527r1528
768768        111     |   3.819   (2.2k)
769769    Which were normalized to produce the following table: */
770770
771   UINT8 color_table[8] = { 0, 7, 18, 31, 58, 88, 146, 255 };
771   static const UINT8 color_table[8] = { 0, 7, 18, 31, 58, 88, 146, 255 };
772772
773773   int r, g, b;
774774   UINT32 c, color_index;
src/mame/drivers/nycaptor.c
r1527r1528
811811   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
812812   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* IRQ generated by ??? */
813813
814   MDRV_CPU_ADD(M68705,2000000/M68705_CLOCK_DIVIDER)
814   MDRV_CPU_ADD(M68705,2000000)
815815   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
816816
817817   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
864864   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)
865865
866866#ifdef USE_MCU
867   MDRV_CPU_ADD(M68705,2000000/M68705_CLOCK_DIVIDER)
867   MDRV_CPU_ADD(M68705,2000000)
868868   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
869869#endif
870870
src/mame/drivers/dynduke.c
r1527r1528
257257   GFXDECODE_ENTRY( REGION_GFX4, 0, spritelayout,  0x300, 32 )
258258GFXDECODE_END
259259
260/* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
261
262SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
263
264260/* Interrupt Generator */
265261
266262static INTERRUPT_GEN( dynduke_interrupt )
src/mame/drivers/tunhunt.c
r1527r1528
5555UINT8 *tunhunt_ram;
5656
5757extern WRITE8_HANDLER( tunhunt_videoram_w );
58extern WRITE8_HANDLER( tunhunt_mott_w );
5958
6059extern PALETTE_INIT( tunhunt );
6160extern VIDEO_START( tunhunt );
r1527r1528
165164   AM_RANGE(0x1a00, 0x1a00) AM_WRITE(MWA8_RAM) /* SHEL1H */
166165   AM_RANGE(0x1c00, 0x1c00) AM_WRITE(MWA8_RAM) /* MOBJV */
167166   AM_RANGE(0x1e00, 0x1eff) AM_WRITE(tunhunt_videoram_w) AM_BASE(&videoram)   /* ALPHA */
168   AM_RANGE(0x2c00, 0x2fff) AM_WRITE(tunhunt_mott_w) AM_BASE(&spriteram)
167   AM_RANGE(0x2c00, 0x2fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)
169168   AM_RANGE(0x2000, 0x2000) AM_WRITE(MWA8_NOP) /* watchdog */
170169   AM_RANGE(0x2400, 0x2400) AM_WRITE(MWA8_NOP) /* INT ACK */
171170   AM_RANGE(0x2800, 0x2800) AM_WRITE(tunhunt_control_w)
src/mame/drivers/tempest.c
r1527r1528
313313 *
314314 *************************************/
315315
316static UINT32 tempest_knob_r(void *param)
316static CUSTOM_INPUT( tempest_knob_r )
317317{
318318   UINT32 ret;
319319
r1527r1528
329329   return ret;
330330}
331331
332static UINT32 tempest_buttons_r(void *param)
332static CUSTOM_INPUT( tempest_buttons_r )
333333{
334334   UINT32 ret;
335335
src/mame/drivers/bublbobl.c
r1527r1528
830830   MDRV_IMPORT_FROM(bublbobl)
831831   MDRV_CPU_REMOVE("mcu")
832832
833   MDRV_CPU_ADD_TAG("mcu", M68705, 4000000/M68705_CLOCK_DIVIDER)   // xtal is 4MHz, divided by 4 internally
833   MDRV_CPU_ADD_TAG("mcu", M68705, 4000000)   // xtal is 4MHz, divided by 4 internally
834834   MDRV_CPU_PROGRAM_MAP(bootlegmcu_map, 0)
835835   MDRV_CPU_VBLANK_INT(bublbobl_m68705_interrupt, 2) // ??? should come from the same clock which latches the INT pin on the second Z80
836836MACHINE_DRIVER_END
src/mame/drivers/midyunit.c
r1527r1528
149149 *
150150 *************************************/
151151
152static UINT32 narc_talkback_strobe_r(void *param)
152static CUSTOM_INPUT( narc_talkback_strobe_r )
153153{
154154   return (williams_narc_talkback_r() >> 8) & 1;
155155}
156156
157157
158static UINT32 narc_talkback_data_r(void *param)
158static CUSTOM_INPUT( narc_talkback_data_r )
159159{
160160   return williams_narc_talkback_r() & 0xff;
161161}
162162
163163
164static UINT32 adpcm_irq_state_r(void *param)
164static CUSTOM_INPUT( adpcm_irq_state_r )
165165{
166166   return williams_adpcm_sound_irq_r() & 1;
167167}
r1527r1528
257257   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(narc_talkback_strobe_r, NULL)
258258   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) /* memory protect interlock */
259259   PORT_BIT( 0x3000, IP_ACTIVE_LOW, IPT_UNUSED )
260   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Language ) ) /* Is this a REAL dip or toggle? or software enable? */
261   PORT_DIPSETTING(      0xc000, DEF_STR( English ) )
262   PORT_DIPSETTING(      0x8000, DEF_STR( French ) )
263   PORT_DIPSETTING(      0x4000, DEF_STR( German ) )
264//  PORT_DIPSETTING(      0x0000, DEF_STR( Unknown ) )
260   PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNUSED )
261/*
262    Test mode indicates "Cut for French" and "Cut for German", hinting that these
263    are jumpers or wires that can be modified on the PCB. However, there are no
264    French or German strings in the ROMs, and this "feature" was clearly never
265    actually implemented
266    PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Language ) )
267    PORT_DIPSETTING(      0xc000, DEF_STR( English ) )
268    PORT_DIPSETTING(      0x8000, DEF_STR( French ) )
269    PORT_DIPSETTING(      0x4000, DEF_STR( German ) )
270*/
265271
266272   PORT_START
267273   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(narc_talkback_data_r, NULL)
r1527r1528
10031009static MACHINE_DRIVER_START( zunit )
10041010
10051011   /* basic machine hardware */
1006   MDRV_CPU_ADD(TMS34010, FAST_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
1012   MDRV_CPU_ADD(TMS34010, FAST_MASTER_CLOCK)
10071013   MDRV_CPU_CONFIG(zunit_tms_config)
10081014   MDRV_CPU_PROGRAM_MAP(main_map,0)
10091015
r1527r1528
10361042static MACHINE_DRIVER_START( yunit_core )
10371043
10381044   /* basic machine hardware */
1039   MDRV_CPU_ADD_TAG("main", TMS34010, SLOW_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
1045   MDRV_CPU_ADD_TAG("main", TMS34010, SLOW_MASTER_CLOCK)
10401046   MDRV_CPU_CONFIG(yunit_tms_config)
10411047   MDRV_CPU_PROGRAM_MAP(main_map,0)
10421048
r1527r1528
10711077
10721078   /* basic machine hardware */
10731079   MDRV_IMPORT_FROM(yunit_core)
1074   MDRV_CPU_REPLACE("main", TMS34010, FAST_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
1080   MDRV_CPU_REPLACE("main", TMS34010, FAST_MASTER_CLOCK)
10751081   MDRV_IMPORT_FROM(williams_cvsd_sound)
10761082
10771083   /* video hardware */
r1527r1528
10961102
10971103   /* basic machine hardware */
10981104   MDRV_IMPORT_FROM(yunit_core)
1099   MDRV_CPU_REPLACE("main", TMS34010, FAST_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
1105   MDRV_CPU_REPLACE("main", TMS34010, FAST_MASTER_CLOCK)
11001106   MDRV_IMPORT_FROM(williams_adpcm_sound)
11011107
11021108   /* video hardware */
r1527r1528
11091115
11101116   /* basic machine hardware */
11111117   MDRV_IMPORT_FROM(yunit_core)
1112   MDRV_CPU_REPLACE("main", TMS34010, FASTER_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
1118   MDRV_CPU_REPLACE("main", TMS34010, FASTER_MASTER_CLOCK)
11131119   MDRV_IMPORT_FROM(williams_adpcm_sound)
11141120
11151121   /* video hardware */
src/mame/drivers/nbmj9195.c
r1527r1528
526526static void tmpz84c011_init(running_machine *machine)
527527{
528528   // initialize the CTC
529   ctc_intf_1.baseclock = machine->drv->cpu[0].clock;
530   ctc_intf_2.baseclock = machine->drv->cpu[1].clock;
529   ctc_intf_1.baseclock = cpunum_get_clock(0);
530   ctc_intf_2.baseclock = cpunum_get_clock(1);
531531   z80ctc_init(0, &ctc_intf_1);
532532   z80ctc_init(1, &ctc_intf_2);
533533}
src/mame/drivers/deadang.c
r1527r1528
263263   GFXDECODE_ENTRY( REGION_GFX5, 0x000000, spritelayout,    0, 16 )
264264GFXDECODE_END
265265
266/* Sound Interfaces */
267
268SEIBU_SOUND_SYSTEM_YM2203_HARDWARE
269
270SEIBU_SOUND_SYSTEM_ADPCM_HARDWARE
271
272266/* Interrupt Generators */
273267
274268static INTERRUPT_GEN( deadang_interrupt )
src/mame/drivers/artmagic.c
r1527r1528
3838static UINT8 prot_bit_index;
3939static UINT16 prot_save;
4040
41static void (*protection_handler)(void);
41static void (*protection_handler)(running_machine *);
4242
4343
4444
r1527r1528
152152 *
153153 *************************************/
154154
155static void ultennis_protection(void)
155static void ultennis_protection(running_machine *machine)
156156{
157157   /* check the command byte */
158158   switch (prot_input[0])
159159   {
160160      case 0x00:   /* reset */
161161         prot_input_index = prot_output_index = 0;
162         prot_output[0] = mame_rand(Machine);
162         prot_output[0] = mame_rand(machine);
163163         break;
164164
165165      case 0x01:   /* 01 aaaa bbbb cccc dddd (xxxx) */
r1527r1528
242242}
243243
244244
245static void cheesech_protection(void)
245static void cheesech_protection(running_machine *machine)
246246{
247247   /* check the command byte */
248248   switch (prot_input[0])
249249   {
250250      case 0x00:   /* reset */
251251         prot_input_index = prot_output_index = 0;
252         prot_output[0] = mame_rand(Machine);
252         prot_output[0] = mame_rand(machine);
253253         break;
254254
255255      case 0x01:   /* 01 aaaa bbbb (xxxx) */
r1527r1528
302302}
303303
304304
305static void stonebal_protection(void)
305static void stonebal_protection(running_machine *machine)
306306{
307307   /* check the command byte */
308308   switch (prot_input[0])
r1527r1528
394394      prot_bit_index = 0;
395395
396396      /* update the protection state */
397      (*protection_handler)();
397      (*protection_handler)(Machine);
398398   }
399399}
400400
r1527r1528
723723   MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK_25MHz/2)
724724   MDRV_CPU_PROGRAM_MAP(main_map,0)
725725
726   MDRV_CPU_ADD_TAG("tms", TMS34010, MASTER_CLOCK_40MHz/TMS34010_CLOCK_DIVIDER)
726   MDRV_CPU_ADD_TAG("tms", TMS34010, MASTER_CLOCK_40MHz)
727727   MDRV_CPU_CONFIG(tms_config)
728728   MDRV_CPU_PROGRAM_MAP(tms_map,0)
729729
r1527r1528
733733
734734   /* video hardware */
735735   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
736   MDRV_PALETTE_LENGTH(256)
736   MDRV_VIDEO_START(artmagic)
737   MDRV_VIDEO_UPDATE(tms340x0)
737738
738739   MDRV_SCREEN_ADD("main", 0)
739   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
740   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
740741   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK_40MHz/6, 428, 0, 320, 313, 0, 256)
741742
742   MDRV_VIDEO_START(artmagic)
743   MDRV_VIDEO_UPDATE(tms340x0)
744
745743   /* sound hardware */
746744   MDRV_SPEAKER_STANDARD_MONO("mono")
747745
src/mame/drivers/twincobr.c
r1527r1528
656656   MDRV_CPU_PROGRAM_MAP(sound_program_map, 0)
657657   MDRV_CPU_IO_MAP(sound_io_map, 0)
658658
659   MDRV_CPU_ADD(TMS32010,(28000000/2)/TMS32010_CLOCK_DIVIDER)   /* 14MHz CLKin */
659   MDRV_CPU_ADD(TMS32010,28000000/2)   /* 14MHz CLKin */
660660   MDRV_CPU_PROGRAM_MAP(DSP_program_map, 0)
661661   /* Data Map is internal to the CPU */
662662   MDRV_CPU_IO_MAP(DSP_io_map, 0)
src/mame/drivers/shougi.c
r1527r1528
162162
163163   for (offs = 0;offs <0x4000; offs++)
164164   {
165   //  if (dirtybuffer[offs])
166      {
167         int sx, sy, x, data1, data2, color, data;
165      int sx, sy, x, data1, data2, color, data;
168166
169   //      dirtybuffer[offs] = 0;
167      sx = offs >> 8;      /*00..0x3f (64*4=256)*/
168      sy = offs & 0xff;   /*00..0xff*/
169//      if (flipscreen[0]) sx = 31 - sx;
170//      if (flipscreen[1]) sy = 31 - sy;
170171
171         sx = offs >> 8;      /*00..0x3f (64*4=256)*/
172         sy = offs & 0xff;   /*00..0xff*/
173   //      if (flipscreen[0]) sx = 31 - sx;
174   //      if (flipscreen[1]) sy = 31 - sy;
172      data1 = videoram[offs];            /* color */
173      data2 = videoram[0x4000 + offs];   /* pixel data */
175174
176         data1 = videoram[offs];            /* color */
177         data2 = videoram[0x4000 + offs];   /* pixel data */
175      for (x=0; x<4; x++) /*4 pixels per byte (2 bitplanes in 2 nibbles: 1st=bits 7-4, 2nd=bits 3-0)*/
176      {
177         color= ((data1>>x) & 1) | (((data1>>(4+x)) & 1)<<1);
178         data = ((data2>>x) & 1) | (((data2>>(4+x)) & 1)<<1);
178179
179         for (x=0; x<4; x++) /*4 pixels per byte (2 bitplanes in 2 nibbles: 1st=bits 7-4, 2nd=bits 3-0)*/
180         {
181            color= ((data1>>x) & 1) | (((data1>>(4+x)) & 1)<<1);
182            data = ((data2>>x) & 1) | (((data2>>(4+x)) & 1)<<1);
183
184            *BITMAP_ADDR16(bitmap, 255-sy, 255-(sx*4 + x)) = color*4 + data;
185         }
180         *BITMAP_ADDR16(bitmap, 255-sy, 255-(sx*4 + x)) = color*4 + data;
186181      }
187182   }
188183   /* copy the character mapped graphics */
r1527r1528
301296//  AM_RANGE(0x7800, 0x78ff) AM_WRITE(cpu_sharedram_main_w) AM_BASE(&cpu_sharedram)/* sharedram main/sub */
302297//  AM_RANGE(0x7800, 0x7bff) AM_READ(cpu_sharedram_r)/* 2114 x 2 (0x400 x 4bit each) */
303298
304   AM_RANGE(0x8000, 0xffff) AM_WRITE(videoram_w) AM_READ(MRA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)   /* 4116 x 16 (32K) */
299   AM_RANGE(0x8000, 0xffff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)   /* 4116 x 16 (32K) */
305300ADDRESS_MAP_END
306301
307302/* sub */
src/mame/drivers/ccastles.c
r1527r1528
185185}
186186
187187
188static UINT32 get_vblank(void *param)
188static CUSTOM_INPUT( get_vblank )
189189{
190190   int scanline = video_screen_get_vpos(0);
191191   return syncprom[scanline & 0xff] & 1;
src/mame/drivers/exterm.c
r1527r1528
476476static MACHINE_DRIVER_START( exterm )
477477
478478   /* basic machine hardware */
479   MDRV_CPU_ADD(TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
479   MDRV_CPU_ADD(TMS34010, 40000000)
480480   MDRV_CPU_CONFIG(master_config)
481481   MDRV_CPU_PROGRAM_MAP(master_map,0)
482482
483   MDRV_CPU_ADD(TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
483   MDRV_CPU_ADD(TMS34010, 40000000)
484484   MDRV_CPU_CONFIG(slave_config)
485485   MDRV_CPU_PROGRAM_MAP(slave_map,0)
486486
src/mame/drivers/coolpool.c
r1527r1528
7878static void amerdart_scanline(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
7979{
8080   UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0xff00];
81   UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
81   UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
82   rgb_t pens[16];
8283   int coladdr = params->coladdr;
8384   int x;
8485
r1527r1528
8788      for (x = 0; x < 16; x++)
8889      {
8990         UINT16 pal = vram_base[x];
90         palette_set_color_rgb(machine, scanline * 16 + x, pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12));
91         pens[x] = MAKE_RGB(pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12));
9192      }
9293
9394   for (x = params->heblnk; x < params->hsblnk; x += 4)
9495   {
9596      UINT16 pixels = vram[coladdr++ & 0xff];
96      dest[x + 0] = scanline * 16 + ((pixels >> 0) & 15);
97      dest[x + 1] = scanline * 16 + ((pixels >> 4) & 15);
98      dest[x + 2] = scanline * 16 + ((pixels >> 8) & 15);
99      dest[x + 3] = scanline * 16 + ((pixels >> 12) & 15);
97      dest[x + 0] = pens[(pixels >> 0) & 15];
98      dest[x + 1] = pens[(pixels >> 4) & 15];
99      dest[x + 2] = pens[(pixels >> 8) & 15];
100      dest[x + 3] = pens[(pixels >> 12) & 15];
100101   }
101102}
102103
r1527r1528
104105static void coolpool_scanline(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
105106{
106107   UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0x1ff00];
107   UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
108   UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
109   const rgb_t *pens = tlc34076_get_pens();
108110   int coladdr = params->coladdr;
109111   int x;
110112
111113   for (x = params->heblnk; x < params->hsblnk; x += 2)
112114   {
113115      UINT16 pixels = vram[coladdr++ & 0xff];
114      dest[x + 0] = pixels & 0xff;
115      dest[x + 1] = pixels >> 8;
116      dest[x + 0] = pens[pixels & 0xff];
117      dest[x + 1] = pens[pixels >> 8];
116118   }
117119}
118120
r1527r1528
682684static MACHINE_DRIVER_START( amerdart )
683685
684686   /* basic machine hardware */
685   MDRV_CPU_ADD(TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
687   MDRV_CPU_ADD(TMS34010, 40000000)
686688   MDRV_CPU_CONFIG(tms_config_amerdart)
687689   MDRV_CPU_PROGRAM_MAP(amerdart_map,0)
688690
689   MDRV_CPU_ADD(TMS32010, 15000000/8)
691   MDRV_CPU_ADD(TMS32010, 15000000/2)
690692   MDRV_CPU_FLAGS(CPU_DISABLE)
691693   MDRV_CPU_PROGRAM_MAP(amerdart_dsp_map,0)
692694
r1527r1528
695697
696698   /* video hardware */
697699   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
698   MDRV_PALETTE_LENGTH(16*256)
700   MDRV_VIDEO_UPDATE(tms340x0)
699701
700702   MDRV_SCREEN_ADD("main", 0)
701   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
703   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
702704   MDRV_SCREEN_RAW_PARAMS(40000000/6, 212*2, 0, 161*2, 262, 0, 241)
703705
704   MDRV_VIDEO_UPDATE(tms340x0)
705
706706   /* sound hardware */
707707   MDRV_SPEAKER_STANDARD_MONO("mono")
708708
r1527r1528
714714static MACHINE_DRIVER_START( coolpool )
715715
716716   /* basic machine hardware */
717   MDRV_CPU_ADD_TAG("main", TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
717   MDRV_CPU_ADD_TAG("main", TMS34010, 40000000)
718718   MDRV_CPU_CONFIG(tms_config_coolpool)
719719   MDRV_CPU_PROGRAM_MAP(coolpool_map,0)
720720
r1527r1528
727727
728728   /* video hardware */
729729   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
730   MDRV_PALETTE_LENGTH(256)
730   MDRV_VIDEO_UPDATE(tms340x0)
731731
732732   MDRV_SCREEN_ADD("main", 0)
733   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
733   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
734734   MDRV_SCREEN_RAW_PARAMS(40000000/6, 424, 0, 320, 262, 0, 240)
735735
736   MDRV_VIDEO_UPDATE(tms340x0)
737
738736   /* sound hardware */
739737   MDRV_SPEAKER_STANDARD_MONO("mono")
740738
src/mame/drivers/sauro.c
r1527r1528
336336    16*16     /* every sprite takes 32 consecutive bytes */
337337};
338338
339const struct sp0256_interface sauro_sp256 =
339static const struct sp0256_interface sauro_sp256 =
340340{
341341   lrq_callback,
342342   0,
343   REGION_SOUND1};
343   REGION_SOUND1
344};
344345
345346static GFXDECODE_START( sauro )
346347   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 64 )
r1527r1528
471472   ROM_LOAD( "trckydoc.a1",    0x0c000, 0x4000, CRC(436c59ba) SHA1(2aa9c155c432a3c81420520c53bb944dcc613a94) )
472473
473474   ROM_REGION( 0x0c00, REGION_PROMS, 0 ) // colour proms
474   ROM_LOAD( "tdclr3.prm",    0x0000, 0x0400, CRC(671d0140) SHA1(7d5fcd9589c46590b0a240cac428f993201bec2a) )
475   ROM_LOAD( "tdclr2.prm",    0x0400, 0x0400, CRC(874f9050) SHA1(db40d68f5166657fce0eadcd82143112b0388894) )
476   ROM_LOAD( "tdclr1.prm",    0x0800, 0x0400, CRC(57f127b0) SHA1(3d2b18a7a31933579f06d92fa0cc3f0e1fe8b98a) )
475   ROM_LOAD( "tdclr3.prm",    0x0000, 0x0100, CRC(671d0140) SHA1(7d5fcd9589c46590b0a240cac428f993201bec2a) )
476   ROM_LOAD( "tdclr2.prm",    0x0400, 0x0100, CRC(874f9050) SHA1(db40d68f5166657fce0eadcd82143112b0388894) )
477   ROM_LOAD( "tdclr1.prm",    0x0800, 0x0100, CRC(57f127b0) SHA1(3d2b18a7a31933579f06d92fa0cc3f0e1fe8b98a) )
477478
478479   ROM_REGION( 0x0200, REGION_USER1, 0 ) // unknown
479480   ROM_LOAD( "tdprm.prm",    0x0000, 0x0200,  CRC(5261bc11) SHA1(1cc7a9a7376e65f4587b75ef9382049458656372) )
r1527r1528
495496   ROM_LOAD( "trckydoc.a1",    0x0c000, 0x4000, CRC(436c59ba) SHA1(2aa9c155c432a3c81420520c53bb944dcc613a94) )
496497
497498   ROM_REGION( 0x0c00, REGION_PROMS, 0 ) // colour proms
498   ROM_LOAD( "tdclr3.prm",    0x0000, 0x0400, CRC(671d0140) SHA1(7d5fcd9589c46590b0a240cac428f993201bec2a) )
499   ROM_LOAD( "tdclr2.prm",    0x0400, 0x0400, CRC(874f9050) SHA1(db40d68f5166657fce0eadcd82143112b0388894) )
500   ROM_LOAD( "tdclr1.prm",    0x0800, 0x0400, CRC(57f127b0) SHA1(3d2b18a7a31933579f06d92fa0cc3f0e1fe8b98a) )
499   ROM_LOAD( "tdclr3.prm",    0x0000, 0x0100, CRC(671d0140) SHA1(7d5fcd9589c46590b0a240cac428f993201bec2a) )
500   ROM_LOAD( "tdclr2.prm",    0x0400, 0x0100, CRC(874f9050) SHA1(db40d68f5166657fce0eadcd82143112b0388894) )
501   ROM_LOAD( "tdclr1.prm",    0x0800, 0x0100, CRC(57f127b0) SHA1(3d2b18a7a31933579f06d92fa0cc3f0e1fe8b98a) )
501502
502503   ROM_REGION( 0x0200, REGION_USER1, 0 ) // unknown
503504   ROM_LOAD( "tdprm.prm",    0x0000, 0x0200,  CRC(5261bc11) SHA1(1cc7a9a7376e65f4587b75ef9382049458656372) )
src/mame/drivers/midtunit.c
r1527r1528
603603static MACHINE_DRIVER_START( tunit_core )
604604
605605   /* basic machine hardware */
606   MDRV_CPU_ADD_TAG("main", TMS34010, CPU_CLOCK/TMS34010_CLOCK_DIVIDER)
606   MDRV_CPU_ADD_TAG("main", TMS34010, CPU_CLOCK)
607607   MDRV_CPU_CONFIG(tms_config)
608608   MDRV_CPU_PROGRAM_MAP(main_map,0)
609609
src/mame/drivers/system1.c
r1527r1528
21562156   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
21572157   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
21582158   PORT_DIPSETTING(   0x01, DEF_STR( Cocktail ) )
2159   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
2160   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
2161   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2159   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
2160   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
2161   PORT_DIPSETTING(   0x02, DEF_STR( On ) )
21622162   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
21632163   PORT_DIPSETTING(   0x00, "1" )
21642164   PORT_DIPSETTING(   0x08, "2" )
src/mame/drivers/niyanpai.c
r1527r1528
202202static void tmpz84c011_init(running_machine *machine)
203203{
204204   // initialize the CTC
205   ctc_intf.baseclock = machine->drv->cpu[1].clock;
205   ctc_intf.baseclock = cpunum_get_clock(1);
206206   z80ctc_init(0, &ctc_intf);
207207}
208208
r1527r1528
768768   PORT_DIPNAME( 0x04, 0x04, "DIPSW 1-3" )
769769   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
770770   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
771   PORT_DIPNAME( 0x08, 0x00, "DIPSW 1-4" )
772   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
773   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
771   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )
772   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
773   PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
774774   PORT_DIPNAME( 0x10, 0x00, "DIPSW 1-5" )
775775   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
776776   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/jedi.c
r1527r1528
386386   AM_RANGE(0x1e87, 0x1e87) AM_WRITE(jedi_video_off_w)
387387   AM_RANGE(0x1f00, 0x1f00) AM_WRITE(sound_latch_w)
388388   AM_RANGE(0x1f80, 0x1f80) AM_WRITE(rom_banksel_w)
389   AM_RANGE(0x2000, 0x27ff) AM_READWRITE(MRA8_RAM, jedi_backgroundram_w) AM_BASE(&jedi_backgroundram) AM_SIZE(&jedi_backgroundram_size)
389   AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(&jedi_backgroundram) AM_SIZE(&jedi_backgroundram_size)
390390   AM_RANGE(0x2800, 0x2fff) AM_READWRITE(MRA8_RAM, jedi_paletteram_w) AM_BASE(&paletteram)
391   AM_RANGE(0x3000, 0x37bf) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
392   AM_RANGE(0x37c0, 0x3bff) AM_READWRITE(MRA8_RAM, MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
391   AM_RANGE(0x3000, 0x37bf) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
392   AM_RANGE(0x37c0, 0x3bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
393393   AM_RANGE(0x3c00, 0x3c01) AM_WRITE(jedi_vscroll_w)
394394   AM_RANGE(0x3d00, 0x3d01) AM_WRITE(jedi_hscroll_w)
395   AM_RANGE(0x3e00, 0x3fff) AM_WRITE(jedi_PIXIRAM_w) AM_BASE(&jedi_PIXIRAM)
395   AM_RANGE(0x3e00, 0x3fff) AM_WRITE(jedi_PIXIRAM_w)
396396   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
397397   AM_RANGE(0x8000, 0xffff) AM_ROM
398398ADDRESS_MAP_END
src/mame/drivers/zn.c
r1527r1528
621621
622622static MACHINE_DRIVER_START( coh1000c )
623623   /* basic machine hardware */
624   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
624   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
625625   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
626626   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
627627
r1527r1528
664664
665665static MACHINE_DRIVER_START( coh1002c )
666666   /* basic machine hardware */
667   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
667   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
668668   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
669669   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
670670
r1527r1528
873873
874874static MACHINE_DRIVER_START( coh3002c )
875875   /* basic machine hardware */
876   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
876   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
877877   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
878878   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
879879
r1527r1528
13141314
13151315static MACHINE_DRIVER_START( coh1000ta )
13161316   /* basic machine hardware */
1317   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
1317   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
13181318   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
13191319   MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 )
13201320
r1527r1528
14211421
14221422static MACHINE_DRIVER_START( coh1000tb )
14231423   /* basic machine hardware */
1424   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
1424   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
14251425   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
14261426   MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 )
14271427
r1527r1528
16111611
16121612static MACHINE_DRIVER_START( coh3002t )
16131613   /* basic machine hardware */
1614   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
1614   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
16151615   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
16161616   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
16171617
r1527r1528
18251825
18261826static MACHINE_DRIVER_START( coh1000w )
18271827   /* basic machine hardware */
1828   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
1828   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
18291829   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
18301830   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
18311831
r1527r1528
20672067
20682068static MACHINE_DRIVER_START( coh1002e )
20692069   /* basic machine hardware */
2070   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
2070   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
20712071   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
20722072   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
20732073
r1527r1528
24122412
24132413static MACHINE_DRIVER_START( coh1000a )
24142414   /* basic machine hardware */
2415   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
2415   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
24162416   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
24172417   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
24182418
r1527r1528
25792579
25802580static MACHINE_DRIVER_START( coh1001l )
25812581   /* basic machine hardware */
2582   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
2582   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
25832583   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
25842584   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
25852585
r1527r1528
26682668
26692669static MACHINE_DRIVER_START( coh1002v )
26702670   /* basic machine hardware */
2671   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
2671   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
26722672   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
26732673   MDRV_CPU_VBLANK_INT( coh1002v_vblank, 1 )
26742674
r1527r1528
29372937
29382938static MACHINE_DRIVER_START( coh1002m )
29392939   /* basic machine hardware */
2940   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
2940   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
29412941   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
29422942   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
29432943
r1527r1528
29692969
29702970static MACHINE_DRIVER_START( coh1002msnd )
29712971   /* basic machine hardware */
2972   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
2972   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
29732973   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
29742974   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
29752975
r1527r1528
30113011
30123012static MACHINE_DRIVER_START( coh1002ml )
30133013   /* basic machine hardware */
3014   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
3014   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
30153015   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
30163016   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
30173017
src/mame/drivers/paradise.c
r1527r1528
104104   AM_RANGE(0x2022, 0x2022) AM_READ(input_port_2_r      )   // P1
105105   AM_RANGE(0x2023, 0x2023) AM_READ(input_port_3_r      )   // P2
106106   AM_RANGE(0x2024, 0x2024) AM_READ(input_port_4_r      )   // Coins
107   AM_RANGE(0x8000, 0xffff) AM_READ(videoram_r         )   // Pixmap
107   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_RAM         )   // Pixmap
108108ADDRESS_MAP_END
109109
110110static ADDRESS_MAP_START( paradise_writeport, ADDRESS_SPACE_IO, 8 )
111   AM_RANGE(0x0000, 0x17ff) AM_WRITE(paradise_palette_w   )   // Palette
111   AM_RANGE(0x0000, 0x17ff) AM_WRITE(paradise_palette_w   ) AM_BASE(&paletteram)   // Palette
112112   AM_RANGE(0x1800, 0x1800) AM_WRITE(paradise_priority_w   )   // Layers priority
113113   AM_RANGE(0x2001, 0x2001) AM_WRITE(paradise_flipscreen_w   )   // Flip Screen
114114   AM_RANGE(0x2004, 0x2004) AM_WRITE(paradise_palbank_w   )   // Layers palette bank
r1527r1528
116116   AM_RANGE(0x2007, 0x2007) AM_WRITE(paradise_okibank_w   )   // OKI 1 samples bank
117117   AM_RANGE(0x2010, 0x2010) AM_WRITE(OKIM6295_data_0_w      )   // OKI 0
118118   AM_RANGE(0x2030, 0x2030) AM_WRITE(OKIM6295_data_1_w      )   // OKI 1
119   AM_RANGE(0x8000, 0xffff) AM_WRITE(paradise_pixmap_w      )   // Pixmap
119   AM_RANGE(0x8000, 0xffff) AM_WRITE(paradise_pixmap_w      ) AM_BASE(&videoram)    // Pixmap
120120ADDRESS_MAP_END
121121
122122
src/mame/drivers/mexico86.c
r1527r1528
387387   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
388388   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
389389
390   MDRV_CPU_ADD_TAG("mcu", M68705, 4000000/M68705_CLOCK_DIVIDER) /* xtal is 4MHz, divided by 4 internally */
390   MDRV_CPU_ADD_TAG("mcu", M68705, 4000000) /* xtal is 4MHz, divided by 4 internally */
391391   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
392392   MDRV_CPU_VBLANK_INT(mexico86_m68705_interrupt,2)
393393
src/mame/drivers/mouser.c
r1527r1528
5656static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
5757   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
5858   AM_RANGE(0x6000, 0x6bff) AM_READ(MRA8_RAM)
59   AM_RANGE(0x9000, 0x93ff) AM_READ(videoram_r)
59   AM_RANGE(0x9000, 0x93ff) AM_READ(MRA8_RAM)
6060   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
6161   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
6262   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
r1527r1528
6868   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
6969   AM_RANGE(0x6000, 0x6bff) AM_WRITE(MWA8_RAM)
7070   AM_RANGE(0x8800, 0x88ff) AM_WRITE(MWA8_NOP) /* unknown */
71   AM_RANGE(0x9000, 0x93ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
72   AM_RANGE(0x9800, 0x9cff) AM_WRITE(mouser_spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
73   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(mouser_colorram_w) AM_BASE(&colorram)
71   AM_RANGE(0x9000, 0x93ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
72   AM_RANGE(0x9800, 0x9cff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
73   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
7474   AM_RANGE(0xa000, 0xa000) AM_WRITE(mouser_nmi_enable_w) /* bit 0 = NMI Enable */
7575   AM_RANGE(0xa001, 0xa001) AM_WRITE(mouser_flip_screen_x_w)
7676   AM_RANGE(0xa002, 0xa002) AM_WRITE(mouser_flip_screen_y_w)
r1527r1528
221221   MDRV_PALETTE_LENGTH(64)
222222
223223   MDRV_PALETTE_INIT(mouser)
224   MDRV_VIDEO_START(generic)
225224   MDRV_VIDEO_UPDATE(mouser)
226225
227226   /* sound hardware */
src/mame/drivers/midzeus.c
r1527r1528
446446 *
447447 *************************************/
448448
449static UINT32 custom_49way_r(void *param)
449static CUSTOM_INPUT( custom_49way_r )
450450{
451451   static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 };
452452   const char *namex = param;
r1527r1528
462462}
463463
464464
465static UINT32 keypad_r(void *param)
465static CUSTOM_INPUT( keypad_r )
466466{
467467   UINT32 bits = readinputportbytag(param);
468468   UINT8 select = keypad_select;
src/mame/drivers/lkage.c
r1527r1528
332332   MDRV_CPU_ADD(Z80, 6000000)
333333   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
334334                        /* IRQs are triggered by the YM2203 */
335   MDRV_CPU_ADD(M68705,4000000/M68705_CLOCK_DIVIDER)   /* ??? */
335   MDRV_CPU_ADD(M68705,4000000)   /* ??? */
336336   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
337337
338338   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/goodejan.c
r1527r1528
263263   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x100, 0x10 ) /* Text */
264264GFXDECODE_END
265265
266SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
267
268266static INTERRUPT_GEN( goodejan_interrupt )
269267{
270268   if (cpu_getiloops())
src/mame/drivers/ninjakid.c
r1527r1528
9696   AM_RANGE(0xa002, 0xa002) AM_READ(ninjakun_io_A002_r)
9797   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)   /* tilemaps */
9898   AM_RANGE(0xc800, 0xcfff) AM_READ(ninjakid_bg_videoram_r)
99    AM_RANGE(0xd000, 0xd7ff) AM_READ(MRA8_RAM)   /* spriteram */
10099    AM_RANGE(0xd800, 0xd9ff) AM_READ(paletteram_r)
101100    AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM)
102101ADDRESS_MAP_END
r1527r1528
109108   AM_RANGE(0xa003, 0xa003) AM_WRITE(ninjakun_flipscreen_w)
110109   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(ninjakid_fg_videoram_w) AM_BASE(&videoram)
111110   AM_RANGE(0xc800, 0xcfff) AM_WRITE(ninjakid_bg_videoram_w)
112   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)
111   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1)
113112   AM_RANGE(0xd800, 0xd9ff) AM_WRITE(ninjakun_paletteram_w) AM_BASE(&paletteram)
114113   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM) AM_BASE(&shareram)
115114ADDRESS_MAP_END
r1527r1528
121120   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
122121   AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
123122   AM_RANGE(0xa002, 0xa002) AM_READ(ninjakun_io_A002_r)
124   AM_RANGE(0xc000, 0xc7ff) AM_READ(videoram_r)      /* tilemaps */
123   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)      /* tilemaps */
125124   AM_RANGE(0xc800, 0xcfff) AM_READ(ninjakid_bg_videoram_r)
126    AM_RANGE(0xd000, 0xd7ff) AM_READ(spriteram_r)   /* shareram */
127125    AM_RANGE(0xd800, 0xd9ff) AM_READ(paletteram_r)
128126    AM_RANGE(0xe000, 0xe7ff) AM_READ(shareram_r)
129127ADDRESS_MAP_END
r1527r1528
135133   AM_RANGE(0xa003, 0xa003) AM_WRITE(ninjakun_flipscreen_w)
136134   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(ninjakid_fg_videoram_w)
137135   AM_RANGE(0xc800, 0xcfff) AM_WRITE(ninjakid_bg_videoram_w)
138   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(spriteram_w)   /* shareram */
136   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(1)
139137   AM_RANGE(0xd800, 0xd9ff) AM_WRITE(ninjakun_paletteram_w)
140138    AM_RANGE(0xe000, 0xe7ff) AM_WRITE(shareram_w)
141139ADDRESS_MAP_END
src/mame/drivers/zaxxon.c
r1527r1528
316316 *
317317 *************************************/
318318
319#define MASTER_CLOCK      48660000
320#define SOUND_CLOCK         4000000
319#define MASTER_CLOCK      XTAL_48_66MHz
320#define SOUND_CLOCK         XTAL_4MHz
321321
322322#define PIXEL_CLOCK         (MASTER_CLOCK/8)
323323
r1527r1528
414414}
415415
416416
417static UINT32 razmataz_dial_r(void *param)
417static CUSTOM_INPUT( razmataz_dial_r )
418418{
419419   static const char *const dialname[2] = { "DIAL0", "DIAL1" };
420420   int num = (FPTR)param;
src/mame/drivers/shangkid.c
r1527r1528
384384static MACHINE_DRIVER_START( chinhero )
385385
386386   /* basic machine hardware */
387   MDRV_CPU_ADD_TAG("main", Z80, 3000000) /* ? */
387   MDRV_CPU_ADD_TAG("main", Z80, XTAL_18_432MHz/6) /* verified on pcb */
388388   MDRV_CPU_PROGRAM_MAP(chinhero_main_map,0)
389389   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
390390
391   MDRV_CPU_ADD_TAG("bbx", Z80, 3000000) /* ? */
391   MDRV_CPU_ADD_TAG("bbx", Z80, XTAL_18_432MHz/6) /* verified on pcb */
392392   MDRV_CPU_PROGRAM_MAP(chinhero_bbx_map,0)
393393   MDRV_CPU_IO_MAP(chinhero_bbx_portmap,0)
394394   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
395395
396   MDRV_CPU_ADD_TAG("audio", Z80, 3000000) /* ? */
396   MDRV_CPU_ADD_TAG("audio", Z80, XTAL_18_432MHz/6) /* verified on pcb */
397397   MDRV_CPU_PROGRAM_MAP(chinhero_sound_map,0)
398398   MDRV_CPU_IO_MAP(sound_portmap,0)
399399
r1527r1528
421421   MDRV_SOUND_ADD(DAC, 0)
422422   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
423423
424   MDRV_SOUND_ADD(AY8910, 2000000)
424   MDRV_SOUND_ADD(AY8910, XTAL_18_432MHz/12) /* verified on pcb */
425425   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
426426MACHINE_DRIVER_END
427427
src/mame/drivers/astrof.c
r1527r1528
1010        * Astro Fire
1111        * Astro Combat (2 sets)
1212        * Super Star Battle
13        * Space Fighter Mark II (2 sets)
1314        * Tomahawk 777 late version with changed game play
1415        * Tomahawk 777 early version
1516
1617    Notes:
1718        * Astro Battle added by HIGHWAYMAN with help from Reip.
1819          2 sets, 1 may be a bad set, or they may simply be different - don't know yet.
19          protection involves the eprom datalines being routed through an 8bit x 256byte prom.
20          protection involves the EPROM datalines being routed through an 8bit x 256byte PROM.
2021          it *may* have a more complex palette, it needs to be investigated when i get more time.
2122
2223        * Astro Fighter set differences:
r1527r1528
3536                    Blue/Solid empty fuel bar.
3637                   300 points for every seven bombs destroyed.
3738
38        * I know there must be at least one other rom set for Astro Fighter
39        * I know there must be at least one other ROM set for Astro Fighter
3940          I have played one that stoped between waves to show the next enemy
4041
4142    Known issues/to-do's:
4243        * Is Astro Fighter supposed to have a blue background???
4344        * Analog sound in all games
4445        * Verify DIPs for clones
46        * Figure out unknown DIPs for Space Fighter Mark II (set 2)
4547
4648****************************************************************************/
4749
r1527r1528
5052#include "astrof.h"
5153
5254
53#define MASTER_CLOCK        (10595000)
55#define MASTER_CLOCK        (XTAL_10_595MHz)
5456#define MAIN_CPU_CLOCK     (MASTER_CLOCK / 16)
5557#define PIXEL_CLOCK        (MASTER_CLOCK / 2)
5658#define HTOTAL            (0x150)
5759#define HBEND            (0x000)
5860#define HBSTART            (0x100)
59#define ASTROF_VTOTAL      (0x107)
60#define ASTROF_VBEND      (0x008)
61#define VTOTAL            (0x118)
62#define VBEND            (0x000)
6163#define VBSTART            (0x100)
62#define TOMAHAWK_VTOTAL      (0x118)
63#define TOMAHAWK_VBEND      (0x000)
6464
6565
6666
r1527r1528
118118
119119/*************************************
120120 *
121 *  Machine setup
122 *
123 *************************************/
124
125static MACHINE_START( tomahawk )
126{
127   create_irq_timer();
128
129   /* register for state saving */
130   state_save_register_global(red_on);
131   state_save_register_global(flipscreen);
132   state_save_register_global(screen_off);
133}
134
135
136static MACHINE_START( astrof )
137{
138   /* register for state saving */
139   state_save_register_global(astrof_palette_bank);
140
141   machine_start_astrof_audio(machine);
142   machine_start_tomahawk(machine);
143}
144
145
146static MACHINE_START( abattle )
147{
148   /* register for state saving */
149   state_save_register_global(abattle_count);
150
151   machine_start_astrof(machine);
152}
153
154
155
156/*************************************
157 *
158 *  Machine reset
159 *
160 *************************************/
161
162static MACHINE_RESET( astrof )
163{
164   start_irq_timer();
165}
166
167
168static MACHINE_RESET( abattle )
169{
170   machine_reset_astrof(machine);
171
172   abattle_count = 0;
173}
174
175
176
177/*************************************
178 *
179121 *  Input handling
180122 *
181123 *************************************/
r1527r1528
198140}
199141
200142
201static UINT32 astrof_p1_controls_r(void *param)
143static CUSTOM_INPUT( astrof_p1_controls_r )
202144{
203145   return readinputportbytag("P1");
204146}
205147
206148
207static UINT32 astrof_p2_controls_r(void *param)
149static CUSTOM_INPUT( astrof_p2_controls_r )
208150{
209151   UINT32 ret;
210152
r1527r1528
241183
242184static rgb_t make_pen(UINT8 data)
243185{
244   UINT8 r1_bit = ((data >> 0) & 0x01) | red_on;
245   UINT8 r2_bit = ((data >> 1) & 0x01) | red_on;
246   UINT8 g1_bit = ( data >> 2) & 0x01;
247   UINT8 g2_bit = ( data >> 3) & 0x01;
248   UINT8 b1_bit = ( data >> 4) & 0x01;
249   UINT8 b2_bit = ( data >> 5) & 0x01;
186   UINT8 r1_bit = red_on ? 0x01 : (data >> 0) & 0x01;
187   UINT8 r2_bit = red_on ? 0x01 : (data >> 1) & 0x01;
188   UINT8 g1_bit =                 (data >> 2) & 0x01;
189   UINT8 g2_bit =                 (data >> 3) & 0x01;
190   UINT8 b1_bit =                 (data >> 4) & 0x01;
191   UINT8 b2_bit =                 (data >> 5) & 0x01;
250192
251193   /* this is probably not quite right, but I don't have the
252194       knowledge to figure out the actual weights - ZV */
r1527r1528
264206
265207   for (i = 0; i < ASTROF_NUM_PENS; i++)
266208   {
267      UINT8 data = memory_region(REGION_PROMS)[(astrof_palette_bank << 4) | i];
209      UINT8 data = memory_region(REGION_PROMS)[(astrof_palette_bank ? 0x10 : 0x00) | i];
268210
269211      pens[i] = make_pen(data);
270212   }
r1527r1528
303245   flipscreen = ((data >> 0) & 0x01) & readinputportbytag("FLIP");
304246
305247   /* this ties to the CLR pin of the shift registers */
306   screen_off = ((data >> 1) & 0x01);
248   screen_off = (data & 0x02) ? TRUE : FALSE;
307249
308   /* D2 - not connected in the schematics, but at one point Astro Fighter sets it to 1*/
250   /* D2 - not connected in the schematics, but at one point Astro Fighter sets it to 1 */
309251   /* D3-D7 - not connected */
310252
311253   video_screen_update_partial(0, video_screen_get_vpos(0));
312254}
313255
314256
315static WRITE8_HANDLER( astrof_video_control_2_w )
257static void astrof_set_video_control_2(UINT8 data)
316258{
317259   /* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
318260   /* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
319261
320   astrof_palette_bank = (data >> 2) & 0x01;
262   /* D2 - selects one of the two palette banks */
263   astrof_palette_bank = (data & 0x04) ? TRUE : FALSE;
321264
322   red_on = (data >> 3) & 0x01;
265   /* D3 - turns on the red color gun regardless of the value in the color PROM */
266   red_on = (data & 0x08) ? TRUE : FALSE;
323267
324268   /* D4-D7 - not connected */
269}
325270
271static WRITE8_HANDLER( astrof_video_control_2_w )
272{
273   astrof_set_video_control_2(data);
326274   video_screen_update_partial(0, video_screen_get_vpos(0));
327275}
328276
329277
330static WRITE8_HANDLER( tomahawk_video_control_2_w )
278static void spfghmk2_set_video_control_2(UINT8 data)
331279{
332280   /* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
333281   /* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
282
283   /* D2 - selects one of the two palette banks */
284   astrof_palette_bank = (data & 0x04) ? TRUE : FALSE;
285
286   /* D3-D7 - not connected */
287}
288
289static WRITE8_HANDLER( spfghmk2_video_control_2_w )
290{
291   spfghmk2_set_video_control_2(data);
292   video_screen_update_partial(0, video_screen_get_vpos(0));
293}
294
295
296static void tomahawk_set_video_control_2(UINT8 data)
297{
298   /* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
299   /* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
334300   /* D2 - not connected */
335301
336   red_on = (data >> 3) & 0x01;
302   /* D3 - turns on the red color gun regardless of the value in the color PROM */
303   red_on = (data & 0x08) ? TRUE : FALSE;
304}
337305
306static WRITE8_HANDLER( tomahawk_video_control_2_w )
307{
308   tomahawk_set_video_control_2(data);
338309   video_screen_update_partial(0, video_screen_get_vpos(0));
339310}
340311
r1527r1528
447418
448419/*************************************
449420 *
421 *  Machine setup
422 *
423 *************************************/
424
425static MACHINE_START( astrof )
426{
427   create_irq_timer();
428
429   /* the 74175 outputs all HI's if not otherwise set */
430   astrof_set_video_control_2(0xff);
431
432   /* register for state saving */
433   state_save_register_global(red_on);
434   state_save_register_global(flipscreen);
435   state_save_register_global(screen_off);
436   state_save_register_global(astrof_palette_bank);
437
438   machine_start_astrof_audio(machine);
439}
440
441
442static MACHINE_START( abattle )
443{
444   /* register for state saving */
445   state_save_register_global(abattle_count);
446
447   machine_start_astrof(machine);
448}
449
450
451static MACHINE_START( spfghmk2 )
452{
453   create_irq_timer();
454
455   /* the 74175 outputs all HI's if not otherwise set */
456   spfghmk2_set_video_control_2(0xff);
457
458   /* the red background circuit is disabled */
459   red_on = FALSE;
460
461   /* register for state saving */
462   state_save_register_global(flipscreen);
463   state_save_register_global(screen_off);
464   state_save_register_global(astrof_palette_bank);
465}
466
467
468static MACHINE_START( tomahawk )
469{
470   create_irq_timer();
471
472   /* the 74175 outputs all HI's if not otherwise set */
473   tomahawk_set_video_control_2(0xff);
474
475   /* register for state saving */
476   state_save_register_global(red_on);
477   state_save_register_global(flipscreen);
478   state_save_register_global(screen_off);
479}
480
481
482
483/*************************************
484 *
485 *  Machine reset
486 *
487 *************************************/
488
489static MACHINE_RESET( astrof )
490{
491   start_irq_timer();
492}
493
494
495static MACHINE_RESET( abattle )
496{
497   machine_reset_astrof(machine);
498
499   abattle_count = 0;
500}
501
502
503
504/*************************************
505 *
450506 *  Memory handlers
451507 *
452508 *************************************/
r1527r1528
462518   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READWRITE(MRA8_NOP, astrof_video_control_2_w)
463519   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READWRITE(MRA8_NOP, astrof_audio_1_w)
464520   AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READWRITE(MRA8_NOP, astrof_audio_2_w)
465   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITE(MWA8_NOP)
466   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITE(MWA8_NOP)
521   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READWRITE(port_tag_to_handler("IN"), MWA8_NOP)
522   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READWRITE(port_tag_to_handler("DSW"), MWA8_NOP)
467523   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READWRITE(irq_ack_r, MWA8_NOP)
468524   AM_RANGE(0xa003, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
469525   AM_RANGE(0xc000, 0xffff) AM_ROM
470526ADDRESS_MAP_END
471527
472528
529static ADDRESS_MAP_START( spfghmk2_map, ADDRESS_SPACE_PROGRAM, 8 )
530   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM
531   AM_RANGE(0x2000, 0x3fff) AM_NOP
532   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_WRITE(astrof_videoram_w) AM_BASE(&astrof_videoram) AM_SIZE(&astrof_videoram_size)
533   AM_RANGE(0x6000, 0x7fff) AM_NOP
534   AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP
535   AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READWRITE(MRA8_NOP, MWA8_RAM) AM_BASE(&astrof_color)
536   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READWRITE(MRA8_NOP, video_control_1_w)
537   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READWRITE(MRA8_NOP, spfghmk2_video_control_2_w)
538   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READWRITE(MRA8_NOP, spfghmk2_audio_w)
539   AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_NOP
540   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READWRITE(port_tag_to_handler("IN"), MWA8_NOP)
541   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READWRITE(port_tag_to_handler("DSW"), MWA8_NOP)
542   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READWRITE(irq_ack_r, MWA8_NOP)
543   AM_RANGE(0xa003, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
544   AM_RANGE(0xc000, 0xffff) AM_ROM
545ADDRESS_MAP_END
546
547
473548static ADDRESS_MAP_START( tomahawk_map, ADDRESS_SPACE_PROGRAM, 8 )
474549   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM
475550   AM_RANGE(0x2000, 0x3fff) AM_NOP
r1527r1528
546621   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
547622
548623   PORT_START_TAG("FLIP")
549   PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" ) PORT_DIPLOCATION("SW:8")
624   PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" )
550625   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
551626   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
552627   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
r1527r1528
556631   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
557632   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
558633   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
634
635//  PORT_START_TAG("WIREMOD")
636//  PORT_CONFNAME( 0x01, 0x00, "Wire Mod for Background Color" )
637//  PORT_CONFSETTING(    0x00, "Blue Background" )
638//  PORT_CONFSETTING(    0x01, "Black Background" )
639//  PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
559640INPUT_PORTS_END
560641
561642
r1527r1528
621702INPUT_PORTS_END
622703
623704
705static INPUT_PORTS_START( spfghmk2 )
706   PORT_START_TAG("IN")
707   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
708   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
709   PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(astrof_p1_controls_r, 0)
710   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(astrof_p2_controls_r, 0)
711
712   PORT_START_TAG("DSW")
713   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )   /* most likely not used */
714   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
715   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
716   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
717   PORT_DIPSETTING(    0x00, "3" )
718   PORT_DIPSETTING(    0x02, "5" )
719   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
720   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
721  /*PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )*/
722   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
723   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
724   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )
725   PORT_DIPSETTING(    0x00, "1500" )
726   PORT_DIPSETTING(    0x10, "2000" )
727   PORT_DIPSETTING(    0x20, "2500" )
728   PORT_DIPSETTING(    0x30, "3000" )
729   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )   /* most likely not used */
730   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
731   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
732   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
733
734   PORT_START_TAG("P1")
735   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
736   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
737   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
738   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
739
740   PORT_START_TAG("P2")
741   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
742   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
743   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
744   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
745
746   PORT_START_TAG("COIN")
747   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
748   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
749
750   PORT_START_TAG("SERVICE")
751   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1)
752   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
753
754   PORT_START_TAG("FLIP")
755   PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" )
756   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
757   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
758   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
759
760   PORT_START_TAG("CAB")
761   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
762   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
763   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
764   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
765INPUT_PORTS_END
766
767
768static INPUT_PORTS_START( spfgmk22 )
769   PORT_START_TAG("IN")
770   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
771   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
772   PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(astrof_p1_controls_r, 0)
773   PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(astrof_p2_controls_r, 0)
774
775   PORT_START_TAG("DSW")
776   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )   /* used */
777   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
778   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
779   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
780   PORT_DIPSETTING(    0x00, "3" )
781   PORT_DIPSETTING(    0x02, "5" )
782   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
783   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
784  /*PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )*/
785   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
786   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
787   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )
788   PORT_DIPSETTING(    0x00, "2000" )
789   PORT_DIPSETTING(    0x10, "3000" )
790   PORT_DIPSETTING(    0x20, "4000" )
791   PORT_DIPSETTING(    0x30, "5000" )
792   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )   /* used */
793   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
794   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
795   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
796
797   PORT_START_TAG("P1")
798   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
799   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
800   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
801   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
802
803   PORT_START_TAG("P2")
804   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
805   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
806   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
807   PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
808
809   PORT_START_TAG("COIN")
810   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
811   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
812
813   PORT_START_TAG("SERVICE")
814   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_IMPULSE(1)
815   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
816
817   PORT_START_TAG("FLIP")
818   PORT_DIPNAME( 0x01, 0x00, "Flip Screen for Player 2" )
819   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
820   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
821   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
822
823   PORT_START_TAG("CAB")
824   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
825   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )
826   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )
827   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
828INPUT_PORTS_END
829
830
624831static INPUT_PORTS_START( tomahawk )
625832   PORT_START_TAG("IN")
626833   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
r1527r1528
690897
691898   MDRV_SCREEN_ADD("main", 0)
692899   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
900   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
693901
694902MACHINE_DRIVER_END
695903
r1527r1528
706914   /* video hardware */
707915   MDRV_VIDEO_UPDATE(astrof)
708916
709   MDRV_SCREEN_MODIFY("main")
710   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, ASTROF_VTOTAL, ASTROF_VBEND, VBSTART)
711
712917   /* audio hardware */
713918   MDRV_IMPORT_FROM(astrof_audio)
714919
r1527r1528
726931MACHINE_DRIVER_END
727932
728933
934static MACHINE_DRIVER_START( spfghmk2 )
935
936   /* basic machine hardware */
937   MDRV_IMPORT_FROM(base)
938   MDRV_CPU_MODIFY("main")
939   MDRV_CPU_PROGRAM_MAP(spfghmk2_map,0)
940
941   MDRV_MACHINE_START(spfghmk2)
942
943   /* video hardware */
944   MDRV_VIDEO_UPDATE(astrof)
945
946   /* audio hardware */
947   MDRV_IMPORT_FROM(spfghmk2_audio)
948
949MACHINE_DRIVER_END
950
951
729952static MACHINE_DRIVER_START( tomahawk )
730953
731954   /* basic machine hardware */
r1527r1528
738961   /* video hardware */
739962   MDRV_VIDEO_UPDATE(tomahawk)
740963
741   MDRV_SCREEN_MODIFY("main")
742   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, TOMAHAWK_VTOTAL, TOMAHAWK_VBEND, VBSTART)
743
744964   /* audio hardware */
745965   MDRV_IMPORT_FROM(tomahawk_audio)
746966
r1527r1528
9381158ROM_END
9391159
9401160
1161ROM_START( spfghmk2 )
1162   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1163   ROM_LOAD( "2708.5e",      0xe400, 0x0400, CRC(cd5f66de) SHA1(aea3d88eb1d59a9279361369991fcace90c4b61a) )
1164   ROM_LOAD( "2708.5d",      0xe800, 0x0400, CRC(385cca72) SHA1(8d38a127f7603f1573df24cb028e1f41098a61c1) )
1165   ROM_LOAD( "2708.5c",      0xec00, 0x0400, CRC(e6eaac70) SHA1(3af366f190ed0aed43cc584c6bd472da957c725a) )
1166   ROM_LOAD( "2708.4h",      0xf000, 0x0400, CRC(27945183) SHA1(7907d3d2b90d38c35fb6cf194408d2be23769c8c) )
1167   ROM_LOAD( "2708.4e",      0xf400, 0x0400, CRC(2115e25f) SHA1(a7c529f42d9bf70c7f81df949ba4666bde8da4c5) )
1168   ROM_LOAD( "2708.4d",      0xf800, 0x0400, CRC(b9655874) SHA1(22e53bc0b68acc8483bd18b15a020af19cf3e151) )
1169   ROM_LOAD( "2708.4c",      0xfc00, 0x0400, CRC(7d67f6b5) SHA1(aed42c2c48d50fb9e3c2860cdc9d448024a554ae) )
1170
1171   ROM_REGION( 0x0020, REGION_PROMS, 0 )
1172   ROM_LOAD( "709-5.1a",     0x0000, 0x0020, CRC(61329fd1) SHA1(15782d8757d4dda5a8b97815e94c90218f0e08dd) )
1173ROM_END
1174
1175
1176ROM_START( spfgmk22 )
1177   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1178   ROM_LOAD( "2708.5e",      0xe400, 0x0400, CRC(27d7060d) SHA1(796c44a395e1c54769dc57050503b4b111bde7ef) )
1179   ROM_LOAD( "2708.5d",      0xe800, 0x0400, CRC(6ccb3b0a) SHA1(566104ca2e0fae741d4650e7159c9ddb48f59e8b) )
1180   ROM_LOAD( "2708.5c",      0xec00, 0x0400, CRC(68eb0ad5) SHA1(d303685ffd67898cec3e7c51b3831558a837e5a3) )
1181   ROM_LOAD( "2708.4h",      0xf000, 0x0400, CRC(ea8d1f2f) SHA1(35b01e76284080d5bd0270e4004a54386d9eb697) )
1182   ROM_LOAD( "2708.4e",      0xf400, 0x0400, CRC(6e7f00ae) SHA1(91ca17d5dc75be641c059fd84bed7cced2a2ef69) )
1183   ROM_LOAD( "2708.4d",      0xf800, 0x0400, CRC(29501dba) SHA1(978d7009eab8da40ccf0d026c9dabc0a3fa95d76) )
1184   ROM_LOAD( "2708.4c",      0xfc00, 0x0400, CRC(9bd589a6) SHA1(bce92fcab5220ff68526bc8c1c88ab0f317fe400) )
1185
1186   ROM_REGION( 0x0020, REGION_PROMS, 0 )
1187   ROM_LOAD( "709-5.1a",     0x0000, 0x0020, CRC(61329fd1) SHA1(15782d8757d4dda5a8b97815e94c90218f0e08dd) )
1188ROM_END
1189
1190
9411191ROM_START( tomahawk )
9421192   ROM_REGION( 0x10000, REGION_CPU1, 0 )
9431193   ROM_LOAD( "thawk.l8",     0xdc00, 0x0400, CRC(b01dab4b) SHA1(d8b4266359a3b18d649f539fad8dce4d73cec412) )
r1527r1528
9811231
9821232static DRIVER_INIT( abattle )
9831233{
984   /* use the protection prom to decrypt the roms */
1234   /* use the protection PROM to decrypt the ROMs */
9851235   UINT8 *rom = memory_region(REGION_CPU1);
9861236   UINT8 *prom = memory_region(REGION_USER1);
9871237   int i;
r1527r1528
10391289GAME( 1979, acombat,  astrof,   abattle,  abattle,  afire,   ROT90, "bootleg",     "Astro Combat (newer, CB)", GAME_SUPPORTS_SAVE )
10401290GAME( 1979, acombato, astrof,   abattle,  abattle,  afire,   ROT90, "bootleg",     "Astro Combat (older, PZ)", GAME_SUPPORTS_SAVE )
10411291GAME( 1979, sstarbtl, astrof,   abattle,  abattle,  sstarbtl,ROT90, "bootleg",     "Super Star Battle", GAME_SUPPORTS_SAVE )
1042GAME( 1980, tomahawk, 0,        tomahawk, tomahawk, 0,       ROT90, "Data East",   "Tomahawk 777 (Revision 5)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1043GAME( 1980, tomahaw1, tomahawk, tomahawk, tomahawk, 0,       ROT90, "Data East",   "Tomahawk 777 (Revision 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1292GAME( 1980, spfghmk2, 0,        spfghmk2, spfghmk2, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1293GAME( 1980, spfgmk22, spfghmk2, spfghmk2, spfgmk22, 0,       ROT90, "Data East",   "Space Fighter Mark II (set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
1294GAME( 1980, tomahawk, 0,        tomahawk, tomahawk, 0,       ROT90, "Data East",   "Tomahawk 777 (rev 5)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1295GAME( 1980, tomahaw1, tomahawk, tomahawk, tomahawk, 0,       ROT90, "Data East",   "Tomahawk 777 (rev 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/xtheball.c
r1527r1528
4848static void xtheball_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
4949{
5050   UINT16 *srcbg = &vram_bg[(params->rowaddr << 8) & 0xff00];
51   UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
51   UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
52   const rgb_t *pens = tlc34076_get_pens();
5253   int coladdr = params->coladdr;
5354   int x;
5455
r1527r1528
6364         UINT16 fgpix = srcfg[coladdr & 0xff];
6465         UINT16 bgpix = srcbg[coladdr & 0xff];
6566
66         dest[x + 0] = ((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff);
67         dest[x + 1] = ((fgpix & 0xff00) != 0) ? (fgpix >> 8) : (bgpix >> 8);
67         dest[x + 0] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff)];
68         dest[x + 1] = pens[((fgpix & 0xff00) != 0) ? (fgpix >> 8) : (bgpix >> 8)];
6869      }
6970   }
7071   else
r1527r1528
7879         UINT16 fgpix = srcfg[(coladdr >> 1) & 0xff] >> (8 * (coladdr & 1));
7980         UINT16 bgpix = srcbg[coladdr & 0xff];
8081
81         dest[x + 0] = ((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff);
82         dest[x + 1] = ((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix >> 8);
82         dest[x + 0] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff)];
83         dest[x + 1] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix >> 8)];
8384      }
8485   }
8586
r1527r1528
355356
356357static MACHINE_DRIVER_START( xtheball )
357358
358   MDRV_CPU_ADD(TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
359   MDRV_CPU_ADD(TMS34010, 40000000)
359360   MDRV_CPU_CONFIG(tms_config)
360361   MDRV_CPU_PROGRAM_MAP(main_map,0)
361362   MDRV_CPU_PERIODIC_INT(irq1_line_pulse,15000)
r1527r1528
365366
366367   /* video hardware */
367368   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
368   MDRV_PALETTE_LENGTH(256)
369   MDRV_VIDEO_UPDATE(tms340x0)
369370
370371   MDRV_SCREEN_ADD("main", 0)
371   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
372   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
372373   MDRV_SCREEN_SIZE(512,256)
373374   MDRV_SCREEN_VISIBLE_AREA(0,511, 24,247)
374375   MDRV_SCREEN_REFRESH_RATE(60)
375376
376   MDRV_VIDEO_UPDATE(tms340x0)
377
378377   /* sound hardware */
379378   MDRV_SPEAKER_STANDARD_MONO("mono")
380379
src/mame/drivers/maxaflex.c
r1527r1528
436436   MDRV_CPU_VBLANK_INT(a800xl_interrupt, TOTAL_LINES_60HZ)
437437   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
438438
439   MDRV_CPU_ADD(M68705, 3579545/M68705_CLOCK_DIVIDER)
439   MDRV_CPU_ADD(M68705, 3579545)
440440   MDRV_CPU_PROGRAM_MAP(mcu_mem,0)
441441   MDRV_CPU_PERIODIC_INT( supervisor_board_check_coin_input, 10 )
442442
src/mame/drivers/punchout.c
r1527r1528
22
33Punch Out memory map (preliminary)
44Arm Wrestling runs on about the same hardware, but the video board is different.
5 The most significant changes are that Punchout has a larger bottom tilemap,
6 with scrolling, while Arm Wrestling has an additional FG tilemap displayed on
7 the bottom screen.
58
6TODO:
7- The money bag is misplaced in armwrest bonus rounds.
9- money bag placement might not be 100% correct in Arm Wrestingly, however,
10  the more serious part of armwrest35b9yel (unplayable bonus round after rounds
11  5 and 9) is now fixed.
812
9
1013driver by Nicola Salmoria
1114
1215
r1527r1528
101104
102105#include "rendlay.h"
103106
104
105extern UINT8 *punchout_videoram2;
106extern UINT8 *armwrest_videoram3;
107extern UINT8 *punchout_topTilemap_ram;
108extern UINT8 *punchout_botTilemap_ram;
109extern UINT8 *punchout_botTilemap_scroll_ram;
110extern UINT8 *armwrest_fgTilemap_ram;
107111extern UINT8 *punchout_bigsprite1ram;
108112extern UINT8 *punchout_bigsprite2ram;
109extern UINT8 *punchout_scroll;
110113extern UINT8 *punchout_bigsprite1;
111114extern UINT8 *punchout_bigsprite2;
112115extern UINT8 *punchout_palettebank;
113WRITE8_HANDLER( punchout_videoram_w );
114WRITE8_HANDLER( punchout_videoram2_w );
115WRITE8_HANDLER( armwrest_videoram3_w );
116WRITE8_HANDLER( punchout_topTilemap_ram_w );
117WRITE8_HANDLER( punchout_botTilemap_ram_w );
118WRITE8_HANDLER( armwrest_fgTilemap_ram_w );
116119WRITE8_HANDLER( punchout_bigsprite1ram_w );
117120WRITE8_HANDLER( punchout_bigsprite2ram_w );
118121WRITE8_HANDLER( punchout_palettebank_w );
r1527r1528
396399   AM_RANGE(0xdff0, 0xdff7) AM_RAM AM_BASE(&punchout_bigsprite1)
397400   AM_RANGE(0xdff8, 0xdffc) AM_RAM AM_BASE(&punchout_bigsprite2)
398401   AM_RANGE(0xdffd, 0xdffd) AM_READWRITE(MRA8_RAM, punchout_palettebank_w) AM_BASE(&punchout_palettebank)
399   AM_RANGE(0xd800, 0xdfff) AM_READWRITE(MRA8_RAM, punchout_videoram_w) AM_BASE(&videoram)
402   AM_RANGE(0xd800, 0xdfff) AM_READWRITE(MRA8_RAM, punchout_topTilemap_ram_w) AM_BASE(&punchout_topTilemap_ram)
400403   AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(MRA8_RAM, punchout_bigsprite1ram_w) AM_BASE(&punchout_bigsprite1ram)
401404   AM_RANGE(0xe800, 0xefff) AM_READWRITE(MRA8_RAM, punchout_bigsprite2ram_w) AM_BASE(&punchout_bigsprite2ram)
402   AM_RANGE(0xf000, 0xf03f) AM_RAM AM_BASE(&punchout_scroll)
403   AM_RANGE(0xf000, 0xffff) AM_READWRITE(MRA8_RAM, punchout_videoram2_w) AM_BASE(&punchout_videoram2)
405   AM_RANGE(0xf000, 0xf03f) AM_RAM AM_BASE(&punchout_botTilemap_scroll_ram)
406   AM_RANGE(0xf000, 0xffff) AM_READWRITE(MRA8_RAM, punchout_botTilemap_ram_w) AM_BASE(&punchout_botTilemap_ram)
404407ADDRESS_MAP_END
405408
406409
r1527r1528
411414   AM_RANGE(0xdff0, 0xdff7) AM_RAM AM_BASE(&punchout_bigsprite1)
412415   AM_RANGE(0xdff8, 0xdffc) AM_RAM AM_BASE(&punchout_bigsprite2)
413416   AM_RANGE(0xdffd, 0xdffd) AM_READWRITE(MRA8_RAM, punchout_palettebank_w) AM_BASE(&punchout_palettebank)
414   AM_RANGE(0xd800, 0xdfff) AM_READWRITE(MRA8_RAM, armwrest_videoram3_w) AM_BASE(&armwrest_videoram3)
417   AM_RANGE(0xd800, 0xdfff) AM_READWRITE(MRA8_RAM, armwrest_fgTilemap_ram_w) AM_BASE(&armwrest_fgTilemap_ram)
415418   AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(MRA8_RAM, punchout_bigsprite1ram_w) AM_BASE(&punchout_bigsprite1ram)
416419   AM_RANGE(0xe800, 0xefff) AM_READWRITE(MRA8_RAM, punchout_bigsprite2ram_w) AM_BASE(&punchout_bigsprite2ram)
417   AM_RANGE(0xf000, 0xf03f) AM_RAM AM_BASE(&punchout_scroll)
418   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(MRA8_RAM, punchout_videoram2_w) AM_BASE(&punchout_videoram2)
419   AM_RANGE(0xf800, 0xffff) AM_READWRITE(MRA8_RAM, punchout_videoram_w) AM_BASE(&videoram)
420   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(MRA8_RAM, punchout_botTilemap_ram_w) AM_BASE(&punchout_botTilemap_ram)
421   AM_RANGE(0xf800, 0xffff) AM_READWRITE(MRA8_RAM, punchout_topTilemap_ram_w) AM_BASE(&punchout_topTilemap_ram)
420422ADDRESS_MAP_END
421423
422424
r1527r1528
427429   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
428430   AM_RANGE(0x03, 0x03) AM_READ(punchout_input_3_r)
429431
430   /* protection ports */
432   /* protection ports - Super Punchout only (move to install handler?) */
431433   AM_RANGE(0x07, 0x07) AM_READ(spunchout_prot_0_r)
432434   AM_RANGE(0x17, 0x17) AM_READ(spunchout_prot_1_r)
433435   AM_RANGE(0x27, 0x27) AM_READ(spunchout_prot_2_r)
src/mame/drivers/finalizr.c
r1527r1528
122122   AM_RANGE(0x081b, 0x081b) AM_WRITE(MWA8_NOP)      /* Loads the snd command into the snd latch */
123123   AM_RANGE(0x081c, 0x081c) AM_WRITE(finalizr_i8039_irq_w)   /* custom sound chip */
124124   AM_RANGE(0x081d, 0x081d) AM_WRITE(soundlatch_w)         /* custom sound chip */
125   AM_RANGE(0x2000, 0x23ff) AM_WRITE(colorram_w) AM_BASE(&colorram)
126   AM_RANGE(0x2400, 0x27ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
125   AM_RANGE(0x2000, 0x23ff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
126   AM_RANGE(0x2400, 0x27ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
127127   AM_RANGE(0x2800, 0x2bff) AM_WRITE(MWA8_RAM) AM_BASE(&finalizr_colorram2)
128128   AM_RANGE(0x2c00, 0x2fff) AM_WRITE(MWA8_RAM) AM_BASE(&finalizr_videoram2)
129129   AM_RANGE(0x3000, 0x31ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
r1527r1528
408408   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
409409   MDRV_CPU_VBLANK_INT(finalizr_interrupt,16)   /* 1 IRQ + 8 NMI (generated by a custom IC) */
410410
411   MDRV_CPU_ADD(I8039,(18432000/2)/I8039_CLOCK_DIVIDER)   /* 9.216MHz clkin ?? */
411   MDRV_CPU_ADD(I8039,18432000/2)   /* 9.216MHz clkin ?? */
412412   /* audio CPU */   /* DAC */
413413   MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem)
414414   MDRV_CPU_IO_MAP(i8039_readport,i8039_writeport)
src/mame/drivers/cclimber.c
r1527r1528
131131#include "includes/cclimber.h"
132132
133133
134#define MASTER_CLOCK         XTAL_18_432MHz
135
136
137
134138static WRITE8_HANDLER( cannonb_flip_screen_w )
135139{
136140   flip_screen_set(data);
r1527r1528
175179/* Note that River Patrol reads/writes to a000-a4f0. This is a bug in the code.
176180   The instruction at 0x0593 should say LD DE,$8000 */
177181
178static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
179   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
180   AM_RANGE(0x6000, 0x6bff) AM_READ(MRA8_RAM)   /* Crazy Kong only */
181   AM_RANGE(0x8000, 0x83ff) AM_READ(MRA8_RAM)
182   AM_RANGE(0x8800, 0x8bff) AM_READ(MRA8_RAM)
183   AM_RANGE(0x9000, 0x93ff) AM_READ(MRA8_RAM)   /* video RAM */
184   AM_RANGE(0x9800, 0x9bff) AM_READ(MRA8_RAM)   /* column scroll registers */
185   AM_RANGE(0x9c00, 0x9fff) AM_READ(MRA8_RAM)   /* color RAM */
186   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)     /* IN0 */
187   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)     /* IN1 */
188   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)     /* DSW */
189   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)     /* IN2 */
190ADDRESS_MAP_END
191
192static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
193   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
194   AM_RANGE(0x6000, 0x6bff) AM_WRITE(MWA8_RAM)    /* Crazy Kong only */
195   AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM)
196   AM_RANGE(0x8800, 0x88ff) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
197   AM_RANGE(0x8900, 0x8bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
198   AM_RANGE(0x9000, 0x93ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
199   AM_RANGE(0x9400, 0x97ff) AM_WRITE(videoram_w) /* mirror address, used by Crazy Climber to draw windows */
182static ADDRESS_MAP_START( cclimber_map, ADDRESS_SPACE_PROGRAM, 8 )
183   AM_RANGE(0x0000, 0x5fff) AM_ROM
184   AM_RANGE(0x6000, 0x6bff) AM_RAM            /* Crazy Kong only */
185   AM_RANGE(0x8000, 0x83ff) AM_RAM
186   AM_RANGE(0x8800, 0x88ff) AM_READWRITE(MRA8_RAM, cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
187   AM_RANGE(0x8900, 0x8bff) AM_RAM            /* not used, but initialized */
188   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
200189   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
201190   /* (9800-981f for scroll, 9c20-9c3f for color RAM, and so on) */
202   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_column_scroll)
203   AM_RANGE(0x9880, 0x989f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
204   AM_RANGE(0x98dc, 0x98df) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_bigspriteram)
205   AM_RANGE(0x9800, 0x9bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
206   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(cclimber_colorram_w) AM_BASE(&colorram)
207   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w)
191   AM_RANGE(0x9800, 0x981f) AM_RAM AM_BASE(&cclimber_column_scroll)
192   AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
193   AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigspriteram)
194   AM_RANGE(0x9800, 0x9bff) AM_RAM  /* not used, but initialized */
195   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&colorram)
196   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)     /* IN0 */
208197   AM_RANGE(0xa001, 0xa001) AM_WRITE(flip_screen_x_w)
209198   AM_RANGE(0xa002, 0xa002) AM_WRITE(flip_screen_y_w)
210199   AM_RANGE(0xa003, 0xa003) AM_WRITE(interrupt_enable_w) //used by Crazy Kong Bootleg with alt levels and speed up
211200   AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w)
212   AM_RANGE(0xa800, 0xa800) AM_WRITE(cclimber_sample_rate_w)
213   AM_RANGE(0xb000, 0xb000) AM_WRITE(cclimber_sample_volume_w)
214ADDRESS_MAP_END
215
216static ADDRESS_MAP_START( cannonb_readmem, ADDRESS_SPACE_PROGRAM, 8 )
217   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
218   AM_RANGE(0x6000, 0x6bff) AM_READ(MRA8_RAM)   /* Crazy Kong only, Cannon Ball also*/
219   AM_RANGE(0x8000, 0x83ff) AM_READ(MRA8_RAM)
220   AM_RANGE(0x8800, 0x8800) AM_READ(MRA8_NOP)    /* must not return what's written (game will reset after coin insert if it returns 0xff)*/
221//AM_RANGE(0x8800, 0x8bff) AM_READ(MRA8_RAM)
222   AM_RANGE(0x9000, 0x93ff) AM_READ(MRA8_RAM)   /* video RAM */
223   AM_RANGE(0x9800, 0x981f) AM_READ(MRA8_RAM)   /* column scroll registers */
224   AM_RANGE(0x9820, 0x9bff) AM_READ(MRA8_RAM)   /* */
225   AM_RANGE(0x9c00, 0x9fff) AM_READ(MRA8_RAM)   /* color RAM */
226   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)     /* IN0 */
227   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)     /* IN1 */
228   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)     /* DSW */
201   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, cclimber_sample_rate_w)     /* IN1 */
202   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, cclimber_sample_volume_w)     /* DSW */
229203   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)     /* IN2 */
230204ADDRESS_MAP_END
231205
232static ADDRESS_MAP_START( cannonb_writemem, ADDRESS_SPACE_PROGRAM, 8 )
233206
234   AM_RANGE(0x5045, 0x505f) AM_WRITE(MWA8_NOP)   /* do not errorlog this */
235   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
236   AM_RANGE(0x6000, 0x6bff) AM_WRITE(MWA8_RAM)       /* Crazy Kong only, Cannon Ball also */
237   AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM)
238   AM_RANGE(0x8800, 0x88ff) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
207static ADDRESS_MAP_START( cannonb_map, ADDRESS_SPACE_PROGRAM, 8 )
208   AM_RANGE(0x5045, 0x505f) AM_WRITENOP      /* do not errorlog this */
209   AM_RANGE(0x0000, 0x5fff) AM_ROM
210   AM_RANGE(0x6000, 0x6bff) AM_RAM             /* Crazy Kong only, Cannon Ball also */
211   AM_RANGE(0x8000, 0x83ff) AM_RAM
212   AM_RANGE(0x8800, 0x8800) AM_READNOP          /* must not return what's written (game will reset after coin insert if it returns 0xff)*/
213   AM_RANGE(0x8800, 0x88ff) AM_READWRITE(MRA8_RAM, cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
239214//AM_RANGE(0x8900, 0x8bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
240   AM_RANGE(0x9000, 0x93ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
241   AM_RANGE(0x9400, 0x97ff) AM_WRITE(videoram_w) /* mirror address, used by Crazy Climber to draw windows */
215   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
242216   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
243217   /* (9800-981f for scroll, 9c20-9c3f for color RAM, and so on) */
244   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_column_scroll)
245   AM_RANGE(0x9880, 0x989f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
246   AM_RANGE(0x98dc, 0x98df) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_bigspriteram)
247   AM_RANGE(0x9800, 0x9bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
248   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(cclimber_colorram_w) AM_BASE(&colorram)
249   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w)
218   AM_RANGE(0x9800, 0x981f) AM_RAM AM_BASE(&cclimber_column_scroll)
219   AM_RANGE(0x9880, 0x989f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
220   AM_RANGE(0x98dc, 0x98df) AM_RAM AM_BASE(&cclimber_bigspriteram)
221   AM_RANGE(0x9800, 0x9bff) AM_RAM  /* not used, but initialized */
222   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&colorram)
223   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)
250224   AM_RANGE(0xa001, 0xa001) AM_WRITE(cannonb_flip_screen_w)
251225   AM_RANGE(0xa004, 0xa004) AM_WRITE(cclimber_sample_trigger_w)
252   AM_RANGE(0xa800, 0xa800) AM_WRITE(cclimber_sample_rate_w)
253   AM_RANGE(0xb000, 0xb000) AM_WRITE(cclimber_sample_volume_w)
226   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, cclimber_sample_rate_w)
227   AM_RANGE(0xb000, 0xb000) AM_READWRITE(input_port_2_r, cclimber_sample_volume_w)
228   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)     /* IN2 */
254229ADDRESS_MAP_END
255230
256static ADDRESS_MAP_START( swimmer_readmem, ADDRESS_SPACE_PROGRAM, 8 )
257   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
258   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
259   AM_RANGE(0x9000, 0x93ff) AM_READ(MRA8_RAM)
260   AM_RANGE(0x9400, 0x97ff) AM_READ(videoram_r) /* mirror address (used by Swimmer) */
261   AM_RANGE(0x9c00, 0x9fff) AM_READ(MRA8_RAM)
262   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
263   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
264   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
265   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_3_r)
266   AM_RANGE(0xb880, 0xb880) AM_READ(input_port_4_r)
267   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)    /* ??? used by Guzzler */
268   AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_ROM)    /* Guzzler only */
269ADDRESS_MAP_END
270231
271static ADDRESS_MAP_START( swimmer_writemem, ADDRESS_SPACE_PROGRAM, 8 )
272   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
273   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
274   AM_RANGE(0x8800, 0x88ff) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
275   AM_RANGE(0x8900, 0x89ff) AM_WRITE(cclimber_bigsprite_videoram_w)      /* mirror for the above (Guzzler writes to both) */
276   AM_RANGE(0x9000, 0x93ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
277   AM_RANGE(0x9400, 0x97ff) AM_WRITE(videoram_w) /* mirror address (used by Guzzler) */
232static ADDRESS_MAP_START( swimmer_map, ADDRESS_SPACE_PROGRAM, 8 )
233   AM_RANGE(0x0000, 0x7fff) AM_ROM
234   AM_RANGE(0x8000, 0x87ff) AM_RAM
235   AM_RANGE(0x8800, 0x88ff) AM_MIRROR(0x0100) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
236   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
278237   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_column_scroll)
279238   AM_RANGE(0x9880, 0x989f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
280239   AM_RANGE(0x98fc, 0x98ff) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_bigspriteram)
281   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(cclimber_colorram_w) AM_BASE(&colorram)
282   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w)
240   AM_RANGE(0x9c00, 0x9fff) AM_READWRITE(MRA8_RAM, cclimber_colorram_w) AM_BASE(&colorram)
241   AM_RANGE(0xa000, 0xa000) AM_READWRITE(input_port_0_r, interrupt_enable_w)
283242   AM_RANGE(0xa001, 0xa001) AM_WRITE(flip_screen_x_w)
284243   AM_RANGE(0xa002, 0xa002) AM_WRITE(flip_screen_y_w)
285244   AM_RANGE(0xa003, 0xa003) AM_WRITE(swimmer_sidepanel_enable_w)
286245   AM_RANGE(0xa004, 0xa004) AM_WRITE(swimmer_palettebank_w)
287   AM_RANGE(0xa800, 0xa800) AM_WRITE(swimmer_sh_soundlatch_w)
288   AM_RANGE(0xb800, 0xb800) AM_WRITE(swimmer_bgcolor_w)  /* river color in Swimmer */
289   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)    /* ??? used by Guzzler */
290   AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_ROM)    /* Guzzler only */
246   AM_RANGE(0xa800, 0xa800) AM_READWRITE(input_port_1_r, swimmer_sh_soundlatch_w)
247   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
248   AM_RANGE(0xb800, 0xb800) AM_READWRITE(input_port_3_r, swimmer_bgcolor_w)  /* river color in Swimmer */
249   AM_RANGE(0xb880, 0xb880) AM_READ(input_port_4_r)
250   AM_RANGE(0xc000, 0xc7ff) AM_RAM               /* ??? used by Guzzler */
251   AM_RANGE(0xe000, 0xffff) AM_ROM               /* Guzzler only */
291252ADDRESS_MAP_END
292253
293static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
294   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
295   AM_RANGE(0x0c, 0x0c) AM_READ(AY8910_read_port_0_r)
296ADDRESS_MAP_END
297254
298static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
255static ADDRESS_MAP_START( cclimber_portmap, ADDRESS_SPACE_IO, 8 )
299256   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
300257   AM_RANGE(0x08, 0x08) AM_WRITE(AY8910_control_port_0_w)
301258   AM_RANGE(0x09, 0x09) AM_WRITE(AY8910_write_port_0_w)
259   AM_RANGE(0x0c, 0x0c) AM_READ(AY8910_read_port_0_r)
302260ADDRESS_MAP_END
303261
304static ADDRESS_MAP_START( swimmer_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
305   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_ROM)
306   AM_RANGE(0x2000, 0x23ff) AM_READ(MRA8_RAM)
262
263static ADDRESS_MAP_START( swimmer_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
264   AM_RANGE(0x0000, 0x0fff) AM_ROM
265   AM_RANGE(0x2000, 0x23ff) AM_RAM
307266   AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)
308   AM_RANGE(0x4000, 0x4001) AM_READ(MRA8_RAM)    /* ??? */
267   AM_RANGE(0x4000, 0x4001) AM_RAM            /* ??? */
309268ADDRESS_MAP_END
310269
311static ADDRESS_MAP_START( swimmer_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
312   AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_ROM)
313   AM_RANGE(0x2000, 0x23ff) AM_WRITE(MWA8_RAM)
314   AM_RANGE(0x4000, 0x4000) AM_WRITE(MWA8_RAM)    /* ??? */
315ADDRESS_MAP_END
316
317static ADDRESS_MAP_START( swimmer_sound_writeport, ADDRESS_SPACE_IO, 8 )
270static ADDRESS_MAP_START( swimmer_sound_portmap, ADDRESS_SPACE_IO, 8 )
318271   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
319272   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_write_port_0_w)
320273   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_control_port_0_w)
r1527r1528
829782static MACHINE_DRIVER_START( cclimber )
830783
831784   /* basic machine hardware */
832   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz */
833   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
834   MDRV_CPU_IO_MAP(readport,writeport)
785   MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/3/2)   /* 3.072 MHz */
786   MDRV_CPU_PROGRAM_MAP(cclimber_map,0)
787   MDRV_CPU_IO_MAP(cclimber_portmap,0)
835788   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
836789
837790   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
854807   /* sound hardware */
855808   MDRV_SPEAKER_STANDARD_MONO("mono")
856809
857   MDRV_SOUND_ADD(AY8910, 1536000)
810   MDRV_SOUND_ADD(AY8910, MASTER_CLOCK/3/2/2)
858811   MDRV_SOUND_CONFIG(cclimber_ay8910_interface)
859812   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
860813
r1527r1528
863816   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
864817MACHINE_DRIVER_END
865818
866/* copy of cclimber except for readmem, writemem and video update */
819
867820static MACHINE_DRIVER_START( cannonb )
868821
822   MDRV_IMPORT_FROM(cclimber)
823
869824   /* basic machine hardware */
870   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz */
871   MDRV_CPU_PROGRAM_MAP(cannonb_readmem,cannonb_writemem)
872   MDRV_CPU_IO_MAP(readport,writeport)
873   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
825   MDRV_CPU_MODIFY("main")
826   MDRV_CPU_PROGRAM_MAP(cannonb_map,0)
874827
875   MDRV_SCREEN_REFRESH_RATE(60)
876   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
877   MDRV_MACHINE_RESET(cclimber)
878
879828   /* video hardware */
880   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
881   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
882   MDRV_SCREEN_SIZE(32*8, 32*8)
883   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
884   MDRV_GFXDECODE(cclimber)
885   MDRV_PALETTE_LENGTH(96)
886   MDRV_COLORTABLE_LENGTH(16*4+8*4)
887
888   MDRV_PALETTE_INIT(cclimber)
889   MDRV_VIDEO_START(generic)
890829   MDRV_VIDEO_UPDATE(cannonb)
891
892   /* sound hardware */
893   MDRV_SPEAKER_STANDARD_MONO("mono")
894
895   MDRV_SOUND_ADD(AY8910, 1536000)
896   MDRV_SOUND_CONFIG(cclimber_ay8910_interface)
897   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
898
899   MDRV_SOUND_ADD(SAMPLES, 0)
900   MDRV_SOUND_CONFIG(cclimber_samples_interface)
901   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
902830MACHINE_DRIVER_END
903831
832
904833static MACHINE_DRIVER_START( swimmer )
905834
906835   /* basic machine hardware */
907836   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz */
908   MDRV_CPU_PROGRAM_MAP(swimmer_readmem,swimmer_writemem)
837   MDRV_CPU_PROGRAM_MAP(swimmer_map,0)
909838   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
910839
911840   MDRV_CPU_ADD(Z80,4000000/2)
912   /* audio CPU */   /* 2 MHz */
913   MDRV_CPU_PROGRAM_MAP(swimmer_sound_readmem,swimmer_sound_writemem)
914   MDRV_CPU_IO_MAP(0,swimmer_sound_writeport)
841   MDRV_CPU_PROGRAM_MAP(swimmer_sound_map,0)
842   MDRV_CPU_IO_MAP(swimmer_sound_portmap,0)
915843   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, (double)4000000/16384) /* IRQs are triggered by the main CPU */
916844
917845   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/enigma2.c
r1527r1528
376376}
377377
378378
379static UINT32 p1_controls_r(void *param)
379static CUSTOM_INPUT( p1_controls_r )
380380{
381381   return readinputportbytag("P1CONTROLS");
382382}
383383
384384
385static UINT32 p2_controls_r(void *param)
385static CUSTOM_INPUT( p2_controls_r )
386386{
387387   if (engima2_flip_screen)
388388      return readinputportbytag("P2CONTROLS");
src/mame/drivers/namcona1.c
r1527r1528
646646 */
647647static void write_version_info( void )
648648{
649   const UINT16 source[0x8] =
649   static const UINT16 source[0x8] =
650650   { /* "NSA-BIOS ver"... */
651651      0x534e,0x2d41,0x4942,0x534f,0x7620,0x7265,0x2e31,0x3133
652652   };
r1527r1528
778778      if( offset==4 ) keyseq = 0;
779779      if( offset==3 )
780780      {
781         const UINT16 data[] =
781         static const UINT16 data[] =
782782         {
783783            0x0000,0x2000,0x2100,0x2104,0x0106,0x0007,0x4003,0x6021,
784784            0x61a0,0x31a4,0x9186,0x9047,0xc443,0x6471,0x6db0,0x39bc,
src/mame/drivers/acefruit.c
r1527r1528
8484         {
8585            int y;
8686            int x;
87            int spriteskip[] = { 1, 2, 4 };
87            static const int spriteskip[] = { 1, 2, 4 };
8888            int spritesize = spriteskip[ color - 5 ];
8989            const gfx_element *gfx = machine->gfx[ 0 ];
9090
r1527r1528
139139   return 0;
140140}
141141
142static UINT32 sidewndr_payout_r(void *param)
142static CUSTOM_INPUT( sidewndr_payout_r )
143143{
144144   int bit_mask = (FPTR)param;
145145
r1527r1528
155155   }
156156}
157157
158static UINT32 starspnr_coinage_r(void *param)
158static CUSTOM_INPUT( starspnr_coinage_r )
159159{
160160   int bit_mask = (FPTR)param;
161161
r1527r1528
175175   }
176176}
177177
178static UINT32 starspnr_payout_r(void *param)
178static CUSTOM_INPUT( starspnr_payout_r )
179179{
180180   int bit_mask = (FPTR)param;
181181
src/mame/drivers/sprint4.c
r1527r1528
3333static int gear[4];
3434
3535
36static UINT32 get_lever(void* param)
36static CUSTOM_INPUT( get_lever )
3737{
3838   int n = (FPTR) param;
3939
r1527r1528
4141}
4242
4343
44static UINT32 get_wheel(void* param)
44static CUSTOM_INPUT( get_wheel )
4545{
4646   int n = (FPTR) param;
4747
r1527r1528
4949}
5050
5151
52static UINT32 get_collision(void *param)
52static CUSTOM_INPUT( get_collision )
5353{
5454   int n = (FPTR) param;
5555
src/mame/drivers/kaneko16.c
r1527r1528
18321832static MACHINE_DRIVER_START( bakubrkr )
18331833
18341834   /* basic machine hardware */
1835   MDRV_CPU_ADD(M68000, 12000000)   /* TMP68HC000-12 */
1835   MDRV_CPU_ADD(M68000, XTAL_12MHz) /* verified on pcb */
18361836   MDRV_CPU_PROGRAM_MAP(bakubrkr,0)
18371837   MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM)
18381838
r1527r1528
18561856   /* sound hardware */
18571857   MDRV_SPEAKER_STANDARD_MONO("mono")
18581858
1859   MDRV_SOUND_ADD(AY8910, 2000000)
1859   MDRV_SOUND_ADD(AY8910, XTAL_12MHz/6) /* verified on pcb */
18601860   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
18611861
1862   MDRV_SOUND_ADD(AY8910, 2000000)
1862   MDRV_SOUND_ADD(AY8910, XTAL_12MHz/6) /* verified on pcb */
18631863   MDRV_SOUND_CONFIG(ay8910_intf_eeprom)
18641864   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
18651865
1866   MDRV_SOUND_ADD(OKIM6295, 12000000/6)
1867   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
1866   MDRV_SOUND_ADD(OKIM6295, XTAL_12MHz/6) /* verified on pcb */
1867   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */
18681868   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
18691869MACHINE_DRIVER_END
18701870
r1527r1528
20272027static MACHINE_DRIVER_START( mgcrystl )
20282028
20292029   /* basic machine hardware */
2030   MDRV_CPU_ADD(M68000, 12000000)
2030   MDRV_CPU_ADD(M68000, XTAL_12MHz) /* verified on pcb */
20312031   MDRV_CPU_PROGRAM_MAP(mgcrystl,0)
20322032   MDRV_CPU_VBLANK_INT(kaneko16_interrupt,KANEKO16_INTERRUPTS_NUM)
20332033
r1527r1528
20512051   /* sound hardware */
20522052   MDRV_SPEAKER_STANDARD_MONO("mono")
20532053
2054   MDRV_SOUND_ADD(AY8910, 2000000)
2054   MDRV_SOUND_ADD(AY8910, XTAL_12MHz/6) /* verified on pcb */
20552055   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
20562056
2057   MDRV_SOUND_ADD(AY8910, 2000000)
2057   MDRV_SOUND_ADD(AY8910, XTAL_12MHz/6) /* verified on pcb */
20582058   MDRV_SOUND_CONFIG(ay8910_intf_eeprom)
20592059   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
20602060
2061   MDRV_SOUND_ADD(OKIM6295, 12000000/4)
2062   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low)
2061   MDRV_SOUND_ADD(OKIM6295, XTAL_12MHz/6) /* verified on pcb */
2062   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */
20632063   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
20642064MACHINE_DRIVER_END
20652065
src/mame/drivers/goldstar.c
r1527r1528
1616extern size_t goldstar_video_size;
1717extern UINT8 *goldstar_scroll1, *goldstar_scroll2, *goldstar_scroll3;
1818
19WRITE8_HANDLER( goldstar_video1_w );
20WRITE8_HANDLER( goldstar_video2_w );
21WRITE8_HANDLER( goldstar_video3_w );
2219WRITE8_HANDLER( goldstar_fa00_w );
2320VIDEO_START( goldstar );
2421VIDEO_UPDATE( goldstar );
r1527r1528
5956static ADDRESS_MAP_START( map, ADDRESS_SPACE_PROGRAM, 8 )
6057   AM_RANGE(0x0000, 0xb7ff) AM_ROM
6158   AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size)
62   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_ROM)
63   AM_RANGE(0xc800, 0xd9ff) AM_READ(MRA8_RAM)
64   AM_RANGE(0xc800, 0xcfff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
65   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(colorram_w) AM_BASE(&colorram)
66   AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(MRA8_RAM,goldstar_video2_w) AM_BASE(&goldstar_video2)
67   AM_RANGE(0xd800, 0xd9ff) AM_READWRITE(MRA8_RAM,goldstar_video1_w) AM_BASE(&goldstar_video1) AM_SIZE(&goldstar_video_size)
68   AM_RANGE(0xe800, 0xe9ff) AM_WRITE(goldstar_video3_w) AM_BASE(&goldstar_video3)
59   AM_RANGE(0xc000, 0xc7ff) AM_ROM
60   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
61   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&colorram)
62   AM_RANGE(0xd800, 0xd9ff) AM_RAM AM_BASE(&goldstar_video1) AM_SIZE(&goldstar_video_size)
63   AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_BASE(&goldstar_video2)
64   AM_RANGE(0xe800, 0xe9ff) AM_WRITE(MWA8_RAM) AM_BASE(&goldstar_video3)
6965   AM_RANGE(0xf040, 0xf07f) AM_WRITE(MWA8_RAM) AM_BASE(&goldstar_scroll1)
7066   AM_RANGE(0xf800, 0xf800) AM_READ(input_port_0_r)
7167   AM_RANGE(0xf801, 0xf801) AM_READ(input_port_1_r)   /* Test Mode */
src/mame/drivers/namcos10.c
r1527r1528
377377
378378static MACHINE_DRIVER_START( namcos10 )
379379   /* basic machine hardware */
380   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
380   MDRV_CPU_ADD( PSXCPU, XTAL_101_4912MHz )
381381   MDRV_CPU_PROGRAM_MAP( namcos10_map, 0 )
382382   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
383383
src/mame/drivers/limenko.c
r1527r1528
802802   ROM_LOAD( "sou_rom1",     0x000000, 0x40000, CRC(5791195b) SHA1(de0df8f89f395cbf3508b01aeea05675e110ad04) )
803803ROM_END
804804
805static int irq_active(void)
806{
807   UINT32 FCR = activecpu_get_reg(27);
808   if( !(FCR&(1<<28)) ) // int 1 (irq 5)
809      return 1;
810   else
811      return 0;
812}
813805
806
814807static READ32_HANDLER( dynabomb_speedup_r )
815808{
816809   if(activecpu_get_pc() == 0xc25b8)
817810   {
818      if(irq_active())
819         cpu_spinuntil_int();
820      else
821         activecpu_eat_cycles(50);
811      activecpu_eat_cycles(50);
822812   }
823813
824814   return mainram[0xe2784/4];
r1527r1528
828818{
829819   if(activecpu_get_pc() == 0x23e32)
830820   {
831      if(irq_active())
832         cpu_spinuntil_int();
833      else
834         activecpu_eat_cycles(50);
821      activecpu_eat_cycles(50);
835822   }
836823
837824   return mainram[0x32ab0/4];
r1527r1528
841828{
842829   if(activecpu_get_pc() == 0x26da4)
843830   {
844      if(irq_active())
845         cpu_spinuntil_int();
846      else
847         activecpu_eat_cycles(50);
831      activecpu_eat_cycles(50);
848832   }
849833
850834   return mainram[0x135800/4];
r1527r1528
854838{
855839   if(activecpu_get_pc() == 0x8560)
856840   {
857      if(irq_active())
858         cpu_spinuntil_int();
859      else
860         activecpu_eat_cycles(50);
841      activecpu_eat_cycles(50);
861842   }
862843
863844   return mainram[0x6626c/4];
src/mame/drivers/redalert.c
r1527r1528
6262   AM_RANGE(0x0200, 0x0fff) AM_WRITE(MWA8_RAM) /* ? */
6363   AM_RANGE(0x1000, 0x1fff) AM_WRITE(MWA8_RAM) /* Scratchpad video RAM */
6464   AM_RANGE(0x2000, 0x3fff) AM_WRITE(redalert_backram_w) AM_BASE(&redalert_backram)
65   AM_RANGE(0x4000, 0x43ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
65   AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
6666   AM_RANGE(0x4400, 0x47ff) AM_WRITE(redalert_spriteram1_w) AM_BASE(&redalert_spriteram1)
6767   AM_RANGE(0x4800, 0x4bff) AM_WRITE(redalert_characterram_w) AM_BASE(&redalert_characterram)
6868   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(redalert_spriteram2_w) AM_BASE(&redalert_spriteram2)
r1527r1528
123123   AM_RANGE(0x4400, 0x47ff) AM_WRITE(redalert_spriteram1_w) AM_BASE(&redalert_spriteram1)
124124   AM_RANGE(0x4800, 0x4bff) AM_WRITE(redalert_characterram2_w) AM_BASE(&redalert_characterram2)
125125   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(redalert_spriteram2_w) AM_BASE(&redalert_spriteram2)
126   AM_RANGE(0x5000, 0x53ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
126   AM_RANGE(0x5000, 0x53ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
127127   AM_RANGE(0x5400, 0x57ff) AM_WRITE(redalert_spriteram3_w) AM_BASE(&redalert_spriteram3)
128128   AM_RANGE(0x5800, 0x5bff) AM_WRITE(MWA8_RAM) //???
129129   AM_RANGE(0x5c00, 0x5fff) AM_WRITE(MWA8_RAM) //???
src/mame/drivers/mcr3.c
r1527r1528
8888#include "mcr.h"
8989
9090
91#define MASTER_CLOCK      XTAL_20MHz
9192
93
94
9295/*************************************
9396 *
9497 *  Local variables and tables
r1527r1528
10491052static MACHINE_DRIVER_START( mcr3_base )
10501053
10511054   /* basic machine hardware */
1052   MDRV_CPU_ADD_TAG("main", Z80, 5000000)
1055   MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/4)
10531056   MDRV_CPU_CONFIG(mcr_daisy_chain)
10541057   MDRV_CPU_VBLANK_INT(mcr_interrupt,2)
10551058
src/mame/drivers/pipeline.c
r1527r1528
346346
347347static MACHINE_RESET( pipeline )
348348{
349   ctc_intf.baseclock = machine->drv->cpu[0].clock;
349   ctc_intf.baseclock = cpunum_get_clock(0);
350350   z80ctc_init(0, &ctc_intf);
351351   ppi8255_init(&ppi8255_intf);
352352}
r1527r1528
363363   MDRV_CPU_PROGRAM_MAP(cpu1_mem, 0)
364364   MDRV_CPU_IO_MAP(sound_port, 0)
365365
366   MDRV_CPU_ADD(M68705, 7372800/2/M68705_CLOCK_DIVIDER)
366   MDRV_CPU_ADD(M68705, 7372800/2)
367367   MDRV_CPU_PROGRAM_MAP(mcu_mem, 0)
368368
369369   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/stadhero.c
r1527r1528
177177   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
178178   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
179179   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
180   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
180   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
181181   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
182182   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
183183   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
src/mame/drivers/simpsons.c
r1527r1528
276276static MACHINE_DRIVER_START( simpsons )
277277
278278   /* basic machine hardware */
279   MDRV_CPU_ADD(KONAMI, 3000000) /* ? */
279   MDRV_CPU_ADD(KONAMI, XTAL_24MHz/2/4) /* pin 18 of konami cpu is 12Mhz, while pin 17 is 3mhz. Clock probably divided internally by 4 */
280280   MDRV_CPU_PROGRAM_MAP(main_map,0)
281281   MDRV_CPU_VBLANK_INT(simpsons_irq,1)   /* IRQ triggered by the 052109, FIRQ by the sprite hardware */
282282
283   MDRV_CPU_ADD(Z80, 3579545)   /* Reznor007 verified with schematics + PCB trace */
284   /* audio CPU */
283   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)   /* verified on pcb */
285284   MDRV_CPU_PROGRAM_MAP(z80_map,0)
286285                        /* NMIs are generated by the 053260 */
287286   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
303302   /* sound hardware */
304303   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
305304
306   MDRV_SOUND_ADD(YM2151, 3579545)
305   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz) /* verified on pcb */
307306   MDRV_SOUND_ROUTE(0, "left", 1.0)   /* only left channel is connected */
308307   MDRV_SOUND_ROUTE(0, "right", 1.0)
309308   MDRV_SOUND_ROUTE(1, "left", 0.0)
310309   MDRV_SOUND_ROUTE(1, "right", 0.0)
311310
312   MDRV_SOUND_ADD(K053260, 3579545) /* measured on real pcb */
311   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz) /* verified on pcb */
313312   MDRV_SOUND_CONFIG(k053260_interface)
314313   MDRV_SOUND_ROUTE(0, "left", 0.75)
315314   MDRV_SOUND_ROUTE(1, "right", 0.75)
src/mame/drivers/paranoia.c
r1527r1528
8484   }
8585}
8686
87ADDRESS_MAP_START(paranoia_8085_map, ADDRESS_SPACE_PROGRAM, 8)
87static ADDRESS_MAP_START(paranoia_8085_map, ADDRESS_SPACE_PROGRAM, 8)
8888   AM_RANGE( 0x0000, 0x7fff) AM_ROM
8989   AM_RANGE( 0x8000, 0x80ff) AM_RAM
9090   AM_RANGE( 0x8100, 0x8105) AM_WRITE( paranoia_8085_8155_w )
r1527r1528
9292   AM_RANGE( 0xe000, 0xe1ff) AM_RAM
9393ADDRESS_MAP_END
9494
95ADDRESS_MAP_START(paranoia_8085_io_map, ADDRESS_SPACE_IO, 8)
95static ADDRESS_MAP_START(paranoia_8085_io_map, ADDRESS_SPACE_IO, 8)
9696ADDRESS_MAP_END
9797
98ADDRESS_MAP_START(paranoia_z80_map, ADDRESS_SPACE_PROGRAM, 8)
98static ADDRESS_MAP_START(paranoia_z80_map, ADDRESS_SPACE_PROGRAM, 8)
9999   AM_RANGE( 0x0000, 0x3fff) AM_ROM
100100   AM_RANGE( 0x6000, 0x67ff) AM_RAM
101101   AM_RANGE( 0x7000, 0x73ff) AM_RAM
r1527r1528
119119{
120120}
121121
122ADDRESS_MAP_START(paranoia_z80_io_map, ADDRESS_SPACE_IO, 8)
122static ADDRESS_MAP_START(paranoia_z80_io_map, ADDRESS_SPACE_IO, 8)
123123   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
124124   AM_RANGE( 0x01, 0x01 ) AM_READ( paranoia_z80_io_01_r )
125125   AM_RANGE( 0x02, 0x02 ) AM_READ( paranoia_z80_io_02_r )
src/mame/drivers/mw8080bw.c
r1527r1528
317317}
318318
319319
320static UINT32 seawolf_erase_input_r(void *param)
320static CUSTOM_INPUT( seawolf_erase_input_r )
321321{
322322   return readinputportbytag(SEAWOLF_ERASE_SW_PORT_TAG) &
323323         readinputportbytag(SEAWOLF_ERASE_DIP_PORT_TAG);
r1527r1528
548548}
549549
550550
551static UINT32 tornbase_hit_left_input_r(void *param)
551static CUSTOM_INPUT( tornbase_hit_left_input_r )
552552{
553553   return readinputportbytag(TORNBASE_L_HIT_PORT_TAG);
554554}
555555
556556
557static UINT32 tornbase_hit_right_input_r(void *param)
557static CUSTOM_INPUT( tornbase_hit_right_input_r )
558558{
559559   UINT32 ret;
560560
r1527r1528
575575}
576576
577577
578static UINT32 tornbase_pitch_left_input_r(void *param)
578static CUSTOM_INPUT( tornbase_pitch_left_input_r )
579579{
580580   UINT32 ret;
581581
r1527r1528
596596}
597597
598598
599static UINT32 tornbase_pitch_right_input_r(void *param)
599static CUSTOM_INPUT( tornbase_pitch_right_input_r )
600600{
601601   return readinputportbytag(TORNBASE_L_PITCH_PORT_TAG);
602602}
603603
604604
605static UINT32 tornbase_score_input_r(void *param)
605static CUSTOM_INPUT( tornbase_score_input_r )
606606{
607607   return readinputportbytag(TORNBASE_SCORE_SW_PORT_TAG) &
608608         readinputportbytag(TORNBASE_SCORE_DIP_PORT_TAG);
r1527r1528
11771177}
11781178
11791179
1180static UINT32 desertgu_gun_input_r(void *param)
1180static CUSTOM_INPUT( desertgu_gun_input_r )
11811181{
11821182   UINT32 ret;
11831183
r1527r1528
11901190}
11911191
11921192
1193static UINT32 desertgu_dip_sw_0_1_r(void *param)
1193static CUSTOM_INPUT( desertgu_dip_sw_0_1_r )
11941194{
11951195   UINT32 ret;
11961196
r1527r1528
13041304#define DPLAY_CAB_TYPE_COCKTAIL      (1)
13051305
13061306
1307static UINT32 dplay_pitch_left_input_r(void *param)
1307static CUSTOM_INPUT( dplay_pitch_left_input_r )
13081308{
13091309   UINT32 ret;
13101310
r1527r1528
13171317}
13181318
13191319
1320static UINT32 dplay_pitch_right_input_r(void *param)
1320static CUSTOM_INPUT( dplay_pitch_right_input_r )
13211321{
13221322   return readinputportbytag(DPLAY_L_PITCH_PORT_TAG);
13231323}
r1527r1528
16921692}
16931693
16941694
1695static UINT32 clowns_controller_r(void *param)
1695static CUSTOM_INPUT( clowns_controller_r )
16961696{
16971697   UINT32 ret;
16981698
r1527r1528
24792479}
24802480
24812481
2482static UINT32 invaders_coin_input_r(void *param)
2482static CUSTOM_INPUT( invaders_coin_input_r )
24832483{
24842484   UINT32 ret = readinputportbytag(INVADERS_COIN_INPUT_PORT_TAG);
24852485
r1527r1528
24892489}
24902490
24912491
2492static UINT32 invaders_sw6_sw7_r(void *param)
2492static CUSTOM_INPUT( invaders_sw6_sw7_r )
24932493{
24942494   UINT32 ret;
24952495
r1527r1528
25052505}
25062506
25072507
2508static UINT32 invaders_sw5_r(void *param)
2508static CUSTOM_INPUT( invaders_sw5_r )
25092509{
25102510   UINT32 ret;
25112511
r1527r1528
25212521}
25222522
25232523
2524static UINT32 invaders_in0_control_r(void *param)
2524static CUSTOM_INPUT( invaders_in0_control_r )
25252525{
25262526   UINT32 ret;
25272527
r1527r1528
25372537}
25382538
25392539
2540UINT32 invaders_in2_control_r(void *param)
2540CUSTOM_INPUT( invaders_in2_control_r )
25412541{
25422542   UINT32 ret;
25432543
r1527r1528
26792679#define BLUESHRK_COIN_INPUT_PORT_TAG   ("COIN")
26802680
26812681
2682static UINT32 blueshrk_coin_input_r(void *param)
2682static CUSTOM_INPUT( blueshrk_coin_input_r )
26832683{
26842684   UINT32 ret = readinputportbytag(BLUESHRK_COIN_INPUT_PORT_TAG);
26852685
r1527r1528
29272927   ROM_LOAD( "9316.1h",    0x0000, 0x0800, CRC(c0030d7c) SHA1(4d0a3a59d4f8181c6e30966a6b1d19ba5b29c398) )
29282928   ROM_LOAD( "9316.1g",    0x0800, 0x0800, CRC(1ddde10b) SHA1(8fb8e85844a8ec6c0722883013ecdd4eeaeb08c1) )
29292929   ROM_LOAD( "9316.1f",    0x1000, 0x0800, CRC(808e46f1) SHA1(1cc4e9b0aa7e9546c133bd40d40ede6f2fbe93ba) )
2930   ROM_LOAD( "9316.1e",    0x1800, 0x0800, BAD_DUMP CRC(d5adff14) SHA1(39e5bf5b9846073d2e909542e394244b8c31dc5a) )
2930   ROM_LOAD( "9316.1e",    0x1800, 0x0800, CRC(db5996a5) SHA1(cbc784e3ff9c7ad4954f3af8bfd786d3d17d1e0c) )
29312931ROM_END
29322932
29332933
r1527r1528
30983098/* 612 */ GAME( 1977, boothill, 0,        boothill, boothill, 0, ROT0,   "Midway", "Boot Hill" , GAME_SUPPORTS_SAVE  )
30993099/* 615 */ GAME( 1977, checkmat, 0,        checkmat, checkmat, 0, ROT0,   "Midway", "Checkmate", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE  )
31003100/* 618 */ GAME( 1977, desertgu, 0,        desertgu, desertgu, 0, ROT0,   "Midway", "Desert Gun", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE  )
3101/* 618 */ GAME( 1977, roadrunm, desertgu, desertgu, desertgu, 0, ROT0,   "Midway", "Road Runner (Midway)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
3101/* 618 */ GAME( 1977, roadrunm, desertgu, desertgu, desertgu, 0, ROT0,   "Midway", "Road Runner (Midway)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
31023102/* 619 */ GAME( 1977, dplay,    0,        dplay,    dplay,    0, ROT0,   "Midway", "Double Play", GAME_SUPPORTS_SAVE  )
31033103/* 622 */ GAME( 1977, lagunar,  0,        zzzap,    lagunar,  0, ROT90,  "Midway", "Laguna Racer", GAME_NO_SOUND | GAME_SUPPORTS_SAVE  )
31043104/* 623 */ GAME( 1977, gmissile, 0,        gmissile, gmissile, 0, ROT0,   "Taito / Midway", "Missile X / Guided Missile", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE  )
src/mame/drivers/wiz.c
r1527r1528
168168extern UINT8 *wiz_sprite_bank;
169169
170170WRITE8_HANDLER( wiz_char_bank_select_w );
171WRITE8_HANDLER( wiz_attributes_w );
172171WRITE8_HANDLER( wiz_palettebank_w );
173172WRITE8_HANDLER( wiz_bgcolor_w );
174173WRITE8_HANDLER( wiz_flipx_w );
r1527r1528
246245   AM_RANGE(0xd400, 0xd7ff) AM_WRITE(MWA8_RAM) AM_BASE(&wiz_colorram2)
247246   AM_RANGE(0xd800, 0xd83f) AM_WRITE(MWA8_RAM) AM_BASE(&wiz_attributesram2)
248247   AM_RANGE(0xd840, 0xd85f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2) AM_SIZE(&spriteram_size)
249   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
250   AM_RANGE(0xe400, 0xe7ff) AM_WRITE(colorram_w) AM_BASE(&colorram)
251   AM_RANGE(0xe800, 0xe83f) AM_WRITE(wiz_attributes_w) AM_BASE(&wiz_attributesram)
248   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
249   AM_RANGE(0xe400, 0xe7ff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
250   AM_RANGE(0xe800, 0xe83f) AM_WRITE(MWA8_RAM) AM_BASE(&wiz_attributesram)
252251   AM_RANGE(0xe840, 0xe85f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)
253252   AM_RANGE(0xf000, 0xf000) AM_WRITE(MWA8_RAM) AM_BASE(&wiz_sprite_bank)
254253   AM_RANGE(0xf001, 0xf001) AM_WRITE(interrupt_enable_w)
src/mame/drivers/gaelco3d.c
r1527r1528
358358static READ32_HANDLER( input_port_3_020_r ) { return readinputport(3) << 16; }
359359
360360
361static UINT32 analog_bit_r(void *param)
361static CUSTOM_INPUT( analog_bit_r )
362362{
363363   int which = (FPTR)param;
364364   return (analog_ports[which] >> 7) & 0x01;
r1527r1528
632632         /* calculate how long until we generate an interrupt */
633633
634634         /* period per each bit sent */
635         sample_period = attotime_mul(ATTOTIME_IN_HZ(Machine->drv->cpu[2].clock), 2 * (adsp_control_regs[S1_SCLKDIV_REG] + 1));
635         sample_period = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(2)), 2 * (adsp_control_regs[S1_SCLKDIV_REG] + 1));
636636
637637         /* now put it down to samples, so we know what the channel frequency has to be */
638638         sample_period = attotime_mul(sample_period, 16 * SOUND_CHANNELS);
src/mame/drivers/namcos11.c
r1527r1528
896896
897897static MACHINE_DRIVER_START( coh100 )
898898   /* basic machine hardware */
899   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
899   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
900900   MDRV_CPU_PROGRAM_MAP( namcos11_map, 0 )
901901   MDRV_CPU_VBLANK_INT( namcos11_vblank, 1 )
902902
src/mame/drivers/lethalj.c
r1527r1528
77    Games supported:
88        * Lethal Justice
99        * Egg Venture
10        * Ripper Ribit
11        * Chicken Farm
12        * Crazzy Clownz
1013
1114    Known bugs:
1215        * some DIP switches not understood
1316
14    Note:
15    Even though Egg Venture looks like it has a few extra scanlines at
16    the bottom, the video hardware is explicitly programmed to only
17    display 236 lines. Altering this will lead to bad flickering.
18
1917****************************************************************************
2018
2119         EU21     EU18     EU20   32.000MHz
r1527r1528
4644#include "driver.h"
4745#include "cpu/tms34010/tms34010.h"
4846#include "lethalj.h"
47#include "machine/ticket.h"
4948#include "sound/okim6295.h"
5049
51#define VIDEO_CLOCK         11289600
52#define VIDEO_CLOCK_LETHALJ   11059200
5350
51#define MASTER_CLOCK      XTAL_40MHz
52#define SOUND_CLOCK         XTAL_2MHz
5453
54#define VIDEO_CLOCK         XTAL_11_289MHz
55#define VIDEO_CLOCK_LETHALJ   XTAL_11_0592MHz
5556
57
58
5659/*************************************
5760 *
61 *  Custom inputs
62 *
63 *************************************/
64
65static CUSTOM_INPUT( ticket_status )
66{
67   return ticket_dispenser_0_r(0) >> 7;
68}
69
70
71static CUSTOM_INPUT( cclownz_paddle )
72{
73   int value = readinputportbytag("PADDLE");
74   return ((value << 4) & 0xf00) | (value & 0x00f);
75}
76
77
78
79/*************************************
80 *
81 *  Output controls
82 *
83 *************************************/
84
85static WRITE16_HANDLER( ripribit_control_w )
86{
87   coin_counter_w(0, data & 1);
88   ticket_dispenser_0_w(0, ((data >> 1) & 1) << 7);
89   output_set_lamp_value(0, (data >> 2) & 1);
90}
91
92
93static WRITE16_HANDLER( cfarm_control_w )
94{
95   ticket_dispenser_0_w(0, ((data >> 0) & 1) << 7);
96   output_set_lamp_value(0, (data >> 2) & 1);
97   output_set_lamp_value(1, (data >> 3) & 1);
98   output_set_lamp_value(2, (data >> 4) & 1);
99   coin_counter_w(0, (data >> 7) & 1);
100}
101
102
103static WRITE16_HANDLER( cclownz_control_w )
104{
105   ticket_dispenser_0_w(0, ((data >> 0) & 1) << 7);
106   output_set_lamp_value(0, (data >> 2) & 1);
107   output_set_lamp_value(1, (data >> 4) & 1);
108   output_set_lamp_value(2, (data >> 5) & 1);
109   coin_counter_w(0, (data >> 6) & 1);
110}
111
112
113
114/*************************************
115 *
58116 *  Memory maps
59117 *
60118 *************************************/
r1527r1528
64122   AM_RANGE(0x04000000, 0x0400000f) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w)
65123   AM_RANGE(0x04000010, 0x0400001f) AM_READWRITE(OKIM6295_status_1_lsb_r, OKIM6295_data_1_lsb_w)
66124   AM_RANGE(0x04100000, 0x0410000f) AM_READWRITE(OKIM6295_status_2_lsb_r, OKIM6295_data_2_lsb_w)
67   AM_RANGE(0x04100010, 0x0410001f) AM_READNOP      /* read but never examined */
125//  AM_RANGE(0x04100010, 0x0410001f) AM_READNOP     /* read but never examined */
68126   AM_RANGE(0x04200000, 0x0420001f) AM_WRITENOP   /* clocks bits through here */
69127   AM_RANGE(0x04300000, 0x0430007f) AM_READ(lethalj_gun_r)
70128   AM_RANGE(0x04400000, 0x0440000f) AM_WRITENOP   /* clocks bits through here */
71129   AM_RANGE(0x04500010, 0x0450001f) AM_READ(input_port_0_word_r)
72130   AM_RANGE(0x04600000, 0x0460000f) AM_READ(input_port_1_word_r)
73   AM_RANGE(0x04700000, 0x047000ff) AM_WRITE(lethalj_blitter_w)
131   AM_RANGE(0x04700000, 0x0470007f) AM_WRITE(lethalj_blitter_w)
74132   AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE(tms34010_io_register_r, tms34010_io_register_w)
75133   AM_RANGE(0xc0000240, 0xc000025f) AM_WRITENOP   /* seems to be a bug in their code, one of many. */
76134   AM_RANGE(0xff800000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1, 0)
r1527r1528
252310INPUT_PORTS_END
253311
254312
255static INPUT_PORTS_START( laigames )
256   /* No Idea about the inputs */
313static INPUT_PORTS_START( ripribit )
257314   PORT_START
315   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
316   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
317   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ticket_status, NULL)
318   PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED )
319
320   PORT_START
258321   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 )
259   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
322   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_HIGH )
260323   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
261324   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
262325   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
263    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
264    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
265    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
266    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
267    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
268    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
269    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
270    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
271    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
272    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
273    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
274    PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
275    PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
276    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
277    PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
278    PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
279    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
280    PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
281    PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
282    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
283    PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
284    PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
285    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
286    PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
287    PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
288    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
289    PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
290    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
291    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
292    PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
293    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
294    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
295    PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
296    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
297    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
326   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
327   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
328   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
329   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
330   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
331   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ))
332   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ))
333   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ))
334   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
335   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ))
336   PORT_DIPNAME( 0x0700, 0x0200, "Starting Jackpot" )
337   PORT_DIPSETTING(      0x0000, "0" )
338   PORT_DIPSETTING(      0x0100, "5" )
339   PORT_DIPSETTING(      0x0200, "10" )
340   PORT_DIPSETTING(      0x0300, "15" )
341   PORT_DIPSETTING(      0x0400, "20" )
342   PORT_DIPSETTING(      0x0500, "25" )
343   PORT_DIPSETTING(      0x0600, "30" )
344   PORT_DIPSETTING(      0x0700, "35" )
345   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Unknown ) )
346   PORT_DIPSETTING(      0x0000, "0" )
347   PORT_DIPSETTING(      0x0800, "1" )
348   PORT_DIPSETTING(      0x1000, "2" )
349   PORT_DIPSETTING(      0x1800, "3" )
350   PORT_DIPNAME( 0xe000, 0x8000, "Points per Ticket" )
351   PORT_DIPSETTING(      0xe000, "200" )
352   PORT_DIPSETTING(      0xc000, "300" )
353   PORT_DIPSETTING(      0xa000, "400" )
354   PORT_DIPSETTING(      0x8000, "500" )
355   PORT_DIPSETTING(      0x6000, "600" )
356   PORT_DIPSETTING(      0x4000, "700" )
357   PORT_DIPSETTING(      0x2000, "800" )
358   PORT_DIPSETTING(      0x0000, "1000" )
298359
360   PORT_START            /* fake analog X */
361   PORT_START            /* fake analog Y */
362   PORT_START            /* fake analog X */
363   PORT_START            /* fake analog Y */
364INPUT_PORTS_END
365
366
367static INPUT_PORTS_START( cfarm )
299368   PORT_START
300    PORT_DIPNAME( 0x0001, 0x0001, "1" )
301    PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
302    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
303    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
304    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
305    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
306    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
307    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
308    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
309    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
310    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
311    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
369   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 )
370   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_HIGH )
371   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
372   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
312373    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
313374    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
314375    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
315376    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
316377    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
317378    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
318    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
319    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
320    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
321    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
322    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
323    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
324    PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
325    PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
326    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
327    PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
328    PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
329    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
330    PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
331    PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
332    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
333    PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
334    PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
335    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
336    PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
337    PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
338    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
339    PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
340    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
341    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
342    PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
343    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
344    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
345    PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
346    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
347    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
379   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ))
380   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ))
381   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ))
382   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
383   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ))
384    PORT_DIPNAME( 0x0700, 0x0300, "Starting Jackpot" )
385    PORT_DIPSETTING(      0x0000, "0" )
386    PORT_DIPSETTING(      0x0100, "5" )
387    PORT_DIPSETTING(      0x0200, "8" )
388    PORT_DIPSETTING(      0x0300, "10" )
389    PORT_DIPSETTING(      0x0400, "12" )
390    PORT_DIPSETTING(      0x0500, "15" )
391    PORT_DIPSETTING(      0x0600, "18" )
392    PORT_DIPSETTING(      0x0700, "20" )
393    PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Unknown ) )
394    PORT_DIPSETTING(      0x0000, "0" )
395    PORT_DIPSETTING(      0x0800, "1" )
396    PORT_DIPSETTING(      0x1000, "2" )
397    PORT_DIPSETTING(      0x1800, "3" )
398    PORT_DIPNAME( 0xe000, 0x8000, "Eggs per Ticket" )
399    PORT_DIPSETTING(      0xe000, "1" )
400    PORT_DIPSETTING(      0xc000, "2" )
401    PORT_DIPSETTING(      0xa000, "3" )
402    PORT_DIPSETTING(      0x8000, "4" )
403    PORT_DIPSETTING(      0x6000, "5" )
404    PORT_DIPSETTING(      0x4000, "6" )
405    PORT_DIPSETTING(      0x2000, "8" )
406    PORT_DIPSETTING(      0x0000, "10" )
348407
408   PORT_START
409   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ticket_status, NULL)
410   PORT_BIT( 0x0006, IP_ACTIVE_LOW, IPT_UNUSED )
411    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
412    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
413    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
414   PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED )
415
349416   PORT_START            /* fake analog X */
350   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
351
352417   PORT_START            /* fake analog Y */
353   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10)
354
355418   PORT_START            /* fake analog X */
356   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2)
357
358419   PORT_START            /* fake analog Y */
359   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(2)
360420INPUT_PORTS_END
361421
362422
363static INPUT_PORTS_START( ripribit )
364   /* No Idea about the inputs */
423static INPUT_PORTS_START( cclownz )
365424   PORT_START
366    PORT_DIPNAME( 0x0001, 0x0001, "0" )
367    PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
368    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
369    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
370    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
371    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
372    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
373    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
374    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
375    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
376    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
377    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
378    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
379    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
380    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
381    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
382    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
383    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
384    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
385    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
386    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
387    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
388    PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
389    PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
390    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
391    PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
392    PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
393    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
394    PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
395    PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
396    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
397    PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
398    PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
399    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
400    PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
401    PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
402    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
403    PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
404    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
405    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
406    PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
407    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
408    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
409    PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
410    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
411    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
412
413   PORT_START
414425   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 )
415   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN )
426   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_HIGH )
416427   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
417   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
418   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
428   PORT_BIT( 0x0018, IP_ACTIVE_LOW, IPT_UNUSED )
429    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
419430    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
420431    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
421432    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
422433    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
423434    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
424    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
425    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
426    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
427    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
428    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
429    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
430    PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) )
431    PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
432    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
433    PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
434    PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
435    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
436    PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
437    PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
438    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
439    PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
440    PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
441    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
442    PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
443    PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
444    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
445    PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
446    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
447    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
448    PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
449    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
450    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
451    PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
452    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
453    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
435   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ))
436   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ))
437   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ))
438   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
439   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ))
440    PORT_DIPNAME( 0x0700, 0x0700, "Starting Jackpot" )
441    PORT_DIPSETTING(      0x0000, "0" )
442    PORT_DIPSETTING(      0x0100, "2" )
443    PORT_DIPSETTING(      0x0200, "5" )
444    PORT_DIPSETTING(      0x0300, "8" )
445    PORT_DIPSETTING(      0x0400, "10" )
446    PORT_DIPSETTING(      0x0500, "15" )
447    PORT_DIPSETTING(      0x0600, "20" )
448    PORT_DIPSETTING(      0x0700, "30" )
449    PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Unknown ) )
450    PORT_DIPSETTING(      0x0000, "0" )
451    PORT_DIPSETTING(      0x0800, "1" )
452    PORT_DIPSETTING(      0x1000, "2" )
453    PORT_DIPSETTING(      0x1800, "3" )
454    PORT_DIPNAME( 0xe000, 0x8000, "Points per Ticket" )
455    PORT_DIPSETTING(      0xe000, "700" )
456    PORT_DIPSETTING(      0xc000, "900" )
457    PORT_DIPSETTING(      0xa000, "1200" )
458    PORT_DIPSETTING(      0x8000, "1500" )
459    PORT_DIPSETTING(      0x6000, "1800" )
460    PORT_DIPSETTING(      0x4000, "2100" )
461    PORT_DIPSETTING(      0x2000, "2400" )
462    PORT_DIPSETTING(      0x0000, "3000" )
454463
464   PORT_START
465   PORT_BIT( 0x0f0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cclownz_paddle, NULL)
466   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ticket_status, NULL)
467   PORT_BIT( 0x0060, IP_ACTIVE_LOW, IPT_UNUSED )
468    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
469   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
470
455471   PORT_START            /* fake analog X */
456
457472   PORT_START            /* fake analog Y */
458
459473   PORT_START            /* fake analog X */
474   PORT_START            /* fake analog Y */
460475
461   PORT_START            /* fake analog Y */
476   PORT_START_TAG("PADDLE")
477    PORT_BIT( 0x00ff, 0x0000, IPT_PADDLE ) PORT_PLAYER(1) PORT_SENSITIVITY(50) PORT_KEYDELTA(8) PORT_CENTERDELTA(0) PORT_REVERSE
462478INPUT_PORTS_END
463479
464480
r1527r1528
504520static MACHINE_DRIVER_START( gameroom )
505521
506522   /* basic machine hardware */
507   MDRV_CPU_ADD_TAG("main", TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
523   MDRV_CPU_ADD_TAG("main", TMS34010, MASTER_CLOCK)
508524   MDRV_CPU_CONFIG(tms_config)
509525   MDRV_CPU_PROGRAM_MAP(lethalj_map,0)
510526
511527   /* video hardware */
512   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
528   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
513529   MDRV_PALETTE_LENGTH(32768)
514530
515531   MDRV_SCREEN_ADD("main", 0)
r1527r1528
522538   /* sound hardware */
523539   MDRV_SPEAKER_STANDARD_MONO("mono")
524540
525   MDRV_SOUND_ADD(OKIM6295, 2000000)
541   MDRV_SOUND_ADD(OKIM6295, SOUND_CLOCK)
526542   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
527543   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
528544
529   MDRV_SOUND_ADD(OKIM6295, 2000000)
545   MDRV_SOUND_ADD(OKIM6295, SOUND_CLOCK)
530546   MDRV_SOUND_CONFIG(okim6295_interface_region_2_pin7high)
531547   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
532548
533   MDRV_SOUND_ADD(OKIM6295, 2000000)
549   MDRV_SOUND_ADD(OKIM6295, SOUND_CLOCK)
534550   MDRV_SOUND_CONFIG(okim6295_interface_region_3_pin7high)
535551   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
536552MACHINE_DRIVER_END
r1527r1528
654670ROM_END
655671
656672
657ROM_START( cclown )
673ROM_START( cclownz )
658674   ROM_REGION16_LE( 0x100000, REGION_USER1, 0 )      /* 34010 code */
659675   ROM_LOAD16_BYTE( "cc-v1-vc8.bin", 0x000000, 0x080000, CRC(433fe6ac) SHA1(dea7aede9882ee52be88927418b7395418757d12) )
660676   ROM_LOAD16_BYTE( "cc-v1-vc9.bin", 0x000001, 0x080000, CRC(9d1b3dae) SHA1(44a97c38bc9685e97721722c67505832fa06b44d) )
r1527r1528
685701   /* 25 / 26 are secure? */
686702ROM_END
687703
704
688705ROM_START( ripribit )
689706   ROM_REGION16_LE( 0x100000, REGION_USER1, 0 )      /* 34010 code */
690707   ROM_LOAD16_BYTE( "rr_v2-84-vc8.bin", 0x000000, 0x080000, CRC(5ecc432d) SHA1(073062528fbcf63be7e3c6695d60d048430f6e4b) )
r1527r1528
716733   /* 25 / 26 are secure? */
717734ROM_END
718735
736
719737ROM_START( cfarm )
720738   ROM_REGION16_LE( 0x100000, REGION_USER1, 0 )      /* 34010 code */
721739   ROM_LOAD16_BYTE( "cf-v2-vc8.bin", 0x000000, 0x080000, CRC(93bcf145) SHA1(134ac3ee4fd837f56fb0b338289cf03108346539) )
r1527r1528
751769
752770/*************************************
753771 *
772 *  Driver-specific initialization
773 *
774 *************************************/
775
776static DRIVER_INIT( ripribit )
777{
778   ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
779   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, ripribit_control_w);
780}
781
782
783static DRIVER_INIT( cfarm )
784{
785   ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
786   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cfarm_control_w);
787}
788
789
790static DRIVER_INIT( cclownz )
791{
792   ticket_dispenser_init(200, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH);
793   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x04100010, 0x0410001f, 0, 0, cclownz_control_w);
794}
795
796
797
798/*************************************
799 *
754800 *  Game drivers
755801 *
756802 *************************************/
757803
758GAME( 1996, lethalj,  0,        lethalj,  lethalj,  0, ROT0,  "The Game Room", "Lethal Justice", 0 )
759GAME( 1997, eggventr, 0,        gameroom, eggventr, 0, ROT0,  "The Game Room", "Egg Venture (Release 10)", 0 )
760GAME( 1997, eggvent7, eggventr, gameroom, eggventr, 0, ROT0,  "The Game Room", "Egg Venture (Release 7)", 0 )
761GAME( 1997, eggvntdx, eggventr, gameroom, eggvntdx, 0, ROT0,  "The Game Room", "Egg Venture Deluxe", 0 )
762GAME( 1997, ripribit, 0,        gameroom, ripribit, 0, ROT0,  "LAI Games",     "Ripper Ribbit (Version 2.8.4)", GAME_NOT_WORKING )
763GAME( 1999, cfarm,    0,        gameroom, laigames, 0, ROT90, "LAI Games",     "Chicken Farm (Version 2.0)", GAME_NOT_WORKING )
764GAME( 1999, cclown,   0,        gameroom, laigames, 0, ROT0,  "LAI Games",     "Crazzy Clownz (Version 1.0)", GAME_NOT_WORKING )
804GAME( 1996, lethalj,  0,        lethalj,  lethalj,  0,        ROT0,  "The Game Room", "Lethal Justice", 0 )
805GAME( 1997, eggventr, 0,        gameroom, eggventr, 0,        ROT0,  "The Game Room", "Egg Venture (Release 10)", 0 )
806GAME( 1997, eggvent7, eggventr, gameroom, eggventr, 0,        ROT0,  "The Game Room", "Egg Venture (Release 7)", 0 )
807GAME( 1997, eggvntdx, eggventr, gameroom, eggvntdx, 0,        ROT0,  "The Game Room", "Egg Venture Deluxe", 0 )
808GAME( 1997, ripribit, 0,        gameroom, ripribit, ripribit, ROT0,  "LAI Games",     "Ripper Ribbit (Version 2.8.4)", 0 )
809GAME( 1999, cfarm,    0,        gameroom, cfarm,    cfarm,    ROT90, "LAI Games",     "Chicken Farm (Version 2.0)", 0 )
810GAME( 1999, cclownz,  0,        gameroom, cclownz,  cclownz,  ROT0,  "LAI Games",     "Crazzy Clownz (Version 1.0)", 0 )
src/mame/drivers/dcon.c
r1527r1528
272272
273273/******************************************************************************/
274274
275/* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
276SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
277SEIBU_SOUND_SYSTEM_YM2151_HARDWARE
278
279275static MACHINE_DRIVER_START( dcon )
280276
281277   /* basic machine hardware */
src/mame/drivers/kickgoal.c
r1527r1528
668668   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
669669   MDRV_CPU_PERIODIC_INT(kickgoal_interrupt, 240)
670670
671   MDRV_CPU_ADD(PIC16C57, ((12000000/4)/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz ? */
671   MDRV_CPU_ADD(PIC16C57, 12000000/4)   /* 3MHz ? */
672672   MDRV_CPU_FLAGS(CPU_DISABLE)   /* Disables since the internal rom isn't dumped */
673673   /* Program and Data Maps are internal to the MCU */
674674   MDRV_CPU_IO_MAP(kickgoal_sound_io_map, 0)
r1527r1528
703703   MDRV_CPU_PROGRAM_MAP(kickgoal_program_map, 0)
704704   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
705705
706   MDRV_CPU_ADD(PIC16C57, ((12000000/4)/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz ? */
706   MDRV_CPU_ADD(PIC16C57, 12000000/4)   /* 3MHz ? */
707707   MDRV_CPU_FLAGS(CPU_DISABLE) /* Disables since the internal rom isn't dumped */
708708   /* Program and Data Maps are internal to the MCU */
709709   MDRV_CPU_IO_MAP(actionhw_io_map, 0)
src/mame/drivers/itech8.c
r1527r1528
463463#include "sound/2203intf.h"
464464#include "sound/3812intf.h"
465465#include "sound/okim6295.h"
466#include <math.h>
467466
468467
469468#define FULL_LOGGING   0
r1527r1528
538537 *
539538 *************************************/
540539
541void itech8_update_interrupts(int periodic, int tms34061, int blitter)
540void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter)
542541{
543542   /* update the states */
544543   if (periodic != -1) periodic_int = periodic;
r1527r1528
546545   if (blitter != -1) blitter_int = blitter;
547546
548547   /* handle the 6809 case */
549   if (Machine->drv->cpu[0].type == CPU_M6809)
548   if (machine->drv->cpu[0].type == CPU_M6809)
550549   {
551550      /* just modify lines that have changed */
552551      if (periodic != -1) cpunum_set_input_line(0, INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE);
r1527r1528
582581static INTERRUPT_GEN( generate_nmi )
583582{
584583   /* signal the NMI */
585   itech8_update_interrupts(1, -1, -1);
586   itech8_update_interrupts(0, -1, -1);
584   itech8_update_interrupts(machine, 1, -1, -1);
585   itech8_update_interrupts(machine, 0, -1, -1);
587586
588587   if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", video_screen_get_vpos(0));
589588}
r1527r1528
17741773
17751774   /* video hardware */
17761775   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
1777   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1778   MDRV_SCREEN_SIZE(512, 263)
1779   MDRV_PALETTE_LENGTH(256)
1780
17811776   MDRV_VIDEO_START(itech8)
17821777
1778   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1779   MDRV_SCREEN_SIZE(512, 263)
1780
17831781   /* sound hardware */
17841782   MDRV_SPEAKER_STANDARD_MONO("mono")
17851783
src/mame/drivers/flstory.c
r1527r1528
691691   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* IRQ generated by ??? */
692692                  /* NMI generated by the main CPU */
693693
694   MDRV_CPU_ADD(M68705,4000000/M68705_CLOCK_DIVIDER)   /* ??? */
694   MDRV_CPU_ADD(M68705,4000000)   /* ??? */
695695   MDRV_CPU_PROGRAM_MAP(flstory_m68705_map,0)
696696
697697   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
738738   MDRV_CPU_PROGRAM_MAP(sound_map,0)
739739   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* IRQ generated by ??? */
740740                  /* NMI generated by the main CPU */
741//  MDRV_CPU_ADD(M68705,4000000/M68705_CLOCK_DIVIDER)  /* ??? */
741//  MDRV_CPU_ADD(M68705,4000000)  /* ??? */
742742//  MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
743743
744744   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
785785   MDRV_CPU_PROGRAM_MAP(sound_map,0)
786786   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* IRQ generated by ??? */
787787                  /* NMI generated by the main CPU */
788//  MDRV_CPU_ADD(M68705,4000000/M68705_CLOCK_DIVIDER)  /* ??? */
788//  MDRV_CPU_ADD(M68705,4000000)  /* ??? */
789789//  MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
790790
791791   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/strnskil.c
r1527r1528
124124
125125static ADDRESS_MAP_START( strnskil_readmem2, ADDRESS_SPACE_PROGRAM, 8 )
126126   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
127   AM_RANGE(0xc000, 0xc7ff) AM_READ(spriteram_r)
127   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
128128   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM)
129129ADDRESS_MAP_END
130130
src/mame/drivers/atetris.c
r1527r1528
5353#include "atetris.h"
5454#include "sound/sn76496.h"
5555#include "sound/pokey.h"
56#include "state.h"
5657
5758
58#define ATARI_CLOCK_14MHz   14318180
59#define MASTER_CLOCK      XTAL_14_31818MHz
60#define BOOTLEG_CLOCK      XTAL_14_7456MHz
5961
6062
6163/* Local variables */
6264static UINT8 *slapstic_source;
6365static UINT8 *slapstic_base;
6466static UINT8 current_bank;
65
6667static UINT8 nvram_write_enable;
68static emu_timer *interrupt_timer;
6769
6870
6971
r1527r1528
8486   scanline += 32;
8587   if (scanline >= 256)
8688      scanline -= 256;
87   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, interrupt_gen);
89   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
8890}
8991
9092
r1527r1528
101103 *
102104 *************************************/
103105
106static void reset_bank(void)
107{
108   memcpy(slapstic_base, &slapstic_source[current_bank * 0x4000], 0x4000);
109}
110
111
112static MACHINE_START( atetris )
113{
114   /* Allocate interrupt timer */
115   interrupt_timer = timer_alloc(interrupt_gen, NULL);
116
117   /* Set up save state */
118   state_save_register_global(current_bank);
119   state_save_register_global(nvram_write_enable);
120   state_save_register_func_postload(reset_bank);
121}
122
123
104124static MACHINE_RESET( atetris )
105125{
106126   /* reset the slapstic */
107127   slapstic_reset();
108128   current_bank = slapstic_bank() & 1;
109   memcpy(slapstic_base, &slapstic_source[current_bank * 0x4000], 0x4000);
129   reset_bank();
110130
111131   /* start interrupts going (32V clocked by 16V) */
112   timer_set(video_screen_get_time_until_pos(0, 48, 0), NULL, 48, interrupt_gen);
132   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 48, 0), 48, attotime_zero);
113133}
114134
115135
r1527r1528
177197 *
178198 *************************************/
179199
200/* full address map derived from schematics */
180201static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
181202   AM_RANGE(0x0000, 0x0fff) AM_RAM
182203   AM_RANGE(0x1000, 0x1fff) AM_READWRITE(MRA8_RAM, atetris_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
183   AM_RANGE(0x2000, 0x20ff) AM_READWRITE(MRA8_RAM, paletteram_RRRGGGBB_w) AM_BASE(&paletteram)
184   AM_RANGE(0x2400, 0x25ff) AM_READWRITE(MRA8_RAM, nvram_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
185   AM_RANGE(0x2800, 0x280f) AM_READWRITE(pokey1_r, pokey1_w)
186   AM_RANGE(0x2810, 0x281f) AM_READWRITE(pokey2_r, pokey2_w)
187   AM_RANGE(0x3000, 0x3000) AM_WRITE(watchdog_reset_w)
188   AM_RANGE(0x3400, 0x3400) AM_WRITE(nvram_enable_w)
189   AM_RANGE(0x3800, 0x3800) AM_WRITE(irq_ack_w)
190   AM_RANGE(0x3c00, 0x3c00) AM_WRITE(coincount_w)
204   AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_READWRITE(MRA8_RAM, paletteram_RRRGGGBB_w) AM_BASE(&paletteram)
205   AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_READWRITE(MRA8_RAM, nvram_w) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
206   AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_READWRITE(pokey1_r, pokey1_w)
207   AM_RANGE(0x2810, 0x281f) AM_MIRROR(0x03e0) AM_READWRITE(pokey2_r, pokey2_w)
208   AM_RANGE(0x3000, 0x3000) AM_MIRROR(0x03ff) AM_WRITE(watchdog_reset_w)
209   AM_RANGE(0x3400, 0x3400) AM_MIRROR(0x03ff) AM_WRITE(nvram_enable_w)
210   AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(irq_ack_w)
211   AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(coincount_w)
191212   AM_RANGE(0x4000, 0x5fff) AM_ROM
192213   AM_RANGE(0x6000, 0x7fff) AM_READ(atetris_slapstic_r)
193214   AM_RANGE(0x8000, 0xffff) AM_ROM
r1527r1528
330351static MACHINE_DRIVER_START( atetris )
331352
332353   /* basic machine hardware */
333   MDRV_CPU_ADD(M6502,ATARI_CLOCK_14MHz/8)
354   MDRV_CPU_ADD(M6502,MASTER_CLOCK/8)
334355   MDRV_CPU_PROGRAM_MAP(main_map,0)
335356
357   MDRV_MACHINE_START(atetris)
336358   MDRV_MACHINE_RESET(atetris)
337359   MDRV_NVRAM_HANDLER(generic_1fill)
338360
r1527r1528
345367   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
346368   /* note: these parameters are from published specs, not derived */
347369   /* the board uses an SOS-2 chip to generate video signals */
348   MDRV_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
370   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 456, 0, 336, 262, 0, 240)
349371
350372   MDRV_VIDEO_START(atetris)
351373   MDRV_VIDEO_UPDATE(atetris)
r1527r1528
353375   /* sound hardware */
354376   MDRV_SPEAKER_STANDARD_MONO("mono")
355377
356   MDRV_SOUND_ADD(POKEY, ATARI_CLOCK_14MHz/8)
378   MDRV_SOUND_ADD(POKEY, MASTER_CLOCK/8)
357379   MDRV_SOUND_CONFIG(pokey_interface_1)
358380   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
359381
360   MDRV_SOUND_ADD(POKEY, ATARI_CLOCK_14MHz/8)
382   MDRV_SOUND_ADD(POKEY, MASTER_CLOCK/8)
361383   MDRV_SOUND_CONFIG(pokey_interface_2)
362384   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
363385MACHINE_DRIVER_END
r1527r1528
366388static MACHINE_DRIVER_START( atetrsb2 )
367389
368390   /* basic machine hardware */
369   MDRV_CPU_ADD(M6502,14745600/8)
391   MDRV_CPU_ADD(M6502,BOOTLEG_CLOCK/8)
370392   MDRV_CPU_PROGRAM_MAP(atetrsb2_map,0)
371393
372394   MDRV_SCREEN_REFRESH_RATE(60)
373395
396   MDRV_MACHINE_START(atetris)
374397   MDRV_MACHINE_RESET(atetris)
375398   MDRV_NVRAM_HANDLER(generic_1fill)
376399
r1527r1528
383406   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
384407   /* note: these parameters are from published specs, not derived */
385408   /* the board uses an SOS-2 chip to generate video signals */
386   MDRV_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
409   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 456, 0, 336, 262, 0, 240)
387410
388411   MDRV_VIDEO_START(atetris)
389412   MDRV_VIDEO_UPDATE(atetris)
r1527r1528
391414   /* sound hardware */
392415   MDRV_SPEAKER_STANDARD_MONO("mono")
393416
394   MDRV_SOUND_ADD(SN76496, 14745600/8)
417   MDRV_SOUND_ADD(SN76496, BOOTLEG_CLOCK/8)
395418   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
396419
397   MDRV_SOUND_ADD(SN76496, 14745600/8)
420   MDRV_SOUND_ADD(SN76496, BOOTLEG_CLOCK/8)
398421   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
399422
400   MDRV_SOUND_ADD(SN76496, 14745600/8)
423   MDRV_SOUND_ADD(SN76496, BOOTLEG_CLOCK/8)
401424   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
402425MACHINE_DRIVER_END
403426
r1527r1528
496519 *
497520 *************************************/
498521
499GAME( 1988, atetris,  0,       atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 1)", 0 )
500GAME( 1988, atetrisa, atetris, atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 2)", 0 )
501GAME( 1988, atetrisb, atetris, atetris,  atetris,  atetris, ROT0,   "bootleg",     "Tetris (bootleg set 1)", 0 )
502GAME( 1988, atetrsb2, atetris, atetrsb2, atetris,  atetris, ROT0,   "bootleg",   "Tetris (bootleg set 2)", 0 )
503GAME( 1989, atetcktl, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (Cocktail set 1)", 0 )
504GAME( 1989, atetckt2, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (Cocktail set 2)", 0 )
522GAME( 1988, atetris,  0,       atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 1)", GAME_SUPPORTS_SAVE )
523GAME( 1988, atetrisa, atetris, atetris,  atetris,  atetris, ROT0,   "Atari Games", "Tetris (set 2)", GAME_SUPPORTS_SAVE )
524GAME( 1988, atetrisb, atetris, atetris,  atetris,  atetris, ROT0,   "bootleg",     "Tetris (bootleg set 1)", GAME_SUPPORTS_SAVE )
525GAME( 1988, atetrsb2, atetris, atetrsb2, atetris,  atetris, ROT0,   "bootleg",   "Tetris (bootleg set 2)", GAME_SUPPORTS_SAVE )
526GAME( 1989, atetcktl, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (Cocktail set 1)", GAME_SUPPORTS_SAVE )
527GAME( 1989, atetckt2, atetris, atetris,  atetcktl, atetris, ROT270, "Atari Games", "Tetris (Cocktail set 2)", GAME_SUPPORTS_SAVE )
src/mame/drivers/troangel.c
r1527r1528
6262
6363static ADDRESS_MAP_START( troangel_writemem, ADDRESS_SPACE_PROGRAM, 8 )
6464   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
65   AM_RANGE(0x8000, 0x87ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
65   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
6666//  AM_RANGE(0x8800, 0x8fff) AM_WRITE(MWA8_RAM)
6767   AM_RANGE(0x9000, 0x91ff) AM_WRITE(MWA8_RAM) AM_BASE(&troangel_scroll)
6868   AM_RANGE(0xc820, 0xc8ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
r1527r1528
200200static MACHINE_DRIVER_START( troangel )
201201
202202   /* basic machine hardware */
203   MDRV_CPU_ADD(Z80, 3000000)   /* 3 MHz ??? */
203   MDRV_CPU_ADD(Z80, XTAL_18_432MHz/6)   /* verified on pcb */
204204   MDRV_CPU_PROGRAM_MAP(troangel_readmem,troangel_writemem)
205205   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
206206
src/mame/drivers/cosmic.c
r1527r1528
15081508static DRIVER_INIT( nomnlnd )
15091509{
15101510   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r);
1511
1511   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, MWA8_NOP);
15121512   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
1513   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x480a, 0x480a, 0, 0, DAC_0_data_w);
15131514}
15141515
15151516
src/mame/drivers/ataxx.c
r1527r1528
3333#include "sound/custom.h"
3434
3535
36#define MASTER_CLOCK      XTAL_28_63636MHz
37#define MCU_CLOCK         XTAL_16MHz
3638
39
40
3741/*************************************
3842 *
3943 *  Master CPU memory handlers
r1527r1528
334338   MDRV_CPU_PROGRAM_MAP(slave_map_program,0)
335339   MDRV_CPU_IO_MAP(slave_map_io,0)
336340
337   MDRV_CPU_ADD_TAG("sound", I80186, 16000000/2)
341   MDRV_CPU_ADD_TAG("sound", I80186, XTAL_16MHz)
338342   /* audio CPU */
339343   MDRV_CPU_PROGRAM_MAP(leland_80186_map_program,0)
340344   MDRV_CPU_IO_MAP(ataxx_80186_map_io,0)
src/mame/drivers/wiping.c
r1527r1528
104104
105105static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
106106   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
107   AM_RANGE(0x8000, 0x83ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
108   AM_RANGE(0x8400, 0x87ff) AM_WRITE(colorram_w) AM_BASE(&colorram)
107   AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
108   AM_RANGE(0x8400, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
109109   AM_RANGE(0x8800, 0x88ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
110110   AM_RANGE(0x8900, 0x8bff) AM_WRITE(MWA8_RAM)
111111   AM_RANGE(0x9000, 0x93ff) AM_WRITE(shared1_w) AM_BASE(&sharedram1)
r1527r1528
329329   MDRV_COLORTABLE_LENGTH(64*4+64*4)
330330
331331   MDRV_PALETTE_INIT(wiping)
332   MDRV_VIDEO_START(generic)
333332   MDRV_VIDEO_UPDATE(wiping)
334333
335334   /* sound hardware */
src/mame/drivers/leland.c
r1527r1528
4747#include "sound/custom.h"
4848
4949
50#define MASTER_CLOCK      XTAL_12MHz
51#define VIDEO_CLOCK         XTAL_14_31818MHz
52#define MCU_CLOCK         XTAL_16MHz
53
54
55
5056/*************************************
5157 *
5258 *  Master CPU memory handlers
r1527r1528
733739static MACHINE_DRIVER_START( leland )
734740
735741   /* basic machine hardware */
736   MDRV_CPU_ADD_TAG("master", Z80, 6000000)
742   MDRV_CPU_ADD_TAG("master", Z80, MASTER_CLOCK/2)
737743   MDRV_CPU_PROGRAM_MAP(master_map_program,0)
738744   MDRV_CPU_IO_MAP(master_map_io,0)
739745   MDRV_CPU_VBLANK_INT(leland_master_interrupt,1)
740746
741   MDRV_CPU_ADD_TAG("slave", Z80, 6000000)
747   MDRV_CPU_ADD_TAG("slave", Z80, MASTER_CLOCK/2)
742748   MDRV_CPU_PROGRAM_MAP(slave_small_map_program,0)
743749   MDRV_CPU_IO_MAP(slave_map_io,0)
744750
r1527r1528
781787
782788   /* basic machine hardware */
783789   MDRV_IMPORT_FROM(leland)
784   MDRV_CPU_ADD_TAG("sound", I80186, 16000000/2)
785   /* audio CPU */
790
791   MDRV_CPU_ADD_TAG("sound", I80186, MCU_CLOCK)
786792   MDRV_CPU_PROGRAM_MAP(leland_80186_map_program,0)
787793   MDRV_CPU_IO_MAP(redline_80186_map_io,0)
788794
r1527r1528
797803
798804   /* basic machine hardware */
799805   MDRV_IMPORT_FROM(redline)
806
800807   MDRV_CPU_MODIFY("sound")
801808   MDRV_CPU_IO_MAP(leland_80186_map_io,0)
802809
r1527r1528
811818
812819   /* basic machine hardware */
813820   MDRV_IMPORT_FROM(quarterb)
821
814822   MDRV_CPU_MODIFY("slave")
815823   MDRV_CPU_PROGRAM_MAP(slave_large_map_program,0)
816824MACHINE_DRIVER_END
src/mame/drivers/gstream.c
r1527r1528
457457{
458458   if (activecpu_get_pc()==0xc0001592)
459459   {
460      cpu_spinuntil_int();
460      activecpu_eat_cycles(50);
461461   }
462462
463463   return gstream_workram[0xd1ee0/4];
src/mame/drivers/pushman.c
r1527r1528
442442   MDRV_CPU_IO_MAP(0,sound_writeport)
443443
444444   /* ElSemi. Reversed the CPU order so the sound callback works with bballs */
445   MDRV_CPU_ADD(M68705, 4000000/M68705_CLOCK_DIVIDER)   /* No idea */
445   MDRV_CPU_ADD(M68705, 4000000)   /* No idea */
446446   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
447447
448448   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/toaplan1.c
r1527r1528
17381738   MDRV_CPU_PROGRAM_MAP(toaplan1_sound_map, 0)
17391739   MDRV_CPU_IO_MAP(demonwld_sound_io_map, 0)
17401740
1741   MDRV_CPU_ADD(TMS32010,(28000000/2)/TMS32010_CLOCK_DIVIDER)   /* 14MHz CLKin */
1741   MDRV_CPU_ADD(TMS32010,28000000/2)   /* 14MHz CLKin */
17421742   MDRV_CPU_PROGRAM_MAP(DSP_program_map,0)
17431743   MDRV_CPU_IO_MAP(DSP_io_map,0)
17441744
src/mame/drivers/shanghai.c
r1527r1528
10431043   MDRV_SOUND_ROUTE(3, "mono", 0.80)
10441044MACHINE_DRIVER_END
10451045
1046SEIBU_SOUND_SYSTEM_YM2203_HARDWARE
10471046
1048SEIBU_SOUND_SYSTEM_ADPCM_HARDWARE
1049
1050
10511047static MACHINE_DRIVER_START( kothello )
10521048
10531049   /* basic machine hardware */
src/mame/drivers/tmnt.c
r1527r1528
23482348   /* sound hardware */
23492349   MDRV_SPEAKER_STANDARD_MONO("mono")
23502350
2351   MDRV_SOUND_ADD(YM2151, 3579545)
2351   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
23522352   MDRV_SOUND_CONFIG(ym2151_interface_cbj)
23532353   MDRV_SOUND_ROUTE(0, "mono", 1.0)
23542354   MDRV_SOUND_ROUTE(1, "mono", 1.0)
23552355MACHINE_DRIVER_END
23562356
2357
23572358static MACHINE_DRIVER_START( mia )
23582359
23592360   /* basic machine hardware */
2360   MDRV_CPU_ADD(M68000, 8000000)   /* 8 MHz */
2361   MDRV_CPU_ADD(M68000, XTAL_24MHz/3)
23612362   MDRV_CPU_PROGRAM_MAP(mia_main_map,0)
23622363   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
23632364
2364   MDRV_CPU_ADD(Z80, 3579545)
2365   /* audio CPU */   /* 3.579545 MHz */
2365   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
23662366   MDRV_CPU_PROGRAM_MAP(mia_audio_map,0)
23672367
23682368   MDRV_SCREEN_REFRESH_RATE(60)
23692369   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
23702370
23712371   /* video hardware */
2372   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK)
2372   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
23732373   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23742374   MDRV_SCREEN_SIZE(64*8, 32*8)
23752375   MDRV_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 )
r1527r1528
23812381   /* sound hardware */
23822382   MDRV_SPEAKER_STANDARD_MONO("mono")
23832383
2384   MDRV_SOUND_ADD(YM2151, 3579545)
2384   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
23852385   MDRV_SOUND_ROUTE(0, "mono", 1.0)
23862386   MDRV_SOUND_ROUTE(1, "mono", 1.0)
23872387
2388   MDRV_SOUND_ADD(K007232, 3579545)
2388   MDRV_SOUND_ADD(K007232, XTAL_3_579545MHz)
23892389   MDRV_SOUND_CONFIG(k007232_interface)
23902390   MDRV_SOUND_ROUTE(0, "mono", 0.20)
23912391   MDRV_SOUND_ROUTE(1, "mono", 0.20)
r1527r1528
24022402static MACHINE_DRIVER_START( tmnt )
24032403
24042404   /* basic machine hardware */
2405   MDRV_CPU_ADD(M68000, 8000000)   /* 8 MHz */
2405   MDRV_CPU_ADD(M68000, XTAL_24MHz/3)
24062406   MDRV_CPU_PROGRAM_MAP(tmnt_main_map,0)
24072407   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
24082408
2409   MDRV_CPU_ADD(Z80, 3579545)
2410   /* audio CPU */   /* 3.579545 MHz */
2409   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
24112410   MDRV_CPU_PROGRAM_MAP(tmnt_audio_map,0)
24122411
24132412   MDRV_MACHINE_RESET(tmnt);
r1527r1528
24282427   /* sound hardware */
24292428   MDRV_SPEAKER_STANDARD_MONO("mono")
24302429
2431   MDRV_SOUND_ADD(YM2151, 3579545)
2430   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
24322431   MDRV_SOUND_ROUTE(0, "mono", 1.0)
24332432   MDRV_SOUND_ROUTE(1, "mono", 1.0)
24342433
2435   MDRV_SOUND_ADD(K007232, 3579545)
2434   MDRV_SOUND_ADD(K007232, XTAL_3_579545MHz)
24362435   MDRV_SOUND_CONFIG(k007232_interface)
24372436   MDRV_SOUND_ROUTE(0, "mono", 0.20)
24382437   MDRV_SOUND_ROUTE(1, "mono", 0.20)
24392438
2440   MDRV_SOUND_ADD(UPD7759, UPD7759_STANDARD_CLOCK)
2439   MDRV_SOUND_ADD(UPD7759, XTAL_640kHz)
24412440   MDRV_SOUND_CONFIG(upd7759_interface)
24422441   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
24432442
r1527r1528
24502449static MACHINE_DRIVER_START( punkshot )
24512450
24522451   /* basic machine hardware */
2453   MDRV_CPU_ADD(M68000, 12000000)   /* CPU is 68000/12, but this doesn't necessarily mean it's */
2454                           /* running at 12MHz. TMNT uses 8MHz */
2452   MDRV_CPU_ADD(M68000, XTAL_24MHz/2)
24552453   MDRV_CPU_PROGRAM_MAP(punkshot_main_map,0)
24562454   MDRV_CPU_VBLANK_INT(punkshot_interrupt,1)
24572455
2458   MDRV_CPU_ADD(Z80, 3579545)
2459   /* audio CPU */   /* 3.579545 MHz */
2456   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
24602457   MDRV_CPU_PROGRAM_MAP(punkshot_audio_map,0)
24612458                        /* NMIs are generated by the 053260 */
24622459   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
24752472   /* sound hardware */
24762473   MDRV_SPEAKER_STANDARD_MONO("mono")
24772474
2478   MDRV_SOUND_ADD(YM2151, 3579545)
2475   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
24792476   MDRV_SOUND_ROUTE(0, "mono", 1.0)
24802477   MDRV_SOUND_ROUTE(1, "mono", 1.0)
24812478
2482   MDRV_SOUND_ADD(K053260, 3579545)
2479   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz)
24832480   MDRV_SOUND_CONFIG(k053260_interface)
24842481   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
24852482MACHINE_DRIVER_END
r1527r1528
24882485static MACHINE_DRIVER_START( lgtnfght )
24892486
24902487   /* basic machine hardware */
2491   MDRV_CPU_ADD(M68000, 12000000)   /* 12 MHz */
2488   MDRV_CPU_ADD(M68000, XTAL_24MHz/2)
24922489   MDRV_CPU_PROGRAM_MAP(lgtnfght_main_map,0)
24932490   MDRV_CPU_VBLANK_INT(lgtnfght_interrupt,1)
24942491
2495   MDRV_CPU_ADD(Z80, 3579545)
2496   /* audio CPU */   /* 3.579545 MHz */
2492   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
24972493   MDRV_CPU_PROGRAM_MAP(lgtnfght_audio_map,0)
24982494
24992495   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
25122508   /* sound hardware */
25132509   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
25142510
2515   MDRV_SOUND_ADD(YM2151, 3579545)
2511   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
25162512   MDRV_SOUND_ROUTE(0, "left", 1.0)
25172513   MDRV_SOUND_ROUTE(1, "right", 1.0)
25182514
2519   MDRV_SOUND_ADD(K053260, 3579545)
2515   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz)
25202516   MDRV_SOUND_CONFIG(k053260_interface)
25212517   MDRV_SOUND_ROUTE(0, "left", 0.70)
25222518   MDRV_SOUND_ROUTE(1, "right", 0.70)
r1527r1528
25302526   MDRV_CPU_PROGRAM_MAP(blswhstl_main_map,0)
25312527   MDRV_CPU_VBLANK_INT(punkshot_interrupt,1)
25322528
2533   MDRV_CPU_ADD(Z80, 3579545)
2534   /* audio CPU */   /* ????? */
2529   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
25352530   MDRV_CPU_PROGRAM_MAP(ssriders_audio_map,0)
25362531                        /* NMIs are generated by the 053260 */
25372532   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
25532548   /* sound hardware */
25542549   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
25552550
2556   MDRV_SOUND_ADD(YM2151, 3579545)
2551   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
25572552   MDRV_SOUND_ROUTE(0, "left", 1.0)
25582553   MDRV_SOUND_ROUTE(1, "right", 1.0)
25592554
2560   MDRV_SOUND_ADD(K053260, 3579545)
2555   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz)
25612556   MDRV_SOUND_CONFIG(k053260_interface)
25622557   MDRV_SOUND_ROUTE(0, "right", 0.75)   /* fixed inverted stereo channels */
25632558   MDRV_SOUND_ROUTE(1, "left", 0.75)
r1527r1528
25882583   MDRV_CPU_PROGRAM_MAP(glfgreat_main_map,0)
25892584   MDRV_CPU_VBLANK_INT(lgtnfght_interrupt,1)
25902585
2591   MDRV_CPU_ADD(Z80, 3579545)
2592   /* audio CPU */   /* ? */
2586   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
25932587   MDRV_CPU_PROGRAM_MAP(glfgreat_audio_map,0)
25942588                        /* NMIs are generated by the 053260 */
25952589   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
26092603   /* sound hardware */
26102604   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
26112605
2612   MDRV_SOUND_ADD(K053260, 3579545)
2606   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz)
26132607   MDRV_SOUND_CONFIG(k053260_interface)
26142608   MDRV_SOUND_ROUTE(0, "left", 1.0)
26152609   MDRV_SOUND_ROUTE(1, "right", 1.0)
r1527r1528
26682662static MACHINE_DRIVER_START( tmnt2 )
26692663
26702664   /* basic machine hardware */
2671   MDRV_CPU_ADD(M68000, 16000000)   /* 16 MHz */
2665   MDRV_CPU_ADD(M68000, XTAL_32MHz/2)
26722666   MDRV_CPU_PROGRAM_MAP(tmnt2_main_map,0)
26732667   MDRV_CPU_VBLANK_INT(punkshot_interrupt,1)
26742668
r1527r1528
26982692   /* sound hardware */
26992693   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
27002694
2701   MDRV_SOUND_ADD(YM2151, 3579545)
2695   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
27022696   MDRV_SOUND_ROUTE(0, "left", 1.0)
27032697   MDRV_SOUND_ROUTE(1, "right", 1.0)
27042698
2705   MDRV_SOUND_ADD(K053260, 3579545)
2699   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz)
27062700   MDRV_SOUND_CONFIG(k053260_interface)
27072701   MDRV_SOUND_ROUTE(0, "left", 0.70)
27082702   MDRV_SOUND_ROUTE(1, "right", 0.70)
r1527r1528
27122706static MACHINE_DRIVER_START( ssriders )
27132707
27142708   /* basic machine hardware */
2715   MDRV_CPU_ADD(M68000, 16000000)   /* 16 MHz */
2709   MDRV_CPU_ADD(M68000, XTAL_32MHz/2)
27162710   MDRV_CPU_PROGRAM_MAP(ssriders_main_map,0)
27172711   MDRV_CPU_VBLANK_INT(punkshot_interrupt,1)
27182712
r1527r1528
27382732   /* sound hardware */
27392733   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
27402734
2741   MDRV_SOUND_ADD(YM2151, 3579545)
2735   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
27422736   MDRV_SOUND_ROUTE(0, "left", 1.0)
27432737   MDRV_SOUND_ROUTE(1, "right", 1.0)
27442738
2745   MDRV_SOUND_ADD(K053260, 3579545)
2739   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz)
27462740   MDRV_SOUND_CONFIG(k053260_interface)
27472741   MDRV_SOUND_ROUTE(0, "left", 0.75)
27482742   MDRV_SOUND_ROUTE(1, "right", 0.75)
r1527r1528
27872781   MDRV_CPU_PROGRAM_MAP(thndrx2_main_map,0)
27882782   MDRV_CPU_VBLANK_INT(punkshot_interrupt,1)
27892783
2790   MDRV_CPU_ADD(Z80, 3579545)
2791   /* audio CPU */   /* ????? */
2784   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz)
27922785   MDRV_CPU_PROGRAM_MAP(thndrx2_audio_map,0)
27932786                        /* NMIs are generated by the 053260 */
27942787   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
28092802   /* sound hardware */
28102803   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
28112804
2812   MDRV_SOUND_ADD(YM2151, 3579545)
2805   MDRV_SOUND_ADD(YM2151, XTAL_3_579545MHz)
28132806   MDRV_SOUND_ROUTE(0, "left", 1.0)
28142807   MDRV_SOUND_ROUTE(1, "right", 1.0)
28152808
2816   MDRV_SOUND_ADD(K053260, 3579545)
2809   MDRV_SOUND_ADD(K053260, XTAL_3_579545MHz)
28172810   MDRV_SOUND_CONFIG(k053260_interface)
28182811   MDRV_SOUND_ROUTE(0, "left", 0.70)
28192812   MDRV_SOUND_ROUTE(1, "right", 0.70)
src/mame/drivers/jpmimpct.c
r1527r1528
840840   MDRV_CPU_ADD(M68000, 8000000)
841841   MDRV_CPU_PROGRAM_MAP(m68k_program_map, 0)
842842
843    MDRV_CPU_ADD(TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
843    MDRV_CPU_ADD(TMS34010, 40000000)
844844   MDRV_CPU_CONFIG(tms_config)
845845   MDRV_CPU_PROGRAM_MAP(tms_program_map, 0)
846846
src/mame/drivers/namcos12.c
r1527r1528
14961496
14971497static MACHINE_DRIVER_START( coh700 )
14981498   /* basic machine hardware */
1499   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
1499   MDRV_CPU_ADD( PSXCPU, XTAL_100MHz )
15001500   MDRV_CPU_PROGRAM_MAP( namcos12_map, 0 )
15011501   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
15021502
src/mame/drivers/raiden2.c
r1527r1528
22622262
22632263
22642264
2265DRIVER_INIT(rdx_v33)
2265static DRIVER_INIT(rdx_v33)
22662266{
22672267   memory_set_bankptr(1,&memory_region(REGION_CPU1)[0x020000]);
22682268   memory_set_bankptr(2,&memory_region(REGION_CPU1)[0x030000]);
src/mame/drivers/pitnrun.c
r1527r1528
124124   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
125125   AM_RANGE(0x8800, 0x8fff) AM_READ(pitnrun_videoram_r)
126126   AM_RANGE(0x9000, 0x9fff) AM_READ(pitnrun_videoram2_r)
127   AM_RANGE(0xa000, 0xa0ff) AM_READ(spriteram_r)
127   AM_RANGE(0xa000, 0xa0ff) AM_READ(MRA8_RAM)
128128   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_0_r)
129129   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_1_r)
130130   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_2_r)
r1527r1528
138138   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)
139139   AM_RANGE(0x8800, 0x8fff) AM_WRITE(pitnrun_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
140140   AM_RANGE(0x9000, 0x9fff) AM_WRITE(pitnrun_videoram2_w) AM_BASE(&pitnrun_videoram2)
141   AM_RANGE(0xa000, 0xa0ff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
141   AM_RANGE(0xa000, 0xa0ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
142142   AM_RANGE(0xa800, 0xa807) AM_WRITE(MWA8_NOP) /* Analog Sound */
143143   AM_RANGE(0xb000, 0xb000) AM_WRITE(nmi_enable_w)
144144   AM_RANGE(0xb001, 0xb001) AM_WRITE(pitnrun_color_select_w)
r1527r1528
298298   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
299299   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
300300
301   MDRV_CPU_ADD(M68705,3000000/M68705_CLOCK_DIVIDER)
301   MDRV_CPU_ADD(M68705,3000000)
302302   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
303303
304304   MDRV_MACHINE_RESET(pitnrun)
src/mame/drivers/berzerk.c
r1527r1528
1010
1111#include "driver.h"
1212#include "berzerk.h"
13#include "exidy.h"
1314#include "machine/74181.h"
1415#include "video/resnet.h"
1516
src/mame/drivers/bionicc.c
r1527r1528
2020      as USA (TSU) had an red stripe on the sticker.  The intermixing
2121      of TSE and TSU roms in the parent set is correct and verified.
2222Note: Euro set simply states the game cannot be operated in Japan....
23
24ToDo:
25- finish video driver
26    Some attributes are unknown. I don't remember the original game but
27    seems there are some problems:
28    - misplaced sprites ? ( see beginning of level 1 or 2 for example )
29    - sprite / sprite priority ? ( see level 2 the reflectors )
30    - sprite / background priority ? ( see level 1: birds walk through
23Note: These issues have been verified on a real PCB and are not emulation bugs:
24      - misplaced sprites ( see beginning of level 1 or 2 for example )
25      - sprite / sprite priority ( see level 2 the reflectors )
26      - sprite / background priority ( see level 1: birds walk through
3127        branches of different trees )
32    - see the beginning of level 3: is the background screwed ?
28      - see the beginning of level 3: background screwed
3329
30ToDo:
3431- get rid of input port hack
3532
3633    Controls appear to be mapped at 0xFE4000, alongside dip switches, but there
src/mame/drivers/suprridr.c
r1527r1528
222222#define SUPRRIDR_P1_CONTROL_PORT_TAG   ("CONTP1")
223223#define SUPRRIDR_P2_CONTROL_PORT_TAG   ("CONTP2")
224224
225static UINT32 suprridr_control_r(void *param)
225static CUSTOM_INPUT( suprridr_control_r )
226226{
227227   UINT32 ret;
228228
src/mame/drivers/dynadice.c
r1527r1528
6767
6868static ADDRESS_MAP_START( dynadice_map, ADDRESS_SPACE_PROGRAM, 8 )
6969   AM_RANGE(0x0000, 0x1fff) AM_ROM
70   AM_RANGE(0x2000, 0x23ff) AM_WRITE(dynadice_videoram_w) AM_READ(videoram_r) AM_BASE(&videoram)
70   AM_RANGE(0x2000, 0x23ff) AM_READWRITE(MRA8_RAM, dynadice_videoram_w) AM_BASE(&videoram)
7171   AM_RANGE(0x4000, 0x40ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
7272ADDRESS_MAP_END
7373
src/mame/drivers/playmark.c
r1527r1528
972972   MDRV_CPU_PROGRAM_MAP(bigtwin_main_map, 0)
973973   MDRV_CPU_VBLANK_INT(irq2_line_hold,1)
974974
975   MDRV_CPU_ADD(PIC16C57, (12000000/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz */
975   MDRV_CPU_ADD(PIC16C57, 12000000)   /* 3MHz */
976976   /* Program and Data Maps are internal to the MCU */
977977   MDRV_CPU_IO_MAP(playmark_sound_io_map, 0)
978978
r1527r1528
10061006   MDRV_CPU_PROGRAM_MAP(wbeachvl_main_map, 0)
10071007   MDRV_CPU_VBLANK_INT(irq2_line_hold,1)
10081008
1009//  MDRV_CPU_ADD(PIC16C57, (12000000/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz */
1009//  MDRV_CPU_ADD(PIC16C57, 12000000)   /* 3MHz */
10101010   /* Program and Data Maps are internal to the MCU */
10111011//  MDRV_CPU_IO_MAP(playmark_sound_io_map, 0)
10121012
r1527r1528
10411041   MDRV_CPU_PROGRAM_MAP(excelsr_main_map, 0)
10421042   MDRV_CPU_VBLANK_INT(irq2_line_hold,1)
10431043
1044   MDRV_CPU_ADD(PIC16C57, (12000000/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz */
1044   MDRV_CPU_ADD(PIC16C57, 12000000)   /* 3MHz */
10451045   /* Program and Data Maps are internal to the MCU */
10461046   MDRV_CPU_IO_MAP(playmark_sound_io_map, 0)
10471047
r1527r1528
10741074   MDRV_CPU_PROGRAM_MAP(hotmind_main_map, 0)
10751075   MDRV_CPU_VBLANK_INT(irq2_line_hold,1)
10761076
1077   MDRV_CPU_ADD(PIC16C57, (12000000/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz */
1077   MDRV_CPU_ADD(PIC16C57, 12000000)   /* 3MHz */
10781078   /* Program and Data Maps are internal to the MCU */
10791079   MDRV_CPU_IO_MAP(playmark_sound_io_map, 0)
10801080
r1527r1528
11091109   MDRV_CPU_PROGRAM_MAP(hrdtimes_main_map, 0)
11101110   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
11111111
1112//  MDRV_CPU_ADD(PIC16C57, (12000000/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz */
1112//  MDRV_CPU_ADD(PIC16C57, 12000000)   /* 3MHz */
11131113   /* Program and Data Maps are internal to the MCU */
11141114//  MDRV_CPU_IO_MAP(playmark_sound_io_map, 0)
11151115
src/mame/drivers/ikki.c
r1527r1528
4040   AM_RANGE(0x0000, 0x9fff) AM_ROM
4141   AM_RANGE(0xc000, 0xc7ff) AM_RAM
4242   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE(1)
43   AM_RANGE(0xd000, 0xd7ff) AM_READWRITE(videoram_r, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
43   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
4444   AM_RANGE(0xe000, 0xe000) AM_READ(ikki_e000_r)
4545   AM_RANGE(0xe001, 0xe001) AM_READ(input_port_0_r) /* dsw 1 */
4646   AM_RANGE(0xe002, 0xe002) AM_READ(input_port_1_r) /* dsw 2 */
src/mame/drivers/capbowl.c
r1527r1528
349349static MACHINE_DRIVER_START( capbowl )
350350
351351   /* basic machine hardware */
352   MDRV_CPU_ADD_TAG("main", M6809E, MASTER_CLOCK/4)
352   MDRV_CPU_ADD_TAG("main", M6809E, MASTER_CLOCK)
353353   MDRV_CPU_PROGRAM_MAP(capbowl_map,0)
354354   MDRV_CPU_VBLANK_INT(capbowl_interrupt,1)
355355
356   MDRV_CPU_ADD(M6809E, MASTER_CLOCK/4)
357356   /* audio CPU */
357   MDRV_CPU_ADD(M6809E, MASTER_CLOCK)
358358   MDRV_CPU_PROGRAM_MAP(sound_map,0)
359359
360   MDRV_SCREEN_REFRESH_RATE(57)
361
362360   MDRV_MACHINE_RESET(capbowl)
363361   MDRV_NVRAM_HANDLER(capbowl)
364362
365363   /* video hardware */
366364   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
367   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
368   MDRV_SCREEN_SIZE(360, 256)
369   MDRV_SCREEN_VISIBLE_AREA(0, 359, 0, 244)
370   MDRV_PALETTE_LENGTH(4096)
371
372365   MDRV_VIDEO_START(capbowl)
373366   MDRV_VIDEO_UPDATE(capbowl)
374367
368   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
369   MDRV_SCREEN_SIZE(360, 256)
370   MDRV_SCREEN_VISIBLE_AREA(0, 359, 0, 244)
371   MDRV_SCREEN_REFRESH_RATE(57)
372
375373   /* sound hardware */
376374   MDRV_SPEAKER_STANDARD_MONO("mono")
377375
src/mame/drivers/darius.c
r1527r1528
149149static UINT16 coin_word=0;
150150
151151extern UINT16 *darius_fg_ram;
152READ16_HANDLER ( darius_fg_layer_r );
153152WRITE16_HANDLER( darius_fg_layer_w );
154153
155static size_t sharedram_size;
156static UINT16 *sharedram;
157154
158
159static READ16_HANDLER( sharedram_r )
160{
161   return sharedram[offset];
162}
163
164static WRITE16_HANDLER( sharedram_w )
165{
166   COMBINE_DATA(&sharedram[offset]);
167}
168
169155static void parse_control( void )   /* assumes Z80 sandwiched between 68Ks */
170156{
171157   /* bit 0 enables cpu B */
r1527r1528
191177   watchdog_reset_w(0,data);
192178}
193179
194static READ16_HANDLER( paletteram16_r )
195{
196   return paletteram16[offset];
197}
198180
199
200181/**********************************************************
201182                        GAME INPUTS
202183**********************************************************/
r1527r1528
272253   AM_RANGE(0x080000, 0x08ffff) AM_READ(MRA16_RAM)      /* main RAM */
273254   AM_RANGE(0xc00000, 0xc0001f) AM_READ(darius_ioc_r)   /* inputs, sound */
274255   AM_RANGE(0xd00000, 0xd0ffff) AM_READ(PC080SN_word_0_r)   /* tilemaps */
275   AM_RANGE(0xd80000, 0xd80fff) AM_READ(paletteram16_r)   /* palette */
276   AM_RANGE(0xe00100, 0xe00fff) AM_READ(MRA16_RAM)      /* sprite ram */
277   AM_RANGE(0xe01000, 0xe02fff) AM_READ(sharedram_r)
278   AM_RANGE(0xe08000, 0xe0ffff) AM_READ(darius_fg_layer_r)   /* front tilemap */
256   AM_RANGE(0xd80000, 0xd80fff) AM_READ(MRA16_RAM)   /* palette */
257   AM_RANGE(0xe00100, 0xe00fff) AM_RAM AM_SHARE(1) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
258   AM_RANGE(0xe01000, 0xe02fff) AM_RAM AM_SHARE(2)
259   AM_RANGE(0xe08000, 0xe0ffff) AM_READWRITE(MRA16_RAM, darius_fg_layer_w) AM_SHARE(3) AM_BASE(&darius_fg_ram)
279260   AM_RANGE(0xe10000, 0xe10fff) AM_READ(MRA16_RAM)      /* ??? */
280261ADDRESS_MAP_END
281262
r1527r1528
290271   AM_RANGE(0xd40000, 0xd40003) AM_WRITE(PC080SN_xscroll_word_0_w)
291272   AM_RANGE(0xd50000, 0xd50003) AM_WRITE(PC080SN_ctrl_word_0_w)
292273   AM_RANGE(0xd80000, 0xd80fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
293   AM_RANGE(0xe00100, 0xe00fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
294   AM_RANGE(0xe01000, 0xe02fff) AM_WRITE(sharedram_w) AM_BASE(&sharedram) AM_SIZE(&sharedram_size)
295   AM_RANGE(0xe08000, 0xe0ffff) AM_WRITE(darius_fg_layer_w) AM_BASE(&darius_fg_ram)
296274   AM_RANGE(0xe10000, 0xe10fff) AM_WRITE(MWA16_RAM)
297275ADDRESS_MAP_END
298276
299277static ADDRESS_MAP_START( darius_cpub_readmem, ADDRESS_SPACE_PROGRAM, 16 )
300278   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
301279   AM_RANGE(0x040000, 0x04ffff) AM_READ(MRA16_RAM)   /* local RAM */
302   AM_RANGE(0xe01000, 0xe02fff) AM_READ(sharedram_r)
280   AM_RANGE(0xe00100, 0xe00fff) AM_RAM AM_SHARE(1)
281   AM_RANGE(0xe01000, 0xe02fff) AM_RAM AM_SHARE(2)
282   AM_RANGE(0xe08000, 0xe0ffff) AM_READWRITE(MRA16_RAM, darius_fg_layer_w) AM_SHARE(3)
303283ADDRESS_MAP_END
304284
305285static ADDRESS_MAP_START( darius_cpub_writemem, ADDRESS_SPACE_PROGRAM, 16 )
r1527r1528
307287   AM_RANGE(0x040000, 0x04ffff) AM_WRITE(MWA16_RAM)
308288   AM_RANGE(0xc00000, 0xc0007f) AM_WRITE(darius_ioc_w)   /* only writes $c00050 (?) */
309289   AM_RANGE(0xd80000, 0xd80fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w)
310   AM_RANGE(0xe00100, 0xe00fff) AM_WRITE(spriteram16_w)   /* some writes */
311   AM_RANGE(0xe01000, 0Xe02fff) AM_WRITE(sharedram_w)
312   AM_RANGE(0xe08000, 0xe0ffff) AM_WRITE(darius_fg_layer_w)   /* a few writes */
313290ADDRESS_MAP_END
314291
315292
src/mame/drivers/ssingles.c
r1527r1528
22 'Swinging Singles' by Ent. Ent. Ltd
33 driver by Tomasz Slanina
44
5
56 Crap XXX game.
67 Three roms contains text "BY YACHIYO"
78
89 Upper half of 7.bin = upper half of 8.bin = intentional or bad dump ?
910
1011 TODO:
11 - colors (proms ? one of unk writes?)
12 - colors (missing prom(s) ?)
1213 - samples (at least two of unused roms contains samples (unkn. format , adpcm ?)
1314 - dips (one is tested in game (difficulty related?), another 2 are tested at start)
1415
1516 Unknown reads/writes:
1617 - AY i/o ports (writes)
1718 - mem $c000, $c001 = protection device ? if tests fails, game crashes (problems with stack - skipped code with "pop af")
18 - i/o port $8 = data read used for  $e command arg for onr of AY chips (volume? - could be a sample player (based on volume changes?)
19 - i/o port $1a = 1 or 0, rarely accessed
20 - i/o ports $fe,$ff (pair, unknown device , $fe = register, $ff = data ?? sample player)
21   initialized with data:
19 - i/o port $8 = data read used for  $e command arg for one of AY chips (volume? - could be a sample player (based on volume changes?)
20 - i/o port $1a = 1 or 0, rarely accessed, related to crt  writes
2221
23 0 34
24 1 24
25 2 2c
26 3 14
27 4 f
28 5 0
29 6 e
30 7 e
31 8 0
32 9 f
33 a 0
34 b 0
35 c 0
36 d 0
37 e 0
38 f 0
39
4022*/
4123
4224#include "driver.h"
4325#include "sound/ay8910.h"
26#include "video/crtc6845.h"
4427
45static UINT8* ssingles_vram;
28static UINT8 *ssingles_videoram;
29static UINT8 *ssingles_colorram;
30static UINT8 prot_data;
4631
47static WRITE8_HANDLER(ssingles_vram_w)
32#define NUM_PENS (4*8)
33#define VMEM_SIZE 0x100
34static pen_t pens[NUM_PENS];
35
36//fake palette
37static const UINT8 ssingles_colors[NUM_PENS*3]=
4838{
49   ssingles_vram[offset]=data;
50}
39   0x00,0x00,0x00,   0xff,0xff,0xff, 0xff,0x00,0x00,   0x80,0x00,0x00,
40   0x00,0x00,0x00,   0xf0,0xf0,0xf0,   0xff,0xff,0x00, 0x40,0x40,0x40,
41   0x00,0x00,0x00,   0xff,0xff,0xff,   0xff,0x00,0x00,   0xff,0xff,0x00,
42   0x00,0x00,0x00,   0xff,0xff,0x00,   0xd0,0x00,0x00,   0x80,0x00,0x00,
43   0x00,0x00,0x00,   0xff,0x00,0x00,   0xff,0xff,0x00,   0x80,0x80,0x00,
44   0x00,0x00,0x00,   0xff,0x00,0x00,   0x40,0x40,0x40,   0xd0,0xd0,0xd0,
45   0x00,0x00,0x00,   0x00,0x00,0xff,   0x60,0x40,0x30,   0xff,0xff,0x00,
46   0x00,0x00,0x00,   0xff,0x00,0xff,   0x80,0x00,0x80,   0x40,0x00,0x40
47};
5148
52static VIDEO_START(ssingles)
49static void update_row(mame_bitmap *bitmap, const rectangle *cliprect,
50      UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param)
5351{
54}
52   int cx,x;
53   UINT32 tile_address;
54   UINT16 cell,palette;
55   UINT8 b0,b1;
5556
56static VIDEO_UPDATE(ssingles)
57{
58   int x,y;
59   int addr=0;
60   for(y=0;y<32;y++)
57   for(cx=0;cx<x_count;++cx)
6158   {
62      for(x=0;x<18;x++)
59      int address=((ma>>1)+(cx>>1))&0xff;
60
61      cell=ssingles_videoram[address]+(ssingles_colorram[address]<<8);
62
63      tile_address=((cell&0x3ff)<<4)+ra;
64      palette=(cell>>10)&0x1c;
65
66      if(cx&1)
6367      {
64         int    code=ssingles_vram[addr]+256*(ssingles_vram[addr+0x800]&3);
65         addr++;
68         b0=memory_region(REGION_GFX1)[tile_address+0x0000]; /*  9.bin */
69         b1=memory_region(REGION_GFX1)[tile_address+0x8000]; /* 11.bin */
70      }
71      else
72      {
73         b0=memory_region(REGION_GFX1)[tile_address+0x4000]; /* 10.bin */
74         b1=memory_region(REGION_GFX1)[tile_address+0xc000]; /* 12.bin */
75      }
6676
67         drawgfx(bitmap,machine->gfx[0],
68               code,
69               0,
70               0,0,
71               x<<4, y<<4,
72               0,TRANSPARENCY_NONE,0);
77      for(x=7;x>=0;--x)
78      {
79         *BITMAP_ADDR32(bitmap, y, (cx<<3)|(x)) = pens[palette+((b1&1)|((b0&1)<<1))];
80         b0>>=1;
81         b1>>=1;
7382      }
7483   }
75   return 0;
7684}
7785
78static READ8_HANDLER(prot_r)
86static const crtc6845_interface crtc6845_intf =
7987{
80      int address=activecpu_get_pc();
81      switch(address)
82      {
83         case 0x638c:
84         case 0x638e: return 0;    //    not used = device reset /clear ?
85         case 0x6392: return 0x80; //1st check
86         case 0x639c: return 0xc4;   //2nd check
87         default: logerror("unk protection read @ %x\n",address);
88      }
89      return 0;
88      0,
89      1000000, /* ? MHz */
90      8,
91      NULL,
92      update_row,
93      NULL,
94      NULL
95};
96
97static WRITE8_HANDLER(ssingles_videoram_w)
98{
99   ssingles_videoram[offset]=data;
90100}
91101
92static WRITE8_HANDLER(prot_w)
102static WRITE8_HANDLER(ssingles_colorram_w)
93103{
94   int address=activecpu_get_pc();
95      switch(address)
104   ssingles_colorram[offset]=data;
105}
106
107static VIDEO_START(ssingles)
108{
109   crtc6845_config(0, &crtc6845_intf);
110
111   {
112      int i;
113      for(i=0;i<NUM_PENS;++i)
96114      {
97         case 0x6390:
98         case 0x639a: break;// do nothing
99         default: logerror("unk protection write %x @ %x\n",data,address);
115         pens[i]=MAKE_RGB(ssingles_colors[3*i], ssingles_colors[3*i+1], ssingles_colors[3*i+2]);
100116      }
117   }
101118}
102119
120
121static READ8_HANDLER(c000_r)
122{
123   return prot_data;
124}
125
126static READ8_HANDLER(c001_r)
127{
128   prot_data=0xc4;
129   return 0;
130}
131
132static WRITE8_HANDLER(c001_w)
133{
134   prot_data^=data^0x11;
135}
136
103137static READ8_HANDLER(controls_r)
104138{
105139   int data=7;
r1527r1528
117151}
118152
119153static ADDRESS_MAP_START( ssingles_map, ADDRESS_SPACE_PROGRAM, 8 )
120   AM_RANGE(0x0000, 0x1fff) AM_READ( MRA8_ROM ) AM_WRITE(ssingles_vram_w)
121   AM_RANGE(0xc000, 0xc001) AM_READWRITE( prot_r, prot_w ) //protection
154   AM_RANGE(0x0000, 0x00ff) AM_WRITE(ssingles_videoram_w)
155   AM_RANGE(0x0800, 0x08ff) AM_WRITE(ssingles_colorram_w)
156   AM_RANGE(0x0000, 0x1fff) AM_READ( MRA8_ROM )
157   AM_RANGE(0xc000, 0xc000) AM_READ( c000_r )
158   AM_RANGE(0xc001, 0xc001) AM_READWRITE( c001_r, c001_w )
122159   AM_RANGE(0x6000, 0xbfff) AM_ROM
123160   AM_RANGE(0xf800, 0xffff) AM_RAM
124161ADDRESS_MAP_END
r1527r1528
133170   AM_RANGE(0x16, 0x16) AM_READ(input_port_2_r)
134171   AM_RANGE(0x18, 0x18) AM_READ(input_port_3_r)
135172   AM_RANGE(0x1c, 0x1c) AM_READ(controls_r)
136   AM_RANGE(0x1a, 0x1a) AM_WRITENOP
137   AM_RANGE(0xfe, 0xff) AM_WRITENOP
173   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)
176
138177ADDRESS_MAP_END
139178
140179static INPUT_PORTS_START( ssingles )
r1527r1528
208247   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
209248INPUT_PORTS_END
210249
211static const gfx_layout charlayout =
212{
213   16,16,
214   RGN_FRAC(1,4),
215   2,
216   { 0, RGN_FRAC(1,2) },
217   { RGN_FRAC(1,4),RGN_FRAC(1,4)+ 1,RGN_FRAC(1,4)+ 2,RGN_FRAC(1,4)+ 3,RGN_FRAC(1,4)+ 4,RGN_FRAC(1,4)+ 5,RGN_FRAC(1,4) + 6,RGN_FRAC(1,4) + 7,0,1,2,3,4,5,6,7 },
218   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8},
219   8*8*2
220};
221
222static GFXDECODE_START( ssingles )
223   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0x0000, 1 )
224GFXDECODE_END
225
226250static MACHINE_DRIVER_START( ssingles )
227251   MDRV_CPU_ADD(Z80,4000000)       /* ? MHz */
228252   MDRV_CPU_PROGRAM_MAP(ssingles_map,0)
229253   MDRV_CPU_IO_MAP(ssingles_io_map,0)
230254   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
255
231256   MDRV_SCREEN_REFRESH_RATE(60)
232257   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
233258
234259   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
235   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
236   MDRV_SCREEN_SIZE(288, 288)
260   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
261   MDRV_SCREEN_RAW_PARAMS(4000000, 256, 0, 256, 256, 0, 256)   /* temporary, CRTC will configure screen */
237262
238   MDRV_SCREEN_VISIBLE_AREA(0*8, 288-1, 0*8, 224-1)
263   MDRV_PALETTE_LENGTH(4) //guess
239264
240   MDRV_GFXDECODE(ssingles)
241   MDRV_PALETTE_LENGTH(16*4) //guess
242
243265   MDRV_VIDEO_START(ssingles)
244   MDRV_VIDEO_UPDATE(ssingles)
266   MDRV_VIDEO_UPDATE(crtc6845)
245267
246268   /* sound hardware */
247269   MDRV_SPEAKER_STANDARD_MONO("mono")
r1527r1528
267289   ROM_LOAD( "11.bin", 0x8000, 0x4000, CRC(f7107b29) SHA1(a405926fd3cb4b3d2a1c705dcde25d961dba5884) )
268290   ROM_LOAD( "12.bin", 0xc000, 0x4000, CRC(e5585a93) SHA1(04d55699b56d869066f2be2c6ac48042aa6c3108) )
269291
270   ROM_REGION( 0x08000, REGION_USER1, 0 ) /* samples ? */
292   ROM_REGION( 0x08000, REGION_USER1, 0) /* samples ? data ?*/
271293   ROM_LOAD( "5.bin", 0x00000, 0x2000, CRC(242a8dda) SHA1(e140893cc05fb8cee75904d98b02626f2565ed1b) )
272294   ROM_LOAD( "6.bin", 0x02000, 0x2000, CRC(85ab8aab) SHA1(566f034e1ba23382442f27457447133a0e0f1cfc) )
273295   ROM_LOAD( "7.bin", 0x04000, 0x2000, CRC(57cc112d) SHA1(fc861c58ae39503497f04d302a9f16fca19b37fb) )
r1527r1528
277299
278300static DRIVER_INIT(ssingles)
279301{
280   ssingles_vram=auto_malloc(0x2000);
281   memset(ssingles_vram,0,0x2000);
282   state_save_register_global_pointer(ssingles_vram, 0x2000);
302   ssingles_videoram=auto_malloc(VMEM_SIZE);
303   ssingles_colorram=auto_malloc(VMEM_SIZE);
304   memset(ssingles_videoram,0,VMEM_SIZE);
305   memset(ssingles_colorram,0,VMEM_SIZE);
306   state_save_register_global_pointer(ssingles_videoram, VMEM_SIZE);
307   state_save_register_global_pointer(ssingles_colorram, VMEM_SIZE);
283308}
284309
285310GAME ( 1983, ssingles, 0, ssingles, ssingles, ssingles, ROT90, "Ent. Ent. Ltd", "Swinging Singles", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
src/mame/drivers/skyarmy.c
r1527r1528
170170        AM_RANGE(0x8000, 0x87FF) AM_WRITE(MWA8_RAM)
171171        AM_RANGE(0x8800, 0x8BFF) AM_WRITE(skyarmy_videoram_w) AM_BASE(&skyarmy_videoram) /* Video RAM */
172172        AM_RANGE(0x9000, 0x93FF) AM_WRITE(skyarmy_colorram_w) AM_BASE(&skyarmy_colorram) /* Color RAM */
173        AM_RANGE(0x9800, 0x983F) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* Sprites */
173        AM_RANGE(0x9800, 0x983F) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* Sprites */
174174        AM_RANGE(0x9840, 0x985F) AM_WRITE(skyarmy_scrollram_w) AM_BASE(&skyarmy_scrollram) /* Sprites */
175175        AM_RANGE(0xa004, 0xa004) AM_WRITE(nmi_enable_w) // ???
176176        AM_RANGE(0xa005, 0xa005) AM_WRITE(MWA8_NOP)
src/mame/drivers/ksayakyu.c
r1527r1528
117117   AM_RANGE(0xa806, 0xa806) AM_READ(sound_status_r)
118118   AM_RANGE(0xa807, 0xa807) AM_READ(MRA8_NOP) /* watchdog ? */
119119   AM_RANGE(0xa808, 0xa808) AM_WRITE(bank_select_w)
120   AM_RANGE(0xb000, 0xb7ff) AM_READWRITE(videoram_r, ksayakyu_videoram_w) AM_BASE(&videoram)
120   AM_RANGE(0xb000, 0xb7ff) AM_READWRITE(MRA8_RAM, ksayakyu_videoram_w) AM_BASE(&videoram)
121121   AM_RANGE(0xb800, 0xbfff) AM_READWRITE(MRA8_RAM, MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
122122ADDRESS_MAP_END
123123
src/mame/drivers/qix.c
r1527r1528
654654   /* basic machine hardware */
655655   MDRV_IMPORT_FROM(qix)
656656
657   MDRV_CPU_ADD(M68705, COIN_CLOCK_OSC/M68705_CLOCK_DIVIDER)   /* 1.00 MHz */
657   MDRV_CPU_ADD(M68705, COIN_CLOCK_OSC)   /* 1.00 MHz */
658658   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
659659
660660   MDRV_MACHINE_START(qixmcu)
src/mame/drivers/konamigq.c
r1527r1528
143143   cpunum_set_input_line(1, INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
144144}
145145
146static UINT32 eeprom_bit_r(void *param)
146static CUSTOM_INPUT( eeprom_bit_r )
147147{
148148   return EEPROM_read_bit();
149149}
r1527r1528
373373
374374static MACHINE_DRIVER_START( konamigq )
375375   /* basic machine hardware */
376   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
376   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
377377   MDRV_CPU_PROGRAM_MAP( konamigq_map, 0 )
378378   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
379379
src/mame/drivers/cps3.c
r1527r1528
11421142            int xsizedraw2 = ((value3 & 0x007f0000)>>16);
11431143            int xx,yy;
11441144
1145            int tilestable[4] = { 8,1,2,4 };
1145            static const int tilestable[4] = { 8,1,2,4 };
11461146            int ysize2 = ((value3 & 0x0000000c)>>2);
11471147            int xsize2 = ((value3 & 0x00000003)>>0);
11481148            UINT32 xinc,yinc;
r1527r1528
19671967   }
19681968}
19691969
1970static UINT32* tilemap20_regs_base;
1971static UINT32* tilemap30_regs_base;
1972static UINT32* tilemap40_regs_base;
1973static UINT32* tilemap50_regs_base;
1974
19751970//<ElSemi> +0 X  +2 Y +4 unknown +6 enable (&0x8000) +8 low part tilemap base, high part linescroll base
19761971//<ElSemi> (a word each)
19771972
src/mame/drivers/gaelco.c
r1527r1528
663663
664664static int decrypt(int game, int key, int high_word, int low_word)
665665{
666   int swaps[4][16] =
666   static const int swaps[4][16] =
667667   {
668668      { 5,7,9,12,2,14,13,15,3,6,8,11,4,10,0,1 },
669669      { 11,2,5,14,8,13,10,4,7,12,0,6,15,9,1,3 },
r1527r1528
673673
674674   int dst[16],carry[16];
675675   int i;
676   int *s = swaps[key & 3];
676   const int *s = swaps[key & 3];
677677   int flag1 = BIT(high_word, 9) ^ BIT(high_word, 12) ^ 1;
678678   int flag2 = game ? BIT(high_word, 10) : (BIT(high_word, 9) ^ BIT(high_word, 10));
679679
src/mame/drivers/crbaloon.c
r1527r1528
11/***************************************************************************
22
3Crazy Balloon memory map (preliminary)
3    Taito Crazy Balloon hardware
44
50000-2fff ROM
64000-43ff RAM
74800-4bff Video RAM
85000-53ff Color RAM
5    Copyright Nicola Salmoria and the MAME Team.
96
10I/O:
7    To-Do:
8        * Video timing from schematics
9        * Watchdog length from schematics
10        * Interrupt timing from schematics
11        * DIP switches
12        * Faithfully implement the custom chips
13        * Coin counter and lock-out
1114
12read:
1300        dsw
1401        joystick
1502        bit 0-3 from chip PC3259 (bit 3 is the sprite/char collision detection)
16          bit 4-7 dsw
1703        bit 0 dsw
18          bit 1 high score name reset
19          bit 2 service
20          bit 3 tilt
21          bit 4-7 from chip PC3092; coin inputs & start buttons
2206-0a-0e  mirror addresses for 02; address lines 2 and 3 go to the PC3256 chip
23          so they probably alter its output, while the dsw bits (4-7) stay the same.
24
25write:
2601        ?
2702        bit 0-3 sprite code bit 4-7 sprite color
2803        sprite X pos
2904        sprite Y pos
3005        music?? to a counter?
3106        sound
32          bit 0 IRQ enable/acknowledge
33          bit 1 sound enable
34          bit 2 sound related (to amplifier)
35          bit 3 explosion (to 76477)
36          bit 4 breath (to 76477)
37          bit 5 appear (to 76477)
38          bit 6 sound related (to 555)
39          bit 7 to chip PC3259
4007        to chip PC3092 (bits 0-3)
4108        to chip PC3092 (bits 0-3)
42          bit 0 seems to be flip screen
43          bit 1 might enable coin input
4409        to chip PC3092 (bits 0-3)
450a        to chip PC3092 (bits 0-3)
460b        to chip PC3092 (bits 0-3)
470c        MSK (to chip PC3259)
480d        CC (not used)
49
5015***************************************************************************/
5116
5217#include "driver.h"
53#include "sound/sn76477.h"
54#include "sound/custom.h"
5518#include "crbaloon.h"
5619
5720
21static UINT8 *pc3092_data;
5822
59static UINT8 val06,val08,val0a;
6023
61static MACHINE_START( crbaloon )
24
25/*************************************
26 *
27 *  PC3092 custom chip
28 *
29 *  Inputs:  pins 1-4   - D0-D3 of data bus
30 *           pin 5      - 1P ENTRY (start button 1)
31 *           pin 6      - 2P ENTRY (start button 2)
32 *           pin 7      - COIN
33 *           pin 8      - /4HN (pixel timing)
34 *           pin 9      - port 0x0a written to
35 *           pin 10     - port 0x08 written to
36 *           pin 11     - port 0x07 written to
37 *           pin 13     - /RESET
38 *           pin 14     - port 0x09 written to
39 *           pin 15     - port 0x0b written to
40 *
41 *  Outputs: pins 16-19 - D28-D31 of I/O bus
42 *           pin 20     - /V-INV (flip screen)
43 *           pin 21     - coin counter
44 *
45 *************************************/
46
47#define LOG_PC3092      0
48
49
50static void pc3092_reset(void)
6251{
63   state_save_register_global(val06);
64   state_save_register_global(val08);
65   state_save_register_global(val0a);
52   /* nothing yet */
6653}
6754
68static WRITE8_HANDLER( crbaloon_06_w )
55
56static void pc3092_update(void)
6957{
70   val06 = data;
58   flip_screen_set((pc3092_data[1] & 0x01) ? TRUE : FALSE);
59}
7160
72   interrupt_enable_w(offset,data & 1);
7361
74   /* SOUND STOP is really sound enable */
75   sound_global_enable(data & 0x02);
62static WRITE8_HANDLER( pc3092_w )
63{
64   pc3092_data[offset] = data & 0x0f;
7665
77   /* enable is connected to EXPLOSION */
78   SN76477_enable_w(0, (data & 0x08) ? 1 : 0);
66   if (LOG_PC3092) logerror("%04X:  write PC3092 #%d = 0x%02x\n", safe_activecpu_get_pc(), offset, pc3092_data[offset]);
7967
80   /* BREATH changes slf_res to 10k (middle of two 10k resistors) */
81   /* it also puts a tantal capacitor against GND on the output,
82       but this section of the schematics is not readable. */
83   SN76477_slf_res_w(0, (data & 0x10) ? RES_K(10) : RES_K(20) );
68   pc3092_update();
69}
8470
85   /* APPEAR is connected to MIXER B */
86   SN76477_mixer_b_w(0, (data & 0x20) ? 1 : 0);
8771
88   discrete_sound_w(CRBALOON_MUSIC_EN, data & 0x04);
89   discrete_sound_w(CRBALOON_LAUGH_EN, data & 0x40);
90}
91
92static WRITE8_HANDLER( crbaloon_08_w )
72static CUSTOM_INPUT( pc3092_r )
9373{
94   val08 = data;
74   UINT32 ret;
9575
96   crbaloon_flipscreen_w(offset,data & 1);
76   /* enable coin & start input? Wild guess!!! */
77   if (pc3092_data[1] & 0x02)
78      ret = readinputportbytag("PC3092");
79   else
80      ret = 0x00;
81
82   if (LOG_PC3092) logerror("%04X:  read  PC3092 = 0x%02x\n", safe_activecpu_get_pc(), ret);
83
84   return ret;
9785}
9886
99static WRITE8_HANDLER( crbaloon_0a_w )
87
88
89/*************************************
90 *
91 *  PC3259 custom chip -
92 *  collision detection
93 *
94 *  Inputs:  pins 1-10  - 128V/64V/32V/16V/8V
95 *                        128H/64H/32H/16H/8H
96 *                        video timing lines
97 *           pin 11     - CLK
98 *           pin 13     - /HTCLR
99 *           pin 14     - MVID
100 *           pin 15     - T1
101 *           pin 16     - D7 of SOUND port buffer
102 *           pin 21/22  - AD2/AD3 of address bus
103 *           pin 23     - MSK (port 0x0c written to)
104 *
105 *  Outputs: pins 17-20 - D24-D27 of I/O bus
106 *
107 *************************************/
108
109#define LOG_PC3259      0
110
111
112static void pc3259_update(void)
100113{
101   val0a = data;
114   /* nothing yet */
102115}
103116
104static READ8_HANDLER( crbaloon_IN2_r )
117
118static READ8_HANDLER( pc3259_r )
105119{
106   if (crbaloon_collision != 0)
120   UINT8 ret = 0;
121   UINT8 reg = offset >> 2;
122
123   UINT16 collision_address = crbaloon_get_collision_address();
124   int collided = (collision_address != 0xffff);
125
126   switch (reg)
107127   {
108      return (input_port_2_r(0) & 0xf0) | 0x08;
109    }
128   case 0x00:
129      ret = collided ? (collision_address & 0x0f) : 0;
130      break;
110131
111   /* the following is needed for the game to boot up */
112   if (val06 & 0x80)
113   {
114logerror("PC %04x: %02x high\n",activecpu_get_pc(),offset);
115      return (input_port_2_r(0) & 0xf0) | 0x07;
132   case 0x01:
133      ret = collided ? ((collision_address >> 4) & 0x0f) : 0;
134      break;
135
136   case 0x02:;
137      ret = collided ? (collision_address >> 8) : 0;
138      break;
139
140   default:
141   case 0x03:
142      ret = collided ? 0x08 : 0x07;
143      break;
116144   }
117   else
118   {
119logerror("PC %04x: %02x low\n",activecpu_get_pc(),offset);
120      return (input_port_2_r(0) & 0xf0) | 0x07;
121   }
122}
123145
124static READ8_HANDLER( crbaloon_IN3_r )
125{
126   if (val08 & 0x02)
127      /* enable coin & start input? Wild guess!!! */
128      return input_port_3_r(0);
146   if (LOG_PC3259) logerror("%04X:  read PC3259 #%d = 0x%02x\n", safe_activecpu_get_pc(), reg, ret);
129147
130   /* the following is needed for the game to boot up */
131   if (val0a & 0x01)
132   {
133logerror("PC %04x: 03 high\n",activecpu_get_pc());
134      return (input_port_3_r(0) & 0x0f) | 0x00;
135   }
136   else
137   {
138logerror("PC %04x: 03 low\n",activecpu_get_pc());
139      return (input_port_3_r(0) & 0x0f) | 0x00;
140   }
148   return ret | (readinputportbytag("DSW1") & 0xf0);
141149}
142150
143151
144static READ8_HANDLER( crbaloon_IN_r )
152
153/*************************************
154 *
155 *  I/O ports
156 *
157 *************************************/
158
159static WRITE8_HANDLER( port_sound_w )
145160{
146   switch (offset & 0x03)
147   {
148      case 0:
149         return input_port_0_r(offset);
161   /* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */
162   cpu_interrupt_enable(0, (data & 0x01) ? TRUE : FALSE);
163   crbaloon_set_clear_collision_address((data & 0x01) ? TRUE : FALSE);
150164
151      case 1:
152         return input_port_1_r(offset);
165   /* D1 - SOUND STOP */
166   sound_global_enable((data & 0x02) ? TRUE : FALSE);
153167
154      case 2:
155         return crbaloon_IN2_r(offset);
168   /* D2 - unlabeled - music enable */
169   crbaloon_audio_set_music_enable((data & 0x04) ? TRUE : FALSE);
156170
157      case 3:
158         return crbaloon_IN3_r(offset);
159   }
171   /* D3 - EXPLOSION */
172   crbaloon_audio_set_explosion_enable((data & 0x08) ? TRUE : FALSE);
160173
161   return 0;
174   /* D4 - BREATH */
175   crbaloon_audio_set_breath_enable((data & 0x10) ? TRUE : FALSE);
176
177   /* D5 - APPEAR */
178   crbaloon_audio_set_appear_enable((data & 0x20) ? TRUE : FALSE);
179
180   /* D6 - unlabeled - laugh enable */
181   crbaloon_audio_set_laugh_enable((data & 0x40) ? TRUE : FALSE);
182
183   /* D7 - unlabeled - goes to PC3259 pin 16 */
184
185   pc3259_update();
162186}
163187
164static WRITE8_HANDLER( crbaloon_tone_w )
188
189static WRITE8_HANDLER( port_music_w )
165190{
166   discrete_sound_w(CRBALOON_MUSIC_DATA, data);
191   crbaloon_audio_set_music_freq(data);
167192}
168193
169194
170195
171static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
172   AM_RANGE(0x0000, 0x2fff) AM_READ(MRA8_ROM)
173   AM_RANGE(0x4000, 0x43ff) AM_READ(MRA8_RAM)
174   AM_RANGE(0x4800, 0x4bff) AM_READ(MRA8_RAM)
175   AM_RANGE(0x5000, 0x53ff) AM_READ(MRA8_RAM)
176ADDRESS_MAP_END
196/*************************************
197 *
198 *  Memory handlers
199 *
200 *************************************/
177201
178static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
179   AM_RANGE(0x0000, 0x2fff) AM_WRITE(MWA8_ROM)
180   AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM)
181   AM_RANGE(0x4800, 0x4bff) AM_WRITE(crbaloon_videoram_w) AM_BASE(&videoram)
182   AM_RANGE(0x5000, 0x53ff) AM_WRITE(crbaloon_colorram_w) AM_BASE(&colorram)
202static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
203   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )   /* A15 is not decoded */
204   AM_RANGE(0x0000, 0x3fff) AM_ROM      /* not fully populated */
205   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM
206   AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0x0400) AM_READWRITE(MRA8_RAM, crbaloon_videoram_w) AM_BASE(&crbaloon_videoram)
207   AM_RANGE(0x5000, 0x53ff) AM_MIRROR(0x0400) AM_READWRITE(MRA8_RAM, crbaloon_colorram_w) AM_BASE(&crbaloon_colorram)
208   AM_RANGE(0x5800, 0x7fff) AM_NOP
183209ADDRESS_MAP_END
184210
185static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
186   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
187   AM_RANGE(0x00, 0x0f) AM_READ(crbaloon_IN_r)
188ADDRESS_MAP_END
189211
190static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
191   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
192   AM_RANGE(0x02, 0x04) AM_WRITE(crbaloon_spritectrl_w)
193   AM_RANGE(0x05, 0x05) AM_WRITE(crbaloon_tone_w)
194   AM_RANGE(0x06, 0x06) AM_WRITE(crbaloon_06_w)
195   AM_RANGE(0x08, 0x08) AM_WRITE(crbaloon_08_w)
196   AM_RANGE(0x0a, 0x0a) AM_WRITE(crbaloon_0a_w)
212
213/*************************************
214 *
215 *  Port handlers
216 *
217 *************************************/
218
219static ADDRESS_MAP_START( main_io_map, ADDRESS_SPACE_IO, 8 )
220   ADDRESS_MAP_FLAGS( AMEF_ABITS(4) )
221   AM_RANGE(0x00, 0x00) AM_MIRROR(0x0c) AM_READ(port_tag_to_handler8("DSW0"))
222   AM_RANGE(0x01, 0x01) AM_MIRROR(0x0c) AM_READ(port_tag_to_handler8("IN0"))
223/*  AM_SPACE(0x02, 0x03) AM_READ(pc3259_r) crashes if not at the end */
224   AM_RANGE(0x03, 0x03) AM_MIRROR(0x0c) AM_READ(port_tag_to_handler8("IN1"))
225
226   AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP)   /* not connected */
227   AM_RANGE(0x01, 0x01) AM_WRITE(MWA8_NOP) /* watchdog */
228   AM_RANGE(0x02, 0x04) AM_WRITE(MWA8_RAM) AM_BASE(&crbaloon_spriteram)
229   AM_RANGE(0x05, 0x05) AM_WRITE(port_music_w)
230   AM_RANGE(0x06, 0x06) AM_WRITE(port_sound_w)
231   AM_RANGE(0x07, 0x0b) AM_WRITE(pc3092_w) AM_BASE(&pc3092_data)
232   AM_RANGE(0x0c, 0x0c) AM_WRITE(MWA8_NOP) /* MSK - to PC3259 */
233   AM_RANGE(0x0d, 0x0d) AM_WRITE(MWA8_NOP) /* schematics has it in a box marked "NOT USE" */
234   AM_RANGE(0x0e, 0x0f) AM_WRITE(MWA8_NOP)
235
236   AM_SPACE(0x02, 0x03) AM_READ(pc3259_r)
197237ADDRESS_MAP_END
198238
199239
200240
241/*************************************
242 *
243 *  Port definition
244 *
245 *************************************/
246
201247static INPUT_PORTS_START( crbaloon )
202   PORT_START_TAG("DSW0") // 0
203   PORT_DIPNAME( 0x01, 0x01, "Test?" )
248   PORT_START_TAG("DSW0")
249   PORT_DIPNAME( 0x01, 0x01, "Test?" ) PORT_DIPLOCATION("SW A:1")
204250   PORT_DIPSETTING(    0x01, "I/O Check?" )
205251   PORT_DIPSETTING(    0x00, "RAM Check?" )
206   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
252   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW A:2")
207253   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
208254   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
209   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )
255   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW A:3,4")
210256   PORT_DIPSETTING(    0x00, "2" )
211257   PORT_DIPSETTING(    0x04, "3" )
212258   PORT_DIPSETTING(    0x08, "4" )
213259   PORT_DIPSETTING(    0x0c, "5" )
214   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) )
260   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW A:5")
215261   PORT_DIPSETTING(    0x00, "5000" )
216262   PORT_DIPSETTING(    0x10, "10000" )
217   PORT_DIPNAME( 0xe0, 0x80, DEF_STR( Coinage ) )
263   PORT_DIPNAME( 0xe0, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW A:6,7,8")
218264   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
219265   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )
220266   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
r1527r1528
224270   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_4C ) )
225271   PORT_DIPSETTING(    0x00, "Disable" )
226272
227   PORT_START_TAG("IN0") // 1
273   PORT_START_TAG("IN0")
228274   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
229275   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
230276   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
r1527r1528
234280   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
235281   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
236282
237   PORT_START_TAG("DSW1") // 2
238   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* from chip PC3259 */
239   PORT_DIPNAME( 0x10, 0x10, "Invulnerability (Cheat)")
283   PORT_START_TAG("DSW1")
284   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* PC3259 */
285   PORT_DIPNAME( 0x10, 0x10, "Invulnerability") PORT_DIPLOCATION("SW B:1")
240286   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
241287   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
242   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
288   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW B:2")
243289   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
244290   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
245   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
291   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW B:3")
246292   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
247293   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
248   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
294   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW B:4")
249295   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
250296   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
251297
252   PORT_START_TAG("IN1") // 3
253   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
298   PORT_START_TAG("IN1")
299   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW B:5")
254300   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
255301   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("High Score Name Reset")
257   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )   /* should be COIN2 */
302   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Name Reset")
303   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
258304   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
259   /* the following four bits come from chip PC3092 */
260   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
261   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
262   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
263   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
305   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(pc3092_r, 0)
264306
265   PORT_START_TAG("VR2") // 4
307   PORT_START_TAG("PC3092")
308   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
309   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
310   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
311   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
312
313   PORT_START_TAG("VR2")
266314   PORT_ADJUSTER(50, "VR2 - Beep")
267315
268   PORT_START_TAG("VR3") // 5
316   PORT_START_TAG("VR3")
269317   PORT_ADJUSTER(50, "VR3 - Music")
270318
271319INPUT_PORTS_END
r1527r1528
282330   { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
283331   8*8   /* every char takes 8 consecutive bytes */
284332};
285static const gfx_layout spritelayout =
286{
287   32,32,   /* 32*32 sprites */
288   16,   /* 16 sprites */
289   1,   /* 1 bit per pixel */
290   { 0 },
291   { 3*32*8+0, 3*32*8+1, 3*32*8+2, 3*32*8+3, 3*32*8+4, 3*32*8+5, 3*32*8+6, 3*32*8+7,
292         2*32*8+0, 2*32*8+1, 2*32*8+2, 2*32*8+3, 2*32*8+4, 2*32*8+5, 2*32*8+6, 2*32*8+7,
293         1*32*8+0, 1*32*8+1, 1*32*8+2, 1*32*8+3, 1*32*8+4, 1*32*8+5, 1*32*8+6, 1*32*8+7,
294         0*32*8+0, 0*32*8+1, 0*32*8+2, 0*32*8+3, 0*32*8+4, 0*32*8+5, 0*32*8+6, 0*32*8+7 },
295   { 31*8, 30*8, 29*8, 28*8, 27*8, 26*8, 25*8, 24*8,
296         23*8, 22*8, 21*8, 20*8, 19*8, 18*8, 17*8, 16*8,
297         15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8,
298         7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
299   32*4*8  /* every sprite takes 128 consecutive bytes */
300};
301333
302334
303335static GFXDECODE_START( crbaloon )
304   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,   0, 16 )
305   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 0, 16 )
336   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
306337GFXDECODE_END
307338
308339
309static const struct SN76477interface sn76477_interface =
340
341/*************************************
342 *
343 *  Machine reset
344 *
345 *************************************/
346
347MACHINE_RESET( crballoon )
310348{
311   RES_K( 47),   /*  4 noise_res          */
312   RES_K(330),   /*  5 filter_res         */
313   CAP_P(470),   /*  6 filter_cap         */
314   RES_K(220),   /*  7 decay_res          */
315   CAP_U(1.0),   /*  8 attack_decay_cap   */
316   RES_K(4.7),   /* 10 attack_res         */
317   RES_M(  1),   /* 11 amplitude_res      */
318   RES_K(200),   /* 12 feedback_res       */
319   5.0,      /* 16 vco_voltage        */
320   CAP_P(470),   /* 17 vco_cap            */
321   RES_K(330),   /* 18 vco_res            */
322   5.0,      /* 19 pitch_voltage      */
323   RES_K( 20),   /* 20 slf_res (variable) */
324   CAP_P(420),   /* 21 slf_cap            */
325   CAP_U(1.0),   /* 23 oneshot_cap        */
326   RES_K( 47),   /* 24 oneshot_res        */
327   0,         /* 22 vco                */
328   0,         /* 26 mixer A            */
329   0,         /* 25 mixer B (variable) */
330   1,         /* 27 mixer C            */
331   1,         /* 1  envelope 1         */
332   0,         /* 28 envelope 2         */
333   0         /* 9  enable (variable)  */
334};
349   pc3092_reset();
350   port_sound_w(0, 0);
351   port_music_w(0, 0);
352}
335353
336354
355
356/*************************************
357 *
358 *  Machine driver
359 *
360 *************************************/
361
337362static MACHINE_DRIVER_START( crbaloon )
338363
339364   /* basic machine hardware */
340   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz ????? */
341   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
342   MDRV_CPU_IO_MAP(readport,writeport)
365   MDRV_CPU_ADD(Z80, CRBALOON_MASTER_XTAL / 3)
366   MDRV_CPU_PROGRAM_MAP(main_map,0)
367   MDRV_CPU_IO_MAP(main_io_map,0)
343368   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
344369
345   MDRV_SCREEN_REFRESH_RATE(60)
346   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
370   MDRV_MACHINE_RESET(crballoon)
347371
348   MDRV_MACHINE_START(crbaloon)
372   /* video hardware */
373   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
374   MDRV_VIDEO_START(crbaloon)
375   MDRV_VIDEO_UPDATE(crbaloon)
349376
350   /* video hardware */
351   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
352   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
353   MDRV_SCREEN_SIZE(32*8, 32*8)
354   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
355377   MDRV_GFXDECODE(crbaloon)
356378   MDRV_PALETTE_LENGTH(16)
379   MDRV_PALETTE_INIT(crbaloon)
357380   MDRV_COLORTABLE_LENGTH(16*2)
358381
359   MDRV_PALETTE_INIT(crbaloon)
360   MDRV_VIDEO_START(crbaloon)
361   MDRV_VIDEO_UPDATE(crbaloon)
382   MDRV_SCREEN_REFRESH_RATE(60)
383   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
384   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
385   MDRV_SCREEN_SIZE(32*8, 32*8)
386   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
362387
363   /* sound hardware */
364   MDRV_SPEAKER_STANDARD_MONO("mono")
388   /* audio hardware */
389   MDRV_IMPORT_FROM(crbaloon_audio)
365390
366   MDRV_SOUND_ADD(SN76477, 0)
367   MDRV_SOUND_CONFIG(sn76477_interface)
368   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.0)
369
370   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
371   MDRV_SOUND_CONFIG_DISCRETE(crbaloon)
372   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
373391MACHINE_DRIVER_END
374392
375393
376394
377/***************************************************************************
395/*************************************
396 *
397 *  ROM definitions
398 *
399 *************************************/
378400
379  Game driver(s)
380
381***************************************************************************/
382
383401ROM_START( crbaloon )
384402   ROM_REGION( 0x10000, REGION_CPU1, 0 )
385403   ROM_LOAD( "cl01.bin",     0x0000, 0x0800, CRC(9d4eef0b) SHA1(a8dd814ac2612073982123c91fa62deaf5bee242) )
r1527r1528
392410   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
393411   ROM_LOAD( "cl07.bin",     0x0000, 0x0800, CRC(2c1fbea8) SHA1(41cf2aef74d56173057886512d989f6fa3682056) )
394412
395   ROM_REGION( 0x0800, REGION_GFX2, ROMREGION_DISPOSE )
413   ROM_REGION( 0x0800, REGION_GFX2, 0 )
396414   ROM_LOAD( "cl08.bin",     0x0000, 0x0800, CRC(ba898659) SHA1(4291059b113ff91896f1f61a4c14956716edfe1e) )
397415ROM_END
398416
417
399418ROM_START( crbalon2 )
400419   ROM_REGION( 0x10000, REGION_CPU1, 0 )
401420   ROM_LOAD( "cl01.bin",     0x0000, 0x0800, CRC(9d4eef0b) SHA1(a8dd814ac2612073982123c91fa62deaf5bee242) )
r1527r1528
408427   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
409428   ROM_LOAD( "cl07.bin",     0x0000, 0x0800, CRC(2c1fbea8) SHA1(41cf2aef74d56173057886512d989f6fa3682056) )
410429
411   ROM_REGION( 0x0800, REGION_GFX2, ROMREGION_DISPOSE )
430   ROM_REGION( 0x0800, REGION_GFX2, 0 )
412431   ROM_LOAD( "cl08.bin",     0x0000, 0x0800, CRC(ba898659) SHA1(4291059b113ff91896f1f61a4c14956716edfe1e) )
413432ROM_END
414433
415434
416435
436/*************************************
437 *
438 *  Game drivers
439 *
440 *************************************/
441
417442GAME( 1980, crbaloon, 0,      crbaloon, crbaloon, 0, ROT90, "Taito Corporation", "Crazy Balloon (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
418443GAME( 1980, crbalon2, crbaloon, crbaloon, crbaloon, 0, ROT90, "Taito Corporation", "Crazy Balloon (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/munchmo.c
r1527r1528
3535WRITE8_HANDLER( mnchmobl_sprite_attr_w );
3636READ8_HANDLER( mnchmobl_sprite_tile_r );
3737WRITE8_HANDLER( mnchmobl_sprite_tile_w );
38READ8_HANDLER( mnchmobl_videoram_r );
39WRITE8_HANDLER( mnchmobl_videoram_w );
4038VIDEO_UPDATE( mnchmobl );
4139
4240
r1527r1528
7775   AM_RANGE(0xac00, 0xafff) AM_READ(mnchmobl_sprite_tile_r) /* mirrored */
7876   AM_RANGE(0xb000, 0xb3ff) AM_READ(MRA8_RAM)
7977   AM_RANGE(0xb400, 0xb7ff) AM_READ(mnchmobl_sprite_attr_r) /* mirrored */
80   AM_RANGE(0xb800, 0xb8ff) AM_READ(MRA8_RAM)
81   AM_RANGE(0xb900, 0xb9ff) AM_READ(mnchmobl_videoram_r)   /* mirrored */
78   AM_RANGE(0xb800, 0xb8ff) AM_MIRROR(0x0100) AM_READ(MRA8_RAM)
8279   AM_RANGE(0xbe02, 0xbe02) AM_READ(input_port_3_r) /* DSW1 */
8380   AM_RANGE(0xbe03, 0xbe03) AM_READ(input_port_4_r) /* DSW2 */
8481   AM_RANGE(0xbf01, 0xbf01) AM_READ(input_port_0_r) /* coin, start */
r1527r1528
9592   AM_RANGE(0xac00, 0xafff) AM_WRITE(mnchmobl_sprite_tile_w)
9693   AM_RANGE(0xb000, 0xb3ff) AM_WRITE(MWA8_RAM) AM_BASE(&mnchmobl_sprite_attr)
9794   AM_RANGE(0xb400, 0xb7ff) AM_WRITE(mnchmobl_sprite_attr_w)
98   AM_RANGE(0xb800, 0xb9ff) AM_WRITE(mnchmobl_videoram_w) AM_BASE(&videoram)
95   AM_RANGE(0xb800, 0xb8ff) AM_MIRROR(0x0100) AM_WRITE(MWA8_RAM) AM_BASE(&videoram)
9996   AM_RANGE(0xba00, 0xbbff) AM_WRITE(MWA8_RAM)
10097   AM_RANGE(0xbc00, 0xbc7f) AM_WRITE(MWA8_RAM) AM_BASE(&mnchmobl_status_vram)
10198   AM_RANGE(0xbe00, 0xbe00) AM_WRITE(mnchmobl_soundlatch_w)
src/mame/drivers/btoads.c
r1527r1528
339339
340340static MACHINE_DRIVER_START( btoads )
341341
342   MDRV_CPU_ADD(TMS34020, CPU_CLOCK/2/TMS34020_CLOCK_DIVIDER)
342   MDRV_CPU_ADD(TMS34020, CPU_CLOCK/2)
343343   MDRV_CPU_CONFIG(tms_config)
344344   MDRV_CPU_PROGRAM_MAP(main_map,0)
345345
r1527r1528
354354
355355   /* video hardware */
356356   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
357   MDRV_PALETTE_LENGTH(256)
357   MDRV_VIDEO_START(btoads)
358   MDRV_VIDEO_UPDATE(tms340x0)
358359
359360   MDRV_SCREEN_ADD("main", 0)
360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
361   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
361362   MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 640, 0, 512, 257, 0, 224)
362363
363   MDRV_VIDEO_START(btoads)
364   MDRV_VIDEO_UPDATE(tms340x0)
365
366364   /* sound hardware */
367365   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
368366
src/mame/drivers/lastduel.c
r1527r1528
296296   MDRV_CPU_PROGRAM_MAP(madgear_readmem,madgear_writemem)
297297   MDRV_CPU_VBLANK_INT(madgear_interrupt,3)   /* 1 for vbl, 2 for control reads?? */
298298
299   MDRV_CPU_ADD(Z80, 3579545)
300   /* audio CPU */ /* Accurate */
299   MDRV_CPU_ADD(Z80, XTAL_3_579545MHz) /* verified on pcb */
300   /* audio CPU */
301301   MDRV_CPU_PROGRAM_MAP(mg_sound_readmem,mg_sound_writemem)
302302
303303   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
318318   /* sound hardware */
319319   MDRV_SPEAKER_STANDARD_MONO("mono")
320320
321   MDRV_SOUND_ADD(YM2203, 3579545)
321   MDRV_SOUND_ADD(YM2203, XTAL_3_579545MHz) /* verified on pcb */
322322   MDRV_SOUND_CONFIG(ym2203_interface)
323323   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
324324
325   MDRV_SOUND_ADD(YM2203, 3579545)
325   MDRV_SOUND_ADD(YM2203, XTAL_3_579545MHz) /* verified on pcb */
326326   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
327327
328   MDRV_SOUND_ADD(OKIM6295, 1024188)
329   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
328   MDRV_SOUND_ADD(OKIM6295, XTAL_10MHz/10)
329   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* verified on pcb */
330330   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.98)
331331MACHINE_DRIVER_END
332332
src/mame/drivers/drgnmst.c
r1527r1528
362362   MDRV_CPU_PROGRAM_MAP(drgnmst_main_map, 0)
363363   MDRV_CPU_VBLANK_INT(irq2_line_hold,1)
364364
365   MDRV_CPU_ADD(PIC16C55, ((32000000/8)/PIC16C5x_CLOCK_DIVIDER))   /* Confirmed */
365   MDRV_CPU_ADD(PIC16C55, 32000000/8)   /* Confirmed */
366366   /* Program and Data Maps are internal to the MCU */
367367   MDRV_CPU_IO_MAP(drgnmst_sound_io_map, 0)
368368
src/mame/drivers/vicdual.c
r1527r1528
8282}
8383
8484
85static UINT32 vicdual_read_coin_status(void *param)
85static CUSTOM_INPUT( vicdual_read_coin_status )
8686{
8787   UINT32 coin_input = readinputportbytag(COIN_PORT_TAG);
8888
r1527r1528
143143}
144144
145145
146static UINT32 vicdual_get_64v(void *param)
146static CUSTOM_INPUT( vicdual_get_64v )
147147{
148148   return (get_vcounter() >> 6) & 0x01;
149149}
150150
151151
152static UINT32 vicdual_get_vblank_comp(void *param)
152static CUSTOM_INPUT( vicdual_get_vblank_comp )
153153{
154154   return (get_vcounter() < VICDUAL_VBSTART);
155155}
156156
157157
158static UINT32 vicdual_get_composite_blank_comp(void *param)
158static CUSTOM_INPUT( vicdual_get_composite_blank_comp )
159159{
160160   return (vicdual_get_vblank_comp(0) && !video_screen_get_hblank(0));
161161}
r1527r1528
167167}
168168
169169
170static UINT32 vicdual_get_timer_value(void *param)
170static CUSTOM_INPUT( vicdual_get_timer_value )
171171{
172172   /* start the timer, if this is the first call */
173173   if (!timer_started)
r1527r1528
20302030}
20312031
20322032
2033static UINT32 samurai_protection_r(int offset)
2033static CUSTOM_INPUT( samurai_protection_r )
20342034{
2035   int offset = (FPTR)param;
20352036   UINT32 answer = 0;
20362037
20372038   if (samurai_protection_data == 0xab)
src/mame/drivers/pturn.c
r1527r1528
278278
279279   AM_RANGE(0xdfe0, 0xdfe0) AM_NOP
280280
281   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(pturn_videoram_w) AM_READ(videoram_r) AM_BASE(&videoram)
281   AM_RANGE(0xe000, 0xe3ff) AM_READWRITE(MRA8_RAM, pturn_videoram_w) AM_BASE(&videoram)
282282   AM_RANGE(0xe400, 0xe400) AM_WRITE(fgpalette_w)
283283   AM_RANGE(0xe800, 0xe800) AM_WRITE(sound_w)
284284
src/mame/drivers/getrivia.c
r1527r1528
726726   ROM_LOAD( "high_icb_6-25a",    0x0e000, 0x2000, CRC(6ddc1750) SHA1(ee19206b7f4a98e3e7647414127f4e09b3e9134f) )
727727   /* Banked roms */
728728   ROM_LOAD( "jokerpoker_cb_10-19-88",    0x10000, 0x2000, CRC(a590af75) SHA1(63bc64fbc9ac0c489b1f4894d77a4be13d7251e7) )
729   ROM_LOAD( "horserace_icb_1-1-87",      0x12000, 0x2000, CRC(6d5092e3) SHA1(ef99d1b858aef3c438c61c2b17e371dc6aca6623) )
729730ROM_END
730731
731732GAME( 1982, m075,     0,        gselect,  gselect,  0, ROT0, "Greyhound Electronics", "M075 Poker (Version 16.03B)",            GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
src/mame/drivers/ssv.c
r1527r1528
951951                                Twin Eagle II
952952***************************************************************************/
953953
954/* standalone board based on SSV hardware */
954/* comes as either a standalone board or a standard SSV rom board (verified) */
955955
956956static ADDRESS_MAP_START( twineag2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
957957   AM_RANGE(0x010000, 0x03ffff) AM_READ(MRA16_RAM            )   // More RAM
src/mame/drivers/metro.c
r1527r1528
2323---------------------------------------------------------------------------
242492  Last Fortress - Toride      VG420       14100
252592  Last Fortress - Toride (Ger)VG460-(A)   14100
2692  Pang Poms                   VG420       14100
2692  Pang Pom's                  VG420       14100
272792  Sky Alert                   VG420       14100
282892  The Karate Tournament       VG460-B     14100
292993? Lady Killer / Moeyo Gonta!! VG460-B     14100
r1527r1528
16811681
16821682
16831683/***************************************************************************
1684                                Pang Poms
1684                                Pang Pom's
16851685***************************************************************************/
16861686
16871687static ADDRESS_MAP_START( pangpoms_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r1527r1528
25952595   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
25962596   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 )
25972597   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
2598   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START3 )
2599   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START4 )
2598   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
2599   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
26002600INPUT_PORTS_END
26012601
26022602/***************************************************************************
r1527r1528
32113211
32123212
32133213/***************************************************************************
3214                                Pang Poms
3214                                Pang Pom's
32153215***************************************************************************/
32163216
32173217static INPUT_PORTS_START( pangpoms )
r1527r1528
55095509
55105510/***************************************************************************
55115511
5512Pang Poms (c) 1992 Metro
5512Pang Pom's (c) 1992 Metro
55135513
55145514Pcb code:  VG420 (Same as Toride)
55155515
r1527r1528
58785878
58795879/*     year  rom       clone     machine   inputs    init */
58805880GAME( 1992, karatour, 0,        karatour, karatour, karatour, ROT0,   "Mitchell",                   "The Karate Tournament",           GAME_IMPERFECT_GRAPHICS )
5881GAME( 1992, pangpoms, 0,        pangpoms, pangpoms, metro,    ROT0,   "Metro",                      "Pang Poms"                          , 0 )
5882GAME( 1992, pangpomm, pangpoms, pangpoms, pangpoms, metro,    ROT0,   "Metro (Mitchell license)",   "Pang Poms (Mitchell)"               , 0 )
5881GAME( 1992, pangpoms, 0,        pangpoms, pangpoms, metro,    ROT0,   "Metro",                      "Pang Pom's"                         , 0 )
5882GAME( 1992, pangpomm, pangpoms, pangpoms, pangpoms, metro,    ROT0,   "Metro (Mitchell license)",   "Pang Pom's (Mitchell)"              , 0 )
58835883GAME( 1992, skyalert, 0,        skyalert, skyalert, metro,    ROT270, "Metro",                      "Sky Alert"                          , 0 )
58845884GAME( 1993?,ladykill, 0,        karatour, ladykill, karatour, ROT90,  "Yanyaka (Mitchell license)", "Lady Killer",                     GAME_IMPERFECT_GRAPHICS )
58855885GAME( 1993?,moegonta, ladykill, karatour, moegonta, karatour, ROT90,  "Yanyaka",                    "Moeyo Gonta!! (Japan)",           GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/hshavoc.c
r1527r1528
214214   int x;
215215   UINT16 *src = (UINT16 *)memory_region(REGION_CPU1);
216216
217   UINT16 typedat[16] = {
217   static const UINT16 typedat[16] = {
218218      1,1,1,1, 1,1,1,1,
219219      1,0,0,1, 1,0,1,1
220220      };
src/mame/drivers/midvunit.c
r1527r1528
301301
302302      /* bit 0x200 selects internal clocking, which is 1/2 the main CPU clock rate */
303303      if (data & 0x200)
304         timer_rate = (double)Machine->drv->cpu[0].clock * 0.5;
304         timer_rate = (double)(cpunum_get_clock(0) * 0.5);
305305      else
306306         timer_rate = 10000000.;
307307   }
src/mame/drivers/firebeat.c
r1527r1528
14611461
14621462static TIMER_CALLBACK( keyboard_timer_callback )
14631463{
1464   const int kb_uart_channel[2] = { 1, 0 };
1464   static const int kb_uart_channel[2] = { 1, 0 };
14651465   int keyboard;
14661466   int i;
14671467
src/mame/drivers/bigevglf.c
r1527r1528
492492        2 irqs/frame give good music tempo but also SOUND ERROR in test mode,
493493        4 irqs/frame give SOUND OK in test mode but music seems to be running too fast */
494494
495   MDRV_CPU_ADD(M68705,2000000/M68705_CLOCK_DIVIDER)   /* ??? */
495   MDRV_CPU_ADD(M68705,2000000)   /* ??? */
496496   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
497497
498498   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/bagman.c
r1527r1528
212212   AM_RANGE(0xc000, 0xffff) AM_WRITE(MWA8_ROM)   /* Super Bagman only */
213213   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* hidden portion of color RAM */
214214                           /* here only to initialize the pointer, */
215                           /* writes are handled by colorram_w */
215                           /* writes are handled by bagman_colorram_w */
216216   AM_RANGE(0xa800, 0xa805) AM_WRITE(bagman_ls259_w) /* TMS5110 driving state machine */
217217   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(MWA8_NOP)   /* written to, but unused */
218218   AM_RANGE(0xa004, 0xa004) AM_WRITE(bagman_coin_counter_w)
r1527r1528
243243   AM_RANGE(0xa003, 0xa003) AM_WRITE(MWA8_RAM) AM_BASE(&bagman_video_enable)
244244   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* hidden portion of color RAM */
245245                           /* here only to initialize the pointer, */
246                           /* writes are handled by colorram_w */
246                           /* writes are handled by bagman_colorram_w */
247247   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(MWA8_NOP)   /* written to, but unused */
248248   AM_RANGE(0xa004, 0xa004) AM_WRITE(bagman_coin_counter_w)
249249#if 0
src/mame/drivers/dunhuang.c
r1527r1528
5454#include "sound/okim6295.h"
5555#include "sound/2413intf.h"
5656
57#define DUNHUANG_DEBUG   0
58
5759/***************************************************************************
5860                                Video Hardware
5961***************************************************************************/
r1527r1528
113115{
114116   int layers_ctrl = -1;
115117
116#ifdef MAME_DEBUG
118#if DUNHUANG_DEBUG
117119if (input_code_pressed(KEYCODE_Z))
118120{
119121   int msk = 0;
src/mame/drivers/kncljoe.c
r1527r1528
3939
4040static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
4141   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
42   AM_RANGE(0xc000, 0xcfff) AM_READ(videoram_r)      /* videoram */
42   AM_RANGE(0xc000, 0xcfff) AM_READ(MRA8_RAM)      /* videoram */
4343   AM_RANGE(0xd800, 0xd800) AM_READ(input_port_0_r) /* IN 0 */
4444   AM_RANGE(0xd801, 0xd801) AM_READ(input_port_1_r) /* IN 1 */
4545   AM_RANGE(0xd802, 0xd802) AM_READ(input_port_2_r) /* IN 2 */
src/mame/drivers/cvs.c
r1527r1528
472472 *
473473 *************************************/
474474
475static MACHINE_START( cvs )
475MACHINE_START( cvs )
476476{
477477   /* allocate memory */
478478   cvs_color_ram = auto_malloc(0x400);
r1527r1528
651651
652652static GFXDECODE_START( cvs )
653653   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,                  0, 256+3 )   /* chars */
654     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #1  */
655     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #2  */
656     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )    /* s2636 #3  */
654     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #1 */
655     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #2 */
656     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #3 */
657657GFXDECODE_END
658658
659659
r1527r1528
683683   MDRV_MACHINE_START(cvs)
684684
685685   /* video hardware */
686   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
686   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
687687   MDRV_VIDEO_START(cvs)
688688   MDRV_VIDEO_UPDATE(cvs)
689689
src/mame/drivers/seta.c
r1527r1528
66
77
88CPU    :    68000 + [65C02] (only in the earlier games)
9Custom :    X1-001A  X1-002A            Sprites
9Custom :    X1-001A  X1-002A (SDIP64)   Sprites
1010            X1-001
1111            X1-002
1212            X1-003
13            X1-004
13            X1-004           (SDIP52)   Inputs
1414            X1-005   X0-005
1515            X1-006   X0-006
16            X1-007
17            X1-010                      Sound: 16 Bit PCM
18            X1-011 [x2]  X1-012 [x2]    Tilemaps
16            X1-007           (SDIP42)   Vide DAC
17            X1-010           (QFP80)    Sound: 16 Bit PCM
18            X1-011   X1-012  (QFP100)   Tilemaps
1919            X1-014                      Sprites?
2020
2121-------------------------------------------------------------------------------
r1527r1528
3535P0-055-B                89 Wit's                            Athena
3636P0-055-D                90 Thunder & Lightning              Romstar / Visco
3737Promat PCB              94 Wiggie Waggie(5)                 --
38P0-058-C                98 Internation Toote (6)            Coinmaster
3839P0-063-A                91 Rezon                            Allumer
3940P0-068-B (M6100723A)    92 Block Carnival                   Visco
4041P0-072-2 (prototype)    92 Blandia (prototype)              Allumer
r1527r1528
6263P0-120-A (BP954KA)      95 Gundhara                         Banpresto
6364PO-122-A (SZR-001)      95 Zombie Raid                      American Sammy
6465?                       96 Crazy Fight                      Subsino
65
6666-------------------------------------------------------------------------------
6767(1) YM2203 + YM3812 instead of X1-010
6868(2) wrong colors
r1527r1528
7575    there are a few gfx emulation bugs (flipping of some border tiles and
7676    sprites not leaving the screen correctly) its possible the custom hw
7777    doesn't behave *exactly* the same as the original seta hw
78(6) To enter test mode press 9 (open door), then F2 (turn function key), then E (bet 3-4).
7879
7980Notes:
8081- The NEC D4701 used by Caliber 50 is a mouse interface IC (uPD4701c).
r1527r1528
12561257
12571258***************************************************************************/
12581259
1260/***************************************************************************
1261                                Internation Toote
12591262
1263Main PCB (P0-058C):
1264
1265    TOSHIBA TMP68HC000N-16
1266    X1-010
1267    X1-001A
1268    X1-002A
1269    X1-004 (x2)
1270    X1-007
1271    X1-011
1272    X1-012
1273    HD63B50P
1274
1275Horse Race I/O Expansion (PCB-HRE-000):
1276
1277    MC68B50CP (x2)
1278    EF68B21P  (x2)
1279
1280Note: on screen copyright is (c)1998 Coinmaster.
1281      The I/O board has      (c)1993 Coinmaster.
1282
1283***************************************************************************/
1284
12601285#include "driver.h"
12611286#include "seta.h"
1287#include "machine/6821pia.h"
1288#include "machine/6850acia.h"
1289#include "machine/msm6242.h"
12621290#include "sound/2203intf.h"
12631291#include "sound/2612intf.h"
12641292#include "sound/3812intf.h"
r1527r1528
12911319   UINT16 max = uPD71054.max[no]&0xffff;
12921320
12931321   if( max != 0 ) {
1294      attotime period = attotime_mul(ATTOTIME_IN_HZ(Machine->drv->cpu[0].clock), 16 * max);
1322      attotime period = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(0)), 16 * max);
12951323      timer_adjust( uPD71054.timer[no], period, no, attotime_zero );
12961324   } else {
12971325      timer_adjust( uPD71054.timer[no], attotime_never, no, attotime_never);
r1527r1528
30713099   AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_BASE(&spriteram16_2)   // Sprites Code + X + Attr
30723100ADDRESS_MAP_END
30733101
3102/***************************************************************************
3103                             International Toote
3104***************************************************************************/
30743105
3106static READ16_HANDLER( inttoote_dsw_r )
3107{
3108   int shift = offset * 4;
3109   return   ((((readinputport(0) >> shift)     & 0xf)) << 0) |
3110         ((((readinputport(1) >> shift)     & 0xf)) << 4) |
3111         ((((readinputport(1) >> (shift+8)) & 0xf)) << 8) ;
3112}
3113
3114static UINT16 *inttoote_key_select;
3115static READ16_HANDLER( inttoote_key_r )
3116{
3117   switch( *inttoote_key_select )
3118   {
3119      case 0x08:   return readinputport(4+0);
3120      case 0x10:   return readinputport(4+1);
3121      case 0x20:   return readinputport(4+2);
3122      case 0x40:   return readinputport(4+3);
3123      case 0x80:   return readinputport(4+4);
3124   }
3125   logerror("%06X: unknown read, select = %04x\n",activecpu_get_pc(),*inttoote_key_select);
3126   return 0xffff;
3127}
3128
3129static UINT16 *inttoote_700000;
3130static READ16_HANDLER( inttoote_700000_r )
3131{
3132   return inttoote_700000[offset] & 0x3f;
3133}
3134
3135static ADDRESS_MAP_START( inttoote_map, ADDRESS_SPACE_PROGRAM, 16 )
3136   AM_RANGE(0x000000, 0x1fffff) AM_ROM   // ROM (up to 2MB)
3137
3138   AM_RANGE(0x200000, 0x200001) AM_READWRITE(inttoote_key_r, MWA16_RAM) AM_BASE(&inttoote_key_select)
3139   AM_RANGE(0x200002, 0x200003) AM_READ(input_port_2_word_r)
3140   AM_RANGE(0x200010, 0x200011) AM_READWRITE(input_port_3_word_r, MWA16_NOP)
3141
3142   AM_RANGE(0x300000, 0x300001) AM_WRITE(watchdog_reset16_w)   // Watchdog
3143
3144   AM_RANGE(0x300010, 0x300011) AM_WRITE(MWA16_NOP)   // lev1 ack
3145   AM_RANGE(0x300020, 0x300021) AM_WRITE(MWA16_NOP)   // lev2 ack
3146   AM_RANGE(0x300040, 0x300041) AM_WRITE(MWA16_NOP)   // lev4 ack
3147   AM_RANGE(0x300060, 0x300061) AM_WRITE(MWA16_NOP)   // lev6 ack
3148
3149   AM_RANGE(0x500000, 0x500003) AM_READ(inttoote_dsw_r)   // DSW x 3
3150
3151   AM_RANGE(0x700000, 0x700101) AM_READWRITE(inttoote_700000_r,MWA16_RAM) AM_BASE(&inttoote_700000)
3152
3153   AM_RANGE(0x800000, 0x80001f) AM_READWRITE(msm6242_lsb_r,msm6242_lsb_w)   // 6242RTC
3154
3155   AM_RANGE(0x900000, 0x903fff) AM_READWRITE( seta_sound_word_r, seta_sound_word_w      )   // Sound
3156
3157   AM_RANGE(0xa00000, 0xa00005) AM_WRITE(MWA16_RAM) AM_BASE(&seta_vctrl_0      )   // VRAM 0&1 Ctrl
3158   AM_RANGE(0xb00000, 0xb03fff) AM_READWRITE(MRA16_RAM,seta_vram_0_w) AM_BASE(&seta_vram_0   )   // VRAM 0&1
3159
3160   AM_RANGE(0xc00000, 0xc00001) AM_RAM      // ? 0x4000
3161
3162   AM_RANGE(0xd00000, 0xd00607) AM_RAM   AM_BASE(&spriteram16      )   // Sprites Y
3163   AM_RANGE(0xe00000, 0xe03fff) AM_RAM   AM_BASE(&spriteram16_2      )   // Sprites Code + X + Attr
3164
3165   AM_RANGE(0xffc000, 0xffffff) AM_RAM   // RAM
3166ADDRESS_MAP_END
3167
3168
30753169/***************************************************************************
30763170
30773171
r1527r1528
62496343   PORT_DIPSETTING(      0x0000, "3" )
62506344INPUT_PORTS_END
62516345
6346/***************************************************************************
6347                             International Toote
6348***************************************************************************/
62526349
6350static INPUT_PORTS_START( inttoote )
6351   PORT_START_TAG("IN0")   // DSW 1
6352   PORT_DIPNAME( 0x03, 0x03, "Max Bet" )
6353   PORT_DIPSETTING(    0x03, "10" )
6354   PORT_DIPSETTING(    0x02, "20" )
6355   PORT_DIPSETTING(    0x01, "99" )
6356//  PORT_DIPSETTING(    0x00, "99" )
6357   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coinage ) )
6358   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
6359   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
6360   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
6361   PORT_DIPSETTING(    0x10, DEF_STR( 1C_4C ) )
6362   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_5C ) )
6363   PORT_DIPSETTING(    0x08, "1 Coin/10 Credits" )
6364   PORT_DIPSETTING(    0x04, "1 Coin/20 Credits" )
6365   PORT_DIPSETTING(    0x00, "1 Coin/50 Credits" )
6366   PORT_DIPNAME( 0x08, 0x08, "Unknown 1-3" )
6367   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
6368   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6369   PORT_DIPNAME( 0x10, 0x10, "Unknown 1-4" )
6370   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
6371   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6372   PORT_DIPNAME( 0x20, 0x20, "Unknown 1-5" )
6373   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6374   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6375   PORT_DIPNAME( 0x40, 0x40, "Unknown 1-6" )
6376   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6377   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6378   PORT_DIPNAME( 0x80, 0x80, "Unknown 1-7" )
6379   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6380   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6381
6382   PORT_START_TAG("IN1")   // DSW 2&3
6383   PORT_DIPNAME( 0x0001, 0x0001, "Unknown 2-0" )
6384   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
6385   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6386   PORT_DIPNAME( 0x0002, 0x0002, "Unknown 2-1" )
6387   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
6388   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6389   PORT_DIPNAME( 0x0004, 0x0004, "Unknown 2-2" )
6390   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
6391   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6392   PORT_DIPNAME( 0x0018, 0x0018, "Betting Clock Speed" )
6393   PORT_DIPSETTING(      0x0018, "Slowest" )
6394   PORT_DIPSETTING(      0x0010, "Slower" )
6395   PORT_DIPSETTING(      0x0008, "Faster" )
6396   PORT_DIPSETTING(      0x0000, "Fastest" )
6397   PORT_DIPNAME( 0x01e0, 0x01e0, "Payout Rate" )
6398   PORT_DIPSETTING(      0x01e0, "80%" )
6399   PORT_DIPSETTING(      0x01c0, "81%" )
6400   PORT_DIPSETTING(      0x01a0, "82%" )
6401   PORT_DIPSETTING(      0x0180, "83%" )
6402   PORT_DIPSETTING(      0x0160, "84%" )
6403   PORT_DIPSETTING(      0x0140, "85%" )
6404   PORT_DIPSETTING(      0x0120, "86%" )
6405   PORT_DIPSETTING(      0x0100, "87%" )
6406   PORT_DIPSETTING(      0x00e0, "88%" )
6407   PORT_DIPSETTING(      0x00c0, "89%" )
6408   PORT_DIPSETTING(      0x00a0, "90%" )
6409   PORT_DIPSETTING(      0x0080, "91%" )
6410   PORT_DIPSETTING(      0x0060, "92%" )
6411   PORT_DIPSETTING(      0x0040, "93%" )
6412   PORT_DIPSETTING(      0x0020, "94%" )
6413   PORT_DIPSETTING(      0x0000, "95%" )
6414   PORT_DIPNAME( 0x0200, 0x0200, "Unknown 3-1" )
6415   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
6416   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6417   PORT_DIPNAME( 0x0400, 0x0400, "Payout" )
6418   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
6419   PORT_DIPSETTING(      0x0400, DEF_STR( On ) )
6420   PORT_DIPNAME( 0x0800, 0x0800, "Horses" )
6421   PORT_DIPSETTING(      0x0800, "Random" )
6422   PORT_DIPSETTING(      0x0000, "Cyclic" )
6423   PORT_DIPNAME( 0x1000, 0x1000, "Higher Odds" )
6424   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
6425   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6426   PORT_DIPNAME( 0x2000, 0x2000, "Unknown 3-5" )
6427   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
6428   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6429   PORT_DIPNAME( 0x4000, 0x4000, "Unknown 3-6" )
6430   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
6431   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6432   PORT_DIPNAME( 0x8000, 0x8000, "Unknown 3-7" )
6433   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
6434   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
6435
6436   PORT_START_TAG("IN2")
6437   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
6438   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
6439   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SPECIAL ) // P1 coin out
6440   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
6441   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
6442   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
6443   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
6444   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
6445   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
6446   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
6447   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SPECIAL )   // P2 coin out
6448   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
6449   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6450   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6451   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6452   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6453
6454   PORT_START_TAG("IN3")
6455   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Door Open") PORT_TOGGLE
6456   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START1 )
6457   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Question Mark")
6458   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
6459   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
6460   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
6461   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
6462   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
6463   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
6464   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
6465   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
6466   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
6467   PORT_SERVICE( 0x1000, IP_ACTIVE_LOW )   // Function menu (electronic key switch, fitted beneath the front panel)
6468   PORT_BIT( 0x6000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6469   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) // Battery (0 = OK, 1 = NG)
6470/*
6471    Betting Panel         (keys)
6472
6473    1 1-2 2-3 3-4 4-5 5-6 (1QWERT)
6474    2 1-3 2-4 3-5 4-6     (2ASDF)
6475    3 1-4 2-5 3-6         (3ZXC)
6476    4 1-5 2-6             (4YU)
6477    5 1-6                 (5H)
6478    6                     (6)
6479*/
6480   PORT_START_TAG("IN4")   // 200000.w (0x08)
6481   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1") PORT_CODE(KEYCODE_1_PAD)
6482   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2") PORT_CODE(KEYCODE_2_PAD)
6483   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3") PORT_CODE(KEYCODE_3_PAD)
6484   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4") PORT_CODE(KEYCODE_4_PAD)
6485   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5") PORT_CODE(KEYCODE_5_PAD)
6486   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
6487   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
6488   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
6489   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1") //PORT_CODE(KEYCODE_)
6490   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2") //PORT_CODE(KEYCODE_)
6491   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3") //PORT_CODE(KEYCODE_)
6492   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4") //PORT_CODE(KEYCODE_)
6493   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5") //PORT_CODE(KEYCODE_)
6494   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6495   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6496   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6497
6498   PORT_START_TAG("IN5")   // 200000.w (0x10)
6499   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 6") PORT_CODE(KEYCODE_6_PAD)
6500   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Collect")
6501   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
6502   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
6503   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Cancel")
6504   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
6505   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
6506   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
6507   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 6") //PORT_CODE(KEYCODE_)
6508   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Collect") //PORT_CODE(KEYCODE_)
6509   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
6510   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
6511   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Cancel") //PORT_CODE(KEYCODE_)
6512   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6513   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6514   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6515
6516   PORT_START_TAG("IN6")   // 200000.w (0x20)
6517   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-2") PORT_CODE(KEYCODE_Q)
6518   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-3") PORT_CODE(KEYCODE_A)
6519   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-4") PORT_CODE(KEYCODE_Z)
6520   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-5") PORT_CODE(KEYCODE_Y)
6521   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-6") PORT_CODE(KEYCODE_H)
6522   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
6523   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
6524   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
6525   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-2") //PORT_CODE(KEYCODE_)
6526   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-3") //PORT_CODE(KEYCODE_)
6527   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-4") //PORT_CODE(KEYCODE_)
6528   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-5") //PORT_CODE(KEYCODE_)
6529   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-6") //PORT_CODE(KEYCODE_)
6530   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6531   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6532   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6533
6534   PORT_START_TAG("IN7")   // 200000.w (0x40)
6535   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-3") PORT_CODE(KEYCODE_W)
6536   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-4") PORT_CODE(KEYCODE_S)
6537   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-5") PORT_CODE(KEYCODE_X)
6538   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-6") PORT_CODE(KEYCODE_U)
6539   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-4") PORT_CODE(KEYCODE_E)
6540   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
6541   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
6542   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
6543   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-3") //PORT_CODE(KEYCODE_)
6544   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-4") //PORT_CODE(KEYCODE_)
6545   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-5") //PORT_CODE(KEYCODE_)
6546   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-6") //PORT_CODE(KEYCODE_)
6547   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-4") //PORT_CODE(KEYCODE_)
6548   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6549   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6550   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6551
6552   PORT_START_TAG("IN8")   // 200000.w (0x80)
6553   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-5") PORT_CODE(KEYCODE_D)
6554   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-6") PORT_CODE(KEYCODE_C)
6555   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-5") PORT_CODE(KEYCODE_R)
6556   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-6") PORT_CODE(KEYCODE_F)
6557   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5-6") PORT_CODE(KEYCODE_T)
6558   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
6559   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
6560   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
6561   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-5") //PORT_CODE(KEYCODE_)
6562   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-6") //PORT_CODE(KEYCODE_)
6563   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-5") //PORT_CODE(KEYCODE_)
6564   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-6") //PORT_CODE(KEYCODE_)
6565   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5-6") //PORT_CODE(KEYCODE_)
6566   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6567   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6568   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
6569INPUT_PORTS_END
6570
6571
62536572/***************************************************************************
62546573
62556574
r1527r1528
64826801   GFXDECODE_ENTRY( REGION_GFX3, 0, layout_packed_6bits_3roms, 16*32,       32 ) // [2] Layer 2
64836802GFXDECODE_END
64846803
6804/***************************************************************************
6805                             International Toote
6806***************************************************************************/
64856807
6808static GFXDECODE_START( inttoote )
6809   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_planes,             0,       32 ) // [0] Sprites
6810   GFXDECODE_ENTRY( REGION_GFX2, 0, layout_planes_2roms_split, 16*32*0, 32 ) // [1] Layer 1
6811GFXDECODE_END
64866812
64876813/***************************************************************************
64886814
r1527r1528
79548280   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
79558281MACHINE_DRIVER_END
79568282
8283/***************************************************************************
8284                             International Toote
8285***************************************************************************/
79578286
8287// Test mode shows a 16ms and 2ms counters
8288static INTERRUPT_GEN( inttoote_interrupt )
8289{
8290   switch (cpu_getiloops())
8291   {
8292      case 0:
8293      case 1:
8294      case 2:
8295      case 3:
8296      case 4:
8297      case 5:
8298      case 6:
8299      case 7:      cpunum_set_input_line(0, 6, HOLD_LINE);   break;
79588300
8301      case 8:      cpunum_set_input_line(0, 2, HOLD_LINE);   break;
8302
8303      case 9:      cpunum_set_input_line(0, 1, HOLD_LINE);   break;
8304
8305      case 10:   cpunum_set_input_line(0, 4, HOLD_LINE);   break;
8306   }
8307}
8308
8309static MACHINE_DRIVER_START( inttoote )
8310
8311   /* basic machine hardware */
8312   MDRV_CPU_ADD(M68000, 16000000)
8313   MDRV_CPU_PROGRAM_MAP(inttoote_map,0)
8314   MDRV_CPU_VBLANK_INT(inttoote_interrupt,8+1+1+1)
8315
8316   MDRV_SCREEN_REFRESH_RATE(60)
8317   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
8318
8319   /* video hardware */
8320   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
8321   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
8322   MDRV_SCREEN_SIZE(64*8, 32*8)
8323   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
8324   MDRV_GFXDECODE(inttoote)
8325   MDRV_PALETTE_LENGTH(512 * 1)   /* sprites, layer1, layer2 */
8326
8327   MDRV_PALETTE_INIT(inttoote)
8328   MDRV_VIDEO_START(seta_1_layer)
8329   MDRV_VIDEO_UPDATE(seta)
8330
8331   /* sound hardware */
8332   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
8333
8334   MDRV_SOUND_ADD(X1_010, 16000000)
8335   MDRV_SOUND_CONFIG(seta_sound_intf)
8336   MDRV_SOUND_ROUTE(0, "left", 1.0)
8337   MDRV_SOUND_ROUTE(1, "right", 1.0)
8338MACHINE_DRIVER_END
8339
8340
79598341/***************************************************************************
79608342
79618343                                ROMs Loading
r1527r1528
90039385   ROM_LOAD( "rom.u85",  0x00000, 0x40000, CRC(7b95d0bb) SHA1(f16dfd639eed6856e3ab93704caef592a07ba367) )
90049386ROM_END
90059387
9388ROM_START( inttoote )
9389   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* 68000 Code */
9390   ROM_LOAD16_BYTE( "p523.v01_horse_prog_2.002", 0x000000, 0x10000, CRC(6ce6f1ad) SHA1(82e7100721ca5b1a736f6523610b1f1edf225c12) )
9391   ROM_LOAD16_BYTE( "p523.v01_horse_prog_1.003", 0x000001, 0x10000, CRC(921fcff5) SHA1(cabc4e9936621132a6fbaa1a925d205c5f04a2ae) )
9392   ROM_FILL(                                     0x020000, 0x60000, 0xff )
9393   ROM_LOAD16_WORD_SWAP( "ya_002_001.u18",       0x100000, 0x80000, CRC(dd108016) SHA1(1554de4cc1a9436a1e62400cd96c9752a2098f99) )
9394   ROM_FILL(                                     0x180000, 0x80000, 0xff )
90069395
9396   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
9397   ROM_LOAD( "ya_011_004.u10",             0x000000, 0x80000, CRC(eb74d2e0) SHA1(221ff6cc03ce57a7fcbe418f1c12a293990f8a7d) )
9398   ROM_LOAD( "p523.v01_horse_fore_1.u135", 0x070000, 0x10000, CRC(3a75df30) SHA1(f3b3a7428e3e125921686bc9aacde6b28b1947b5) )
9399
9400   ROM_LOAD( "ya_011_005.u17",             0x080000, 0x80000, CRC(4a6c804b) SHA1(b596b9b0b3b453c26f9c7f976ff4d56eac4fac04) )
9401   ROM_LOAD( "p523.v01_horse_fore_2.u134", 0x0f0000, 0x10000, CRC(26fb0339) SHA1(a134ecef00f690c82c8bddf26498b357ccf8d5c3) )
9402
9403   ROM_LOAD( "ya_011_006.u22",             0x100000, 0x80000, CRC(bfae01a5) SHA1(3be83972c3987e9bf722cd6db7770f074587301c) )
9404   ROM_LOAD( "p523.v01_horse_fore_3.u133", 0x170000, 0x10000, CRC(c38596af) SHA1(d27141e28d8f8352f065c55121412e604c199a9a) )
9405
9406   ROM_LOAD( "ya_011_007.u27",             0x180000, 0x80000, CRC(2dc7a294) SHA1(97f2aa9939a45aaa94d4aeb2fcd5b7f30204b942) )
9407   ROM_LOAD( "p523.v01_horse_fore_4.u132", 0x1f0000, 0x10000, CRC(64ef345e) SHA1(ef5d9f293ded44a2be91278549f5db8673fc7571) )
9408
9409   ROM_REGION( 0xc0000, REGION_GFX2, ROMREGION_DISPOSE )   /* Layer 1 */
9410   ROM_LOAD( "ya_011_008.u35",             0x000000, 0x40000, CRC(4b890f83) SHA1(fde6544898a0691b550f3045803f2e81cfeb5fe9) )
9411   ROM_LOAD( "p523.v01_horse_back_1.u137", 0x040000, 0x20000, CRC(39b221ea) SHA1(3b3367430733ed36d6a981cd2ec6df731d07c089) )
9412
9413   ROM_LOAD( "ya_011_009.u41",             0x060000, 0x40000, CRC(caa5e3c1) SHA1(63cccc5479040a02872febc8d7f2d46096e138d1) )
9414   ROM_LOAD( "p523.v01_horse_back_2.u136", 0x0a0000, 0x20000, CRC(9c5e32a0) SHA1(964734a626b5c7b9d7130addc642895df520dcb7) )
9415
9416   ROM_REGION( 0x400, REGION_PROMS, 0 )   /* Colours */
9417   ROM_LOAD16_BYTE( "ya-010.prom",  0x000, 0x200, CRC(778094b3) SHA1(270329a0d544dc7a8240d6dab08ccd54ea87ab70) )
9418   ROM_LOAD16_BYTE( "ya-011.prom",  0x001, 0x200, CRC(bd4fe2f6) SHA1(83d9f9db3fbfa2d172f5227c397ea4d5a9687015) )
9419
9420   ROM_REGION( 0x100000, REGION_SOUND1, 0 )   /* Samples */
9421   ROM_LOAD( "ya_011_013.u71", 0x00000, 0x80000, CRC(2bccaf47) SHA1(1658643444d575410f11b648e0d7ae6c43fcf1ea) )
9422   ROM_LOAD( "ya_011_012.u64", 0x80000, 0x80000, CRC(a8015ce6) SHA1(bb0b589856ec82e1fd42be9af89b07ba1d17e595) )
9423ROM_END
9424
9425
90079426static READ16_HANDLER( twineagl_debug_r )
90089427{
90099428   /*  At several points in the code, the program checks if four
r1527r1528
92399658}
92409659
92419660/***************************************************************************
9661                             International Toote
9662***************************************************************************/
92429663
9664static const pia6821_interface inttoote_pia0_intf =
9665{
9666   /* PIA inputs: A, B, CA1, CB1, CA2, CB2 */
9667   0, 0, 0, 0, 0, 0,
9668
9669   /* PIA outputs: A, B, CA2, CB2 */
9670   0, 0, 0, 0,
9671
9672   /* PIA IRQs: A, B */
9673   0, 0
9674};
9675
9676static const pia6821_interface inttoote_pia1_intf =
9677{
9678   /* PIA inputs: A, B, CA1, CB1, CA2, CB2 */
9679   0, 0, 0, 0, 0, 0,
9680
9681   /* PIA outputs: A, B, CA2, CB2 */
9682   0, 0, 0, 0,
9683
9684   /* PIA IRQs: A, B */
9685   0, 0
9686};
9687
9688static DRIVER_INIT( inttoote )
9689{
9690   UINT16 *ROM = (UINT16 *)memory_region( REGION_CPU1 );
9691   static UINT16 seta_vregs_unused[3] = {0,0,0};
9692
9693   // missing / unused video regs
9694   seta_vregs = seta_vregs_unused;
9695
9696   // code patches (to be removed...)
9697   ROM[0x4de0/2] = 0x4e71;   // hardware test errors
9698   ROM[0x4de2/2] = 0x4e71;
9699
9700   ROM[0x368a/2] = 0x50f9;   // betting count down
9701
9702   /* Initializing PIAs... (to be done) */
9703   pia_config(0, &inttoote_pia0_intf);
9704   pia_config(1, &inttoote_pia1_intf);
9705}
9706
9707/***************************************************************************
9708
92439709                                Game Drivers
92449710
92459711***************************************************************************/
92469712
9247/* Working Games: */
9248
92499713/* 68000 + 65C02 */
92509714GAME( 1987, tndrcade, 0,        tndrcade, tndrcade, 0,        ROT270, "[Seta] (Taito license)", "Thundercade / Twin Formation" , 0) // Title/License: DSW
92519715GAME( 1987, tndrcadj, tndrcade, tndrcade, tndrcadj, 0,        ROT270, "[Seta] (Taito license)", "Tokusyu Butai U.A.G. (Japan)" , 0) // License: DSW
r1527r1528
92959759GAME( 1995, sokonuke, 0,        extdwnhl, sokonuke, 0,        ROT0,   "Sammy Industries",       "Sokonuke Taisen Game (Japan)", GAME_IMPERFECT_SOUND )
92969760GAME( 1995, zombraid, 0,        gundhara, zombraid, zombraid, ROT0,   "American Sammy",         "Zombie Raid (US)", GAME_NO_COCKTAIL )
92979761GAME( 1996, crazyfgt, 0,        crazyfgt, crazyfgt, crazyfgt, ROT0,   "Subsino",                "Crazy Fight", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
9762GAME( 1998, inttoote, 0,        inttoote, inttoote, inttoote, ROT0,   "Coinmaster",             "International Toote (Germany)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
src/mame/drivers/tnzs.c
r1527r1528
13731373   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
13741374   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
13751375
1376   MDRV_CPU_ADD(I8X41,(12000000/2)/I8X41_CLOCK_DIVIDER)   /* 400KHz ??? - Main board Crystal is 12MHz */
1376   MDRV_CPU_ADD(I8X41,12000000/2)   /* 400KHz ??? - Main board Crystal is 12MHz */
13771377   MDRV_CPU_PROGRAM_MAP(i8742_readmem,i8742_writemem)
13781378   MDRV_CPU_IO_MAP(i8742_readport,i8742_writeport)
13791379
src/mame/drivers/tp84.c
r1527r1528
471471static MACHINE_DRIVER_START( tp84 )
472472
473473   /* basic machine hardware */
474   MDRV_CPU_ADD_TAG("cpu1",M6809, 1500000)   /* ??? */
474   MDRV_CPU_ADD_TAG("cpu1",M6809, XTAL_18_432MHz/12) /* verified on pcb */
475475   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
476476   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
477477
478   MDRV_CPU_ADD(M6809, 1500000)   /* ??? */
478   MDRV_CPU_ADD(M6809, XTAL_18_432MHz/12)   /* verified on pcb */
479479   MDRV_CPU_PROGRAM_MAP(readmem_cpu2,writemem_cpu2)
480480   MDRV_CPU_VBLANK_INT(tp84_6809_interrupt,256)
481481
482   MDRV_CPU_ADD(Z80,14318180/4)
482   MDRV_CPU_ADD(Z80,XTAL_14_31818MHz/4) /* verified on pcb */
483483   /* audio CPU */
484484   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
485485
r1527r1528
504504   /* sound hardware */
505505   MDRV_SPEAKER_STANDARD_MONO("mono")
506506
507   MDRV_SOUND_ADD(SN76489A, 14318180/8)
507   MDRV_SOUND_ADD(SN76489A, XTAL_14_31818MHz/8) /* verified on pcb */
508508   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "filter1", 0.75)
509509
510   MDRV_SOUND_ADD(SN76489A, 14318180/8)
510   MDRV_SOUND_ADD(SN76489A, XTAL_14_31818MHz/8) /* verified on pcb */
511511   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "filter2", 0.75)
512512
513   MDRV_SOUND_ADD(SN76489A, 14318180/8)
513   MDRV_SOUND_ADD(SN76489A, XTAL_14_31818MHz/8) /* verified on pcb */
514514   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "filter3", 0.75)
515515
516516   MDRV_SOUND_ADD_TAG("filter1", FILTER_RC, 0)
src/mame/drivers/naomi.c
r1527r1528
520520   dc_vblank();
521521}
522522
523READ64_HANDLER( naomi_arm_r )
523static READ64_HANDLER( naomi_arm_r )
524524{
525525   return *((UINT64 *)dc_sound_ram+offset);
526526}
527527
528WRITE64_HANDLER( naomi_arm_w )
528static WRITE64_HANDLER( naomi_arm_w )
529529{
530530   COMBINE_DATA((UINT64 *)dc_sound_ram + offset);
531531}
532532
533READ64_HANDLER( naomi_unknown1_r )
533static READ64_HANDLER( naomi_unknown1_r )
534534{
535535   if ((offset * 8) == 0xc0) // trick so that it does not "wait for multiboard sync"
536536      return -1;
537537   return 0;
538538}
539539
540WRITE64_HANDLER( naomi_unknown1_w )
540static WRITE64_HANDLER( naomi_unknown1_w )
541541{
542542}
543543
544READ32_HANDLER( dc_aica_arm_r )
544static READ32_HANDLER( dc_aica_arm_r )
545545{
546546   return 0;
547547}
548548
549WRITE32_HANDLER( dc_aica_arm_w )
549static WRITE32_HANDLER( dc_aica_arm_w )
550550{
551551}
552552
r1527r1528
572572
573573// NOTE: all accesses are 16 or 32 bits wide but only 16 bits are valid
574574
575READ64_HANDLER( naomi_rom_board_r )
575static READ64_HANDLER( naomi_rom_board_r )
576576{
577577   UINT8 *ROM = (UINT8 *)memory_region(REGION_USER1);
578578
r1527r1528
595595   return U64(0xffffffffffffffff);
596596}
597597
598WRITE64_HANDLER( naomi_rom_board_w )
598static WRITE64_HANDLER( naomi_rom_board_w )
599599{
600600   if ((offset == 1) && ((mem_mask & U64(0xffff)) == 0))
601601   {
r1527r1528
652652   AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_REGION(REGION_CPU1, 0)
653653ADDRESS_MAP_END
654654
655READ32_HANDLER( test1 )
655static READ32_HANDLER( test1 )
656656{
657657   return -1;
658658}
src/mame/drivers/bloodbro.c
r1527r1528
521521   GFXDECODE_ENTRY( REGION_GFX3, 0x00000, weststry_spritelayout,    0*16,  0x10 )
522522GFXDECODE_END
523523
524/* Sound Interfaces */
525524
526// Parameters: YM3812 frequency, Oki frequency, Oki memory region
527SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
528
529525/* Machine Drivers */
530526
531527static MACHINE_DRIVER_START( bloodbro )
src/mame/drivers/raiden.c
r1527r1528
221221
222222/******************************************************************************/
223223
224/* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
225SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
226
227224static INTERRUPT_GEN( raiden_interrupt )
228225{
229226   cpunum_set_input_line_and_vector(cpunum, 0, HOLD_LINE, 0xc8/4);   /* VBL */
src/mame/drivers/alg.c
r1527r1528
226226}
227227
228228
229static UINT32 lightgun_pos_r(void *param)
229static CUSTOM_INPUT( lightgun_pos_r )
230230{
231231   int x = 0, y = 0;
232232
r1527r1528
236236}
237237
238238
239static UINT32 lightgun_trigger_r(void *param)
239static CUSTOM_INPUT( lightgun_trigger_r )
240240{
241241   /* read the trigger control based on the input select */
242242   return (readinputportbytag("TRIGGERS") >> input_select) & 1;
243243}
244244
245245
246static UINT32 lightgun_holster_r(void *param)
246static CUSTOM_INPUT( lightgun_holster_r )
247247{
248248   /* read the holster control based on the input select */
249249   return (readinputportbytag("TRIGGERS") >> (2 + input_select)) & 1;
src/mame/drivers/bking2.c
r1527r1528
598598   MDRV_CPU_MODIFY("main_cpu")
599599   MDRV_CPU_IO_MAP(bking3_io_map,0)
600600
601   MDRV_CPU_ADD(M68705, XTAL_3MHz/M68705_CLOCK_DIVIDER)      /* xtal is 3MHz, divided by 4 internally */
601   MDRV_CPU_ADD(M68705, XTAL_3MHz)      /* xtal is 3MHz, divided by 4 internally */
602602   MDRV_CPU_PROGRAM_MAP(m68705_map,0)
603603
604604   MDRV_MACHINE_RESET(buggychl)
src/mame/drivers/arcadia.c
r1527r1528
8282 *
8383 *************************************/
8484
85static UINT32 arcadia_coin_counter_r(void *param)
85static CUSTOM_INPUT( arcadia_coin_counter_r )
8686{
8787   /* return coin counter values */
8888   return *(UINT8 *)param & 3;
src/mame/drivers/segag80v.c
r1527r1528
314314 *
315315 *************************************/
316316
317static UINT32 elim4_joint_coin_r(void *param)
317static CUSTOM_INPUT( elim4_joint_coin_r )
318318{
319319   return (readinputportbytag("COINS") & 0xf) != 0xf;
320320}
src/mame/drivers/carjmbre.c
r1527r1528
5656   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
5757   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
5858   AM_RANGE(0x8800, 0x8800) AM_READ(MRA8_NOP)         //?? possibly watchdog
59   AM_RANGE(0x9000, 0x97ff) AM_READ(videoram_r)
59   AM_RANGE(0x9000, 0x97ff) AM_READ(MRA8_RAM)
6060   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
6161   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
6262   AM_RANGE(0xb800, 0xb800) AM_READ(input_port_2_r)
r1527r1528
7171   AM_RANGE(0x8fc1, 0x8fc1) AM_WRITE(MWA8_NOP)         //overrun during initial screen clear
7272   AM_RANGE(0x8fe1, 0x8fe1) AM_WRITE(MWA8_NOP)         //overrun during initial screen clear
7373   AM_RANGE(0x9000, 0x97ff) AM_WRITE(carjmbre_videoram_w) AM_BASE(&videoram)
74   AM_RANGE(0x9800, 0x985f) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
74   AM_RANGE(0x9800, 0x985f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
7575   AM_RANGE(0x9880, 0x98df) AM_WRITE(MWA8_RAM)         //spriteram mirror
7676   AM_RANGE(0xb800, 0xb800) AM_WRITE(soundlatch_w)
7777ADDRESS_MAP_END
src/mame/drivers/xain.c
r1527r1528
486486   /* audio CPU */
487487   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
488488
489//  MDRV_CPU_ADD(M68705, 3000000/M68705_CLOCK_DIVIDER)    /* Confirmed 3MHz */
489//  MDRV_CPU_ADD(M68705, 3000000)    /* Confirmed 3MHz */
490490//  MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
491491
492492   MDRV_MACHINE_START(xsleena)
src/mame/drivers/astrocde.c
r1527r1528
244244 *
245245 *************************************/
246246
247static UINT32 ebases_trackball_r(void *param)
247static CUSTOM_INPUT( ebases_trackball_r )
248248{
249249   static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
250250   return readinputportbytag(names[input_select]);
r1527r1528
460460}
461461
462462
463static UINT32 demndragn_joystick_r(void *param)
463static CUSTOM_INPUT( demndragn_joystick_r )
464464{
465465   static const char *const names[] = { "MOVEX", "MOVEY" };
466466   return readinputportbytag(names[input_select]);
r1527r1528
506506static MACHINE_START( tenpindx )
507507{
508508   /* initialize the CTC */
509   ctc_intf.baseclock = machine->drv->cpu[0].clock;
509   ctc_intf.baseclock = cpunum_get_clock(0);
510510   z80ctc_init(0, &ctc_intf);
511511   machine_start_astrocde(machine);
512512}
src/mame/drivers/megazone.c
r1527r1528
2020extern UINT8 *megazone_scrollx;
2121extern UINT8 *megazone_scrolly;
2222
23static UINT8 *megazone_sharedram;
24
2523extern UINT8 *megazone_videoram2;
2624extern UINT8 *megazone_colorram2;
2725extern size_t megazone_videoram2_size;
r1527r1528
7573   }
7674}
7775
78static WRITE8_HANDLER( megazone_videoram2_w )
79{
80   if (megazone_videoram2[offset] != data)
81   {
82      megazone_videoram2[offset] = data;
83   }
84}
85
86static WRITE8_HANDLER( megazone_colorram2_w )
87{
88   if (megazone_colorram2[offset] != data)
89   {
90      megazone_colorram2[offset] = data;
91   }
92}
93
94static READ8_HANDLER( megazone_sharedram_r )
95{
96   return(megazone_sharedram[offset]);
97}
98
99static WRITE8_HANDLER( megazone_sharedram_w )
100{
101   megazone_sharedram[offset] = data;
102}
103
10476static WRITE8_HANDLER( megazone_i8039_irq_w )
10577{
10678   cpunum_set_input_line(2, 0, ASSERT_LINE);
r1527r1528
12395static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
12496   AM_RANGE(0x2000, 0x2fff) AM_READ(MRA8_RAM)
12597   AM_RANGE(0x3000, 0x33ff) AM_READ(MRA8_RAM)
126   AM_RANGE(0x3800, 0x3fff) AM_READ(megazone_sharedram_r)
98   AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE(1)
12799   AM_RANGE(0x4000, 0xffff) AM_READ(MRA8_ROM)      /* 4000->5FFF is a debug rom */
128100ADDRESS_MAP_END
129101
r1527r1528
134106   AM_RANGE(0x0800, 0x0800) AM_WRITE(watchdog_reset_w)
135107   AM_RANGE(0x1800, 0x1800) AM_WRITE(MWA8_RAM) AM_BASE(&megazone_scrollx)
136108   AM_RANGE(0x1000, 0x1000) AM_WRITE(MWA8_RAM) AM_BASE(&megazone_scrolly)
137   AM_RANGE(0x2000, 0x23ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
138   AM_RANGE(0x2400, 0x27ff) AM_WRITE(megazone_videoram2_w) AM_BASE(&megazone_videoram2) AM_SIZE(&megazone_videoram2_size)
139   AM_RANGE(0x2800, 0x2bff) AM_WRITE(colorram_w) AM_BASE(&colorram)
140   AM_RANGE(0x2c00, 0x2fff) AM_WRITE(megazone_colorram2_w) AM_BASE(&megazone_colorram2)
109   AM_RANGE(0x2000, 0x23ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
110   AM_RANGE(0x2400, 0x27ff) AM_WRITE(MWA8_RAM) AM_BASE(&megazone_videoram2) AM_SIZE(&megazone_videoram2_size)
111   AM_RANGE(0x2800, 0x2bff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
112   AM_RANGE(0x2c00, 0x2fff) AM_WRITE(MWA8_RAM) AM_BASE(&megazone_colorram2)
141113   AM_RANGE(0x3000, 0x33ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
142   AM_RANGE(0x3800, 0x3fff) AM_WRITE(megazone_sharedram_w) AM_BASE(&megazone_sharedram)
143114   AM_RANGE(0x4000, 0xffff) AM_WRITE(MWA8_ROM)
144115ADDRESS_MAP_END
145116
r1527r1528
150121   AM_RANGE(0x6002, 0x6002) AM_READ(input_port_2_r) /* P2 IO */
151122   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_3_r) /* DIP 1 */
152123   AM_RANGE(0x8001, 0x8001) AM_READ(input_port_4_r) /* DIP 2 */
153   AM_RANGE(0xe000, 0xe7ff) AM_READ(megazone_sharedram_r) /* Shared with $3800->3fff of main CPU */
124   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(1)
154125ADDRESS_MAP_END
155126
156127static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
r1527r1528
160131   AM_RANGE(0xa000, 0xa000) AM_WRITE(MWA8_RAM)            /* INTMAIN - Interrupts main CPU (unused) */
161132   AM_RANGE(0xc000, 0xc000) AM_WRITE(MWA8_RAM)            /* INT (Actually is NMI) enable/disable (unused)*/
162133   AM_RANGE(0xc001, 0xc001) AM_WRITE(watchdog_reset_w)
163   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(megazone_sharedram_w)   /* Shared with $3800->3fff of main CPU */
164134ADDRESS_MAP_END
165135
166136static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
r1527r1528
337307   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
338308   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
339309
340   MDRV_CPU_ADD(I8039,(14318000/2)/I8039_CLOCK_DIVIDER)
310   MDRV_CPU_ADD(I8039,14318000/2)
341311   /* audio CPU */   /* 1/2 14MHz crystal */
342312   MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem)
343313   MDRV_CPU_IO_MAP(i8039_readport,i8039_writeport)
src/mame/drivers/deco156.c
r1527r1528
423423static MACHINE_DRIVER_START( hvysmsh )
424424
425425   /* basic machine hardware */
426   MDRV_CPU_ADD(ARM, 28000000/2) /* Unconfirmed */
426   MDRV_CPU_ADD(ARM, 28000000) /* Unconfirmed */
427427   MDRV_CPU_PROGRAM_MAP(hvysmsh_map,0)
428428   MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt,1)
429429
r1527r1528
459459static MACHINE_DRIVER_START( wcvol95 )
460460
461461   /* basic machine hardware */
462   MDRV_CPU_ADD(ARM, 28000000/2) /* Unconfirmed */
462   MDRV_CPU_ADD(ARM, 28000000) /* Unconfirmed */
463463   MDRV_CPU_PROGRAM_MAP(wcvol95_map,0)
464464   MDRV_CPU_VBLANK_INT(deco32_vbl_interrupt,1)
465465
src/mame/drivers/toki.c
r1527r1528
425425
426426/*****************************************************************************/
427427
428/* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
429SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
430
431
432428static const struct MSM5205interface msm5205_interface =
433429{
434430   toki_adpcm_int,   /* interrupt function */
src/mame/drivers/40love.c
r1527r1528
11051105   MDRV_CPU_PROGRAM_MAP(sound_map,0)
11061106   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* source/number of IRQs is unknown */
11071107
1108   MDRV_CPU_ADD(M68705,18432000/6/M68705_CLOCK_DIVIDER) /* OK */
1108   MDRV_CPU_ADD(M68705,18432000/6) /* OK */
11091109   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
11101110
11111111   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
11521152   MDRV_CPU_PROGRAM_MAP(sound_map,0)
11531153   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* source/number of IRQs is unknown */
11541154
1155//  MDRV_CPU_ADD(M68705,18432000/6/M68705_CLOCK_DIVIDER)
1155//  MDRV_CPU_ADD(M68705,18432000/6)
11561156//  MDRV_CPU_PROGRAM_MAP(mcu_map,0)
11571157
11581158   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/junofrst.c
r1527r1528
351351   /* audio CPU */   /* 1.78975 MHz */
352352   MDRV_CPU_PROGRAM_MAP(audio_map,0)
353353
354   MDRV_CPU_ADD(I8039,8000000/I8039_CLOCK_DIVIDER)
354   MDRV_CPU_ADD(I8039,8000000)
355355   /* audio CPU */   /* 8MHz crystal */
356356   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
357357   MDRV_CPU_IO_MAP(mcu_io_map,0)
src/mame/drivers/lasso.c
r1527r1528
576576   MDRV_CPU_ADD_TAG("audio", M6502, 600000)
577577   MDRV_CPU_PROGRAM_MAP(lasso_audio_map, 0)
578578
579   MDRV_SCREEN_REFRESH_RATE(60)
579   MDRV_SCREEN_REFRESH_RATE(57)   /* guess, but avoids glitching of Chameleon's high score table */
580580   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
581
581582   MDRV_CPU_VBLANK_INT(lasso_interrupt,2)      /* IRQ = VBlank, NMI = Coin Insertion */
582583   MDRV_INTERLEAVE(100)
583584
src/mame/drivers/tail2nos.c
r1527r1528
264264static MACHINE_DRIVER_START( tail2nos )
265265
266266   /* basic machine hardware */
267   MDRV_CPU_ADD(M68000,20000000/2)   /* 10 MHz (?) */
267   MDRV_CPU_ADD(M68000,XTAL_20MHz/2)   /* verified on pcb */
268268   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
269269   MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
270270
271   MDRV_CPU_ADD(Z80,8000000/2)
272   /* audio CPU */   /* 4 MHz ??? */
271   MDRV_CPU_ADD(Z80,XTAL_20MHz/4)   /* verified on pcb */
272   /* audio CPU */
273273   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
274274   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
275275                        /* IRQs are triggered by the YM2608 */
r1527r1528
292292   /* sound hardware */
293293   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
294294
295   MDRV_SOUND_ADD(YM2608, 8000000)
295   MDRV_SOUND_ADD(YM2608, XTAL_8MHz)   /* verified on pcb */
296296   MDRV_SOUND_CONFIG(ym2608_interface)
297297   MDRV_SOUND_ROUTE(0, "left",  0.25)
298298   MDRV_SOUND_ROUTE(0, "right", 0.25)
src/mame/drivers/quasar.c
r1527r1528
386386   MDRV_CPU_IO_MAP(quasar_io,0)
387387   MDRV_CPU_VBLANK_INT(quasar_interrupt,1)
388388
389   MDRV_CPU_ADD_TAG("sound",I8035,6000000/15)         /* 6MHz crystal divide by 15 in CPU */
389   MDRV_CPU_ADD_TAG("sound",I8035,6000000)         /* 6MHz crystal divide by 15 in CPU */
390390   /* audio CPU */
391391   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
392392   MDRV_CPU_IO_MAP(readport_sound,writeport_sound)
393393
394   MDRV_MACHINE_START( cvs )
395
394396   MDRV_SCREEN_REFRESH_RATE(50)                     /* From dot clock */
395397   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
396398   MDRV_INTERLEAVE(100)
src/mame/drivers/victory.c
r1527r1528
7878    ========================================================================
7979    CPU #2
8080    ========================================================================
81    0000-01FF   R/W   xxxxxxxx   Program RAM
81    0000-00FF   R/W   xxxxxxxx   Program RAM
8282    1000-1FFF   R/W   xxxxxxxx   6532 RIOT timer and I/O
8383    2000-2FFF   R/W   xxxxxxxx   6821 PIA I/O
8484    3000-3FFF   R/W   xxxxxxxx   8253 timer
r1527r1528
8686    6000-6FFF     W   ------xx   Control bits
8787                  W   ------x-      (6840 Channel 1 output enable)
8888                  W   -------x      (sound effects noise frequency select)
89    C000-FFFF   R     xxxxxxxx   Program ROM
89    B000-FFFF   R     xxxxxxxx   Program ROM
9090    ========================================================================
9191    Interrupts:
92       INT generated by 6532 RIOT
92       INT generated by 6821 PIA and 6532 RIOT
9393    ========================================================================
9494
9595***************************************************************************/
9696
97
9897#include "driver.h"
9998#include "exidy.h"
100#include "machine/6821pia.h"
101#include "sound/5220intf.h"
99#include "victory.h"
102100
103101
104#define LOG_SOUND      0
105102
106
107static UINT8 sound_response;
108static UINT8 sound_response_ack_clk;
109
110
111/* video driver data & functions */
112extern UINT8 *victory_charram;
113
114VIDEO_START( victory );
115VIDEO_EOF( victory );
116VIDEO_UPDATE( victory );
117INTERRUPT_GEN( victory_vblank_interrupt );
118
119READ8_HANDLER( victory_video_control_r );
120WRITE8_HANDLER( victory_video_control_w );
121WRITE8_HANDLER( victory_paletteram_w );
122WRITE8_HANDLER( victory_videoram_w );
123WRITE8_HANDLER( victory_charram_w );
124
125
126
127103/*************************************
128104 *
129 *  Sound CPU control
130 *
131 *************************************/
132
133static READ8_HANDLER( sound_response_r )
134{
135   if (LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", activecpu_get_previouspc(), sound_response);
136   pia_0_cb1_w(0, 0);
137   return sound_response;
138}
139
140
141static READ8_HANDLER( sound_status_r )
142{
143   if (LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", activecpu_get_previouspc(), (pia_0_ca1_r(0) << 7) | (pia_0_cb1_r(0) << 6));
144   return (pia_0_ca1_r(0) << 7) | (pia_0_cb1_r(0) << 6);
145}
146
147
148static TIMER_CALLBACK( delayed_command_w )
149{
150   pia_0_porta_w(0, param);
151   pia_0_ca1_w(0, 0);
152   if (LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", activecpu_get_previouspc(), param);
153}
154
155static WRITE8_HANDLER( sound_command_w )
156{
157   timer_call_after_resynch(NULL, data, delayed_command_w);
158}
159
160
161WRITE8_HANDLER( victory_sound_response_w )
162{
163   sound_response = data;
164   if (LOG_SOUND) logerror("%04X:!!!! Sound response = %02X\n", activecpu_get_previouspc(), data);
165}
166
167
168WRITE8_HANDLER( victory_sound_irq_clear_w )
169{
170   if (LOG_SOUND) logerror("%04X:!!!! Sound IRQ clear = %02X\n", activecpu_get_previouspc(), data);
171   if (!data) pia_0_ca1_w(0, 1);
172}
173
174
175WRITE8_HANDLER( victory_main_ack_w )
176{
177   if (LOG_SOUND) logerror("%04X:!!!! Sound ack = %02X\n", activecpu_get_previouspc(), data);
178   if (sound_response_ack_clk && !data)
179      pia_0_cb1_w(0, 1);
180   sound_response_ack_clk = data;
181}
182
183
184
185/*************************************
186 *
187105 *  Misc I/O
188106 *
189107 *************************************/
190108
191109static WRITE8_HANDLER( lamp_control_w )
192110{
193   set_led_status(0,data & 0x80);
194   set_led_status(1,data & 0x40);
195   set_led_status(2,data & 0x20);
196   set_led_status(3,data & 0x10);
111   set_led_status(0, data & 0x80);
112   set_led_status(1, data & 0x40);
113   set_led_status(2, data & 0x20);
114   set_led_status(3, data & 0x10);
197115}
198116
199117
r1527r1528
208126   AM_RANGE(0x0000, 0xbfff) AM_ROM
209127   AM_RANGE(0xc000, 0xc0ff) AM_READ(victory_video_control_r)
210128   AM_RANGE(0xc100, 0xc1ff) AM_WRITE(victory_video_control_w)
211   AM_RANGE(0xc200, 0xc3ff) AM_WRITE(victory_paletteram_w) AM_BASE(&paletteram)
212   AM_RANGE(0xc400, 0xc7ff) AM_READWRITE(MRA8_RAM, victory_videoram_w) AM_BASE(&videoram)
213   AM_RANGE(0xc800, 0xdfff) AM_READWRITE(MRA8_RAM, victory_charram_w) AM_BASE(&victory_charram)
129   AM_RANGE(0xc200, 0xc3ff) AM_WRITE(victory_paletteram_w)
130   AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_BASE(&victory_videoram)
131   AM_RANGE(0xc800, 0xdfff) AM_RAM AM_BASE(&victory_charram)
214132   AM_RANGE(0xe000, 0xefff) AM_RAM
215133   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
216   AM_RANGE(0xf800, 0xf800) AM_READWRITE(sound_response_r, sound_command_w)
217   AM_RANGE(0xf801, 0xf801) AM_READ(sound_status_r)
134   AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07fc) AM_READWRITE(victory_sound_response_r, victory_sound_command_w)
135   AM_RANGE(0xf801, 0xf801) AM_MIRROR(0x07fc) AM_READ(victory_sound_status_r)
218136ADDRESS_MAP_END
219137
220138
221static ADDRESS_MAP_START( main_iomap, ADDRESS_SPACE_IO, 8 )
139static ADDRESS_MAP_START( main_io_map, ADDRESS_SPACE_IO, 8 )
222140   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
223   AM_RANGE(0x00, 0x03) AM_READ(input_port_0_r)
224   AM_RANGE(0x04, 0x07) AM_READ(input_port_1_r)
141   AM_RANGE(0x00, 0x00) AM_MIRROR(0x03) AM_READ(input_port_0_r)
142   AM_RANGE(0x04, 0x04) AM_MIRROR(0x03) AM_READ(input_port_1_r)
225143   AM_RANGE(0x08, 0x08) AM_READ(input_port_2_r)
226144   AM_RANGE(0x0a, 0x0a) AM_READ(input_port_3_r)
227145   AM_RANGE(0x0c, 0x0c) AM_READ(input_port_4_r)
228146   AM_RANGE(0x0e, 0x0e) AM_READ(input_port_5_r)
229   AM_RANGE(0x10, 0x13) AM_WRITE(lamp_control_w)
147   AM_RANGE(0x10, 0x10) AM_MIRROR(0x03) AM_WRITE(lamp_control_w)
148   AM_RANGE(0x14, 0xff) AM_NOP
230149ADDRESS_MAP_END
231150
232151
233152
234153/*************************************
235154 *
236 *  Sound CPU memory handlers
237 *
238 *************************************/
239
240static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
241   AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0xf00) AM_RAM
242   AM_RANGE(0x1000, 0x1fff) AM_READWRITE(exidy_shriot_r, exidy_shriot_w)
243   AM_RANGE(0x2000, 0x27ff) AM_READWRITE(pia_0_r, pia_0_w)
244   AM_RANGE(0x3000, 0x3fff) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
245   AM_RANGE(0x4000, 0x4fff) AM_WRITE(exidy_sound_filter_w)
246   AM_RANGE(0x5000, 0x5fff) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w)
247   AM_RANGE(0x6000, 0x6fff) AM_WRITE(exidy_sfxctrl_w)
248   AM_RANGE(0xc000, 0xffff) AM_ROM
249ADDRESS_MAP_END
250
251
252
253/*************************************
254 *
255155 *  Port definitions
256156 *
257157 *************************************/
r1527r1528
302202
303203/*************************************
304204 *
305 *  Sound definitions
306 *
307 *************************************/
308
309static const struct CustomSound_interface custom_interface =
310{
311    victory_sh_start,
312    0,
313   0
314};
315
316
317
318/*************************************
319 *
320205 *  Machine driver
321206 *
322207 *************************************/
r1527r1528
324209static MACHINE_DRIVER_START( victory )
325210
326211   /* basic machine hardware */
327   MDRV_CPU_ADD(Z80, 4000000)
212   MDRV_CPU_ADD(Z80, VICTORY_MAIN_CPU_CLOCK)
328213   MDRV_CPU_PROGRAM_MAP(main_map,0)
329   MDRV_CPU_IO_MAP(main_iomap,0)
214   MDRV_CPU_IO_MAP(main_io_map,0)
330215   MDRV_CPU_VBLANK_INT(victory_vblank_interrupt,1)
331216
332   MDRV_CPU_ADD(M6502,3579545/4)
333   /* audio CPU */
334   MDRV_CPU_PROGRAM_MAP(sound_map,0)
335
336217   MDRV_NVRAM_HANDLER(generic_0fill)
337218
338219   /* video hardware */
339   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
220   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_ALWAYS_UPDATE)
340221   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
341222   /* using the standard Exidy video parameters for now, needs to be confirmed */
342223   MDRV_SCREEN_RAW_PARAMS(EXIDY_PIXEL_CLOCK, EXIDY_HTOTAL, EXIDY_HBEND, EXIDY_HBSTART, EXIDY_VTOTAL, EXIDY_VBEND, EXIDY_VBSTART)
343224   MDRV_PALETTE_LENGTH(64)
344225
345226   MDRV_VIDEO_START(victory)
346   MDRV_VIDEO_EOF(victory)
347227   MDRV_VIDEO_UPDATE(victory)
348228
349   /* sound hardware */
350   MDRV_SPEAKER_STANDARD_MONO("mono")
351   MDRV_SOUND_ADD(CUSTOM, 0)
352   MDRV_SOUND_CONFIG(custom_interface)
353   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
229   /* audio hardware */
230   MDRV_IMPORT_FROM(victory_audio)
354231
355   MDRV_SOUND_ADD(TMS5220, 640000)
356   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
357232MACHINE_DRIVER_END
358233
359234
r1527r1528
437312 *
438313 *************************************/
439314
440GAME( 1982, victory,  0,        victory, victory, 0,     ROT0, "Exidy", "Victory", 0 )
441GAME( 1982, victorba, victory,  victory, victory, 0,     ROT0, "Exidy", "Victor Banana", 0 )
315GAME( 1982, victory,  0,       victory, victory, 0, ROT0, "Exidy", "Victory", 0 )
316GAME( 1982, victorba, victory, victory, victory, 0, ROT0, "Exidy", "Victor Banana", 0 )
src/mame/drivers/wardner.c
r1527r1528
470470   MDRV_CPU_PROGRAM_MAP(sound_program_map, 0)
471471   MDRV_CPU_IO_MAP(sound_io_map, 0)
472472
473   MDRV_CPU_ADD(TMS32010,14000000/TMS32010_CLOCK_DIVIDER)   /* 14MHz Crystal CLKin */
473   MDRV_CPU_ADD(TMS32010,14000000)   /* 14MHz Crystal CLKin */
474474   MDRV_CPU_PROGRAM_MAP(DSP_program_map, 0)
475475   /* Data Map is internal to the CPU */
476476   MDRV_CPU_IO_MAP(DSP_io_map, 0)
src/mame/drivers/nss.c
r1527r1528
624624ROM_START( nss_smw )
625625   NSS_BIOS
626626   ROM_REGION( 0x100000, REGION_USER3, ROMREGION_DISPOSE )
627   ROM_LOAD( "nss-mw-0_prg.ic1", 0x000000, 0x100000, CRC(971ff812) SHA1(4e8f5f0d160ca3e14db3d88c00f2e7e2dce4dca6) )
627   ROM_LOAD( "nss-mw-0_prg.ic1", 0x000000, 0x80000, CRC(c46766f2) SHA1(06a6efc246c6fdb83efab1d402d61d2179a84494) )
628628
629629   /* instruction / data rom for bios */
630630   ROM_REGION( 0x8000, REGION_USER4, 0 )
src/mame/drivers/rollrace.c
r1527r1528
22
33Issues:
44-sound effects missing
5-cpu speeds are guessed
65***************************************************************************/
76
87#include "driver.h"
r1527r1528
5655   AM_RANGE(0x8000, 0x9fff) AM_WRITE(MWA8_ROM)
5756   AM_RANGE(0xc000, 0xcfff) AM_WRITE(MWA8_RAM)
5857   AM_RANGE(0xd900, 0xd900) AM_WRITE(ra_fake_d800_w) /* protection ?? */
59   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
60   AM_RANGE(0xe400, 0xe47f) AM_WRITE(colorram_w) AM_BASE(&colorram)
58   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
59   AM_RANGE(0xe400, 0xe47f) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
6160   AM_RANGE(0xe800, 0xe800) AM_WRITE(soundlatch_w)
6261   AM_RANGE(0xec00, 0xec0f) AM_WRITE(MWA8_NOP) /* Analog sound effects ?? ec00 sound enable ?*/
6362   AM_RANGE(0xf000, 0xf0ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
r1527r1528
236235static MACHINE_DRIVER_START( rollrace )
237236
238237   /* basic machine hardware */
239   MDRV_CPU_ADD(Z80,12000000/3)         /* ?? */
238   MDRV_CPU_ADD(Z80,XTAL_24MHz/8) /* verified on pcb */
240239   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
241240   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
242241
243   MDRV_CPU_ADD(Z80,12000000/3)
244   /* audio CPU */         /* ?? */
242   MDRV_CPU_ADD(Z80,XTAL_24MHz/16) /* verified on pcb */
243   /* audio CPU */
245244   MDRV_CPU_PROGRAM_MAP(readmem_snd,writemem_snd)
246245   MDRV_CPU_VBLANK_INT(nmi_line_pulse,4)
247246
r1527r1528
263262   /* sound hardware */
264263   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
265264
266   MDRV_SOUND_ADD(AY8910,12000000/8)
265   MDRV_SOUND_ADD(AY8910,XTAL_24MHz/16) /* verified on pcb */
267266   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.10)
268267
269   MDRV_SOUND_ADD(AY8910,12000000/8)
268   MDRV_SOUND_ADD(AY8910,XTAL_24MHz/16) /* verified on pcb */
270269   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.10)
271270
272   MDRV_SOUND_ADD(AY8910,12000000/8)
271   MDRV_SOUND_ADD(AY8910,XTAL_24MHz/16) /* verified on pcb */
273272   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.10)
274273MACHINE_DRIVER_END
275274
src/mame/drivers/missile.c
r1527r1528
325325}
326326
327327
328static UINT32 get_vblank(void *param)
328static CUSTOM_INPUT( get_vblank )
329329{
330330   int v = scanline_to_v(video_screen_get_vpos(0));
331331   return v < 24;
src/mame/drivers/taitosj.c
r1527r1528
236236   input_port_4_f0 = data >> 4;
237237}
238238
239static UINT32 input_port_4_f0_r(void *param)
239static CUSTOM_INPUT( input_port_4_f0_r )
240240{
241241   return input_port_4_f0;
242242}
r1527r1528
325325/* seems the most logical way to do the gears */
326326static UINT8 kikstart_gears[2];
327327
328static int kikstart_gear_r(void *param)
328static CUSTOM_INPUT( kikstart_gear_r )
329329{
330330   const char *port_tag;
331331
332   int player = (int)param;
332   int player = (int)(FPTR)param;
333333
334334   if (player == 0)
335335      port_tag = "GEARP1";
r1527r1528
19231923   MDRV_CPU_MODIFY("main")
19241924   MDRV_CPU_PROGRAM_MAP(taitosj_main_mcu_map,0)
19251925
1926   MDRV_CPU_ADD(M68705,3000000/M68705_CLOCK_DIVIDER)      /* xtal is 3MHz, divided by 4 internally */
1926   MDRV_CPU_ADD(M68705,3000000)      /* xtal is 3MHz, divided by 4 internally */
19271927   MDRV_CPU_PROGRAM_MAP(taitosj_mcu_map,0)
19281928MACHINE_DRIVER_END
19291929
src/mame/drivers/vigilant.c
r1527r1528
7474   AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK1)
7575   AM_RANGE(0xc020, 0xc0df) AM_READ(MRA8_RAM)
7676   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM)
77   AM_RANGE(0xd000, 0xdfff) AM_READ(videoram_r)
77   AM_RANGE(0xd000, 0xdfff) AM_READ(MRA8_RAM)
7878   AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM)
7979ADDRESS_MAP_END
8080
r1527r1528
8282   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
8383   AM_RANGE(0xc020, 0xc0df) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
8484   AM_RANGE(0xc800, 0xcfff) AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram)
85   AM_RANGE(0xd000, 0xdfff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
85   AM_RANGE(0xd000, 0xdfff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
8686   AM_RANGE(0xe000, 0xefff) AM_WRITE(MWA8_RAM)
8787ADDRESS_MAP_END
8888
r1527r1528
110110   AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK1)
111111   AM_RANGE(0xc000, 0xc0ff) AM_READ(MRA8_RAM)
112112   AM_RANGE(0xc800, 0xcaff) AM_READ(MRA8_RAM)
113   AM_RANGE(0xd000, 0xdfff) AM_READ(videoram_r)
113   AM_RANGE(0xd000, 0xdfff) AM_READ(MRA8_RAM)
114114   AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_RAM)
115115ADDRESS_MAP_END
116116
r1527r1528
118118   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
119119   AM_RANGE(0xc000, 0xc0ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
120120   AM_RANGE(0xc800, 0xcaff) AM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram)
121   AM_RANGE(0xd000, 0xdfff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
121   AM_RANGE(0xd000, 0xdfff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
122122   AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_RAM)
123123ADDRESS_MAP_END
124124
src/mame/drivers/kingobox.c
r1527r1528
110110    AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
111111    AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) /* work ram */
112112    AM_RANGE(0xa000, 0xa7ff) AM_READ(video_shared_r) /* shared with main */
113    AM_RANGE(0xc000, 0xc0ff) AM_READ(videoram_r) /* background vram */
114    AM_RANGE(0xc400, 0xc4ff) AM_READ(colorram_r) /* background colorram */
113    AM_RANGE(0xc000, 0xc0ff) AM_READ(MRA8_RAM) /* background vram */
114    AM_RANGE(0xc400, 0xc4ff) AM_READ(MRA8_RAM) /* background colorram */
115115    AM_RANGE(0xc800, 0xcbff) AM_READ(MRA8_RAM) /* foreground vram */
116116    AM_RANGE(0xcc00, 0xcfff) AM_READ(MRA8_RAM) /* foreground colorram */
117117ADDRESS_MAP_END
r1527r1528
130130    AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
131131    AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) /* work ram */
132132    AM_RANGE(0xa000, 0xa7ff) AM_READ(sprite_shared_r) /* shared with main */
133    AM_RANGE(0xc000, 0xc3ff) AM_READ(spriteram_r) /* sprite ram */
133    AM_RANGE(0xc000, 0xc3ff) AM_READ(MRA8_RAM) /* sprite ram */
134134    AM_RANGE(0xc400, 0xc43f) AM_READ(MRA8_RAM) /* something related to scroll? */
135135ADDRESS_MAP_END
136136
r1527r1528
138138    AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
139139    AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) /* work ram */
140140    AM_RANGE(0xa000, 0xa7ff) AM_WRITE(sprite_shared_w) AM_BASE(&sprite_shared) /* shared with main */
141    AM_RANGE(0xc000, 0xc3ff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite ram */
141    AM_RANGE(0xc000, 0xc3ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite ram */
142142    AM_RANGE(0xc400, 0xc43f) AM_WRITE(MWA8_RAM)  /* something related to scroll? */
143143ADDRESS_MAP_END
144144
r1527r1528
197197    AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
198198    AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) /* work ram */
199199    AM_RANGE(0xc000, 0xc7ff) AM_READ(video_shared_r) /* shared with main */
200    AM_RANGE(0xa800, 0xa8ff) AM_READ(videoram_r) /* background vram */
201    AM_RANGE(0xac00, 0xacff) AM_READ(colorram_r) /* background colorram */
200    AM_RANGE(0xa800, 0xa8ff) AM_READ(MRA8_RAM) /* background vram */
201    AM_RANGE(0xac00, 0xacff) AM_READ(MRA8_RAM) /* background colorram */
202202    AM_RANGE(0xa000, 0xa3ff) AM_READ(MRA8_RAM) /* foreground vram */
203203    AM_RANGE(0xa400, 0xa7ff) AM_READ(MRA8_RAM) /* foreground colorram */
204204ADDRESS_MAP_END
r1527r1528
217217    AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
218218    AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) /* work ram */
219219    AM_RANGE(0xc800, 0xcfff) AM_READ(sprite_shared_r) /* shared with main */
220    AM_RANGE(0xa000, 0xa3ff) AM_READ(spriteram_r) /* sprite ram */
220    AM_RANGE(0xa000, 0xa3ff) AM_READ(MRA8_RAM) /* sprite ram */
221221    AM_RANGE(0xa400, 0xa43f) AM_READ(MRA8_RAM) /* something related to scroll? */
222222ADDRESS_MAP_END
223223
r1527r1528
225225    AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
226226    AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) /* work ram */
227227    AM_RANGE(0xc800, 0xcfff) AM_WRITE(sprite_shared_w) AM_BASE(&sprite_shared) /* shared with main */
228    AM_RANGE(0xa000, 0xa3ff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite ram */
228    AM_RANGE(0xa000, 0xa3ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite ram */
229229    AM_RANGE(0xa400, 0xa43f) AM_WRITE(MWA8_RAM)  /* something related to scroll? */
230230ADDRESS_MAP_END
231231
src/mame/drivers/f1gp.c
r1527r1528
565565static MACHINE_DRIVER_START( f1gp )
566566
567567   /* basic machine hardware */
568   MDRV_CPU_ADD_TAG("main",M68000,10000000)   /* 10 MHz ??? */
568   MDRV_CPU_ADD_TAG("main",M68000,XTAL_20MHz/2)   /* verified on pcb */
569569   MDRV_CPU_PROGRAM_MAP(f1gp_readmem1,f1gp_writemem1)
570570   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
571571
572   MDRV_CPU_ADD(M68000,10000000)   /* 10 MHz ??? */
572   MDRV_CPU_ADD(M68000,XTAL_20MHz/2)   /* verified on pcb */
573573   MDRV_CPU_PROGRAM_MAP(readmem2,writemem2)
574574   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
575575
576   MDRV_CPU_ADD(Z80,8000000/2)   /* 4 MHz ??? */
576   MDRV_CPU_ADD(Z80,XTAL_20MHz/4)   /* verified on pcb */
577577   /* audio CPU */
578578   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
579579   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
r1527r1528
595595   /* sound hardware */
596596   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
597597
598   MDRV_SOUND_ADD(YM2610, 8000000)
598   MDRV_SOUND_ADD(YM2610, XTAL_8MHz)
599599   MDRV_SOUND_CONFIG(ym2610_interface)
600600   MDRV_SOUND_ROUTE(0, "left",  0.25)
601601   MDRV_SOUND_ROUTE(0, "right", 0.25)
src/mame/drivers/midwunit.c
r1527r1528
633633
634634static MACHINE_DRIVER_START( wunit )
635635
636   MDRV_CPU_ADD(TMS34010, 50000000/TMS34010_CLOCK_DIVIDER)
636   MDRV_CPU_ADD(TMS34010, 50000000)
637637   MDRV_CPU_CONFIG(tms_config)
638638   MDRV_CPU_PROGRAM_MAP(main_map,0)
639639
src/mame/drivers/thayers.c
r1527r1528
9898   return ram_ic[offset];
9999}
100100
101static UINT32 laserdisc_status_r(void *param)
101static CUSTOM_INPUT( laserdisc_status_r )
102102{
103103   if (discinfo == NULL)
104104      return 0;
r1527r1528
107107   return (laserdisc_line_r(discinfo, LASERDISC_LINE_STATUS) == ASSERT_LINE) ? 0 : 1;
108108}
109109
110static UINT32 laserdisc_command_r(void *param)
110static CUSTOM_INPUT( laserdisc_command_r )
111111{
112112   if (discinfo == NULL)
113113      return 0;
src/mame/drivers/merit.c
r1527r1528
11881188   ROM_LOAD( "sex1_1a.bin",  0x90000, 0x8000, CRC(ed7604b8) SHA1(b1e841b50b8ef6ae95fafac1c34b6d0337a05d18) )
11891189ROM_END
11901190
1191ROM_START( dodge )
1192   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1193   ROM_LOAD( "2131-82.u5",     0x0000, 0x8000, CRC(eb82515d) SHA1(d2c15bd633472f50b621ba90598559e345246d01) )
11911194
1195   ROM_REGION( 0x18000, REGION_GFX1, 0 )
1196    /*
1197    dodge.u37        1ST AND 2ND HALF IDENTICAL
1198    dodge.u38        1ST AND 2ND HALF IDENTICAL
1199    dodge.u39        1ST AND 2ND HALF IDENTICAL */
1200
1201   ROM_LOAD( "dodge.u39",    0x00000, 0x8000, CRC(3b3376a1) SHA1(6880cdc29686ff7328717c3833ff826c278b023e) )
1202   ROM_LOAD( "dodge.u38",    0x08000, 0x8000, CRC(654d5b00) SHA1(9e16330b2dc8821fc20a39eb42176fda23085bfc) )
1203   ROM_LOAD( "dodge.u37",    0x10000, 0x8000, CRC(bc9e63d4) SHA1(2320f5a0545f18e1e42a3a45fedce912c36fbe13) )
1204
1205   ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_ERASEFF )
1206    /* socket at position u40 is unpopulated */
1207ROM_END
1208
1209
1210
11921211static DRIVER_INIT( key_0 )
11931212{
11941213   decryption_key = 0;
r1527r1528
12281247GAME( 1986, phrcraze, 0,       phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze",                                GAME_WRONG_COLORS )
12291248GAME( 1986, phrcrazs, 0,       phrcraze, phrcrazs, key_7,  ROT90, "Merit", "Phraze Craze (Sex Kit)",                      GAME_WRONG_COLORS )
12301249GAME( 1986, bigappg,  0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Big Apple Games ?",                           GAME_WRONG_COLORS | GAME_NOT_WORKING )
1250GAME( 1986, dodge,    0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Dodge City",                                  GAME_WRONG_COLORS | GAME_NOT_WORKING )
src/mame/drivers/tatsumi.c
r1527r1528
148148UINT8 *tatsumi_rom_sprite_lookup1, *tatsumi_rom_sprite_lookup2;
149149UINT8 *tatsumi_rom_clut0, *tatsumi_rom_clut1;
150150UINT16 *roundup5_unknown0, *roundup5_unknown1, *roundup5_unknown2;
151UINT16 bigfight_a20000[8], bigfight_a40000[2], bigfight_a60000[2];
151static UINT16 bigfight_a20000[8];
152UINT16 bigfight_a40000[2];
153static UINT16 bigfight_a60000[2];
152154extern UINT16 bigfight_bank;
153155static UINT8 *apache3_bg_ram;
154156
src/mame/drivers/blmbycar.c
r1527r1528
212212static INPUT_PORTS_START( blmbycar )
213213
214214   PORT_START   // IN0 - $700000.w
215   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) )
215   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:8,7")
216216   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    )
217217   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  )
218218   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    )
219219   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
220   PORT_DIPNAME( 0x0004, 0x0004, "Joysticks" )
220   PORT_DIPNAME( 0x0004, 0x0004, "Joysticks" ) PORT_DIPLOCATION("SW1:6")
221221   PORT_DIPSETTING(      0x0000, "1" )
222222   PORT_DIPSETTING(      0x0004, "2" )
223   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Controls ) )
223   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW1:5,4")
224224   PORT_DIPSETTING(      0x0018, DEF_STR( Joystick ) )
225225//  PORT_DIPSETTING(      0x0010, "Pot Wheel" ) // Preliminary
226226//  PORT_DIPSETTING(      0x0008, "Opt Wheel" ) // Preliminary
227227//  PORT_DIPSETTING(      0x0000, DEF_STR( Unused ) )   // Time goes to 0 rally fast!
228   PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Demo_Sounds ) )
228   PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
229229   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
230230   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
231   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 1-6" )
231   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 1-2" ) PORT_DIPLOCATION("SW1:2")
232232   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
233233   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
234   PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
234   PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:1" )
235235
236   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) )
236   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:8,7,6")
237237   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
238238   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_4C ) )
239239   PORT_DIPSETTING(      0x0100, DEF_STR( 2C_3C ) )
r1527r1528
242242   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
243243   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_5C ) )
244244   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_6C ) )
245   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) )
245   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,4,3")
246246   PORT_DIPSETTING(      0x1000, DEF_STR( 6C_1C ) )
247247   PORT_DIPSETTING(      0x1800, DEF_STR( 5C_1C ) )
248248   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
r1527r1528
251251   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_2C ) )
252252   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_3C ) )
253253   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
254   PORT_DIPNAME( 0x4000, 0x4000, "Credits To Start" )
254   PORT_DIPNAME( 0x4000, 0x4000, "Credits To Start" ) PORT_DIPLOCATION("SW2:2")
255255   PORT_DIPSETTING(      0x4000, "1" )
256256   PORT_DIPSETTING(      0x0000, "2" )
257   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Free_Play ) )
257   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:1")
258258   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
259259   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
260260
r1527r1528
288288
289289static INPUT_PORTS_START( watrball )
290290   PORT_START   /* dips */
291   PORT_DIPNAME( 0x0001, 0x0001, "1" )
292   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
293   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
294   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
295   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
296   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
297   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
298   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
299   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
300   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
301   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
302   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
303   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
304   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
305   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
306   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
291   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:8,7") /* Affects timer */
292   PORT_DIPSETTING(      0x0002, DEF_STR( Easy )    )    /* 180 Seconds */
293   PORT_DIPSETTING(      0x0003, DEF_STR( Normal )  )    /* 150 Seconds */
294   PORT_DIPSETTING(      0x0001, DEF_STR( Hard )    )    /* 120 Seconds */
295   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )    /* 100 Seconds */
296   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:6" )
297   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:5" )
298   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:4" )
299   PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
307300   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
308301   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
309   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
302   PORT_DIPNAME( 0x0040, 0x0040, "Unknown 1-2" ) PORT_DIPLOCATION("SW1:2")
310303   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
311304   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
312   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
313   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
314   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
315   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
316   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
317   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
318   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
319   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
320   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
321   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
322   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
323   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
324   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
325   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
326   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
327   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
328   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
329   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
330   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
331   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
332   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
333   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
334   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
335   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
336   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
337   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
338   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
305   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:1" )
339306
307   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:8,7,6")
308   PORT_DIPSETTING(      0x0700, DEF_STR( 1C_1C ) )
309   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_4C ) )
310   PORT_DIPSETTING(      0x0100, DEF_STR( 2C_3C ) )
311   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_2C ) )
312   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )
313   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
314   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_5C ) )
315   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_6C ) )
316   PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,4,3")
317   PORT_DIPSETTING(      0x1000, DEF_STR( 6C_1C ) )
318   PORT_DIPSETTING(      0x1800, DEF_STR( 5C_1C ) )
319   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_1C ) )
320   PORT_DIPSETTING(      0x2800, DEF_STR( 3C_1C ) )
321   PORT_DIPSETTING(      0x3000, DEF_STR( 2C_1C ) )
322   PORT_DIPSETTING(      0x0800, DEF_STR( 3C_2C ) )
323   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_3C ) )
324   PORT_DIPSETTING(      0x3800, DEF_STR( 1C_1C ) )
325   PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:2" )
326   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:1" )
327
340328   PORT_START   /* 16bit */
341329   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
342330   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN    ) PORT_PLAYER(1)
src/mame/drivers/retofinv.c
r1527r1528
376376   MDRV_CPU_PROGRAM_MAP(sound_map,0)
377377   MDRV_CPU_VBLANK_INT(nmi_line_pulse,2)
378378
379   MDRV_CPU_ADD_TAG("68705", M68705,18432000/6/M68705_CLOCK_DIVIDER)   /* 3.072 MHz? */
379   MDRV_CPU_ADD_TAG("68705", M68705,18432000/6)   /* 3.072 MHz? */
380380   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
381381
382382   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/megaplay.c
r1527r1528
464464   UINT8* game = memory_region(REGION_CPU1);
465465
466466   if(game_banksel == 0x142) // Genesis I/O
467      return megaplay_genesis_io_r((offset/2) & 0x1f, 0xffff);
467      return megaplay_genesis_io_r((offset & 0x1f) / 2, 0xffff);
468468
469469   if(bios_mode & MP_ROM)
470470   {
r1527r1528
497497static WRITE8_HANDLER ( bank_w )
498498{
499499   if(game_banksel == 0x142) // Genesis I/O
500      genesis_io_w((offset/2) & 0x1f, data, 0xffff);
500      genesis_io_w((offset & 0x1f) / 2, data, 0xffff);
501501
502502   if(offset <= 0x1fff && (bios_width & 0x08))
503503      ic37_ram[(0x2000 * (bios_bank & 0x03)) + offset] = data;
src/mame/drivers/harddriv.c
r1527r1528
966966   MDRV_CPU_VBLANK_INT(atarigen_video_int_gen,1)
967967   MDRV_CPU_PERIODIC_INT(hd68k_irq_gen, (double)32000000/16/16/16/16/2)
968968
969   MDRV_CPU_ADD_TAG("gsp", TMS34010, 48000000/TMS34010_CLOCK_DIVIDER)
969   MDRV_CPU_ADD_TAG("gsp", TMS34010, 48000000)
970970   MDRV_CPU_PROGRAM_MAP(driver_gsp_map,0)
971971   MDRV_CPU_CONFIG(gsp_config_driver)
972972
r1527r1528
994994   MDRV_IMPORT_FROM(driver_nomsp)
995995
996996   /* basic machine hardware */
997   MDRV_CPU_ADD_TAG("msp", TMS34010, 50000000/TMS34010_CLOCK_DIVIDER)
997   MDRV_CPU_ADD_TAG("msp", TMS34010, 50000000)
998998   MDRV_CPU_PROGRAM_MAP(driver_msp_map,0)
999999   MDRV_CPU_CONFIG(msp_config)
10001000MACHINE_DRIVER_END
r1527r1528
10231023   MDRV_IMPORT_FROM(multisync_nomsp)
10241024
10251025   /* basic machine hardware */
1026   MDRV_CPU_ADD_TAG("msp", TMS34010, 50000000/TMS34010_CLOCK_DIVIDER)
1026   MDRV_CPU_ADD_TAG("msp", TMS34010, 50000000)
10271027   MDRV_CPU_PROGRAM_MAP(driver_msp_map,0)
10281028   MDRV_CPU_CONFIG(msp_config)
10291029MACHINE_DRIVER_END
r1527r1528
11431143   MDRV_CPU_ADD_TAG("sound", M68000, 16000000/2)
11441144   MDRV_CPU_PROGRAM_MAP(driversnd_68k_map,0)
11451145
1146   MDRV_CPU_ADD_TAG("sounddsp", TMS32010, 20000000/TMS32010_CLOCK_DIVIDER)
1146   MDRV_CPU_ADD_TAG("sounddsp", TMS32010, 20000000)
11471147   MDRV_CPU_PROGRAM_MAP(driversnd_dsp_program_map,0)
11481148   /* Data Map is internal to the CPU */
11491149   MDRV_CPU_IO_MAP(driversnd_dsp_io_map,0)
src/mame/drivers/m72.c
r1527r1528
21842184   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 512, 64, 448, 284, 0, 256)
21852185   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
21862186
2187   MDRV_VIDEO_START(m72)
2188   MDRV_VIDEO_UPDATE(m72)
2189
21872190   /* sound hardware */
21882191   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
21892192
src/mame/drivers/r2dtank.c
r1527r1528
220220}
221221
222222
223static UINT32 get_ttl74123_output(void *param)
223static CUSTOM_INPUT( get_ttl74123_output )
224224{
225225   return ttl74123_output;
226226}
src/mame/drivers/konamigv.c
r1527r1528
155155   }
156156}
157157
158static UINT32 eeprom_bit_r(void *param)
158static CUSTOM_INPUT( eeprom_bit_r )
159159{
160160   return EEPROM_read_bit();
161161}
r1527r1528
347347
348348static MACHINE_DRIVER_START( konamigv )
349349   /* basic machine hardware */
350   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
350   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
351351   MDRV_CPU_PROGRAM_MAP( konamigv_map, 0 )
352352   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
353353
src/mame/drivers/amspdwy.c
r1527r1528
7474static ADDRESS_MAP_START( amspdwy_readmem, ADDRESS_SPACE_PROGRAM, 8 )
7575   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM            )   // ROM
7676//  AM_RANGE(0x8000, 0x801f) AM_READ(MRA8_RAM               )   // Palette
77   AM_RANGE(0x9000, 0x93ff) AM_READ(videoram_r         )   // Layer
78   AM_RANGE(0x9400, 0x97ff) AM_READ(videoram_r         )   // Mirror?
79   AM_RANGE(0x9800, 0x9bff) AM_READ(colorram_r         )   // Layer
77   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_READ(MRA8_RAM)   // Layer, mirrored?
78   AM_RANGE(0x9800, 0x9bff) AM_READ(MRA8_RAM         )   // Layer
8079   AM_RANGE(0x9c00, 0x9fff) AM_READ(MRA8_RAM            )   // Unused?
8180   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r      )   // DSW 1
8281   AM_RANGE(0xa400, 0xa400) AM_READ(input_port_1_r      )   // DSW 2
r1527r1528
9089static ADDRESS_MAP_START( amspdwy_writemem, ADDRESS_SPACE_PROGRAM, 8 )
9190   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM                     )   // ROM
9291   AM_RANGE(0x8000, 0x801f) AM_WRITE(amspdwy_paletteram_w) AM_BASE(&paletteram   )   // Palette
93   AM_RANGE(0x9000, 0x93ff) AM_WRITE(amspdwy_videoram_w) AM_BASE(&videoram      )   // Layer
94   AM_RANGE(0x9400, 0x97ff) AM_WRITE(amspdwy_videoram_w            )   // Mirror?
92   AM_RANGE(0x9000, 0x93ff) AM_MIRROR(0x0400) AM_WRITE(amspdwy_videoram_w) AM_BASE(&videoram)   // Layer, mirrored?
9593   AM_RANGE(0x9800, 0x9bff) AM_WRITE(amspdwy_colorram_w) AM_BASE(&colorram      )   // Layer
9694   AM_RANGE(0x9c00, 0x9fff) AM_WRITE(MWA8_RAM                     )   // Unused?
9795//  AM_RANGE(0xa000, 0xa000) AM_WRITE(MWA8_NOP                          )   // ?
src/mame/drivers/ksys573.c
r1527r1528
18781878   verboselog( 2, "stage: %dp data clk=%d state=%d d0=%d shift=%08x bit=%d stage_mask=%08x\n", offset + 1, clk, stage[ offset ].state, stage[ offset ].DO, stage[ offset ].shift, stage[ offset ].bit, stage_mask );
18791879}
18801880
1881static UINT32 gn845pwbb_read( void *param )
1881static CUSTOM_INPUT( gn845pwbb_read )
18821882{
18831883   return readinputportbytag( "STAGE" ) & stage_mask;
18841884}
r1527r1528
27252725
27262726static MACHINE_DRIVER_START( konami573 )
27272727   /* basic machine hardware */
2728   MDRV_CPU_ADD( PSXCPU, 33868800 / 2 ) /* 33MHz ?? */
2728   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
27292729   MDRV_CPU_PROGRAM_MAP( konami573_map, 0 )
27302730   MDRV_CPU_VBLANK_INT( sys573_vblank, 1 )
27312731
src/mame/drivers/legionna.c
r1527r1528
34593459
34603460/*****************************************************************************/
34613461
3462/* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
3463SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
3464
3465SEIBU_SOUND_SYSTEM_YM2151_HARDWARE
3466
3467/*****************************************************************************/
3468
34693462static MACHINE_DRIVER_START( legionna )
34703463
34713464   /* basic machine hardware */
r1527r1528
38583851   ROM_LOAD( "barrel.8",  0x00000, 0x20000, CRC(489e5b1d) SHA1(ecd69d87ed354d1d08dbe6c2890af5f05d9d67d0) )
38593852ROM_END
38603853
3854ROM_START( hetbrlu2 )
3855   ROM_REGION( 0x80000, REGION_CPU1, 0 )   /* 68000 code */
3856   ROM_LOAD32_BYTE( "hb1",   0x00000, 0x20000, CRC(16a3754f) SHA1(3e070f2d004fc17d8ae9171955dc48ec5d14cf8a) )
3857   ROM_LOAD32_BYTE( "hb2",   0x00001, 0x20000, CRC(b34dc60c) SHA1(f9d1438469bf0d36d53d3f148bdf7f04dee5eae0) )
3858   ROM_LOAD32_BYTE( "hb3",   0x00002, 0x20000, CRC(3b035081) SHA1(b7ecbacd85102eda21dd162427a0e57cc6d24661) )
3859   ROM_LOAD32_BYTE( "hb4",   0x00003, 0x20000, CRC(fae85c88) SHA1(1b0316e66d4e0c5b3aa4045d6bfcc8a5464dc74e) )
3860
3861   ROM_REGION( 0x20000*2, REGION_CPU2, 0 )   /* Z80 code, banked data */
3862   ROM_LOAD( "barrel.7",   0x00000, 0x08000, CRC(0784dbd8) SHA1(bdf7f8a3a3eb346eb2aeaf4f9bfc49af059d04c9) )
3863   ROM_CONTINUE(    0x10000, 0x08000 )   /* banked stuff */
3864
3865   ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE )
3866   ROM_LOAD( "barrel.6",   0x000000, 0x10000, CRC(bea3c581) SHA1(7f7f0a74bf106acaf57c182d47f0c707da2011bd) )   /* chars */
3867   ROM_LOAD( "barrel.5",   0x010000, 0x10000, CRC(5604d155) SHA1(afc30347b1e1316ec25056c0c1576f78be5f1a72) )
3868
3869   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
3870   ROM_LOAD( "obj1",     0x000000, 0x100000, CRC(f7a7c31c) SHA1(683e5c7a0732ff5fd56167dd82035ca050de0507) )   /* sprites */
3871   ROM_LOAD( "obj2",     0x100000, 0x100000, CRC(24236116) SHA1(b27bd771cacd1587d4927e3f489c4f54b5dec110) )
3872
3873   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE )   /* MBK tiles */
3874   ROM_LOAD( "bg-1",     0x000000, 0x100000, CRC(2f5d8baa) SHA1(0bf687c46c603150eadb304adcd78d53a338e615) )
3875
3876   ROM_REGION( 0x020000, REGION_GFX4, ROMREGION_DISPOSE )   /* not used */
3877
3878   ROM_REGION( 0x080000, REGION_GFX5, ROMREGION_DISPOSE )   /* BK3 tiles */
3879   ROM_LOAD( "bg-3",     0x000000, 0x080000, CRC(83850e2d) SHA1(cdc2df8e3bc58319c50768ea2a05b9c7ddc2a652) )
3880
3881   ROM_REGION( 0x080000, REGION_GFX6, ROMREGION_DISPOSE )   /* LBK tiles */
3882   ROM_LOAD( "bg-2",     0x000000, 0x080000, CRC(77ee4c6f) SHA1(a0072331bc970ba448ac5bb1ae5caa0332c82a99) )
3883
3884   ROM_REGION( 0x020000, REGION_SOUND1, 0 )   /* ADPCM samples */
3885   ROM_LOAD( "barrel.8",  0x00000, 0x20000, CRC(489e5b1d) SHA1(ecd69d87ed354d1d08dbe6c2890af5f05d9d67d0) )
3886ROM_END
3887
38613888/*
38623889
38633890Godzilla
r1527r1528
43804407GAME( 1992, heatbrl,  0,        heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (World)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43814408GAME( 1992, heatbrlo, heatbrl,  heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (World old version)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43824409GAME( 1992, heatbrlu, heatbrl,  heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (US)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
4410GAME( 1992, hetbrlu2, heatbrl,  heatbrl,  heatbrl,  0,        ROT0, "Tad", "Heated Barrel (US set 2)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43834411
43844412GAME( 1993, godzilla, 0,        godzilla, godzilla, 0,        ROT0, "Banpresto", "Godzilla", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
43854413GAME( 1993, sdgndmrb, 0,        sdgndmrb, sdgndmrb, 0,         ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/midas.c
r1527r1528
4949#include "sound/ymz280b.h"
5050#include "machine/eeprom.h"
5151
52#define MIDAS_DEBUG   0
53
5254static UINT16 *livequiz_gfxram, *livequiz_gfxregs;
5355
5456static VIDEO_START( livequiz );
r1527r1528
158160{
159161   int layers_ctrl = -1;
160162
161#ifdef MAME_DEBUG
163#if MIDAS_DEBUG
162164   if ( input_code_pressed(KEYCODE_Z) )
163165   {
164166      int msk = 0;
src/mame/drivers/mcr68.c
r1527r1528
878878static MACHINE_DRIVER_START( zwackery )
879879
880880   /* basic machine hardware */
881   MDRV_CPU_ADD(M68000, 7652400)
881   MDRV_CPU_ADD(M68000, 7652400)   /* should be XTAL_16MHz/2 */
882882   MDRV_CPU_PROGRAM_MAP(zwackery_map,0)
883883   MDRV_CPU_VBLANK_INT(mcr68_interrupt,1)
884884
r1527r1528
13211321   mcr68_common_init(MCR_CHIP_SQUEAK_DELUXE, 0, 0);
13221322
13231323   /* Zwackery doesn't care too much about this value; currently taken from Blasted */
1324   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(machine->drv->cpu[0].clock / 10) * (256 + 16));
1324   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
13251325}
13261326
13271327
r1527r1528
13301330   mcr68_common_init(MCR_SOUNDS_GOOD, 0, 0);
13311331
13321332   /* Xenophobe doesn't care too much about this value; currently taken from Blasted */
1333   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(machine->drv->cpu[0].clock / 10) * (256 + 16));
1333   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
13341334
13351335   /* install control port handler */
13361336   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, xenophobe_control_w);
r1527r1528
13421342   mcr68_common_init(MCR_TURBO_CHIP_SQUEAK | MCR_SOUNDS_GOOD, 0, -6);
13431343
13441344   /* Spy Hunter 2 doesn't care too much about this value; currently taken from Blasted */
1345   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(machine->drv->cpu[0].clock / 10) * (256 + 16));
1345   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
13461346
13471347   /* analog port handling is a bit tricky */
13481348   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, spyhunt2_control_w);
r1527r1528
13581358   /* Blasted checks the timing of VBLANK relative to the 493 interrupt */
13591359   /* VBLANK is required to come within 220-256 E clocks (i.e., 2200-2560 CPU clocks) */
13601360   /* after the 493; we also allow 16 E clocks for latency  */
1361   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(machine->drv->cpu[0].clock / 10) * (256 + 16));
1361   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
13621362
13631363   /* handle control writes */
13641364   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, blasted_control_w);
r1527r1528
13741374   mcr68_common_init(MCR_WILLIAMS_SOUND, 16, 0);
13751375
13761376   /* Arch Rivals doesn't care too much about this value; currently taken from Blasted */
1377   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(machine->drv->cpu[0].clock / 10) * (256 + 16));
1377   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * (256 + 16));
13781378
13791379   /* handle control writes */
13801380   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0cffff, 0, 0, archrivl_control_w);
r1527r1528
13931393   mcr68_common_init(MCR_WILLIAMS_SOUND, 16, 0);
13941394
13951395   /* Pigskin doesn't care too much about this value; currently taken from Tri-Sports */
1396   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(machine->drv->cpu[0].clock / 10) * 115);
1396   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * 115);
13971397
13981398   state_save_register_global_array(protection_data);
13991399}
r1527r1528
14061406   /* Tri-Sports checks the timing of VBLANK relative to the 493 interrupt */
14071407   /* VBLANK is required to come within 87-119 E clocks (i.e., 870-1190 CPU clocks) */
14081408   /* after the 493 */
1409   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(machine->drv->cpu[0].clock / 10) * 115);
1409   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpunum_get_clock(0) / 10) * 115);
14101410}
14111411
14121412
src/mame/drivers/spcforce.c
r1527r1528
255255   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
256256   MDRV_CPU_VBLANK_INT(irq3_line_hold,1)
257257
258   MDRV_CPU_ADD(I8035,6144000/8)
258   MDRV_CPU_ADD(I8035,6144000)
259259   /* audio CPU */      /* divisor ??? */
260260   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
261261   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
src/mame/drivers/gsword.c
r1527r1528
687687static MACHINE_DRIVER_START( gsword )
688688
689689   /* basic machine hardware */
690   MDRV_CPU_ADD(Z80, 3000000)
690   MDRV_CPU_ADD(Z80, XTAL_18MHz/6) /* verified on pcb */
691691   MDRV_CPU_PROGRAM_MAP(cpu1_map,0)
692692   MDRV_CPU_IO_MAP(cpu1_io_map,0)
693693   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
694694
695   MDRV_CPU_ADD(Z80, 3000000)
695   MDRV_CPU_ADD(Z80, XTAL_18MHz/6) /* verified on pcb */
696696   MDRV_CPU_PROGRAM_MAP(cpu2_map,0)
697697   MDRV_CPU_IO_MAP(cpu2_io_map,0)
698698   MDRV_CPU_VBLANK_INT(gsword_snd_interrupt,4)
699699
700   MDRV_CPU_ADD(Z80, 3000000)
700   MDRV_CPU_ADD(Z80, XTAL_18MHz/6) /* verified on pcb */
701701   /* audio CPU */
702702   MDRV_CPU_PROGRAM_MAP(cpu3_map,0)
703703
r1527r1528
728728   /* sound hardware */
729729   MDRV_SPEAKER_STANDARD_MONO("mono")
730730
731   MDRV_SOUND_ADD(AY8910, 1500000)
731   MDRV_SOUND_ADD(AY8910, XTAL_18MHz/12) /* verified on pcb */
732732   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
733733
734734   MDRV_SOUND_ADD(AY8910, 1500000)
735735   MDRV_SOUND_CONFIG(ay8910_interface)
736736   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
737737
738   MDRV_SOUND_ADD(MSM5205, 384000)
738   MDRV_SOUND_ADD(MSM5205, XTAL_400kHz) /* verified on pcb */
739739   MDRV_SOUND_CONFIG(msm5205_interface)
740740   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
741741MACHINE_DRIVER_END
src/mame/drivers/csk.c
r1527r1528
134134
135135extern UINT8 * cpk_colorram;
136136extern UINT8 * cpk_videoram;
137extern UINT8 * cpk_palette;
138extern UINT8 * cpk_palette2;
139137extern UINT8 * cpk_expram;
140138
141139
r1527r1528
146144
147145WRITE8_HANDLER( cpk_palette_w );
148146WRITE8_HANDLER( cpk_palette2_w );
149READ8_HANDLER( cpk_videoram_r );
150WRITE8_HANDLER( cpk_videoram_w );
151READ8_HANDLER( cpk_colorram_r );
152WRITE8_HANDLER( cpk_colorram_w );
153147READ8_HANDLER( cpk_expansion_r );
154WRITE8_HANDLER( cpk_expansion_w );
155148
156149
157150
r1527r1528
207200   AM_RANGE(0x5082, 0x5082) AM_READ(input_port_6_r)      /* Coing & Kbd */
208201   AM_RANGE(0x5091, 0x5091) AM_READ(input_port_7_r)      /* Keyboard */
209202   AM_RANGE(0x50a0, 0x50a0) AM_READ(input_port_8_r)      /* Not connected */
210   AM_RANGE(0x6800, 0x6fff) AM_WRITE(cpk_expansion_w)
211   AM_RANGE(0x7000, 0x77ff) AM_READWRITE(cpk_videoram_r,cpk_videoram_w)
212   AM_RANGE(0x7800, 0x7fff) AM_READWRITE(cpk_colorram_r,cpk_colorram_w)
203   AM_RANGE(0x6800, 0x6fff) AM_WRITE(MWA8_RAM) AM_BASE(&cpk_expram)
204   AM_RANGE(0x7000, 0x77ff) AM_RAM AM_BASE(&cpk_videoram)
205   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_BASE(&cpk_colorram)
213206   AM_RANGE(0x8000, 0xffff) AM_READ(cpk_expansion_r)
214207ADDRESS_MAP_END
215208
r1527r1528
226219   AM_RANGE(0x5090, 0x5090) AM_WRITE(custom_io_w)
227220   AM_RANGE(0x5091, 0x5091) AM_READ(custom_io_r)         /* used for protection and other */
228221   AM_RANGE(0x50a0, 0x50a0) AM_READ(input_port_8_r)      /* Not connected */
229   AM_RANGE(0x6800, 0x6fff) AM_WRITE(cpk_expansion_w)
230   AM_RANGE(0x7000, 0x77ff) AM_READWRITE(cpk_videoram_r,cpk_videoram_w)
231   AM_RANGE(0x7800, 0x7fff) AM_READWRITE(cpk_colorram_r,cpk_colorram_w)
222   AM_RANGE(0x6800, 0x6fff) AM_WRITE(MWA8_RAM) AM_BASE(&cpk_expram)
223   AM_RANGE(0x7000, 0x77ff) AM_RAM AM_BASE(&cpk_videoram)
224   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_BASE(&cpk_colorram)
232225   AM_RANGE(0x8000, 0xffff) AM_READ(cpk_expansion_r)
233226ADDRESS_MAP_END
234227
src/mame/drivers/naughtyb.c
r1527r1528
186186static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
187187   AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM)
188188   AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_RAM)
189   AM_RANGE(0x8000, 0x87ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
190   AM_RANGE(0x8800, 0x8fff) AM_WRITE(naughtyb_videoram2_w) AM_BASE(&naughtyb_videoram2)
189   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
190   AM_RANGE(0x8800, 0x8fff) AM_WRITE(MWA8_RAM) AM_BASE(&naughtyb_videoram2)
191191   AM_RANGE(0x9000, 0x97ff) AM_WRITE(naughtyb_videoreg_w)
192192   AM_RANGE(0x9800, 0x9fff) AM_WRITE(MWA8_RAM) AM_BASE(&naughtyb_scrollreg)
193193   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(pleiads_sound_control_a_w)
r1527r1528
197197static ADDRESS_MAP_START( popflame_writemem, ADDRESS_SPACE_PROGRAM, 8 )
198198   AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM)
199199   AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_RAM)
200   AM_RANGE(0x8000, 0x87ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
201   AM_RANGE(0x8800, 0x8fff) AM_WRITE(naughtyb_videoram2_w) AM_BASE(&naughtyb_videoram2)
200   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
201   AM_RANGE(0x8800, 0x8fff) AM_WRITE(MWA8_RAM) AM_BASE(&naughtyb_videoram2)
202202   AM_RANGE(0x9000, 0x97ff) AM_WRITE(popflame_videoreg_w)
203203   AM_RANGE(0x9800, 0x9fff) AM_WRITE(MWA8_RAM) AM_BASE(&naughtyb_scrollreg)
204204   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(pleiads_sound_control_a_w)
src/mame/drivers/micro3d.c
r1527r1528
863863   MDRV_CPU_PROGRAM_MAP(hostmem,0)
864864   MDRV_CPU_VBLANK_INT(micro3d_vblank,1)
865865
866    MDRV_CPU_ADD(TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
866    MDRV_CPU_ADD(TMS34010, 40000000)
867867   MDRV_CPU_CONFIG(vgb_config)
868868   MDRV_CPU_PROGRAM_MAP(vgbmem,0)
869869
src/mame/drivers/momoko.c
r1527r1528
7878   AM_RANGE(0xdc01, 0xdc01) AM_WRITE(momoko_fg_scrollx_w)
7979   AM_RANGE(0xdc02, 0xdc02) AM_WRITE(momoko_fg_select_w)
8080
81   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
81   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
8282
8383   AM_RANGE(0xe800, 0xe800) AM_WRITE(momoko_text_scrolly_w)
8484   AM_RANGE(0xe801, 0xe801) AM_WRITE(momoko_text_mode_w)
src/mame/drivers/kchamp.c
r1527r1528
9797   AM_RANGE(0xc000, 0xcfff) AM_WRITE(MWA8_RAM)
9898   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(kchamp_videoram_w) AM_BASE(&videoram)
9999   AM_RANGE(0xd400, 0xd7ff) AM_WRITE(kchamp_colorram_w) AM_BASE(&colorram)
100   AM_RANGE(0xd800, 0xd8ff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
100   AM_RANGE(0xd800, 0xd8ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
101101   AM_RANGE(0xd900, 0xdfff) AM_WRITE(MWA8_RAM)
102102   AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_ROM)
103103ADDRESS_MAP_END
r1527r1528
188188   AM_RANGE(0xc000, 0xdfff) AM_WRITE(MWA8_RAM)
189189   AM_RANGE(0xe000, 0xe3ff) AM_WRITE(kchamp_videoram_w) AM_BASE(&videoram)
190190   AM_RANGE(0xe400, 0xe7ff) AM_WRITE(kchamp_colorram_w) AM_BASE(&colorram)
191   AM_RANGE(0xea00, 0xeaff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
191   AM_RANGE(0xea00, 0xeaff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
192192   AM_RANGE(0xeb00, 0xffff) AM_WRITE(MWA8_RAM)
193193ADDRESS_MAP_END
194194
src/mame/drivers/ultratnk.c
r1527r1528
2020
2121
2222
23static UINT32 get_collision(void *param)
23static CUSTOM_INPUT( get_collision )
2424{
2525   return ultratnk_collision[(FPTR) param];
2626}
2727
2828
29static UINT32 get_joystick(void* param)
29static CUSTOM_INPUT( get_joystick )
3030{
3131   UINT8 joy = readinputportbytag(param) & 3;
3232
src/mame/drivers/phoenix.c
r1527r1528
664664};
665665
666666static GFXDECODE_START( phoenix )
667   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,     0, 16 )
668   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 16*4, 16 )
667   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
668   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0, 16 )
669669GFXDECODE_END
670670
671671static GFXDECODE_START( pleiads )
r1527r1528
720720static MACHINE_DRIVER_START( phoenix )
721721
722722   /* basic machine hardware */
723   MDRV_CPU_ADD_TAG("main", 8085A, 11000000/4)   /* 2.75 MHz */
723   MDRV_CPU_ADD_TAG("main", 8085A, CPU_CLOCK)   /* 2.75 MHz */
724724   MDRV_CPU_PROGRAM_MAP(phoenix_readmem,phoenix_writemem)
725725
726   MDRV_SCREEN_REFRESH_RATE(60)
727   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION   /* frames per second, vblank duration */)
726   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
728727
729728   MDRV_MACHINE_RESET(phoenix)
730729
731730   /* video hardware */
732731   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
733732   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
734   MDRV_SCREEN_SIZE(32*8, 32*8)
735   MDRV_SCREEN_VISIBLE_AREA(0*8, 31*8-1, 0*8, 26*8-1)
736733   MDRV_GFXDECODE(phoenix)
737734   MDRV_PALETTE_LENGTH(256)
738   MDRV_COLORTABLE_LENGTH(16*4+16*4)
739735
740736   MDRV_PALETTE_INIT(phoenix)
741737   MDRV_VIDEO_START(phoenix)
742738   MDRV_VIDEO_UPDATE(phoenix)
743739
740   MDRV_SOUND_START(phoenix)
741
744742   /* sound hardware */
745743   MDRV_SPEAKER_STANDARD_MONO("mono")
746744
r1527r1528
770768   MDRV_COLORTABLE_LENGTH(32*4+32*4)
771769
772770   MDRV_PALETTE_INIT(pleiads)
771   MDRV_VIDEO_START(pleiads)
773772
774773   /* sound hardware */
775774   MDRV_SOUND_REPLACE("tms", TMS36XX, 247)
r1527r1528
13071306
13081307
13091308
1310GAME( 1980, phoenix,  0,       phoenix,  phoenix,  0,        ROT90, "Amstar", "Phoenix (Amstar)", 0 )
1311GAME( 1980, phoenixa, phoenix, phoenix,  phoenixa, 0,        ROT90, "Amstar (Centuri license)", "Phoenix (Centuri), Set 1", 0 )
1312GAME( 1980, phoenixb, phoenix, phoenix,  phoenixa, 0,        ROT90, "Amstar (Centuri license)", "Phoenix (Centuri), Set 2", 0 )
1313GAME( 1980, phoenixt, phoenix, phoenix,  phoenixt, 0,        ROT90, "Taito", "Phoenix (Taito)", 0 )
1314GAME( 1980, phoenix3, phoenix, phoenix,  phoenix3, 0,        ROT90, "bootleg", "Phoenix (T.P.N.)", 0 )
1315GAME( 1981, phoenixc, phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg?", "Phoenix (IRECSA, G.G.I Corp)", 0 )
1309GAME( 1980, phoenix,  0,       phoenix,  phoenix,  0,        ROT90, "Amstar", "Phoenix (Amstar)", GAME_SUPPORTS_SAVE )
1310GAME( 1980, phoenixa, phoenix, phoenix,  phoenixa, 0,        ROT90, "Amstar (Centuri license)", "Phoenix (Centuri), Set 1", GAME_SUPPORTS_SAVE )
1311GAME( 1980, phoenixb, phoenix, phoenix,  phoenixa, 0,        ROT90, "Amstar (Centuri license)", "Phoenix (Centuri), Set 2", GAME_SUPPORTS_SAVE )
1312GAME( 1980, phoenixt, phoenix, phoenix,  phoenixt, 0,        ROT90, "Taito", "Phoenix (Taito)", GAME_SUPPORTS_SAVE )
1313GAME( 1980, phoenix3, phoenix, phoenix,  phoenix3, 0,        ROT90, "bootleg", "Phoenix (T.P.N.)", GAME_SUPPORTS_SAVE )
1314GAME( 1981, phoenixc, phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg?", "Phoenix (IRECSA, G.G.I Corp)", GAME_SUPPORTS_SAVE )
13161315
13171316
13181317GAME( 1981, condor,   phoenix, condor,   condor,   condor,   ROT90, "Sidam (bootleg)",      "Condor (bootleg of Phoenix)", 0 )
13191318// the following 2 were common bootlegs in england & france respectively
1320GAME( 1980, falcon,   phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg",              "Falcon (bootleg of Phoenix) (set 1)", 0 )
1321GAME( 1980, vautour,  phoenix, phoenix,  phoenixt, 0,        ROT90, "Jeutel (bootleg)",     "Vautour (bootleg of Phoenix) (set 1)", 0 )
1319GAME( 1980, falcon,   phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg",              "Falcon (bootleg of Phoenix) (set 1)", GAME_SUPPORTS_SAVE )
1320GAME( 1980, vautour,  phoenix, phoenix,  phoenixt, 0,        ROT90, "Jeutel (bootleg)",     "Vautour (bootleg of Phoenix) (set 1)", GAME_SUPPORTS_SAVE )
13221321GAME( 1980, vautour2, phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Vautour (bootleg of Phoenix) (set 2)", 0 )
13231322// fenix is an italian bootleg based on vautour
13241323GAME( 1980, fenix,    phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Fenix (bootleg of Phoenix)", GAME_NOT_WORKING )
src/mame/drivers/markham.c
r1527r1528
4545   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
4646
4747   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
48   AM_RANGE(0xc800, 0xcfff) AM_READ(spriteram_r)
48   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM)
4949   AM_RANGE(0xd000, 0xd7ff) AM_READ(MRA8_RAM)
5050   AM_RANGE(0xd800, 0xdfff) AM_READ(markham_sharedram_r)
5151
src/mame/drivers/msisaac.c
r1527r1528
538538   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)   /* source of IRQs is unknown */
539539
540540#ifdef USE_MCU
541   MDRV_CPU_ADD(M68705,8000000/2/M68705_CLOCK_DIVIDER)  /* 4 MHz */
541   MDRV_CPU_ADD(M68705,8000000/2)  /* 4 MHz */
542542   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
543543#endif
544544
src/mame/drivers/superqix.c
r1527r1528
962962   MDRV_CPU_IO_MAP(hotsmash_port_map,0)
963963   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
964964
965   MDRV_CPU_ADD(M68705, 4000000/M68705_CLOCK_DIVIDER) /* ???? */
965   MDRV_CPU_ADD(M68705, 4000000) /* ???? */
966966   MDRV_CPU_PROGRAM_MAP(m68705_map,0)
967967
968968   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/cojag.c
r1527r1528
177177#include "jaguar.h"
178178
179179
180#define JAGUAR_CLOCK      XTAL_52MHz
181#define R3000_CLOCK         XTAL_40MHz
182#define M68K_CLOCK         XTAL_50MHz
180183
184
185
181186/*************************************
182187 *
183188 *  Global variables
r1527r1528
987992static MACHINE_DRIVER_START( cojagr3k )
988993
989994   /* basic machine hardware */
990   MDRV_CPU_ADD(R3000BE, 66000000/2)
995   MDRV_CPU_ADD_TAG("main", R3041BE, R3000_CLOCK)
991996   MDRV_CPU_CONFIG(config)
992997   MDRV_CPU_PROGRAM_MAP(r3000_map,0)
993998
994   MDRV_CPU_ADD(JAGUARGPU, 52000000/2)
999   MDRV_CPU_ADD(JAGUARGPU, JAGUAR_CLOCK/2)
9951000   MDRV_CPU_CONFIG(gpu_config)
9961001   MDRV_CPU_PROGRAM_MAP(gpu_map,0)
9971002
998   MDRV_CPU_ADD(JAGUARDSP, 52000000/2)
1003   MDRV_CPU_ADD(JAGUARDSP, JAGUAR_CLOCK/2)
9991004   MDRV_CPU_CONFIG(dsp_config)
10001005   MDRV_CPU_PROGRAM_MAP(dsp_map,0)
10011006
1002   MDRV_SCREEN_REFRESH_RATE(60)
1003
10041007   MDRV_MACHINE_RESET(cojag)
10051008   MDRV_NVRAM_HANDLER(generic_1fill)
10061009
10071010   /* video hardware */
10081011   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
1009   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1010   MDRV_SCREEN_SIZE(42*8, 262)     /* guess -- TOM registers should be used to configure screen */
1011   MDRV_SCREEN_VISIBLE_AREA(0*8, 42*8-1, 0*8, 30*8-1)
1012   MDRV_PALETTE_LENGTH(65534)
10131012
1013   MDRV_SCREEN_ADD("main", 0)
1014   MDRV_SCREEN_RAW_PARAMS(COJAG_PIXEL_CLOCK/2, 456, 42, 402, 262, 17, 257)
1015   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
1016
10141017   MDRV_VIDEO_START(cojag)
10151018   MDRV_VIDEO_UPDATE(cojag)
10161019
r1527r1528
10251028MACHINE_DRIVER_END
10261029
10271030
1028static MACHINE_DRIVER_START( r3knarrow )
1031static MACHINE_DRIVER_START( cojag68k )
10291032   MDRV_IMPORT_FROM(cojagr3k)
10301033
1031   /* video hardware */
1032   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
1033MACHINE_DRIVER_END
1034
1035
1036static MACHINE_DRIVER_START( cojag68k )
1037
10381034   /* basic machine hardware */
1039   MDRV_CPU_ADD(M68EC020, 50000000/2)
1035   MDRV_CPU_REPLACE("main", M68EC020, M68K_CLOCK/2)
10401036   MDRV_CPU_PROGRAM_MAP(m68020_map,0)
1041
1042   MDRV_CPU_ADD(JAGUARGPU, 52000000/2)
1043   MDRV_CPU_CONFIG(gpu_config)
1044   MDRV_CPU_PROGRAM_MAP(gpu_map,0)
1045
1046   MDRV_CPU_ADD(JAGUARDSP, 52000000/2)
1047   MDRV_CPU_CONFIG(dsp_config)
1048   MDRV_CPU_PROGRAM_MAP(dsp_map,0)
1049
1050   MDRV_SCREEN_REFRESH_RATE(60)
1051
1052   MDRV_MACHINE_RESET(cojag)
1053   MDRV_NVRAM_HANDLER(generic_1fill)
1054
1055   /* video hardware */
1056   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
1057   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1058   MDRV_SCREEN_SIZE(42*8, 262)     /* guess -- TOM registers should be used to configure screen */
1059   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
1060   MDRV_PALETTE_LENGTH(65534)
1061
1062   MDRV_VIDEO_START(cojag)
1063   MDRV_VIDEO_UPDATE(cojag)
1064
1065   /* sound hardware */
1066   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1067
1068   MDRV_SOUND_ADD(DAC, 0)
1069   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
1070
1071   MDRV_SOUND_ADD(DAC, 0)
1072   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
10731037MACHINE_DRIVER_END
10741038
10751039
r1527r1528
14231387static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
14241388{
14251389   /* copy over the ROM */
1426   cojag_is_r3000 = (machine->drv->cpu[0].type == CPU_R3000BE);
1390   cojag_is_r3000 = (machine->drv->cpu[0].type == CPU_R3041BE);
14271391
14281392   /* install synchronization hooks for GPU */
14291393   if (cojag_is_r3000)
r1527r1528
15601524 *
15611525 *************************************/
15621526
1563GAME( 1996, area51,   0,        r3knarrow, area51,   area51,   ROT0, "Atari Games", "Area 51 (R3000)", 0 )
1527GAME( 1996, area51,   0,        cojagr3k, area51,   area51,   ROT0, "Atari Games", "Area 51 (R3000)", 0 )
15641528GAME( 1995, area51t,  area51,   cojag68k,  area51,   area51a,  ROT0, "Time Warner", "Area 51 (Time Warner License)", 0 )
15651529GAME( 1995, area51a,  area51,   cojag68k,  area51,   area51a,  ROT0, "Atari Games", "Area 51 (Atari Games License)", 0 )
15661530GAME( 1995, fishfren, 0,        cojagr3k,  fishfren, fishfren, ROT0, "Time Warner Interactive", "Fishin' Frenzy (prototype)", 0 )
r1527r1528
15711535GAME( 1996, freezea4, freezeat, cojagr3k,  freezeat, freezea4, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/10/03)", 0 )
15721536GAME( 1996, freezea5, freezeat, cojagr3k,  freezeat, freezea5, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/20, AMOA-96)", 0 )
15731537GAME( 1996, freezea6, freezeat, cojagr3k,  freezeat, freezea6, ROT0, "Atari Games", "Freeze (Atari) (prototype, 96/09/07, Jamma-96)", 0 )
1574GAME( 1996, maxforce, 0,        r3knarrow, area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.05", 0 )
1575GAME( 1996, maxf_102, maxforce, r3knarrow, area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.02", 0 )
1576GAME( 1996, maxf_ng,  maxforce, r3knarrow, area51,   maxforce, ROT0, "Atari Games", "Maximum Force (No Gore version)", 0 )
1538GAME( 1996, maxforce, 0,        cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.05", 0 )
1539GAME( 1996, maxf_102, maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force v1.02", 0 )
1540GAME( 1996, maxf_ng,  maxforce, cojagr3k,  area51,   maxforce, ROT0, "Atari Games", "Maximum Force (No Gore version)", 0 )
15771541GAME( 1998, area51mx, 0,        cojag68k,  area51,   area51mx, ROT0, "Atari Games", "Area 51 / Maximum Force Duo v2.0", 0 )
1578GAME( 1998, a51mxr3k, area51mx, r3knarrow, area51,   a51mxr3k, ROT0, "Atari Games", "Area 51 / Maximum Force Duo (R3000)", 0 )
1542GAME( 1998, a51mxr3k, area51mx, cojagr3k, area51,   a51mxr3k, ROT0, "Atari Games", "Area 51 / Maximum Force Duo (R3000)", 0 )
15791543GAME( 1996, vcircle,  0,        cojagr3k,  vcircle,  vcircle,  ROT0, "Atari Games", "Vicious Circle (prototype)", 0 )
src/mame/drivers/uapce.c
r1527r1528
113113   jamma_if_control_latch = 0;
114114};
115115
116ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8)
116static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8)
117117   AM_RANGE( 0x0000, 0x07FF) AM_ROM
118118   AM_RANGE( 0x0800, 0x0FFF) AM_RAM
119119   AM_RANGE( 0x1000, 0x17FF) AM_WRITE( jamma_if_control_latch_w )
src/mame/drivers/wilytowr.c
r1527r1528
516516   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
517517   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
518518
519   MDRV_CPU_ADD(I8039,8000000/15)   /* ????? */
519   MDRV_CPU_ADD(I8039,8000000)   /* ????? */
520520   /* audio CPU */
521521   MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem)
522522   MDRV_CPU_IO_MAP(i8039_readport,i8039_writeport)
r1527r1528
553553   MDRV_CPU_PROGRAM_MAP(fghtbskt_map,0)
554554   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
555555
556   MDRV_CPU_ADD(I8039,12000000/4/I8039_CLOCK_DIVIDER)   /* ????? */
556   MDRV_CPU_ADD(I8039,12000000/4)   /* ????? */
557557   /* audio CPU */
558558   MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem)
559559   MDRV_CPU_IO_MAP(i8039_readport,i8039_writeport)
src/mame/drivers/looping.c
r1527r1528
6666
6767#define MAIN_CPU_CLOCK      (12000000)
6868#define SOUND_CLOCK         (8000000)
69#define COP_CLOCK         (1000000)      /* unknown */
69#define COP_CLOCK         (SOUND_CLOCK/2)      /* unknown guess */
7070#define TMS_CLOCK         (640000)
7171
7272/* the schematics are very blurry here and don't actually specify the clock */
src/mame/drivers/segas32.c
r1527r1528
584584 *
585585 *************************************/
586586
587static UINT32 eeprom_bit_r(void *param)
587static CUSTOM_INPUT( eeprom_bit_r )
588588{
589589   return EEPROM_read_bit();
590590}
src/mame/drivers/slapfght.c
r1527r1528
945945   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
946946   MDRV_CPU_VBLANK_INT(nmi_line_pulse,6)    /* ??? */
947947
948   MDRV_CPU_ADD(M68705,4000000/M68705_CLOCK_DIVIDER)
948   MDRV_CPU_ADD(M68705,4000000)
949949   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
950950
951951   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
16491649static READ8_HANDLER( slapfigh_mcu_r )
16501650{
16511651   /* pass initial checks */
1652   int protvalues[] = { 0xc7, 0x55, -1 };
1652   static const int protvalues[] = { 0xc7, 0x55, -1 };
16531653
16541654   if ((activecpu_get_pc()==0x1369) || // slapfigh
16551655      (activecpu_get_pc()==0x136d)) // slapfiga
src/mame/drivers/astinvad.c
r1527r1528
1414***************************************************************************/
1515
1616#include "driver.h"
17#include "machine/8255ppi.h"
1718#include "sound/samples.h"
18#include "includes/astinvad.h"
1919
2020
21static ADDRESS_MAP_START( kamikaze_readmem, ADDRESS_SPACE_PROGRAM, 8 )
22   AM_RANGE(0x0000, 0x1bff) AM_READ(MRA8_ROM)
23   AM_RANGE(0x1c00, 0x3fff) AM_READ(MRA8_RAM)
24ADDRESS_MAP_END
21#define MASTER_CLOCK      XTAL_2MHz
22#define VIDEO_CLOCK         XTAL_4_9152MHz
2523
26static ADDRESS_MAP_START( kamikaze_writemem, ADDRESS_SPACE_PROGRAM, 8 )
27   AM_RANGE(0x0000, 0x1bff) AM_WRITE(MWA8_ROM)
28   AM_RANGE(0x1c00, 0x1fff) AM_WRITE(MWA8_RAM)
29   AM_RANGE(0x2000, 0x3fff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
30   AM_RANGE(0x4000, 0x4fff) AM_WRITE(MWA8_NOP) /* sloppy game code writes here */
31ADDRESS_MAP_END
3224
25/* sample sound IDs - must match sample file name table below */
26enum
27{
28   SND_UFO = 0,
29   SND_SHOT,
30   SND_BASEHIT,
31   SND_INVADERHIT,
32   SND_FLEET1,
33   SND_FLEET2,
34   SND_FLEET3,
35   SND_FLEET4,
36   SND_UFOHIT
37};
3338
34static ADDRESS_MAP_START( spaceint_readmem, ADDRESS_SPACE_PROGRAM, 8 )
35   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
36   AM_RANGE(0x2000, 0x23ff) AM_READ(MRA8_RAM)
37   AM_RANGE(0x4000, 0x5fff) AM_READ(MRA8_RAM)
38ADDRESS_MAP_END
3939
40static ADDRESS_MAP_START( spaceint_writemem, ADDRESS_SPACE_PROGRAM, 8 )
41   AM_RANGE(0x0000, 0x17ff) AM_WRITE(MWA8_ROM)
42   AM_RANGE(0x2000, 0x23ff) AM_WRITE(MWA8_RAM)
43   AM_RANGE(0x4000, 0x5fff) AM_WRITE(spaceint_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
40
41/*************************************
42 *
43 *  Globals
44 *
45 *************************************/
46
47static emu_timer *int_timer;
48static UINT8 sound_state[2];
49static UINT8 screen_flip;
50static UINT8 screen_red;
51static UINT8 flip_yoffs;
52static UINT8 color_latch;
53
54
55
56/*************************************
57 *
58 *  Prototypes and interfaces
59 *
60 *************************************/
61
62static WRITE8_HANDLER( astinvad_sound1_w );
63static WRITE8_HANDLER( astinvad_sound2_w );
64
65static const ppi8255_interface ppi8255_intf =
66{
67   2,
68   { input_port_0_r, NULL },
69   { input_port_1_r, input_port_3_r },
70   { input_port_2_r, NULL },
71   { NULL, astinvad_sound1_w },
72   { NULL, astinvad_sound2_w },
73   { NULL, NULL },
74};
75
76
77
78/*************************************
79 *
80 *  Spaceint color RAM handling
81 *
82 *************************************/
83
84static VIDEO_START( spaceint )
85{
86   colorram = auto_malloc(videoram_size);
87}
88
89
90static WRITE8_HANDLER( color_latch_w )
91{
92   color_latch = data & 0x0f;
93}
94
95
96static WRITE8_HANDLER( spaceint_videoram_w )
97{
98   videoram[offset] = data;
99   colorram[offset] = color_latch;
100}
101
102
103
104/*************************************
105 *
106 *  Spaceint color RAM handling
107 *
108 *************************************/
109
110static void plot_byte(mame_bitmap *bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color)
111{
112   pen_t fore_pen = MAKE_RGB(pal1bit(color >> 0), pal1bit(color >> 2), pal1bit(color >> 1));
113   UINT8 flip_xor = screen_flip & 7;
114
115   *BITMAP_ADDR32(bitmap, y, x + (0 ^ flip_xor)) = (data & 0x01) ? fore_pen : RGB_BLACK;
116   *BITMAP_ADDR32(bitmap, y, x + (1 ^ flip_xor)) = (data & 0x02) ? fore_pen : RGB_BLACK;
117   *BITMAP_ADDR32(bitmap, y, x + (2 ^ flip_xor)) = (data & 0x04) ? fore_pen : RGB_BLACK;
118   *BITMAP_ADDR32(bitmap, y, x + (3 ^ flip_xor)) = (data & 0x08) ? fore_pen : RGB_BLACK;
119   *BITMAP_ADDR32(bitmap, y, x + (4 ^ flip_xor)) = (data & 0x10) ? fore_pen : RGB_BLACK;
120   *BITMAP_ADDR32(bitmap, y, x + (5 ^ flip_xor)) = (data & 0x20) ? fore_pen : RGB_BLACK;
121   *BITMAP_ADDR32(bitmap, y, x + (6 ^ flip_xor)) = (data & 0x40) ? fore_pen : RGB_BLACK;
122   *BITMAP_ADDR32(bitmap, y, x + (7 ^ flip_xor)) = (data & 0x80) ? fore_pen : RGB_BLACK;
123}
124
125
126static VIDEO_UPDATE( astinvad )
127{
128   const UINT8 *color_prom = memory_region(REGION_PROMS);
129   UINT8 yoffs = flip_yoffs & screen_flip;
130   int x, y;
131
132   /* render the visible pixels */
133   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
134      for (x = cliprect->min_x & ~7; x <= cliprect->max_x; x += 8)
135      {
136         UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (screen_flip ? 0 : 4);
137         UINT8 data = videoram[(((y ^ screen_flip) + yoffs) << 5) | ((x ^ screen_flip) >> 3)];
138         plot_byte(bitmap, y, x, data, screen_red ? 1 : color);
139      }
140
141   return 0;
142}
143
144
145static VIDEO_UPDATE( spaceint )
146{
147   int offs;
148
149   for (offs = 0; offs < videoram_size; offs++)
150   {
151      UINT8 data = videoram[offs];
152      UINT8 color = colorram[offs];
153
154      UINT8 y = ~offs;
155      UINT8 x = offs >> 8 << 3;
156
157      /* this is almost certainly wrong */
158      offs_t n = ((offs >> 5) & 0xf0) | color;
159      color = memory_region(REGION_PROMS)[n] & 0x07;
160
161      plot_byte(bitmap, y, x, data, color);
162   }
163
164   return 0;
165}
166
167
168
169/*************************************
170 *
171 *  Interrupts
172 *
173 *************************************/
174
175static TIMER_CALLBACK( kamikaze_int_off )
176{
177   cpunum_set_input_line(0, 0, CLEAR_LINE);
178}
179
180
181static TIMER_CALLBACK( kamizake_int_gen )
182{
183   /* interrupts are asserted on every state change of the 128V line */
184   cpunum_set_input_line(0, 0, ASSERT_LINE);
185   param ^= 128;
186   timer_adjust(int_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_never);
187
188   /* an RC circuit turns the interrupt off after a short amount of time */
189   timer_set(double_to_attotime(300 * 0.1e-6), NULL, 0, kamikaze_int_off);
190}
191
192
193static MACHINE_START( kamikaze )
194{
195   ppi8255_init(&ppi8255_intf);
196   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);
198}
199
200
201static INTERRUPT_GEN( spaceint_interrupt )
202{
203   if (readinputport(2) & 1)   /* coin */
204      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
205
206   cpunum_set_input_line(0, 0, HOLD_LINE);
207}
208
209
210
211/*************************************
212 *
213 *  8255 PPI handlers
214 *
215 *************************************/
216
217static READ8_HANDLER( kamikaze_ppi_r )
218{
219   UINT8 result = 0xff;
220
221   /* the address lines are used for /CS; yes, they can overlap! */
222   if (!(offset & 4))
223      result &= ppi8255_0_r(offset);
224   if (!(offset & 8))
225      result &= ppi8255_1_r(offset);
226   return result;
227}
228
229
230static WRITE8_HANDLER( kamikaze_ppi_w )
231{
232   /* the address lines are used for /CS; yes, they can overlap! */
233   if (!(offset & 4))
234      ppi8255_0_w(offset, data);
235   if (!(offset & 8))
236      ppi8255_1_w(offset, data);
237}
238
239
240
241/*************************************
242 *
243 *  Sound and I/O port handlers
244 *
245 *************************************/
246
247static WRITE8_HANDLER( astinvad_sound1_w )
248{
249   int bits_gone_hi = data & ~sound_state[0];
250   sound_state[0] = data;
251
252   if (bits_gone_hi & 0x01) sample_start(0, SND_UFO, 1);
253   if (!(data & 0x01))      sample_stop(0);
254   if (bits_gone_hi & 0x02) sample_start(1, SND_SHOT, 0);
255   if (bits_gone_hi & 0x04) sample_start(2, SND_BASEHIT, 0);
256   if (bits_gone_hi & 0x08) sample_start(3, SND_INVADERHIT, 0);
257
258   sound_global_enable(data & 0x20);
259   screen_red = data & 0x04;
260}
261
262
263static WRITE8_HANDLER( astinvad_sound2_w )
264{
265   int bits_gone_hi = data & ~sound_state[1];
266   sound_state[1] = data;
267
268   if (bits_gone_hi & 0x01) sample_start(5, SND_FLEET1, 0);
269   if (bits_gone_hi & 0x02) sample_start(5, SND_FLEET2, 0);
270   if (bits_gone_hi & 0x04) sample_start(5, SND_FLEET3, 0);
271   if (bits_gone_hi & 0x08) sample_start(5, SND_FLEET4, 0);
272   if (bits_gone_hi & 0x10) sample_start(4, SND_UFOHIT, 0);
273
274   screen_flip = (readinputport(3) & data & 0x20) ? 0xff : 0x00;
275}
276
277
278static WRITE8_HANDLER( spaceint_sound1_w )
279{
280   int bits_gone_hi = data & ~sound_state[0];
281   sound_state[0] = data;
282
283   if (bits_gone_hi & 0x01) sample_start(1, SND_SHOT, 0);
284   if (bits_gone_hi & 0x02) sample_start(2, SND_BASEHIT, 0);
285   if (bits_gone_hi & 0x04) sample_start(4, SND_UFOHIT, 0);
286   if (bits_gone_hi & 0x08) sample_start(0, SND_UFO, 1);
287   if (!(data & 0x08))      sample_stop(0);
288
289   if (bits_gone_hi & 0x10) sample_start(5, SND_FLEET1, 0);
290   if (bits_gone_hi & 0x20) sample_start(5, SND_FLEET2, 0);
291   if (bits_gone_hi & 0x40) sample_start(5, SND_FLEET3, 0);
292   if (bits_gone_hi & 0x80) sample_start(5, SND_FLEET4, 0);
293}
294
295
296static WRITE8_HANDLER( spaceint_sound2_w )
297{
298   int bits_gone_hi = data & ~sound_state[1];
299   sound_state[1] = data;
300
301   sound_global_enable(data & 0x02);
302
303   if (bits_gone_hi & 0x04) sample_start(3, SND_INVADERHIT, 0);
304
305   screen_flip = (readinputport(3) & data & 0x80) ? 0xff : 0x00;
306}
307
308
309
310/*************************************
311 *
312 *  Main CPU memory handlers
313 *
314 *************************************/
315
316static ADDRESS_MAP_START( kamikaze_map, ADDRESS_SPACE_PROGRAM, 8 )
317   ADDRESS_MAP_FLAGS( AMEF_ABITS(14) )
318   AM_RANGE(0x0000, 0x1bff) AM_ROM
319   AM_RANGE(0x1c00, 0x1fff) AM_RAM
320   AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
44321ADDRESS_MAP_END
45322
46323
47static ADDRESS_MAP_START( kamikaze_readport, ADDRESS_SPACE_IO, 8 )
48   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
49   AM_RANGE(0x08, 0x08) AM_READ(input_port_0_r)
50   AM_RANGE(0x09, 0x09) AM_READ(input_port_1_r)
51   AM_RANGE(0x0a, 0x0a) AM_READ(input_port_2_r)
324static ADDRESS_MAP_START( spaceint_map, ADDRESS_SPACE_PROGRAM, 8 )
325   AM_RANGE(0x0000, 0x17ff) AM_ROM
326   AM_RANGE(0x2000, 0x23ff) AM_RAM
327   AM_RANGE(0x4000, 0x5fff) AM_READWRITE(MRA8_RAM, spaceint_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
52328ADDRESS_MAP_END
53329
54static ADDRESS_MAP_START( kamikaze_writeport, ADDRESS_SPACE_IO, 8 )
330
331static ADDRESS_MAP_START( kamikaze_portmap, ADDRESS_SPACE_IO, 8 )
55332   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
56   AM_RANGE(0x04, 0x04) AM_WRITE(astinvad_sound1_w)
57   AM_RANGE(0x05, 0x05) AM_WRITE(astinvad_sound2_w)
333   AM_RANGE(0x00, 0xff) AM_READWRITE(kamikaze_ppi_r, kamikaze_ppi_w)
58334ADDRESS_MAP_END
59335
60336
61static ADDRESS_MAP_START( spaceint_readport, ADDRESS_SPACE_IO, 8 )
337static ADDRESS_MAP_START( spaceint_portmap, ADDRESS_SPACE_IO, 8 )
62338   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
63339   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
64340   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
65ADDRESS_MAP_END
66
67static ADDRESS_MAP_START( spaceint_writeport, ADDRESS_SPACE_IO, 8 )
68   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
69341   AM_RANGE(0x02, 0x02) AM_WRITE(spaceint_sound1_w)
70   AM_RANGE(0x03, 0x03) AM_WRITE(spaceint_color_w)
342   AM_RANGE(0x03, 0x03) AM_WRITE(color_latch_w)
71343   AM_RANGE(0x04, 0x04) AM_WRITE(spaceint_sound2_w)
72344ADDRESS_MAP_END
73345
74346
75#define COMMON_INPUT_BITS \
76   PORT_START_TAG("IN0") \
77   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) \
78   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) \
79   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) \
80   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) \
81   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) \
82   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY \
83   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY \
84   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) \
85347
348/*************************************
349 *
350 *  Port definitions
351 *
352 *************************************/
86353
87354static INPUT_PORTS_START( kamikaze )
88   COMMON_INPUT_BITS
355   PORT_START_TAG("IN0")
356   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
357   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
358   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
359   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
360   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
361   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
362   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
363   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
89364
90365   PORT_START_TAG("IN1")
91366   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
r1527r1528
93368   PORT_DIPSETTING(    0x01, "4" )
94369   PORT_DIPSETTING(    0x02, "5" )
95370   PORT_DIPSETTING(    0x00, "6" )
96   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
97   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
98   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
371   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
99372   PORT_DIPNAME( 0x88, 0x88, DEF_STR( Bonus_Life ) )
100373   PORT_DIPSETTING(    0x88, "5000" )
101374   PORT_DIPSETTING(    0x80, "10000" )
102375   PORT_DIPSETTING(    0x08, "15000" )
103376   PORT_DIPSETTING(    0x00, "20000" )
104   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
105   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
106   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
377   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
378   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
379   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
107380
108381   PORT_START_TAG("IN2")
109382   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
r1527r1528
115388   PORT_DIPSETTING(    0xff, DEF_STR( Cocktail ) )
116389INPUT_PORTS_END
117390
391
118392static INPUT_PORTS_START( astinvad )
119   COMMON_INPUT_BITS
393   PORT_INCLUDE(kamikaze)
120394
121   PORT_START_TAG("IN1")
395   PORT_MODIFY("IN1")
122396   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
123397   PORT_DIPSETTING(    0x00, "3" )
124398   PORT_DIPSETTING(    0x01, "4" )
r1527r1528
131405   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
132406   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
133407   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
408INPUT_PORTS_END
134409
135   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
136   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
137   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
138410
139   PORT_START_TAG("IN2")
140   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
141   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
142
143   PORT_START_TAG("IN3")
144   PORT_DIPNAME( 0xff, 0x00, DEF_STR( Cabinet ) )
145   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
146   PORT_DIPSETTING(    0xff, DEF_STR( Cocktail ) )
147INPUT_PORTS_END
148
149411static INPUT_PORTS_START( spcking2 )
150   COMMON_INPUT_BITS
412   PORT_INCLUDE(kamikaze)
151413
152   PORT_START_TAG("IN1")
414   PORT_MODIFY("IN1")
153415   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
154416   PORT_DIPSETTING(    0x00, "3" )
155417   PORT_DIPSETTING(    0x01, "4" )
156418   PORT_DIPSETTING(    0x02, "5" )
157419   PORT_DIPSETTING(    0x03, "6" )
158   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
159   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
160   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
161420   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
162421   PORT_DIPSETTING(    0x08, "1000" )
163422   PORT_DIPSETTING(    0x00, "2000" )
164   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
165   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
166   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
167423   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
168424   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
169425   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
426INPUT_PORTS_END
170427
171   PORT_START_TAG("IN2")
172   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
173   PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
174428
175   PORT_START_TAG("IN3")
176   PORT_DIPNAME( 0xff, 0x00, DEF_STR( Cabinet ) )
177   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
178   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
179INPUT_PORTS_END
180
181429static INPUT_PORTS_START( spaceint )
182430   PORT_START_TAG("IN0")
183431   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
r1527r1528
211459INPUT_PORTS_END
212460
213461
214static INTERRUPT_GEN( spaceint_interrupt )
462
463/*************************************
464 *
465 *  Sound definitions
466 *
467 *************************************/
468
469static const char *const astinvad_sample_names[] =
215470{
216   if (readinputport(2) & 1)   /* coin */
217      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
471   "*invaders",
472   "0.wav",
473   "1.wav",
474   "2.wav",
475   "3.wav",
476   "4.wav",
477   "5.wav",
478   "6.wav",
479   "7.wav",
480   "8.wav",
481   0
482};
218483
219   cpunum_set_input_line(0, 0, HOLD_LINE);
220}
484static const struct Samplesinterface astinvad_samples_interface =
485{
486   6,   /* channels */
487   astinvad_sample_names
488};
221489
222490
491
492/*************************************
493 *
494 *  Machine drivers
495 *
496 *************************************/
497
223498static MACHINE_DRIVER_START( kamikaze )
224499
225500   /* basic machine hardware */
226   MDRV_CPU_ADD(Z80, 2000000)
227   MDRV_CPU_PROGRAM_MAP(kamikaze_readmem,kamikaze_writemem)
228   MDRV_CPU_IO_MAP(kamikaze_readport,kamikaze_writeport)
229   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)    /* two interrupts per frame */
501   MDRV_CPU_ADD(Z80, MASTER_CLOCK)
502   MDRV_CPU_PROGRAM_MAP(kamikaze_map,0)
503   MDRV_CPU_IO_MAP(kamikaze_portmap,0)
230504
505   MDRV_MACHINE_START(kamikaze)
506
231507   /* video hardware */
232508   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
233509   MDRV_VIDEO_UPDATE(astinvad)
234510
235511   MDRV_SCREEN_ADD("main", 0)
236512   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
237   MDRV_SCREEN_SIZE(32*8, 32*8)
238   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 32*8-1)
239   MDRV_SCREEN_REFRESH_RATE(60)
240   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
513   MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 320, 0, 256, 256, 32, 256)
241514
242515   /* sound hardware */
243516   MDRV_SPEAKER_STANDARD_MONO("mono")
r1527r1528
252525
253526   /* basic machine hardware */
254527   MDRV_IMPORT_FROM(kamikaze)
255
256   /* video hardware */
257   MDRV_VIDEO_UPDATE( spcking2 )
258
259   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
528   MDRV_SCREEN_MODIFY("main")
529   MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 320, 0, 256, 256, 16, 240)
260530MACHINE_DRIVER_END
261531
262532
263533static MACHINE_DRIVER_START( spaceint )
264534
265535   /* basic machine hardware */
266   MDRV_CPU_ADD(Z80, 2000000)        /* 2 MHz? */
267   MDRV_CPU_PROGRAM_MAP(spaceint_readmem,spaceint_writemem)
268   MDRV_CPU_IO_MAP(spaceint_readport,spaceint_writeport)
536   MDRV_CPU_ADD(Z80, MASTER_CLOCK)        /* a guess */
537   MDRV_CPU_PROGRAM_MAP(spaceint_map,0)
538   MDRV_CPU_IO_MAP(spaceint_portmap,0)
269539   MDRV_CPU_VBLANK_INT(spaceint_interrupt,1)
270540
271541   /* video hardware */
r1527r1528
288558MACHINE_DRIVER_END
289559
290560
561
562/*************************************
563 *
564 *  ROM definitions
565 *
566 *************************************/
567
291568ROM_START( kamikaze )
292569   ROM_REGION( 0x10000, REGION_CPU1, 0 )
293570   ROM_LOAD( "km01",         0x0000, 0x0800, CRC(8aae7414) SHA1(91cb5c268a03960d50401000903d70dc29f904fb) )
r1527r1528
365642ROM_END
366643
367644
368GAME( 1979, kamikaze, 0,        kamikaze, kamikaze, 0, ROT270, "Leijac Corporation", "Kamikaze", 0 )
369GAME( 1980, astinvad, kamikaze, kamikaze, astinvad, 0, ROT270, "Stern",              "Astro Invader", 0 )
370GAME( 19??, kosmokil, kamikaze, kamikaze, kamikaze, 0, ROT270, "bootleg",            "Kosmo Killer", 0 ) // says >BEM< Mi Italy but it looks hacked in, dif revision of game tho.
371GAME( 1979, spcking2, 0,        spcking2, spcking2, 0, ROT270, "Konami",             "Space King 2", 0 )
372GAME( 1980, spaceint, 0,        spaceint, spaceint, 0, ROT90,  "Shoei",              "Space Intruder", GAME_WRONG_COLORS )
373GAME( 1980, spaceinj, spaceint, spaceint, spaceint, 0, ROT90,  "Shoei",              "Space Intruder (Japan)", GAME_WRONG_COLORS )
645
646/*************************************
647 *
648 *  Driver initialization
649 *
650 *************************************/
651
652static DRIVER_INIT( kamikaze )
653{
654   /* the flip screen logic adds 32 to the Y after flipping */
655   flip_yoffs = 32;
656}
657
658
659static DRIVER_INIT( spcking2 )
660{
661   /* don't have the schematics, but the blanking must center the screen here */
662   flip_yoffs = 0;
663}
664
665
666
667/*************************************
668 *
669 *  Game drivers
670 *
671 *************************************/
672
673GAME( 1979, kamikaze, 0,        kamikaze, kamikaze, kamikaze, ROT270, "Leijac Corporation", "Kamikaze", 0 )
674GAME( 1980, astinvad, kamikaze, kamikaze, astinvad, kamikaze, ROT270, "Stern",              "Astro Invader", 0 )
675GAME( 19??, kosmokil, kamikaze, kamikaze, kamikaze, kamikaze, ROT270, "bootleg",            "Kosmo Killer", 0 ) // says >BEM< Mi Italy but it looks hacked in, dif revision of game tho.
676GAME( 1979, spcking2, 0,        spcking2, spcking2, spcking2, ROT270, "Konami",             "Space King 2", 0 )
677GAME( 1980, spaceint, 0,        spaceint, spaceint, 0,        ROT90,  "Shoei",              "Space Intruder", GAME_WRONG_COLORS )
678GAME( 1980, spaceinj, spaceint, spaceint, spaceint, 0,        ROT90,  "Shoei",              "Space Intruder (Japan)", GAME_WRONG_COLORS )
src/mame/drivers/darkhors.c
r1527r1528
5858#include "machine/eeprom.h"
5959#include "sound/okim6295.h"
6060
61#define DARKHORS_DEBUG   0
62
6163/***************************************************************************
6264
6365
r1527r1528
151153{
152154   int layers_ctrl = -1;
153155
154#ifdef MAME_DEBUG
156#if DARKHORS_DEBUG
155157   if (input_code_pressed(KEYCODE_Z))
156158   {
157159      int mask = 0;
r1527r1528
174176
175177   if (layers_ctrl & 4)   draw_sprites(machine,bitmap,cliprect);
176178
177#ifdef MAME_DEBUG
179#if DARKHORS_DEBUG
178180#if 0
179181   popmessage("%04X-%04X %04X-%04X %04X-%04X %04X-%04X %04X-%04X %04X-%04X",
180182      darkhors_tmapscroll[0] >> 16, darkhors_tmapscroll[0] & 0xffff,
src/mame/drivers/bishjan.c
r1527r1528
4848#include "driver.h"
4949#include "cpu/h83002/h83002.h"
5050
51#define BISHJAN_DEBUG   0
52
5153/***************************************************************************
5254                                Video Hardware
5355***************************************************************************/
r1527r1528
8991   int scroll2_x = ((bishjan_scroll[2] & 0x0f)<<8) | (bishjan_scroll[1] & 0xff);
9092   int scroll2_y = ((bishjan_scroll[2] & 0xf0)<<4) | (bishjan_scroll[2] >> 8);
9193
92#ifdef MAME_DEBUG
94#if BISHJAN_DEBUG
9395if (input_code_pressed(KEYCODE_Z))
9496{
9597   int msk = 0;
src/mame/drivers/equites.c
r1527r1528
9595
9696The following ROMs need redump:
9797
98- Bull Fighter's RGB PROMs (the ones in use are fake make-up's)
9998- The Koukouyakyuh's epr-6706.bin (the one in use is patched)
10099
101100
r1527r1528
106105- Scale factors in High Voltage and Splendor Blast are inaccurate. Actual values are believed
107106  to be in the three unknown ROM s3.8l, 1.9j and 4.7m but the equations are unknown.
108107
109- MSM5232 clock speed and capacitor values are not known.
110- There seems to be a rheostat on Equites' soundboard to adjust the MSM5232's music pitch.
111- It hasn't been confirmed whether music tempos are the same across all games.
108- MSM5232 capacitor values are not known.
109- There is a potentiometer on the soundboard to adjust the MSM5232's music pitch.  Clock speed ranges
110  from 6.144mhz (OSC value) to few khz
111- All games have the same sound board with only rom swaps
112112
113
114113* Special Thanks to:
115114
116115  Jarek Burczynski for a superb MSM5232 emulation
r1527r1528
143142
144143// Common Hardware Start
145144#define EQUITES_ADD_SOUNDBOARD7 \
146   MDRV_CPU_ADD(8085A, 5000000) \
145   MDRV_CPU_ADD(8085A, XTAL_6_144MHz/2) /* verified on pcb */ \
147146   /* audio CPU */ \
148147   MDRV_CPU_PROGRAM_MAP(equites_s_readmem, equites_s_writemem) \
149148   MDRV_CPU_IO_MAP(0, equites_s_writeport) \
150149   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 4000) \
151150   MDRV_SPEAKER_STANDARD_MONO("mono") \
152151   \
153   MDRV_SOUND_ADD(MSM5232, 2500000) \
152   MDRV_SOUND_ADD(MSM5232, XTAL_6_144MHz/2) \
153/* OSC is connected to a pot which varies the frequency of M5232 from 6.144mhz to few Khz. Here I assume a value which gives a good pitch */ \
154154   MDRV_SOUND_CONFIG(equites_5232intf) \
155155   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) \
156156   \
157   MDRV_SOUND_ADD(AY8910, 6144444/4) \
157   MDRV_SOUND_ADD(AY8910, XTAL_6_144MHz/4) /* verified on pcb */ \
158158   MDRV_SOUND_CONFIG(equites_8910intf) \
159159   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) \
160160   \
r1527r1528
686686static MACHINE_DRIVER_START( equites )
687687
688688   /* basic machine hardware */
689   MDRV_CPU_ADD(M68000, 12000000/2) // OSC: 12Mhz
689   MDRV_CPU_ADD(M68000, XTAL_12MHz/4) /* 68000P8 running at 3mhz! verified on pcb */
690690   MDRV_CPU_PROGRAM_MAP(equites_readmem, equites_writemem)
691691   MDRV_CPU_VBLANK_INT(equites_interrupt, 2)
692692
r1527r1528
713713static MACHINE_DRIVER_START( splndrbt )
714714
715715   /* basic machine hardware */
716   MDRV_CPU_ADD(M68000, 12000000/2) // OSC: 12Mhz
716   MDRV_CPU_ADD(M68000, XTAL_24MHz/4) /* 68000P8 running at 6mhz, verified on pcb */
717717   MDRV_CPU_PROGRAM_MAP(splndrbt_readmem, splndrbt_writemem)
718718   MDRV_CPU_VBLANK_INT(splndrbt_interrupt, 2)
719719
src/mame/drivers/decocass.c
r1527r1528
389389   MDRV_CPU_ADD(M6502,500000) /* 500 kHz */
390390   MDRV_CPU_PROGRAM_MAP(decocass_sound_map,0)
391391
392   MDRV_CPU_ADD(I8X41,500000) /* 500 kHz ( I doubt it is 400kHz Al! )*/
392   MDRV_CPU_ADD(I8X41,500000*15) /* 500 kHz ( I doubt it is 400kHz Al! )*/
393393   MDRV_CPU_PROGRAM_MAP(decocass_mcu_map,0)
394394   MDRV_CPU_IO_MAP(decocass_mcu_portmap,0)
395395
src/mame/drivers/eolithsp.c
r1527r1528
9595   }
9696}
9797
98UINT32 eolith_speedup_getvblank(void *param)
98CUSTOM_INPUT( eolith_speedup_getvblank )
9999{
100100   return eolith_vblank&1;
101101}
src/mame/drivers/dlair.c
r1527r1528
279279static MACHINE_START( dleuro )
280280{
281281   /* initialize the CTC and SIO peripherals */
282   ctc_intf.baseclock = machine->drv->cpu[0].clock;
283   sio_intf.baseclock = machine->drv->cpu[0].clock;
282   ctc_intf.baseclock = cpunum_get_clock(0);
283   sio_intf.baseclock = cpunum_get_clock(0);
284284   z80ctc_init(0, &ctc_intf);
285285   z80sio_init(0, &sio_intf);
286286
r1527r1528
397397 *
398398 *************************************/
399399
400static UINT32 laserdisc_status_r(void *param)
400static CUSTOM_INPUT( laserdisc_status_r )
401401{
402402   if (discinfo == NULL)
403403      return 0;
r1527r1528
417417}
418418
419419
420static UINT32 laserdisc_command_r(void *param)
420static CUSTOM_INPUT( laserdisc_command_r )
421421{
422422   if (discinfo == NULL)
423423      return 0;
src/mame/drivers/peplus.c
r1527r1528
762762   AM_RANGE(0xd000, 0xdfff) AM_RAM AM_READWRITE(peplus_sd000_r, peplus_sd000_w) AM_BASE(&sd000_ram)
763763
764764   // DUART
765   AM_RANGE(0xe000, 0xe005) AM_READWRITE(peplus_duart_r, peplus_duart_w)
765   AM_RANGE(0xe000, 0xe00a) AM_READWRITE(peplus_duart_r, peplus_duart_w)
766766
767767    // Superboard Data
768768   AM_RANGE(0xf000, 0xffff) AM_RAM AM_READWRITE(peplus_sf000_r, peplus_sf000_w) AM_BASE(&sf000_ram)
r1527r1528
11311131    program_ram[0x9e9c] = 0x22; // RET - Disable 2nd Memory Test
11321132}
11331133
1134static DRIVER_INIT( pexmp006 )
1135{
1136   peplussb_init();
11341137
1138   // For testing only, cannot stay in final driver
1139   program_ram[0xbfc6] = 0x22; // RET - Disable Memory Test
1140    program_ram[0xc2a2] = 0x22; // RET - Disable 2nd Memory Test
1141}
1142
1143
11351144/*************************
11361145*        Rom Load        *
11371146*************************/
11381147
11391148ROM_START( peset038 )
1140   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1149   ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* Normal board : Set Chip (Set038) */
11411150   ROM_LOAD( "set038.u68",   0x00000, 0x10000, CRC(9c4b1d1a) SHA1(8a65cd1d8e2d74c7b66f4dfc73e7afca8458e979) )
11421151
11431152   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
r1527r1528
11501159   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) )
11511160ROM_END
11521161
1153ROM_START( pepp0158 )
1162ROM_START( pepp0158 ) /* Normal board : 4 of a Kind Bonus Poker (PP0158) */
11541163   ROM_REGION( 0x10000, REGION_CPU1, 0 )
11551164   ROM_LOAD( "pp0158.u68",   0x00000, 0x10000, CRC(5976cd19) SHA1(6a461ea9ddf78dffa3cf8b65903ebf3127f23d45) )
11561165
r1527r1528
11641173   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) )
11651174ROM_END
11661175
1167ROM_START( pepp0188 )
1176ROM_START( pepp0188 ) /* Normal board : Standard Draw Poker (PP0188) */
11681177   ROM_REGION( 0x10000, REGION_CPU1, 0 )
11691178   ROM_LOAD( "pp0188.u68",   0x00000, 0x10000, CRC(cf36a53c) SHA1(99b578538ab24d9ff91971b1f77599272d1dbfc6) )
11701179
r1527r1528
11781187   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) )
11791188ROM_END
11801189
1181ROM_START( pepp0516 )
1190ROM_START( pepp0516 ) /* Normal board : Double Bonus Poker (PP0516) */
11821191   ROM_REGION( 0x10000, REGION_CPU1, 0 )
11831192   ROM_LOAD( "pp0516.u68",   0x00000, 0x10000, CRC(d9da6e13) SHA1(421678d9cb42daaf5b21074cc3900db914dd26cf) )
11841193
r1527r1528
11921201   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) )
11931202ROM_END
11941203
1195ROM_START( pebe0014 )
1204ROM_START( pebe0014 ) /* Normal board : Blackjack (BE0014) */
11961205   ROM_REGION( 0x10000, REGION_CPU1, 0 )
11971206   ROM_LOAD( "be0014.u68",   0x00000, 0x10000, CRC(232b32b7) SHA1(a3af9414577642fedc23b4c1911901cd31e9d6e0) )
11981207
r1527r1528
12061215   ROM_LOAD( "cap707.u50", 0x0000, 0x0100, CRC(9851ba36) SHA1(5a0a43c1e212ae8c173102ede9c57a3d95752f99) )
12071216ROM_END
12081217
1209ROM_START( peke1012 )
1218ROM_START( peke1012 ) /* Normal board : Keno (KE1012) */
12101219   ROM_REGION( 0x10000, REGION_CPU1, 0 )
12111220   ROM_LOAD( "ke1012.u68",   0x00000, 0x10000, CRC(470e8c10) SHA1(f8a65a3a73477e9e9d2f582eeefa93b470497dfa) )
12121221
r1527r1528
12201229   ROM_LOAD( "cap1267.u50", 0x0000, 0x0100, CRC(7051db57) SHA1(76751a3cc47d506983205decb07e99ca0c178a42) )
12211230ROM_END
12221231
1223ROM_START( peps0615 )
1232ROM_START( peps0615 ) /* Normal board : Chaos Slots (PS0615) */
12241233   ROM_REGION( 0x10000, REGION_CPU1, 0 )
12251234   ROM_LOAD( "ps0615.u68",   0x00000, 0x10000, CRC(d27dd6ab) SHA1(b3f065f507191682edbd93b07b72ed87bf6ae9b1) )
12261235
r1527r1528
12341243   ROM_LOAD( "cap2234.u50", 0x0000, 0x0100, CRC(a930e283) SHA1(61bce50fa13b3e980ece3e72d068835e19bd5049) )
12351244ROM_END
12361245
1237ROM_START( peps0716 )
1246ROM_START( peps0716 ) /* Normal board : Quarter Mania Slots (PS0716) */
12381247   ROM_REGION( 0x10000, REGION_CPU1, 0 )
12391248   ROM_LOAD( "ps0716.u68",   0x00000, 0x10000, CRC(7615d7b6) SHA1(91fe62eec720a0dc2ebf48835065148f19499d16) )
12401249
r1527r1528
12481257   ROM_LOAD( "cap2265.u50", 0x0000, 0x0100, CRC(dfb82a2f) SHA1(c96947bb475bf4497ff2e44053941625a3a7bf62) )
12491258ROM_END
12501259
1251ROM_START( pexp0019 )
1260ROM_START( pexp0019 ) /* Superboard : Deuces Wild Poker (XP000019) */
12521261   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1253    ROM_LOAD( "xp000019.u67",   0x00000, 0x10000, CRC(8ac876eb) SHA1(105b4aee2692ccb20795586ccbdf722c59db66cf) )
1262   ROM_LOAD( "xp000019.u67",   0x00000, 0x10000, CRC(8ac876eb) SHA1(105b4aee2692ccb20795586ccbdf722c59db66cf) )
12541263
1255    ROM_REGION( 0x10000, REGION_USER1, 0 )
1256    ROM_LOAD( "x002025p.u66",   0x00000, 0x10000, CRC(f3dac423) SHA1(e9394d330deb3b8a1001e57e72a506cd9098f161) )
1264   ROM_REGION( 0x10000, REGION_USER1, 0 )
1265   ROM_LOAD( "x002025p.u66",   0x00000, 0x10000, CRC(f3dac423) SHA1(e9394d330deb3b8a1001e57e72a506cd9098f161) )
12571266
12581267   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
12591268   ROM_LOAD( "mro-cg2185.u77",    0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) )
r1527r1528
12651274   ROM_LOAD( "cap2234.u43", 0x0000, 0x0100, CRC(a930e283) SHA1(61bce50fa13b3e980ece3e72d068835e19bd5049) )
12661275ROM_END
12671276
1268ROM_START( pexs0006 )
1277ROM_START( pexs0006 ) /* Superboard : Triple Triple Diamond Slots (XS000006) */
12691278   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1270    ROM_LOAD( "xs000006.u67",   0x00000, 0x10000, CRC(4b11ca18) SHA1(f64a1fbd089c01bc35a5484e60b8834a2db4a79f) )
1279   ROM_LOAD( "xs000006.u67",   0x00000, 0x10000, CRC(4b11ca18) SHA1(f64a1fbd089c01bc35a5484e60b8834a2db4a79f) )
12711280
1272    ROM_REGION( 0x10000, REGION_USER1, 0 )
1273    ROM_LOAD( "x000998s.u66",   0x00000, 0x10000, CRC(e29d4346) SHA1(93901ff65c8973e34ac1f0dd68bb4c4973da5621) )
1281   ROM_REGION( 0x10000, REGION_USER1, 0 )
1282   ROM_LOAD( "x000998s.u66",   0x00000, 0x10000, CRC(e29d4346) SHA1(93901ff65c8973e34ac1f0dd68bb4c4973da5621) )
12741283
12751284   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
12761285   ROM_LOAD( "mro-cg2361.u77",    0x00000, 0x8000, CRC(c0eba866) SHA1(8f217aeb3e8028a5633d95e5612f1b55e601650f) )
r1527r1528
12821291   ROM_LOAD( "cap2361.u43", 0x0000, 0x0100, CRC(051aea66) SHA1(2abf32caaeb821ca50a6398581de69bbfe5930e9) )
12831292ROM_END
12841293
1294ROM_START( pexmp006 ) /* Superboard : Multi-Poker (XMP00006) */
1295   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1296   ROM_LOAD( "xmp00006.u67",   0x00000, 0x10000, CRC(d61f1677) SHA1(2eca1315d6aa310a54de2dfa369e443a07495b76) )
12851297
1298   ROM_REGION( 0x10000, REGION_USER1, 0 )
1299   ROM_LOAD( "xm00002p.u66",   0x00000, 0x10000, CRC(96cf471c) SHA1(9597bf6a80c392ee22dc4606db610fdaf032377f) )
1300
1301   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
1302   ROM_LOAD( "mro-cg2174.u77",    0x00000, 0x8000, CRC(bb666733) SHA1(dcaa1980b051a554cb0f443b1183a680edc9ad3f) )
1303   ROM_LOAD( "mgo-cg2174.u78",    0x08000, 0x8000, CRC(cc46adb0) SHA1(6065aa5dcb9091ad80e499c7ee6dc629e79c865a) )
1304   ROM_LOAD( "mbo-cg2174.u79",    0x10000, 0x8000, CRC(7291a0c8) SHA1(1068f35e6ef5fd88c584922860231840a90fb623) )
1305   ROM_LOAD( "mxo-cg2174.u80",    0x18000, 0x8000, CRC(14f9480c) SHA1(59323f9fc5995277aea86d088893b6eb95b4e89b) )
1306
1307   ROM_REGION( 0x100, REGION_PROMS, 0 )
1308   ROM_LOAD( "cap2174.u43", 0x0000, 0x0100, CRC(cbff3f26) SHA1(9e145676f2871c2369042a13cbeabb7efe2728e1) )
1309ROM_END
1310
12861311/*************************
12871312*      Game Drivers      *
12881313*************************/
r1527r1528
13101335/* Superboard : poker */
13111336GAMEL(1995, pexp0019, 0,      peplus,  peplus_poker, pexp0019, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XP000019) Deuces Wild Poker",           0,   layout_pe_poker )
13121337
1338/* Superboard : multi-poker */
1339GAMEL(1995, pexmp006, 0,      peplus,  peplus_poker, pexmp006, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XMP00006) Multi-Poker",                 0,   layout_pe_poker )
1340
13131341/* Superboard : slots machine */
13141342GAMEL(1997, pexs0006, 0,      peplus,  peplus_slots, pexs0006, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XS000006) Triple Triple Diamond Slots", 0,   layout_pe_slots )
src/mame/drivers/mustache.c
r1527r1528
6262static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 )
6363   AM_RANGE(0x0000, 0x7fff) AM_ROM
6464   AM_RANGE(0x8000, 0xbfff) AM_ROM
65   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(videoram_r, mustache_videoram_w) AM_BASE(&videoram)
65   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(MRA8_RAM, mustache_videoram_w) AM_BASE(&videoram)
6666   AM_RANGE(0xd000, 0xd000) AM_WRITE(t5182_sound_irq_w)
6767   AM_RANGE(0xd001, 0xd001) AM_READ(t5182_sharedram_semaphore_snd_r)
6868   AM_RANGE(0xd002, 0xd002) AM_WRITE(t5182_sharedram_semaphore_main_acquire_w)
src/mame/drivers/ddayjlc.c
r1527r1528
207207   AM_RANGE(0x0000, 0x7fff) AM_ROM
208208   AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(&mainram)
209209   AM_RANGE(0x9000, 0x93ff) AM_RAM AM_BASE(&spriteram)
210   AM_RANGE(0x9400, 0x97ff) AM_READWRITE(videoram_r, ddayjlc_videoram_w) AM_BASE(&videoram)
210   AM_RANGE(0x9400, 0x97ff) AM_READWRITE(MRA8_RAM, ddayjlc_videoram_w) AM_BASE(&videoram)
211211   AM_RANGE(0x9800, 0x9fff) AM_READWRITE(MRA8_RAM, ddayjlc_bgram_w) AM_BASE(&bgram) /* 9800-981f - videoregs */
212212   AM_RANGE(0xa000, 0xdfff) AM_ROMBANK(1) AM_WRITENOP
213213   AM_RANGE(0xe000, 0xe003) AM_WRITE(i8257_CH0_w)
src/mame/drivers/segas16a.c
r1527r1528
17981798   MDRV_CPU_PROGRAM_MAP(sound_map,0)
17991799   MDRV_CPU_IO_MAP(sound_portmap,0)
18001800
1801   MDRV_CPU_ADD_TAG("n7751", N7751, 6000000/15)
1801   MDRV_CPU_ADD_TAG("n7751", N7751, 6000000)
18021802   /* audio CPU */
18031803   MDRV_CPU_PROGRAM_MAP(n7751_map,0)
18041804   MDRV_CPU_IO_MAP(n7751_portmap,0)
src/mame/drivers/neogeo.c
r1527r1528
325325}
326326
327327
328static UINT32 multiplexed_controller_r(void *param)
328static CUSTOM_INPUT( multiplexed_controller_r )
329329{
330330   char tag[6];
331331
r1527r1528
335335}
336336
337337
338static UINT32 mahjong_controller_r(void *param)
338static CUSTOM_INPUT( mahjong_controller_r )
339339{
340340   UINT32 ret;
341341
r1527r1528
441441}
442442
443443
444static UINT32 get_calendar_status(void)
444static CUSTOM_INPUT( get_calendar_status )
445445{
446446   return (pd4990a_databit_r(0) << 1) | pd4990a_testbit_r(0);
447447}
r1527r1528
500500}
501501
502502
503static UINT32 get_memcard_status(void *param)
503static CUSTOM_INPUT( get_memcard_status )
504504{
505505   /* D0 and D1 are memcard presence indicators, D2 indicates memcard
506506       write protect status (we are always write enabled) */
r1527r1528
596596}
597597
598598
599static UINT32 get_audio_result(void)
599static CUSTOM_INPUT( get_audio_result )
600600{
601601   UINT32 ret = audio_result;
602602
src/mame/drivers/dorachan.c
r1527r1528
2626 *
2727 *************************************/
2828
29static READ8_HANDLER( dorachan_protection_r )
29static CUSTOM_INPUT( dorachan_protection_r )
3030{
3131   UINT8 ret = 0;
3232
r1527r1528
114114}
115115
116116
117static READ8_HANDLER( dorachan_v128_r )
117static CUSTOM_INPUT( dorachan_v128_r )
118118{
119119   /* to avoid resetting (when player 2 starts) bit 0 need to be
120120       inverted when screen is flipped */
src/mame/drivers/ladybug.c
r1527r1528
119119#define LADYBUG_P1_CONTROL_PORT_TAG   ("CONTP1")
120120#define LADYBUG_P2_CONTROL_PORT_TAG   ("CONTP2")
121121
122static UINT32 ladybug_p1_control_r(void *param)
122static CUSTOM_INPUT( ladybug_p1_control_r )
123123{
124124   return readinputportbytag(LADYBUG_P1_CONTROL_PORT_TAG);
125125}
126126
127static UINT32 ladybug_p2_control_r(void *param)
127static CUSTOM_INPUT( ladybug_p2_control_r )
128128{
129129   UINT32 ret;
130130
src/mame/drivers/yamato.c
r1527r1528
246246   AM_RANGE(0x7000, 0x7fff) AM_WRITE(MWA8_ROM)
247247   AM_RANGE(0x8800, 0x88ff) AM_WRITE(cclimber_bigsprite_videoram_w) AM_BASE(&cclimber_bsvideoram) AM_SIZE(&cclimber_bsvideoram_size)
248248   AM_RANGE(0x8900, 0x8bff) AM_WRITE(MWA8_RAM)  /* not used, but initialized */
249   AM_RANGE(0x9000, 0x93ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
250//AM_RANGE(0x9400, 0x97ff) AM_WRITE(videoram_w) /* mirror address, used by Crazy Climber to draw windows */
249   AM_RANGE(0x9000, 0x93ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
250//AM_RANGE(0x9400, 0x97ff) AM_WRITE(MWA8_RAM) /* mirror address, used by Crazy Climber to draw windows */
251251   /* 9800-9bff and 9c00-9fff share the same RAM, interleaved */
252252   /* (9800-981f for scroll, 9c20-9c3f for color RAM, and so on) */
253253   AM_RANGE(0x9800, 0x981f) AM_WRITE(MWA8_RAM) AM_BASE(&cclimber_column_scroll)
src/mame/drivers/midxunit.c
r1527r1528
192192static MACHINE_DRIVER_START( midxunit )
193193
194194   /* basic machine hardware */
195   MDRV_CPU_ADD(TMS34020, 40000000/TMS34020_CLOCK_DIVIDER)
195   MDRV_CPU_ADD(TMS34020, 40000000)
196196   MDRV_CPU_CONFIG(tms_config)
197197   MDRV_CPU_PROGRAM_MAP(main_map,0)
198198
src/mame/drivers/buggychl.c
r1527r1528
164164   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) /* 6116 SRAM (36) */
165165   AM_RANGE(0x8800, 0x8fff) AM_READ(MRA8_RAM) /* 6116 SRAM (35) */
166166   AM_RANGE(0xa000, 0xbfff) AM_READ(MRA8_BANK1)
167   AM_RANGE(0xc800, 0xcfff) AM_READ(videoram_r)
167   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM)
168168   AM_RANGE(0xd400, 0xd400) AM_READ(buggychl_mcu_r)
169169   AM_RANGE(0xd401, 0xd401) AM_READ(buggychl_mcu_status_r)
170170   AM_RANGE(0xd600, 0xd600) AM_READ(input_port_0_r)   /* dsw */
r1527r1528
184184   AM_RANGE(0x8800, 0x8fff) AM_WRITE(MWA8_RAM) /* 6116 SRAM (35) */
185185   AM_RANGE(0x9000, 0x9fff) AM_WRITE(buggychl_sprite_lookup_w)
186186   AM_RANGE(0xa000, 0xbfff) AM_WRITE(buggychl_chargen_w) AM_BASE(&buggychl_character_ram)
187   AM_RANGE(0xc800, 0xcfff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
187   AM_RANGE(0xc800, 0xcfff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
188188//  { 0xd000, 0xd000, horizon
189189   AM_RANGE(0xd100, 0xd100) AM_WRITE(buggychl_ctrl_w)
190190   AM_RANGE(0xd200, 0xd200) AM_WRITE(bankswitch_w)
r1527r1528
439439   MDRV_CPU_VBLANK_INT(irq0_line_hold,60)   /* irq is timed, tied to the cpu clock and not to vblank */
440440                     /* nmi is caused by the main cpu */
441441
442   MDRV_CPU_ADD(M68705,8000000/2/M68705_CLOCK_DIVIDER)  /* 4 MHz */
442   MDRV_CPU_ADD(M68705,8000000/2)  /* 4 MHz */
443443   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
444444
445445   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/pandoras.c
r1527r1528
409409   /* audio CPU */
410410   MDRV_CPU_PROGRAM_MAP(pandoras_readmem_snd,pandoras_writemem_snd)
411411
412   MDRV_CPU_ADD(I8039,(14318000/2)/I8039_CLOCK_DIVIDER)
412   MDRV_CPU_ADD(I8039,14318000/2)
413413   /* audio CPU */
414414   MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem)
415415   MDRV_CPU_IO_MAP(i8039_readport,i8039_writeport)
src/mame/drivers/ddragon.c
r1527r1528
10511051    /* audio CPU */   /* ? */
10521052   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
10531053
1054   MDRV_CPU_ADD(M68705,8000000/2/M68705_CLOCK_DIVIDER)  /* ? MHz */
1054   MDRV_CPU_ADD(M68705,8000000/2)  /* ? MHz */
10551055   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
10561056
10571057   MDRV_SCREEN_REFRESH_RATE(((12000000.0 / 256.0) / 3.0) / 272.0)
src/mame/drivers/exidy.c
r1527r1528
126126***************************************************************************/
127127
128128#include "driver.h"
129#include "machine/6821pia.h"
130129#include "exidy.h"
131#include "sound/custom.h"
132#include "sound/samples.h"
133#include "sound/hc55516.h"
130#include "targ.h"
131#include "machine/6821pia.h"
134132
135133
136134static UINT8 last_dial;
137135
138136
137
139138/*************************************
140139 *
141140 *  Special Teeter Torture input
142141 *
143142 *************************************/
144143
145static READ8_HANDLER( teetert_input_r )
144static CUSTOM_INPUT( teetert_input_direction_r )
146145{
147   UINT8 result = readinputportbytag("IN0") & ~0x44;
146   int result = 0;
148147   UINT8 dial = readinputportbytag("DIAL");
149148
150149   if (dial != last_dial)
151150   {
152      result |= 0x40;
153151      if (((dial - last_dial) & 0xff) < 0x80)
154152      {
155         result |= 0x04;
153         result = 1;
156154         last_dial++;
157155      }
158156      else
r1527r1528
163161}
164162
165163
164static CUSTOM_INPUT( teetert_input_movement_r )
165{
166   UINT8 dial = readinputportbytag("DIAL");
166167
168   return (dial != last_dial) ? 1 : 0;
169}
170
171
172
167173/*************************************
168174 *
169175 *  Bankswitcher
r1527r1528
174180{
175181   UINT8 *RAM = memory_region(REGION_CPU1);
176182
177   memory_set_bankptr(1, &RAM[0x10000 + (0x2000 * (data & 0x1F))]);
178   if ((data & 0x1F) > 0x17)
179      logerror("Banking to unpopulated ROM bank %02X!\n",data & 0x1F);
183   memory_set_bankptr(1, &RAM[0x10000 + (0x2000 * (data & 0x1f))]);
184   if ((data & 0x1f) > 0x17)
185      logerror("Banking to unpopulated ROM bank %02X!\n",data & 0x1f);
180186}
181187
182188
r1527r1528
187193 *
188194 *************************************/
189195
190static ADDRESS_MAP_START( common_map, ADDRESS_SPACE_PROGRAM, 8 )
196static ADDRESS_MAP_START( exidy_map, ADDRESS_SPACE_PROGRAM, 8 )
191197   AM_RANGE(0x0000, 0x03ff) AM_RAM
192198   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&exidy_videoram)
193   AM_RANGE(0x5000, 0x503f) AM_WRITE(exidy_sprite1_xpos_w)
194   AM_RANGE(0x5040, 0x507f) AM_WRITE(exidy_sprite1_ypos_w)
195   AM_RANGE(0x5080, 0x50bf) AM_WRITE(exidy_sprite2_xpos_w)
196   AM_RANGE(0x50c0, 0x50ff) AM_WRITE(exidy_sprite2_ypos_w)
197   AM_RANGE(0x5100, 0x5100) AM_MIRROR(0xfc) AM_READ_PORT("DSW")
198   AM_RANGE(0x5101, 0x5101) AM_MIRROR(0xfc) AM_READ_PORT("IN0")
199   AM_RANGE(0x5100, 0x5100) AM_MIRROR(0xfc) AM_WRITE(exidy_spriteno_w)
200   AM_RANGE(0x5101, 0x5101) AM_MIRROR(0xfc) AM_WRITE(exidy_sprite_enable_w)
201   AM_RANGE(0x5103, 0x5103) AM_MIRROR(0xfc) AM_READ(exidy_interrupt_r)
199   AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x003f) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite1_xpos)
200   AM_RANGE(0x5040, 0x5040) AM_MIRROR(0x003f) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite1_ypos)
201   AM_RANGE(0x5080, 0x5080) AM_MIRROR(0x003f) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite2_xpos)
202   AM_RANGE(0x50c0, 0x50c0) AM_MIRROR(0x003f) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite2_ypos)
203   AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_READ_PORT("DSW")
204   AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_spriteno)
205   AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_READ_PORT("IN0")
206   AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite_enable)
207   AM_RANGE(0x5103, 0x5103) AM_MIRROR(0x00fc) AM_READ(exidy_interrupt_r)
202208   AM_RANGE(0x5210, 0x5212) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_color_latch)
203209   AM_RANGE(0x5213, 0x5213) AM_READ_PORT("IN2")
204210ADDRESS_MAP_END
r1527r1528
207213static ADDRESS_MAP_START( sidetrac_map, ADDRESS_SPACE_PROGRAM, 8 )
208214   AM_RANGE(0x0800, 0x3fff) AM_ROM
209215   AM_RANGE(0x4800, 0x4fff) AM_ROM AM_BASE(&exidy_characterram)
210   AM_RANGE(0x5200, 0x5201) AM_WRITE(targ_sh_w)
216   AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w)
217   AM_RANGE(0x5201, 0x5201) AM_WRITE(spectar_audio_2_w)
211218   AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x3f00)
212219ADDRESS_MAP_END
213220
r1527r1528
215222static ADDRESS_MAP_START( targ_map, ADDRESS_SPACE_PROGRAM, 8 )
216223   AM_RANGE(0x0800, 0x3fff) AM_ROM
217224   AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram)
218   AM_RANGE(0x5200, 0x5201) AM_WRITE(targ_sh_w)
225   AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w)
226   AM_RANGE(0x5201, 0x5201) AM_WRITE(targ_audio_2_w)
219227   AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x3f00)
220228ADDRESS_MAP_END
221229
222230
231static ADDRESS_MAP_START( spectar_map, ADDRESS_SPACE_PROGRAM, 8 )
232   AM_RANGE(0x0800, 0x3fff) AM_ROM
233   AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram)
234   AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w)
235   AM_RANGE(0x5201, 0x5201) AM_WRITE(spectar_audio_2_w)
236   AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x3f00)
237ADDRESS_MAP_END
238
239
240static ADDRESS_MAP_START( rallys_map, ADDRESS_SPACE_PROGRAM, 8 )
241   AM_RANGE(0x0000, 0x03ff) AM_RAM
242   AM_RANGE(0x0800, 0x3fff) AM_ROM
243   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&exidy_videoram)
244   AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram)
245   AM_RANGE(0x5000, 0x5000) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite1_xpos)
246   AM_RANGE(0x5001, 0x5001) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite1_ypos)
247   AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_READ_PORT("DSW")
248   AM_RANGE(0x5100, 0x5100) AM_MIRROR(0x00fc) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_spriteno)
249   AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_READ_PORT("IN0")
250   AM_RANGE(0x5101, 0x5101) AM_MIRROR(0x00fc) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite_enable)
251   AM_RANGE(0x5103, 0x5103) AM_MIRROR(0x00fc) AM_READ(exidy_interrupt_r)
252   AM_RANGE(0x5200, 0x5200) AM_WRITE(targ_audio_1_w)
253   AM_RANGE(0x5201, 0x5201) AM_WRITE(spectar_audio_2_w)
254   AM_RANGE(0x5210, 0x5212) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_color_latch)
255   AM_RANGE(0x5213, 0x5213) AM_READ_PORT("IN2")
256   AM_RANGE(0x5300, 0x5300) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite2_xpos)
257   AM_RANGE(0x5301, 0x5301) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_sprite2_ypos)
258   AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x3f00)
259ADDRESS_MAP_END
260
261
223262static ADDRESS_MAP_START( venture_map, ADDRESS_SPACE_PROGRAM, 8 )
224263   AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram)
225264   AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w)
r1527r1528
228267
229268
230269static ADDRESS_MAP_START( pepper2_map, ADDRESS_SPACE_PROGRAM, 8 )
270   AM_RANGE(0x4800, 0x4fff) AM_NOP
231271   AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w)
232272   AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram)
233273   AM_RANGE(0x8000, 0xffff) AM_ROM
r1527r1528
241281   AM_RANGE(0x2000, 0x2000) AM_WRITE(fax_bank_select_w)
242282   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)
243283   AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w)
244   AM_RANGE(0x5213, 0x5217) AM_WRITE(MWA8_NOP)            /* empty control lines on color/sound board */
284   AM_RANGE(0x5213, 0x5217) AM_WRITE(MWA8_NOP)      /* empty control lines on color/sound board */
245285   AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram)
246286   AM_RANGE(0x8000, 0xffff) AM_ROM
247287ADDRESS_MAP_END
r1527r1528
250290
251291/*************************************
252292 *
253 *  Sound CPU memory handlers
254 *
255 *************************************/
256
257static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
258   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )
259   AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x780) AM_RAM
260   AM_RANGE(0x0800, 0x0fff) AM_READWRITE(exidy_shriot_r, exidy_shriot_w)
261   AM_RANGE(0x1000, 0x17ff) AM_READWRITE(pia_1_r, pia_1_w)
262   AM_RANGE(0x1800, 0x1fff) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
263   AM_RANGE(0x2000, 0x27ff) AM_WRITE(exidy_sound_filter_w)
264   AM_RANGE(0x2800, 0x2fff) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w)
265   AM_RANGE(0x3000, 0x37ff) AM_WRITE(exidy_sfxctrl_w)
266   AM_RANGE(0x5800, 0x7fff) AM_ROM
267ADDRESS_MAP_END
268
269
270static ADDRESS_MAP_START( cvsd_map, ADDRESS_SPACE_PROGRAM, 8 )
271   ADDRESS_MAP_FLAGS( AMEF_ABITS(14) )
272   AM_RANGE(0x0000, 0x3fff) AM_ROM
273ADDRESS_MAP_END
274
275
276static ADDRESS_MAP_START( cvsd_iomap, ADDRESS_SPACE_IO, 8 )
277   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
278   AM_RANGE(0x00, 0xff) AM_READWRITE(mtrap_voiceio_r, mtrap_voiceio_w)
279ADDRESS_MAP_END
280
281
282
283/*************************************
284 *
285293 *  Port definitions
286294 *
287295 *************************************/
r1527r1528
581589   PORT_START_TAG("IN0")
582590   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
583591   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
584   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   /* direction */
592   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(teetert_input_direction_r, 0)
585593   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
586594   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
587595   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
588   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL )   /* movement */
596   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(teetert_input_movement_r, 0)
589597   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
590598
591599   PORT_START_TAG("INTSOURCE")
r1527r1528
759767
760768
761769static GFXDECODE_START( exidy )
762   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,    0, 2 )
770   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 2 )
763771GFXDECODE_END
764772
765773
766774
767775/*************************************
768776 *
769 *  Sound definitions
777 *  Machine drivers
770778 *
771779 *************************************/
772780
773static const char *const targ_sample_names[] =
774{
775   "*targ",
776   "expl.wav",
777   "shot.wav",
778   "sexpl.wav",
779   "spslow.wav",
780   "spfast.wav",
781   0
782};
781static MACHINE_DRIVER_START( base )
783782
783   /* basic machine hardware */
784   MDRV_CPU_ADD_TAG("main", M6502, EXIDY_CPU_CLOCK)
785   MDRV_CPU_VBLANK_INT(exidy_vblank_interrupt,1)
784786
785static const struct Samplesinterface targ_samples_interface =
786{
787   4,   /* 3 Channels */
788   targ_sample_names,
789   targ_sh_start
790};
787   /* video hardware */
788   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
789   MDRV_VIDEO_START(exidy)
790   MDRV_VIDEO_UPDATE(exidy)
791   MDRV_GFXDECODE(exidy)
792   MDRV_PALETTE_LENGTH(8)
791793
794   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
795   MDRV_SCREEN_RAW_PARAMS(EXIDY_PIXEL_CLOCK, EXIDY_HTOTAL, EXIDY_HBEND, EXIDY_HBSTART, EXIDY_VTOTAL, EXIDY_VBEND, EXIDY_VBSTART)
792796
793static const struct CustomSound_interface exidy_custom_interface =
794{
795   exidy_sh_start
796};
797MACHINE_DRIVER_END
797798
798799
800static MACHINE_DRIVER_START( sidetrac )
799801
800/*************************************
801 *
802 *  Machine drivers
803 *
804 *************************************/
802   /* basic machine hardware */
803   MDRV_IMPORT_FROM(base)
804   MDRV_CPU_MODIFY("main")
805   MDRV_CPU_PROGRAM_MAP(exidy_map,sidetrac_map)
805806
806static MACHINE_DRIVER_START( sidetrac )
807   /* audio hardware */
808   MDRV_IMPORT_FROM(spectar_audio)
809MACHINE_DRIVER_END
807810
811
812static MACHINE_DRIVER_START( targ )
813
808814   /* basic machine hardware */
809   MDRV_CPU_ADD_TAG("main", M6502, EXIDY_CPU_CLOCK)
810   MDRV_CPU_PROGRAM_MAP(common_map,sidetrac_map)
811   MDRV_CPU_VBLANK_INT(exidy_vblank_interrupt,1)
815   MDRV_IMPORT_FROM(base)
816   MDRV_CPU_MODIFY("main")
817   MDRV_CPU_PROGRAM_MAP(exidy_map,targ_map)
812818
813   /* video hardware */
814   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
815   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
816   MDRV_SCREEN_RAW_PARAMS(EXIDY_PIXEL_CLOCK, EXIDY_HTOTAL, EXIDY_HBEND, EXIDY_HBSTART, EXIDY_VTOTAL, EXIDY_VBEND, EXIDY_VBSTART)
817   MDRV_GFXDECODE(exidy)
818   MDRV_PALETTE_LENGTH(8)
819   /* audio hardware */
820   MDRV_IMPORT_FROM(targ_audio)
821MACHINE_DRIVER_END
819822
820   MDRV_VIDEO_START(exidy)
821   MDRV_VIDEO_EOF(exidy)
822   MDRV_VIDEO_UPDATE(exidy)
823823
824   /* sound hardware */
825   MDRV_SPEAKER_STANDARD_MONO("mono")
824static MACHINE_DRIVER_START( spectar )
826825
827   MDRV_SOUND_ADD_TAG("sample", SAMPLES, 0)
828   MDRV_SOUND_CONFIG(targ_samples_interface)
829   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
826   /* basic machine hardware */
827   MDRV_IMPORT_FROM(base)
828   MDRV_CPU_MODIFY("main")
829   MDRV_CPU_PROGRAM_MAP(exidy_map,spectar_map)
830830
831   MDRV_SOUND_ADD_TAG("dac", DAC, 0)
832   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
831   /* audio hardware */
832   MDRV_IMPORT_FROM(spectar_audio)
833833MACHINE_DRIVER_END
834834
835835
836static MACHINE_DRIVER_START( targ )
836static MACHINE_DRIVER_START( rallys )
837837
838838   /* basic machine hardware */
839   MDRV_IMPORT_FROM(sidetrac)
839   MDRV_IMPORT_FROM(spectar)
840840   MDRV_CPU_MODIFY("main")
841   MDRV_CPU_PROGRAM_MAP(common_map,targ_map)
841   MDRV_CPU_PROGRAM_MAP(rallys_map,0)
842842MACHINE_DRIVER_END
843843
844844
845845static MACHINE_DRIVER_START( venture )
846846
847847   /* basic machine hardware */
848   MDRV_IMPORT_FROM(targ)
848   MDRV_IMPORT_FROM(base)
849849   MDRV_CPU_MODIFY("main")
850   MDRV_CPU_PROGRAM_MAP(common_map,venture_map)
850   MDRV_CPU_PROGRAM_MAP(exidy_map,venture_map)
851851
852   MDRV_CPU_ADD(M6502, 3579545/4)
853   /* audio CPU */
854   MDRV_CPU_PROGRAM_MAP(sound_map,0)
855
856852   MDRV_INTERLEAVE(10)
857853
858   /* sound hardware */
859   MDRV_SOUND_REPLACE("sample", CUSTOM, 0)
860   MDRV_SOUND_CONFIG(exidy_custom_interface)
861   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
862
863   MDRV_SOUND_REMOVE("dac")
854   /* audio hardware */
855   MDRV_IMPORT_FROM(venture_audio)
864856MACHINE_DRIVER_END
865857
866858
r1527r1528
878870   /* basic machine hardware */
879871   MDRV_IMPORT_FROM(venture)
880872
881   MDRV_CPU_ADD(Z80, 3579545/2)
882   MDRV_CPU_PROGRAM_MAP(cvsd_map,0)
883   MDRV_CPU_IO_MAP(cvsd_iomap,0)
884
885873   MDRV_INTERLEAVE(32)
886874
887   /* sound hardware */
888   MDRV_SOUND_ADD(HC55516, 0)
889   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
875   /* audio hardware */
876   MDRV_IMPORT_FROM(mtrap_cvsd_audio)
890877MACHINE_DRIVER_END
891878
892879
r1527r1528
895882   /* basic machine hardware */
896883   MDRV_IMPORT_FROM(venture)
897884   MDRV_CPU_MODIFY("main")
898   MDRV_CPU_PROGRAM_MAP(common_map,pepper2_map)
885   MDRV_CPU_PROGRAM_MAP(exidy_map,pepper2_map)
899886MACHINE_DRIVER_END
900887
901888
r1527r1528
904891   /* basic machine hardware */
905892   MDRV_IMPORT_FROM(pepper2)
906893   MDRV_CPU_MODIFY("main")
907   MDRV_CPU_PROGRAM_MAP(common_map,fax_map)
894   MDRV_CPU_PROGRAM_MAP(exidy_map,fax_map)
908895MACHINE_DRIVER_END
909896
910897
r1527r1528
917904
918905ROM_START( sidetrac )
919906   ROM_REGION( 0x10000, REGION_CPU1, 0 )
920   ROM_LOAD( "stl8a-1", 0x2800, 0x0800, CRC(e41750ff) SHA1(3868a0d7e34a5118b39b31cff9e4fc839df541ff) )
921   ROM_LOAD( "stl7a-2", 0x3000, 0x0800, CRC(57fb28dc) SHA1(6addd633d655d6a56b3e509d18e5f7c0ab2d0fbb) )
922   ROM_LOAD( "stl6a-2", 0x3800, 0x0800, CRC(4226d469) SHA1(fd18b732b66082988b01e04adc2b1e5dae410c98) )
923   ROM_LOAD( "stl9c-1", 0x4800, 0x0400, CRC(08710a84) SHA1(4bff254a14af7c968656ccc85277d31ab5a8f0c4) ) /* PROM instead of RAM char generator */
907   ROM_LOAD( "stl8a-1",  0x2800, 0x0800, CRC(e41750ff) SHA1(3868a0d7e34a5118b39b31cff9e4fc839df541ff) )
908   ROM_LOAD( "stl7a-2",  0x3000, 0x0800, CRC(57fb28dc) SHA1(6addd633d655d6a56b3e509d18e5f7c0ab2d0fbb) )
909   ROM_LOAD( "stl6a-2",  0x3800, 0x0800, CRC(4226d469) SHA1(fd18b732b66082988b01e04adc2b1e5dae410c98) )
910   ROM_LOAD( "stl9c-1",  0x4800, 0x0400, CRC(08710a84) SHA1(4bff254a14af7c968656ccc85277d31ab5a8f0c4) ) /* PROM instead of RAM char generator */
924911
925912   ROM_REGION( 0x0200, REGION_GFX1, ROMREGION_DISPOSE )
926   ROM_LOAD( "stl11d",  0x0000, 0x0200, CRC(3bd1acc1) SHA1(06f900cb8f56cd4215c5fbf58a852426d390e0c1) )
913   ROM_LOAD( "stl11d",  0x0000, 0x0200, CRC(3bd1acc1) SHA1(06f900cb8f56cd4215c5fbf58a852426d390e0c1) )
927914ROM_END
928915
929916
r1527r1528
938925   ROM_REGION( 0x0400, REGION_GFX1, ROMREGION_DISPOSE )
939926   ROM_LOAD( "hrl11d-1", 0x0000, 0x0400, CRC(9f03513e) SHA1(aa4763e49df65e5686a96431543580b8d8285893) )
940927
941   ROM_REGION( 0x0160, REGION_PROMS, 0 )
928   ROM_REGION( 0x0140, REGION_PROMS, 0 )
942929   ROM_LOAD( "hrl5c-1",  0x0000, 0x0100, CRC(a24290d0) SHA1(5f2888d168de874021b51c5d19a62fb8165e4454) )   /* address decoder */
943930   ROM_LOAD( "stl6d-1",  0x0100, 0x0020, CRC(e26f9053) SHA1(eec35b6aa2c2d305418306bf4a1754a0583f109f) )   /* unknown */
944   ROM_LOAD( "hra2b-1",  0x0120, 0x0020, CRC(38e8024b) SHA1(adf1c1770695f7614c95eceb803f662c5b096a76) )   /* unknown */
945   ROM_LOAD( "hrl14h-1", 0x0140, 0x0020, CRC(f76b4fcf) SHA1(197e0cc508ffeb5cefa4046bdfb158939d598225) )   /* unknown */
931   ROM_LOAD( "hrl14h-1", 0x0120, 0x0020, CRC(f76b4fcf) SHA1(197e0cc508ffeb5cefa4046bdfb158939d598225) )   /* unknown */
932
933   ROM_REGION( 0x0020, TARG_TONE_REGION, 0 )
934   ROM_LOAD( "hra2b-1",  0x0000, 0x0020, CRC(38e8024b) SHA1(adf1c1770695f7614c95eceb803f662c5b096a76) )   /* unknown */
946935ROM_END
947936
937
948938ROM_START( targc )
949939   ROM_REGION( 0x10000, REGION_CPU1, 0 )
950940   ROM_LOAD( "ctl.10a",  0x1800, 0x0800, CRC(058b3983) SHA1(8079667613c9273e95131c3c68cd92ce34c18148) )
r1527r1528
955945
956946   ROM_REGION( 0x0400, REGION_GFX1, ROMREGION_DISPOSE )
957947   ROM_LOAD( "hrl11d-1", 0x0000, 0x0400, CRC(9f03513e) SHA1(aa4763e49df65e5686a96431543580b8d8285893) )
948
949   ROM_REGION( 0x0020, TARG_TONE_REGION, 0 )
950   ROM_LOAD( "hra2b-1",  0x0000, 0x0020, CRC(38e8024b) SHA1(adf1c1770695f7614c95eceb803f662c5b096a76) )   /* unknown */
958951ROM_END
959952
960953
r1527r1528
972965   ROM_CONTINUE(         0x0000, 0x0400 )  /* overwrite with the real one */
973966ROM_END
974967
968
975969ROM_START( spectar1 )
976970   ROM_REGION( 0x10000, REGION_CPU1, 0 )
977971   ROM_LOAD( "spl12a1",  0x0800, 0x0800, CRC(7002efb4) SHA1(fbb19ccd2aee49b78606eadcbef94e842e1be905) )
r1527r1528
987981   ROM_CONTINUE(         0x0000, 0x0400 )  /* overwrite with the real one */
988982ROM_END
989983
984
990985ROM_START( rallys )
991986   ROM_REGION( 0x10000, REGION_CPU1, 0 )
992   ROM_LOAD( "rallys.01", 0x1000, 0x0400, CRC(a192b22b) SHA1(aaae0b1822f934df30b354f787ffa8848c71b52f) )
993   ROM_LOAD( "rallys.02", 0x1400, 0x0400, CRC(19e730aa) SHA1(4f4e87d26c14a9ff2be5b4173c4e5804db551e33) )
994   ROM_LOAD( "rallys.03", 0x1800, 0x0400, CRC(2a3e7b69) SHA1(d31a3e6acca87881741e88e70d46a4a0ee59fcf8) )
995   ROM_LOAD( "rallys.04", 0x1c00, 0x0400, CRC(6d224696) SHA1(586bc8efdc8ac0a73e4a4300459efaf89021f6f5) )
996   ROM_LOAD( "rallys.05", 0x2000, 0x0400, CRC(af943b5e) SHA1(819fa8a6ee78a39cdade49789cd42b4a215f82f0) )
997   ROM_LOAD( "rallys.06", 0x2400, 0x0400, CRC(9b3d9e61) SHA1(b183e0844706713eb0a241a6e45c09c53e4077a3) )
998   ROM_LOAD( "rallys.07", 0x2800, 0x0400, CRC(8ef8bc67) SHA1(c8d80cc8e89a9bc5d957d648d704e4c66b17932d) )
999   ROM_LOAD( "rallys.08", 0x2c00, 0x0400, CRC(243c54f2) SHA1(813b3ecbd5642034b5de0bae96698ed2b036fc7b) )
1000   ROM_LOAD( "rallys.10", 0x3400, 0x0400, CRC(46f473d2) SHA1(e6a180fdcf2ac13ffab624554ef8aab128e80321) )
1001   ROM_LOAD( "rallys.09", 0x3c00, 0x0400, CRC(56ce8a94) SHA1(becd31cda58e59267517a39c82ccfa70abdd31c6) )
987   ROM_LOAD( "rallys.01",   0x1000, 0x0400, CRC(a192b22b) SHA1(aaae0b1822f934df30b354f787ffa8848c71b52f) )
988   ROM_LOAD( "rallys.02",   0x1400, 0x0400, CRC(19e730aa) SHA1(4f4e87d26c14a9ff2be5b4173c4e5804db551e33) )
989   ROM_LOAD( "rallys.03",   0x1800, 0x0400, CRC(2a3e7b69) SHA1(d31a3e6acca87881741e88e70d46a4a0ee59fcf8) )
990   ROM_LOAD( "rallys.04",   0x1c00, 0x0400, CRC(6d224696) SHA1(586bc8efdc8ac0a73e4a4300459efaf89021f6f5) )
991   ROM_LOAD( "rallys.05",   0x2000, 0x0400, CRC(af943b5e) SHA1(819fa8a6ee78a39cdade49789cd42b4a215f82f0) )
992   ROM_LOAD( "rallys.06",   0x2400, 0x0400, CRC(9b3d9e61) SHA1(b183e0844706713eb0a241a6e45c09c53e4077a3) )
993   ROM_LOAD( "rallys.07",   0x2800, 0x0400, CRC(8ef8bc67) SHA1(c8d80cc8e89a9bc5d957d648d704e4c66b17932d) )
994   ROM_LOAD( "rallys.08",   0x2c00, 0x0400, CRC(243c54f2) SHA1(813b3ecbd5642034b5de0bae96698ed2b036fc7b) )
995   ROM_LOAD( "rallys.10",   0x3400, 0x0400, CRC(46f473d2) SHA1(e6a180fdcf2ac13ffab624554ef8aab128e80321) )
996   ROM_LOAD( "rallys.09",   0x3c00, 0x0400, CRC(56ce8a94) SHA1(becd31cda58e59267517a39c82ccfa70abdd31c6) )
1002997
1003998   ROM_REGION( 0x0400, REGION_GFX1, ROMREGION_DISPOSE )
1004   ROM_LOAD( "hrl11d-1",  0x0000, 0x0400, CRC(9f03513e) SHA1(aa4763e49df65e5686a96431543580b8d8285893) )
999   ROM_LOAD( "hrl11d-1",    0x0000, 0x0400, CRC(9f03513e) SHA1(aa4763e49df65e5686a96431543580b8d8285893) )
10051000
10061001   ROM_REGION( 0x0020, REGION_PROMS, 0 )
10071002   ROM_LOAD( "targ82s.123", 0x0000, 0x0020, CRC(9eb9125c) SHA1(660ad9b2c7c28c3fda4b10c1401c03165d131c61) )   /* unknown */
10081003ROM_END
10091004
1005
10101006ROM_START( phantoma )
10111007   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1012   ROM_LOAD( "156_a2",  0x1000, 0x0800, CRC(c5af9d34) SHA1(4c9f9a06cc7f6caf13a79fa8491db17b01b24774) )
1013   ROM_LOAD( "156_a3",  0x1800, 0x0800, CRC(30121e69) SHA1(1588cfb61eb9aa9598b3ff600cc02b0f1ac622bf) )
1014   ROM_LOAD( "156_a4",  0x2000, 0x0800, CRC(02d7fb94) SHA1(634e952a6a0d4c1a42692100e1913ecd5ab9faed) )
1015   ROM_LOAD( "156_a5",  0x2800, 0x0800, CRC(0127bc8d) SHA1(c555507f2662d1b45caf0b696147f70749292930) )
1016   ROM_LOAD( "156_a1",  0xf800, 0x0800, CRC(26292c0a) SHA1(d4157e261f6247cfafb948d1a9dbf0b02b2b84de) )
1008   ROM_LOAD( "156_a2",   0x1000, 0x0800, CRC(c5af9d34) SHA1(4c9f9a06cc7f6caf13a79fa8491db17b01b24774) )
1009   ROM_LOAD( "156_a3",   0x1800, 0x0800, CRC(30121e69) SHA1(1588cfb61eb9aa9598b3ff600cc02b0f1ac622bf) )
1010   ROM_LOAD( "156_a4",   0x2000, 0x0800, CRC(02d7fb94) SHA1(634e952a6a0d4c1a42692100e1913ecd5ab9faed) )
1011   ROM_LOAD( "156_a5",   0x2800, 0x0800, CRC(0127bc8d) SHA1(c555507f2662d1b45caf0b696147f70749292930) )
1012   ROM_LOAD( "156_a1",   0xf800, 0x0800, CRC(26292c0a) SHA1(d4157e261f6247cfafb948d1a9dbf0b02b2b84de) )
10171013
10181014   ROM_REGION( 0x800, REGION_GFX1, 0 )
1019   ROM_LOAD( "156_d1",  0x0000, 0x0800, CRC(d18e5f14) SHA1(5cd327500e74eca378ad5d0924949f96dd955cf8) )
1015   ROM_LOAD( "156_d1",  0x0000, 0x0800, CRC(d18e5f14) SHA1(5cd327500e74eca378ad5d0924949f96dd955cf8) )
10201016
10211017   ROM_REGION( 0x0020, REGION_PROMS, 0 )
1022   ROM_LOAD( "156_pal", 0x0000, 0x0020, CRC(9fb1daee) SHA1(2ec1189a57c95d7ad820eb12343fcf2c3fb08431) )
1018   ROM_LOAD( "156_pal", 0x0000, 0x0020, CRC(9fb1daee) SHA1(2ec1189a57c95d7ad820eb12343fcf2c3fb08431) )
10231019ROM_END
10241020
10251021
r1527r1528
10321028   ROM_LOAD( "mtl7a.bin",   0xe000, 0x1000, CRC(caafbb6d) SHA1(96823ac4e49f192121c53f70382a20f7c52e290b) )
10331029   ROM_LOAD( "mtl6a.bin",   0xf000, 0x1000, CRC(d85e52ca) SHA1(51296247e365a468fe9458b722bbdbbeeed59fa0) )
10341030
1035   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1031   ROM_REGION( 0x8000, REGION_CPU2, 0 )
10361032   ROM_LOAD( "mta5a.bin",   0x6800, 0x0800, CRC(dbe4ec02) SHA1(34e965428dbb4b9c558927bb80d19cb550b53228) )
10371033   ROM_LOAD( "mta6a.bin",   0x7000, 0x0800, CRC(c00f0c05) SHA1(398b0bc2a7e54b1e2326ed067bf6bb15cc52ed39) )
10381034   ROM_LOAD( "mta7a.bin",   0x7800, 0x0800, CRC(f3f16ca7) SHA1(3928c5da246c43036a7b4cbb140a1734d5f1fb03) )
10391035
10401036   ROM_REGION( 0x4000, REGION_CPU3, 0 ) /* 16k for digital sound processor */
1041   ROM_LOAD( "mta2a.bin", 0x0000, 0x1000, CRC(13db8ed3) SHA1(939352323bdcd7df25db5eb2e30f269bcaebe6af) )
1042   ROM_LOAD( "mta3a.bin", 0x1000, 0x1000, CRC(31bdfe5c) SHA1(b10bfe9e56dd617c5b4cd8b5bfec9c7f537b1086) )
1043   ROM_LOAD( "mta4a.bin", 0x2000, 0x1000, CRC(1502d0e8) SHA1(8ef51ad4601299016f1821a5c65bec0199dd5474) )
1044   ROM_LOAD( "mta1a.bin", 0x3000, 0x1000, CRC(658482a6) SHA1(c0d770fbeaa7cb3e0eef47d8caa0f8a78841692e) )
1037   ROM_LOAD( "mta2a.bin",   0x0000, 0x1000, CRC(13db8ed3) SHA1(939352323bdcd7df25db5eb2e30f269bcaebe6af) )
1038   ROM_LOAD( "mta3a.bin",   0x1000, 0x1000, CRC(31bdfe5c) SHA1(b10bfe9e56dd617c5b4cd8b5bfec9c7f537b1086) )
1039   ROM_LOAD( "mta4a.bin",   0x2000, 0x1000, CRC(1502d0e8) SHA1(8ef51ad4601299016f1821a5c65bec0199dd5474) )
1040   ROM_LOAD( "mta1a.bin",   0x3000, 0x1000, CRC(658482a6) SHA1(c0d770fbeaa7cb3e0eef47d8caa0f8a78841692e) )
10451041
10461042   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
10471043   ROM_LOAD( "mtl11d.bin",  0x0000, 0x0800, CRC(c6e4d339) SHA1(b091923e4d52e93d7c567afba217a10b2a3735fc) )
10481044ROM_END
10491045
1046
10501047ROM_START( mtrap3 )
10511048   ROM_REGION( 0x10000, REGION_CPU1, 0 )
10521049   ROM_LOAD( "mtl-3.11a",   0xa000, 0x1000, CRC(4091be6e) SHA1(a4432f4588915276583f4b2e8db527fd24eb4291) )
r1527r1528
10561053   ROM_LOAD( "mtl-3.7a",    0xe000, 0x1000, CRC(ea8ec479) SHA1(785557a242d9343c83cdc403b1f726cbea9d230f) )
10571054   ROM_LOAD( "mtl-3.6a",    0xf000, 0x1000, CRC(d72ba72d) SHA1(4c5b311bc7ecfc6133bc09e586635844e2f1d6a9) )
10581055
1059   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1056   ROM_REGION( 0x8000, REGION_CPU2, 0 )
10601057   ROM_LOAD( "mta5a.bin",   0x6800, 0x0800, CRC(dbe4ec02) SHA1(34e965428dbb4b9c558927bb80d19cb550b53228) )
10611058   ROM_LOAD( "mta6a.bin",   0x7000, 0x0800, CRC(c00f0c05) SHA1(398b0bc2a7e54b1e2326ed067bf6bb15cc52ed39) )
10621059   ROM_LOAD( "mta7a.bin",   0x7800, 0x0800, CRC(f3f16ca7) SHA1(3928c5da246c43036a7b4cbb140a1734d5f1fb03) )
10631060
10641061   ROM_REGION( 0x4000, REGION_CPU3, 0 ) /* 16k for digital sound processor */
1065   ROM_LOAD( "mta2a.bin", 0x0000, 0x1000, CRC(13db8ed3) SHA1(939352323bdcd7df25db5eb2e30f269bcaebe6af) )
1066   ROM_LOAD( "mta3a.bin", 0x1000, 0x1000, CRC(31bdfe5c) SHA1(b10bfe9e56dd617c5b4cd8b5bfec9c7f537b1086) )
1067   ROM_LOAD( "mta4a.bin", 0x2000, 0x1000, CRC(1502d0e8) SHA1(8ef51ad4601299016f1821a5c65bec0199dd5474) )
1068   ROM_LOAD( "mta1a.bin", 0x3000, 0x1000, CRC(658482a6) SHA1(c0d770fbeaa7cb3e0eef47d8caa0f8a78841692e) )
1062   ROM_LOAD( "mta2a.bin",   0x0000, 0x1000, CRC(13db8ed3) SHA1(939352323bdcd7df25db5eb2e30f269bcaebe6af) )
1063   ROM_LOAD( "mta3a.bin",   0x1000, 0x1000, CRC(31bdfe5c) SHA1(b10bfe9e56dd617c5b4cd8b5bfec9c7f537b1086) )
1064   ROM_LOAD( "mta4a.bin",   0x2000, 0x1000, CRC(1502d0e8) SHA1(8ef51ad4601299016f1821a5c65bec0199dd5474) )
1065   ROM_LOAD( "mta1a.bin",   0x3000, 0x1000, CRC(658482a6) SHA1(c0d770fbeaa7cb3e0eef47d8caa0f8a78841692e) )
10691066
10701067   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
10711068   ROM_LOAD( "mtl11d.bin",  0x0000, 0x0800, CRC(c6e4d339) SHA1(b091923e4d52e93d7c567afba217a10b2a3735fc) )
10721069ROM_END
10731070
1071
10741072ROM_START( mtrap4 )
10751073   ROM_REGION( 0x10000, REGION_CPU1, 0 )
10761074   ROM_LOAD( "mta411a.bin",  0xa000, 0x1000, CRC(2879cb8d) SHA1(738bd3cd968fd733adcfe0fb5efdb2e2fcfb344e) )
r1527r1528
10801078   ROM_LOAD( "mta47a.bin",   0xe000, 0x1000, CRC(cdf8c6a8) SHA1(932ae9c0ea5700bd79862efa94742136d8e15641) )
10811079   ROM_LOAD( "mta46a.bin",   0xf000, 0x1000, CRC(77d3f2e6) SHA1(2c21dd7ee326ccb41d3c64eec90a19198382edea) )
10821080
1083   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1081   ROM_REGION( 0x8000, REGION_CPU2, 0 )
10841082   ROM_LOAD( "mta5a.bin",    0x6800, 0x0800, CRC(dbe4ec02) SHA1(34e965428dbb4b9c558927bb80d19cb550b53228) )
10851083   ROM_LOAD( "mta6a.bin",    0x7000, 0x0800, CRC(c00f0c05) SHA1(398b0bc2a7e54b1e2326ed067bf6bb15cc52ed39) )
10861084   ROM_LOAD( "mta7a.bin",    0x7800, 0x0800, CRC(f3f16ca7) SHA1(3928c5da246c43036a7b4cbb140a1734d5f1fb03) )
10871085
10881086   ROM_REGION( 0x4000, REGION_CPU3, 0 ) /* 16k for digital sound processor */
1089   ROM_LOAD( "mta2a.bin", 0x0000,0x1000,CRC(13db8ed3) SHA1(939352323bdcd7df25db5eb2e30f269bcaebe6af) )
1090   ROM_LOAD( "mta3a.bin", 0x1000,0x1000,CRC(31bdfe5c) SHA1(b10bfe9e56dd617c5b4cd8b5bfec9c7f537b1086) )
1091   ROM_LOAD( "mta4a.bin", 0x2000,0x1000,CRC(1502d0e8) SHA1(8ef51ad4601299016f1821a5c65bec0199dd5474) )
1092   ROM_LOAD( "mta1a.bin", 0x3000,0x1000,CRC(658482a6) SHA1(c0d770fbeaa7cb3e0eef47d8caa0f8a78841692e) )
1087   ROM_LOAD( "mta2a.bin",    0x0000,0x1000,CRC(13db8ed3) SHA1(939352323bdcd7df25db5eb2e30f269bcaebe6af) )
1088   ROM_LOAD( "mta3a.bin",    0x1000,0x1000,CRC(31bdfe5c) SHA1(b10bfe9e56dd617c5b4cd8b5bfec9c7f537b1086) )
1089   ROM_LOAD( "mta4a.bin",    0x2000,0x1000,CRC(1502d0e8) SHA1(8ef51ad4601299016f1821a5c65bec0199dd5474) )
1090   ROM_LOAD( "mta1a.bin",    0x3000,0x1000,CRC(658482a6) SHA1(c0d770fbeaa7cb3e0eef47d8caa0f8a78841692e) )
10931091
10941092   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
10951093   ROM_LOAD( "mtl11d.bin",   0x0000, 0x0800, CRC(c6e4d339) SHA1(b091923e4d52e93d7c567afba217a10b2a3735fc) )
r1527r1528
10981096
10991097ROM_START( venture )
11001098   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1101   ROM_LOAD( "13a-cpu",      0x8000, 0x1000, CRC(f4e4d991) SHA1(6683c1552b56b20f2296e461aff697af73563792) )
1102   ROM_LOAD( "12a-cpu",      0x9000, 0x1000, CRC(c6d8cb04) SHA1(3b9ae8fdc35117c73c91daed66e93e5344bdcd7e) )
1103   ROM_LOAD( "11a-cpu",      0xa000, 0x1000, CRC(3bdb01f4) SHA1(3c1f43a3c37a21524b64d69e4dae58af8c2e0d90) )
1104   ROM_LOAD( "10a-cpu",      0xb000, 0x1000, CRC(0da769e9) SHA1(3604dc08c63461b2ea957a396887fb32e4a1a970) )
1105   ROM_LOAD( "9a-cpu",       0xc000, 0x1000, CRC(0ae05855) SHA1(29b3c2ca9740aa753e90131e6edcc61f414277e1) )
1106   ROM_LOAD( "8a-cpu",       0xd000, 0x1000, CRC(4ae59676) SHA1(36fc9dce9dd0c764a861634859ca0d7f98e20382) )
1107   ROM_LOAD( "7a-cpu",       0xe000, 0x1000, CRC(48d66220) SHA1(97b1605170c67b3a945b4d5f088df79328e163ce) )
1108   ROM_LOAD( "6a-cpu",       0xf000, 0x1000, CRC(7b78cf49) SHA1(1d484172465d3db6c4fc3733aa2b409e3a2e228f) )
1099   ROM_LOAD( "13a-cpu", 0x8000, 0x1000, CRC(f4e4d991) SHA1(6683c1552b56b20f2296e461aff697af73563792) )
1100   ROM_LOAD( "12a-cpu", 0x9000, 0x1000, CRC(c6d8cb04) SHA1(3b9ae8fdc35117c73c91daed66e93e5344bdcd7e) )
1101   ROM_LOAD( "11a-cpu", 0xa000, 0x1000, CRC(3bdb01f4) SHA1(3c1f43a3c37a21524b64d69e4dae58af8c2e0d90) )
1102   ROM_LOAD( "10a-cpu", 0xb000, 0x1000, CRC(0da769e9) SHA1(3604dc08c63461b2ea957a396887fb32e4a1a970) )
1103   ROM_LOAD( "9a-cpu",  0xc000, 0x1000, CRC(0ae05855) SHA1(29b3c2ca9740aa753e90131e6edcc61f414277e1) )
1104   ROM_LOAD( "8a-cpu",  0xd000, 0x1000, CRC(4ae59676) SHA1(36fc9dce9dd0c764a861634859ca0d7f98e20382) )
1105   ROM_LOAD( "7a-cpu",  0xe000, 0x1000, CRC(48d66220) SHA1(97b1605170c67b3a945b4d5f088df79328e163ce) )
1106   ROM_LOAD( "6a-cpu",  0xf000, 0x1000, CRC(7b78cf49) SHA1(1d484172465d3db6c4fc3733aa2b409e3a2e228f) )
11091107
1110   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1111   ROM_LOAD( "3a-ac",        0x5800, 0x0800, CRC(4ea1c3d9) SHA1(d0c99c9d5b887d717c68e8745906ae4e65aec6ad) )
1112   ROM_LOAD( "4a-ac",        0x6000, 0x0800, CRC(5154c39e) SHA1(e6f011630eb1aa4116a0e5824ad6b65c1be2455f) )
1113   ROM_LOAD( "5a-ac",        0x6800, 0x0800, CRC(1e1e3916) SHA1(867e586583e07cd01e0e852f6ea52a040995725d) )
1114   ROM_LOAD( "6a-ac",        0x7000, 0x0800, CRC(80f3357a) SHA1(f1ee638251e8676a526e6367c11866b1d52f5910) )
1115   ROM_LOAD( "7a-ac",        0x7800, 0x0800, CRC(466addc7) SHA1(0230b5365d6aeee3ca47666a9eadee4141de125b) )
1108   ROM_REGION( 0x8000, REGION_CPU2, 0 )
1109   ROM_LOAD( "3a-ac",   0x5800, 0x0800, CRC(4ea1c3d9) SHA1(d0c99c9d5b887d717c68e8745906ae4e65aec6ad) )
1110   ROM_LOAD( "4a-ac",   0x6000, 0x0800, CRC(5154c39e) SHA1(e6f011630eb1aa4116a0e5824ad6b65c1be2455f) )
1111   ROM_LOAD( "5a-ac",   0x6800, 0x0800, CRC(1e1e3916) SHA1(867e586583e07cd01e0e852f6ea52a040995725d) )
1112   ROM_LOAD( "6a-ac",   0x7000, 0x0800, CRC(80f3357a) SHA1(f1ee638251e8676a526e6367c11866b1d52f5910) )
1113   ROM_LOAD( "7a-ac",   0x7800, 0x0800, CRC(466addc7) SHA1(0230b5365d6aeee3ca47666a9eadee4141de125b) )
11161114
11171115   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1118   ROM_LOAD( "11d-cpu",      0x0000, 0x0800, CRC(b4bb2503) SHA1(67303603b7c5e6301e976ef19f81c7519648b179) )
1116   ROM_LOAD( "11d-cpu", 0x0000, 0x0800, CRC(b4bb2503) SHA1(67303603b7c5e6301e976ef19f81c7519648b179) )
11191117ROM_END
11201118
1119
11211120ROM_START( venture2 )
11221121   ROM_REGION( 0x10000, REGION_CPU1, 0 )
11231122   ROM_LOAD( "vent_a13.cpu", 0x8000, 0x1000, CRC(4c833f99) SHA1(1ff4eafe48b9f0ab8a123659d78c3dfa0bf56d7d) )
r1527r1528
11291128   ROM_LOAD( "vent_a7.cpu",  0xe000, 0x1000, CRC(1aab27c2) SHA1(66c7274dbb8bda3c78cc61d96a6cb1a9b29939b5) )
11301129   ROM_LOAD( "vent_a6.cpu",  0xf000, 0x1000, CRC(767bdd71) SHA1(334a903e05fc86186f90aa2d9ce3b0d367d7e516) )
11311130
1132   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1131   ROM_REGION( 0x8000, REGION_CPU2, 0 )
11331132   ROM_LOAD( "3a-ac",        0x5800, 0x0800, CRC(4ea1c3d9) SHA1(d0c99c9d5b887d717c68e8745906ae4e65aec6ad) )
11341133   ROM_LOAD( "4a-ac",        0x6000, 0x0800, CRC(5154c39e) SHA1(e6f011630eb1aa4116a0e5824ad6b65c1be2455f) )
11351134   ROM_LOAD( "5a-ac",        0x6800, 0x0800, CRC(1e1e3916) SHA1(867e586583e07cd01e0e852f6ea52a040995725d) )
r1527r1528
11401139   ROM_LOAD( "11d-cpu",      0x0000, 0x0800, CRC(b4bb2503) SHA1(67303603b7c5e6301e976ef19f81c7519648b179) )
11411140ROM_END
11421141
1142
11431143ROM_START( venture4 )
11441144   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1145   ROM_LOAD( "vel13a-4",     0x8000, 0x1000, CRC(1c5448f9) SHA1(59d3ca2a2d7048f5f7bd23fa5d9c9a2cc0734cb8) )
1146   ROM_LOAD( "vel12a-4",     0x9000, 0x1000, CRC(e62491cc) SHA1(a98b6c6e60d83fd4591d0de145a99c5e4576121a) )
1147   ROM_LOAD( "vel11a-4",     0xa000, 0x1000, CRC(e91faeaf) SHA1(ce50a9f1016671282d16f2d0ad3553598e0c7e89) )
1148   ROM_LOAD( "vel10a-4",     0xb000, 0x1000, CRC(da3a2991) SHA1(2b5175b0f3642e735b6d87fbd5b75118cf6b7faa) )
1149   ROM_LOAD( "vel9a-4",      0xc000, 0x1000, CRC(d1887b11) SHA1(40ed1e1bdcb95d6e317cb5e4fb8572a314b3fbf8) )
1150   ROM_LOAD( "vel8a-4",      0xd000, 0x1000, CRC(8e8153fc) SHA1(409cf0ed39ef04c1e9359f0499d7cba3aed8f36e) )
1151   ROM_LOAD( "vel7a-4",      0xe000, 0x1000, CRC(0a091701) SHA1(ffdea1d60371779d0c28fb3c6111639cace79dad) )
1152   ROM_LOAD( "vel6a-4",      0xf000, 0x1000, CRC(7b165f67) SHA1(4109797bcfd33c870234930790e3cecaaf90b706) )
1145   ROM_LOAD( "vel13a-4", 0x8000, 0x1000, CRC(1c5448f9) SHA1(59d3ca2a2d7048f5f7bd23fa5d9c9a2cc0734cb8) )
1146   ROM_LOAD( "vel12a-4", 0x9000, 0x1000, CRC(e62491cc) SHA1(a98b6c6e60d83fd4591d0de145a99c5e4576121a) )
1147   ROM_LOAD( "vel11a-4", 0xa000, 0x1000, CRC(e91faeaf) SHA1(ce50a9f1016671282d16f2d0ad3553598e0c7e89) )
1148   ROM_LOAD( "vel10a-4", 0xb000, 0x1000, CRC(da3a2991) SHA1(2b5175b0f3642e735b6d87fbd5b75118cf6b7faa) )
1149   ROM_LOAD( "vel9a-4",  0xc000, 0x1000, CRC(d1887b11) SHA1(40ed1e1bdcb95d6e317cb5e4fb8572a314b3fbf8) )
1150   ROM_LOAD( "vel8a-4",  0xd000, 0x1000, CRC(8e8153fc) SHA1(409cf0ed39ef04c1e9359f0499d7cba3aed8f36e) )
1151   ROM_LOAD( "vel7a-4",  0xe000, 0x1000, CRC(0a091701) SHA1(ffdea1d60371779d0c28fb3c6111639cace79dad) )
1152   ROM_LOAD( "vel6a-4",  0xf000, 0x1000, CRC(7b165f67) SHA1(4109797bcfd33c870234930790e3cecaaf90b706) )
11531153
1154   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1155   ROM_LOAD( "vea3a-2",      0x5800, 0x0800, CRC(83b8836f) SHA1(ec0e2de62caea61ceff56e924449213997bff8cd) )
1156   ROM_LOAD( "4a-ac",        0x6000, 0x0800, CRC(5154c39e) SHA1(e6f011630eb1aa4116a0e5824ad6b65c1be2455f) )
1157   ROM_LOAD( "5a-ac",        0x6800, 0x0800, CRC(1e1e3916) SHA1(867e586583e07cd01e0e852f6ea52a040995725d) )
1158   ROM_LOAD( "6a-ac",        0x7000, 0x0800, CRC(80f3357a) SHA1(f1ee638251e8676a526e6367c11866b1d52f5910) )
1159   ROM_LOAD( "7a-ac",        0x7800, 0x0800, CRC(466addc7) SHA1(0230b5365d6aeee3ca47666a9eadee4141de125b) )
1154   ROM_REGION( 0x8000, REGION_CPU2, 0 )
1155   ROM_LOAD( "vea3a-2",  0x5800, 0x0800, CRC(83b8836f) SHA1(ec0e2de62caea61ceff56e924449213997bff8cd) )
1156   ROM_LOAD( "4a-ac",    0x6000, 0x0800, CRC(5154c39e) SHA1(e6f011630eb1aa4116a0e5824ad6b65c1be2455f) )
1157   ROM_LOAD( "5a-ac",    0x6800, 0x0800, CRC(1e1e3916) SHA1(867e586583e07cd01e0e852f6ea52a040995725d) )
1158   ROM_LOAD( "6a-ac",    0x7000, 0x0800, CRC(80f3357a) SHA1(f1ee638251e8676a526e6367c11866b1d52f5910) )
1159   ROM_LOAD( "7a-ac",    0x7800, 0x0800, CRC(466addc7) SHA1(0230b5365d6aeee3ca47666a9eadee4141de125b) )
11601160
11611161   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1162   ROM_LOAD( "vel11d-2",     0x0000, 0x0800, CRC(ea6fd981) SHA1(46b1658e1607423d5a073f14097c2a48d59057c0) )
1162   ROM_LOAD( "vel11d-2", 0x0000, 0x0800, CRC(ea6fd981) SHA1(46b1658e1607423d5a073f14097c2a48d59057c0) )
11631163ROM_END
11641164
11651165
11661166ROM_START( pepper2 )
11671167   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1168   ROM_LOAD( "main_12a",     0x9000, 0x1000, CRC(33db4737) SHA1(d8f7a5d340ddbc4d06d403c3bff0102ce637d24e) )
1169   ROM_LOAD( "main_11a",     0xa000, 0x1000, CRC(a1f43b1f) SHA1(a669f2ef55d9a0617110f65863822fdcaf153511) )
1170   ROM_LOAD( "main_10a",     0xb000, 0x1000, CRC(4d7d7786) SHA1(ea1390b887404a67ea556720219e81007b954a7d) )
1171   ROM_LOAD( "main_9a",      0xc000, 0x1000, CRC(b3362298) SHA1(7adad138ec5f94caa39f9c0fabece538d5db4913) )
1172   ROM_LOAD( "main_8a",      0xd000, 0x1000, CRC(64d106ed) SHA1(49646a97def9e1793cac6ee0044f68232b294e4f) )
1173   ROM_LOAD( "main_7a",      0xe000, 0x1000, CRC(b1c6f07c) SHA1(53d07211d014336bb43671c51f4190c6515e9cde) )
1174   ROM_LOAD( "main_6a",      0xf000, 0x1000, CRC(515b1046) SHA1(bdcccd4e415c00ee8e5ec185597df75ecafe7d3d) )
1168   ROM_LOAD( "main_12a", 0x9000, 0x1000, CRC(33db4737) SHA1(d8f7a5d340ddbc4d06d403c3bff0102ce637d24e) )
1169   ROM_LOAD( "main_11a", 0xa000, 0x1000, CRC(a1f43b1f) SHA1(a669f2ef55d9a0617110f65863822fdcaf153511) )
1170   ROM_LOAD( "main_10a", 0xb000, 0x1000, CRC(4d7d7786) SHA1(ea1390b887404a67ea556720219e81007b954a7d) )
1171   ROM_LOAD( "main_9a",  0xc000, 0x1000, CRC(b3362298) SHA1(7adad138ec5f94caa39f9c0fabece538d5db4913) )
1172   ROM_LOAD( "main_8a",  0xd000, 0x1000, CRC(64d106ed) SHA1(49646a97def9e1793cac6ee0044f68232b294e4f) )
1173   ROM_LOAD( "main_7a",  0xe000, 0x1000, CRC(b1c6f07c) SHA1(53d07211d014336bb43671c51f4190c6515e9cde) )
1174   ROM_LOAD( "main_6a",  0xf000, 0x1000, CRC(515b1046) SHA1(bdcccd4e415c00ee8e5ec185597df75ecafe7d3d) )
11751175
1176   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1177   ROM_LOAD( "audio_5a",     0x6800, 0x0800, CRC(90e3c781) SHA1(d51a9e011167a132e8af9f4b1201600a58e86b62) )
1178   ROM_LOAD( "audio_6a",     0x7000, 0x0800, CRC(dd343e34) SHA1(4ec55bb73d6afbd167fa91d2606d1d55a15b5c39) )
1179   ROM_LOAD( "audio_7a",     0x7800, 0x0800, CRC(e02b4356) SHA1(9891e14d84221c1d6f2d15a29813eb41024290ca) )
1176   ROM_REGION( 0x8000, REGION_CPU2, 0 )
1177   ROM_LOAD( "audio_5a", 0x6800, 0x0800, CRC(90e3c781) SHA1(d51a9e011167a132e8af9f4b1201600a58e86b62) )
1178   ROM_LOAD( "audio_6a", 0x7000, 0x0800, CRC(dd343e34) SHA1(4ec55bb73d6afbd167fa91d2606d1d55a15b5c39) )
1179   ROM_LOAD( "audio_7a", 0x7800, 0x0800, CRC(e02b4356) SHA1(9891e14d84221c1d6f2d15a29813eb41024290ca) )
11801180
11811181   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1182   ROM_LOAD( "main_11d",     0x0000, 0x0800, CRC(b25160cd) SHA1(3d768552960a3a660891dcb85da6a5c382b33991) )
1182   ROM_LOAD( "main_11d", 0x0000, 0x0800, CRC(b25160cd) SHA1(3d768552960a3a660891dcb85da6a5c382b33991) )
11831183ROM_END
11841184
11851185
11861186ROM_START( hardhat )
11871187   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1188   ROM_LOAD( "hhl-2.11a",    0xa000, 0x1000, CRC(7623deea) SHA1(3c47c0439c80e66536af42c5ee4e522fea5f8374) )
1189   ROM_LOAD( "hhl-2.10a",    0xb000, 0x1000, CRC(e6bf2fb1) SHA1(ad41859129774fc51462726a825c0ae16ed81a6e) )
1190   ROM_LOAD( "hhl-2.9a",     0xc000, 0x1000, CRC(acc2bce5) SHA1(0f7b8cfbd2628b8587c423fbc2c8310d71d8ad2a) )
1191   ROM_LOAD( "hhl-2.8a",     0xd000, 0x1000, CRC(23c7a2f8) SHA1(5eb1d512d73ba6bd1c23501664b582e9d3cf777f) )
1192   ROM_LOAD( "hhl-2.7a",     0xe000, 0x1000, CRC(6f7ce1c2) SHA1(356dcea22e50c95a8552566a0fb5f9b4e3e5de2a) )
1193   ROM_LOAD( "hhl-2.6a",     0xf000, 0x1000, CRC(2a20cf10) SHA1(31eb4556647e78e3d9be1c30d970eac8aaa5cf18) )
1188   ROM_LOAD( "hhl-2.11a", 0xa000, 0x1000, CRC(7623deea) SHA1(3c47c0439c80e66536af42c5ee4e522fea5f8374) )
1189   ROM_LOAD( "hhl-2.10a", 0xb000, 0x1000, CRC(e6bf2fb1) SHA1(ad41859129774fc51462726a825c0ae16ed81a6e) )
1190   ROM_LOAD( "hhl-2.9a",  0xc000, 0x1000, CRC(acc2bce5) SHA1(0f7b8cfbd2628b8587c423fbc2c8310d71d8ad2a) )
1191   ROM_LOAD( "hhl-2.8a",  0xd000, 0x1000, CRC(23c7a2f8) SHA1(5eb1d512d73ba6bd1c23501664b582e9d3cf777f) )
1192   ROM_LOAD( "hhl-2.7a",  0xe000, 0x1000, CRC(6f7ce1c2) SHA1(356dcea22e50c95a8552566a0fb5f9b4e3e5de2a) )
1193   ROM_LOAD( "hhl-2.6a",  0xf000, 0x1000, CRC(2a20cf10) SHA1(31eb4556647e78e3d9be1c30d970eac8aaa5cf18) )
11941194
1195   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1196   ROM_LOAD( "hha-1.5a",     0x6800, 0x0800, CRC(16a5a183) SHA1(cf3fed55db9c61fd33c222275d472fa109bed081) )
1197   ROM_LOAD( "hha-1.6a",     0x7000, 0x0800, CRC(bde64021) SHA1(a403590d5a27b859eaa299e47df4ebd6ce4a5772) )
1198   ROM_LOAD( "hha-1.7a",     0x7800, 0x0800, CRC(505ee5d3) SHA1(efa228465688f2bb30f00dc1511cc5f3a287356c) )
1195   ROM_REGION( 0x8000, REGION_CPU2, 0 )
1196   ROM_LOAD( "hha-1.5a",  0x6800, 0x0800, CRC(16a5a183) SHA1(cf3fed55db9c61fd33c222275d472fa109bed081) )
1197   ROM_LOAD( "hha-1.6a",  0x7000, 0x0800, CRC(bde64021) SHA1(a403590d5a27b859eaa299e47df4ebd6ce4a5772) )
1198   ROM_LOAD( "hha-1.7a",  0x7800, 0x0800, CRC(505ee5d3) SHA1(efa228465688f2bb30f00dc1511cc5f3a287356c) )
11991199
12001200   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1201   ROM_LOAD( "hhl-1.11d",    0x0000, 0x0800, CRC(dbcdf353) SHA1(76ea287326a5c9e75e407cc010414212d8fdd52a) )
1201   ROM_LOAD( "hhl-1.11d", 0x0000, 0x0800, CRC(dbcdf353) SHA1(76ea287326a5c9e75e407cc010414212d8fdd52a) )
12021202ROM_END
12031203
12041204
12051205ROM_START( teetert )
12061206   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1207   ROM_LOAD( "13a-cpu",      0x8000, 0x1000, CRC(f4e4d991) SHA1(6683c1552b56b20f2296e461aff697af73563792) )
1208   ROM_LOAD( "12a-cpu",      0x9000, 0x1000, CRC(c6d8cb04) SHA1(3b9ae8fdc35117c73c91daed66e93e5344bdcd7e) )
1209   ROM_LOAD( "11a-cpu",      0xa000, 0x1000, CRC(bac9b259) SHA1(0265cbd683fadf42f8a6b71958cbe782a732c257) )
1210   ROM_LOAD( "10a-cpu",      0xb000, 0x1000, CRC(3ae7e445) SHA1(e511ce4c553ac58e87b6ee623f8c42d7653de972) )
1211   ROM_LOAD( "9a-cpu",       0xc000, 0x1000, CRC(0cba424d) SHA1(54377163a8b8082639baf56b960eb26268462d46) )
1212   ROM_LOAD( "8a-cpu",       0xd000, 0x1000, CRC(68de66e7) SHA1(70a0cc950f16f2c408fae717e6fdb75eb0fd8039) )
1213   ROM_LOAD( "7a-cpu",       0xe000, 0x1000, CRC(84491333) SHA1(db9f8e4c49057a4574a3784d71e627da7f7a4b44) )
1214   ROM_LOAD( "6a-cpu",       0xf000, 0x1000, CRC(3600d465) SHA1(84d633e042f73bfd6bf4a4d0ffee1cd2027c65d2) )
1207   ROM_LOAD( "13a-cpu", 0x8000, 0x1000, CRC(f4e4d991) SHA1(6683c1552b56b20f2296e461aff697af73563792) )
1208   ROM_LOAD( "12a-cpu", 0x9000, 0x1000, CRC(c6d8cb04) SHA1(3b9ae8fdc35117c73c91daed66e93e5344bdcd7e) )
1209   ROM_LOAD( "11a-cpu", 0xa000, 0x1000, CRC(bac9b259) SHA1(0265cbd683fadf42f8a6b71958cbe782a732c257) )
1210   ROM_LOAD( "10a-cpu", 0xb000, 0x1000, CRC(3ae7e445) SHA1(e511ce4c553ac58e87b6ee623f8c42d7653de972) )
1211   ROM_LOAD( "9a-cpu",  0xc000, 0x1000, CRC(0cba424d) SHA1(54377163a8b8082639baf56b960eb26268462d46) )
1212   ROM_LOAD( "8a-cpu",  0xd000, 0x1000, CRC(68de66e7) SHA1(70a0cc950f16f2c408fae717e6fdb75eb0fd8039) )
1213   ROM_LOAD( "7a-cpu",  0xe000, 0x1000, CRC(84491333) SHA1(db9f8e4c49057a4574a3784d71e627da7f7a4b44) )
1214   ROM_LOAD( "6a-cpu",  0xf000, 0x1000, CRC(3600d465) SHA1(84d633e042f73bfd6bf4a4d0ffee1cd2027c65d2) )
12151215
1216   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1217   ROM_LOAD( "3a-ac",        0x5800, 0x0800, CRC(83b8836f) SHA1(ec0e2de62caea61ceff56e924449213997bff8cd) )
1218   ROM_LOAD( "4a-ac",        0x6000, 0x0800, CRC(5154c39e) SHA1(e6f011630eb1aa4116a0e5824ad6b65c1be2455f) )
1219   ROM_LOAD( "5a-ac",        0x6800, 0x0800, CRC(1e1e3916) SHA1(867e586583e07cd01e0e852f6ea52a040995725d) )
1220   ROM_LOAD( "6a-ac",        0x7000, 0x0800, CRC(80f3357a) SHA1(f1ee638251e8676a526e6367c11866b1d52f5910) )
1221   ROM_LOAD( "7a-ac",        0x7800, 0x0800, CRC(466addc7) SHA1(0230b5365d6aeee3ca47666a9eadee4141de125b) )
1216   ROM_REGION( 0x8000, REGION_CPU2, 0 )
1217   ROM_LOAD( "3a-ac",   0x5800, 0x0800, CRC(83b8836f) SHA1(ec0e2de62caea61ceff56e924449213997bff8cd) )
1218   ROM_LOAD( "4a-ac",   0x6000, 0x0800, CRC(5154c39e) SHA1(e6f011630eb1aa4116a0e5824ad6b65c1be2455f) )
1219   ROM_LOAD( "5a-ac",   0x6800, 0x0800, CRC(1e1e3916) SHA1(867e586583e07cd01e0e852f6ea52a040995725d) )
1220   ROM_LOAD( "6a-ac",   0x7000, 0x0800, CRC(80f3357a) SHA1(f1ee638251e8676a526e6367c11866b1d52f5910) )
1221   ROM_LOAD( "7a-ac",   0x7800, 0x0800, CRC(466addc7) SHA1(0230b5365d6aeee3ca47666a9eadee4141de125b) )
12221222
12231223   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1224   ROM_LOAD( "11d-cpu",      0x0000, 0x0800, CRC(0fe70b00) SHA1(6068be263d7a8e6b71af6f4dceec40bb8d246376) )
1224   ROM_LOAD( "11d-cpu", 0x0000, 0x0800, CRC(0fe70b00) SHA1(6068be263d7a8e6b71af6f4dceec40bb8d246376) )
12251225ROM_END
12261226
12271227
12281228ROM_START( fax )
1229   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 64k for code + 192k for extra memory */
1230   ROM_LOAD( "fxl8-13a.32",  0x8000, 0x1000, CRC(8e30bf6b) SHA1(1fdf010da0258bc038554cf33c26e539a1f6b648) )
1231   ROM_LOAD( "fxl8-12a.32",  0x9000, 0x1000, CRC(60a41ff1) SHA1(1703dbedd09354d89c6014644d0ffe13ec657b8b) )
1232   ROM_LOAD( "fxl8-11a.32",  0xa000, 0x1000, CRC(2c9cee8a) SHA1(169045b4d840730cfbaa0b9a8a8d82907ea09d0c) )
1233   ROM_LOAD( "fxl8-10a.32",  0xb000, 0x1000, CRC(9b03938f) SHA1(af4c27b06a1f1be917316910b88d026b67cc60c0) )
1234   ROM_LOAD( "fxl8-9a.32",   0xc000, 0x1000, CRC(fb869f62) SHA1(cea6ff423c60662a1b36e9565940432707d5299b) )
1235   ROM_LOAD( "fxl8-8a.32",   0xd000, 0x1000, CRC(db3470bc) SHA1(7786f84ab41765ea91ab241d14a207044eda0e93) )
1236   ROM_LOAD( "fxl8-7a.32",   0xe000, 0x1000, CRC(1471fef5) SHA1(89308f3c2a0d7ea699e99622d37c5c95e3eaaf95) )
1237   ROM_LOAD( "fxl8-6a.32",   0xf000, 0x1000, CRC(812e39f3) SHA1(41c99f8483c69617f9c8dd82f979630ea9190454) )
1229   ROM_REGION( 0x40000, REGION_CPU1, 0 )
1230   ROM_LOAD( "fxl8-13a.32", 0x08000, 0x1000, CRC(8e30bf6b) SHA1(1fdf010da0258bc038554cf33c26e539a1f6b648) )
1231   ROM_LOAD( "fxl8-12a.32", 0x09000, 0x1000, CRC(60a41ff1) SHA1(1703dbedd09354d89c6014644d0ffe13ec657b8b) )
1232   ROM_LOAD( "fxl8-11a.32", 0x0a000, 0x1000, CRC(2c9cee8a) SHA1(169045b4d840730cfbaa0b9a8a8d82907ea09d0c) )
1233   ROM_LOAD( "fxl8-10a.32", 0x0b000, 0x1000, CRC(9b03938f) SHA1(af4c27b06a1f1be917316910b88d026b67cc60c0) )
1234   ROM_LOAD( "fxl8-9a.32",  0x0c000, 0x1000, CRC(fb869f62) SHA1(cea6ff423c60662a1b36e9565940432707d5299b) )
1235   ROM_LOAD( "fxl8-8a.32",  0x0d000, 0x1000, CRC(db3470bc) SHA1(7786f84ab41765ea91ab241d14a207044eda0e93) )
1236   ROM_LOAD( "fxl8-7a.32",  0x0e000, 0x1000, CRC(1471fef5) SHA1(89308f3c2a0d7ea699e99622d37c5c95e3eaaf95) )
1237   ROM_LOAD( "fxl8-6a.32",  0x0f000, 0x1000, CRC(812e39f3) SHA1(41c99f8483c69617f9c8dd82f979630ea9190454) )
12381238   /* Banks of question ROMs */
1239   ROM_LOAD( "fxd-1c.64",  0x10000, 0x2000, CRC(fd7e3137) SHA1(6fda53737cd7c886c66c60436ae3ed5c62e6b178) )
1240   ROM_LOAD( "fxd-2c.64",  0x12000, 0x2000, CRC(e78cb16f) SHA1(d58dfa2385368ccf00ecfbaeccaf5ba82ef7da9b) )
1241   ROM_LOAD( "fxd-3c.64",  0x14000, 0x2000, CRC(57a94c6f) SHA1(fc27fe805c4cc29f797bfc0e4cd13a570ac5c1ec) )
1242   ROM_LOAD( "fxd-4c.64",  0x16000, 0x2000, CRC(9036c5a2) SHA1(b7a01e4002f615702cb691764cfae93707bf3c0f) )
1243   ROM_LOAD( "fxd-5c.64",  0x18000, 0x2000, CRC(38c03405) SHA1(c490252825dc3c4bf91255c7cb70a5ead92de85b) )
1244   ROM_LOAD( "fxd-6c.64",  0x1a000, 0x2000, CRC(f48fc308) SHA1(bfaf43e57a4d92b593d51d8cd61fe4d5c06e836c) )
1245   ROM_LOAD( "fxd-7c.64",  0x1c000, 0x2000, CRC(cf93b924) SHA1(892e6e6aa33bbcd271f5e0a63c1e8393df62f360) )
1246   ROM_LOAD( "fxd-8c.64",  0x1e000, 0x2000, CRC(607b48da) SHA1(6c8f2f207f3dd936c529b86cef917a0f0699a21c) )
1247   ROM_LOAD( "fxd-1b.64",  0x20000, 0x2000, CRC(62872d4f) SHA1(c020fdeae6c2e7d04c16048fdaa99ecf3e40af31) )
1248   ROM_LOAD( "fxd-2b.64",  0x22000, 0x2000, CRC(625778d0) SHA1(6c8d6b50653bff3774f5ccef0e000a2ef3f7030c) )
1249   ROM_LOAD( "fxd-3b.64",  0x24000, 0x2000, CRC(c3473dee) SHA1(8675f9b93bbbae4f5a5682c5b1623afeeacc0a4b) )
1250   ROM_LOAD( "fxd-4b.64",  0x26000, 0x2000, CRC(e39a15f5) SHA1(43b04cc2e4750b649116ade5b1004c2580293134) )
1251   ROM_LOAD( "fxd-5b.64",  0x28000, 0x2000, CRC(101a9d70) SHA1(2b839cd707e03b0e50037e1ffabcb8fe375dc4c0) )
1252   ROM_LOAD( "fxd-6b.64",  0x2a000, 0x2000, CRC(374a8f05) SHA1(ec41470932823242fff36ab6e6f158fa5c07d0a8) )
1253   ROM_LOAD( "fxd-7b.64",  0x2c000, 0x2000, CRC(f7e7f824) SHA1(1bed1ee07032b25675ace612a883cba4ab4b2f77) )
1254   ROM_LOAD( "fxd-8b.64",  0x2e000, 0x2000, CRC(8f1a5287) SHA1(a1102d49bacb25887eaa67ae64bcf64c8cad94fe) )
1255   ROM_LOAD( "fxd-1a.64",  0x30000, 0x2000, CRC(fc5e6344) SHA1(c61aad5100819f2fe98c3a159b64739fa6322d09) )
1256   ROM_LOAD( "fxd-2a.64",  0x32000, 0x2000, CRC(43cf60b3) SHA1(5169196d0a95450801b3a57703cb9f2861a25948) )
1257   ROM_LOAD( "fxd-3a.64",  0x34000, 0x2000, CRC(6b7d29cb) SHA1(fd4006efd24b33f8e2baf7f97d4b776d5ef90959) )
1258   ROM_LOAD( "fxd-4a.64",  0x36000, 0x2000, CRC(b9de3c2d) SHA1(229f9f0762d4d659acf516c2c1a42e70d2f98652) )
1259   ROM_LOAD( "fxd-5a.64",  0x38000, 0x2000, CRC(67285bc6) SHA1(f929c916fb19dbc91fc3a75dfed6375b63cb2043) )
1260   ROM_LOAD( "fxd-6a.64",  0x3a000, 0x2000, CRC(ba67b7b2) SHA1(12265f678b1e4dfc3b36a964f78b0103112753ee) )
1239   ROM_LOAD( "fxd-1c.64",   0x10000, 0x2000, CRC(fd7e3137) SHA1(6fda53737cd7c886c66c60436ae3ed5c62e6b178) )
1240   ROM_LOAD( "fxd-2c.64",   0x12000, 0x2000, CRC(e78cb16f) SHA1(d58dfa2385368ccf00ecfbaeccaf5ba82ef7da9b) )
1241   ROM_LOAD( "fxd-3c.64",   0x14000, 0x2000, CRC(57a94c6f) SHA1(fc27fe805c4cc29f797bfc0e4cd13a570ac5c1ec) )
1242   ROM_LOAD( "fxd-4c.64",   0x16000, 0x2000, CRC(9036c5a2) SHA1(b7a01e4002f615702cb691764cfae93707bf3c0f) )
1243   ROM_LOAD( "fxd-5c.64",   0x18000, 0x2000, CRC(38c03405) SHA1(c490252825dc3c4bf91255c7cb70a5ead92de85b) )
1244   ROM_LOAD( "fxd-6c.64",   0x1a000, 0x2000, CRC(f48fc308) SHA1(bfaf43e57a4d92b593d51d8cd61fe4d5c06e836c) )
1245   ROM_LOAD( "fxd-7c.64",   0x1c000, 0x2000, CRC(cf93b924) SHA1(892e6e6aa33bbcd271f5e0a63c1e8393df62f360) )
1246   ROM_LOAD( "fxd-8c.64",   0x1e000, 0x2000, CRC(607b48da) SHA1(6c8f2f207f3dd936c529b86cef917a0f0699a21c) )
1247   ROM_LOAD( "fxd-1b.64",   0x20000, 0x2000, CRC(62872d4f) SHA1(c020fdeae6c2e7d04c16048fdaa99ecf3e40af31) )
1248   ROM_LOAD( "fxd-2b.64",   0x22000, 0x2000, CRC(625778d0) SHA1(6c8d6b50653bff3774f5ccef0e000a2ef3f7030c) )
1249   ROM_LOAD( "fxd-3b.64",   0x24000, 0x2000, CRC(c3473dee) SHA1(8675f9b93bbbae4f5a5682c5b1623afeeacc0a4b) )
1250   ROM_LOAD( "fxd-4b.64",   0x26000, 0x2000, CRC(e39a15f5) SHA1(43b04cc2e4750b649116ade5b1004c2580293134) )
1251   ROM_LOAD( "fxd-5b.64",   0x28000, 0x2000, CRC(101a9d70) SHA1(2b839cd707e03b0e50037e1ffabcb8fe375dc4c0) )
1252   ROM_LOAD( "fxd-6b.64",   0x2a000, 0x2000, CRC(374a8f05) SHA1(ec41470932823242fff36ab6e6f158fa5c07d0a8) )
1253   ROM_LOAD( "fxd-7b.64",   0x2c000, 0x2000, CRC(f7e7f824) SHA1(1bed1ee07032b25675ace612a883cba4ab4b2f77) )
1254   ROM_LOAD( "fxd-8b.64",   0x2e000, 0x2000, CRC(8f1a5287) SHA1(a1102d49bacb25887eaa67ae64bcf64c8cad94fe) )
1255   ROM_LOAD( "fxd-1a.64",   0x30000, 0x2000, CRC(fc5e6344) SHA1(c61aad5100819f2fe98c3a159b64739fa6322d09) )
1256   ROM_LOAD( "fxd-2a.64",   0x32000, 0x2000, CRC(43cf60b3) SHA1(5169196d0a95450801b3a57703cb9f2861a25948) )
1257   ROM_LOAD( "fxd-3a.64",   0x34000, 0x2000, CRC(6b7d29cb) SHA1(fd4006efd24b33f8e2baf7f97d4b776d5ef90959) )
1258   ROM_LOAD( "fxd-4a.64",   0x36000, 0x2000, CRC(b9de3c2d) SHA1(229f9f0762d4d659acf516c2c1a42e70d2f98652) )
1259   ROM_LOAD( "fxd-5a.64",   0x38000, 0x2000, CRC(67285bc6) SHA1(f929c916fb19dbc91fc3a75dfed6375b63cb2043) )
1260   ROM_LOAD( "fxd-6a.64",   0x3a000, 0x2000, CRC(ba67b7b2) SHA1(12265f678b1e4dfc3b36a964f78b0103112753ee) )
12611261   /* The last two ROM sockets were apparently never populated */
1262//  ROM_LOAD( "fxd-7a.64",  0x3c000, 0x2000, NO_DUMP )
1263//  ROM_LOAD( "fxd-8a.64",  0x3e000, 0x2000, NO_DUMP )
1262//  ROM_LOAD( "fxd-7a.64",   0x3c000, 0x2000, NO_DUMP )
1263//  ROM_LOAD( "fxd-8a.64",   0x3e000, 0x2000, NO_DUMP )
12641264
1265   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1265   ROM_REGION( 0x8000, REGION_CPU2, 0 )
12661266   ROM_LOAD( "fxa2-5a.16",   0x6800, 0x0800, CRC(7c525aec) SHA1(f3afd3bfc0ba4265106e6ca217d113d23ad66016) )
12671267   ROM_LOAD( "fxa2-6a.16",   0x7000, 0x0800, CRC(2b3bfc44) SHA1(7e3b9133916c8121b2145942155601b3ade420da) )
12681268   ROM_LOAD( "fxa2-7a.16",   0x7800, 0x0800, CRC(578c62b7) SHA1(1bcb987e8730c001b7339c3dfab2467bf76421c7) )
r1527r1528
12711271   ROM_LOAD( "fxl1-11d.32",  0x0000, 0x0800, CRC(62083db2) SHA1(0c6e90b73419bff53f991e66d4faa9495c7d8e09) )
12721272ROM_END
12731273
1274
12741275ROM_START( fax2 )
1275   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 64k for code + 192k for extra memory */
1276   ROM_LOAD( "fxl8-13a.32",  0x8000, 0x1000, CRC(8e30bf6b) SHA1(1fdf010da0258bc038554cf33c26e539a1f6b648) )
1277   ROM_LOAD( "fxl8-12a.32",  0x9000, 0x1000, CRC(60a41ff1) SHA1(1703dbedd09354d89c6014644d0ffe13ec657b8b) )
1278   ROM_LOAD( "fxl8-11a.32",  0xA000, 0x1000, CRC(2c9cee8a) SHA1(169045b4d840730cfbaa0b9a8a8d82907ea09d0c) )
1279   ROM_LOAD( "fxl8-10a.32",  0xB000, 0x1000, CRC(9b03938f) SHA1(af4c27b06a1f1be917316910b88d026b67cc60c0) )
1280   ROM_LOAD( "fxl8-9a.32",   0xC000, 0x1000, CRC(fb869f62) SHA1(cea6ff423c60662a1b36e9565940432707d5299b) )
1281   ROM_LOAD( "fxl8-8a.32",   0xD000, 0x1000, CRC(db3470bc) SHA1(7786f84ab41765ea91ab241d14a207044eda0e93) )
1282   ROM_LOAD( "fxl8-7a.32",   0xE000, 0x1000, CRC(1471fef5) SHA1(89308f3c2a0d7ea699e99622d37c5c95e3eaaf95) )
1283   ROM_LOAD( "fxl8-6a.32",   0xF000, 0x1000, CRC(812e39f3) SHA1(41c99f8483c69617f9c8dd82f979630ea9190454) )
1276   ROM_REGION( 0x40000, REGION_CPU1, 0 )
1277   ROM_LOAD( "fxl8-13a.32",  0x08000, 0x1000, CRC(8e30bf6b) SHA1(1fdf010da0258bc038554cf33c26e539a1f6b648) )
1278   ROM_LOAD( "fxl8-12a.32",  0x09000, 0x1000, CRC(60a41ff1) SHA1(1703dbedd09354d89c6014644d0ffe13ec657b8b) )
1279   ROM_LOAD( "fxl8-11a.32",  0x0a000, 0x1000, CRC(2c9cee8a) SHA1(169045b4d840730cfbaa0b9a8a8d82907ea09d0c) )
1280   ROM_LOAD( "fxl8-10a.32",  0x0b000, 0x1000, CRC(9b03938f) SHA1(af4c27b06a1f1be917316910b88d026b67cc60c0) )
1281   ROM_LOAD( "fxl8-9a.32",   0x0c000, 0x1000, CRC(fb869f62) SHA1(cea6ff423c60662a1b36e9565940432707d5299b) )
1282   ROM_LOAD( "fxl8-8a.32",   0x0d000, 0x1000, CRC(db3470bc) SHA1(7786f84ab41765ea91ab241d14a207044eda0e93) )
1283   ROM_LOAD( "fxl8-7a.32",   0x0e000, 0x1000, CRC(1471fef5) SHA1(89308f3c2a0d7ea699e99622d37c5c95e3eaaf95) )
1284   ROM_LOAD( "fxl8-6a.32",   0x0f000, 0x1000, CRC(812e39f3) SHA1(41c99f8483c69617f9c8dd82f979630ea9190454) )
12841285   /* Banks of question ROMs */
12851286   ROM_LOAD( "fxdb1-1c.bin", 0x10000, 0x2000, CRC(0e42a2a4) SHA1(f7021aad36b49338cdaae8e13638dbdd12327afc) )
12861287   ROM_LOAD( "fxdb1-2c.bin", 0x12000, 0x2000, CRC(cef8d49a) SHA1(a3005ab21add22ffb4c6f4cb9843db8964fef49c) )
r1527r1528
13071308   ROM_LOAD( "fxdb1-7a.bin", 0x3c000, 0x2000, CRC(0f97b874) SHA1(5790d3ed9eed2ce05947bc28cc252f720a7f3aeb) )
13081309   ROM_LOAD( "fxdb1-8a.bin", 0x3e000, 0x2000, CRC(1d055bea) SHA1(96531db0a3a36319bc0a28096e601302eb2eb115) )
13091310
1310   ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* 32k for audio */
1311   ROM_LOAD( "fxa2-5a.16",   0x6800, 0x0800, CRC(7c525aec) SHA1(f3afd3bfc0ba4265106e6ca217d113d23ad66016) )
1312   ROM_LOAD( "fxa2-6a.16",   0x7000, 0x0800, CRC(2b3bfc44) SHA1(7e3b9133916c8121b2145942155601b3ade420da) )
1313   ROM_LOAD( "fxa2-7a.16",   0x7800, 0x0800, CRC(578c62b7) SHA1(1bcb987e8730c001b7339c3dfab2467bf76421c7) )
1311   ROM_REGION( 0x8000, REGION_CPU2, 0 )
1312   ROM_LOAD( "fxa2-5a.16",    0x6800, 0x0800, CRC(7c525aec) SHA1(f3afd3bfc0ba4265106e6ca217d113d23ad66016) )
1313   ROM_LOAD( "fxa2-6a.16",    0x7000, 0x0800, CRC(2b3bfc44) SHA1(7e3b9133916c8121b2145942155601b3ade420da) )
1314   ROM_LOAD( "fxa2-7a.16",    0x7800, 0x0800, CRC(578c62b7) SHA1(1bcb987e8730c001b7339c3dfab2467bf76421c7) )
13141315
13151316   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
1316   ROM_LOAD( "fxl1-11d.32",  0x0000, 0x0800, CRC(62083db2) SHA1(0c6e90b73419bff53f991e66d4faa9495c7d8e09) )
1317   ROM_LOAD( "fxl1-11d.32",  0x0000, 0x0800, CRC(62083db2) SHA1(0c6e90b73419bff53f991e66d4faa9495c7d8e09) )
13171318ROM_END
13181319
13191320
r1527r1528
13271328static DRIVER_INIT( sidetrac )
13281329{
13291330   exidy_video_config(0x00, 0x00, FALSE);
1330   targ_spec_flag = 0;
13311331
13321332   /* hard-coded palette controlled via 8x3 DIP switches on the board */
13331333   exidy_color_latch[2] = 0xf8;
r1527r1528
13391339static DRIVER_INIT( targ )
13401340{
13411341   exidy_video_config(0x00, 0x00, FALSE);
1342   targ_spec_flag = 1;
13431342
13441343   /* hard-coded palette controlled via 8x3 DIP switches on the board */
13451344   exidy_color_latch[2] = 0x5c;
r1527r1528
13511350static DRIVER_INIT( spectar )
13521351{
13531352   exidy_video_config(0x00, 0x00, FALSE);
1354   targ_spec_flag = 0;
13551353
13561354   /* hard-coded palette controlled via 8x3 DIP switches on the board */
13571355   exidy_color_latch[2] = 0x58;
r1527r1528
13621360static DRIVER_INIT( rallys )
13631361{
13641362   exidy_video_config(0x00, 0x00, FALSE);
1365   targ_spec_flag = 0;
13661363
13671364   /* hard-coded palette controlled via 8x3 DIP switches on the board */
13681365   exidy_color_latch[2] = 0x58;
13691366   exidy_color_latch[1] = 0xee;
13701367   exidy_color_latch[0] = 0x09;
1371
1372   /* sprite locations are slightly different */
1373   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, exidy_sprite1_xpos_w);
1374   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5001, 0x5001, 0, 0, exidy_sprite1_ypos_w);
1375   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5300, 0x5300, 0, 0, exidy_sprite2_xpos_w);
1376   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5301, 0x5301, 0, 0, exidy_sprite2_ypos_w);
13771368}
13781369
13791370static DRIVER_INIT( phantoma )
13801371{
13811372   exidy_video_config(0x00, 0x00, FALSE);
1382   targ_spec_flag = 0;
13831373
13841374   /* hard-coded palette controlled via 8x3 DIP switches on the board */
13851375   exidy_color_latch[2] = 0x58;
13861376   exidy_color_latch[1] = 0xee;
13871377   exidy_color_latch[0] = 0x09;
13881378
1389   /* sprite locations are slightly different */
1390   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5000, 0, 0, exidy_sprite1_xpos_w);
1391   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5001, 0x5001, 0, 0, exidy_sprite1_ypos_w);
1392   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5300, 0x5300, 0, 0, exidy_sprite2_xpos_w);
1393   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5301, 0x5301, 0, 0, exidy_sprite2_ypos_w);
1394
13951379   /* the ROM is actually mapped high */
13961380   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xf800, 0xffff, 0, 0, MRA8_BANK1);
13971381   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0xf800);
r1527r1528
14011385static DRIVER_INIT( mtrap )
14021386{
14031387   exidy_video_config(0x14, 0x00, FALSE);
1404   targ_spec_flag = 0;
14051388}
14061389
14071390
14081391static DRIVER_INIT( venture )
14091392{
14101393   exidy_video_config(0x04, 0x04, FALSE);
1411   targ_spec_flag = 0;
14121394}
14131395
14141396
14151397static DRIVER_INIT( teetert )
14161398{
14171399   exidy_video_config(0x0c, 0x0c, FALSE);
1418   targ_spec_flag = 0;
1419
1420   /* special input handler for the dial */
1421   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5101, 0x5101, 0, 0, teetert_input_r);
14221400}
14231401
14241402
14251403static DRIVER_INIT( pepper2 )
14261404{
14271405   exidy_video_config(0x14, 0x04, TRUE);
1428   targ_spec_flag = 0;
1429
1430   /* two 6116 character RAMs */
1431   exidy_characterram = memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_RAM);
1432   exidy_characterram = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MWA8_RAM);
1433   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, MRA8_NOP);
1434   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, MWA8_NOP);
14351406}
14361407
14371408
14381409static DRIVER_INIT( fax )
14391410{
14401411   exidy_video_config(0x04, 0x04, TRUE);
1441   targ_spec_flag = 0;
14421412
14431413   /* reset the ROM bank */
14441414   fax_bank_select_w(0,0);
r1527r1528
14521422 *
14531423 *************************************/
14541424
1455GAME( 1979, sidetrac, 0,       sidetrac, sidetrac, sidetrac, ROT0, "Exidy", "Side Trak", 0 )
1425GAME( 1979, sidetrac, 0,       sidetrac, sidetrac, sidetrac, ROT0, "Exidy", "Side Track", 0 )
14561426GAME( 1980, targ,     0,       targ,     targ,     targ,     ROT0, "Exidy", "Targ", 0 )
14571427GAME( 1980, targc,    targ,    targ,     targ,     targ,     ROT0, "Exidy", "Targ (cocktail?)", 0 )
1458GAME( 1980, spectar,  0,       targ,     spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 3)", 0 )
1459GAME( 1980, spectar1, spectar, targ,     spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 1?)", 0 )
1460GAME( 1980, rallys,   spectar, targ,     rallys,   rallys,   ROT0, "Novar", "Rallys (bootleg?)", 0 )
1461GAME( 1980, phantoma, spectar, targ,     phantoma, phantoma, ROT0, "Jeutel","Phantomas", 0 )
1428GAME( 1980, spectar,  0,       spectar,  spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 3)", 0 )
1429GAME( 1980, spectar1, spectar, spectar,  spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 1?)", 0 )
1430GAME( 1980, rallys,   spectar, rallys,   rallys,   rallys,   ROT0, "Novar", "Rallys (bootleg?)", 0 )
1431GAME( 1980, phantoma, spectar, rallys,   phantoma, phantoma, ROT0, "Jeutel","Phantomas", 0 )
14621432
14631433GAME( 1981, mtrap,    0,       mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 5)", 0 )
14641434GAME( 1981, mtrap3,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 3)", 0 )
src/mame/drivers/gladiatr.c
r1527r1528
679679static MACHINE_DRIVER_START( ppking )
680680
681681   /* basic machine hardware */
682   MDRV_CPU_ADD(Z80, 12000000/2) /* 6 MHz */
682   MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */
683683   MDRV_CPU_PROGRAM_MAP(ppking_cpu1_map,0)
684684   MDRV_CPU_IO_MAP(ppking_cpu1_io,0)
685685   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
686686
687   MDRV_CPU_ADD(Z80, 12000000/4) /* 3 MHz */
687   MDRV_CPU_ADD(Z80, XTAL_12MHz/4) /* verified on pcb */
688688   MDRV_CPU_PROGRAM_MAP(cpu2_map,0)
689689   MDRV_CPU_IO_MAP(ppking_cpu2_io,0)
690690   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
691691
692   MDRV_CPU_ADD(M6809, 12000000/16) /* 750 kHz */
692   MDRV_CPU_ADD(M6809, XTAL_12MHz/16) /* verified on pcb */
693693   /* audio CPU */
694694   MDRV_CPU_PROGRAM_MAP(ppking_cpu3_map,0)
695695
r1527r1528
713713   /* sound hardware */
714714   MDRV_SPEAKER_STANDARD_MONO("mono")
715715
716   MDRV_SOUND_ADD(YM2203, 12000000/8)
716   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/8) /* verified on pcb */
717717   MDRV_SOUND_CONFIG(ppking_ym2203_interface)
718718   MDRV_SOUND_ROUTE(0, "mono", 0.60)
719719   MDRV_SOUND_ROUTE(1, "mono", 0.60)
720720   MDRV_SOUND_ROUTE(2, "mono", 0.60)
721721   MDRV_SOUND_ROUTE(3, "mono", 0.50)
722722
723   MDRV_SOUND_ADD(MSM5205, 12000000/32)
723   MDRV_SOUND_ADD(MSM5205, XTAL_455kHz) /* verified on pcb */
724724   MDRV_SOUND_CONFIG(msm5205_interface)
725725   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
726726MACHINE_DRIVER_END
r1527r1528
728728static MACHINE_DRIVER_START( gladiatr )
729729
730730   /* basic machine hardware */
731   MDRV_CPU_ADD(Z80, 12000000/2) /* 6 MHz */
731   MDRV_CPU_ADD(Z80, XTAL_12MHz/2) /* verified on pcb */
732732   MDRV_CPU_PROGRAM_MAP(gladiatr_cpu1_map,0)
733733   MDRV_CPU_IO_MAP(gladiatr_cpu1_io,0)
734734   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
735735
736   MDRV_CPU_ADD(Z80, 12000000/4) /* 3 MHz */
736   MDRV_CPU_ADD(Z80, XTAL_12MHz/4) /* verified on pcb */
737737   MDRV_CPU_PROGRAM_MAP(cpu2_map,0)
738738   MDRV_CPU_IO_MAP(gladiatr_cpu2_io,0)
739739
740   MDRV_CPU_ADD(M6809, 12000000/16) /* 750 kHz */
740   MDRV_CPU_ADD(M6809, XTAL_12MHz/16) /* verified on pcb */
741741   /* audio CPU */
742742   MDRV_CPU_PROGRAM_MAP(gladiatr_cpu3_map,0)
743743
r1527r1528
762762   /* sound hardware */
763763   MDRV_SPEAKER_STANDARD_MONO("mono")
764764
765   MDRV_SOUND_ADD(YM2203, 12000000/8)
765   MDRV_SOUND_ADD(YM2203, XTAL_12MHz/8) /* verified on pcb */
766766   MDRV_SOUND_CONFIG(gladiatr_ym2203_interface)
767767   MDRV_SOUND_ROUTE(0, "mono", 0.60)
768768   MDRV_SOUND_ROUTE(1, "mono", 0.60)
769769   MDRV_SOUND_ROUTE(2, "mono", 0.60)
770770   MDRV_SOUND_ROUTE(3, "mono", 0.50)
771771
772   MDRV_SOUND_ADD(MSM5205, 12000000/32)
772   MDRV_SOUND_ADD(MSM5205, XTAL_455kHz) /* verified on pcb */
773773   MDRV_SOUND_CONFIG(msm5205_interface)
774774   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
775775MACHINE_DRIVER_END
src/mame/drivers/imolagp.c
r1527r1528
131131static void
132132InitializeColors( void )
133133{ /* optional runtime remapping of colors */
134   const UINT8 color[0x10][3] =
134   static const UINT8 color[0x10][3] =
135135   { /* wrong! need color-accurate screenshots to fix */
136136      { 0x44,0x44,0x00 },
137137      { 0x7f,0xff,0xff },
src/mame/drivers/skychut.c
r1527r1528
173173 *              0x06: SAUCER HIT
174174 */
175175
176WRITE8_HANDLER( iremm10_ctrl_w )
176static WRITE8_HANDLER( iremm10_ctrl_w )
177177{
178178   irem_state *state = Machine->driver_data;
179179
r1527r1528
250250 *              Will be updated only in attract mode
251251 */
252252
253WRITE8_HANDLER( iremm11_ctrl_w )
253static WRITE8_HANDLER( iremm11_ctrl_w )
254254{
255255   irem_state *state = Machine->driver_data;
256256
r1527r1528
283283 *              Will be updated only in attract mode
284284 */
285285
286WRITE8_HANDLER( iremm15_ctrl_w )
286static WRITE8_HANDLER( iremm15_ctrl_w )
287287{
288288   irem_state *state = Machine->driver_data;
289289
r1527r1528
311311 *              Will be updated only in attract mode
312312 */
313313
314WRITE8_HANDLER( iremm10_a500_w )
314static WRITE8_HANDLER( iremm10_a500_w )
315315{
316316#if DEBUG
317317   if (data & 0xFC)
r1527r1528
319319#endif
320320}
321321
322WRITE8_HANDLER( iremm11_a100_w )
322static WRITE8_HANDLER( iremm11_a100_w )
323323{
324324   static int last = 0x00;
325325   int raising_bits = data & ~last;
r1527r1528
353353
354354}
355355
356WRITE8_HANDLER( iremm15_a100_w )
356static WRITE8_HANDLER( iremm15_a100_w )
357357{
358358   static int last = 0x00;
359359   //int raising_bits = data & ~last;
r1527r1528
411411   last = data;
412412}
413413
414READ8_HANDLER( iremm10_a700_r )
414static READ8_HANDLER( iremm10_a700_r )
415415{
416416      //printf("rd:%d\n",video_screen_get_vpos(0));
417417   cpunum_set_input_line(0, 0, CLEAR_LINE);
418418   return 0x00;
419419}
420420
421READ8_HANDLER( iremm11_a700_r )
421static READ8_HANDLER( iremm11_a700_r )
422422{
423423      //printf("rd:%d\n",video_screen_get_vpos(0));
424424   return 0x00;
r1527r1528
430430 *
431431 *************************************/
432432
433TIMER_CALLBACK( skychut_callback )
433static TIMER_CALLBACK( skychut_callback )
434434{
435435    if (param==0)
436436    {
r1527r1528
447447
448448}
449449
450INTERRUPT_GEN( iremm11_interrupt )
450static INTERRUPT_GEN( iremm11_interrupt )
451451{
452452   if (readinputport(2) & 1)   /* Left Coin */
453453        cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
r1527r1528
458458    }
459459}
460460
461INTERRUPT_GEN( iremm10_interrupt )
461static INTERRUPT_GEN( iremm10_interrupt )
462462{
463463   if (readinputport(2) & 1)   /* Left Coin */
464464        cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
r1527r1528
466466      cpunum_set_input_line(0, 0, ASSERT_LINE);
467467}
468468
469INTERRUPT_GEN( iremm15_interrupt )
469static INTERRUPT_GEN( iremm15_interrupt )
470470{
471471   if (readinputport(2) & 1)   /* Left Coin */
472472        cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
r1527r1528
486486static ADDRESS_MAP_START( iremm10_main, ADDRESS_SPACE_PROGRAM, 8 )
487487   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(irem_state, memory) /* scratch ram */
488488   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(irem_state, rom)
489   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
489   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
490490   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
491491   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(irem_state, chargen) /* background ????? */
492492   AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r)
r1527r1528
500500static ADDRESS_MAP_START( iremm11_main, ADDRESS_SPACE_PROGRAM, 8 )
501501   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(irem_state, memory) /* scratch ram */
502502   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(irem_state, rom)
503   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
503   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
504504   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
505505   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(irem_state, chargen) /* background ????? */
506506   AM_RANGE(0xa100, 0xa100) AM_WRITE(iremm11_a100_w) /* sound writes ???? */
r1527r1528
514514static ADDRESS_MAP_START( iremm15_main, ADDRESS_SPACE_PROGRAM, 8 )
515515   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(irem_state, memory) /* scratch ram */
516516   AM_RANGE(0x1000, 0x33ff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(irem_state, rom)
517   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
517   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
518518   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
519519   AM_RANGE(0x5000, 0x57ff) AM_READWRITE(MRA8_RAM, iremm15_chargen_w) AM_BASE_MEMBER(irem_state, chargen) /* background ????? */
520520   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_3_r)
r1527r1528
543543   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
544544
545545
546INPUT_PORTS_START( skychut )
546static INPUT_PORTS_START( skychut )
547547   PORT_START
548548   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
549549   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
r1527r1528
584584   CAB_PORTENV
585585INPUT_PORTS_END
586586
587INPUT_PORTS_START( ipminvad )
587static INPUT_PORTS_START( ipminvad )
588588   PORT_START
589589   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
590590   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
r1527r1528
625625   CAB_PORTENV
626626INPUT_PORTS_END
627627
628INPUT_PORTS_START( spacebeam )
628static INPUT_PORTS_START( spacebeam )
629629   PORT_START
630630   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
631631   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
r1527r1528
659659   CAB_PORTENV
660660INPUT_PORTS_END
661661
662INPUT_PORTS_START( headoni )
662static INPUT_PORTS_START( headoni )
663663   PORT_START
664664   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
665665   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
src/mame/drivers/gyruss.c
r1527r1528
377377   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
378378   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
379379
380   MDRV_CPU_ADD(I8039,8000000/15)
380   MDRV_CPU_ADD(I8039,8000000)
381381   /* audio CPU */   /* 8MHz crystal */
382382   MDRV_CPU_PROGRAM_MAP(i8039_readmem,i8039_writemem)
383383   MDRV_CPU_IO_MAP(i8039_readport,i8039_writeport)
src/mame/drivers/cabal.c
r1527r1528
513513GFXDECODE_END
514514
515515
516static const struct YM2151interface ym2151_interface =
517{
518   seibu_ym3812_irqhandler
519};
520
521516static void irqhandler(int irq)
522517{
523518   cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
r1527r1528
528523   irqhandler
529524};
530525
531SEIBU_SOUND_SYSTEM_ADPCM_HARDWARE
532
533526static const struct MSM5205interface msm5205_interface_1 =
534527{
535528   0,
r1527r1528
573566   MDRV_SPEAKER_STANDARD_MONO("mono")
574567
575568   MDRV_SOUND_ADD(YM2151, 3579580) /* verified on pcb */
576   MDRV_SOUND_CONFIG(ym2151_interface)
569   MDRV_SOUND_CONFIG(seibu_ym2151_interface)
577570   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.80)
578571
579572   MDRV_SOUND_ADD(CUSTOM, 8000)
580   MDRV_SOUND_CONFIG(adpcm_interface)
573   MDRV_SOUND_CONFIG(seibu_adpcm_interface)
581574   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.40)
582575
583
584576   MDRV_SOUND_ADD(CUSTOM, 8000)
585   MDRV_SOUND_CONFIG(adpcm_interface)
577   MDRV_SOUND_CONFIG(seibu_adpcm_interface)
586578   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.40)
587579MACHINE_DRIVER_END
588580
src/mame/drivers/tickee.c
r1527r1528
1818#include "cpu/tms34010/tms34010.h"
1919#include "machine/ticket.h"
2020#include "video/tlc34076.h"
21#include "tickee.h"
2221#include "sound/ay8910.h"
2322
2423
25UINT16 *tickee_control;
24#define CPU_CLOCK         XTAL_40MHz
25#define VIDEO_CLOCK         XTAL_14_31818MHz
2626
2727
2828
29/* local variables */
30static UINT16 *tickee_control;
31static UINT16 *tickee_vram;
32static emu_timer *setup_gun_timer;
33
34
35
2936/*************************************
3037 *
38 *  Compute X/Y coordinates
39 *
40 *************************************/
41
42INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
43{
44   *x = (((readinputport(4 + player * 2) & 0xff) * (machine->screen[0].visarea.max_x - machine->screen[0].visarea.min_x)) >> 8) + machine->screen[0].visarea.min_x;
45   *y = (((readinputport(5 + player * 2) & 0xff) * (machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y)) >> 8) + machine->screen[0].visarea.min_y;
46}
47
48
49
50/*************************************
51 *
52 *  Light gun interrupts
53 *
54 *************************************/
55
56static TIMER_CALLBACK( trigger_gun_interrupt )
57{
58   /* fire the IRQ at the correct moment */
59   cpunum_set_input_line(0, param, ASSERT_LINE);
60}
61
62
63static TIMER_CALLBACK( clear_gun_interrupt )
64{
65   /* clear the IRQ on the next scanline? */
66   cpunum_set_input_line(0, param, CLEAR_LINE);
67}
68
69
70static TIMER_CALLBACK( setup_gun_interrupts )
71{
72   int beamx, beamy;
73
74   /* 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);
76
77   /* only do work if the palette is flashed */
78   if (!tickee_control[2])
79      return;
80
81   /* generate interrupts for player 1's gun */
82   get_crosshair_xy(machine, 0, &beamx, &beamy);
83   timer_set(video_screen_get_time_until_pos(0, beamy,     beamx + 50), NULL, 0, trigger_gun_interrupt);
84   timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 0, clear_gun_interrupt);
85
86   /* generate interrupts for player 2's gun */
87   get_crosshair_xy(machine, 1, &beamx, &beamy);
88   timer_set(video_screen_get_time_until_pos(0, beamy,     beamx + 50), NULL, 1, trigger_gun_interrupt);
89   timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 1, clear_gun_interrupt);
90}
91
92
93
94/*************************************
95 *
96 *  Video startup
97 *
98 *************************************/
99
100static VIDEO_START( tickee )
101{
102   /* start a timer going on the first scanline of every frame */
103   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);
105}
106
107
108
109/*************************************
110 *
111 *  Video update
112 *
113 *************************************/
114
115static void scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
116{
117   UINT16 *src = &tickee_vram[(params->rowaddr << 8) & 0x3ff00];
118   UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
119   const rgb_t *pens = tlc34076_get_pens();
120   int coladdr = params->coladdr << 1;
121   int x;
122
123   /* blank palette: fill with pen 255 */
124   if (tickee_control[2])
125   {
126      for (x = params->heblnk; x < params->hsblnk; x++)
127         dest[x] = pens[0xff];
128   }
129   else
130      /* copy the non-blanked portions of this scanline */
131      for (x = params->heblnk; x < params->hsblnk; x += 2)
132      {
133         UINT16 pixels = src[coladdr++ & 0xff];
134         dest[x + 0] = pens[pixels & 0xff];
135         dest[x + 1] = pens[pixels >> 8];
136      }
137}
138
139
140/*************************************
141 *
31142 *  Machine init
32143 *
33144 *************************************/
r1527r1528
285396{
286397   FALSE,                     /* halt on reset */
287398   0,                        /* the screen operated on */
288   14318180/2,                  /* pixel clock */
399   VIDEO_CLOCK/2,               /* pixel clock */
289400   1,                        /* pixels per clock */
290   tickee_scanline_update,         /* scanline callback */
401   scanline_update,            /* scanline callback */
291402   NULL,                     /* generate interrupt */
292403   NULL,                     /* write to shiftreg function */
293404   NULL                     /* read from shiftreg function */
r1527r1528
304415static MACHINE_DRIVER_START( tickee )
305416
306417   /* basic machine hardware */
307   MDRV_CPU_ADD_TAG("main", TMS34010, 40000000/TMS34010_CLOCK_DIVIDER)
418   MDRV_CPU_ADD_TAG("main", TMS34010, XTAL_40MHz)
308419   MDRV_CPU_CONFIG(tms_config)
309420   MDRV_CPU_PROGRAM_MAP(tickee_map,0)
310421
r1527r1528
313424
314425   /* video hardware */
315426   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
316   MDRV_PALETTE_LENGTH(256)
427   MDRV_VIDEO_START(tickee)
428   MDRV_VIDEO_UPDATE(tms340x0)
317429
318430   MDRV_SCREEN_ADD("main", 0)
319   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
320   MDRV_SCREEN_RAW_PARAMS(14318180/2, 444, 0, 320, 233, 0, 200)
431   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
432   MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 444, 0, 320, 233, 0, 200)
321433
322   MDRV_VIDEO_START(tickee)
323   MDRV_VIDEO_UPDATE(tms340x0)
324
325434   /* sound hardware */
326435   MDRV_SPEAKER_STANDARD_MONO("mono")
327436
328   MDRV_SOUND_ADD(AY8910, 14318180/8)
437   MDRV_SOUND_ADD(YM2149, VIDEO_CLOCK/8)
329438   MDRV_SOUND_CONFIG(ay8910_interface_1)
330439   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
331440
332   MDRV_SOUND_ADD(AY8910, 14318180/8)
441   MDRV_SOUND_ADD(YM2149, VIDEO_CLOCK/8)
333442   MDRV_SOUND_CONFIG(ay8910_interface_2)
334443   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
335444MACHINE_DRIVER_END
src/mame/drivers/m92.c
r1527r1528
297297   }
298298}
299299
300static UINT32 m92_sprite_busy_r(void *param)
300static CUSTOM_INPUT( m92_sprite_busy_r )
301301{
302302   return m92_sprite_buffer_busy;
303303}
src/mame/drivers/fcombat.c
r1527r1528
207207static ADDRESS_MAP_START( fcombat_writemem, ADDRESS_SPACE_PROGRAM, 8 )
208208   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
209209   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
210   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
210   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
211211   AM_RANGE(0xd800, 0xd8ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
212212
213213   AM_RANGE(0xe800, 0xe800) AM_WRITE(fcombat_videoreg_w)   // at least bit 0 for flip screen and joystick input multiplexor
src/mame/drivers/m92.h
r1527r1528
66
77*******************************************************************************/
88
9/* Player 1 and 2 have the same IN */
10#define IREM_JOYSTICK_1_2(_n_) \
11   PORT_START   \
12   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(_n_) \
13   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(_n_) \
14   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(_n_) \
15   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(_n_) \
16   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) \
17   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) \
18   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(_n_) \
19   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(_n_)
20
219#define IREM_JOYSTICKS_1_2 \
2210   PORT_START_TAG("JOY12")   \
2311   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) \
r1527r1528
3725   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) \
3826   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3927
40/* Player 3 and 4 have IN similar to Player 1 and 2, but have the COIN and START buttons */
41#define IREM_JOYSTICK_3_4(_n_) \
42   PORT_START   \
43   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(_n_) \
44   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(_n_) \
45   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(_n_) \
46   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(_n_) \
47   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START##_n_ ) /* If common slots, Coin3 if separate */ \
48   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN##_n_ ) \
49   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(_n_) \
50   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(_n_)
51
5228#define IREM_JOYSTICKS_3_4 \
5329   PORT_START_TAG("JOY34")   \
5430   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) \
r1527r1528
130106   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) ) \
131107   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
132108
133
134#define IREM_SYSTEM_DIPSWITCH_4PLAYERS \
135   PORT_START \
136   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) \
137   PORT_DIPSETTING(    0x01, DEF_STR( Off ) ) \
138   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
139   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) \
140   PORT_DIPSETTING(    0x02, "2 Players" ) \
141   PORT_DIPSETTING(    0x00, "4 Players" ) \
142   PORT_DIPNAME( 0x04, 0x04, "Coin Slots" ) \
143   PORT_DIPSETTING(    0x04, "Common" ) \
144   PORT_DIPSETTING(    0x00, "Separate" ) \
145   PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) /* Default 1 */ \
146   PORT_DIPSETTING(    0x08, "1" ) \
147   PORT_DIPSETTING(    0x00, "2" ) \
148   IREM_COIN_MODE_1_NEW
149
150#define IREM_SYSTEM_DIPSWITCH_3PLAYERS \
151   PORT_START \
152   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) \
153   PORT_DIPSETTING(    0x01, DEF_STR( Off ) ) \
154   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
155   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) \
156   PORT_DIPSETTING(    0x02, "2 Players" ) \
157   PORT_DIPSETTING(    0x00, "3 Players" ) \
158   PORT_DIPNAME( 0x04, 0x04, "Coin Slots" ) \
159   PORT_DIPSETTING(    0x04, "Common" ) \
160   PORT_DIPSETTING(    0x00, "Separate" ) \
161   PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) /* Default 1 */ \
162   PORT_DIPSETTING(    0x08, "1" ) \
163   PORT_DIPSETTING(    0x00, "2" ) \
164   IREM_COIN_MODE_1_NEW
165
166#define IREM_SYSTEM_DIPSWITCH_CABINET \
167   PORT_START \
168   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) \
169   PORT_DIPSETTING(    0x01, DEF_STR( Off ) ) \
170   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
171   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) \
172   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) ) \
173   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) ) \
174   PORT_DIPNAME( 0x04, 0x04, "Coin Slots" ) \
175   PORT_DIPSETTING(    0x04, "Common" ) \
176   PORT_DIPSETTING(    0x00, "Separate" ) \
177   PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) /* Default 1 */ \
178   PORT_DIPSETTING(    0x08, "1" ) \
179   PORT_DIPSETTING(    0x00, "2" ) \
180   IREM_COIN_MODE_1_NEW
181
182#define IREM_SYSTEM_DIPSWITCH \
183   PORT_START \
184   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) \
185   PORT_DIPSETTING(    0x01, DEF_STR( Off ) ) \
186   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
187   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) \
188   PORT_DIPSETTING(    0x02, DEF_STR( Off ) ) \
189   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
190   PORT_DIPNAME( 0x04, 0x04, "Coin Slots" ) \
191   PORT_DIPSETTING(    0x04, "Common" ) \
192   PORT_DIPSETTING(    0x00, "Separate" ) \
193   PORT_DIPNAME( 0x08, 0x08, "Coin Mode" ) /* Default 1 */ \
194   PORT_DIPSETTING(    0x08, "1" ) \
195   PORT_DIPSETTING(    0x00, "2" ) \
196   IREM_COIN_MODE_1_NEW
197
198#define IREM_COINS_SYSTEMDIPS(custom) \
199   PORT_START_TAG("COINS_DIPS")   \
200   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) \
201   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) \
202   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) \
203   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) \
204   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
205   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE )  \
206   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )  \
207   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(custom, 0) /* Actually vblank, handled above */ \
208   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) \
209   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) ) \
210   PORT_DIPSETTING(      0x0000, DEF_STR( On ) ) \
211   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) \
212   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) ) \
213   PORT_DIPSETTING(      0x0000, DEF_STR( On ) ) \
214   PORT_DIPNAME( 0x0400, 0x0400, "Coin Slots" ) \
215   PORT_DIPSETTING(      0x0400, "Common" ) \
216   PORT_DIPSETTING(      0x0000, "Separate" ) \
217   PORT_DIPNAME( 0x0800, 0x0800, "Coin Mode" ) /* Default 1 */ \
218   PORT_DIPSETTING(      0x0800, "1" ) \
219   PORT_DIPSETTING(      0x0000, "2" ) \
220   PORT_DIPNAME( 0xf000, 0xf000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:5,6,7,8") \
221   PORT_DIPSETTING(      0xa000, DEF_STR( 6C_1C ) ) \
222   PORT_DIPSETTING(      0xb000, DEF_STR( 5C_1C ) ) \
223   PORT_DIPSETTING(      0xc000, DEF_STR( 4C_1C ) ) \
224   PORT_DIPSETTING(      0xd000, DEF_STR( 3C_1C ) ) \
225   PORT_DIPSETTING(      0xe000, DEF_STR( 2C_1C ) ) \
226   PORT_DIPSETTING(      0x1000, "2 Coins to Start/1 to Continue") \
227   PORT_DIPSETTING(      0x3000, DEF_STR( 3C_2C ) ) \
228   PORT_DIPSETTING(      0x2000, DEF_STR( 4C_3C ) ) \
229   PORT_DIPSETTING(      0xf000, DEF_STR( 1C_1C ) ) \
230   PORT_DIPSETTING(      0x4000, DEF_STR( 2C_3C ) ) \
231   PORT_DIPSETTING(      0x9000, DEF_STR( 1C_2C ) ) \
232   PORT_DIPSETTING(      0x8000, DEF_STR( 1C_3C ) ) \
233   PORT_DIPSETTING(      0x7000, DEF_STR( 1C_4C ) ) \
234   PORT_DIPSETTING(      0x6000, DEF_STR( 1C_5C ) ) \
235   PORT_DIPSETTING(      0x5000, DEF_STR( 1C_6C ) ) \
236   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
237
238
239#define IREM_PORT_UNUSED \
240   PORT_START   \
241   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
242
src/mame/drivers/fuukifg2.c
r1527r1528
8888   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM               )   // ROM
8989   AM_RANGE(0x400000, 0x40ffff) AM_READ(MRA16_RAM               )   // RAM
9090   AM_RANGE(0x500000, 0x507fff) AM_READ(MRA16_RAM               )   // Layers
91   AM_RANGE(0x600000, 0x601fff) AM_READ(spriteram16_r            )   // Sprites
92   AM_RANGE(0x608000, 0x609fff) AM_READ(spriteram16_r            )   // Sprites (? Mirror ?)
91   AM_RANGE(0x600000, 0x601fff) AM_MIRROR(0x008000) AM_READ(MRA16_RAM   )   // Sprites, mirrored?
9392   AM_RANGE(0x700000, 0x703fff) AM_READ(MRA16_RAM               )   // Palette
9493   AM_RANGE(0x800000, 0x800001) AM_READ(input_port_0_word_r      )   // Buttons (Inputs)
9594   AM_RANGE(0x810000, 0x810001) AM_READ(input_port_1_word_r      )   // P1 + P2
r1527r1528
107106   AM_RANGE(0x504000, 0x505fff) AM_WRITE(fuuki16_vram_2_w) AM_BASE(&fuuki16_vram_2   )   //
108107   AM_RANGE(0x506000, 0x507fff) AM_WRITE(fuuki16_vram_3_w) AM_BASE(&fuuki16_vram_3   )   //
109108   AM_RANGE(0x506000, 0x507fff) AM_WRITE(MWA16_RAM                     )   //
110   AM_RANGE(0x600000, 0x601fff) AM_WRITE(spriteram16_w) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites
111   AM_RANGE(0x608000, 0x609fff) AM_WRITE(spriteram16_w                  )   // Sprites (? Mirror ?)
109   AM_RANGE(0x600000, 0x601fff) AM_MIRROR(0x008000) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites, mirrored?
112110   AM_RANGE(0x700000, 0x703fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16   )   // Palette
113111   AM_RANGE(0x8c0000, 0x8c001f) AM_WRITE(fuuki16_vregs_w) AM_BASE(&fuuki16_vregs )   // Video Registers
114112   AM_RANGE(0x8a0000, 0x8a0001) AM_WRITE(fuuki16_sound_command_w         )   // To Sound CPU
src/mame/drivers/zac2650.c
r1527r1528
1515#include "tinv2650.lh"
1616
1717WRITE8_HANDLER( tinvader_videoram_w );
18WRITE8_HANDLER( tinvader_sound_w );
18static WRITE8_HANDLER( tinvader_sound_w );
1919READ8_HANDLER( zac_s2636_r );
2020READ8_HANDLER( tinvader_port_0_r );
2121
r1527r1528
343343   /* sound hardware */
344344MACHINE_DRIVER_END
345345
346WRITE8_HANDLER( tinvader_sound_w )
346static WRITE8_HANDLER( tinvader_sound_w )
347347{
348348    /* sounds are NOT the same as space invaders */
349349
src/mame/drivers/ninjaw.c
r1527r1528
207207
208208static UINT16 cpua_ctrl = 0xff;
209209
210static size_t sharedram_size;
211static UINT16 *sharedram;
212
213
214static READ16_HANDLER( sharedram_r )
215{
216   return sharedram[offset];
217}
218
219static WRITE16_HANDLER( sharedram_w )
220{
221   COMBINE_DATA(&sharedram[offset]);
222}
223
224210static void parse_control(void)   /* assumes Z80 sandwiched between 68Ks */
225211{
226212   /* bit 0 enables cpu B */
r1527r1528
301287   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
302288   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
303289   AM_RANGE(0x220000, 0x220003) AM_READ(ninjaw_sound_r)
304   AM_RANGE(0x240000, 0x24ffff) AM_READ(sharedram_r)
305   AM_RANGE(0x260000, 0x263fff) AM_READ(MRA16_RAM)         /* sprite ram */
306290   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
307291   AM_RANGE(0x2a0000, 0x2a000f) AM_READ(TC0100SCN_ctrl_word_0_r)
308292   AM_RANGE(0x2c0000, 0x2d3fff) AM_READ(TC0100SCN_word_1_r)   /* tilemaps (2nd screen) */
r1527r1528
321305   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
322306   AM_RANGE(0x210000, 0x210001) AM_WRITE(cpua_ctrl_w)
323307   AM_RANGE(0x220000, 0x220003) AM_WRITE(ninjaw_sound_w)
324   AM_RANGE(0x240000, 0x24ffff) AM_WRITE(sharedram_w) AM_BASE(&sharedram) AM_SIZE(&sharedram_size)
325   AM_RANGE(0x260000, 0x263fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
308   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
309   AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE(2) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
326310   AM_RANGE(0x280000, 0x293fff) AM_WRITE(TC0100SCN_triple_screen_w)   /* tilemaps (all screens) */
327311   AM_RANGE(0x2a0000, 0x2a000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
328312   AM_RANGE(0x2c0000, 0x2d3fff) AM_WRITE(TC0100SCN_word_1_w)   /* tilemaps (2nd screen) */
r1527r1528
342326   AM_RANGE(0x080000, 0x08ffff) AM_READ(MRA16_RAM)   /* main ram */
343327   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
344328   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
345   AM_RANGE(0x240000, 0x24ffff) AM_READ(sharedram_r)
346   AM_RANGE(0x260000, 0x263fff) AM_READ(spriteram16_r)   /* sprite ram */
347329   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
348330   AM_RANGE(0x340000, 0x340007) AM_READ(TC0110PCR_word_r)      /* palette (1st screen) */
349331   AM_RANGE(0x350000, 0x350007) AM_READ(TC0110PCR_word_1_r)   /* palette (2nd screen) */
r1527r1528
355337   AM_RANGE(0x080000, 0x08ffff) AM_WRITE(MWA16_RAM)
356338   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
357339   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
358   AM_RANGE(0x240000, 0x24ffff) AM_WRITE(sharedram_w) AM_BASE(&sharedram)
359   AM_RANGE(0x260000, 0x263fff) AM_WRITE(spriteram16_w)
340   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
341   AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE(2)
360342   AM_RANGE(0x280000, 0x293fff) AM_WRITE(TC0100SCN_triple_screen_w)   /* tilemaps (all screens) */
361343   AM_RANGE(0x340000, 0x340007) AM_WRITE(TC0110PCR_step1_word_w)      /* palette (1st screen) */
362344   AM_RANGE(0x350000, 0x350007) AM_WRITE(TC0110PCR_step1_word_1_w)   /* palette (2nd screen) */
r1527r1528
370352   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
371353   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
372354   AM_RANGE(0x220000, 0x220003) AM_READ(ninjaw_sound_r)
373   AM_RANGE(0x240000, 0x24ffff) AM_READ(sharedram_r)
374   AM_RANGE(0x260000, 0x263fff) AM_READ(MRA16_RAM)   /* sprite ram */
375355   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
376356   AM_RANGE(0x2a0000, 0x2a000f) AM_READ(TC0100SCN_ctrl_word_0_r)
377357   AM_RANGE(0x2c0000, 0x2d3fff) AM_READ(TC0100SCN_word_1_r)   /* tilemaps (2nd screen) */
r1527r1528
390370   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
391371   AM_RANGE(0x210000, 0x210001) AM_WRITE(cpua_ctrl_w)
392372   AM_RANGE(0x220000, 0x220003) AM_WRITE(ninjaw_sound_w)
393   AM_RANGE(0x240000, 0x24ffff) AM_WRITE(sharedram_w) AM_BASE(&sharedram) AM_SIZE(&sharedram_size)
394   AM_RANGE(0x260000, 0x263fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
373   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
374   AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE(2) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
395375   AM_RANGE(0x280000, 0x293fff) AM_WRITE(TC0100SCN_triple_screen_w)   /* tilemaps (all screens) */
396376   AM_RANGE(0x2a0000, 0x2a000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
397377   AM_RANGE(0x2c0000, 0x2d3fff) AM_WRITE(TC0100SCN_word_1_w)   /* tilemaps (2nd screen) */
r1527r1528
408388   AM_RANGE(0x080000, 0x08ffff) AM_READ(MRA16_RAM)   /* main ram */
409389   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
410390   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
411   AM_RANGE(0x240000, 0x24ffff) AM_READ(sharedram_r)
412   AM_RANGE(0x260000, 0x263fff) AM_READ(spriteram16_r)   /* sprite ram */
413391   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
414392ADDRESS_MAP_END
415393
r1527r1528
418396   AM_RANGE(0x080000, 0x08ffff) AM_WRITE(MWA16_RAM)
419397   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
420398   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
421   AM_RANGE(0x240000, 0x24ffff) AM_WRITE(sharedram_w) AM_BASE(&sharedram)
422   AM_RANGE(0x260000, 0x263fff) AM_WRITE(spriteram16_w)
399   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
400   AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE(2)
423401   AM_RANGE(0x280000, 0x293fff) AM_WRITE(TC0100SCN_triple_screen_w)   /* tilemaps (all screens) */
424402ADDRESS_MAP_END
425403
src/mame/drivers/matmania.c
r1527r1528
3939PALETTE_INIT( matmania );
4040VIDEO_UPDATE( matmania );
4141VIDEO_UPDATE( maniach );
42WRITE8_HANDLER( matmania_videoram3_w );
43WRITE8_HANDLER( matmania_colorram3_w );
4442VIDEO_START( matmania );
4543VIDEO_UPDATE( matmania );
4644
r1527r1528
9593   AM_RANGE(0x0780, 0x07df) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
9694   AM_RANGE(0x1000, 0x13ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_videoram2) AM_SIZE(&matmania_videoram2_size)
9795   AM_RANGE(0x1400, 0x17ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_colorram2)
98   AM_RANGE(0x2000, 0x21ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
99   AM_RANGE(0x2200, 0x23ff) AM_WRITE(colorram_w) AM_BASE(&colorram)
100   AM_RANGE(0x2400, 0x25ff) AM_WRITE(matmania_videoram3_w) AM_BASE(&matmania_videoram3) AM_SIZE(&matmania_videoram3_size)
101   AM_RANGE(0x2600, 0x27ff) AM_WRITE(matmania_colorram3_w) AM_BASE(&matmania_colorram3)
96   AM_RANGE(0x2000, 0x21ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
97   AM_RANGE(0x2200, 0x23ff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
98   AM_RANGE(0x2400, 0x25ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_videoram3) AM_SIZE(&matmania_videoram3_size)
99   AM_RANGE(0x2600, 0x27ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_colorram3)
102100   AM_RANGE(0x3000, 0x3000) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_pageselect)
103101   AM_RANGE(0x3010, 0x3010) AM_WRITE(matmania_sh_command_w)
104102   AM_RANGE(0x3020, 0x3020) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_scroll)
r1527r1528
125123   AM_RANGE(0x0780, 0x07df) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
126124   AM_RANGE(0x1000, 0x13ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_videoram2) AM_SIZE(&matmania_videoram2_size)
127125   AM_RANGE(0x1400, 0x17ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_colorram2)
128   AM_RANGE(0x2000, 0x21ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
129   AM_RANGE(0x2200, 0x23ff) AM_WRITE(colorram_w) AM_BASE(&colorram)
130   AM_RANGE(0x2400, 0x25ff) AM_WRITE(matmania_videoram3_w) AM_BASE(&matmania_videoram3) AM_SIZE(&matmania_videoram3_size)
131   AM_RANGE(0x2600, 0x27ff) AM_WRITE(matmania_colorram3_w) AM_BASE(&matmania_colorram3)
126   AM_RANGE(0x2000, 0x21ff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
127   AM_RANGE(0x2200, 0x23ff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
128   AM_RANGE(0x2400, 0x25ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_videoram3) AM_SIZE(&matmania_videoram3_size)
129   AM_RANGE(0x2600, 0x27ff) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_colorram3)
132130   AM_RANGE(0x3000, 0x3000) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_pageselect)
133131   AM_RANGE(0x3010, 0x3010) AM_WRITE(maniach_sh_command_w)
134132   AM_RANGE(0x3020, 0x3020) AM_WRITE(MWA8_RAM) AM_BASE(&matmania_scroll)
r1527r1528
400398   /* audio CPU */   /* 1.5 MHz ???? */
401399   MDRV_CPU_PROGRAM_MAP(maniach_sound_readmem,maniach_sound_writemem)
402400                        /* IRQs are caused by the main CPU */
403   MDRV_CPU_ADD(M68705, 1500000*2/M68705_CLOCK_DIVIDER)   /* (don't know really how fast, but it doesn't need to even be this fast) */
401   MDRV_CPU_ADD(M68705, 1500000*2)   /* (don't know really how fast, but it doesn't need to even be this fast) */
404402   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
405403
406404   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/arkanoid.c
r1527r1528
767767   MDRV_CPU_PROGRAM_MAP(arkanoid_map, 0)
768768   MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
769769
770   MDRV_CPU_ADD_TAG("mcu", M68705, 3000000/M68705_CLOCK_DIVIDER) /* 3 Mhz */
770   MDRV_CPU_ADD_TAG("mcu", M68705, 3000000) /* 3 Mhz */
771771   MDRV_CPU_PROGRAM_MAP(mcu_map, 0)
772772
773773   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/twin16.c
r1527r1528
296296   AM_RANGE(0x100000, 0x103fff) AM_READ(MRA16_RAM)
297297   AM_RANGE(0x104000, 0x105fff) AM_READ(MRA16_RAM)   // miaj
298298   AM_RANGE(0x120000, 0x123fff) AM_READ(MRA16_RAM)
299   AM_RANGE(0x140000, 0x143fff) AM_READ(MRA16_RAM)
300299ADDRESS_MAP_END
301300
302301static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 16 )
r1527r1528
315314   AM_RANGE(0x100000, 0x103fff) AM_WRITE(twin16_videoram2_w) AM_BASE(&twin16_videoram2)
316315   AM_RANGE(0x104000, 0x105fff) AM_WRITE(MWA16_RAM)   // miaj
317316   AM_RANGE(0x120000, 0x123fff) AM_WRITE(MWA16_RAM) AM_BASE(&videoram16)
318   AM_RANGE(0x140000, 0x143fff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
317   AM_RANGE(0x140000, 0x143fff) AM_RAM AM_SHARE(1) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
319318ADDRESS_MAP_END
320319
321320static ADDRESS_MAP_START( readmem_sub, ADDRESS_SPACE_PROGRAM, 16 )
r1527r1528
324323   AM_RANGE(0x044000, 0x04ffff) AM_READ(MRA16_RAM)   // miaj
325324   AM_RANGE(0x060000, 0x063fff) AM_READ(MRA16_RAM)
326325   AM_RANGE(0x080000, 0x09ffff) AM_READ(extra_rom_r)
327   AM_RANGE(0x400000, 0x403fff) AM_READ(spriteram16_r)
328326   AM_RANGE(0x480000, 0x483fff) AM_READ(videoram16_r)
329327   AM_RANGE(0x500000, 0x53ffff) AM_READ(MRA16_RAM)
330328   AM_RANGE(0x600000, 0x6fffff) AM_READ(twin16_gfx_rom1_r)
r1527r1528
338336   AM_RANGE(0x044000, 0x04ffff) AM_WRITE(MWA16_RAM)   // miaj
339337   AM_RANGE(0x060000, 0x063fff) AM_WRITE(MWA16_RAM)
340338   AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(twin16_CPUB_register_w)
341   AM_RANGE(0x400000, 0x403fff) AM_WRITE(spriteram16_w)
339   AM_RANGE(0x400000, 0x403fff) AM_RAM AM_SHARE(1)
342340   AM_RANGE(0x480000, 0x483fff) AM_WRITE(videoram16_w)
343341   AM_RANGE(0x500000, 0x53ffff) AM_WRITE(MWA16_RAM) AM_BASE(&twin16_tile_gfx_ram)
344342   AM_RANGE(0x780000, 0x79ffff) AM_WRITE(MWA16_RAM) AM_BASE(&twin16_sprite_gfx_ram)
src/mame/drivers/pacman.c
r1527r1528
11181118   AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_READ(input_port_1_r)
11191119ADDRESS_MAP_END
11201120
1121
1122
11211123/*************************************
11221124 *
11231125 *  Main CPU port handlers
r1527r1528
12041206   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_control_port_0_w)
12051207ADDRESS_MAP_END
12061208
1209
1210
12071211/*************************************
12081212 *
12091213 *  Port definitions
r1527r1528
29662970   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
29672971INPUT_PORTS_END
29682972
2973
2974
29692975/*************************************
29702976 *
29712977 *  Graphics layouts
r1527r1528
33343340   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
33353341MACHINE_DRIVER_END
33363342
3343
3344
33373345/*************************************
33383346 *
33393347 *  ROM definitions
src/mame/drivers/lsasquad.c
r1527r1528
596596   /* audio CPU */   /* 4 MHz? */
597597   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
598598                        /* IRQs are triggered by the YM2203 */
599   MDRV_CPU_ADD(M68705,4000000/M68705_CLOCK_DIVIDER)   /* ? */
599   MDRV_CPU_ADD(M68705,4000000)   /* ? */
600600   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
601601
602602   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/sengokmj.c
r1527r1528
278278   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout, 0x700, 0x10 ) /* Text */
279279GFXDECODE_END
280280
281SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
282
283281static INTERRUPT_GEN( sengokmj_interrupt )
284282{
285283   cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xcb/4);
src/mame/drivers/dec8.c
r1527r1528
570570
571571static ADDRESS_MAP_START( ghostb_readmem, ADDRESS_SPACE_PROGRAM, 8 )
572572   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM)
573   AM_RANGE(0x1800, 0x1fff) AM_READ(videoram_r)
573   AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM)
574574   AM_RANGE(0x2000, 0x27ff) AM_READ(dec8_pf0_data_r)
575575   AM_RANGE(0x2800, 0x2dff) AM_READ(MRA8_RAM)
576576   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM)
r1527r1528
634634
635635static ADDRESS_MAP_START( gondo_readmem, ADDRESS_SPACE_PROGRAM, 8 )
636636   AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_RAM)
637   AM_RANGE(0x1800, 0x1fff) AM_READ(videoram_r)
637   AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM)
638638   AM_RANGE(0x2000, 0x27ff) AM_READ(dec8_pf0_data_r)
639639   AM_RANGE(0x2800, 0x2bff) AM_READ(paletteram_r)
640640   AM_RANGE(0x2c00, 0x2fff) AM_READ(paletteram_2_r)
r1527r1528
669669   AM_RANGE(0x0000, 0x0eff) AM_READ(MRA8_RAM) AM_SHARE(1)
670670   AM_RANGE(0x0f00, 0x0fff) AM_READ(MRA8_RAM)
671671   AM_RANGE(0x1000, 0x1fff) AM_READ(MRA8_RAM) AM_SHARE(2)
672   AM_RANGE(0x2000, 0x27ff) AM_READ(videoram_r)
672   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
673673   AM_RANGE(0x2800, 0x2fff) AM_READ(dec8_pf0_data_r)
674674   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) /* Sprites */
675675   AM_RANGE(0x3800, 0x3bff) AM_READ(paletteram_r)
r1527r1528
725725   AM_RANGE(0x1804, 0x1804) AM_READ(input_port_4_r) /* Dip 2 */
726726   AM_RANGE(0x1806, 0x1806) AM_READ(i8751_h_r)
727727   AM_RANGE(0x1807, 0x1807) AM_READ(i8751_l_r)
728   AM_RANGE(0x2000, 0x27ff) AM_READ(videoram_r)
728   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
729729   AM_RANGE(0x2800, 0x2fff) AM_READ(MRA8_RAM)
730730   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) AM_SHARE(2)
731731   AM_RANGE(0x3800, 0x3fff) AM_READ(dec8_pf0_data_r)
r1527r1528
761761   AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r)
762762   AM_RANGE(0x1803, 0x1803) AM_READ(input_port_3_r) /* Dip 1 */
763763   AM_RANGE(0x1804, 0x1804) AM_READ(input_port_4_r) /* Dip 2 */
764   AM_RANGE(0x2000, 0x27ff) AM_READ(videoram_r)
764   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
765765   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) AM_SHARE(2)
766766   AM_RANGE(0x3800, 0x3fff) AM_READ(dec8_pf0_data_r)
767767   AM_RANGE(0x4000, 0xffff) AM_READ(MRA8_ROM)
r1527r1528
791791   AM_RANGE(0x1802, 0x1802) AM_READ(input_port_2_r)
792792   AM_RANGE(0x1803, 0x1803) AM_READ(input_port_3_r)
793793   AM_RANGE(0x1804, 0x1804) AM_READ(input_port_4_r)
794   AM_RANGE(0x2000, 0x27ff) AM_READ(videoram_r)
794   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
795795   AM_RANGE(0x2800, 0x2fff) AM_READ(shackled_sprite_r)
796796   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) AM_SHARE(2)
797797   AM_RANGE(0x3800, 0x3fff) AM_READ(dec8_pf0_data_r)
r1527r1528
828828   AM_RANGE(0x1804, 0x1804) AM_READ(input_port_4_r)
829829   AM_RANGE(0x1806, 0x1806) AM_READ(i8751_h_r)
830830   AM_RANGE(0x1807, 0x1807) AM_READ(i8751_l_r)
831   AM_RANGE(0x2000, 0x27ff) AM_READ(videoram_r)
831   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
832832   AM_RANGE(0x2800, 0x2fff) AM_READ(MRA8_RAM)
833833   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) AM_SHARE(2)
834834   AM_RANGE(0x3800, 0x3fff) AM_READ(dec8_pf0_data_r)
r1527r1528
865865   AM_RANGE(0x1805, 0x1805) AM_READ(input_port_3_r) /* Dip 1 */
866866   AM_RANGE(0x1c00, 0x1c00) AM_READ(i8751_h_r)
867867   AM_RANGE(0x1e00, 0x1e00) AM_READ(i8751_l_r)
868   AM_RANGE(0x2000, 0x27ff) AM_READ(videoram_r)
868   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
869869   AM_RANGE(0x2800, 0x2fff) AM_READ(shackled_sprite_r)
870870   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) AM_SHARE(2)
871871   AM_RANGE(0x3800, 0x3fff) AM_READ(dec8_pf0_data_r)
r1527r1528
898898   AM_RANGE(0x1803, 0x1803) AM_READ(input_port_2_r)
899899   AM_RANGE(0x1804, 0x1804) AM_READ(input_port_4_r)
900900   AM_RANGE(0x1805, 0x1805) AM_READ(input_port_3_r)
901   AM_RANGE(0x2000, 0x27ff) AM_READ(videoram_r)
901   AM_RANGE(0x2000, 0x27ff) AM_READ(MRA8_RAM)
902902   AM_RANGE(0x2800, 0x2fff) AM_READ(MRA8_RAM)
903903   AM_RANGE(0x3000, 0x37ff) AM_READ(MRA8_RAM) AM_SHARE(2)
904904   AM_RANGE(0x3800, 0x3fff) AM_READ(dec8_pf0_data_r)
r1527r1528
921921
922922static ADDRESS_MAP_START( garyoret_readmem, ADDRESS_SPACE_PROGRAM, 8 )
923923   AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_RAM)
924   AM_RANGE(0x1800, 0x1fff) AM_READ(videoram_r)
924   AM_RANGE(0x1800, 0x1fff) AM_READ(MRA8_RAM)
925925   AM_RANGE(0x2000, 0x27ff) AM_READ(dec8_pf0_data_r)
926926   AM_RANGE(0x2800, 0x2bff) AM_READ(paletteram_r)
927927   AM_RANGE(0x2c00, 0x2fff) AM_READ(paletteram_2_r)
src/mame/drivers/pkunwar.c
r1527r1528
2929static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
3030   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
3131   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
32   AM_RANGE(0x8800, 0x8bff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
33   AM_RANGE(0x8c00, 0x8fff) AM_WRITE(colorram_w) AM_BASE(&colorram)
32   AM_RANGE(0x8800, 0x8bff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
33   AM_RANGE(0x8c00, 0x8fff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
3434   AM_RANGE(0xa000, 0xa000) AM_WRITE(&AY8910_control_port_0_w)
3535   AM_RANGE(0xa001, 0xa001) AM_WRITE(&AY8910_write_port_0_w)
3636   AM_RANGE(0xa002, 0xa002) AM_WRITE(&AY8910_control_port_1_w)
r1527r1528
184184   MDRV_COLORTABLE_LENGTH(32*16)
185185
186186   MDRV_PALETTE_INIT(nova2001)
187   MDRV_VIDEO_START(generic)
188187   MDRV_VIDEO_UPDATE(pkunwar)
189188
190189   /* sound hardware */
src/mame/drivers/cloud9.c
r1527r1528
152152}
153153
154154
155static UINT32 get_vblank(void *param)
155static CUSTOM_INPUT( get_vblank )
156156{
157157   int scanline = video_screen_get_vpos(0);
158158   return (~syncprom[scanline & 0xff] >> 1) & 1;
src/mame/drivers/changela.c
r1527r1528
481481   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
482482   MDRV_CPU_VBLANK_INT(chl_interrupt,4)
483483
484   MDRV_CPU_ADD(M68705,2500000/M68705_CLOCK_DIVIDER)
484   MDRV_CPU_ADD(M68705,2500000)
485485   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
486486
487487   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/asuka.c
r1527r1528
885885static MACHINE_DRIVER_START( asuka )
886886
887887   /* basic machine hardware */
888   MDRV_CPU_ADD(M68000, 8000000)   /* 8 MHz ??? */
888   MDRV_CPU_ADD(M68000, XTAL_16MHz/2)   /* verified on pcb */
889889   MDRV_CPU_PROGRAM_MAP(asuka_readmem,asuka_writemem)
890890   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
891891
892   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz ??? */
892   MDRV_CPU_ADD(Z80, XTAL_16MHz/4)   /* verified on pcb */
893893   MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem)
894894
895895   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
911911   /* sound hardware */
912912   MDRV_SPEAKER_STANDARD_MONO("mono")
913913
914   MDRV_SOUND_ADD(YM2151, 4000000)
914   MDRV_SOUND_ADD(YM2151, XTAL_16MHz/4) /* verified on pcb */
915915   MDRV_SOUND_CONFIG(ym2151_interface)
916916   MDRV_SOUND_ROUTE(0, "mono", 0.50)
917917   MDRV_SOUND_ROUTE(1, "mono", 0.50)
918918
919   MDRV_SOUND_ADD(MSM5205, 384000)
919   MDRV_SOUND_ADD(MSM5205, XTAL_384kHz) /* verified on pcb */
920920   MDRV_SOUND_CONFIG(msm5205_interface)
921921   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
922922MACHINE_DRIVER_END
r1527r1528
924924static MACHINE_DRIVER_START( cadash )
925925
926926   /* basic machine hardware */
927   MDRV_CPU_ADD(M68000, 12000000)   /* 12 MHz ??? */
927   MDRV_CPU_ADD(M68000, XTAL_32MHz/2)   /* 68000p12 running at 16Mhz, verified on pcb */
928928   MDRV_CPU_PROGRAM_MAP(cadash_readmem,cadash_writemem)
929929   MDRV_CPU_VBLANK_INT(cadash_interrupt,1)
930930
931   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz ??? */
931   MDRV_CPU_ADD(Z80, XTAL_8MHz/2)   /* verified on pcb */
932932   MDRV_CPU_PROGRAM_MAP(z80_readmem,cadash_z80_writemem)
933933
934934   MDRV_SCREEN_REFRESH_RATE(60)
r1527r1528
950950   /* sound hardware */
951951   MDRV_SPEAKER_STANDARD_MONO("mono")
952952
953   MDRV_SOUND_ADD(YM2151, 4000000)
953   MDRV_SOUND_ADD(YM2151, XTAL_8MHz/2)   /* verified on pcb */
954954   MDRV_SOUND_CONFIG(ym2151_interface)
955955   MDRV_SOUND_ROUTE(0, "mono", 0.50)
956956   MDRV_SOUND_ROUTE(1, "mono", 0.50)
src/mame/drivers/rollerg.c
r1527r1528
225225   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
226226   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
227227   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
228   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 )
228   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
229229INPUT_PORTS_END
230230
231231
src/mame/drivers/sidepckt.c
r1527r1528
127127
128128static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
129129   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM)
130   AM_RANGE(0x1000, 0x17ff) AM_READ(videoram_r)
131   AM_RANGE(0x1800, 0x1fff) AM_READ(colorram_r)
130   AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM)
131   AM_RANGE(0x1800, 0x1bff) AM_READ(MRA8_RAM)
132132   AM_RANGE(0x2000, 0x20ff) AM_READ(MRA8_RAM)
133133   AM_RANGE(0x3000, 0x3000) AM_READ(input_port_0_r)
134134   AM_RANGE(0x3001, 0x3001) AM_READ(input_port_1_r)
src/mame/drivers/exerion.c
r1527r1528
8989   AM_RANGE(0x0000, 0x5fff) AM_ROM
9090   AM_RANGE(0x6008, 0x600b) AM_READ(exerion_protection_r)
9191   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&exerion_ram)
92   AM_RANGE(0x8000, 0x87ff) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
92   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
9393   AM_RANGE(0x8800, 0x887f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
9494   AM_RANGE(0x8800, 0x8bff) AM_RAM
9595   AM_RANGE(0xa000, 0xa000) AM_READ(exerion_port01_r)
src/mame/drivers/ltcasino.c
r1527r1528
272272
273273INPUT_PORTS_END
274274
275static INPUT_PORTS_START( ltcasin2 )
275static INPUT_PORTS_START( ltcasinn )
276276   PORT_START /* Q in service */
277277   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) //start?
278278   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
r1527r1528
687687ROM_END
688688
689689
690ROM_START( ltcasin2 )
690ROM_START( ltcasinn )
691691   ROM_REGION( 0x10000, REGION_CPU1, 0 )
692692   ROM_LOAD( "lc2_ra.bin", 0x8000, 0x1000, CRC(1a595442) SHA1(b8fe3e5ed2024a57187c0ce547c1bbef2429ed63) )
693693   ROM_LOAD( "lc2_rb.bin", 0x9000, 0x1000, CRC(4f5502c1) SHA1(cd1b7c08d26fed71c45e44ebd208bd18dc262e8f) )
r1527r1528
722722
723723
724724
725GAME( 1982, ltcasino, 0, ltcasino, ltcasino, 0, ROT0, "Digital Controls Inc.", "Little Casino", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS  )
725GAME( 1982, ltcasino, 0, ltcasino, ltcasino, 0, ROT0, "Digital Controls Inc.", "Little Casino (older)", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS  )
726726GAME( 1983, mv4in1,  ltcasino,  ltcasino, mv4in1, mv4in1, ROT0, "Entertainment Enterprises", "Mini Vegas 4in1", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS )
727GAME( 1984, ltcasin2, 0, ltcasino, ltcasin2, 0, ROT0, "Digital Controls Inc.", "Little Casino 2", GAME_NOT_WORKING )
727GAME( 1984, ltcasinn, 0, ltcasino, ltcasinn, 0, ROT0, "Digital Controls Inc.", "Little Casino (newer)", GAME_NOT_WORKING )
src/mame/drivers/subs.c
r1527r1528
6868   AM_RANGE(0x006a, 0x006b) AM_WRITE(subs_crash_w)
6969   AM_RANGE(0x006c, 0x006d) AM_WRITE(subs_invert1_w)
7070   AM_RANGE(0x006e, 0x006f) AM_WRITE(subs_invert2_w)
71   AM_RANGE(0x0090, 0x009f) AM_WRITE(spriteram_w) AM_BASE(&spriteram)
71   AM_RANGE(0x0090, 0x009f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram)
7272   AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM)
73   AM_RANGE(0x0800, 0x0bff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
73   AM_RANGE(0x0800, 0x0bff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
7474   AM_RANGE(0x2000, 0x3fff) AM_WRITE(MWA8_ROM)
7575ADDRESS_MAP_END
7676
src/mame/drivers/nmk16.c
r1527r1528
36873687}
36883688
36893689
3690/* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
3691SEIBU_SOUND_SYSTEM_YM3812_HARDWARE
3692
3693
36943690static MACHINE_DRIVER_START( tharrier )
36953691
36963692   /* basic machine hardware */
r1527r1528
40074003   MDRV_CPU_VBLANK_INT(nmk_interrupt,2)
40084004   MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */
40094005
4010   MDRV_CPU_ADD(PIC16C57, (12000000/PIC16C5x_CLOCK_DIVIDER))   /* 3MHz */
4006   MDRV_CPU_ADD(PIC16C57, 12000000)   /* 3MHz */
40114007   MDRV_CPU_FLAGS(CPU_DISABLE)
40124008
40134009   MDRV_SCREEN_REFRESH_RATE(56)
src/emu/cpu/m6805/m6805.c
r1527r1528
899899      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
900900      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
901901      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
902      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = M6805_CLOCK_DIVIDER;         break;
902      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
903      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
903904      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
904905      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
905906      case CPUINFO_INT_MIN_CYCLES:               info->i = 2;                     break;
src/emu/cpu/m6805/m6805.h
r1527r1528
99
1010#define M6805_IRQ_LINE      0
1111
12#define M6805_CLOCK_DIVIDER   4
13
1412extern void m6805_get_info(UINT32 state, cpuinfo *info);
1513
1614/****************************************************************************
r1527r1528
2826#define M68705_IRQ_LINE            M6805_IRQ_LINE
2927#define M68705_INT_TIMER         0x01
3028
31#define M68705_CLOCK_DIVIDER      M6805_CLOCK_DIVIDER
32
3329extern void m68705_get_info(UINT32 state, cpuinfo *info);
3430#endif
3531
r1527r1528
5955#define   HD63705_INT_ADCONV         0x07
6056#define HD63705_INT_NMI            0x08
6157
62#define HD3705_CLOCK_DIVIDER      M6805_CLOCK_DIVIDER
63
6458extern void hd63705_get_info(UINT32 state, cpuinfo *info);
6559#endif
6660
src/emu/cpu/v30mz/v30mz.c
r1527r1528
10471047      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
10481048      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
10491049      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1050      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
10501051      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
10511052      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
10521053      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
src/emu/cpu/lh5801/lh5801.c
r1527r1528
192192      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
193193      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
194194      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
195      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
195196      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
196197      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
197198      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
src/emu/cpu/m6809/m6809.c
r1527r1528
11291129      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
11301130      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
11311131      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
1132      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
11321133      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
11331134      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
11341135      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
r1527r1528
12181219   switch (state)
12191220   {
12201221      /* --- the following bits of info are returned as 64-bit signed integers --- */
1222      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
12211223      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
12221224
12231225      /* --- the following bits of info are returned as NULL-terminated strings --- */
src/emu/cpu/h83002/h83002.c
r1527r1528
38283828   case CPUINFO_STR_CORE_FILE:               strcpy(info->s, __FILE__);                  break;
38293829   case CPUINFO_STR_FLAGS:                  strcpy(info->s, h8_get_ccr_str());            break;
38303830   case CPUINFO_INT_ENDIANNESS:            info->i = CPU_IS_BE;                     break;
3831   case CPUINFO_INT_CLOCK_MULTIPLIER:         info->i = 1;                           break;
3832   case CPUINFO_INT_CLOCK_DIVIDER:            info->i = 1;                           break;
38313833   case CPUINFO_INT_INPUT_LINES:            info->i = 16;                           break;
38323834   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:      info->i = -1;                           break;
38333835
src/emu/cpu/m68000/m68kmame.c
r1527r1528
510510      case CPUINFO_INT_INPUT_LINES:               info->i = 8;                     break;
511511      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = -1;                     break;
512512      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
513      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
513514      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
514515      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
515516      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 10;                     break;
r1527r1528
689690      case CPUINFO_INT_INPUT_LINES:               info->i = 8;                     break;
690691      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = -1;                     break;
691692      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
693      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
692694      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
693695      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
694696      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 10;                     break;
r1527r1528
923925      case CPUINFO_INT_INPUT_LINES:               info->i = 8;                     break;
924926      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = -1;                     break;
925927      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
928      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
926929      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
927930      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
928931      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 16;                     break;
r1527r1528
11641167      case CPUINFO_INT_INPUT_LINES:               info->i = 8;                     break;
11651168      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = -1;                     break;
11661169      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
1170      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
11671171      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
11681172      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
11691173      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 16;                     break;
src/emu/cpu/ccpu/ccpu.c
r1527r1528
717717      case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
718718      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
719719      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
720      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
720721      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
721722      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
722723      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
src/emu/cpu/z80gb/z80gb.c
r1527r1528
403403   case CPUINFO_INT_INPUT_LINES:                  info->i = 5;                     break;
404404   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
405405   case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
406   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
406407   case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
407408   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
408409   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/tms34010/tms34010.h
r1527r1528
1414#include "driver.h"
1515
1616
17/* the TMS34010 input clock is divided by 8; the 34020 by 4 */
18#define TMS34010_CLOCK_DIVIDER      8
19#define TMS34020_CLOCK_DIVIDER      4
20
21
2217/* register indexes for get_reg and set_reg */
2318enum
2419{
src/emu/cpu/tms34010/tms34010.c
r1527r1528
15081508         /* have an IRQ handler. For this reason, we return it signalled a bit early in order */
15091509         /* to make it past these loops. */
15101510         if (SMART_IOREG(VCOUNT) + 1 == SMART_IOREG(DPYINT) &&
1511            attotime_compare(timer_timeleft(state.scantimer), ATTOTIME_IN_HZ(40000000/TMS34010_CLOCK_DIVIDER/3)) < 0)
1511            attotime_compare(timer_timeleft(state.scantimer), ATTOTIME_IN_HZ(40000000/8/3)) < 0)
15121512            result |= TMS34010_DI;
15131513         return result;
15141514   }
r1527r1528
17981798      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
17991799      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
18001800      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1801      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = TMS34010_CLOCK_DIVIDER;      break;
1801      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
1802      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 8;                     break;
18021803      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
18031804      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 10;                     break;
18041805      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
r1527r1528
19461947   {
19471948      /* --- the following bits of info are returned as 64-bit signed integers --- */
19481949      case CPUINFO_INT_CONTEXT_SIZE:               info->i = TMS34020_STATE_SIZE;         break;
1949      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = TMS34020_CLOCK_DIVIDER;      break;
1950      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
1951      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
19501952
19511953      /* --- the following bits of info are returned as pointers to data or functions --- */
19521954      case CPUINFO_PTR_GET_CONTEXT:               info->getcontext = tms34020_get_context; break;
src/emu/cpu/tms32031/tms32031.c
r1527r1528
733733      case CPUINFO_INT_INPUT_LINES:               info->i = 11;                     break;
734734      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
735735      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
736      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
736737      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
737738      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
738739      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/cpu.mak
r1527r1528
531531CPUDEFS += -DHAS_I8039=$(if $(filter I8039,$(CPUS)),1,0)
532532CPUDEFS += -DHAS_I8048=$(if $(filter I8048,$(CPUS)),1,0)
533533CPUDEFS += -DHAS_N7751=$(if $(filter N7751,$(CPUS)),1,0)
534CPUDEFS += -DHAS_MB8884=$(if $(filter MB8884,$(CPUS)),1,0)
535CPUDEFS += -DHAS_M58715=$(if $(filter M58715,$(CPUS)),1,0)
534536
535537ifneq ($(filter I8035 I8039 I8048 N7751,$(CPUS)),)
536538OBJDIRS += $(CPUOBJ)/i8039
r1527r1528
764766#-------------------------------------------------
765767
766768CPUDEFS += -DHAS_R3000=$(if $(filter R3000,$(CPUS)),1,0)
769CPUDEFS += -DHAS_R3041=$(if $(filter R3041,$(CPUS)),1,0)
767770
768ifneq ($(filter R3000,$(CPUS)),)
771ifneq ($(filter R3000 R3041,$(CPUS)),)
769772OBJDIRS += $(CPUOBJ)/mips
770773CPUOBJS += $(CPUOBJ)/mips/r3000.o
771774DBGOBJS += $(CPUOBJ)/mips/r3kdasm.o
src/emu/cpu/m37710/m37710.c
r1527r1528
11741174      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(m37710i_cpu);         break;
11751175      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
11761176      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1177      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
11771178      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
11781179      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
11791180      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 6;                     break;
src/emu/cpu/sharc/sharc.c
r1527r1528
965965      case CPUINFO_INT_INPUT_LINES:               info->i = 32;                     break;
966966      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
967967      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
968      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
968969      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
969970      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 8;                     break;
970971      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 8;                     break;
src/emu/cpu/z180/z180.c
r1527r1528
24612461      case CPUINFO_INT_INPUT_LINES:               info->i = 3;                     break;
24622462      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
24632463      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
2464      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
24642465      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
24652466      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
24662467      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/i86/i86.c
r1527r1528
383383      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
384384      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
385385      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
386      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
386387      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
387388      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
388389      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 15;                     break;
r1527r1528
521522{
522523   switch (state)
523524   {
525      /* --- the following bits of info are returned as 64-bit signed integers --- */
526      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
527      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 2;                     break;
528
524529      /* --- the following bits of info are returned as pointers to data or functions --- */
525530      case CPUINFO_PTR_EXECUTE:                  info->execute = i80186_execute;         break;
526531
src/emu/cpu/i86/i286.c
r1527r1528
384384      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
385385      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
386386      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
387      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
387388      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
388389      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
389390      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 8;                     break;
src/emu/cpu/upd7810/upd7810.c
r1527r1528
18321832      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
18331833      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
18341834      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1835      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
18351836      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
18361837      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
18371838      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/sc61860/sc61860.c
r1527r1528
177177      case CPUINFO_INT_INPUT_LINES:                  info->i = 0;                     break;
178178      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
179179      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
180      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
180181      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
181182      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
182183      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/minx/minx.c
r1527r1528
238238   case CPUINFO_INT_INPUT_LINES:            info->i = 1; break;
239239   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff; break;
240240   case CPUINFO_INT_ENDIANNESS:            info->i = CPU_IS_BE; break;
241   case CPUINFO_INT_CLOCK_MULTIPLIER:         info->i = 1; break;
241242   case CPUINFO_INT_CLOCK_DIVIDER:            info->i = 1; break;
242243   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1; break;
243244   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5; break;
src/emu/cpu/v60/v60.c
r1527r1528
549549      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
550550      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
551551      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
552      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
552553      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
553554      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
554555      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 22;                     break;
src/emu/cpu/spc700/spc700.c
r1527r1528
17511751      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
17521752      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
17531753      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1754      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
17541755      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
17551756      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
17561757      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
src/emu/cpu/dsp56k/dsp56k.c
r1527r1528
11471147      case CPUINFO_INT_INPUT_LINES:               info->i = 4;                     break;
11481148      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
11491149      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1150      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
11501151      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
11511152      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
11521153      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/i8039/i8039.h
r1527r1528
2525    (Each instruction cycle passes through 5 machine states).
2626*/
2727
28#define I8039_CLOCK_DIVIDER      (3*5)
2928
30
31
3229enum { I8039_PC=1, I8039_SP, I8039_PSW, I8039_A,  I8039_TC,
3330      I8039_P1,   I8039_P2, I8039_R0,  I8039_R1, I8039_R2,
34      I8039_R3,   I8039_R4, I8039_R5,  I8039_R6, I8039_R7
31      I8039_R3,   I8039_R4, I8039_R5,  I8039_R6, I8039_R7,
32      I8039_EA
3533};
3634
3735extern void i8039_get_info(UINT32 state, cpuinfo *info);
r1527r1528
4947#define  I8039_p7   0x107
5048#define  I8039_t0   0x110
5149#define  I8039_t1   0x111
50/* EA is activelow input on real hardware. It is treated
51 * as active high here to remain compatible with existing drivers! */
52#define  I8039_ea   0x112
5253#define  I8039_bus   0x120
5354
5455/**************************************************************************
r1527r1528
7172#define I8035_R6            I8039_R6
7273#define I8035_R7            I8039_R7
7374
74#define I8035_CLOCK_DIVIDER      I8039_CLOCK_DIVIDER
7575#define i8035_ICount         i8039_ICount
7676
7777extern void i8035_get_info(UINT32 state, cpuinfo *info);
r1527r1528
9797#define I8048_R6            I8039_R6
9898#define I8048_R7            I8039_R7
9999
100#define I8048_CLOCK_DIVIDER      I8039_CLOCK_DIVIDER
101100#define i8048_ICount         i8039_ICount
102101
103102extern void i8048_get_info(UINT32 state, cpuinfo *info);
r1527r1528
123122#define N7751_R6            I8039_R6
124123#define N7751_R7            I8039_R7
125124
126#define N7751_CLOCK_DIVIDER      I8039_CLOCK_DIVIDER
127125#define n7751_ICount         i8039_ICount
128126
129127extern void n7751_get_info(UINT32 state, cpuinfo *info);
130128#endif
131129
130/**************************************************************************
131 * MB8884 section
132 **************************************************************************/
133#if (HAS_MB8884)
134#define MB8884_PC            I8039_PC
135#define MB8884_SP            I8039_SP
136#define MB8884_PSW            I8039_PSW
137#define MB8884_A             I8039_A
138#define MB8884_TC            I8039_TC
139#define MB8884_P1            I8039_P1
140#define MB8884_P2            I8039_P2
141#define MB8884_R0            I8039_R0
142#define MB8884_R1            I8039_R1
143#define MB8884_R2            I8039_R2
144#define MB8884_R3            I8039_R3
145#define MB8884_R4            I8039_R4
146#define MB8884_R5            I8039_R5
147#define MB8884_R6            I8039_R6
148#define MB8884_R7            I8039_R7
149
150#define mb8884_ICount         i8039_ICount
151
152extern void mb8884_get_info(UINT32 state, cpuinfo *info);
153#endif
154
155/**************************************************************************
156 * M58715 section
157 **************************************************************************/
158#if (HAS_M58715)
159#define M58715_PC            I8039_PC
160#define M58715_SP            I8039_SP
161#define M58715_PSW            I8039_PSW
162#define M58715_A             I8039_A
163#define M58715_TC            I8039_TC
164#define M58715_P1            I8039_P1
165#define M58715_P2            I8039_P2
166#define M58715_R0            I8039_R0
167#define M58715_R1            I8039_R1
168#define M58715_R2            I8039_R2
169#define M58715_R3            I8039_R3
170#define M58715_R4            I8039_R4
171#define M58715_R5            I8039_R5
172#define M58715_R6            I8039_R6
173#define M58715_R7            I8039_R7
174
175#define m58715_ICount         i8039_ICount
176
177extern void m58715_get_info(UINT32 state, cpuinfo *info);
178#endif
179
132180/*
133181 *   Input a UINT8 from given I/O port
134182 */
src/emu/cpu/i8039/i8039.c
r1527r1528
5050#define ADJUST_CYCLES { }               /* User Manual cycles setting */
5151#endif
5252
53/* There are certain differences between the processors */
54#define FEATURE_M58715      1
5355
54
5556/* HJB 01/05/99 changed to positive values to use pending_irq as a flag */
5657#define I8039_NO_INT      0   /* No Interrupts pending or executing   */
5758#define I8039_EXTERNAL_INT   1   /* Execute a normal external interrupt  */
r1527r1528
6263static int Timer_IRQ(void);
6364
6465#define M_RDMEM(A)      I8039_RDMEM(A)
65#define M_RDOP(A)      I8039_RDOP(A)
66#define M_RDOP_ARG(A)   I8039_RDOP_ARG(A)
66//#define M_RDOP(A)     I8039_RDOP(A)
67//#define M_RDOP_ARG(A) I8039_RDOP_ARG(A)
6768#define M_IN(A)         I8039_In(A)
6869#define M_OUT(A,V)      I8039_Out(A,V)
6970
r1527r1528
7475#define bus_r()         I8039_In(I8039_bus)
7576#define bus_w(V)      I8039_Out(I8039_bus,V)
7677
78#define INTRAM_R(A)      (intRAM[(A) & R.ram_mask])
79#define INTRAM_W(A,V)   do { intRAM[(A) & R.ram_mask] = V; } while (0);
80
7781#define C_FLAG         0x80
7882#define A_FLAG         0x40
7983#define F_FLAG         0x20
r1527r1528
8791   UINT8   RAM[128];
8892   UINT8   bus, f1;      /* Bus data, and flag1 */
8993   UINT8   P1, P2;         /* Internal Port 1 and 2 latched outputs */
90
94   UINT8   EA;            /* latched EA input */
95   UINT8   cpu_feature;   /* process feature */
96   UINT8   ram_mask;      /* internal ram size - 1 */
97   UINT16   int_rom_size;   /* internal rom size */
9198   UINT8   pending_irq, irq_executing, masterClock, regPtr;
9299   UINT8   t_flag, timer, timerON, countON, xirq_en, tirq_en;
93100   UINT16   A11;
94101   UINT8   irq_state, irq_extra_cycles;
95102   int      (*irq_callback)(int irqline);
103   int      inst_cycles;
96104   UINT8   Old_T1;
97105} I8039_Regs;
98106
99107static I8039_Regs R;
100108static int      i8039_ICount;
101static int    inst_cycles;
102109
103110/* The opcode table now is a combination of cycle counts and function pointers */
104111typedef struct {
r1527r1528
130137#define R6   intRAM[regPTR+6]
131138#define R7   intRAM[regPTR+7]
132139
140INLINE UINT8 ea_r(void)
141{
142   R.EA = I8039_In(I8039_ea);
143   return R.EA;
144}
133145
146INLINE UINT8 M_RDOP(int A)
147{
148   if (R.cpu_feature & FEATURE_M58715)
149      if ((A<R.int_rom_size) && !ea_r())
150         return 0x00;
151   return I8039_RDOP(A);
152}
153
154INLINE UINT8 M_RDOP_ARG(int A)
155{
156   if (R.cpu_feature & FEATURE_M58715)
157      if ((A<R.int_rom_size) && !ea_r())
158         return 0x00;
159   return I8039_RDOP_ARG(A);
160}
161
134162INLINE void CLR (UINT8 flag) { R.PSW &= ~flag; }
135163INLINE void SET (UINT8 flag) { R.PSW |= flag;  }
136164
r1527r1528
205233INLINE void M_XCHD(UINT8 addr)
206234{
207235   UINT8 dat = R.A & 0x0f;
236   UINT8 val = INTRAM_R(addr);
208237   R.A &= 0xf0;
209   R.A |= intRAM[addr] & 0x0f;
210   intRAM[addr] &= 0xf0;
211   intRAM[addr] |= dat;
238   R.A |= val & 0x0f;
239   val &= 0xf0;
240   val |= dat;
241   INTRAM_W(addr, val);
212242}
213243
214244
r1527r1528
233263static void add_a_r5(void)    { M_ADD(R5); }
234264static void add_a_r6(void)    { M_ADD(R6); }
235265static void add_a_r7(void)    { M_ADD(R7); }
236static void add_a_xr0(void)    { M_ADD(intRAM[R0 & 0x7f]); }
237static void add_a_xr1(void)    { M_ADD(intRAM[R1 & 0x7f]); }
266static void add_a_xr0(void)    { M_ADD(INTRAM_R(R0)); }
267static void add_a_xr1(void)    { M_ADD(INTRAM_R(R1)); }
238268static void adc_a_n(void)    { M_ADDC(M_RDMEM_OPCODE()); }
239269static void adc_a_r0(void)    { M_ADDC(R0); }
240270static void adc_a_r1(void)    { M_ADDC(R1); }
r1527r1528
244274static void adc_a_r5(void)    { M_ADDC(R5); }
245275static void adc_a_r6(void)    { M_ADDC(R6); }
246276static void adc_a_r7(void)    { M_ADDC(R7); }
247static void adc_a_xr0(void)    { M_ADDC(intRAM[R0 & 0x7f]); }
248static void adc_a_xr1(void)    { M_ADDC(intRAM[R1 & 0x7f]); }
277static void adc_a_xr0(void)    { M_ADDC(INTRAM_R(R0)); }
278static void adc_a_xr1(void)    { M_ADDC(INTRAM_R(R1)); }
249279static void anl_a_n(void)    { R.A &= M_RDMEM_OPCODE(); }
250280static void anl_a_r0(void)    { R.A &= R0; }
251281static void anl_a_r1(void)    { R.A &= R1; }
r1527r1528
255285static void anl_a_r5(void)    { R.A &= R5; }
256286static void anl_a_r6(void)    { R.A &= R6; }
257287static void anl_a_r7(void)    { R.A &= R7; }
258static void anl_a_xr0(void)    { R.A &= intRAM[R0 & 0x7f]; }
259static void anl_a_xr1(void)    { R.A &= intRAM[R1 & 0x7f]; }
288static void anl_a_xr0(void)    { R.A &= INTRAM_R(R0); }
289static void anl_a_xr1(void)    { R.A &= INTRAM_R(R1); }
260290static void anl_bus_n(void)    { bus_w( bus_r() & M_RDMEM_OPCODE() ); }
261static void anl_p1_n(void)    { R.P1 &= M_RDMEM_OPCODE(); port_w( 1, R.P1 ); }
262static void anl_p2_n(void)    { R.P2 &= M_RDMEM_OPCODE(); port_w( 2, R.P2 ); }
263static void anld_p4_a(void)    { port_w( 4, port_r(4) & M_RDMEM_OPCODE() ); }
264static void anld_p5_a(void)    { port_w( 5, port_r(5) & M_RDMEM_OPCODE() ); }
265static void anld_p6_a(void)    { port_w( 6, port_r(6) & M_RDMEM_OPCODE() ); }
266static void anld_p7_a(void)    { port_w( 7, port_r(7) & M_RDMEM_OPCODE() ); }
291
292static void anl_p1_n(void)
293{
294   R.P1 &= M_RDMEM_OPCODE();
295   port_w( 1, R.P1 );
296}
297
298static void anl_p2_n(void)
299{
300   R.P2 &= M_RDMEM_OPCODE();
301   port_w( 2, R.P2 );
302}
303
304static void anld_p4_a(void)    { port_w( 4, (port_r(4) & M_RDMEM_OPCODE()) & 0x0f ); }
305static void anld_p5_a(void)    { port_w( 5, (port_r(5) & M_RDMEM_OPCODE()) & 0x0f ); }
306static void anld_p6_a(void)    { port_w( 6, (port_r(6) & M_RDMEM_OPCODE()) & 0x0f ); }
307static void anld_p7_a(void)    { port_w( 7, (port_r(7) & M_RDMEM_OPCODE()) & 0x0f ); }
267308static void call(void)       { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | a11); }
268309static void call_1(void)    { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x100 | a11); }
269310static void call_2(void)    { UINT8 i=M_RDMEM_OPCODE(); UINT16 a11 = (R.irq_executing == I8039_NO_INT) ? R.A11 : 0; M_CALL(i | 0x200 | a11); }
r1527r1528
314355static void inc_r5(void)    { R5++; }
315356static void inc_r6(void)    { R6++; }
316357static void inc_r7(void)    { R7++; }
317static void inc_xr0(void)    { intRAM[R0 & 0x7f]++; }
318static void inc_xr1(void)    { intRAM[R1 & 0x7f]++; }
358static void inc_xr0(void)    { INTRAM_W(R0, INTRAM_R(R0) + 1); }
359static void inc_xr1(void)    { INTRAM_W(R1, INTRAM_R(R1) + 1); }
319360
320361static void jmp(void)
321362{
r1527r1528
370411static void mov_a_r6(void)    { R.A = R6; }
371412static void mov_a_r7(void)    { R.A = R7; }
372413static void mov_a_psw(void)    { R.A = R.PSW; }
373static void mov_a_xr0(void)    { R.A = intRAM[R0 & 0x7f]; }
374static void mov_a_xr1(void)    { R.A = intRAM[R1 & 0x7f]; }
414static void mov_a_xr0(void)    { R.A = INTRAM_R(R0); }
415static void mov_a_xr1(void)    { R.A = INTRAM_R(R1); }
375416static void mov_r0_a(void)    { R0 = R.A; }
376417static void mov_r1_a(void)    { R1 = R.A; }
377418static void mov_r2_a(void)    { R2 = R.A; }
r1527r1528
391432static void mov_r7_n(void)    { R7 = M_RDMEM_OPCODE(); }
392433static void mov_a_t(void)    { R.A = R.timer; }
393434static void mov_t_a(void)    { R.timer = R.A; }
394static void mov_xr0_a(void)    { intRAM[R0 & 0x7f] = R.A; }
395static void mov_xr1_a(void)    { intRAM[R1 & 0x7f] = R.A; }
396static void mov_xr0_n(void)    { intRAM[R0 & 0x7f] = M_RDMEM_OPCODE(); }
397static void mov_xr1_n(void)    { intRAM[R1 & 0x7f] = M_RDMEM_OPCODE(); }
398static void movd_a_p4(void)    { R.A = port_r(4); }
399static void movd_a_p5(void)    { R.A = port_r(5); }
400static void movd_a_p6(void)    { R.A = port_r(6); }
401static void movd_a_p7(void)    { R.A = port_r(7); }
402static void movd_p4_a(void)    { port_w(4, R.A); }
403static void movd_p5_a(void)    { port_w(5, R.A); }
404static void movd_p6_a(void)    { port_w(6, R.A); }
405static void movd_p7_a(void)    { port_w(7, R.A); }
435static void mov_xr0_a(void)    { INTRAM_W(R0, R.A); }
436static void mov_xr1_a(void)    { INTRAM_W(R1, R.A); }
437static void mov_xr0_n(void)    { INTRAM_W(R0, M_RDMEM_OPCODE()); }
438static void mov_xr1_n(void)    { INTRAM_W(R1, M_RDMEM_OPCODE()); }
439static void movd_a_p4(void)    { R.A = port_r(4) & 0x0F; }
440static void movd_a_p5(void)    { R.A = port_r(5) & 0x0F; }
441static void movd_a_p6(void)    { R.A = port_r(6) & 0x0F; }
442static void movd_a_p7(void)    { R.A = port_r(7) & 0x0F; }
443static void movd_p4_a(void)    { port_w(4, R.A & 0x0F); }
444static void movd_p5_a(void)    { port_w(5, R.A & 0x0F); }
445static void movd_p6_a(void)    { port_w(6, R.A & 0x0F); }
446static void movd_p7_a(void)    { port_w(7, R.A & 0x0F); }
406447static void movp_a_xa(void)    { R.A = M_RDMEM((R.PC.w.l & 0x0f00) | R.A); }
407448static void movp3_a_xa(void) { R.A = M_RDMEM(0x300 | R.A); }
408449static void movx_a_xr0(void) { R.A = M_IN(R0); }
r1527r1528
419460static void orl_a_r5(void)    { R.A |= R5; }
420461static void orl_a_r6(void)    { R.A |= R6; }
421462static void orl_a_r7(void)    { R.A |= R7; }
422static void orl_a_xr0(void)    { R.A |= intRAM[R0 & 0x7f]; }
423static void orl_a_xr1(void)    { R.A |= intRAM[R1 & 0x7f]; }
463static void orl_a_xr0(void)    { R.A |= INTRAM_R(R0); }
464static void orl_a_xr1(void)    { R.A |= INTRAM_R(R1); }
424465static void orl_bus_n(void)    { bus_w( bus_r() | M_RDMEM_OPCODE() ); }
425static void orl_p1_n(void)    { R.P1 |= M_RDMEM_OPCODE(); port_w(1, R.P1); }
426static void orl_p2_n(void)    { R.P2 |= M_RDMEM_OPCODE(); port_w(2, R.P2); }
466static void orl_p1_n(void)
467{
468   R.P1 |= M_RDMEM_OPCODE();
469   port_w(1, R.P1);
470}
471
472static void orl_p2_n(void)
473{
474   R.P2 |= M_RDMEM_OPCODE();
475   port_w(2, R.P2);
476}
477
427478static void orld_p4_a(void)    { port_w(4, port_r(4) | R.A ); }
428479static void orld_p5_a(void)    { port_w(5, port_r(5) | R.A ); }
429480static void orld_p6_a(void)    { port_w(6, port_r(6) | R.A ); }
r1527r1528
473524static void xch_a_r5(void)    { UINT8 i=R.A; R.A=R5; R5=i; }
474525static void xch_a_r6(void)    { UINT8 i=R.A; R.A=R6; R6=i; }
475526static void xch_a_r7(void)    { UINT8 i=R.A; R.A=R7; R7=i; }
476static void xch_a_xr0(void)    { UINT8 i=R.A; R.A=intRAM[R0 & 0x7f]; intRAM[R0 & 0x7f]=i; }
477static void xch_a_xr1(void)    { UINT8 i=R.A; R.A=intRAM[R1 & 0x7f]; intRAM[R1 & 0x7f]=i; }
478static void xchd_a_xr0(void) { M_XCHD(R0 & 0x7f); }
479static void xchd_a_xr1(void) { M_XCHD(R1 & 0x7f); }
527static void xch_a_xr0(void)    { UINT8 i=R.A; R.A=INTRAM_R(R0); INTRAM_W(R0, i); }
528static void xch_a_xr1(void)    { UINT8 i=R.A; R.A=INTRAM_R(R1); INTRAM_W(R1, i); }
529static void xchd_a_xr0(void) { M_XCHD(R0); }
530static void xchd_a_xr1(void) { M_XCHD(R1); }
480531static void xrl_a_n(void)    { R.A ^= M_RDMEM_OPCODE(); }
481532static void xrl_a_r0(void)    { R.A ^= R0; }
482533static void xrl_a_r1(void)    { R.A ^= R1; }
r1527r1528
486537static void xrl_a_r5(void)    { R.A ^= R5; }
487538static void xrl_a_r6(void)    { R.A ^= R6; }
488539static void xrl_a_r7(void)    { R.A ^= R7; }
489static void xrl_a_xr0(void)    { R.A ^= intRAM[R0 & 0x7f]; }
490static void xrl_a_xr1(void)    { R.A ^= intRAM[R1 & 0x7f]; }
540static void xrl_a_xr0(void)    { R.A ^= INTRAM_R(R0); }
541static void xrl_a_xr1(void)    { R.A ^= INTRAM_R(R1); }
491542
492543static const s_opcode opcode_main[256]=
493544{
494   {1, nop       },{0, illegal   },{2, outl_bus_a },{2, add_a_n     },{2, jmp       },{1, en_i      },{0, illegal    },{1, dec_a     },
495   {2, ins_a_bus  },{2, in_a_p1   },{2, in_a_p2    },{0, illegal     },{2, movd_a_p4  },{2, movd_a_p5   },{2, movd_a_p6  },{2, movd_a_p7  },
496   {1, inc_xr0    },{1, inc_xr1   },{2, jb_0       },{2, adc_a_n     },{2, call      },{1, dis_i      },{2, jtf       },{1, inc_a     },
497   {1, inc_r0      },{1, inc_r1    },{1, inc_r2    },{1, inc_r3     },{1, inc_r4      },{1, inc_r5    },{1, inc_r6    },{1, inc_r7     },
498   {1, xch_a_xr0  },{1, xch_a_xr1   },{0, illegal    },{2, mov_a_n     },{2, jmp_1      },{1, en_tcnti   },{2, jnt_0     },{1, clr_a     },
499   {1, xch_a_r0   },{1, xch_a_r1   },{1, xch_a_r2    },{1, xch_a_r3   },{1, xch_a_r4   },{1, xch_a_r5   },{1, xch_a_r6    },{1, xch_a_r7   },
500   {1, xchd_a_xr0 },{1, xchd_a_xr1 },{2, jb_1       },{0, illegal     },{2, call_1      },{1, dis_tcnti   },{2, jt_0       },{1, cpl_a     },
501   {0, illegal    },{2, outl_p1_a   },{2, outl_p2_a  },{0, illegal     },{2, movd_p4_a  },{2, movd_p5_a   },{2, movd_p6_a  },{2, movd_p7_a  },
502   {1, orl_a_xr0  },{1, orl_a_xr1   },{1, mov_a_t    },{2, orl_a_n     },{2, jmp_2      },{1, strt_cnt   },{2, jnt_1     },{1, swap_a     },
503   {1, orl_a_r0   },{1, orl_a_r1   },{1, orl_a_r2    },{1, orl_a_r3   },{1, orl_a_r4   },{1, orl_a_r5   },{1, orl_a_r6    },{1, orl_a_r7   },
504   {1, anl_a_xr0  },{1, anl_a_xr1   },{2, jb_2       },{2, anl_a_n     },{2, call_2      },{1, strt_t    },{2, jt_1       },{1, daa_a     },
505   {1, anl_a_r0   },{1, anl_a_r1   },{1, anl_a_r2    },{1, anl_a_r3   },{1, anl_a_r4   },{1, anl_a_r5   },{1, anl_a_r6    },{1, anl_a_r7   },
506   {1, add_a_xr0  },{1, add_a_xr1   },{1, mov_t_a    },{0, illegal     },{2, jmp_3      },{1, stop_tcnt   },{0, illegal    },{1, rrc_a     },
507   {1, add_a_r0   },{1, add_a_r1   },{1, add_a_r2    },{1, add_a_r3   },{1, add_a_r4   },{1, add_a_r5   },{1, add_a_r6    },{1, add_a_r7   },
508   {1, adc_a_xr0  },{1, adc_a_xr1   },{2, jb_3       },{0, illegal     },{2, call_3      },{1, ento_clk   },{2, jf1       },{1, rr_a      },
509   {1, adc_a_r0   },{1, adc_a_r1   },{1, adc_a_r2    },{1, adc_a_r3   },{1, adc_a_r4   },{1, adc_a_r5   },{1, adc_a_r6    },{1, adc_a_r7   },
510   {2, movx_a_xr0 },{2, movx_a_xr1 },{0, illegal    },{2, ret        },{2, jmp_4      },{1, clr_f0    },{2, jni       },{0, illegal     },
511   {2, orl_bus_n  },{2, orl_p1_n   },{2, orl_p2_n    },{0, illegal     },{2, orld_p4_a  },{2, orld_p5_a   },{2, orld_p6_a  },{2, orld_p7_a  },
512   {2, movx_xr0_a },{2, movx_xr1_a },{2, jb_4       },{2, retr      },{2, call_4      },{1, cpl_f0    },{2, jnz       },{1, clr_c     },
513   {2, anl_bus_n  },{2, anl_p1_n   },{2, anl_p2_n    },{0, illegal     },{2, anld_p4_a  },{2, anld_p5_a   },{2, anld_p6_a  },{2, anld_p7_a  },
514   {1, mov_xr0_a  },{1, mov_xr1_a   },{0, illegal    },{2, movp_a_xa  },{2, jmp_5      },{1, clr_f1    },{0, illegal    },{1, cpl_c     },
515   {1, mov_r0_a   },{1, mov_r1_a   },{1, mov_r2_a    },{1, mov_r3_a   },{1, mov_r4_a   },{1, mov_r5_a   },{1, mov_r6_a    },{1, mov_r7_a   },
516   {2, mov_xr0_n  },{2, mov_xr1_n   },{2, jb_5       },{2, jmpp_xa     },{2, call_5      },{1, cpl_f1    },{2, jf0       },{0, illegal     },
517   {2, mov_r0_n   },{2, mov_r1_n   },{2, mov_r2_n    },{2, mov_r3_n   },{2, mov_r4_n   },{2, mov_r5_n   },{2, mov_r6_n    },{2, mov_r7_n   },
518   {0, illegal    },{0, illegal   },{0, illegal    },{0, illegal     },{2, jmp_6      },{1, sel_rb0   },{2, jz       },{1, mov_a_psw  },
519   {1, dec_r0      },{1, dec_r1    },{1, dec_r2    },{1, dec_r3     },{1, dec_r4      },{1, dec_r5    },{1, dec_r6    },{1, dec_r7     },
520   {1, xrl_a_xr0  },{1, xrl_a_xr1   },{2, jb_6       },{2, xrl_a_n     },{2, call_6      },{1, sel_rb1   },{0, illegal    },{1, mov_psw_a  },
521   {1, xrl_a_r0   },{1, xrl_a_r1   },{1, xrl_a_r2    },{1, xrl_a_r3   },{1, xrl_a_r4   },{1, xrl_a_r5   },{1, xrl_a_r6    },{1, xrl_a_r7   },
522   {0, illegal    },{0, illegal   },{0, illegal    },{2, movp3_a_xa },{2, jmp_7      },{1, sel_mb0   },{2, jnc       },{1, rl_a      },
523   {2, djnz_r0    },{2, djnz_r1   },{2, djnz_r2    },{2, djnz_r3     },{2, djnz_r4    },{2, djnz_r5   },{2, djnz_r6    },{2, djnz_r7     },
524   {1, mov_a_xr0  },{1, mov_a_xr1   },{2, jb_7       },{0, illegal     },{2, call_7      },{1, sel_mb1   },{2, jc       },{1, rlc_a     },
525   {1, mov_a_r0   },{1, mov_a_r1   },{1, mov_a_r2    },{1, mov_a_r3   },{1, mov_a_r4   },{1, mov_a_r5   },{1, mov_a_r6    },{1, mov_a_r7   }
545   {1, nop          },{0, illegal   },{2, outl_bus_a},{2, add_a_n   },{2, jmp          },{1, en_i      },{0, illegal   },{1, dec_a      },
546   {2, ins_a_bus  },{2, in_a_p1   },{2, in_a_p2   },{0, illegal   },{2, movd_a_p4 },{2, movd_a_p5   },{2, movd_a_p6   },{2, movd_a_p7 },
547   {1, inc_xr0    },{1, inc_xr1   },{2, jb_0      },{2, adc_a_n   },{2, call         },{1, dis_i      },{2, jtf      },{1, inc_a      },
548   {1, inc_r0      },{1, inc_r1    },{1, inc_r2   },{1, inc_r3   },{1, inc_r4   },{1, inc_r5    },{1, inc_r6   },{1, inc_r7   },
549   {1, xch_a_xr0  },{1, xch_a_xr1   },{0, illegal   },{2, mov_a_n   },{2, jmp_1         },{1, en_tcnti   },{2, jnt_0    },{1, clr_a        },
550   {1, xch_a_r0   },{1, xch_a_r1   },{1, xch_a_r2   },{1, xch_a_r3  },{1, xch_a_r4  },{1, xch_a_r5   },{1, xch_a_r6   },{1, xch_a_r7  },
551   {1, xchd_a_xr0 },{1, xchd_a_xr1   },{2, jb_1      },{0, illegal   },{2, call_1   },{1, dis_tcnti   },{2, jt_0      },{1, cpl_a        },
552   {0, illegal    },{2, outl_p1_a   },{2, outl_p2_a   },{0, illegal   },{2, movd_p4_a },{2, movd_p5_a   },{2, movd_p6_a },{2, movd_p7_a },
553   {1, orl_a_xr0  },{1, orl_a_xr1   },{1, mov_a_t   },{2, orl_a_n   },{2, jmp_2         },{1, strt_cnt   },{2, jnt_1    },{1, swap_a   },
554   {1, orl_a_r0   },{1, orl_a_r1   },{1, orl_a_r2   },{1, orl_a_r3  },{1, orl_a_r4  },{1, orl_a_r5   },{1, orl_a_r6   },{1, orl_a_r7  },
555   {1, anl_a_xr0  },{1, anl_a_xr1   },{2, jb_2      },{2, anl_a_n   },{2, call_2   },{1, strt_t    },{2, jt_1      },{1, daa_a        },
556   {1, anl_a_r0   },{1, anl_a_r1   },{1, anl_a_r2   },{1, anl_a_r3  },{1, anl_a_r4  },{1, anl_a_r5   },{1, anl_a_r6   },{1, anl_a_r7  },
557   {1, add_a_xr0  },{1, add_a_xr1   },{1, mov_t_a   },{0, illegal   },{2, jmp_3         },{1, stop_tcnt   },{0, illegal   },{1, rrc_a        },
558   {1, add_a_r0   },{1, add_a_r1   },{1, add_a_r2   },{1, add_a_r3  },{1, add_a_r4  },{1, add_a_r5   },{1, add_a_r6   },{1, add_a_r7  },
559   {1, adc_a_xr0  },{1, adc_a_xr1   },{2, jb_3      },{0, illegal   },{2, call_3   },{1, ento_clk   },{2, jf1      },{1, rr_a         },
560   {1, adc_a_r0   },{1, adc_a_r1   },{1, adc_a_r2   },{1, adc_a_r3  },{1, adc_a_r4  },{1, adc_a_r5   },{1, adc_a_r6   },{1, adc_a_r7  },
561   {2, movx_a_xr0 },{2, movx_a_xr1 },{0, illegal   },{2, ret      },{2, jmp_4         },{1, clr_f0    },{2, jni      },{0, illegal   },
562   {2, orl_bus_n  },{2, orl_p1_n   },{2, orl_p2_n   },{0, illegal   },{2, orld_p4_a },{2, orld_p5_a   },{2, orld_p6_a },{2, orld_p7_a },
563   {2, movx_xr0_a },{2, movx_xr1_a },{2, jb_4      },{2, retr      },{2, call_4   },{1, cpl_f0    },{2, jnz      },{1, clr_c        },
564   {2, anl_bus_n  },{2, anl_p1_n   },{2, anl_p2_n   },{0, illegal   },{2, anld_p4_a },{2, anld_p5_a   },{2, anld_p6_a },{2, anld_p7_a },
565   {1, mov_xr0_a  },{1, mov_xr1_a   },{0, illegal   },{2, movp_a_xa },{2, jmp_5         },{1, clr_f1    },{0, illegal   },{1, cpl_c        },
566   {1, mov_r0_a   },{1, mov_r1_a   },{1, mov_r2_a   },{1, mov_r3_a  },{1, mov_r4_a  },{1, mov_r5_a   },{1, mov_r6_a   },{1, mov_r7_a  },
567   {2, mov_xr0_n  },{2, mov_xr1_n   },{2, jb_5      },{2, jmpp_xa   },{2, call_5   },{1, cpl_f1    },{2, jf0      },{0, illegal   },
568   {2, mov_r0_n   },{2, mov_r1_n   },{2, mov_r2_n   },{2, mov_r3_n  },{2, mov_r4_n  },{2, mov_r5_n   },{2, mov_r6_n   },{2, mov_r7_n  },
569   {0, illegal    },{0, illegal   },{0, illegal   },{0, illegal   },{2, jmp_6         },{1, sel_rb0   },{2, jz      },{1, mov_a_psw },
570   {1, dec_r0      },{1, dec_r1    },{1, dec_r2   },{1, dec_r3   },{1, dec_r4   },{1, dec_r5    },{1, dec_r6   },{1, dec_r7   },
571   {1, xrl_a_xr0  },{1, xrl_a_xr1   },{2, jb_6      },{2, xrl_a_n   },{2, call_6   },{1, sel_rb1   },{0, illegal   },{1, mov_psw_a },
572   {1, xrl_a_r0   },{1, xrl_a_r1   },{1, xrl_a_r2   },{1, xrl_a_r3  },{1, xrl_a_r4  },{1, xrl_a_r5   },{1, xrl_a_r6   },{1, xrl_a_r7  },
573   {0, illegal    },{0, illegal   },{0, illegal   },{2, movp3_a_xa},{2, jmp_7      },{1, sel_mb0   },{2, jnc      },{1, rl_a         },
574   {2, djnz_r0    },{2, djnz_r1   },{2, djnz_r2   },{2, djnz_r3   },{2, djnz_r4   },{2, djnz_r5   },{2, djnz_r6   },{2, djnz_r7   },
575   {1, mov_a_xr0  },{1, mov_a_xr1   },{2, jb_7      },{0, illegal   },{2, call_7   },{1, sel_mb1   },{2, jc      },{1, rlc_a        },
576   {1, mov_a_r0   },{1, mov_a_r1   },{1, mov_a_r2   },{1, mov_a_r3  },{1, mov_a_r4  },{1, mov_a_r5   },{1, mov_a_r6   },{1, mov_a_r7  }
526577};
527578
528579
r1527r1528
559610   state_save_register_item("i8039", index, R.irq_state);
560611   state_save_register_item("i8039", index, R.irq_extra_cycles);
561612   state_save_register_item("i8039", index, R.Old_T1);
613
614   R.cpu_feature = 0;
615   R.ram_mask = 0x7F;
616   R.int_rom_size = 0x800;
617   /* not changed on reset*/
618   memset(R.RAM, 0x00, 128);
619   R.timer = 0;
562620}
563621
622static void i8035_init (int index, int clock, const void *config, int (*irqcallback)(int))
623{
624   i8039_init(index, clock, config, irqcallback);
625   R.ram_mask = 0x3F;
626   R.int_rom_size = 0x400;
627}
628
629#if (HAS_M58715)
630static void m58715_init (int index, int clock, const void *config, int (*irqcallback)(int))
631{
632   i8039_init(index, clock, config, irqcallback);
633   R.cpu_feature = FEATURE_M58715;
634}
635#endif
636
564637/****************************************************************************
565638 * Reset registers to their initial values
566639 ****************************************************************************/
r1527r1528
569642   R.PC.w.l = 0;
570643   R.SP  = 0;
571644   R.A   = 0;
572   R.PSW = 0x08;      /* Start with Carry SET, Bit 4 is always SET */
573   memset(R.RAM, 0x0, 128);
645   R.PSW = 0x08;      /* Start with No Carry, Bit 4 is always SET */
646   //R.PSW = C_FLAG | 0x08;
574647   R.P1  = 0xff;
575648   R.P2  = 0xff;
576649   R.bus = 0;
r1527r1528
580653   R.A11     = 0;
581654   R.tirq_en = R.xirq_en = 0;
582655   R.timerON = R.countON = 0;
583   R.timerON = 1;  /* Mario Bros. doesn't work without this */
656
657   if (R.cpu_feature & FEATURE_M58715)
658   {
659      //R.timerON = 1;  /* Mario Bros. doesn't work without this */
660      //R.PSW |= C_FLAG; //MB will play startup sound, but wrong # */
661   }
584662   R.irq_extra_cycles = 0;
585663   R.masterClock = 0;
586664}
r1527r1528
657735 ****************************************************************************/
658736static int i8039_execute(int cycles)
659737{
660   unsigned opcode, T1;
738   unsigned opcode, T1, timerInt;
661739   int count;
662740
663741   i8039_ICount = (cycles - R.irq_extra_cycles);
r1527r1528
674752/*      logerror("I8039:  PC = %04x,  opcode = %02x\n", R.PC.w.l, opcode); */
675753
676754      R.PC.w.l++;
677      inst_cycles = opcode_main[opcode].cycles;
755      R.inst_cycles = opcode_main[opcode].cycles;
678756      (*(opcode_main[opcode].function))();
679      i8039_ICount -= inst_cycles; ///
757      i8039_ICount -= R.inst_cycles; ///
680758
759      timerInt = 0;
681760      if (R.countON)   /* NS990113 */
682761      {
683         for ( ; inst_cycles > 0; inst_cycles-- )
762         for ( ; R.inst_cycles > 0; R.inst_cycles-- )
684763         {
685764            T1 = test_r(1);
686765            if (POSITIVE_EDGE_T1)
687766            {
688767               R.timer++;
689               if (R.timer == 0) {
690                  count = Timer_IRQ();   /* Handle Counter IRQ */
691                  i8039_ICount -= count;
692               }
768               if (R.timer == 0)
769                  timerInt = 1;
693770            }
694771            R.Old_T1 = T1;
695772         }
r1527r1528
700777         if (R.masterClock >= 32) {   /* NS990113 */
701778            R.masterClock -= 32;
702779            R.timer++;
703            if (R.timer == 0) {
704               count = Timer_IRQ();   /* Handle Timer IRQ */
705               i8039_ICount -= count;
706            }
780            if (R.timer == 0)
781               timerInt = 1;
707782         }
708783      }
784
785      if (timerInt)
786      {
787         count = Timer_IRQ();   /* Handle Timer IRQ */
788         i8039_ICount -= count;
789      }
790
709791   } while (i8039_ICount>0);
710792
711793   i8039_ICount -= R.irq_extra_cycles;
r1527r1528
790872      case CPUINFO_INT_REGISTER + I8039_R5:         R5 = info->i;                     break;
791873      case CPUINFO_INT_REGISTER + I8039_R6:         R6 = info->i;                     break;
792874      case CPUINFO_INT_REGISTER + I8039_R7:         R7 = info->i;                     break;
875      case CPUINFO_INT_REGISTER + I8039_EA:         R.EA = info->i;                     break;
793876   }
794877}
795878
r1527r1528
808891      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
809892      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
810893      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
811      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = I8039_CLOCK_DIVIDER;         break;
894      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
895      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 3*5;                     break;
812896      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
813897      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
814898      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
r1527r1528
845929      case CPUINFO_INT_REGISTER + I8039_R5:         info->i = R5;                     break;
846930      case CPUINFO_INT_REGISTER + I8039_R6:         info->i = R6;                     break;
847931      case CPUINFO_INT_REGISTER + I8039_R7:         info->i = R7;                     break;
932      case CPUINFO_INT_REGISTER + I8039_EA:         info->i = R.EA;                     break;
848933
849934      /* --- the following bits of info are returned as pointers to data or functions --- */
850935      case CPUINFO_PTR_SET_INFO:                  info->setinfo = i8039_set_info;         break;
r1527r1528
868953      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Mirko Buffoni\nBased on the original work Copyright Dan Boris"); break;
869954
870955      case CPUINFO_STR_FLAGS:
871         sprintf(info->s, "%c%c%c%c%c%c%c%c",
956         sprintf(info->s, "%c %c%c%c%c%c%c%c%c",
957            R.A11        ? 'M':'.',
872958            R.PSW & 0x80 ? 'C':'.',
873959            R.PSW & 0x40 ? 'A':'.',
874960            R.PSW & 0x20 ? 'F':'.',
r1527r1528
894980      case CPUINFO_STR_REGISTER + I8039_R5:         sprintf(info->s, "R5:%02X", R.RAM[R.regPtr+5]); break;
895981      case CPUINFO_STR_REGISTER + I8039_R6:         sprintf(info->s, "R6:%02X", R.RAM[R.regPtr+6]); break;
896982      case CPUINFO_STR_REGISTER + I8039_R7:         sprintf(info->s, "R7:%02X", R.RAM[R.regPtr+7]); break;
983      case CPUINFO_STR_REGISTER + I8039_EA:         sprintf(info->s, "EA:%02X", R.EA); break;
897984   }
898985}
899986
r1527r1528
909996   {
910997      /* --- the following bits of info are returned as NULL-terminated strings --- */
911998      case CPUINFO_STR_NAME:                     strcpy(info->s, "I8035");            break;
999      case CPUINFO_PTR_INIT:                     info->init = i8035_init;            break;
9121000
9131001      default:                              i8039_get_info(state, info);         break;
9141002   }
r1527r1528
9261014   {
9271015      /* --- the following bits of info are returned as NULL-terminated strings --- */
9281016      case CPUINFO_STR_NAME:                     strcpy(info->s, "I8048");            break;
1017      case CPUINFO_PTR_INIT:                     info->init = i8035_init;            break;
9291018
9301019      default:                              i8039_get_info(state, info);         break;
9311020   }
r1527r1528
9431032   {
9441033      /* --- the following bits of info are returned as NULL-terminated strings --- */
9451034      case CPUINFO_STR_NAME:                     strcpy(info->s, "N7751");            break;
1035      case CPUINFO_PTR_INIT:                     info->init = i8039_init;            break;
9461036
9471037      default:                              i8039_get_info(state, info);         break;
9481038   }
9491039}
9501040#endif
1041
1042#if (HAS_MB8884)
1043/**************************************************************************
1044 * CPU-specific get_info/set_info
1045 **************************************************************************/
1046void mb8884_get_info(UINT32 state, cpuinfo *info)
1047{
1048   switch (state)
1049   {
1050      /* --- the following bits of info are returned as NULL-terminated strings --- */
1051      case CPUINFO_STR_NAME:                     strcpy(info->s, "MB8884");            break;
1052      case CPUINFO_PTR_INIT:                     info->init = i8035_init;            break;
1053
1054      default:                              i8039_get_info(state, info);         break;
1055   }
1056}
1057#endif
1058
1059#if (HAS_M58715)
1060/**************************************************************************
1061 * CPU-specific get_info/set_info
1062 **************************************************************************/
1063void m58715_get_info(UINT32 state, cpuinfo *info)
1064{
1065   switch (state)
1066   {
1067      /* --- the following bits of info are returned as NULL-terminated strings --- */
1068      case CPUINFO_STR_NAME:                     strcpy(info->s, "M58715");            break;
1069      case CPUINFO_PTR_INIT:                     info->init = m58715_init;            break;
1070
1071      default:                              i8039_get_info(state, info);         break;
1072   }
1073}
1074#endif
src/emu/cpu/hd6309/hd6309.c
r1527r1528
12431243      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
12441244      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
12451245      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
1246      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
12461247      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
12471248      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
12481249      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
src/emu/cpu/tlcs90/tlcs90.c
r1527r1528
27302730      case CPUINFO_INT_INPUT_LINES:                        info->i = 1;               break;
27312731      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:                  info->i = 0xff;               break;
27322732      case CPUINFO_INT_ENDIANNESS:                        info->i = CPU_IS_LE;         break;
2733      case CPUINFO_INT_CLOCK_MULTIPLIER:                     info->i = 1;               break;
27332734      case CPUINFO_INT_CLOCK_DIVIDER:                        info->i = 1;               break;
27342735      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:                  info->i = 1;               break;
27352736      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:                  info->i = 6;               break;
src/emu/cpu/s2650/s2650.c
r1527r1528
15191519      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
15201520      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
15211521      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1522      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
15221523      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
15231524      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
15241525      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
src/emu/cpu/cdp1802/cdp1802.c
r1527r1528
941941      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
942942      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
943943      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
944      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
944945      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
945946      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
946947      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
src/emu/cpu/se3208/se3208.c
r1527r1528
18601860      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
18611861      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
18621862      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1863      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
18631864      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
18641865      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
18651866      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
src/emu/cpu/e132xs/e132xs.c
r1527r1528
49134913      case CPUINFO_INT_INPUT_LINES:               info->i = 8;                     break;
49144914      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
49154915      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
4916      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
49164917      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
49174918      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
49184919      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 6;                     break;
src/emu/cpu/i386/i386dasm.c
r1527r1528
21122112   sprintf(s, "???");
21132113}
21142114
2115int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode)
2115static int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode)
21162116{
21172117   UINT8 op;
21182118
src/emu/cpu/i386/i386.c
r1527r1528
855855      case CPUINFO_INT_INPUT_LINES:               info->i = 32;                     break;
856856      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
857857      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
858      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
858859      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
859860      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
860861      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 15;                     break;
src/emu/cpu/mc68hc11/mc68hc11.c
r1527r1528
423423      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
424424      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
425425      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
426      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
426427      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
427428      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
428429      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
src/emu/cpu/adsp2100/adsp2100.c
r1527r1528
18211821      case CPUINFO_INT_INPUT_LINES:               /* set per CPU */                  break;
18221822      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
18231823      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1824      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
18241825      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
18251826      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
18261827      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/dsp32/dsp32.c
r1527r1528
787787      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
788788      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
789789      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
790      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
790791      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
791792      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
792793      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/rsp/rsp.c
r1527r1528
4949   VECTOR_REG v[32];
5050   UINT16 flag[4];
5151   UINT32 sr;
52    UINT32 step_count;
5253
5354   INT64 accum[8];
5455   INT32 square_root_res;
r1527r1528
344345
345346static void rsp_init(int index, int clock, const void *_config, int (*irqcallback)(int))
346347{
347   //int regIdx, accumIdx;
348    // int regIdx;
349    int accumIdx;
348350   config = (rsp_config *)_config;
349351
350352#if LOG_INSTRUCTION_EXECUTION
r1527r1528
352354#endif
353355
354356   rsp.irq_callback = irqcallback;
357
355358#if 0
359    // Do not enable!  RSP registers are in a *random* state at powerup...
356360   for(regIdx = 0; regIdx < 32; regIdx++ )
357361   {
358362      rsp.r[regIdx] = 0;
359363      rsp.v[regIdx].d[0] = 0;
360364      rsp.v[regIdx].d[1] = 0;
361365   }
362   for(accumIdx = 0; accumIdx < 8; accumIdx++ )
363   {
364      rsp.accum[accumIdx] = 0;
365   }
366366   rsp.flag[0] = 0;
367367   rsp.flag[1] = 0;
368368   rsp.flag[2] = 0;
r1527r1528
372372   rsp.reciprocal_res = 0;
373373   rsp.reciprocal_high = 0;
374374#endif
375
376    // ...except for the accumulators.
377    for(accumIdx = 0; accumIdx < 8; accumIdx++ )
378    {
379        rsp.accum[accumIdx] = 0;
380    }
381
375382   rsp.sr = RSP_STATUS_HALT;
383    rsp.step_count = 0;
376384}
377385
378386static void rsp_exit(void)
r1527r1528
27832791
27842792      if( rsp.sr & RSP_STATUS_SSTEP )
27852793      {
2786         rsp.sr |= RSP_STATUS_BROKE;
2794            if( rsp.step_count )
2795            {
2796                rsp.step_count--;
2797            }
2798            else
2799            {
2800                rsp.sr |= RSP_STATUS_BROKE;
2801            }
27872802      }
27882803
27892804      if( rsp.sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
r1527r1528
28692884        case CPUINFO_INT_REGISTER + RSP_R30:            rsp.r[30] = info->i;        break;
28702885        case CPUINFO_INT_SP:
28712886        case CPUINFO_INT_REGISTER + RSP_R31:            rsp.r[31] = info->i;        break;
2872        case CPUINFO_INT_REGISTER + RSP_SR:             rsp.sr = info->i;        break;
2887        case CPUINFO_INT_REGISTER + RSP_SR:
2888            rsp.sr = info->i;
2889            if( info->i & RSP_STATUS_SSTEP )
2890            {
2891                rsp.step_count = 1;
2892            }
2893            break;
28732894        case CPUINFO_INT_REGISTER + RSP_NEXTPC:         rsp.nextpc = info->i;        break;
28742895   }
28752896}
r1527r1528
28832904      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
28842905      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
28852906      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
2907      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
28862908      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
28872909      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
28882910      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/cop400/cop410.c
r1527r1528
308308      case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
309309      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
310310      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
311      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = COP400_CLOCK_DIVIDER;         break;
311      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
312      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
312313      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
313314      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
314315      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
src/emu/cpu/cop400/cop420.c
r1527r1528
336336      case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
337337      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
338338      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
339      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = COP400_CLOCK_DIVIDER;         break;
339      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
340      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
340341      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
341342      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
342343      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
src/emu/cpu/cop400/cop400.h
r1527r1528
1616#define INLINE static inline
1717#endif
1818
19#define COP400_CLOCK_DIVIDER   4
20
2119#define COP400_PORT_L   0x100
2220#define COP400_PORT_G   0x101
2321#define COP400_PORT_D   0x102
src/emu/cpu/m6502/m4510.c
r1527r1528
433433      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
434434      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
435435      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
436      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
436437      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
437438      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
438439      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
src/emu/cpu/m6502/m6502.c
r1527r1528
699699      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
700700      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
701701      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
702      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
702703      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
703704      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
704705      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/m6502/m6509.c
r1527r1528
323323      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
324324      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
325325      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
326      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
326327      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
327328      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
328329      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
src/emu/cpu/jaguar/jaguar.c
r1527r1528
15811581      case CPUINFO_INT_INPUT_LINES:               info->i = 5;                     break;
15821582      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
15831583      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
1584      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
15841585      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
15851586      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
15861587      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 6;                     break;
src/emu/cpu/ssp1610/ssp1610.c
r1527r1528
758758      case CPUINFO_INT_INPUT_LINES:               info->i = 3;                     break;
759759      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
760760      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
761      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
761762      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
762763      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
763764      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/i8085/i8085.c
r1527r1528
16301630      case CPUINFO_INT_INPUT_LINES:               info->i = 4;                     break;
16311631      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
16321632      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1633      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
16331634      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
16341635      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
16351636      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
src/emu/cpu/powerpc/ppc.c
r1527r1528
17401740      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
17411741      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
17421742      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
1743      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
17431744      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
17441745      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
17451746      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/powerpc/ppcdrc.c
r1527r1528
20852085      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
20862086      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
20872087      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
2088      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
20882089      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
20892090      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
20902091      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/arm/arm.c
r1527r1528
14681468      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
14691469      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
14701470      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1471      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
14711472      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
14721473      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
14731474      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/z8000/z8000.c
r1527r1528
629629      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
630630      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
631631      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
632      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
632633      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
633634      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
634635      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 6;                     break;
src/emu/cpu/tms32010/tms32010.h
r1527r1528
1919
2020
2121
22/**************************************************************************
23 *  Internal Clock divisor
24 *
25 *  External Clock is divided internally by 4, to produce the states
26 *  used in carrying out an instruction (machine) cycle.
27 */
28
29#define TMS32010_CLOCK_DIVIDER      4
30
31
3222/****************************************************************************
3323 * Use this in the I/O port address fields of your driver for the BIO pin
3424 * i.e,
src/emu/cpu/tms32010/tms32010.c
r1527r1528
5757#include "debugger.h"
5858
5959
60/* 1 cycle equals 4 clock ticks */
61#if 0
62#define CLK  TMS32010_CLOCK_DIVIDER
63#else
6460#define CLK  1      /* Moved the clock timing back into the driver */
65#endif
6661
6762
6863#ifndef INLINE
r1527r1528
892887      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
893888      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
894889      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
895      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = TMS32010_CLOCK_DIVIDER;      break;
890      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
891      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
896892      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
897893      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
898894      case CPUINFO_INT_MIN_CYCLES:               info->i = 1*CLK;                  break;
src/emu/cpu/sm8500/sm8500.c
r1527r1528
429429   case CPUINFO_INT_INPUT_LINES:            info->i = 8; break;
430430   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff; break;
431431   case CPUINFO_INT_ENDIANNESS:            info->i = CPU_IS_BE; break;
432   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1; break;
432433   case CPUINFO_INT_CLOCK_DIVIDER:            info->i = 1; break;
433434   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1; break;
434435   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5; break;
src/emu/cpu/sh2/sh2.c
r1527r1528
30553055      case CPUINFO_INT_INPUT_LINES:               info->i = 16;                     break;
30563056      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
30573057      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
3058      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
30583059      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
30593060      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
30603061      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
src/emu/cpu/tms32051/tms32051.c
r1527r1528
572572      case CPUINFO_INT_INPUT_LINES:               info->i = 6;                     break;
573573      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
574574      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
575      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
575576      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
576577      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
577578      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/sh4/sh4.c
r1527r1528
49184918      case CPUINFO_INT_INPUT_LINES:               info->i = 5;                  break;
49194919      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                  break;
49204920      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;            break;
4921      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                  break;
49214922      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                  break;
49224923      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                  break;
49234924      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                  break;
src/emu/cpu/mb88xx/mb88xx.c
r1527r1528
799799      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
800800      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
801801      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
802      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
802803      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
803804      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
804805      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
src/emu/cpu/alph8201/alph8201.c
r1527r1528
895895      case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
896896      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
897897      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
898      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
898899      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
899900      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
900901      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
src/emu/cpu/apexc/apexc.c
r1527r1528
853853   switch (state)
854854   {
855855   case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(apexc);            break;
856   case CPUINFO_INT_INPUT_LINES:                  info->i = 0;                     break;
856   case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
857857   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
858858   case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;   /*don't care*/   break;
859   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
859860   case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
860861   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
861862   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/g65816/g65816.c
r1527r1528
379379      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
380380      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
381381      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
382      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
382383      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
383384      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
384385      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/nec/nec.c
r1527r1528
13121312      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
13131313      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
13141314      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1315      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
13151316      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
13161317      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
13171318      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 15;                     break;
src/emu/cpu/i8051/i8051.c
r1527r1528
24302430      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(i8051);            break;
24312431      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
24322432      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
2433      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
24332434      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
24342435      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
24352436      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 5;                     break;
src/emu/cpu/mips/mips3com.h
r1527r1528
193193   UINT32         system_clock;
194194   UINT32         cpu_clock;
195195   UINT64         count_zero_time;
196   emu_timer *   compare_int_timer;
196   emu_timer *      compare_int_timer;
197197
198198   /* memory accesses */
199199   UINT8         bigendian;
src/emu/cpu/mips/r3000.c
r1527r1528
12141214      case CPUINFO_INT_INPUT_LINES:               info->i = 6;                     break;
12151215      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
12161216      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1217      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
12171218      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
12181219      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
12191220      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
r1527r1528
13771378      default:                              r3000_get_info(state, info);         break;
13781379   }
13791380}
1381
1382
1383void r3041be_get_info(UINT32 state, cpuinfo *info)
1384{
1385   switch (state)
1386   {
1387      /* --- the following bits of info are returned as 64-bit signed integers --- */
1388      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
1389
1390      /* --- the following bits of info are returned as pointers to data or functions --- */
1391      case CPUINFO_PTR_RESET:                     info->reset = r3000be_reset;         break;
1392
1393      /* --- the following bits of info are returned as NULL-terminated strings --- */
1394      case CPUINFO_STR_NAME:                     strcpy(info->s, "R3041 (big)");         break;
1395
1396      default:                              r3000_get_info(state, info);         break;
1397   }
1398}
1399
1400
1401void r3041le_get_info(UINT32 state, cpuinfo *info)
1402{
1403   switch (state)
1404   {
1405      /* --- the following bits of info are returned as 64-bit signed integers --- */
1406      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1407
1408      /* --- the following bits of info are returned as pointers to data or functions --- */
1409      case CPUINFO_PTR_RESET:                     info->reset = r3000le_reset;         break;
1410
1411      /* --- the following bits of info are returned as NULL-terminated strings --- */
1412      case CPUINFO_STR_NAME:                     strcpy(info->s, "R3041 (little)");      break;
1413
1414      default:                              r3000_get_info(state, info);         break;
1415   }
1416}
src/emu/cpu/mips/r3000.h
r1527r1528
6262extern void r3000be_get_info(UINT32 state, cpuinfo *info);
6363extern void r3000le_get_info(UINT32 state, cpuinfo *info);
6464
65extern void r3041be_get_info(UINT32 state, cpuinfo *info);
66extern void r3041le_get_info(UINT32 state, cpuinfo *info);
67
6568#endif /* _JAGUAR_H */
src/emu/cpu/mips/psx.c
r1527r1528
33003300      case CPUINFO_INT_INPUT_LINES:               info->i = 6;                     break;
33013301      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
33023302      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
3303      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
3303      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
3304      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 2 * 2;                     break;
33043305      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
33053306      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
33063307      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
src/emu/cpu/mips/mips3drc.c
r1527r1528
188188   allocatedsize = CACHE_SIZE + sizeof(*mips3.core) + memsize;
189189   mips3.core = osd_alloc_executable(allocatedsize);
190190   if (mips3.core == NULL)
191      fatalerror("Unable to allocate cache of size %d\n", allocatedsize);
191      fatalerror("Unable to allocate cache of size %d\n", (UINT32)allocatedsize);
192192   mips3.cache = (UINT8 *)(mips3.core + 1) + memsize;
193193
194194   /* initialize the core */
src/emu/cpu/mips/mips3com.c
r1527r1528
532532      case CPUINFO_INT_INPUT_LINES:               info->i = 6;                     break;
533533      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
534534      case CPUINFO_INT_ENDIANNESS:               info->i = mips->bigendian ? CPU_IS_BE : CPU_IS_LE; break;
535      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
535536      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
536537      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
537538      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/tms7000/tms7000.c
r1527r1528
289289        case CPUINFO_INT_INPUT_LINES:   info->i = 3;   break;
290290        case CPUINFO_INT_DEFAULT_IRQ_VECTOR:   info->i = 0;   break;
291291        case CPUINFO_INT_ENDIANNESS:   info->i = CPU_IS_BE;   break;
292        case CPUINFO_INT_CLOCK_MULTIPLIER:   info->i = 1;   break;
292293        case CPUINFO_INT_CLOCK_DIVIDER:   info->i = 1;   break;
293294        case CPUINFO_INT_MIN_INSTRUCTION_BYTES:   info->i = 1;   break;
294295        case CPUINFO_INT_MAX_INSTRUCTION_BYTES:   info->i = 4;   break;
src/emu/cpu/f8/f8.c
r1527r1528
20082008   case CPUINFO_INT_INPUT_LINES:                  info->i = 1;         break;
20092009   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;         break;
20102010   case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;   break;
2011   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;         break;
20112012   case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;         break;
20122013   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;         break;
20132014   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;         break;
src/emu/cpu/z80/z80.c
r1527r1528
36963696      case CPUINFO_INT_INPUT_LINES:            info->i = 1;                        break;
36973697      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:      info->i = 0xff;                        break;
36983698      case CPUINFO_INT_ENDIANNESS:            info->i = CPU_IS_LE;                  break;
3699      case CPUINFO_INT_CLOCK_MULTIPLIER:         info->i = 1;                        break;
36993700      case CPUINFO_INT_CLOCK_DIVIDER:            info->i = 1;                        break;
37003701      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:      info->i = 1;                        break;
37013702      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:      info->i = 4;                        break;
src/emu/cpu/asap/asap.c
r1527r1528
17391739      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
17401740      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
17411741      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1742      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
17421743      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
17431744      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
17441745      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 12;                     break;
src/emu/cpu/tms9900/99xxcore.h
r1527r1528
46894689      case CPUINFO_INT_INPUT_LINES:               info->i = 3;                     break;
46904690      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
46914691      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
4692      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
46924693      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
46934694      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
46944695      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 6;/*8 with 990/12, 99105, 99110*/break;
src/emu/cpu/i960/i960.c
r1527r1528
593593      x = program_read_dword(i960.r[I960_FP]-16);
594594      y = program_read_dword(i960.r[I960_FP]-12);
595595      do_ret_0();
596      i960.AC = x;
596      i960.AC = y;
597597      // #### test supervisor
598      i960.PC = y;
598      i960.PC = x;
599599
600600      // check for another IRQ now that we're back
601601      check_irqs();
r1527r1528
21522152   case CPUINFO_INT_ENDIANNESS:         info->i = CPU_IS_LE;                        break;
21532153   case CPUINFO_INT_INPUT_LINES:         info->i = 4;                              break;
21542154   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:   info->i = -1;                              break;
2155   case CPUINFO_INT_CLOCK_MULTIPLIER:      info->i = 1;                              break;
2156   case CPUINFO_INT_CLOCK_DIVIDER:         info->i = 1;                              break;
21552157
21562158      // CPU main state
21572159   case CPUINFO_INT_PC:               info->i = i960.IP;                           break;
src/emu/cpu/v810/v810.c
r1527r1528
11041104      case CPUINFO_INT_INPUT_LINES:               info->i = 9;                     break;
11051105      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
11061106      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1107      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
11071108      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
11081109      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
11091110      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/tms32025/tms32025.c
r1527r1528
23152315      case CPUINFO_INT_INPUT_LINES:               info->i = 6;                     break;
23162316      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
23172317      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
2318      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
23182319      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
23192320      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
23202321      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/pic16c5x/pic16c5x.c
r1527r1528
966966      case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
967967      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
968968      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
969      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = PIC16C5x_CLOCK_DIVIDER;      break;
969      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
970      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 4;                     break;
970971      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
971972      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
972973      case CPUINFO_INT_MIN_CYCLES:               info->i = 1*CLK;                  break;
src/emu/cpu/pic16c5x/pic16c5x.h
r1527r1528
2020 *  Internal Clock divisor
2121 *
2222 *  External Clock is divided internally by 4 for the instruction cycle
23 *  times. (Each instruction cycle passes through 4 machine states).
23 *  times. (Each instruction cycle passes through 4 machine states). This
24 *  is handled by the cpu execution engine.
2425 */
2526
26#define PIC16C5x_CLOCK_DIVIDER      4
27
28
2927enum {
3028   PIC16C5x_PC=1, PIC16C5x_STK0, PIC16C5x_STK1, PIC16C5x_FSR,
3129   PIC16C5x_W,    PIC16C5x_ALU,  PIC16C5x_STR,  PIC16C5x_OPT,
src/emu/cpu/pdp1/pdp1.c
r1527r1528
942942   case CPUINFO_INT_INPUT_LINES:                  info->i = 16;                     break;
943943   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
944944   case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;   /*don't care*/   break;
945   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
945946   case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
946947   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
947948   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/pdp1/tx0.c
r1527r1528
450450   case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
451451   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
452452   case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;   /*don't care*/   break;
453   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
453454   case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
454455   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
455456   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
r1527r1528
578579   case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
579580   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
580581   case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;   /*don't care*/   break;
582   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
581583   case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
582584   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
583585   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/mb86233/mb86233.c
r1527r1528
15851585      case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
15861586      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
15871587      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1588      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
15881589      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
15891590      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
15901591      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/t11/t11.c
r1527r1528
460460      case CPUINFO_INT_INPUT_LINES:               info->i = 4;                     break;
461461      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
462462      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
463      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
463464      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
464465      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
465466      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 6;                     break;
src/emu/cpu/arm7/arm7.c
r1527r1528
256256      case CPUINFO_INT_INPUT_LINES:               info->i = ARM7_NUM_LINES;            break;
257257      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
258258      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
259      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
259260      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
260261      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
261262      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/h6280/h6280ops.h
r1527r1528
13751375 * CSL Set CPU in low speed mode
13761376 ***************************************************************/
13771377#define CSL                                          \
1378   h6280.clocks_per_cycle = 3;
1378    h6280.clocks_per_cycle = 4;
13791379
src/emu/cpu/h6280/h6280.c
r1527r1528
130130    UINT8 irq_mask;     /* interrupt enable/disable */
131131    UINT8 timer_status; /* timer status */
132132   UINT8 timer_ack;   /* timer acknowledge */
133   UINT8 clocks_per_cycle;   /* 3 = low speed mode, 1 = high speed mode */
133    UINT8 clocks_per_cycle; /* 4 = low speed mode, 1 = high speed mode */
134134    INT32 timer_value;    /* timer interrupt */
135135    INT32 timer_load;      /* reload value */
136136    UINT8 nmi_state;
r1527r1528
209209   CHANGE_PC;
210210
211211   /* CPU starts in low speed mode */
212   h6280.clocks_per_cycle = 3;
212    h6280.clocks_per_cycle = 4;
213213
214214   /* timer off by default */
215215   h6280.timer_status=0;
r1527r1528
454454      case CPUINFO_INT_INPUT_LINES:               info->i = 3;                     break;
455455      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
456456      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
457      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
457458      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
458459      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
459460      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 7;                     break;
src/emu/cpu/m6800/m6800.c
r1527r1528
26102610      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
26112611      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
26122612      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
2613      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
26132614      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
26142615      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
26152616      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/cpu/cp1610/cp1610.c
r1527r1528
34473447   case CPUINFO_INT_INPUT_LINES:                  info->i = 2;         break;
34483448   case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;         break;
34493449   case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;   break;
3450   case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;         break;
34503451   case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;         break;
34513452   case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;         break;
34523453   case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 8;         break;
src/emu/cpu/saturn/saturn.c
r1527r1528
316316      case CPUINFO_INT_INPUT_LINES:                  info->i = 1;                     break;
317317      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
318318      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
319      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
319320      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
320321      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
321322      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 20; /* 20 nibbles max */      break;
src/emu/cpu/i8x41/i8x41.h
r1527r1528
2929#include "cpuintrf.h"
3030
3131
32/* The i8x41/i8x42 input clock is divided by 15. Use it with your CPU speed */
32/* The i8x41/i8x42 input clock is divided by 15 */
3333#define I8X41_CLOCK_DIVIDER      15
3434
3535/* Note:
src/emu/cpu/i8x41/i8x41.c
r1527r1528
21972197      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
21982198      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
21992199      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
2200      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
22002201      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = I8X41_CLOCK_DIVIDER;         break;
22012202      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
22022203      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
src/emu/cpu/konami/konami.c
r1527r1528
565565      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
566566      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
567567      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
568      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
568569      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
569570      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
570571      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
src/emu/video/tms34061.c
r1527r1528
3535   UINT8 *         shiftreg;
3636   emu_timer *      timer;
3737   struct tms34061_interface intf;
38   running_machine *machine;
3839};
3940
4041
r1527r1528
7475 *
7576 *************************************/
7677
77void tms34061_start(const struct tms34061_interface *interface)
78void tms34061_start(running_machine *machine, const struct tms34061_interface *interface)
7879{
7980   /* reset the data */
8081   memset(&tms34061, 0, sizeof(tms34061));
82   tms34061.machine = machine;
8183   tms34061.intf = *interface;
8284   tms34061.vrammask = tms34061.intf.vramsize - 1;
8385
r1527r1528
135137   {
136138      /* if the status bit is set, and ints are enabled, turn it on */
137139      if ((tms34061.regs[TMS34061_STATUS] & 0x0001) && (tms34061.regs[TMS34061_CONTROL1] & 0x0400))
138         (*tms34061.intf.interrupt)(ASSERT_LINE);
140         (*tms34061.intf.interrupt)(tms34061.machine, ASSERT_LINE);
139141      else
140         (*tms34061.intf.interrupt)(CLEAR_LINE);
142         (*tms34061.intf.interrupt)(tms34061.machine, CLEAR_LINE);
141143   }
142144}
143145
src/emu/video/tms34061.h
r1527r1528
3737/* interface structure */
3838struct tms34061_interface
3939{
40   int            scrnum;                  /* the screen we are acting on */
41   UINT8         rowshift;               /* VRAM address is (row << rowshift) | col */
42   UINT32         vramsize;               /* size of video RAM */
43   void         (*interrupt)(int state);   /* interrupt gen callback */
40   int      scrnum;         /* the screen we are acting on */
41   UINT8   rowshift;      /* VRAM address is (row << rowshift) | col */
42   UINT32   vramsize;      /* size of video RAM */
43   void   (*interrupt)(running_machine *machine, int state);   /* interrupt gen callback */
4444};
4545
4646
4747/* display state structure */
4848struct tms34061_display
4949{
50   UINT8         blanked;               /* true if blanked */
51   UINT8 *         vram;                  /* base of VRAM */
52   UINT8 *         latchram;               /* base of latch RAM */
53   UINT16 *      regs;                  /* pointer to array of registers */
54   offs_t         dispstart;               /* display start */
50   UINT8   blanked;      /* true if blanked */
51   UINT8   *vram;         /* base of VRAM */
52   UINT8   *latchram;      /* base of latch RAM */
53   UINT16   *regs;         /* pointer to array of registers */
54   offs_t   dispstart;      /* display start */
5555};
5656
5757
5858/* starts/stops the emulator */
59void tms34061_start(const struct tms34061_interface *interface);
59void tms34061_start(running_machine *machine, const struct tms34061_interface *interface);
6060
6161/* reads/writes to the 34061 */
6262UINT8 tms34061_r(int col, int row, int func);
src/emu/video/generic.c
r1527r1528
5151size_t spriteram_2_size;
5252size_t spriteram_3_size;
5353
54UINT8 *dirtybuffer;
55UINT16 *dirtybuffer16;
56UINT32 *dirtybuffer32;
57
5854UINT8 *paletteram;
5955UINT16 *paletteram16;
6056UINT32 *paletteram32;
r1527r1528
296292   spriteram_size = 0;      /* ... here just for convenience */
297293   spriteram_2_size = 0;
298294   spriteram_3_size = 0;
299   dirtybuffer = NULL;
300   dirtybuffer16 = NULL;
301   dirtybuffer32 = NULL;
302295   tmpbitmap = NULL;
303296   flip_screen_x = flip_screen_y = 0;
304297}
r1527r1528
310303***************************************************************************/
311304
312305/*-------------------------------------------------
313    video_generic_postload - post-load callback
314    that marks all videoram as dirty
315-------------------------------------------------*/
316
317static void video_generic_postload(void)
318{
319   memset(dirtybuffer, 1, videoram_size);
320}
321
322
323/*-------------------------------------------------
324306    video_start_generic - general video system
325    with dirty buffer support
326307-------------------------------------------------*/
327308
328309VIDEO_START( generic )
329310{
330311   assert_always(videoram_size != 0, "VIDEO_START(generic) requires non-zero videoram_size");
331312
332   /* allocate memory for the dirty buffer */
333   dirtybuffer = auto_malloc(videoram_size);
334   memset(dirtybuffer, 1, videoram_size);
335
336313   /* allocate the temporary bitmap */
337314   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
338
339   /* on a restore, we automatically zap the dirty buffer */
340   state_save_register_func_postload(video_generic_postload);
341315}
342316
343317
r1527r1528
370344
371345
372346/***************************************************************************
373    GENERIC READ/WRITE HANDLERS
374***************************************************************************/
375
376/*-------------------------------------------------
377    videoram_r/w - 8-bit access to videoram with
378    dirty buffer marking
379-------------------------------------------------*/
380
381READ8_HANDLER( videoram_r )
382{
383   return videoram[offset];
384}
385
386WRITE8_HANDLER( videoram_w )
387{
388   dirtybuffer[offset] = 1;
389   videoram[offset] = data;
390}
391
392
393/*-------------------------------------------------
394    colorram_r/w - 8-bit access to colorram with
395    dirty buffer marking
396-------------------------------------------------*/
397
398READ8_HANDLER( colorram_r )
399{
400   return colorram[offset];
401}
402
403WRITE8_HANDLER( colorram_w )
404{
405   dirtybuffer[offset] = 1;
406   colorram[offset] = data;
407}
408
409
410/*-------------------------------------------------
411    spriteram_r/w - 8-bit access to spriteram
412-------------------------------------------------*/
413
414READ8_HANDLER( spriteram_r )
415{
416   return spriteram[offset];
417}
418
419WRITE8_HANDLER( spriteram_w )
420{
421   spriteram[offset] = data;
422}
423
424
425/*-------------------------------------------------
426    spriteram16_r/w - 16-bit access to spriteram16
427-------------------------------------------------*/
428
429READ16_HANDLER( spriteram16_r )
430{
431   return spriteram16[offset];
432}
433
434WRITE16_HANDLER( spriteram16_w )
435{
436   COMBINE_DATA(spriteram16+offset);
437}
438
439
440/*-------------------------------------------------
441    spriteram_r/w - 8-bit access to spriteram2
442-------------------------------------------------*/
443
444READ8_HANDLER( spriteram_2_r )
445{
446   return spriteram_2[offset];
447}
448
449WRITE8_HANDLER( spriteram_2_w )
450{
451   spriteram_2[offset] = data;
452}
453
454
455
456/***************************************************************************
457347    GENERIC SPRITE BUFFERING
458348***************************************************************************/
459349
src/emu/video/generic.h
r1527r1528
9595/* set up all the common systems */
9696void generic_video_init(running_machine *machine);
9797
98/* generic video start with dirty buffers */
98/* generic video start */
9999VIDEO_START( generic );
100100
101101/* generic video start with a temporary bitmap */
r1527r1528
106106
107107
108108
109/* ----- core video/color/spriteram access ----- */
110
111/* video RAM read/write handlers */
112READ8_HANDLER( videoram_r );
113WRITE8_HANDLER( videoram_w );
114
115/* color RAM read/write handlers */
116READ8_HANDLER( colorram_r );
117WRITE8_HANDLER( colorram_w );
118
119/* sprite RAM read/write handlers */
120READ8_HANDLER( spriteram_r );
121WRITE8_HANDLER( spriteram_w );
122READ16_HANDLER( spriteram16_r );
123WRITE16_HANDLER( spriteram16_w );
124READ8_HANDLER( spriteram_2_r );
125WRITE8_HANDLER( spriteram_2_w );
126
127
128
129109/* ----- sprite buffering ----- */
130110
131111/* buffered sprite RAM write handlers */
src/emu/video/tlc34076.c
r1527r1528
1616static UINT8 writeindex, readindex;
1717static UINT8 dacbits;
1818
19static rgb_t pens[0x100];
1920
2021#define PALETTE_WRITE_ADDR   0x00
2122#define PALETTE_DATA      0x01
r1527r1528
3334
3435/*************************************
3536 *
36 *  Palette update
37 *  Retrieve Current Palette
3738 *
3839 *************************************/
3940
40static void update_palette(int which)
41const pen_t *tlc34076_get_pens(void)
4142{
42   int totalcolors = (Machine->drv->total_colors <= 256) ? Machine->drv->total_colors : 256;
43   int i, mask = regs[PIXEL_READ_MASK];
43   offs_t i;
4444
45   for (i = 0; i < totalcolors; i++)
46      if (which == -1 || (i & mask) == which)
45   for (i = 0; i < 0x100; i++)
46   {
47      int r, g, b;
48
49      if ((i & regs[PIXEL_READ_MASK]) == i)
4750      {
48         int r = local_paletteram[3 * i + 0];
49         int g = local_paletteram[3 * i + 1];
50         int b = local_paletteram[3 * i + 2];
51         r = local_paletteram[3 * i + 0];
52         g = local_paletteram[3 * i + 1];
53         b = local_paletteram[3 * i + 2];
54
5155         if (dacbits == 6)
5256         {
5357            r = pal6bit(r);
5458            g = pal6bit(g);
5559            b = pal6bit(b);
5660         }
57         palette_set_color(Machine, i, MAKE_RGB(r, g, b));
5861      }
62      else
63      {
64         r = 0;
65         g = 0;
66         b = 0;
67      }
68
69      pens[i] = MAKE_RGB(r, g, b);
70   }
71
72   return pens;
5973}
6074
6175
r1527r1528
6882
6983void tlc34076_reset(int dacwidth)
7084{
71   /* set the DAC width */
85   assert_always((dacbits == 6) || (dacbits != 8), "tlc34076_reset: dacwidth must be 6 or 8!");
86
7287   dacbits = dacwidth;
73   if (dacbits != 6 && dacbits != 8)
74   {
75      logerror("tlc34076_reset: dacwidth must be 6 or 8!\n");
76      dacbits = 6;
77   }
7888
7989   /* reset the registers */
8090   regs[PIXEL_READ_MASK]      = 0xff;
r1527r1528
156166            local_paletteram[3 * regs[PALETTE_WRITE_ADDR] + 0] = palettedata[0];
157167            local_paletteram[3 * regs[PALETTE_WRITE_ADDR] + 1] = palettedata[1];
158168            local_paletteram[3 * regs[PALETTE_WRITE_ADDR] + 2] = palettedata[2];
159            update_palette(regs[PALETTE_WRITE_ADDR]);
160169            writeindex = 0;
161170            regs[PALETTE_WRITE_ADDR]++;
162171         }
r1527r1528
219228            */
220229         break;
221230
222      case PIXEL_READ_MASK:
223      case PALETTE_PAGE:
224         update_palette(-1);
225         break;
226
227231      case RESET_STATE:
228232         tlc34076_reset(dacbits);
229233         break;
src/emu/video/tlc34076.h
r1527r1528
99
1010void tlc34076_reset(int dacwidth);
1111
12const pen_t *tlc34076_get_pens(void);
13
1214READ8_HANDLER( tlc34076_r );
1315WRITE8_HANDLER( tlc34076_w );
1416
src/emu/uimenu.c
r1527r1528
1313#include "rendutil.h"
1414#include "cheat.h"
1515#include "uimenu.h"
16#include "uitext.h"
1716#include "audit.h"
1817
1918#ifdef MESS
r1527r1528
184183static void switches_menu_select_previous(input_port_entry *in, int switch_entry);
185184static void switches_menu_select_next(input_port_entry *in, int switch_entry);
186185//static int switches_menu_compare_items(const void *i1, const void *i2);
187static void analog_menu_add_item(ui_menu_item *item, const input_port_entry *in, int append_string, int which_item);
186static void analog_menu_add_item(ui_menu_item *item, const input_port_entry *in, const char *append_string, int which_item);
188187
189188/* DIP switch helpers */
190189static void dip_switch_build_model(input_port_entry *entry, int item_is_selected);
r1527r1528
533532
534533static void ui_menu_draw_text_box(const char *text)
535534{
536   const char *priortext = ui_getstring(UI_returntoprior);
535   const char *priortext = "Return to Prior Menu";
537536   float line_height = ui_get_line_height();
538537   float lr_arrow_width = 0.4f * line_height * render_get_ui_aspect();
539538   float gutter_width = lr_arrow_width;
r1527r1528
756755{
757756#define ADD_MENU(name, _handler, _param) \
758757do { \
759   item_list[menu_items].text = ui_getstring(name); \
758   item_list[menu_items].text = name; \
760759   handler_list[menu_items].handler = _handler; \
761760   handler_list[menu_items].state = _param; \
762761   menu_items++; \
r1527r1528
790789   memset(item_list, 0, sizeof(item_list));
791790
792791   /* add input menu items */
793   ADD_MENU(UI_inputgeneral, menu_input_groups, 0);
794   ADD_MENU(UI_inputspecific, menu_input, 1000 << 16);
792   ADD_MENU("Input (general)", menu_input_groups, 0);
793   ADD_MENU("Input (this " CAPSTARTGAMENOUN ")", menu_input, 1000 << 16);
795794
796795   /* add optional input-related menus */
797796   if (has_dips)
798      ADD_MENU(UI_dipswitches, menu_switches, (IPT_DIPSWITCH_NAME << 16) | (IPT_DIPSWITCH_SETTING << 24));
797      ADD_MENU("Dip Switches", menu_switches, (IPT_DIPSWITCH_NAME << 16) | (IPT_DIPSWITCH_SETTING << 24));
799798   if (has_configs)
800      ADD_MENU(UI_configuration, menu_switches, (IPT_CONFIG_NAME << 16) | (IPT_CONFIG_SETTING << 24));
799      ADD_MENU("Driver Configuration", menu_switches, (IPT_CONFIG_NAME << 16) | (IPT_CONFIG_SETTING << 24));
801800#ifdef MESS
802801   if (has_categories)
803      ADD_MENU(UI_categories, menu_switches, (IPT_CATEGORY_NAME << 16) | (IPT_CATEGORY_SETTING << 24));
802      ADD_MENU("Categories", menu_switches, (IPT_CATEGORY_NAME << 16) | (IPT_CATEGORY_SETTING << 24));
804803#endif
805804   if (has_analog)
806      ADD_MENU(UI_analogcontrols, menu_analog, 0);
805      ADD_MENU("Analog Controls", menu_analog, 0);
807806
808807#ifndef MESS
809808     /* add bookkeeping menu */
810   ADD_MENU(UI_bookkeeping, menu_bookkeeping, 0);
809   ADD_MENU("Bookkeeping Info", menu_bookkeeping, 0);
811810#endif
812811
813812   /* add game info menu */
814   ADD_MENU(UI_gameinfo, menu_game_info, 0);
813   ADD_MENU(CAPSTARTGAMENOUN " Information", menu_game_info, 0);
815814
816815#ifdef MESS
817816     /* add image info menu */
818   ADD_MENU(UI_imageinfo, ui_menu_image_info, 0);
817   ADD_MENU("Image Information", ui_menu_image_info, 0);
819818
820819     /* add image info menu */
821   ADD_MENU(UI_filemanager, menu_file_manager, 1);
820   ADD_MENU("File Manager", menu_file_manager, 1);
822821
823822#if HAS_WAVE
824823     /* add tape control menu */
825824   if (device_find(Machine->devices, IO_CASSETTE))
826      ADD_MENU(UI_tapecontrol, menu_tape_control, 1);
825      ADD_MENU("Tape Control", menu_tape_control, 1);
827826#endif /* HAS_WAVE */
828827#endif /* MESS */
829828
830829   /* add video options menu */
831   ADD_MENU(UI_video, menu_video, 1000 << 16);
830   ADD_MENU("Video Options", menu_video, 1000 << 16);
832831
833832   /* add cheat menu */
834833   if (options_get_bool(mame_options(), OPTION_CHEAT))
835      ADD_MENU(UI_cheat, menu_cheat, 1);
834      ADD_MENU("Cheat", menu_cheat, 1);
836835
837836   /* add memory card menu */
838837   if (Machine->drv->memcard_handler != NULL)
839      ADD_MENU(UI_memorycard, menu_memory_card, 0);
838      ADD_MENU("Memory Card", menu_memory_card, 0);
840839
841840   /* add reset and exit menus */
842   ADD_MENU(UI_selectgame, menu_select_game, 1 << 16);
843   ADD_MENU(UI_returntogame, NULL, 0);
841   ADD_MENU("Select New " CAPSTARTGAMENOUN, menu_select_game, 1 << 16);
842   ADD_MENU("Return to " CAPSTARTGAMENOUN, NULL, 0);
844843
845844   /* draw the menu */
846845   visible_items = ui_menu_draw(item_list, menu_items, state, NULL);
r1527r1528
867866   ui_menu_item item_list[IPG_TOTAL_GROUPS + 2];
868867   int menu_items = 0;
869868   int visible_items;
869   int player;
870870
871871   /* reset the menu */
872872   memset(item_list, 0, sizeof(item_list));
873873
874874   /* build up the menu */
875   for (menu_items = 0; menu_items < IPG_TOTAL_GROUPS; menu_items++)
876      item_list[menu_items].text = ui_getstring(UI_uigroup + menu_items);
875   item_list[menu_items++].text = "User Interface";
876   for (player = 0; player < MAX_PLAYERS; player++)
877      item_list[menu_items++].text = menu_string_pool_add("Player %d Controls", player + 1);
878   item_list[menu_items++].text = "Other Controls";
877879
878880   /* add an item for the return */
879   item_list[menu_items++].text = ui_getstring(UI_returntoprior);
881   item_list[menu_items++].text = "Return to Prior Menu";
880882
881883   /* draw the menu */
882884   visible_items = ui_menu_draw(item_list, menu_items, state, NULL);
r1527r1528
932934   qsort(item_list, menu_items, sizeof(item_list[0]), input_menu_compare_items);
933935
934936   /* add an item to return */
935   item_list[menu_items++].text = ui_getstring(UI_returntoprior);
937   item_list[menu_items++].text = "Return to Prior Menu";
936938
937939   /* if we're polling, just put an empty entry and arrows for the subitem */
938940   if (polling)
r1527r1528
10371039   selected_in = item_list[selected].ref;
10381040
10391041   /* add an item to return */
1040   item_list[menu_items++].text = ui_getstring(UI_returntoprior);
1042   item_list[menu_items++].text = "Return to Prior Menu";
10411043
10421044   /* configure the extra menu */
10431045   extra.top = 0;
r1527r1528
11401142         }
11411143
11421144         /* add the needed items for each analog input */
1143         analog_menu_add_item(&item_list[menu_items++], in, UI_keyjoyspeed, ANALOG_ITEM_KEYSPEED);
1145         analog_menu_add_item(&item_list[menu_items++], in, "Digital Speed", ANALOG_ITEM_KEYSPEED);
11441146         if (use_autocenter)
1145            analog_menu_add_item(&item_list[menu_items++], in, UI_centerspeed, ANALOG_ITEM_CENTERSPEED);
1146         analog_menu_add_item(&item_list[menu_items++], in, UI_reverse, ANALOG_ITEM_REVERSE);
1147         analog_menu_add_item(&item_list[menu_items++], in, UI_sensitivity, ANALOG_ITEM_SENSITIVITY);
1147            analog_menu_add_item(&item_list[menu_items++], in, "Autocenter Speed", ANALOG_ITEM_CENTERSPEED);
1148         analog_menu_add_item(&item_list[menu_items++], in, "Reverse", ANALOG_ITEM_REVERSE);
1149         analog_menu_add_item(&item_list[menu_items++], in, "Sensitivity", ANALOG_ITEM_SENSITIVITY);
11481150      }
11491151
11501152   /* add an item to return */
1151   item_list[menu_items++].text = ui_getstring(UI_returntoprior);
1153   item_list[menu_items++].text = "Return to Prior Menu";
11521154
11531155   /* draw the menu */
11541156   visible_items = ui_menu_draw(item_list, menu_items, state, NULL);
r1527r1528
11961198   /* show total time first */
11971199   total_time = timer_get_time();
11981200   if (total_time.seconds >= 60 * 60)
1199      bufptr += sprintf(bufptr, "%s: %d:%02d:%02d\n\n", ui_getstring(UI_totaltime), total_time.seconds / (60*60), (total_time.seconds / 60) % 60, total_time.seconds % 60);
1201      bufptr += sprintf(bufptr, "Uptime: %d:%02d:%02d\n\n", total_time.seconds / (60*60), (total_time.seconds / 60) % 60, total_time.seconds % 60);
12001202   else
1201      bufptr += sprintf(bufptr, "%s: %d:%02d\n\n", ui_getstring(UI_totaltime), (total_time.seconds / 60) % 60, total_time.seconds % 60);
1203      bufptr += sprintf(bufptr, "Uptime: %d:%02d\n\n", (total_time.seconds / 60) % 60, total_time.seconds % 60);
12021204
12031205   /* show tickets at the top */
12041206   if (dispensed_tickets)
1205      bufptr += sprintf(bufptr, "%s: %d\n\n", ui_getstring(UI_tickets), dispensed_tickets);
1207      bufptr += sprintf(bufptr, "Tickets dispensed: %d\n\n", dispensed_tickets);
12061208
12071209   /* loop over coin counters */
12081210   for (ctrnum = 0; ctrnum < COIN_COUNTERS; ctrnum++)
12091211   {
12101212      /* display the coin counter number */
1211      bufptr += sprintf(bufptr, "%s %c: ", ui_getstring(UI_coin), ctrnum + 'A');
1213      bufptr += sprintf(bufptr, "Coin %c: ", ctrnum + 'A');
12121214
12131215      /* display how many coins */
12141216      if (!coin_count[ctrnum])
1215         bufptr += sprintf(bufptr, "%s", ui_getstring(UI_NA));
1217         bufptr += sprintf(bufptr, "NA");
12161218      else
12171219         bufptr += sprintf(bufptr, "%d", coin_count[ctrnum]);
12181220
12191221      /* display whether or not we are locked out */
12201222      if (coinlockedout[ctrnum])
1221         bufptr += sprintf(bufptr, " %s", ui_getstring(UI_locked));
1223         bufptr += sprintf(bufptr, " (locked)");
12221224      *bufptr++ = '\n';
12231225   }
12241226   *bufptr = 0;
r1527r1528
12881290   menu_string_pool_offset = 0;
12891291
12901292   /* add the card select menu */
1291   item_list[menu_items].text = ui_getstring(UI_selectcard);
1293   item_list[menu_items].text = "Card Number:";
12921294   item_list[menu_items].subtext = menu_string_pool_add("%d", cardnum);
12931295   if (cardnum > 0)
12941296      item_list[menu_items].flags |= MENU_FLAG_LEFT_ARROW;
r1527r1528
12971299   menu_items++;
12981300
12991301   /* add the remaining items */
1300   item_list[insertindex = menu_items++].text = ui_getstring(UI_loadcard);
1302   item_list[insertindex = menu_items++].text = "Load Selected Card";
13011303   if (memcard_present() != -1)
1302      item_list[ejectindex = menu_items++].text = ui_getstring(UI_ejectcard);
1303   item_list[createindex = menu_items++].text = ui_getstring(UI_createcard);
1304      item_list[ejectindex = menu_items++].text = "Eject Current Card";
1305   item_list[createindex = menu_items++].text = "Create New Card";
13041306
13051307   /* add an item for the return */
1306   item_list[menu_items++].text = ui_getstring(UI_returntoprior);
1308   item_list[menu_items++].text = "Return to Prior Menu";
13071309
13081310   /* draw the menu */
13091311   visible_items = ui_menu_draw(item_list, menu_items, selected, NULL);
r1527r1528
13241326      {
13251327         if (memcard_insert(cardnum) == 0)
13261328         {
1327            popmessage("%s", ui_getstring(UI_loadok));
1329            popmessage("Memory card loaded");
13281330            ui_menu_stack_reset();
13291331            return 0;
13301332         }
13311333         else
1332            popmessage("%s", ui_getstring(UI_loadfailed));
1334            popmessage("Error loading memory card");
13331335      }
13341336
13351337      /* handle eject */
13361338      else if (selected == ejectindex)
13371339      {
13381340         memcard_eject(Machine);
1339         popmessage("%s", ui_getstring(UI_cardejected));
1341         popmessage("Memory card ejected");
13401342      }
13411343
13421344      /* handle create */
13431345      else if (selected == createindex)
13441346      {
13451347         if (memcard_create(cardnum, FALSE) == 0)
1346            popmessage("%s", ui_getstring(UI_cardcreated));
1348            popmessage("Memory card created");
13471349         else
1348            popmessage("%s\n%s", ui_getstring(UI_cardcreatedfailed), ui_getstring(UI_cardcreatedfailed2));
1350            popmessage("Error creating memory card\n(Card may already exist)");
13491351      }
13501352   }
13511353
r1527r1528
13841386   {
13851387      /* count up the targets, creating menu items for them */
13861388      for (; menu_items < targets; menu_items++)
1387         item_list[menu_items].text = menu_string_pool_add("%s%d", ui_getstring(UI_screen), menu_items);
1389         item_list[menu_items].text = menu_string_pool_add("Screen #%d", menu_items);
13881390
13891391      /* if we only ended up with one, auto-select it */
13901392      if (menu_items == 1)
r1527r1528
13941396      item_list[menu_items++].text = "Move User Interface";
13951397
13961398      /* add an item to return */
1397      item_list[menu_items++].text = ui_getstring(UI_returntoprior);
1399      item_list[menu_items++].text = "Return to Prior Menu";
13981400
13991401      /* draw the menu */
14001402      visible_items = ui_menu_draw(item_list, menu_items, selected, NULL);
r1527r1528
14691471         item_list[menu_items++].text = "Crop to Screen";
14701472
14711473      /* add an item to return */
1472      item_list[menu_items++].text = ui_getstring(UI_returntoprior);
1474      item_list[menu_items++].text = "Return to Prior Menu";
14731475
14741476      /* draw the menu */
14751477      visible_items = ui_menu_draw(item_list, menu_items, selected, NULL);
r1527r1528
16041606
16051607   /* add an item to return, but only if we're not going to pop to the quit handler */
16061608   if (!ui_menu_is_force_game_select())
1607      item_list[menu_items++].text = ui_getstring(UI_returntoprior);
1609      item_list[menu_items++].text = "Return to Prior Menu";
16081610
16091611   /* otherwise, add a general input configuration and exit menus */
16101612   else
16111613   {
16121614      item_list[menu_items++].text = "Configure General Inputs";
1613      item_list[menu_items++].text = ui_getstring(UI_exit);
1615      item_list[menu_items++].text = "Exit";
16141616   }
16151617
16161618   /* configure the extra menu */
r1527r1528
20252027
20262028   /* if no matches, we're invalid */
20272029   if (!item->subtext)
2028      item->subtext = ui_getstring(UI_INVALID);
2030      item->subtext = "INVALID";
20292031
20302032   /* stash our reference */
20312033   item->ref = ref;
r1527r1528
21102112    analog controls menu
21112113-------------------------------------------------*/
21122114
2113static void analog_menu_add_item(ui_menu_item *item, const input_port_entry *in, int append_string, int which_item)
2115static void analog_menu_add_item(ui_menu_item *item, const input_port_entry *in, const char *append_string, int which_item)
21142116{
21152117   int value, minval, maxval;
21162118
21172119   /* set the item text using the formatting string provided */
2118   item->text = menu_string_pool_add("%s %s", input_port_name(in), ui_getstring(append_string));
2120   item->text = menu_string_pool_add("%s %s", input_port_name(in), append_string);
21192121
21202122   /* set the subitem text */
21212123   switch (which_item)
r1527r1528
21392141         value = in->analog.reverse;
21402142         minval = 0;
21412143         maxval = 1;
2142         item->subtext = value ? ui_getstring(UI_on) : ui_getstring(UI_off);
2144         item->subtext = value ? "On" : "Off";
21432145         break;
21442146
21452147      case ANALOG_ITEM_SENSITIVITY:
src/emu/video.c
r1527r1528
584584         int base = gfxdecodeinfo[i].start;
585585         int end = region_length/8;
586586         int linemod = gl->yoffset[0];
587         while (glcopy.total > 0)
587         while (total > 0)
588588         {
589589            int elementbase = base + (total - 1) * charincrement / 8;
590590            int lastpixelbase = elementbase + height * linemod / 8 - 1;
src/emu/emu.mak
r1527r1528
7373   $(EMUOBJ)/ui.o \
7474   $(EMUOBJ)/uigfx.o \
7575   $(EMUOBJ)/uimenu.o \
76   $(EMUOBJ)/uitext.o \
7776   $(EMUOBJ)/validity.o \
7877   $(EMUOBJ)/video.o \
7978
src/emu/machine/6821pia.c
r1527r1528
177177   {
178178      const pia6821_interface *intf = pias[i].intf;
179179
180      if (intf == NULL)  continue;
181
180182      memset(&pias[i], 0, sizeof(pias[i]));
181183
182184      pias[i].intf = intf;
r1527r1528
190192      pias[i].in_a = 0xff;
191193      pias[i].in_ca1 = TRUE;
192194      pias[i].in_ca2 = TRUE;
193   }
194}
195195
196
197
198/*************************************
199 *
200 *  Wire-OR for all interrupt handlers
201 *
202 *************************************/
203
204static void update_shared_irq_handler(void (*irq_func)(int state))
205{
206   int i;
207
208   /* search all PIAs for this same IRQ function */
209   for (i = 0; i < MAX_PIA; i++)
210   {
211      if (pias[i].intf)
212      {
213         /* check IRQ A */
214         if ((pias[i].intf->irq_a_func == irq_func) && pias[i].irq_a_state)
215         {
216            (*irq_func)(TRUE);
217            return;
218         }
219
220         /* check IRQ B */
221         if ((pias[i].intf->irq_b_func == irq_func) && pias[i].irq_b_state)
222         {
223            (*irq_func)(TRUE);
224            return;
225         }
226      }
196      /* clear the IRQs */
197      if (intf->irq_a_func) (*intf->irq_a_func)(FALSE);
198      if (intf->irq_b_func) (*intf->irq_b_func)(FALSE);
227199   }
228
229   /* if we found nothing, the state is off */
230   (*irq_func)(FALSE);
231200}
232201
233202
r1527r1528
249218   {
250219      p->irq_a_state = new_state;
251220
252      if (p->intf->irq_a_func) update_shared_irq_handler(p->intf->irq_a_func);
221      if (p->intf->irq_a_func) (p->intf->irq_a_func)(p->irq_a_state);
253222   }
254223
255224   /* then do IRQ B */
r1527r1528
259228   {
260229      p->irq_b_state = new_state;
261230
262      if (p->intf->irq_b_func) update_shared_irq_handler(p->intf->irq_b_func);
231      if (p->intf->irq_b_func) (p->intf->irq_b_func)(p->irq_b_state);
263232   }
264233}
265234
r1527r1528
879848 *
880849 *************************************/
881850
851UINT8 pia_get_input_a(int which)
852{
853   pia6821 *p = &pias[which];
854
855   return p->in_a;
856}
857
858
882859void pia_set_input_a(int which, UINT8 data, UINT8 z_mask)
883860{
884861   pia6821 *p = &pias[which];
885862
886863   assert_always(p->intf->in_a_func == NULL, "pia_set_input_a() called when in_a_func implemented");
887864
865   LOG(("cpu #%d (PC=%08X): PIA #%d: set input port A = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data));
866
888867   p->in_a = data;
889868   p->port_a_z_mask = z_mask;
890869   p->in_a_pushed = TRUE;
r1527r1528
908887 *
909888 *************************************/
910889
890int pia_get_input_ca1(int which)
891{
892   pia6821 *p = &pias[which];
893
894   return p->in_ca1;
895}
896
897
911898void pia_set_input_ca1(int which, int data)
912899{
913900   pia6821 *p = &pias[which];
r1527r1528
915902   /* limit the data to 0 or 1 */
916903   data = data ? TRUE : FALSE;
917904
905   LOG(("cpu #%d (PC=%08X): PIA #%d: set input CA1 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data));
906
918907   /* the new state has caused a transition */
919908   if ((p->in_ca1 != data) &&
920909      ((data && C1_LOW_TO_HIGH(p->ctl_a)) || (!data && C1_HIGH_TO_LOW(p->ctl_a))))
921910   {
911      LOG(("cpu #%d (PC=%08X): PIA #%d: CA1 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which));
912
922913      /* mark the IRQ */
923914      p->irq_a1 = TRUE;
924915
r1527r1528
943934 *
944935 *************************************/
945936
937int pia_get_input_ca2(int which)
938{
939   pia6821 *p = &pias[which];
940
941   return p->in_ca2;
942}
943
944
946945void pia_set_input_ca2(int which, int data)
947946{
948947   pia6821 *p = &pias[which];
r1527r1528
950949   /* limit the data to 0 or 1 */
951950   data = data ? 1 : 0;
952951
952   LOG(("cpu #%d (PC=%08X): PIA #%d: set input CA2 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data));
953
953954   /* if input mode and the new state has caused a transition */
954955   if (C2_INPUT(p->ctl_a) &&
955956      (p->in_ca2 != data) &&
956957      ((data && C2_LOW_TO_HIGH(p->ctl_a)) || (!data && C2_HIGH_TO_LOW(p->ctl_a))))
957958   {
959      LOG(("cpu #%d (PC=%08X): PIA #%d: CA2 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which));
960
958961      /* mark the IRQ */
959962      p->irq_a2 = TRUE;
960963
r1527r1528
985988 *
986989 *************************************/
987990
991UINT8 pia_get_input_b(int which)
992{
993   pia6821 *p = &pias[which];
994
995   return p->in_b;
996}
997
998
988999void pia_set_input_b(int which, UINT8 data)
9891000{
9901001   pia6821 *p = &pias[which];
9911002
9921003   assert_always(p->intf->in_b_func == NULL, "pia_set_input_b() called when in_b_func implemented");
9931004
1005   LOG(("cpu #%d (PC=%08X): PIA #%d: set input port B = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data));
1006
9941007   p->in_b = data;
9951008   p->in_b_pushed = TRUE;
9961009}
r1527r1528
10141027 *
10151028 *************************************/
10161029
1030int pia_get_input_cb1(int which)
1031{
1032   pia6821 *p = &pias[which];
1033
1034   return p->in_cb1;
1035}
1036
1037
10171038void pia_set_input_cb1(int which, int data)
10181039{
10191040   pia6821 *p = &pias[which];
r1527r1528
10211042   /* limit the data to 0 or 1 */
10221043   data = data ? 1 : 0;
10231044
1045   LOG(("cpu #%d (PC=%08X): PIA #%d: set input CB1 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data));
1046
10241047   /* the new state has caused a transition */
10251048   if ((p->in_cb1 != data) &&
10261049      ((data && C1_LOW_TO_HIGH(p->ctl_b)) || (!data && C1_HIGH_TO_LOW(p->ctl_b))))
10271050   {
1051      LOG(("cpu #%d (PC=%08X): PIA #%d: CB1 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which));
1052
10281053      /* mark the IRQ */
10291054      p->irq_b1 = 1;
10301055
r1527r1528
10501075 *
10511076 *************************************/
10521077
1078int pia_get_input_cb2(int which)
1079{
1080   pia6821 *p = &pias[which];
1081
1082   return p->in_cb2;
1083}
1084
1085
10531086void pia_set_input_cb2(int which, int data)
10541087{
10551088   pia6821 *p = &pias[which];
r1527r1528
10571090   /* limit the data to 0 or 1 */
10581091   data = data ? 1 : 0;
10591092
1093   LOG(("cpu #%d (PC=%08X): PIA #%d: set input CB2 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data));
1094
10601095   /* if input mode and the new state has caused a transition */
10611096   if (C2_INPUT(p->ctl_b) &&
10621097      (p->in_cb2 != data) &&
10631098      ((data && C2_LOW_TO_HIGH(p->ctl_b)) || (!data && C2_HIGH_TO_LOW(p->ctl_b))))
10641099   {
1100      LOG(("cpu #%d (PC=%08X): PIA #%d: CB2 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which));
1101
10651102      /* mark the IRQ */
10661103      p->irq_b2 = 1;
10671104
r1527r1528
12561293WRITE8_HANDLER( pia_6_portb_w ) { pia_set_input_b(6, data); }
12571294WRITE8_HANDLER( pia_7_portb_w ) { pia_set_input_b(7, data); }
12581295
1259READ8_HANDLER( pia_0_porta_r ) { return pias[0].in_a; }
1260READ8_HANDLER( pia_1_porta_r ) { return pias[1].in_a; }
1261READ8_HANDLER( pia_2_porta_r ) { return pias[2].in_a; }
1262READ8_HANDLER( pia_3_porta_r ) { return pias[3].in_a; }
1263READ8_HANDLER( pia_4_porta_r ) { return pias[4].in_a; }
1264READ8_HANDLER( pia_5_porta_r ) { return pias[5].in_a; }
1265READ8_HANDLER( pia_6_porta_r ) { return pias[6].in_a; }
1266READ8_HANDLER( pia_7_porta_r ) { return pias[7].in_a; }
1296READ8_HANDLER( pia_0_porta_r ) { return pia_get_input_a(0); }
1297READ8_HANDLER( pia_1_porta_r ) { return pia_get_input_a(1); }
1298READ8_HANDLER( pia_2_porta_r ) { return pia_get_input_a(2); }
1299READ8_HANDLER( pia_3_porta_r ) { return pia_get_input_a(3); }
1300READ8_HANDLER( pia_4_porta_r ) { return pia_get_input_a(4); }
1301READ8_HANDLER( pia_5_porta_r ) { return pia_get_input_a(5); }
1302READ8_HANDLER( pia_6_porta_r ) { return pia_get_input_a(6); }
1303READ8_HANDLER( pia_7_porta_r ) { return pia_get_input_a(7); }
12671304
1268READ8_HANDLER( pia_0_portb_r ) { return pias[0].in_b; }
1269READ8_HANDLER( pia_1_portb_r ) { return pias[1].in_b; }
1270READ8_HANDLER( pia_2_portb_r ) { return pias[2].in_b; }
1271READ8_HANDLER( pia_3_portb_r ) { return pias[3].in_b; }
1272READ8_HANDLER( pia_4_portb_r ) { return pias[4].in_b; }
1273READ8_HANDLER( pia_5_portb_r ) { return pias[5].in_b; }
1274READ8_HANDLER( pia_6_portb_r ) { return pias[6].in_b; }
1275READ8_HANDLER( pia_7_portb_r ) { return pias[7].in_b; }
1305READ8_HANDLER( pia_0_portb_r ) { return pia_get_input_b(0); }
1306READ8_HANDLER( pia_1_portb_r ) { return pia_get_input_b(1); }
1307READ8_HANDLER( pia_2_portb_r ) { return pia_get_input_b(2); }
1308READ8_HANDLER( pia_3_portb_r ) { return pia_get_input_b(3); }
1309READ8_HANDLER( pia_4_portb_r ) { return pia_get_input_b(4); }
1310READ8_HANDLER( pia_5_portb_r ) { return pia_get_input_b(5); }
1311READ8_HANDLER( pia_6_portb_r ) { return pia_get_input_b(6); }
1312READ8_HANDLER( pia_7_portb_r ) { return pia_get_input_b(7); }
12761313
12771314/******************* 1-bit CA1/CA2/CB1/CB2 port interfaces *******************/
12781315
r1527r1528
13121349WRITE8_HANDLER( pia_6_cb2_w ) { pia_set_input_cb2(6, data); }
13131350WRITE8_HANDLER( pia_7_cb2_w ) { pia_set_input_cb2(7, data); }
13141351
1315READ8_HANDLER( pia_0_ca1_r ) { return pias[0].in_ca1; }
1316READ8_HANDLER( pia_1_ca1_r ) { return pias[1].in_ca1; }
1317READ8_HANDLER( pia_2_ca1_r ) { return pias[2].in_ca1; }
1318READ8_HANDLER( pia_3_ca1_r ) { return pias[3].in_ca1; }
1319READ8_HANDLER( pia_4_ca1_r ) { return pias[4].in_ca1; }
1320READ8_HANDLER( pia_5_ca1_r ) { return pias[5].in_ca1; }
1321READ8_HANDLER( pia_6_ca1_r ) { return pias[6].in_ca1; }
1322READ8_HANDLER( pia_7_ca1_r ) { return pias[7].in_ca1; }
1352READ8_HANDLER( pia_0_ca1_r ) { return pia_get_input_ca1(0); }
1353READ8_HANDLER( pia_1_ca1_r ) { return pia_get_input_ca1(1); }
1354READ8_HANDLER( pia_2_ca1_r ) { return pia_get_input_ca1(2); }
1355READ8_HANDLER( pia_3_ca1_r ) { return pia_get_input_ca1(3); }
1356READ8_HANDLER( pia_4_ca1_r ) { return pia_get_input_ca1(4); }
1357READ8_HANDLER( pia_5_ca1_r ) { return pia_get_input_ca1(5); }
1358READ8_HANDLER( pia_6_ca1_r ) { return pia_get_input_ca1(6); }
1359READ8_HANDLER( pia_7_ca1_r ) { return pia_get_input_ca1(7); }
13231360
1324READ8_HANDLER( pia_0_ca2_r ) { return pias[0].in_ca2; }
1325READ8_HANDLER( pia_1_ca2_r ) { return pias[1].in_ca2; }
1326READ8_HANDLER( pia_2_ca2_r ) { return pias[2].in_ca2; }
1327READ8_HANDLER( pia_3_ca2_r ) { return pias[3].in_ca2; }
1328READ8_HANDLER( pia_4_ca2_r ) { return pias[4].in_ca2; }
1329READ8_HANDLER( pia_5_ca2_r ) { return pias[5].in_ca2; }
1330READ8_HANDLER( pia_6_ca2_r ) { return pias[6].in_ca2; }
1331READ8_HANDLER( pia_7_ca2_r ) { return pias[7].in_ca2; }
1361READ8_HANDLER( pia_0_ca2_r ) { return pia_get_input_ca2(0); }
1362READ8_HANDLER( pia_1_ca2_r ) { return pia_get_input_ca2(1); }
1363READ8_HANDLER( pia_2_ca2_r ) { return pia_get_input_ca2(2); }
1364READ8_HANDLER( pia_3_ca2_r ) { return pia_get_input_ca2(3); }
1365READ8_HANDLER( pia_4_ca2_r ) { return pia_get_input_ca2(4); }
1366READ8_HANDLER( pia_5_ca2_r ) { return pia_get_input_ca2(5); }
1367READ8_HANDLER( pia_6_ca2_r ) { return pia_get_input_ca2(6); }
1368READ8_HANDLER( pia_7_ca2_r ) { return pia_get_input_ca2(7); }
13321369
1333READ8_HANDLER( pia_0_cb1_r ) { return pias[0].in_cb1; }
1334READ8_HANDLER( pia_1_cb1_r ) { return pias[1].in_cb1; }
1335READ8_HANDLER( pia_2_cb1_r ) { return pias[2].in_cb1; }
1336READ8_HANDLER( pia_3_cb1_r ) { return pias[3].in_cb1; }
1337READ8_HANDLER( pia_4_cb1_r ) { return pias[4].in_cb1; }
1338READ8_HANDLER( pia_5_cb1_r ) { return pias[5].in_cb1; }
1339READ8_HANDLER( pia_6_cb1_r ) { return pias[6].in_cb1; }
1340READ8_HANDLER( pia_7_cb1_r ) { return pias[7].in_cb1; }
1370READ8_HANDLER( pia_0_cb1_r ) { return pia_get_input_cb1(0); }
1371READ8_HANDLER( pia_1_cb1_r ) { return pia_get_input_cb1(1); }
1372READ8_HANDLER( pia_2_cb1_r ) { return pia_get_input_cb1(2); }
1373READ8_HANDLER( pia_3_cb1_r ) { return pia_get_input_cb1(3); }
1374READ8_HANDLER( pia_4_cb1_r ) { return pia_get_input_cb1(4); }
1375READ8_HANDLER( pia_5_cb1_r ) { return pia_get_input_cb1(5); }
1376READ8_HANDLER( pia_6_cb1_r ) { return pia_get_input_cb1(6); }
1377READ8_HANDLER( pia_7_cb1_r ) { return pia_get_input_cb1(7); }
13411378
1342READ8_HANDLER( pia_0_cb2_r ) { return pias[0].in_cb2; }
1343READ8_HANDLER( pia_1_cb2_r ) { return pias[1].in_cb2; }
1344READ8_HANDLER( pia_2_cb2_r ) { return pias[2].in_cb2; }
1345READ8_HANDLER( pia_3_cb2_r ) { return pias[3].in_cb2; }
1346READ8_HANDLER( pia_4_cb2_r ) { return pias[4].in_cb2; }
1347READ8_HANDLER( pia_5_cb2_r ) { return pias[5].in_cb2; }
1348READ8_HANDLER( pia_6_cb2_r ) { return pias[6].in_cb2; }
1349READ8_HANDLER( pia_7_cb2_r ) { return pias[7].in_cb2; }
1379READ8_HANDLER( pia_0_cb2_r ) { return pia_get_input_cb2(0); }
1380READ8_HANDLER( pia_1_cb2_r ) { return pia_get_input_cb2(1); }
1381READ8_HANDLER( pia_2_cb2_r ) { return pia_get_input_cb2(2); }
1382READ8_HANDLER( pia_3_cb2_r ) { return pia_get_input_cb2(3); }
1383READ8_HANDLER( pia_4_cb2_r ) { return pia_get_input_cb2(4); }
1384READ8_HANDLER( pia_5_cb2_r ) { return pia_get_input_cb2(5); }
1385READ8_HANDLER( pia_6_cb2_r ) { return pia_get_input_cb2(6); }
1386READ8_HANDLER( pia_7_cb2_r ) { return pia_get_input_cb2(7); }
src/emu/machine/6532riot.c
r1527r1528
313313   r6532[which].intf = intf;
314314
315315   /* Default clock is CPU #0 clock */
316   r6532_set_clock( which, Machine->drv->cpu[0].clock );
316   r6532_set_clock( which, cpunum_get_clock(0) );
317317}
318318
319319
src/emu/machine/6522via.c
r1527r1528
165165   via[which].time2 = via[which].time1 = timer_get_time();
166166
167167   /* Default clock is from CPU1 */
168   via_set_clock (which, Machine->drv->cpu[0].clock);
168   via_set_clock (which, cpunum_get_clock(0));
169169}
170170
171171/******************* external interrupt check *******************/
src/emu/machine/6821pia.h
r1527r1528
7676
7777/*------------- Device interface for port A --------------*/
7878
79UINT8 pia_get_input_a(int which);
7980void pia_set_input_a(int which, UINT8 data, UINT8 z_mask);
8081UINT8 pia_get_output_a(int which);
8182
r1527r1528
8384
8485/*----------- Device interface for the CA1 pin -----------*/
8586
87int pia_get_input_ca1(int which);
8688void pia_set_input_ca1(int which, int data);
8789
8890
8991
9092/*----------- Device interface for the CA2 pin -----------*/
9193
94int pia_get_input_ca2(int which);
9295void pia_set_input_ca2(int which, int data);
9396int pia_get_output_ca2(int which);
9497
9598
9699
97/*------------- Device interface for port A --------------*/
100/*------------- Device interface for port B --------------*/
98101
102UINT8 pia_get_input_b(int which);
99103void pia_set_input_b(int which, UINT8 data);
100104UINT8 pia_get_output_b(int which);
101105
r1527r1528
103107
104108/*----------- Device interface for the CB1 pin -----------*/
105109
110int pia_get_input_cb1(int which);
106111void pia_set_input_cb1(int which, int data);
107112
108113
109114
110115/*----------- Device interface for the CB2 pin -----------*/
111116
117int pia_get_input_cb2(int which);
112118void pia_set_input_cb2(int which, int data);
113119int pia_get_output_cb2(int which);
114120int pia_get_output_cb2_z(int which);  /* see first note */
src/emu/machine/tmp68301.c
r1527r1528
9090      {
9191         int scale = (TCR & 0x3c00)>>10;         // P4..1
9292         if (scale > 8) scale = 8;
93         duration = attotime_mul(ATTOTIME_IN_HZ(Machine->drv->cpu[0].clock), (1 << scale) * max);
93         duration = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(0)), (1 << scale) * max);
9494      }
9595      break;
9696   }
src/emu/inptport.h
r1527r1528
3535#define IP_ACTIVE_LOW      0xffffffff
3636
3737
38/* macro for a custom callback functions (PORT_CUSTOM) */
39#define CUSTOM_INPUT(name)   UINT32 name(void *param)
40
41
3842/* sequence types for input_port_seq() call */
3943enum _input_seq_type
4044{
r1527r1528
4448};
4549typedef enum _input_seq_type input_seq_type;
4650
51
4752/* conditions for DIP switches */
4853enum
4954{
src/emu/cpuintrf.c
r1527r1528
5353void i8039_get_info(UINT32 state, cpuinfo *info);
5454void i8048_get_info(UINT32 state, cpuinfo *info);
5555void n7751_get_info(UINT32 state, cpuinfo *info);
56void mb8884_get_info(UINT32 state, cpuinfo *info);
57void m58715_get_info(UINT32 state, cpuinfo *info);
5658void i8x41_get_info(UINT32 state, cpuinfo *info);
5759void i8051_get_info(UINT32 state, cpuinfo *info);
5860void i8052_get_info(UINT32 state, cpuinfo *info);
r1527r1528
113115void jaguardsp_get_info(UINT32 state, cpuinfo *info);
114116void r3000be_get_info(UINT32 state, cpuinfo *info);
115117void r3000le_get_info(UINT32 state, cpuinfo *info);
118void r3041be_get_info(UINT32 state, cpuinfo *info);
119void r3041le_get_info(UINT32 state, cpuinfo *info);
116120void r4600be_get_info(UINT32 state, cpuinfo *info);
117121void r4600le_get_info(UINT32 state, cpuinfo *info);
118122void r4650be_get_info(UINT32 state, cpuinfo *info);
r1527r1528
365369#if (HAS_N7751)
366370   { CPU_N7751, n7751_get_info },
367371#endif
372#if (HAS_MB8884)
373   { CPU_MB8884, mb8884_get_info },
374#endif
375#if (HAS_M58715)
376   { CPU_M58715, m58715_get_info },
377#endif
368378#if (HAS_I8X41)
369379   { CPU_I8X41, i8x41_get_info },
370380#endif
r1527r1528
541551   { CPU_R3000BE, r3000be_get_info },
542552   { CPU_R3000LE, r3000le_get_info },
543553#endif
554#if (HAS_R3041)
555   { CPU_R3041BE, r3041be_get_info },
556   { CPU_R3041LE, r3041le_get_info },
557#endif
544558#if (HAS_R4600)
545559   { CPU_R4600BE, r4600be_get_info },
546560   { CPU_R4600LE, r4600le_get_info },
r1527r1528
9891003   totalcpu = 0;
9901004
9911005   /* compute information about the CPUs now if we have a machine */
992   if (Machine != NULL)
1006   if (machine != NULL)
9931007   {
9941008      /* loop over all defined CPUs */
9951009      for (totalcpu = 0; totalcpu < CPU_COUNT; totalcpu++)
9961010      {
997         cpu_type cputype = Machine->drv->cpu[totalcpu].type;
1011         cpu_type cputype = machine->drv->cpu[totalcpu].type;
9981012         char familyname[256];
9991013         int j;
10001014
r1527r1528
16071621      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
16081622      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
16091623      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
1624      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
16101625      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
16111626      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
16121627      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 1;                     break;
src/emu/cpuexec.c
r1527r1528
215215      /* initialize the cpuinfo struct */
216216      memset(&cpu[cpunum], 0, sizeof(cpu[cpunum]));
217217      cpu[cpunum].suspend = SUSPEND_REASON_RESET;
218      cpu[cpunum].clock = machine->drv->cpu[cpunum].clock;
218      cpu[cpunum].clock = (UINT64)machine->drv->cpu[cpunum].clock * cputype_clock_multiplier(cputype) / cputype_clock_divider(cputype);
219219      cpu[cpunum].clockscale = 1.0;
220220      cpu[cpunum].localtime = attotime_zero;
221221
src/emu/cpuintrf.h
r1527r1528
8181   CPUINFO_INT_OUTPUT_LINES,                     /* R/O: number of output lines */
8282   CPUINFO_INT_DEFAULT_IRQ_VECTOR,                  /* R/O: default IRQ vector */
8383   CPUINFO_INT_ENDIANNESS,                        /* R/O: either CPU_IS_BE or CPU_IS_LE */
84   CPUINFO_INT_CLOCK_MULTIPLIER,                  /* R/O: internal clock multiplier */
8485   CPUINFO_INT_CLOCK_DIVIDER,                     /* R/O: internal clock divider */
8586   CPUINFO_INT_MIN_INSTRUCTION_BYTES,               /* R/O: minimum bytes per instruction */
8687   CPUINFO_INT_MAX_INSTRUCTION_BYTES,               /* R/O: maximum bytes per instruction */
r1527r1528
332333#define activecpu_output_lines()            activecpu_get_info_int(CPUINFO_INT_OUTPUT_LINES)
333334#define activecpu_default_irq_vector()         activecpu_get_info_int(CPUINFO_INT_DEFAULT_IRQ_VECTOR)
334335#define activecpu_endianness()               activecpu_get_info_int(CPUINFO_INT_ENDIANNESS)
336#define activecpu_clock_multiplier()         activecpu_get_info_int(CPUINFO_INT_CLOCK_MULTIPLIER)
335337#define activecpu_clock_divider()            activecpu_get_info_int(CPUINFO_INT_CLOCK_DIVIDER)
336338#define activecpu_min_instruction_bytes()      activecpu_get_info_int(CPUINFO_INT_MIN_INSTRUCTION_BYTES)
337339#define activecpu_max_instruction_bytes()      activecpu_get_info_int(CPUINFO_INT_MAX_INSTRUCTION_BYTES)
r1527r1528
402404#define cpunum_output_lines(cpunum)            cpunum_get_info_int(cpunum, CPUINFO_INT_OUTPUT_LINES)
403405#define cpunum_default_irq_vector(cpunum)      cpunum_get_info_int(cpunum, CPUINFO_INT_DEFAULT_IRQ_VECTOR)
404406#define cpunum_endianness(cpunum)            cpunum_get_info_int(cpunum, CPUINFO_INT_ENDIANNESS)
407#define cpunum_clock_multiplier(cpunum)         cpunum_get_info_int(cpunum, CPUINFO_INT_CLOCK_MULTIPLIER)
405408#define cpunum_clock_divider(cpunum)         cpunum_get_info_int(cpunum, CPUINFO_INT_CLOCK_DIVIDER)
406409#define cpunum_min_instruction_bytes(cpunum)   cpunum_get_info_int(cpunum, CPUINFO_INT_MIN_INSTRUCTION_BYTES)
407410#define cpunum_max_instruction_bytes(cpunum)   cpunum_get_info_int(cpunum, CPUINFO_INT_MAX_INSTRUCTION_BYTES)
r1527r1528
442445#define cputype_output_lines(cputype)         cputype_get_info_int(cputype, CPUINFO_INT_OUTPUT_LINES)
443446#define cputype_default_irq_vector(cputype)      cputype_get_info_int(cputype, CPUINFO_INT_DEFAULT_IRQ_VECTOR)
444447#define cputype_endianness(cputype)            cputype_get_info_int(cputype, CPUINFO_INT_ENDIANNESS)
448#define cputype_clock_multiplier(cputype)      cputype_get_info_int(cputype, CPUINFO_INT_CLOCK_MULTIPLIER)
445449#define cputype_clock_divider(cputype)         cputype_get_info_int(cputype, CPUINFO_INT_CLOCK_DIVIDER)
446450#define cputype_min_instruction_bytes(cputype)   cputype_get_info_int(cputype, CPUINFO_INT_MIN_INSTRUCTION_BYTES)
447451#define cputype_max_instruction_bytes(cputype)   cputype_get_info_int(cputype, CPUINFO_INT_MAX_INSTRUCTION_BYTES)
src/emu/cpuexec.h
r1527r1528
5555   CPU_I8039,
5656   CPU_I8048,
5757   CPU_N7751,
58   CPU_MB8884,
59   CPU_M58715,
5860   CPU_I8X41,
5961   CPU_I8051,
6062   CPU_I8052,
r1527r1528
116118   CPU_JAGUARDSP,
117119   CPU_R3000BE,
118120   CPU_R3000LE,
121   CPU_R3041BE,
122   CPU_R3041LE,
119123   CPU_R4600BE,
120124   CPU_R4600LE,
121125   CPU_R4650BE,
src/emu/sound/scsp.c
r1527r1528
960960   if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0)
961961   {
962962      INT32 smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
963      INT32 cycle=LEA(slot)-LSA(slot); // cycle corresponds to 2 pi
964963
965964      smp<<=0xA; // associate cycle with 1024
966965      smp>>=0x1A-MDL(slot); // ex. for MDL=0xF, sample range corresponds to +/- 64 pi (32=2^5 cycles) so shift by 11 (16-5 == 0x1A-0xF)
967      while(smp<0) smp+=cycle; smp%=cycle; // keep modulation sampler within a single cycle
968966      if(!PCM8B(slot)) smp<<=1;
969967
970968      addr1+=smp; addr2+=smp;
src/emu/sound/5220intf.c
r1527r1528
7373}
7474
7575
76static void *tms5200_start(int sndindex, int clock, const void *config)
77{
78   struct tms5220_info *info = tms5220_start(sndindex, clock, config);
79   tms5220_set_variant(info->chip, variant_tmc0285);
80   return info;
81}
7682
83
84
7785/**********************************************************************************************
7886
7987     tms5220_stop -- free buffers
r1527r1528
244252   switch (state)
245253   {
246254      /* --- the following bits of info are returned as 64-bit signed integers --- */
255      case SNDINFO_INT_ALIAS:                     info->i = SOUND_TMS5220;            break;
247256
248257      /* --- the following bits of info are returned as pointers to data or functions --- */
249258      case SNDINFO_PTR_SET_INFO:                  info->set_info = tms5220_set_info;      break;
r1527r1528
260269   }
261270}
262271
272void tmc0285_get_info(void *token, UINT32 state, sndinfo *info)
273{
274   switch (state)
275   {
276      case SNDINFO_PTR_START:                     info->start = tms5200_start;         break;
277      case SNDINFO_STR_NAME:                     info->s = "TMC0285";               break;
278      default:                               tms5220_get_info(token, state, info);   break;
279   }
280}
281
282void tms5200_get_info(void *token, UINT32 state, sndinfo *info)
283{
284   switch (state)
285   {
286      case SNDINFO_PTR_START:                     info->start = tms5200_start;         break;
287      case SNDINFO_STR_NAME:                     info->s = "TMS5200";               break;
288      default:                               tms5220_get_info(token, state, info);   break;
289   }
290}
291
src/emu/sound/sound.mak
r1527r1528
581581#-------------------------------------------------
582582
583583SOUNDDEFS += -DHAS_TMS5110=$(if $(filter TMS5110,$(SOUNDS)),1,0)
584SOUNDDEFS += -DHAS_TMC0285=$(if $(filter TMC0285,$(SOUNDS)),1,0)
585SOUNDDEFS += -DHAS_TMS5200=$(if $(filter TMS5200,$(SOUNDS)),1,0)
584586SOUNDDEFS += -DHAS_TMS5220=$(if $(filter TMS5220,$(SOUNDS)),1,0)
585587
586588ifneq ($(filter TMS5110,$(SOUNDS)),)
587589SOUNDOBJS += $(SOUNDOBJ)/tms5110.o $(SOUNDOBJ)/5110intf.o
588590endif
589591
590ifneq ($(filter TMS5220,$(SOUNDS)),)
592ifneq ($(filter TMC0285 TMS5200 TMS5220,$(SOUNDS)),)
591593SOUNDOBJS += $(SOUNDOBJ)/tms5220.o $(SOUNDOBJ)/5220intf.o
592594endif
593595
src/emu/sound/tms5220.c
r1527r1528
2626   * modified code so that the beast only start speaking at the start of next frame, like the data
2727     sheet says
2828*/
29#define USE_OBSOLETE_HACK 0
3029
3130
3231#ifndef TRUE
r1527r1528
5857    */
5958   UINT8 tms5220_speaking;   /* Speak or Speak External command in progress */
6059   UINT8 speak_external;   /* Speak External command in progress */
61   #if USE_OBSOLETE_HACK
62   UINT8 speak_delay_frames;
63   #endif
6460   UINT8 talk_status;       /* tms5220 is really currently speaking */
6561   UINT8 first_frame;      /* we have just started speaking, and we are to parse the first frame */
6662   UINT8 last_frame;      /* we are doing the frame of sound */
r1527r1528
112108   UINT8 data_register;            /* data register, used by read command */
113109   UINT8 RDB_flag;               /* whether we should read data register or status register */
114110
115   /* flag for variant tms0285/tms5200 emulation */
111   /* flag for variant tmc0285/tms5200 emulation */
116112   /* The TMC0285 AKA TMS5200 is an early variant of the TMS5220 used in
117113       the early releases of the Speech Module for the TI-99/4(a) computer,
118114       in Zaccaria's 'Money Money', and in a few other places.
r1527r1528
231227   /* initialize the chip state */
232228   /* Note that we do not actually clear IRQ on start-up : IRQ is even raised if tms->buffer_empty or tms->buffer_low are 0 */
233229   tms->tms5220_speaking = tms->speak_external = tms->talk_status = tms->first_frame = tms->last_frame = tms->irq_pin = 0;
234#if USE_OBSOLETE_HACK
235   tms->speak_delay_frames = 0;
236#endif
237230   if (tms->irq_func) tms->irq_func(0);
238231   tms->buffer_empty = tms->buffer_low = 1;
239232
r1527r1528
315308
316309/**********************************************************************************************
317310
318     tms5220_set_variant -- sets the tms5220 core to emulate its buggy forerunner, the tms0285
311     tms5220_set_variant -- sets the tms5220 core to emulate its buggy forerunner, the tmc0285
319312
320313***********************************************************************************************/
321314
r1527r1528
511504      tms->buffer_empty = 0;
512505   }
513506
514#if 0
515   /* we are to speak, yet we fill with 0s until start of next frame */
516   if (tms->first_frame)
517   {
518      while ((size > 0) && ((tms->sample_count != 0) || (tms->interp_count != 0)))
519      {
520         tms->sample_count = (tms->sample_count + 1) % 200;
521         tms->interp_count = (tms->interp_count + 1) % 25;
522         buffer[buf_count] = 0x00;   /* should be (-1 << 8) ??? (cf note in data sheet, p 10, table 4) */
523         buf_count++;
524         size--;
525      }
526   }
527#endif
528
529#if USE_OBSOLETE_HACK
530    /* apply some delay before we actually consume data; Victory requires this */
531    if (tms->speak_delay_frames)
532    {
533       if (size <= tms->speak_delay_frames)
534       {
535          tms->speak_delay_frames -= size;
536          size = 0;
537       }
538       else
539       {
540          size -= tms->speak_delay_frames;
541          tms->speak_delay_frames = 0;
542       }
543    }
544#endif
545
546507    /* loop until the buffer is full or we've stopped speaking */
547508   while ((size > 0) && tms->talk_status)
548509    {
r1527r1528
847808
848809      case 0x60 : /* speak external */
849810         tms->tms5220_speaking = tms->speak_external = 1;
850#if USE_OBSOLETE_HACK
851            tms->speak_delay_frames = 10;
852#endif
853
854811         tms->RDB_flag = FALSE;
855812
856813            /* according to the datasheet, this will cause an interrupt due to a BE condition */
r1527r1528
946903
947904    /* if the previous frame was a stop frame, don't do anything */
948905   if ((! the_first_frame) && (tms->old_energy == (energytable[15] >> 6)))
949      /*return 1;*/
950   {
951      tms->buffer_empty = 1;
952906      return 1;
953   }
907//  WARNING: This code below breaks Victory's power-on test! If you change it
908//  make sure you test Victory.
909//  {
910//      if (DEBUG_5220) logerror("Buffer Empty set - Last frame stop frame\n");
954911
912//      tms->buffer_empty = 1;
913//      return 1;
914//  }
915
955916   if (tms->speak_external)
956917       /* count the total number of bits available */
957918      bits = tms->fifo_count * 8 - tms->fifo_bits_taken;
r1527r1528
1023984        tms->new_k[0] = k1table[extract_bits(tms, 5)];
1024985        tms->new_k[1] = k2table[extract_bits(tms, 5)];
1025986        tms->new_k[2] = k3table[extract_bits(tms, 4)];
1026      if (tms->variant == variant_tms0285)
987      if (tms->variant == variant_tmc0285)
1027988         tms->new_k[3] = k3table[extract_bits(tms, 4)];   /* ??? */
1028989      else
1029990         tms->new_k[3] = k4table[extract_bits(tms, 4)];
r1527r1528
10431004    tms->new_k[0] = k1table[extract_bits(tms, 5)];
10441005    tms->new_k[1] = k2table[extract_bits(tms, 5)];
10451006    tms->new_k[2] = k3table[extract_bits(tms, 4)];
1046   if (tms->variant == variant_tms0285)
1007   if (tms->variant == variant_tmc0285)
10471008      tms->new_k[3] = k3table[extract_bits(tms, 4)];   /* ??? */
10481009   else
10491010      tms->new_k[3] = k4table[extract_bits(tms, 4)];
src/emu/sound/tms5220.h
r1527r1528
2525typedef enum
2626{
2727   variant_tms5220,   /* TMS5220_IS_TMS5220, TMS5220_IS_TMS5220C,  TMS5220_IS_TSP5220C */
28   variant_tms0285      /* TMS5220_IS_TMS5200, TMS5220_IS_CD2501 */
28   variant_tmc0285      /* TMS5220_IS_TMS5200, TMS5220_IS_CD2501 */
2929} tms5220_variant;
3030
3131void tms5220_set_variant(void *chip, tms5220_variant new_variant);
src/emu/ui.c
r1527r1528
1919#include "ui.h"
2020#include "uimenu.h"
2121#include "uigfx.h"
22#include "uitext.h"
2322
2423#ifdef MESS
2524#include "mess.h"
r1527r1528
248247   /* make sure we clean up after ourselves */
249248   add_exit_callback(machine, ui_exit);
250249
251   /* load the localization file */
252   /* fix me -- need to find a real way to do this */
253   uistring_init(NULL);
254
255250   /* allocate the font */
256251   ui_font = render_font_alloc("ui.bdf");
257252
r1527r1528
946941static int sprintf_disclaimer(char *buffer)
947942{
948943   char *bufptr = buffer;
949   bufptr += sprintf(bufptr, "%s\n\n", ui_getstring(UI_copyright1));
950   bufptr += sprintf(bufptr, ui_getstring(UI_copyright2), Machine->gamedrv->description);
951   bufptr += sprintf(bufptr, "\n\n%s", ui_getstring(UI_copyright3));
944   bufptr += sprintf(bufptr, "Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n");
945   bufptr += sprintf(bufptr, "IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", Machine->gamedrv->description);
946   bufptr += sprintf(bufptr, "Otherwise, type OK or move the joystick left then right to continue");
952947   return bufptr - buffer;
953948}
954949
r1527r1528
978973   /* add a warning if any ROMs were loaded with warnings */
979974   if (rom_load_warnings() > 0)
980975   {
981      bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_incorrectroms));
976      bufptr += sprintf(bufptr, "One or more ROMs/CHDs for this game are incorrect. The " GAMENOUN " may not run correctly.\n");
982977      if (Machine->gamedrv->flags & WARNING_FLAGS)
983978         *bufptr++ = '\n';
984979   }
r1527r1528
986981   /* if we have at least one warning flag, print the general header */
987982   if (Machine->gamedrv->flags & WARNING_FLAGS)
988983   {
989      bufptr += sprintf(bufptr, "%s\n\n", ui_getstring(UI_knownproblems));
984      bufptr += sprintf(bufptr, "There are known problems with this " GAMENOUN "\n\n");
990985
991986      /* add one line per warning flag */
992987#ifdef MESS
993988      if (Machine->gamedrv->flags & GAME_COMPUTER)
994         bufptr += sprintf(bufptr, "%s\n\n%s\n", ui_getstring(UI_comp1), ui_getstring(UI_comp2));
989         bufptr += sprintf(bufptr, "%s\n\n%s\n", "The emulated system is a computer: ", "The keyboard emulation may not be 100% accurate.");
995990#endif
996991      if (Machine->gamedrv->flags & GAME_IMPERFECT_COLORS)
997         bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_imperfectcolors));
992         bufptr += sprintf(bufptr, "The colors aren't 100%% accurate.\n");
998993      if (Machine->gamedrv->flags & GAME_WRONG_COLORS)
999         bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_wrongcolors));
994         bufptr += sprintf(bufptr, "The colors are completely wrong.\n");
1000995      if (Machine->gamedrv->flags & GAME_IMPERFECT_GRAPHICS)
1001         bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_imperfectgraphics));
996         bufptr += sprintf(bufptr, "The video emulation isn't 100%% accurate.\n");
1002997      if (Machine->gamedrv->flags & GAME_IMPERFECT_SOUND)
1003         bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_imperfectsound));
998         bufptr += sprintf(bufptr, "The sound emulation isn't 100%% accurate.\n");
1004999      if (Machine->gamedrv->flags & GAME_NO_SOUND)
1005         bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_nosound));
1000         bufptr += sprintf(bufptr, "The game lacks sound.\n");
10061001      if (Machine->gamedrv->flags & GAME_NO_COCKTAIL)
1007         bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_nococktail));
1002         bufptr += sprintf(bufptr, "Screen flipping in cocktail mode is not supported.\n");
10081003
10091004      /* if there's a NOT WORKING or UNEMULATED PROTECTION warning, make it stronger */
10101005      if (Machine->gamedrv->flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION))
r1527r1528
10151010
10161011         /* add the strings for these warnings */
10171012         if (Machine->gamedrv->flags & GAME_NOT_WORKING)
1018            bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_brokengame));
1013            bufptr += sprintf(bufptr, "THIS " CAPGAMENOUN " DOESN'T WORK. You won't be able to make it work correctly.  Don't bother.\n");
10191014         if (Machine->gamedrv->flags & GAME_UNEMULATED_PROTECTION)
1020            bufptr += sprintf(bufptr, "%s\n", ui_getstring(UI_brokenprotection));
1015            bufptr += sprintf(bufptr, "The game has protection which isn't fully emulated.\n");
10211016
10221017         /* find the parent of this driver */
10231018         clone_of = driver_get_clone(Machine->gamedrv);
r1527r1528
10341029               {
10351030                  /* this one works, add a header and display the name of the clone */
10361031                  if (foundworking == 0)
1037                     bufptr += sprintf(bufptr, "\n\n%s\n\n", ui_getstring(UI_workingclones));
1032                     bufptr += sprintf(bufptr, "\n\nThere are working clones of this game. They are:\n\n");
10381033                  bufptr += sprintf(bufptr, "%s\n", drivers[i]->name);
10391034                  foundworking = 1;
10401035               }
r1527r1528
10421037   }
10431038
10441039   /* add the 'press OK' string */
1045   bufptr += sprintf(bufptr, "\n\n%s", ui_getstring(UI_typeok));
1040   bufptr += sprintf(bufptr, "\n\nType OK or move the joystick left then right to continue");
10461041   return bufptr - buffer;
10471042}
10481043
r1527r1528
10591054   int count;
10601055
10611056   /* print description, manufacturer, and CPU: */
1062   bufptr += sprintf(bufptr, "%s\n%s %s\n\n%s:\n", Machine->gamedrv->description, Machine->gamedrv->year, Machine->gamedrv->manufacturer, ui_getstring(UI_cpu));
1057   bufptr += sprintf(bufptr, "%s\n%s %s\n\nCPU:\n", Machine->gamedrv->description, Machine->gamedrv->year, Machine->gamedrv->manufacturer);
10631058
10641059   /* loop over all CPUs */
10651060   for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum += count)
r1527r1528
10861081   }
10871082
10881083   /* append the Sound: string */
1089   bufptr += sprintf(bufptr, "\n%s:\n", ui_getstring(UI_sound));
1084   bufptr += sprintf(bufptr, "\nSound:\n");
10901085
10911086   /* loop over all sound chips */
10921087   for (sndnum = 0; sndnum < MAX_SOUND && Machine->drv->sound[sndnum].type != SOUND_DUMMY; sndnum += count)
r1527r1528
11161111
11171112   /* display vector information for vector games */
11181113   if (Machine->drv->video_attributes & VIDEO_TYPE_VECTOR)
1119      bufptr += sprintf(bufptr, "\n%s\n", ui_getstring(UI_vectorgame));
1114      bufptr += sprintf(bufptr, "\nVector Game\n");
11201115
11211116   /* display screen resolution and refresh rate info for raster games */
11221117   else if (Machine->drv->video_attributes & VIDEO_TYPE_RASTER)
1123      bufptr += sprintf(bufptr,"\n%s:\n%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
1124            ui_getstring(UI_screenres),
1118      bufptr += sprintf(bufptr,"\nScreen Resolution:\n%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
11251119            Machine->screen[0].visarea.max_x - Machine->screen[0].visarea.min_x + 1,
11261120            Machine->screen[0].visarea.max_y - Machine->screen[0].visarea.min_y + 1,
11271121            (Machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H",
r1527r1528
16681662   if (buffer != NULL)
16691663   {
16701664      sound_set_attenuation(newval);
1671      sprintf(buffer, "%s %3ddB", ui_getstring(UI_volume), sound_get_attenuation());
1665      sprintf(buffer, "Volume %3ddB", sound_get_attenuation());
16721666   }
16731667   return sound_get_attenuation();
16741668}
r1527r1528
16841678   if (buffer != NULL)
16851679   {
16861680      sound_set_user_gain(arg, (float)newval * 0.001f);
1687      sprintf(buffer, "%s %s %4.2f", sound_get_user_gain_name(arg), ui_getstring(UI_volume), sound_get_user_gain(arg));
1681      sprintf(buffer, "%s Volume %4.2f", sound_get_user_gain_name(arg), sound_get_user_gain(arg));
16881682   }
16891683   return floor(sound_get_user_gain(arg) * 1000.0f + 0.5f);
16901684}
r1527r1528
17171711   if (buffer != NULL)
17181712   {
17191713      cpunum_set_clockscale(arg, (float)newval * 0.001f);
1720      sprintf(buffer, "%s %s%d %3.0f%%", ui_getstring(UI_overclock), ui_getstring(UI_cpu), arg, floor(cpunum_get_clockscale(arg) * 100.0f + 0.5f));
1714      sprintf(buffer, "Overclock CPU %d %3.0f%%", arg, floor(cpunum_get_clockscale(arg) * 100.0f + 0.5f));
17211715   }
17221716   return floor(cpunum_get_clockscale(arg) * 1000.0f + 0.5f);
17231717}
r1527r1528
17361730   {
17371731      screen_state *state = &Machine->screen[arg];
17381732      video_screen_configure(arg, state->width, state->height, &state->visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
1739      sprintf(buffer, "Screen %d %s %.3f", arg, ui_getstring(UI_refresh_rate), ATTOSECONDS_TO_HZ(Machine->screen[arg].refresh));
1733      sprintf(buffer, "Screen %d Refresh rate %.3f", arg, ATTOSECONDS_TO_HZ(Machine->screen[arg].refresh));
17401734   }
17411735   refresh = ATTOSECONDS_TO_HZ(Machine->screen[arg].refresh);
17421736   return floor((refresh - defrefresh) * 1000.0f + 0.5f);
r1527r1528
17541748   if (buffer != NULL)
17551749   {
17561750      render_container_set_brightness(container, (float)newval * 0.001f);
1757      sprintf(buffer, "Screen %d %s %.3f", arg, ui_getstring(UI_brightness), render_container_get_brightness(container));
1751      sprintf(buffer, "Screen %d Brightness %.3f", arg, render_container_get_brightness(container));
17581752   }
17591753   return floor(render_container_get_brightness(container) * 1000.0f + 0.5f);
17601754}
r1527r1528
17711765   if (buffer != NULL)
17721766   {
17731767      render_container_set_contrast(container, (float)newval * 0.001f);
1774      sprintf(buffer, "Screen %d %s %.3f", arg, ui_getstring(UI_contrast), render_container_get_contrast(container));
1768      sprintf(buffer, "Screen %d Contrast %.3f", arg, render_container_get_contrast(container));
17751769   }
17761770   return floor(render_container_get_contrast(container) * 1000.0f + 0.5f);
17771771}
r1527r1528
17871781   if (buffer != NULL)
17881782   {
17891783      render_container_set_gamma(container, (float)newval * 0.001f);
1790      sprintf(buffer, "Screen %d %s %.3f", arg, ui_getstring(UI_gamma), render_container_get_gamma(container));
1784      sprintf(buffer, "Screen %d Gamma %.3f", arg, render_container_get_gamma(container));
17911785   }
17921786   return floor(render_container_get_gamma(container) * 1000.0f + 0.5f);
17931787}
r1527r1528
18711865   if (buffer != NULL)
18721866   {
18731867      vector_set_flicker((float)newval * 0.1f);
1874      sprintf(buffer, "%s %1.2f", ui_getstring(UI_vectorflicker), vector_get_flicker());
1868      sprintf(buffer, "Vector Flicker %1.2f", vector_get_flicker());
18751869   }
18761870   return floor(vector_get_flicker() * 10.0f + 0.5f);
18771871}
src/emu/sndintrf.c
r1527r1528
108108void tms36xx_get_info(void *token, UINT32 state, sndinfo *info);
109109void tms3615_get_info(void *token, UINT32 state, sndinfo *info);
110110void tms5110_get_info(void *token, UINT32 state, sndinfo *info);
111void tmc0285_get_info(void *token, UINT32 state, sndinfo *info);
112void tms5200_get_info(void *token, UINT32 state, sndinfo *info);
111113void tms5220_get_info(void *token, UINT32 state, sndinfo *info);
112114void vlm5030_get_info(void *token, UINT32 state, sndinfo *info);
113115void adpcm_get_info(void *token, UINT32 state, sndinfo *info);
r1527r1528
287289#if (HAS_TMS5110)
288290   { SOUND_TMS5110, tms5110_get_info },
289291#endif
292#if (HAS_TMC0285)
293   { SOUND_TMC0285, tmc0285_get_info },
294#endif
295#if (HAS_TMS5200)
296   { SOUND_TMS5200, tms5200_get_info },
297#endif
290298#if (HAS_TMS5220)
291299   { SOUND_TMS5220, tms5220_get_info },
292300#endif
src/emu/sndintrf.h
r1527r1528
7373   SOUND_TMS36XX,
7474   SOUND_TMS3615,
7575   SOUND_TMS5110,
76   SOUND_TMC0285,
77   SOUND_TMS5200,
7678   SOUND_TMS5220,
7779   SOUND_VLM5030,
7880   SOUND_OKIM6295,
src/emu/cheat.c
r1527r1528
1212#include "driver.h"
1313#include "ui.h"
1414#include "uimenu.h"
15#include "uitext.h"
1615#include "machine/eeprom.h"
1716#include "cheat.h"
1817#include <ctype.h>
r1527r1528
16751674   }
16761675
16771676   /********** MENU CONSTRUCION **********/
1678   menu_item[total++].text = ui_getstring(UI_enablecheat);            // Enable/Disable a Cheat
1677   menu_item[total++].text = "Enable/Disable a Cheat";            // Enable/Disable a Cheat
16791678
1680   menu_item[total++].text = ui_getstring(UI_addeditcheat);         // Add/Edit a Cheat
1679   menu_item[total++].text = "Add/Edit a Cheat";         // Add/Edit a Cheat
16811680
16821681   switch(EXTRACT_FIELD(cheatOptions, SearchBox))                  // Search a Cheat
16831682   {
r1527r1528
16941693         break;
16951694   }
16961695
1697   menu_item[total++].text = ui_getstring(UI_memorywatch);            // Configure Watchpoints
1696   menu_item[total++].text = "Configure Watchpoints";            // Configure Watchpoints
16981697
1699   menu_item[total++].text = ui_getstring(UI_reloaddatabase);         // Reload Cheat Database
1698   menu_item[total++].text = "Reload Database";         // Reload Cheat Database
17001699
1701   menu_item[total++].text = ui_getstring(UI_options);               // Options
1700   menu_item[total++].text = "Options";               // Options
17021701
1703   menu_item[total++].text = ui_getstring(UI_returntomain);         // return to the MAME general menu
1702   menu_item[total++].text = "Return to Main Menu";         // return to the MAME general menu
17041703
17051704   menu_item[total].text = NULL;                              // terminate array
17061705
r1527r1528
20302029
20312030   /* ----- print it ----- */
20322031   if(TEST_FIELD(action->type, UserSelectBCD))
2033      sprintf(buf, "\t%s\n\t%.2X\n", ui_getstring(UI_search_select_value), displayValue);
2032      sprintf(buf, "\tSelect a value\n\t%.2X\n", displayValue);
20342033   else
2035      sprintf(buf, "\t%s\n\t%.2X (%d)\n", ui_getstring(UI_search_select_value), displayValue, displayValue);
2034      sprintf(buf, "\tSelect a value\n\t%.2X (%d)\n", displayValue, displayValue);
20362035
20372036   /* ----- create fake menu strings ----- */
2038   strcat(buf, "\t");
2039   strcat(buf, ui_getstring(UI_lefthilight));
2040   strcat(buf, " ");
2041   strcat(buf, ui_getstring(UI_OK));
2042   strcat(buf, " ");
2043   strcat(buf, ui_getstring(UI_righthilight));
2037   strcat(buf, "\t OK ");
20442038
20452039   /* ----- print it ----- */
20462040   ui_draw_message_window(buf);
r1527r1528
21842178   else
21852179      comment = "(none)";
21862180
2187   sprintf(buf, "%s\n\t%s %s %s", comment, ui_getstring(UI_lefthilight), ui_getstring(UI_OK), ui_getstring(UI_righthilight));
2181   sprintf(buf, "%s\n\t OK ", comment);
21882182
21892183   /* ----- print it ----- */
21902184   ui_draw_message_window(buf);
r1527r1528
22762270         if(traverse->selection && (traverse->selection < traverse->actionListLength))
22772271            menu_subitem[total] = traverse->actionList[traverse->selection].optionalName;
22782272         else
2279            menu_subitem[total] = ui_getstring(UI_off);
2273            menu_subitem[total] = "Off";
22802274      }
22812275      else                     // others get "ON" or "OFF"
22822276      {
r1527r1528
22842278         if(!(traverse->flags & kCheatFlag_Null))
22852279         {
22862280            if(traverse->flags & kCheatFlag_OneShot)
2287               menu_subitem[total] = ui_getstring(UI_set);
2281               menu_subitem[total] = "Set";
22882282            else
22892283            {
22902284               if(traverse->flags & kCheatFlag_Active)
2291                  menu_subitem[total] = ui_getstring(UI_on);
2285                  menu_subitem[total] = "On";
22922286               else
2293                  menu_subitem[total] = ui_getstring(UI_off);
2287                  menu_subitem[total] = "Off";
22942288            }
22952289         }
22962290      }
r1527r1528
23242318   }
23252319
23262320   /* ----- set return item ----- */
2327   menu_item[total] = ui_getstring(UI_returntoprior);
2321   menu_item[total] = "Return to Prior Menu";
23282322   menu_subitem[total] = NULL;
23292323   flagBuf[total++] = 0;
23302324
r1527r1528
26912685         menu_item[total++] = "(none)";
26922686   }
26932687
2694   menu_item[total++] = ui_getstring(UI_returntoprior);      // return
2688   menu_item[total++] = "Return to Prior Menu";      // return
26952689
26962690   menu_item[total] = NULL;               // terminate array
26972691
r1527r1528
31763170         menuItemInfo[total].subcheat = i;
31773171         menuItemInfo[total].fieldType = kType_LinkExtension;
31783172         menuItem[total] = "Link Extension";
3179         menuSubItem[total++] = ui_getstring(TEST_FIELD(traverse->type, LinkExtension) ? UI_on : UI_off);
3173         menuSubItem[total++] = TEST_FIELD(traverse->type, LinkExtension) ? "On" : "Off";
31803174      }
31813175
31823176      {
r1527r1528
32213215               menuItemInfo[total].subcheat = i;
32223216               menuItemInfo[total].fieldType = kType_OneShot;
32233217               menuItem[total] = "One Shot";
3224               menuSubItem[total++] = ui_getstring(TEST_FIELD(traverse->type, OneShot) ? UI_on : UI_off);
3218               menuSubItem[total++] = TEST_FIELD(traverse->type, OneShot) ? "On" : "Off";
32253219            }
32263220
32273221            {
r1527r1528
32293223               menuItemInfo[total].subcheat = i;
32303224               menuItemInfo[total].fieldType = kType_RestorePreviousValue;
32313225               menuItem[total] = "Restore Previous Value";
3232               menuSubItem[total++] = ui_getstring(TEST_FIELD(traverse->type, RestorePreviousValue) ? UI_on : UI_off);
3226               menuSubItem[total++] = TEST_FIELD(traverse->type, RestorePreviousValue) ? "On" : "Off";
32333227            }
32343228         }
32353229
r1527r1528
33193313               menuItemInfo[total].subcheat = i;
33203314               menuItemInfo[total].fieldType = kType_WatchLabel;
33213315               menuItem[total] = "Watch Label";
3322               menuSubItem[total++] = ui_getstring(((typeParameter >> 2) & 0x01) ? UI_on : UI_off);
3316               menuSubItem[total++] = ((typeParameter >> 2) & 0x01) ? "On" : "Off";
33233317            }
33243318         }
33253319         else
r1527r1528
34913485                  menuItemInfo[total].subcheat = i;
34923486                  menuItemInfo[total].fieldType = kType_UserSelect;
34933487                  menuItem[total] = "User Select";
3494                  menuSubItem[total++] = ui_getstring(userSelect ? UI_on : UI_off);
3488                  menuSubItem[total++] = userSelect ? "On" : "Off";
34953489               }
34963490
34973491               if(!i && userSelect)
r1527r1528
35193513                  menuItemInfo[total].subcheat = i;
35203514                  menuItemInfo[total].fieldType = kType_UserSelectBCD;
35213515                  menuItem[total] = "BCD";
3522                  menuSubItem[total++] = ui_getstring(TEST_FIELD(traverse->type, UserSelectBCD) ? UI_on : UI_off);
3516                  menuSubItem[total++] = TEST_FIELD(traverse->type, UserSelectBCD) ? "On" : "Off";
35233517               }
35243518
35253519               if(userSelect || isSelect)
r1527r1528
35373531                  menuItemInfo[total].subcheat = i;
35383532                  menuItemInfo[total].fieldType = kType_CopyPrevious;
35393533                  menuItem[total] = "Copy Previous Value";
3540                  menuSubItem[total++] = ui_getstring(TEST_FIELD(traverse->type, LinkCopyPreviousValue) ? UI_on : UI_off);
3534                  menuSubItem[total++] = TEST_FIELD(traverse->type, LinkCopyPreviousValue) ? "On" : "Off";
35413535               }
35423536            }
35433537
r1527r1528
36803674
36813675   menuItemInfo[total].subcheat =   0;            // return
36823676   menuItemInfo[total].fieldType =   kType_Return;
3683   menuItem[total] =            ui_getstring(UI_returntoprior);
3677   menuItem[total] =            "Return to Prior Menu";
36843678   menuSubItem[total++] =         NULL;
36853679
36863680   menuItemInfo[total].subcheat =   0;            // terminate arrey
r1527r1528
47744768
47754769   /********** MENU CONSTRUCTION **********/
47764770   sprintf(cpuBuffer, "%d", search->targetIdx);      // CPU
4777   menuItem[total] = ui_getstring(UI_cpu);
4771   menuItem[total] = "CPU";
47784772   menuSubItem[total++] = cpuBuffer;
47794773
47804774   if(search->sign && (search->oldOptions.value & kSearchByteSignBitTable[search->bytes]))
r1527r1528
48524846      menuItem[total] = "Save Memory";
48534847   menuSubItem[total++] = NULL;
48544848
4855   menuItem[total] = ui_getstring(UI_viewresults);      // view result
4849   menuItem[total] = "View Last Results";      // view result
48564850   menuSubItem[total++] = NULL;
48574851
4858   menuItem[total] = ui_getstring(UI_restoreresults);   // restore result
4852   menuItem[total] = "Restore Previous Results";   // restore result
48594853   menuSubItem[total++] = NULL;
48604854
4861   menuItem[total] = ui_getstring(UI_returntoprior);   // return
4855   menuItem[total] = "Return to Prior Menu";   // return
48624856   menuSubItem[total++] = NULL;
48634857
48644858   menuItem[total] = NULL;                        // terminate array
r1527r1528
53975391   menuSubItem[total++] = NULL;
53985392
53995393   sprintf(cpuBuffer, "%d", search->targetIdx);
5400   menuItem[total] = ui_getstring(UI_cpu);
5394   menuItem[total] = "CPU";
54015395   menuSubItem[total++] = cpuBuffer;
54025396
54035397   if(search->sign && (search->oldOptions.value & kSearchByteSignBitTable[search->bytes]))
r1527r1528
54415435   menuItem[total] = "--------------------";
54425436   menuSubItem[total++] = NULL;
54435437
5444   menuItem[total] = ui_getstring(UI_viewresults);      // view result
5438   menuItem[total] = "View Last Results";      // view result
54455439   menuSubItem[total++] = NULL;
54465440
5447   menuItem[total] = ui_getstring(UI_restoreresults);   // restore result
5441   menuItem[total] = "Restore Previous Results";   // restore result
54485442   menuSubItem[total++] = NULL;
54495443
5450   menuItem[total] = ui_getstring(UI_returntoprior);   // return
5444   menuItem[total] = "Return to Prior Menu";   // return
54515445   menuSubItem[total++] = NULL;
54525446
54535447   menuItem[total] = NULL;                        // terminate array
r1527r1528
59525946   menu_subitem[total++] = kSearchByteNameTable[search->bytes];
59535947
59545948   menu_item[total] = "Swap";
5955   menu_subitem[total++] = ui_getstring(search->swap ? UI_on : UI_off);
5949   menu_subitem[total++] = search->swap ? "On" : "Off";
59565950
59575951   menu_item[total] = "Signed";
5958   menu_subitem[total++] = ui_getstring(search->sign ? UI_on : UI_off);
5952   menu_subitem[total++] = search->sign ? "On" : "Off";
59595953
59605954   sprintf(cpuBuffer, "%d", search->targetIdx);
59615955   menu_item[total] = "CPU";
r1527r1528
59795973   menu_item[total] = "---";
59805974   menu_subitem[total++] = NULL;
59815975
5982   menu_item[total] = ui_getstring(UI_viewresults);      // view result
5976   menu_item[total] = "View Last Results";      // view result
59835977   menu_subitem[total++] = NULL;
59845978
5985   menu_item[total] = ui_getstring(UI_restoreresults);      // restore result
5979   menu_item[total] = "Restore Previous Results";      // restore result
59865980   menu_subitem[total++] = NULL;
59875981
5988   menu_item[total] = ui_getstring(UI_returntoprior);      // return
5982   menu_item[total] = "Return to Prior Menu";      // return
59895983   menu_subitem[total++] = NULL;
59905984
59915985   menu_item[total] = NULL;                        // terminate array
r1527r1528
63216315      SearchRegion   * traverse = &search->regionList[i];
63226316
63236317      menuItem[total] = traverse->name;
6324      menuSubItem[total++] = ui_getstring((traverse->flags & kRegionFlag_Enabled) ? UI_on : UI_off);
6318      menuSubItem[total++] = (traverse->flags & kRegionFlag_Enabled) ? "On" : "Off";
63256319   }
63266320
63276321   menuItem[total] = "Search Speed";
63286322   menuSubItem[total++] = kSearchSpeedList[search->searchSpeed];
63296323
6330   menuItem[total] = ui_getstring(UI_returntoprior);      // return item
6324   menuItem[total] = "Return to Prior Menu";      // return item
63316325   menuSubItem[total++] = NULL;
63326326
63336327   menuItem[total] = NULL;         // terminate array
r1527r1528
66046598         menu_item[total++] = "no results found";
66056599   }
66066600
6607   menu_item[total++] = ui_getstring(UI_returntoprior);      // return
6601   menu_item[total++] = "Return to Prior Menu";      // return
66086602
66096603   menu_item[total] = NULL;                           // terminate array
66106604
r1527r1528
68696863      total++;
68706864   }
68716865
6872   menuItem[total++] = ui_getstring(UI_returntoprior);      // return
6866   menuItem[total++] = "Return to Prior Menu";      // return
68736867
68746868   menuItem[total] = NULL;                           // terminate array
68756869
r1527r1528
71747168   menuSubItem[total] = buf[total];
71757169   total++;
71767170
7177   menuItem[total] = ui_getstring(UI_returntoprior);      // return
7171   menuItem[total] = "Return to Prior Menu";      // return
71787172   menuSubItem[total++] = NULL;
71797173
71807174   menuItem[total] = NULL;                           // terminate array
r1527r1528
76127606   }
76137607
76147608   menuItem[total] =      "Show Search Labels";
7615   menuSubItem[total++] =   ui_getstring(TEST_FIELD(cheatOptions, DontPrintNewLabels) ? UI_off : UI_on);
7609   menuSubItem[total++] =   TEST_FIELD(cheatOptions, DontPrintNewLabels) ? "Off" : "On";
76167610
76177611   menuItem[total] =      "Auto Save Cheats";
7618   menuSubItem[total++] =   ui_getstring(TEST_FIELD(cheatOptions, AutoSaveEnabled) ? UI_on : UI_off);
7612   menuSubItem[total++] =   TEST_FIELD(cheatOptions, AutoSaveEnabled) ? "On" : "Off";
76197613
76207614   menuItem[total] =      "Show Activation Key Message";
7621   menuSubItem[total++] =   ui_getstring(TEST_FIELD(cheatOptions, ActivationKeyMessage) ? UI_on : UI_off);
7615   menuSubItem[total++] =   TEST_FIELD(cheatOptions, ActivationKeyMessage) ? "On" : "Off";
76227616
76237617   menuItem[total] =      "Load Old Format Code";
7624   menuSubItem[total++] =   ui_getstring(TEST_FIELD(cheatOptions, LoadOldFormat) ? UI_on : UI_off);
7618   menuSubItem[total++] =   TEST_FIELD(cheatOptions, LoadOldFormat) ? "On" : "Off";
76257619
76267620   menuItem[total] =      "Debug";
7627   menuSubItem[total++] =   ui_getstring(TEST_FIELD(cheatOptions, Debug) ? UI_on : UI_off);
7621   menuSubItem[total++] =   TEST_FIELD(cheatOptions, Debug) ? "On" : "Off";
76287622
7629   menuItem[total] =      ui_getstring(UI_returntoprior);      // return
7623   menuItem[total] =      "Return to Prior Menu";      // return
76307624   menuSubItem[total++] =   NULL;
76317625
76327626   menuItem[total] =      NULL;                        // terminate array
r1527r1528
78007794      total++;
78017795   }
78027796
7803   menuItem[total++] = ui_getstring(UI_returntoprior);      // return
7797   menuItem[total++] = "Return to Prior Menu";      // return
78047798
78057799   menuItem[total] = NULL;                           // terminate array
78067800
r1527r1528
78957889         /* ------ toggle watchpoint display if shift + toggle cheat ----- */
78967890         watchesDisabled ^= 1;
78977891
7898         ui_popup_time(1, "%s %s", ui_getstring(UI_watchpoints), watchesDisabled ? ui_getstring (UI_off) : ui_getstring (UI_on));
7892         ui_popup_time(1, "Watchpoints %s", watchesDisabled ? "Off" : "On");
78997893      }
79007894      else
79017895      {
79027896         /* ------ toggle cheat ----- */
79037897         cheatsDisabled ^= 1;
79047898
7905         ui_popup_time(1, "%s %s", ui_getstring(UI_cheats), cheatsDisabled ? ui_getstring (UI_off) : ui_getstring (UI_on));
7899         ui_popup_time(1, "Cheats %s", cheatsDisabled ? "Off" : "On");
79067900
79077901         if(cheatsDisabled)
79087902         {
src/emu/validity.c
r1527r1528
1515#include "hash.h"
1616#include <ctype.h>
1717#include <stdarg.h>
18#include "uitext.h"
1918#include "unicode.h"
2019#include <zlib.h>
2120
src/emu/drivers/xtal.h
r1527r1528
5252   XTAL_4_433619MHz   = 4433619,      /* PAL subcarrier */
5353   XTAL_4_9152MHz      = 4915200,
5454   XTAL_6MHz          = 6000000,
55   XTAL_6_144MHz      = 6144000,      /* Used on Alpha Denshi early 80's games sound board */
5556   XTAL_7_3728MHz      = 7372800,
5657   XTAL_8MHz          = 8000000,
58   XTAL_9_987MHz      = 9987000,      /* Crazy Balloon */
5759   XTAL_10MHz         = 10000000,
5860   XTAL_10_595MHz     = 10595000,      /* Mad Alien */
5961   XTAL_11MHz         = 11000000,      /* Mario I8039 sound */
62   XTAL_11_0592MHz     = 11059200,      /* Lethal Justice */
6063   XTAL_11_289MHz     = 11289000,      /* Vanguard */
6164   XTAL_12MHz         = 12000000,
6265   XTAL_12_096MHz       = 12096000,      /* Some early 80's Atari games */
r1527r1528
104107   XTAL_45MHz         = 45000000,      /* Eolith with Hyperstone CPUs */
105108   XTAL_45_158MHz     = 45158000,      /* Sega Model 2A video board, Model 3 CPU board */
106109   XTAL_48MHz         = 48000000,
110   XTAL_48_66MHz        = 48660000,      /* Zaxxon */
107111   XTAL_49_152MHz     = 49152000,      /* Used on some Namco PCBs, Baraduke h/w, System 21, Super System 22  */
108112   XTAL_50MHz         = 50000000,
109113   XTAL_52MHz         = 52000000,      /* Cojag */
r1527r1528
121125/* Resonators (There are probably more. Almost always used for driving OKI sound chips) */
122126
123127   XTAL_384kHz         = 384000,
128   XTAL_400kHz         = 400000,   /* Used on Great Swordman h/w */
129   XTAL_455kHz         = 455000,   /* Used on Gladiator h/w */
124130   XTAL_640kHz         = 640000
125131};
126132
src/mess/muitext.c
r1527r1528
1#include "uitext.h"
2
3const char *mess_default_text[] =
4{
5   "The emulated system is a computer: ",
6   "The keyboard emulation may not be 100% accurate.",
7   "Keyboard Emulation Status",
8   "-------------------------",
9   "Mode: PARTIAL Emulation",
10   "Mode: FULL Emulation",
11   "UI:   Enabled",
12   "UI:   Disabled",
13   "**Use ScrLock to toggle**",
14
15   "Image Information",
16   "File Manager",
17   "Tape Control",
18
19   "No Tape Image loaded",
20   "recording",
21   "playing",
22   "(recording)",
23   "(playing)",
24   "stopped",
25   "Pause/Stop",
26   "Record",
27   "Play",
28   "Rewind",
29   "Fast Forward",
30   "Mount...",
31   "Create...",
32   "Unmount",
33   "[empty slot]",
34   "Input Devices",
35   "Quit Fileselector",
36   "File Specification",   /* IMPORTANT: be careful to ensure that the following */
37   "Cartridge",      /* device list matches the order found in device.h    */
38   "Floppy Disk",      /* and is ALWAYS placed after "File Specification"    */
39   "Hard Disk",
40   "Cylinder",
41   "Cassette",
42   "Punched Card",
43   "Punched Tape",
44   "Printer",
45   "Serial Port",
46   "Parallel Port",
47   "Snapshot",
48   "Quickload",
49   "Memory Card",
50   "CD-ROM"
51};
src/mess/muitext.h
r1527r1528
1#ifndef MUI_TEXT_H
2#define MUI_TEXT_H
3
4enum
5{
6   UI_comp1 = UI_last_mame_entry,
7   UI_comp2,
8   UI_keyb1,
9   UI_keyb2,
10   UI_keyb3,
11   UI_keyb4,
12   UI_keyb5,
13   UI_keyb6,
14   UI_keyb7,
15
16   UI_imageinfo,
17   UI_filemanager,
18   UI_tapecontrol,
19
20   UI_notapeimageloaded,
21   UI_recording,
22   UI_playing,
23   UI_recording_inhibited,
24   UI_playing_inhibited,
25   UI_stopped,
26   UI_pauseorstop,
27   UI_record,
28   UI_play,
29   UI_rewind,
30   UI_fastforward,
31   UI_mount,
32   UI_create,
33   UI_unmount,
34   UI_emptyslot,
35   UI_categories,
36   UI_quitfileselector,
37   UI_filespecification,   /* IMPORTANT: be careful to ensure that the following */
38   UI_cartridge,         /* device list matches the order found in device.h    */
39   UI_floppydisk,         /* and is ALWAYS placed after UI_filespecification    */
40   UI_harddisk,
41   UI_cylinder,
42   UI_cassette,
43   UI_punchcard,
44   UI_punchtape,
45   UI_printer,
46   UI_serial,
47   UI_parallel,
48   UI_snapshot,
49   UI_quickload,
50   UI_memcard,
51   UI_cdrom
52};
53
54#endif /* MUI_TEXT_H */
src/mess/mslegacy.c
r0r1528
1/*********************************************************************
2
3   mslegacy.c
4
5   Defines since removed from MAME, but kept in MESS for legacy
6   reasons
7
8*********************************************************************/
9
10#include "mslegacy.h"
11
12UINT8 *dirtybuffer;
13
14
15
16static const char *mess_default_text[] =
17{
18   "OK",
19   "Off",
20   "On",
21   "Dip Switches",
22   "Driver Configuration",
23   "Analog Controls",
24   "Digital Speed",
25   "Autocenter Speed",
26   "Reverse",
27   "Sensitivity",
28   "\xc2\xab",
29   "\xc2\xbb",
30   "Return to Main Menu",
31
32   "Keyboard Emulation Status",
33   "-------------------------",
34   "Mode: PARTIAL Emulation",
35   "Mode: FULL Emulation",
36   "UI:   Enabled",
37   "UI:   Disabled",
38   "**Use ScrLock to toggle**",
39
40   "Image Information",
41   "File Manager",
42   "Tape Control",
43
44   "No Tape Image loaded",
45   "recording",
46   "playing",
47   "(recording)",
48   "(playing)",
49   "stopped",
50   "Pause/Stop",
51   "Record",
52   "Play",
53   "Rewind",
54   "Fast Forward",
55   "Mount...",
56   "Create...",
57   "Unmount",
58   "[empty slot]",
59   "Input Devices",
60   "Quit Fileselector",
61   "File Specification",   /* IMPORTANT: be careful to ensure that the following */
62   "Cartridge",      /* device list matches the order found in device.h    */
63   "Floppy Disk",      /* and is ALWAYS placed after "File Specification"    */
64   "Hard Disk",
65   "Cylinder",
66   "Cassette",
67   "Punched Card",
68   "Punched Tape",
69   "Printer",
70   "Serial Port",
71   "Parallel Port",
72   "Snapshot",
73   "Quickload",
74   "Memory Card",
75   "CD-ROM"
76};
77
78
79
80/***************************************************************************
81    PALETTE
82***************************************************************************/
83 
84void palette_set_colors_rgb(running_machine *machine, pen_t color_base, const UINT8 *colors, int color_count)
85{
86   while (color_count--)
87   {
88      UINT8 r = *colors++;
89      UINT8 g = *colors++;
90      UINT8 b = *colors++;
91      palette_set_color_rgb(machine, color_base++, r, g, b);
92   }
93}
94
95
96
97/***************************************************************************
98    GENERIC READ/WRITE HANDLERS
99***************************************************************************/
100 
101/*-------------------------------------------------
102    videoram_r/w - 8-bit access to videoram with
103    dirty buffer marking
104-------------------------------------------------*/
105 
106READ8_HANDLER( videoram_r )
107{
108   return videoram[offset];
109}
110 
111WRITE8_HANDLER( videoram_w )
112{
113   dirtybuffer[offset] = 1;
114   videoram[offset] = data;
115}
116 
117/*-------------------------------------------------
118    colorram_w - 8-bit access to colorram with
119    dirty buffer marking
120-------------------------------------------------*/
121 
122WRITE8_HANDLER( colorram_w )
123{
124   dirtybuffer[offset] = 1;
125   colorram[offset] = data;
126}
127 
128 
129 
130/***************************************************************************
131    UI TEXT
132***************************************************************************/
133 
134const char * ui_getstring (int string_num)
135{
136   return mess_default_text[string_num];
137}
138 
src/mess/uimess.c
r1527r1528
77*********************************************************************/
88
99#include "mame.h"
10#include "uitext.h"
10#include "mslegacy.h"
1111#include "uimenu.h"
1212#include "uimess.h"
1313#include "input.h"
src/mess/messcore.mak
r1527r1528
8888   $(MESSOBJ)/utils.o      \
8989   $(MESSOBJ)/eventlst.o   \
9090   $(MESSOBJ)/mscommon.o   \
91   $(MESSOBJ)/mslegacy.o   \
9192   $(MESSOBJ)/tagpool.o   \
9293   $(MESSOBJ)/cheatms.o   \
9394   $(MESSOBJ)/opresolv.o   \
94   $(MESSOBJ)/muitext.o   \
9595   $(MESSOBJ)/infomess.o   \
9696   $(MESSOBJ)/climess.o   \
9797
src/mess/mess.c
r1527r1528
1313#include "driver.h"
1414#include "devices/flopdrv.h"
1515#include "utils.h"
16#include "uitext.h"
16#include "mslegacy.h"
1717#include "image.h"
1818#include "hash.h"
1919#include "messopts.h"
src/mess/mslegacy.h
r1527r1528
1010#ifndef MSLEGACY_H
1111#define MSLEGACY_H
1212
13INLINE void palette_set_colors_rgb(running_machine *machine, pen_t color_base, const UINT8 *colors, int color_count)
13#include "driver.h"
14
15extern UINT8 *dirtybuffer;
16
17enum
1418{
15   while (color_count--)
16   {
17      UINT8 r = *colors++;
18      UINT8 g = *colors++;
19      UINT8 b = *colors++;
20      palette_set_color_rgb(machine, color_base++, r, g, b);
21   }
22}
19   UI_OK,
20   UI_off,
21   UI_on,
22   UI_dipswitches,
23   UI_configuration,
24   UI_analogcontrols,
25   UI_keyjoyspeed,
26   UI_centerspeed,
27   UI_reverse,
28   UI_sensitivity,
29   UI_lefthilight,
30   UI_righthilight,
31   UI_returntomain,
2332
33   UI_last_mame_entry,
34   UI_keyb1 = UI_last_mame_entry,
35   UI_keyb2,
36   UI_keyb3,
37   UI_keyb4,
38   UI_keyb5,
39   UI_keyb6,
40   UI_keyb7,
2441
42   UI_imageinfo,
43   UI_filemanager,
44   UI_tapecontrol,
45
46   UI_notapeimageloaded,
47   UI_recording,
48   UI_playing,
49   UI_recording_inhibited,
50   UI_playing_inhibited,
51   UI_stopped,
52   UI_pauseorstop,
53   UI_record,
54   UI_play,
55   UI_rewind,
56   UI_fastforward,
57   UI_mount,
58   UI_create,
59   UI_unmount,
60   UI_emptyslot,
61   UI_categories,
62   UI_quitfileselector,
63   UI_filespecification,   /* IMPORTANT: be careful to ensure that the following */
64   UI_cartridge,         /* device list matches the order found in device.h    */
65   UI_floppydisk,         /* and is ALWAYS placed after UI_filespecification    */
66   UI_harddisk,
67   UI_cylinder,
68   UI_cassette,
69   UI_punchcard,
70   UI_punchtape,
71   UI_printer,
72   UI_serial,
73   UI_parallel,
74   UI_snapshot,
75   UI_quickload,
76   UI_memcard,
77   UI_cdrom
78};
79
80
81
82/* palette */
83void palette_set_colors_rgb(running_machine *machine, pen_t color_base, const UINT8 *colors, int color_count);
84
85/* read/write handlers */
86READ8_HANDLER( videoram_r );
87WRITE8_HANDLER( videoram_w );
88WRITE8_HANDLER( colorram_w );
89
90/* uitext */
91const char * ui_getstring (int string_num);
92
93
94
2595#endif /* MSLEGACY_H */
src/mess/tapectrl.c
r1527r1528
1010#include "image.h"
1111#include "ui.h"
1212#include "uimenu.h"
13#include "uitext.h"
13#include "mslegacy.h"
1414#include "devices/cassette.h"
1515
1616void tapecontrol_gettime(char *timepos, size_t timepos_size, mess_image *img, int *curpos, int *endpos)
src/mess/device.c
r1527r1528
99#include <stddef.h>
1010
1111#include "device.h"
12#include "uitext.h"
12#include "mslegacy.h"
1313#include "driver.h"
1414#include "pool.h"
1515
r1527r1528
138138 *
139139 *************************************/
140140
141static const char *get_device_name(iodevice_t devtype)
141const char *device_uiname(iodevice_t devtype)
142142{
143   const char *name;
144
145   if (Machine != NULL)
146   {
147      name = ui_getstring((UI_cartridge - IO_CARTSLOT) + devtype);
148   }
149   else
150   {
151      /* man I really hate this; may god have mercy on my soul */
152      extern const char *mess_default_text[];
153      name = mess_default_text[(UI_cartridge - IO_CARTSLOT) + devtype - UI_last_mame_entry];
154   }
155   return name;
143   return ui_getstring((UI_cartridge - IO_CARTSLOT) + devtype);
156144}
157145
158146
r1527r1528
170158      return buf;
171159   }
172160
173   name = get_device_name(dev->type);
161   name = device_uiname(dev->type);
174162   if (dev->count > 1)
175163   {
176164      /* for the average user counting starts at #1 ;-) */
src/mess/filemngr.c
r1527r1528
1111#include "image.h"
1212#include "ui.h"
1313#include "uimenu.h"
14#include "uitext.h"
14#include "mslegacy.h"
1515
1616#define SEL_BITS   12
1717#define SEL_MASK   ((1<<SEL_BITS)-1)
src/mess/device.h
r1527r1528
273273
274274
275275/* device naming */
276const char *device_uiname(iodevice_t devtype);
276277const char *device_typename(iodevice_t type);
277278const char *device_brieftypename(iodevice_t type);
278279int device_typeid(const char *name);
src/mess/mesvalid.c
r1527r1528
1010
1111#include "mess.h"
1212#include "device.h"
13#include "uitext.h"
13#include "mslegacy.h"
1414#include "inputx.h"
1515
1616
r1527r1528
288288   const char *name;
289289   input_port_entry *inputports = NULL;
290290   extern int device_valididtychecks(void);
291   extern const char *mess_default_text[];
292291
293292   /* make sure that all of the UI_* strings are set for all devices */
294293   for (devtype = 0; devtype < IO_COUNT; devtype++)
295294   {
296      name = mess_default_text[UI_cartridge - IO_CARTSLOT - UI_last_mame_entry + devtype];
295      name = device_uiname(devtype);
297296      if (!name || !name[0])
298297      {
299298         mame_printf_error("Device type %d does not have an associated UI string\n", devtype);
src/mess/osd/windows/dialog.c
r1527r1528
1111
1212#include "dialog.h"
1313#include "mame.h"
14#include "uitext.h"
14#include "mslegacy.h"
1515#include "inputx.h"
1616#include "utils.h"
1717#include "strconv.h"
src/mess/osd/windows/menu.c
r1527r1528
2121#include "windows/input.h"
2222#include "dialog.h"
2323#include "opcntrl.h"
24#include "uitext.h"
24#include "mslegacy.h"
2525#include "strconv.h"
2626#include "utils.h"
2727#include "tapedlg.h"
r1527r1528
3131#include "devices/cassette.h"
3232#include "windows/window.h"
3333#include "uimess.h"
34#include "mslegacy.h"
3435#include "winutf8.h"
3536
3637#ifdef UNDER_CE
src/mess/osd/winui/messui.c
r1527r1528
3030#include "devview.h"
3131#include "windows/window.h"
3232#include "utils.h"
33#include "uitext.h"
33#include "mslegacy.h"
3434#include "strconv.h"
3535#include "messui.h"
3636#include "winutf8.h"
src/mess/osd/winui/devview.c
r1527r1528
1616#include "driver.h"
1717#include "devview.h"
1818#include "optionsms.h"
19#include "uitext.h"
19#include "mslegacy.h"
2020#include "strconv.h"
2121#include "winutf8.h"
2222#include "mui_util.h"
src/mess/osd/winui/messui.h
r1527r1528
44#include "driver.h"
55#include "resourcems.h"
66#include "devview.h"
7#include "uitext.h"
87#include "options.h"
98
109extern char g_szSelectedItem[MAX_PATH];
src/mess/machine/mz700.c
r1527r1528
1111
1212/* Core includes */
1313#include "driver.h"
14#include "mslegacy.h"
1415#include "includes/mz700.h"
1516
1617/* Components */
src/mess/machine/pet.c
r1527r1528
33
44    peter.trauner@jk.uni-linz.ac.at
55***************************************************************************/
6
67#include "driver.h"
8#include "mslegacy.h"
79#include "cpu/m6502/m6502.h"
810#include "cpu/m6809/m6809.h"
911
src/mess/machine/nascom1.c
r1527r1528
99
1010#include <stdio.h>
1111#include "driver.h"
12#include "mslegacy.h"
1213#include "image.h"
1314#include "includes/nascom1.h"
1415#include "cpu/z80/z80.h"
src/mess/machine/ti99_4x.c
r1527r1528
824824         memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9000, 0x93ff, 0, 0, ti99_rspeech_r);
825825         memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x97ff, 0, 0, ti99_wspeech_w);
826826
827         sndti_set_info_int(SOUND_TMS5220, 0, SNDINFO_INT_TMS5220_VARIANT, variant_tms0285);
827         sndti_set_info_int(SOUND_TMS5220, 0, SNDINFO_INT_TMS5220_VARIANT, variant_tmc0285);
828828      }
829829   }
830830   else
src/mess/mess.mak
r1527r1528
7373CPUS += I8039
7474CPUS += I8048
7575#CPUS += N7751
76#CPUS += MB8884
77#CPUS += M58715
7678#CPUS += I8X41
7779#CPUS += I8051
7880#CPUS += I8052
r1527r1528
131133CPUS += ARM7
132134CPUS += JAGUAR
133135CPUS += R3000
136#CPUS += R3041
134137CPUS += R4600
135138#CPUS += R4650
136139#CPUS += R4700
r1527r1528
254257#SOUNDS += TMS36XX
255258#SOUNDS += TMS3615
256259#SOUNDS += TMS5110
260#SOUNDS += TMC0285
261#SOUNDS += TMS5200
257262SOUNDS += TMS5220
258263#SOUNDS += VLM5030
259264#SOUNDS += ADPCM
src/mess/drivers/aquarius.c
r1527r1528
2727#include "driver.h"
2828#include "cpu/z80/z80.h"
2929#include "includes/aquarius.h"
30#include "mslegacy.h"
3031
3132/* structures */
3233
src/mess/drivers/nascom1.c
r1527r1528
4949************************************************************************/
5050
5151#include "driver.h"
52#include "mslegacy.h"
5253#include "includes/nascom1.h"
5354#include "cpu/z80/z80.h"
5455#include "devices/cartslot.h"
docs/messnew.txt
r1527r1528
3838
3939Source Changes:
4040----------------
41- The core is based on MAME 0.122u5.  This incorporates all features of the
41- The core is based on MAME 0.122u6.  This incorporates all features of the
4242  update to this core.  [MAME team]
4343
4444- Conditional logging and core callback cleanups.  [Atari Ace]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team