Previous 15994 Revisions Next

r1387 Thursday 6th December, 2007 at 21:01:50 UTC by Nathan Woods
Updated to MAME 0.121u3 core
[ROOT]makefile
[docs]messnew.txt
[src/emu]audit.c clifront.c cpuexec.h cpuintrf.c emu.mak info.c
[src/emu/audio]generic.c
[src/emu/cpu]cpu.mak x86drc.c
[src/emu/cpu/adsp2100]2100dasm.c 2100ops.c
[src/emu/cpu/alph8201]8201dasm.c
[src/emu/cpu/arm]armdasm.c
[src/emu/cpu/arm7]arm7dasm.c
[src/emu/cpu/asap]asapdasm.c
[src/emu/cpu/cop400]cop410.c cop420.c
[src/emu/cpu/dsp32]dsp32.c dsp32dis.c dsp32ops.c
[src/emu/cpu/e132xs]32xsdasm.c e132xsop.c
[src/emu/cpu/f8]f8dasm.c
[src/emu/cpu/g65816]g65816.c g65816cm.h g65816ds.c g65816op.h
[src/emu/cpu/h6280]6280dasm.c h6280.c
[src/emu/cpu/h83002]h8disasm.c
[src/emu/cpu/hd6309]6309dasm.c 6309tbl.c hd6309.c
[src/emu/cpu/i386]cycles.h i386dasm.c
[src/emu/cpu/i8039]8039dasm.c i8039.c
[src/emu/cpu/i8051]i8051.c
[src/emu/cpu/i8085]i8085daa.h
[src/emu/cpu/i86]table186.h table286.h table86.h tablev30.h
[src/emu/cpu/i8x41]i8x41.c
[src/emu/cpu/i960]i960.c i960dis.c
[src/emu/cpu/jaguar]jagdasm.c jaguar.c
[src/emu/cpu/konami]knmidasm.c konami.c
[src/emu/cpu/lh5801]5801dasm.c
[src/emu/cpu/m37710]m37710.c m37710cm.h m37710op.h m7700ds.c
[src/emu/cpu/m6502]6502dasm.c m4510.c m6502.c m6509.c t6502.c t6509.c t65c02.c t65ce02.c t65sc02.c tdeco16.c tn2a03.c
[src/emu/cpu/m6800]6800dasm.c 6800tbl.c
[src/emu/cpu/m6805]6805dasm.c m6805.c
[src/emu/cpu/m6809]6809dasm.c m6809.c
[src/emu/cpu/mc68hc11]hc11dasm.c hc11ops.h
[src/emu/cpu/minx]minxd.c minxopce.h minxopcf.h minxops.h
[src/emu/cpu/mips]dismips.c mdrc64.c mips3.c mips3dsm.c mipsdasm.c psx.c r3kdasm.c
[src/emu/cpu/nec]nec.c necdasm.c
[src/emu/cpu/pic16c5x]16c5xdsm.c
[src/emu/cpu/powerpc]drc_ops.c drc_ops.h ppc.c ppc.h ppc403.c ppc602.c ppc603.c ppc_dasm.c ppcdrc.c
[src/emu/cpu/rsp]rsp_dasm.c
[src/emu/cpu/s2650]2650dasm.c s2650.c
[src/emu/cpu/saturn]saturnds.c
[src/emu/cpu/sh2]sh2dasm.c
[src/emu/cpu/sh4]sh4dasm.c
[src/emu/cpu/sm8500]sm8500.c sm8500d.c
[src/emu/cpu/spc700]spc700ds.c
[src/emu/cpu/ssp1610]ssp1610d.c
[src/emu/cpu/t11]t11dasm.c t11table.c
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms32010]32010dsm.c tms32010.c
[src/emu/cpu/tms32025]32025dsm.c tms32025.c
[src/emu/cpu/tms32031]32031ops.c dis32031.c
[src/emu/cpu/tms32051]32051ops.h dis32051.c
[src/emu/cpu/tms34010]34010fld.c 34010gfx.c 34010tbl.c dis34010.c tms34010.c
[src/emu/cpu/tms7000]7000dasm.c
[src/emu/cpu/tms9900]99xxcore.h
[src/emu/cpu/upd7810]7810dasm.c 7810tbl.c
[src/emu/cpu/v30mz]v30mz.c
[src/emu/cpu/v60]v60.c v60.h
[src/emu/cpu/v810]v810.c v810dasm.c
[src/emu/cpu/z180]z180.c z180daa.h z180dasm.c z180tbl.h
[src/emu/cpu/z80]z80dasm.c
[src/emu/cpu/z8000]8000dasm.c makedab.c z8000dab.h z8000tbl.c
[src/emu/cpu/z80gb]z80gb.c z80gbd.c
[src/emu/machine]8257dma.c* 8257dma.h* at28c16.c at28c16.h eeprom.c eeprom.h
[src/emu/sound]k054539.c samples.c samples.h scsp.c sn76477.c votrax.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]8080bw.c astinvad.c astrof.c blockade.c carnival.c cclimber.c cinemat.c circus.c depthch.c dkong.c galaxian.c gorf.c gottlieb.c invinco.c meadows.c mw8080bw.c n8080.c polyplay.c pulsar.c rockola.c segag80r.c spacefb.c targ.c triplhnt.c turbo.c vicdual.c wow.c zaxxon.c
[src/mame/drivers]20pacgal.c ashnojoe.c asterix.c asteroid.c astrocde.c bfcobra.c bmcbowl.c cave.c cbasebal.c clayshoo.c cosmic.c couple.c cps1.c cps2.c crbaloon.c darkhors.c deco32.c dkong.c dribling.c drw80pkr.c* eolith.c eolith16.c epos.c exidy.c filetto.c findout.c freekick.c galaga.c gaplus.c getrivia.c gijoe.c gottlieb.c gotya.c gridlee.c groundfx.c gticlub.c gunbustr.c homerun.c imolagp.c iqblock.c jack.c kickgoal.c konamigq.c laserbat.c lethal.c lordgun.c m72.c malzak.c mario.c mcr.c meadows.c megatech.c merit.c mitchell.c model3.c moo.c mpu4drvr.c mystwarr.c namcond1.c namcos11.c namcos12.c ninjakd2.c omegrace.c othunder.c overdriv.c pipeline.c pirates.c playmark.c plygonet.c pntnpuzl.c policetr.c polyplay.c powerbal.c psikyo.c psikyo4.c psikyosh.c rallyx.c rockola.c route16.c rungun.c segag80r.c segag80v.c segahang.c segaorun.c segas16a.c seibuspi.c senjyo.c simpl156.c smstrv.c starcrus.c statriv2.c stlforce.c stv.c stvinit.c suna8.c superchs.c superqix.c system1.c taito_b.c taito_z.c tankbatt.c taxidrvr.c tcl.c thief.c tmnt.c tnzs.c toaplan2.c toratora.c turbo.c tx1.c undrfire.c unico.c vamphalf.c vegaeo.c vendetta.c vroulet.c wilytowr.c xexex.c xmen.c zaccaria.c zn.c
[src/mame/includes]8080bw.h astinvad.h astrocde.h blockade.h cclimber.h circus.h dkong.h galaxian.h triplhnt.h
[src/mame/machine]asteroid.c chaknpop.c drakton.c exctsccr.c flstory.c gaelco2.c kanekotb.h leland.c scramble.c simpsons.c slapstic.c steppers.c steppers.h strtheat.c
[src/mame/video]atari.c avgdvg.c cps1.c dkong.c midzeus.c
[src/mess]artworkx.c artworkx.h
[src/mess/osd/windows]menu.c
[src/osd/windows]drawd3d.c winprefix.h
[src/tools]src2html.c

src/mame/audio/spacefb.c
r1386r1387
6666}
6767
6868
69static const char *spacefb_sample_names[] =
69static const char *const spacefb_sample_names[] =
7070{
7171   "*spacefb",
7272   "ekilled.wav",
r1386r1387
7777};
7878
7979
80static struct Samplesinterface spacefb_samples_interface =
80static const struct Samplesinterface spacefb_samples_interface =
8181{
8282   3,
8383   spacefb_sample_names
src/mame/audio/invinco.c
r1386r1387
2020
2121
2222/* sample file names */
23static const char *invinco_sample_names[] =
23static const char *const invinco_sample_names[] =
2424{
2525   "*invinco",
2626   "saucer.wav",
r1386r1387
3535};
3636
3737
38static struct Samplesinterface invinco_samples_interface =
38static const struct Samplesinterface invinco_samples_interface =
3939{
4040   8,
4141   invinco_sample_names
src/mame/audio/pulsar.c
r1386r1387
3333
3434
3535/* sample file names */
36static const char *pulsar_sample_names[] =
36static const char *const pulsar_sample_names[] =
3737{
3838   "*pulsar",
3939   "clang.wav",
r1386r1387
5252};
5353
5454
55static struct Samplesinterface pulsar_samples_interface =
55static const struct Samplesinterface pulsar_samples_interface =
5656{
5757   12,
5858   pulsar_sample_names
src/mame/audio/wow.c
r1386r1387
2929 * 64 Phonemes - currently 1 sample per phoneme, will be combined sometime!
3030 ****************************************************************************/
3131
32static const char *PhonemeTable[65] =
32static const char *const PhonemeTable[65] =
3333{
3434 "EH3","EH2","EH1","PA0","DT" ,"A1" ,"A2" ,"ZH",
3535 "AH2","I3" ,"I2" ,"I1" ,"M"  ,"N"  ,"B"  ,"V",
r1386r1387
4848   doom.wav pop.wav
4949   Problems with YOU and YOU'LL and YOU'DD */
5050
51static const char *wowWordTable[] =
51static const char *const wowWordTable[] =
5252{
5353"AH1I3Y1", "UH1GA1EH1N", "AHAH2", "AE1EH3M", "AE1EH3ND",
5454"anew.wav", "AH1NUHTHER", "AE1NY", "anyone.wav", "appear.wav", "AH1UH3R", "UHR", "BABYY1S", "BAE1EH3K",
r1386r1387
7575#define num_samples (sizeof(wowWordTable)/sizeof(char *))
7676
7777
78const char *wow_sample_names[] =
78const char *const wow_sample_names[] =
7979{
8080   "*wow",
8181   "a.wav", "again.wav", "ahh.wav", "am.wav", "and.wav",
src/mame/audio/n8080.c
r1386r1387
3030
3131
3232
33static struct SN76477interface sheriff_sn76477_interface =
33static const struct SN76477interface sheriff_sn76477_interface =
3434{
3535   RES_K(36)  ,  /* 04 */
3636   RES_K(100) ,  /* 05 */
r1386r1387
5858};
5959
6060
61static struct SN76477interface spacefev_sn76477_interface =
61static const struct SN76477interface spacefev_sn76477_interface =
6262{
6363   RES_K(36)  ,  /* 04 */
6464   RES_K(150) ,  /* 05 */
src/mame/audio/cinemat.c
r1386r1387
136136 *
137137 *************************************/
138138
139static const char *spacewar_sample_names[] =
139static const char *const spacewar_sample_names[] =
140140{
141141   "*spacewar",
142142   "explode1.wav",
r1386r1387
150150    0
151151};
152152
153static struct Samplesinterface spacewar_samples_interface =
153static const struct Samplesinterface spacewar_samples_interface =
154154{
155155   8,
156156   spacewar_sample_names
r1386r1387
218218 *
219219 *************************************/
220220
221static const char *barrier_sample_names[] =
221static const char *const barrier_sample_names[] =
222222{
223223   "*barrier",
224224   "playrdie.wav",
r1386r1387
227227    0
228228};
229229
230static struct Samplesinterface barrier_samples_interface =
230static const struct Samplesinterface barrier_samples_interface =
231231{
232232   3,
233233   barrier_sample_names
r1386r1387
271271 *
272272 *************************************/
273273
274static const char *speedfrk_sample_names[] =
274static const char *const speedfrk_sample_names[] =
275275{
276276   "*speedfrk",
277277   "offroad.wav",
278278    NULL
279279};
280280
281static struct Samplesinterface speedfrk_samples_interface =
281static const struct Samplesinterface speedfrk_samples_interface =
282282{
283283   1,
284284   speedfrk_sample_names
r1386r1387
329329 *
330330 *************************************/
331331
332static const char *starhawk_sample_names[] =
332static const char *const starhawk_sample_names[] =
333333{
334334   "*starhawk",
335335   "explode.wav",
r1386r1387
341341    NULL
342342};
343343
344static struct Samplesinterface starhawk_samples_interface =
344static const struct Samplesinterface starhawk_samples_interface =
345345{
346346   5,
347347   starhawk_sample_names
r1386r1387
403403 *
404404 *************************************/
405405
406static const char *sundance_sample_names[] =
406static const char *const sundance_sample_names[] =
407407{
408408   "*sundance",
409409   "bong.wav",
r1386r1387
415415    0
416416};
417417
418static struct Samplesinterface sundance_samples_interface =
418static const struct Samplesinterface sundance_samples_interface =
419419{
420420   6,
421421   sundance_sample_names
r1386r1387
471471 *
472472 *************************************/
473473
474static const char *tailg_sample_names[] =
474static const char *const tailg_sample_names[] =
475475{
476476   "*tailg",
477477   "sexplode.wav",
r1386r1387
483483    NULL
484484};
485485
486static struct Samplesinterface tailg_samples_interface =
486static const struct Samplesinterface tailg_samples_interface =
487487{
488488   6,
489489   tailg_sample_names
r1386r1387
558558 *
559559 *************************************/
560560
561static const char *warrior_sample_names[] =
561static const char *const warrior_sample_names[] =
562562{
563563   "*warrior",
564564   "bgmhum1.wav",
r1386r1387
569569    NULL
570570};
571571
572static struct Samplesinterface warrior_samples_interface =
572static const struct Samplesinterface warrior_samples_interface =
573573{
574574   5,
575575   warrior_sample_names
r1386r1387
625625 *
626626 *************************************/
627627
628static const char *armora_sample_names[] =
628static const char *const armora_sample_names[] =
629629{
630630   "*armora",
631631    "loexp.wav",
r1386r1387
638638    NULL
639639};
640640
641static struct Samplesinterface armora_samples_interface =
641static const struct Samplesinterface armora_samples_interface =
642642{
643643   7,
644644   armora_sample_names
r1386r1387
718718 *
719719 *************************************/
720720
721static const char *ripoff_sample_names[] =
721static const char *const ripoff_sample_names[] =
722722{
723723   "*ripoff",
724724   "bonuslvl.wav",
r1386r1387
737737    NULL
738738};
739739
740static struct Samplesinterface ripoff_samples_interface =
740static const struct Samplesinterface ripoff_samples_interface =
741741{
742742   6,
743743   ripoff_sample_names
r1386r1387
808808 *
809809 *************************************/
810810
811static const char *starcas_sample_names[] =
811static const char *const starcas_sample_names[] =
812812{
813813   "*starcas",
814814   "cfire.wav",
r1386r1387
822822    0
823823};
824824
825static struct Samplesinterface starcas_samples_interface =
825static const struct Samplesinterface starcas_samples_interface =
826826{
827827   8,
828828   starcas_sample_names
r1386r1387
920920 *
921921 *************************************/
922922
923static const char *solarq_sample_names[] =
923static const char *const solarq_sample_names[] =
924924{
925925   "*solarq",
926926    "bigexpl.wav",
r1386r1387
934934    NULL
935935};
936936
937static struct Samplesinterface solarq_samples_interface =
937static const struct Samplesinterface solarq_samples_interface =
938938{
939939   8,
940940   solarq_sample_names
r1386r1387
10551055 *
10561056 *************************************/
10571057
1058static const char *boxingb_sample_names[] =
1058static const char *const boxingb_sample_names[] =
10591059{
10601060   "*boxingb",
10611061    "softexpl.wav",
r1386r1387
10731073    NULL
10741074};
10751075
1076static struct Samplesinterface boxingb_samples_interface =
1076static const struct Samplesinterface boxingb_samples_interface =
10771077{
10781078   12,
10791079   boxingb_sample_names
r1386r1387
11881188 *
11891189 *************************************/
11901190
1191static const char *wotw_sample_names[] =
1191static const char *const wotw_sample_names[] =
11921192{
11931193   "*wotw",
11941194   "cfire.wav",
r1386r1387
12021202    0
12031203};
12041204
1205static struct Samplesinterface wotw_samples_interface =
1205static const struct Samplesinterface wotw_samples_interface =
12061206{
12071207   8,
12081208   wotw_sample_names
r1386r1387
13001300 *
13011301 *************************************/
13021302
1303static const char *wotwc_sample_names[] =
1303static const char *const wotwc_sample_names[] =
13041304{
13051305   "*wotwc",
13061306   "cfire.wav",
r1386r1387
13141314    0
13151315};
13161316
1317static struct Samplesinterface wotwc_samples_interface =
1317static const struct Samplesinterface wotwc_samples_interface =
13181318{
13191319   8,
13201320   wotwc_sample_names
src/mame/audio/galaxian.c
r1386r1387
5757static INT32 counter, countdown;
5858static INT32 lfobit[4];
5959
60static INT16 backgroundwave[32] =
60static const INT16 backgroundwave[32] =
6161{
6262   0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
6363   0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000,
r1386r1387
357357   sample_start_raw(CHANNEL_SHOOT,shootwave,SHOOT_LENGTH,SHOOT_RATE,1);
358358
359359   sample_set_volume(CHANNEL_LFO+0,0);
360   sample_start_raw(CHANNEL_LFO+0,backgroundwave,sizeof(backgroundwave)/2,1000,1);
360   sample_start_raw(CHANNEL_LFO+0,backgroundwave,ARRAY_LENGTH(backgroundwave),1000,1);
361361   sample_set_volume(CHANNEL_LFO+1,0);
362   sample_start_raw(CHANNEL_LFO+1,backgroundwave,sizeof(backgroundwave)/2,1000,1);
362   sample_start_raw(CHANNEL_LFO+1,backgroundwave,ARRAY_LENGTH(backgroundwave),1000,1);
363363   sample_set_volume(CHANNEL_LFO+2,0);
364   sample_start_raw(CHANNEL_LFO+2,backgroundwave,sizeof(backgroundwave)/2,1000,1);
364   sample_start_raw(CHANNEL_LFO+2,backgroundwave,ARRAY_LENGTH(backgroundwave),1000,1);
365365
366366   noisetimer = timer_alloc(noise_timer_cb, NULL);
367367   timer_adjust(noisetimer, ATTOTIME_IN_NSEC((155000+22000)/100*693*22), 0, ATTOTIME_IN_NSEC((155000+22000)/100*693*22));
r1386r1387
525525}
526526
527527
528struct Samplesinterface galaxian_samples_interface =
528const struct Samplesinterface galaxian_samples_interface =
529529{
530530   5,
531531   NULL,
src/mame/audio/zaxxon.c
r1386r1387
8181 *
8282 *************************************/
8383
84static const char *zaxxon_sample_names[] =
84static const char *const zaxxon_sample_names[] =
8585{
8686   "*zaxxon",
8787   "03.wav",   /* 0 - Homing Missile */
r1386r1387
100100};
101101
102102
103static struct Samplesinterface zaxxon_samples_interface =
103static const struct Samplesinterface zaxxon_samples_interface =
104104{
105105   12,
106106   zaxxon_sample_names
r1386r1387
194194 *
195195 *************************************/
196196
197static const char *congo_sample_names[] =
197static const char *const congo_sample_names[] =
198198{
199199   "*congo",
200200   "gorilla.wav",   /* 0 */
r1386r1387
206206};
207207
208208
209static struct Samplesinterface congo_samples_interface =
209static const struct Samplesinterface congo_samples_interface =
210210{
211211   5,   /* 5 channels */
212212   congo_sample_names
src/mame/audio/circus.c
r1386r1387
44
55int circus_game;
66
7static const char *circus_sample_names[] =
7static const char *const circus_sample_names[] =
88{
99   "*circus",
1010   "pop.wav",
r1386r1387
1313   0
1414};
1515
16struct Samplesinterface circus_samples_interface =
16const struct Samplesinterface circus_samples_interface =
1717{
1818   3,   /* 3 channels */
1919   circus_sample_names
2020};
2121
22static const char *crash_sample_names[] =
22static const char *const crash_sample_names[] =
2323{
2424   "*crash",
2525   "crash.wav",
2626   0
2727};
2828
29struct Samplesinterface crash_samples_interface =
29const struct Samplesinterface crash_samples_interface =
3030{
3131   1,   /* 1 channel */
3232   crash_sample_names
3333};
3434
35static const char *ripcord_sample_names[] =
35static const char *const ripcord_sample_names[] =
3636{
3737   "*ripcord",
3838   "splash.wav",
r1386r1387
4242   0
4343};
4444
45struct Samplesinterface ripcord_samples_interface =
45const struct Samplesinterface ripcord_samples_interface =
4646{
4747   4,   /* 4 channels */
4848   ripcord_sample_names
4949};
5050
51static const char *robotbwl_sample_names[] =
51static const char *const robotbwl_sample_names[] =
5252{
5353   "*robotbwl",
5454   "hit.wav",
r1386r1387
5959   0
6060};
6161
62struct Samplesinterface robotbwl_samples_interface =
62const struct Samplesinterface robotbwl_samples_interface =
6363{
6464   5,   /* 5 channels */
6565   robotbwl_sample_names
src/mame/audio/turbo.c
r1386r1387
164164 *
165165 *************************************/
166166
167static const char *turbo_sample_names[] =
167static const char *const turbo_sample_names[] =
168168{
169169   "*turbo",
170170   "01.wav",      /* 0: Trig1 */
r1386r1387
180180};
181181
182182
183static struct Samplesinterface turbo_samples_interface =
183static const struct Samplesinterface turbo_samples_interface =
184184{
185185   10,
186186   turbo_sample_names
r1386r1387
418418 *
419419 *************************************/
420420
421static const char *subroc3d_sample_names[] =
421static const char *const subroc3d_sample_names[] =
422422{
423423   "*subroc3d",
424424   "01.wav",   /*  0: enemy missile */
r1386r1387
436436};
437437
438438
439static struct Samplesinterface subroc3d_samples_interface =
439static const struct Samplesinterface subroc3d_samples_interface =
440440{
441441   12,
442442   subroc3d_sample_names
r1386r1387
571571 *
572572 *************************************/
573573
574static const char *buckrog_sample_names[]=
574static const char *const buckrog_sample_names[]=
575575{
576576   "*buckrog",
577577   "alarm0.wav",   /* 0 */
r1386r1387
589589};
590590
591591
592static struct Samplesinterface buckrog_samples_interface =
592static const struct Samplesinterface buckrog_samples_interface =
593593{
594594   6,          /* 6 channels */
595595   buckrog_sample_names
src/mame/audio/gorf.c
r1386r1387
2828 * 64 Phonemes - currently 1 sample per phoneme, will be combined sometime!
2929 ****************************************************************************/
3030
31static const char *PhonemeTable[65] =
31static const char *const PhonemeTable[65] =
3232{
3333 "EH3","EH2","EH1","PA0","DT" ,"A1" ,"A2" ,"ZH",
3434 "AH2","I3" ,"I2" ,"I1" ,"M"  ,"N"  ,"B"  ,"V",
r1386r1387
4141 0
4242};
4343
44static const char *GorfWordTable[] =
44static const char *const GorfWordTable[] =
4545{
4646 "A2AYY1","A2E1","UH1GEH1I3N","AE1EH2M","AEM",
4747 "AE1EH3ND","UH1NAH2I1YLA2SHUH2N","AH2NUHTHER","AH1NUHTHVRR",
r1386r1387
7878
7979#define num_samples (sizeof(GorfWordTable)/sizeof(char *))
8080
81const char *gorf_sample_names[] =
81const char *const gorf_sample_names[] =
8282{
8383 "*gorf","a.wav","a.wav","again.wav","am.wav","am.wav","and.wav","anhilatn.wav",
8484 "another.wav","another.wav","are.wav","are.wav",
src/mame/audio/astrof.c
r1386r1387
156156}
157157
158158
159static const char *astrof_sample_names[] =
159static const char *const astrof_sample_names[] =
160160{
161161   "*astrof",
162162   "fire.wav",
r1386r1387
174174};
175175
176176
177static struct Samplesinterface astrof_samples_interface =
177static const struct Samplesinterface astrof_samples_interface =
178178{
179179   4,   /* 4 channels */
180180   astrof_sample_names
r1386r1387
219219}
220220
221221
222static struct SN76477interface tomahawk_sn76477_interface =
222static const struct SN76477interface tomahawk_sn76477_interface =
223223{
224224   0,            /*  4 noise_res (N/C)        */
225225   0,            /*  5 filter_res (N/C)       */
src/mame/audio/astinvad.c
r1386r1387
1818#include "sound/samples.h"
1919#include "includes/astinvad.h"
2020
21static const char *astinvad_sample_names[] =
21static const char *const astinvad_sample_names[] =
2222{
2323   "*invaders",
2424   "0.wav",
r1386r1387
4848};
4949
5050
51struct Samplesinterface astinvad_samples_interface =
51const struct Samplesinterface astinvad_samples_interface =
5252{
5353   6,   /* channels */
5454   astinvad_sample_names
src/mame/audio/polyplay.c
r1386r1387
5050   if (data) {
5151      freq1 = 2457600 / 16 / data / 8;
5252      sample_set_volume(0, channel_playing1 * 1.0);
53      sample_start_raw(0, backgroundwave, sizeof(backgroundwave)/2, sizeof(backgroundwave)*freq1,1);
53      sample_start_raw(0, backgroundwave, ARRAY_LENGTH(backgroundwave), sizeof(backgroundwave)*freq1,1);
5454   }
5555   else {
5656      sample_stop(0);
r1386r1387
6363   if (data) {
6464      freq2 = 2457600 / 16 / data / 8;
6565      sample_set_volume(1, channel_playing2 * 1.0);
66      sample_start_raw(1, backgroundwave, sizeof(backgroundwave)/2, sizeof(backgroundwave)*freq2,1);
66      sample_start_raw(1, backgroundwave, ARRAY_LENGTH(backgroundwave), sizeof(backgroundwave)*freq2,1);
6767   }
6868   else {
6969      sample_stop(0);
src/mame/audio/depthch.c
r1386r1387
1818
1919
2020/* sample file names */
21static const char *depthch_sample_names[] =
21static const char *const depthch_sample_names[] =
2222{
2323   "*depthch",
2424   "longex.wav",
r1386r1387
2929};
3030
3131
32static struct Samplesinterface depthch_samples_interface =
32static const struct Samplesinterface depthch_samples_interface =
3333{
3434   4,
3535   depthch_sample_names
src/mame/audio/cclimber.c
r1386r1387
8383   0
8484};
8585
86struct Samplesinterface cclimber_samples_interface =
86const struct Samplesinterface cclimber_samples_interface =
8787{
8888   1,
8989   NULL,
src/mame/audio/vicdual.c
r1386r1387
101101
102102DISCRETE_SOUND_END
103103
104static const char *frogs_sample_names[] =
104static const char *const frogs_sample_names[] =
105105{
106106   "*frogs",
107107   "boing.wav",
r1386r1387
113113   0
114114};
115115
116static struct Samplesinterface frogs_samples_interface =
116static const struct Samplesinterface frogs_samples_interface =
117117{
118118   5,   /* 5 channels */
119119   frogs_sample_names
src/mame/audio/rockola.c
r1386r1387
5050static int Sound0StopOnRollover;
5151static UINT8 LastPort1;
5252
53const char *sasuke_sample_names[] =
53const char *const sasuke_sample_names[] =
5454{
5555   "*sasuke",
5656
r1386r1387
6363   0
6464};
6565
66const char *vanguard_sample_names[] =
66const char *const vanguard_sample_names[] =
6767{
6868   "*vanguard",
6969
r1386r1387
9292   0
9393};
9494
95const char *fantasy_sample_names[] =
95const char *const fantasy_sample_names[] =
9696{
9797   "*fantasy",
9898
src/mame/audio/meadows.c
r1386r1387
3232static   int channel;
3333static   int freq1 = 1000;
3434static   int freq2 = 1000;
35static   INT16 waveform[2] = { -120*256, 120*256 };
35static const INT16 waveform[2] = { -120*256, 120*256 };
3636
3737/************************************/
3838/* Sound handler start              */
r1386r1387
4444   vol[0]=vol[1]=255;
4545
4646   sample_set_volume(0,0);
47   sample_start_raw(0,waveform,sizeof(waveform)/2,freq1,1);
47   sample_start_raw(0,waveform,ARRAY_LENGTH(waveform),freq1,1);
4848   sample_set_volume(1,0);
49   sample_start_raw(1,waveform,sizeof(waveform)/2,freq2,1);
49   sample_start_raw(1,waveform,ARRAY_LENGTH(waveform),freq2,1);
5050}
5151
5252/************************************/
src/mame/audio/carnival.c
r1386r1387
8181
8282
8383/* sample file names */
84static const char *carnival_sample_names[] =
84static const char *const carnival_sample_names[] =
8585{
8686   "*carnival",
8787   "bear.wav",
r1386r1387
9898};
9999
100100
101static struct Samplesinterface carnival_samples_interface =
101static const struct Samplesinterface carnival_samples_interface =
102102{
103103   10,
104104   carnival_sample_names
src/mame/audio/dkong.c
r1386r1387
11#include "driver.h"
22#include "cpu/i8039/i8039.h"
3#include "cpu/m6502/m6502.h"
4#include "sound/nes_apu.h"
35#include "sound/samples.h"
4#include "includes/dkong.h"
56#include "sound/discrete.h"
67#include "sound/dac.h"
78
9#include "includes/dkong.h"
810
911/****************************************************************
1012 *
11 * Diskrete Sound defines
13 * Defines and Macros
1214 *
1315 ****************************************************************/
1416
17#define DEBUG_SPEECH   (0)
18
19#define ACTIVELOW_PORT_BIT(P,A,D)   (((P) & (~(1 << (A)))) | (((D) ^ 1) << (A)))
20
21/* Needed for dkongjr ... FIXME */
22#define I8035_T_R(N) ((portT >> (N)) & 1)
23#define I8035_T_W_AL(N,D) do { portT = ACTIVELOW_PORT_BIT(portT,N,D); soundlatch2_w(0, portT); } while (0)
24
25#define I8035_P1_R() (soundlatch3_r(0))
26#define I8035_P2_R() (soundlatch4_r(0))
27#define I8035_P1_W(D) soundlatch3_w(0,D)
28#define I8035_P2_W(D) soundlatch4_w(0,D)
29
30#define I8035_P1_W_AL(B,D) I8035_P1_W(ACTIVELOW_PORT_BIT(I8035_P1_R(),B,(D)))
31#define I8035_P2_W_AL(B,D) I8035_P2_W(ACTIVELOW_PORT_BIT(I8035_P2_R(),B,(D)))
32
33
34/****************************************************************
35 *
36 * Discrete Sound defines
37 *
38 ****************************************************************/
39
1540/* Discrete sound inputs */
1641
1742#define DS_SOUND0_INV      NODE_01
r1386r1387
6388static UINT8 dkongjr_latch[10];
6489static UINT8 sh_climb_count;
6590
66static UINT8 has_discrete_interface = 0;
91static UINT8 has_discrete_interface;
6792
6893static UINT8 page,mcustatus;
69static UINT8 p[8];
70static UINT8 t[2];
7194static double envelope,tt;
7295static UINT8 decay;
73static UINT8 sh1_count = 0;
96static UINT8 sh1_count;
97static UINT8 portT;
7498
75enum
76{
99enum {
77100   WAIT_CMD,
78101   WAIT_WRITE,
79102   WAIT_DONE1,
80103   WAIT_DONE2
81};
104} m58817_states;
82105
83106static UINT8 m58817_state;
84107static UINT8 m58817_drq;
r1386r1387
160183#define   DK_C29      CAP_U_AGED(3.3)
161184#define DK_C30      CAP_U_AGED(10)
162185#define DK_C32      CAP_U_AGED(10)
163#define DK_C34      CAP_N(100)
186#define DK_C34      CAP_N(10)
164187#define DK_C160      CAP_N(100)
165188
166189
r1386r1387
234257   DISC_OSC_INVERTER_IS_TYPE2
235258   };
236259
237DISCRETE_SOUND_START(dkong)
260static DISCRETE_SOUND_START(dkong2b)
238261
239262   /************************************************/
240263   /* Input register mapping for dkong             */
r1386r1387
331354
332355   /* following the DAC are two opamps. The first is a current-to-voltage changer
333356     * for the DAC08 which delivers a variable output current.
334     * The second opamp I tried to modell in the transform.
357     *
358     * The second one is a Sallen Key filter ...
359     * http://www.t-linespeakers.org/tech/filters/Sallen-Key.html
360     * f = w / 2 / pi  = 1 / ( 2 * pi * 5.6k*sqrt(22n*10n)) = 1916 Hz
361     * Q = 1/2 * sqrt(22n/10n)= 0.74
335362     */
363   DISCRETE_FILTER2(NODE_73, 1, NODE_71, 1916, (1.0/0.74), DISC_FILTER_LOWPASS)
336364
337    DISCRETE_RCFILTER(NODE_72,1,NODE_71,(DK_R21+DK_R22),DK_C34)
338   DISCRETE_TRANSFORM4(NODE_73,1,NODE_72,NODE_71,-1,NODE_73,"012*3+-")
339
340365   /* Adjustment VR2 */
341366   DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_73, DS_ADJ_DAC)
342367
r1386r1387
346371
347372   DISCRETE_MIXER4(NODE_288, 1, DS_OUT_SOUND0, DS_OUT_SOUND1, DS_OUT_DAC, DS_OUT_SOUND2, &dkong_mixer_desc)
348373
349#if 1
374#if
350375   /* This filter should simulate gain vs. frequency behaviour of MB3712 */
351376   //DISCRETE_FILTER1(NODE_294,1,NODE_288,80,DISC_FILTER_HIGHPASS)
352377
353378   /* The following is the CR filter by the speaker and C8 */
354379   /* 4 Ohm is from MB3712 Spec Sheet */
355380   DISCRETE_CRFILTER(NODE_295,1,NODE_288, 4, DK_C8)
356   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0*30)
381   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0*15)
357382#else
358383   // Amplifier: internal amplifier
359   DISCRETE_ADDER2(NODE_289,1,NODE_288,0.5+5.0*150.0/(150.0+1000.0))
384   //DISCRETE_ADDER2(NODE_289,1,NODE_288,0.3+5.0*150.0/(150.0+1000.0))
385   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
360386    DISCRETE_RCINTEGRATE(NODE_294,1,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
361387   DISCRETE_CRFILTER(NODE_295,1,NODE_294, 50, DK_C13)
362   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0)
388   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0 )
363389#endif
364390
365391DISCRETE_SOUND_END
r1386r1387
382408#define RS_R14      RES_K(10)
383409#define RS_R15      RES_K(5.6)   // ????
384410#define RS_R16      RES_K(5.6)
385#define RS_R18      RES_K(4.7)    // ????
411#define RS_R18      RES_K(4.7)
386412#define RS_R22      RES_K(5.6)
387413#define RS_R23      RES_K(5.6)
388414#define RS_R25      RES_K(10)
r1386r1387
431457#define RS_C45      CAP_U(22)
432458#define RS_C46      CAP_U(1)
433459#define RS_C47      CAP_U(22)
460#define RS_C48      CAP_N(33)
461#define RS_C49      CAP_N(10)
462#define RS_C50      CAP_U(3.3)
434463#define RS_C51      CAP_U(3.3)
435464#define RS_C53      CAP_U(3.3)
436465#define RS_C54      CAP_U(1)
r1386r1387
465494      {0,0,0},   // no variable resistors
466495      {0,0,0},  // no node capacitors
467496      0, 0,
468      RS_C51,
497      RS_C50,
469498      0,
470499      0, 1};
471500
r1386r1387
488517   DISC_OSC_INVERTER_IS_TYPE3
489518   };
490519
491DISCRETE_SOUND_START(radarscp)
520static DISCRETE_SOUND_START(radarscp)
492521
493522   /************************************************/
494523   /* Input register mapping for radarscp          */
r1386r1387
563592   DISCRETE_MIXER3(NODE_42, 1, NODE_41, DK_SUP_V, 0,&radarscp_mixer_desc_0)
564593
565594    /* 555 Voltage controlled */
566    DISCRETE_555_ASTABLE_CV(NODE_43, DS_SOUND6, RES_K(47), RES_K(27), CAP_N(10), NODE_42, &dkong_555_vco_desc)
595    DISCRETE_555_ASTABLE_CV(NODE_43, DS_SOUND6, RES_K(47), RES_K(27), RS_C49, NODE_42, &dkong_555_vco_desc)
567596
568597   DISCRETE_RCDISC_MODULATED(NODE_44,1,DS_SOUND0_INV,NODE_43,RS_R39,RS_R18,RS_R37,RS_R38,RS_C22,DK_SUP_V)
569598   DISCRETE_CRFILTER(NODE_45, 1, NODE_44, RS_R15+RS_R16, RS_C33)
r1386r1387
579608
580609   DISCRETE_MIXER3(NODE_53, 1, NODE_51, DK_SUP_V, 0,&radarscp_mixer_desc_7)
581610    /* 555 Voltage controlled */
582    DISCRETE_555_ASTABLE_CV(NODE_54, DS_SOUND7, RES_K(47), RES_K(27), CAP_N(33), NODE_53, &dkong_555_vco_desc)
611    DISCRETE_555_ASTABLE_CV(NODE_54, DS_SOUND7, RES_K(47), RES_K(27), RS_C48, NODE_53, &dkong_555_vco_desc)
583612
584613    DISCRETE_RCINTEGRATE(NODE_55,1,NODE_52,RS_R46, RS_R46,0,RS_C45,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1)
585614    DISCRETE_TRANSFORM4(NODE_56, 1, NODE_55, DS_SOUND7,NODE_54,2.5, "01*23<*")
r1386r1387
595624
596625   /* following the DAC are two opamps. The first is a current-to-voltage changer
597626     * for the DAC08 which delivers a variable output current.
598     * The second opamp I tried to modell in the transform.
627     *
628     * The second one is a Sallen Key filter ...
629     * http://www.t-linespeakers.org/tech/filters/Sallen-Key.html
630     * f = w / 2 / pi  = 1 / ( 2 * pi * 5.6k*sqrt(22n*10n)) = 1916 Hz
631     * Q = 1/2 * sqrt(22n/10n)= 0.74
599632     */
633   DISCRETE_FILTER2(NODE_173, 1, NODE_171, 1916, (1.0/0.74), DISC_FILTER_LOWPASS)
600634
601    DISCRETE_RCFILTER(NODE_172,1,NODE_171,(RS_R22+RS_R23),RS_C38)
602   DISCRETE_TRANSFORM4(NODE_173,1,NODE_172,NODE_171,-1,NODE_173,"012*3+-")
603
604635   /* Adjustment VR3 */
605636   DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_173, DS_ADJ_DAC)
606637
r1386r1387
610641
611642   DISCRETE_MIXER5(NODE_288, 1, DS_OUT_SOUND0, DS_OUT_SOUND1, DS_OUT_SOUND2, DS_OUT_SOUND7, DS_OUT_DAC, &radarscp_mixer_desc)
612643
613#if 1
644#if
614645   /* This filter should simulate gain vs. frequency behaviour of MB3712 */
615646   //DISCRETE_FILTER1(NODE_291,1,NODE_289,80,DISC_FILTER_HIGHPASS)
616647
617648   /* The following is the CR filter by the speaker and C8 */
618649   /* 4 Ohm is from MB3712 Spec Sheet */
619650   DISCRETE_CRFILTER(NODE_295,1,NODE_288, 4, RS_C5)
620   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0*10)
651   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0*20)
621652#else
622653   // Amplifier: internal amplifier
623   DISCRETE_ADDER2(NODE_289,1,NODE_288,0.5+5.0*150.0/(150.0+1000.0))
654   //DISCRETE_ADDER2(NODE_289,1,NODE_288,0.5+5.0*150.0/(150.0+1000.0))
655   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
624656    DISCRETE_RCINTEGRATE(NODE_294,1,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
625657   DISCRETE_CRFILTER(NODE_295,1,NODE_294, 50, DK_C13)
626   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0)
658   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0 * 3)
627659#endif
628660
629   //DISCRETE_CSVLOG3(DS_SOUND2,NODE_13,NODE_14)
630   //DISCRETE_CSVLOG3(DS_SOUND0,NODE_54,NODE_51)
631   //DISCRETE_CRFILTER(NODE_299,1,NODE_288, 50, DK_C13)
632   //DISCRETE_WAVELOG2(NODE_295, 32767/5.0, NODE_299, 32767.0/5.0*20)
633   //DISCRETE_WAVELOG2(NODE_57, 32767/5.0, NODE_56, 32767/5.0)
634661DISCRETE_SOUND_END
635662
636663
r1386r1387
640667 *
641668 ****************************************************************/
642669
643SOUND_START( dkong )
670static SOUND_START( dkong )
644671{
645672   state_save_register_global(page);
646673   state_save_register_global(mcustatus);
647   state_save_register_global_array(p);
648   state_save_register_global_array(t);
649674   state_save_register_global(envelope);
650675   state_save_register_global(tt);
651676   state_save_register_global(decay);
652677   state_save_register_global(sh1_count);
678   state_save_register_global(portT);
653679
680   has_discrete_interface = 1;
681
682
683}
684
685static SOUND_RESET( dkong )
686{
687
654688   sh1_count = 0;
655689   mcustatus = 0;
656690   envelope = 0;
r1386r1387
658692   decay = 0;
659693
660694   page = 0;
661   p[0] = p[1] = p[2] = p[3] = p[4] = p[5] = p[6] = p[7] = 255;
662   t[0] = t[1] = 1;
663695
664   has_discrete_interface = 1;
696   I8035_T_W_AL(0,0);
697   I8035_T_W_AL(1,0);
698   I8035_P1_W(255);
699   I8035_P2_W(255);
700
665701}
666702
667SOUND_START( dkongjr )
703static SOUND_START( dkongjr )
668704{
669705   sound_start_dkong(machine);
670706
r1386r1387
676712   has_discrete_interface = 0;
677713}
678714
679SOUND_START( hunchbkd  )
715static SOUND_START( radarsc1  )
680716{
681717   sound_start_dkong(machine);
682718
683   has_discrete_interface = 0;
719   state_save_register_global(m58817_state);
720   state_save_register_global(m58817_drq);
721   state_save_register_global_array(m58817_nibbles);
722   state_save_register_global(m58817_count);
723   state_save_register_global(m58817_address);
724
725   has_discrete_interface = 1;
684726}
685727
686static int dumpframe(int startbit);
687
688SOUND_START( radarsc1  )
728static SOUND_RESET( radarsc1  )
689729{
690   sound_start_dkong(machine);
730   sound_reset_dkong(machine);
691731
692732   m58817_state=WAIT_CMD;
693733   m58817_drq=0;
694734   m58817_count=0;
695735   m58817_address=0;
696736
697   state_save_register_global(m58817_state);
698   state_save_register_global(m58817_drq);
699   state_save_register_global_array(m58817_nibbles);
700   state_save_register_global(m58817_count);
701   state_save_register_global(m58817_address);
702
703   has_discrete_interface = 1;
704737}
705738
706739/****************************************************************
707740 *
708 * I/O Handlers
741 * M58817 Speech
709742 *
743 * Fixme: Move to src/emu/audio
744 *
710745 ****************************************************************/
711746
712
713READ8_HANDLER( dkong_sh_p1_r )
714{
715   return p[1];
716}
717
718READ8_HANDLER( dkong_sh_p2_r )
719{
720   return p[2];
721}
722
723READ8_HANDLER( dkong_sh_t0_r )
724{
725   return t[0];
726}
727
728READ8_HANDLER( dkong_sh_t1_r )
729{
730   return t[1];
731}
732
733READ8_HANDLER( dkong_sh_tune_r )
734{
735   UINT8 *SND = memory_region(REGION_CPU2);
736   if ((page & 0x40) && (offset==0x20))
737      return soundlatch_r(0);
738   else
739      return (SND[2048+(page & 7)*256+offset]);
740}
741
742#define TSTEP 0.001
743
744WRITE8_HANDLER( dkong_sh_p1_w )
745{
746
747   if (has_discrete_interface)
748      discrete_sound_w(DS_DAC,data);
749   else
750   {
751      envelope=exp(-tt);
752      DAC_data_w(0,(int)(data*envelope));
753      if (decay)
754         tt+=TSTEP;
755      else
756         tt=0;
757   }
758}
759
760READ8_HANDLER( radarsc1_sh_tune_r )
761{
762   // always offset 0x20
763   return soundlatch_r(0);
764}
765
766
767747/* @0x510, cpu2
768748 10: 0000 00 00000000 ... 50 53 01010000 01010011 "scramble"
769749 12: 007a 44 01000100 ... 00 0f 00000000 00001111 "all pilots climb up"
r1386r1387
788768 271
789769
790770 Samples
791 0: 14 16
792 1: 14 18
793 2: 14 1A
794 3: 1C
795 4: 1E 1E
796 5: 10 10 10
797 6: 12 12
798 7: 20
771 0: 14 16       ... checkpoint charlie
772 1: 14 18       ... checkpoint bravo
773 2: 14 1A       ... checkpoint alpha
774 3: 1C          You'll notice
775 4: 1E 1E       Complete attack mission
776 5: 10 10 10    trouble, trouble, trouble
777 6: 12 12       all pilots climb up
778 7: 20          engine trouble
799779*/
800780
781#if DEBUG_SPEECH
801782static UINT8 m58817_getbit(int bitnum)
802783{
803784   const UINT8 *table = memory_region(REGION_SOUND1);
r1386r1387
817798   return r;
818799}
819800
820static int decodeframe(int startbit)
801static int m58817_decodeframe(int startbit)
821802{
822803   int energy;
823804   int pitch;
r1386r1387
866847   }
867848}
868849
869static int dumpframe(int startbit)
850static int m58817_dumpframe(int startbit)
870851{
871852   while (startbit>=0)
872      startbit=decodeframe(startbit);
853      startbit=m58817_decodeframe(startbit);
873854   logerror("\n");
874855   return startbit;
875856}
857#endif
876858
859static void m58817_sampleframe(int addr)
860{
861   printf("0x%x\n", addr);
862   switch (addr)
863   {
864      case 0x0000:   /* 10 */
865         sample_start (0,0,0);
866         break;
867      case 0x007a:   /* 12 */
868         sample_start (0,1,0);
869         break;
870      case 0x018b:   /* 14 */
871         sample_start (0,2,0);
872         break;
873      case 0x0320:   /* 16 */
874         sample_start (0,3,0);
875         break;
876      case 0x036c:   /* 18 */
877         sample_start (0,4,0);
878         break;
879      case 0x03c4:   /* 1A */
880         sample_start (0,5,0);
881         break;
882      case 0x041c:   /* 1C */
883         sample_start (0,6,0);
884         break;
885      case 0x0520:   /* 1E */
886         sample_start (0,7,0);
887         break;
888      case 0x063e:   /* 20 */
889         sample_start (0,8,0);
890         break;
891   }
892}
893
877894static void m58817_state_loop(int data)
878895{
879896   int i;
r1386r1387
908925            m58817_address |= (m58817_nibbles[i] << (i*4));
909926         }
910927         logerror("m58817: address: 0x%04x\n", m58817_address);
911         dumpframe(m58817_address * 8);
928         //m58817_dumpframe(m58817_address * 8);
929         m58817_sampleframe(m58817_address);
912930         m58817_state=WAIT_CMD;
913931         break;
914932   }
915933}
916934
917static READ8_HANDLER( M58817_status_r)
935
936static READ8_HANDLER( M58817_status_r )
918937{
919   return !(m58817_state == WAIT_CMD);
938   //return !(m58817_state == WAIT_CMD);
939   return sample_playing(0);
920940}
921941
922static WRITE8_HANDLER( M58817_command_w)
942static WRITE8_HANDLER( M58817_command_w )
923943{
924944   int drq = (data>>4) & 0x01; // FIXME 0x20 ??
925945   int dat = data & 0x0f;
r1386r1387
929949   m58817_drq = drq;
930950}
931951
932READ8_HANDLER( radarsc1_sh_p1_r )
952/****************************************************************
953 *
954 * I/O Handlers - static
955 *
956 ****************************************************************/
957
958static READ8_HANDLER( dkong_sh_p1_r )
933959{
960   return I8035_P1_R();
961}
962
963static READ8_HANDLER( dkong_sh_p2_r )
964{
965   return I8035_P2_R();
966}
967
968static READ8_HANDLER( dkong_sh_t0_r )
969{
970   return I8035_T_R(0);
971}
972
973static READ8_HANDLER( dkong_sh_t1_r )
974{
975   return I8035_T_R(1);
976}
977
978static READ8_HANDLER( dkong_sh_tune_r )
979{
980   UINT8 *SND = memory_region(REGION_CPU2);
981   if ( page & 0x40 )
982   {
983      return soundlatch_r(0);
984   }
985   else
986      return (SND[2048+(page & 7)*256+offset]);
987}
988
989#define TSTEP 0.001
990
991static WRITE8_HANDLER( dkong_sh_p1_w )
992{
993
994   if (has_discrete_interface)
995      discrete_sound_w(DS_DAC,data);
996   else
997   {
998      envelope=exp(-tt);
999      DAC_data_w(0,(int)(data*envelope));
1000      if (decay)
1001         tt+=TSTEP;
1002      else
1003         tt=0;
1004   }
1005}
1006
1007
1008static READ8_HANDLER( radarsc1_sh_p1_r )
1009{
9341010   int r;
935
936   r = (p[1] & 0x80) | (M58817_status_r(0)<<6);
937   //logerror("PA Ret %x\n", r);
1011   r = (I8035_P1_R() & 0x80) | (M58817_status_r(0)<<6);
9381012   return r;
9391013}
9401014
941WRITE8_HANDLER( radarsc1_sh_p1_w )
1015static WRITE8_HANDLER( radarsc1_sh_p1_w )
9421016{
9431017   M58817_command_w(0,data);
9441018}
9451019
946WRITE8_HANDLER( radarsc1_sh_p2_w )
1020static WRITE8_HANDLER( radarsc1_sh_p2_w )
9471021{
9481022   /*   If P2.Bit7 -> external signal decay
9491023     *   If P2.Bit6 -> not connected
r1386r1387
9611035   radarsc1_ansn_w(0, (data & 0x20) >> 5);
9621036}
9631037
964WRITE8_HANDLER( dkong_sh_p2_w )
1038static WRITE8_HANDLER( dkong_sh_p2_w )
9651039{
9661040   /*   If P2.Bit7 -> is apparently an external signal decay or other output control
9671041     *   If P2.Bit6 -> activates the external compressed sample ROM
r1386r1387
9771051   mcustatus = ((~data & 0x10) >> 4);
9781052}
9791053
980#define ACTIVELOW_PORT_BIT(P,A,D)   ((P & (~(1 << A))) | (((D) ^ 1) << A))
981
982WRITE8_HANDLER( dkong_sh_tuneselect_w )
1054static READ8_HANDLER( radarsc1_sh_tune_r )
9831055{
984   soundlatch_w(offset,data ^ 0x0f);
1056   return soundlatch_r(0);
9851057}
9861058
1059
1060/****************************************************************
1061 *
1062 * I/O Handlers - global
1063 *
1064 ****************************************************************/
1065
9871066WRITE8_HANDLER( dkongjr_sh_test6_w )
9881067{
989   p[2] = ACTIVELOW_PORT_BIT(p[2],6,data);
1068   I8035_P2_W_AL(6,data & 1);
9901069}
9911070
992WRITE8_HANDLER( dkongjr_sh_test5_w )
993{
994   p[2] = ACTIVELOW_PORT_BIT(p[2],5,data);
995}
9961071
997WRITE8_HANDLER( dkongjr_sh_test4_w )
1072WRITE8_HANDLER( dkongjr_sh_tuneselect_w )
9981073{
999   p[2] = ACTIVELOW_PORT_BIT(p[2],4,data);
1074   soundlatch_w(offset,data);
10001075}
10011076
1002WRITE8_HANDLER( dkongjr_sh_tuneselect_w )
1077READ8_HANDLER( dkong_audio_status_r )
10031078{
1004   soundlatch_w(offset,data);
1079   return mcustatus;
10051080}
10061081
1007
1008WRITE8_HANDLER( dkong_sh_w )
1082WRITE8_HANDLER( dkong_audio_irq_w )
10091083{
10101084   if (data)
10111085      cpunum_set_input_line(1, 0, ASSERT_LINE);
r1386r1387
10151089
10161090WRITE8_HANDLER( dkong_snd_disc_w )
10171091{
1092   dkong_state *state = Machine->driver_data;
1093
10181094   if (!has_discrete_interface && (offset<3))
10191095   {
10201096      logerror("dkong.c: Write to snd port %d (%d)\n", offset, data);
r1386r1387
10331109         radarscp_snd02_w(0, data & 1);
10341110         break;
10351111      case 3:
1036         p[2] = ACTIVELOW_PORT_BIT(p[2],5,data);
1112         if (state->hardware_type == HARDWARE_TRS01)
1113            //SOUND3 ==> PA7
1114            I8035_P1_W_AL(7,data & 1);
1115         else
1116            I8035_P2_W_AL(5,data & 1);
10371117         break;
10381118      case 4:
1039         t[1] = ~data & 1;
1119         I8035_T_W_AL(1, data & 1);
10401120         break;
10411121      case 5:
1042         t[0] = ~data & 1;
1122         I8035_T_W_AL(0, data & 1);
10431123         break;
10441124      case 6:
10451125         if (has_discrete_interface)
r1386r1387
10491129         if (has_discrete_interface)
10501130            discrete_sound_w(DS_SOUND7_INP,data & 1);
10511131         break;
1052   }
1132    }
10531133   return;
10541134}
10551135
1056WRITE8_HANDLER( radarsc1_snd_disc_w )
1136WRITE8_HANDLER( dkong_sh_tuneselect_w )
10571137{
1058   if (!has_discrete_interface && (offset<3))
1059   {
1060      logerror("dkong.c: Write to snd port %d (%d)\n", offset, data);
1061      if (offset == 2)
1062         radarscp_snd02_w(0, data & 1);
1063      return;
1064   }
1065   switch (offset)
1066   {
1067      case 0:
1068         discrete_sound_w(DS_SOUND0_INP,data & 1);
1069         break;
1070      case 1:
1071         discrete_sound_w(DS_SOUND1_INP,data & 1);
1072         break;
1073      case 2:
1074         discrete_sound_w(DS_SOUND2_INP,data & 1);
1075         radarscp_snd02_w(0, data & 1);
1076         break;
1077      case 3:  //SOUND3 ==> PA7
1078         p[1] = ACTIVELOW_PORT_BIT(p[1],7,data & 1);
1079         break;
1080      case 4:
1081         t[1] = ~data & 1;
1082         break;
1083      case 5:
1084         t[0] = ~data & 1;
1085         break;
1086      case 6:
1087         if (has_discrete_interface)
1088            discrete_sound_w(DS_SOUND6_INP,data & 1);
1089         break;
1090      case 7:
1091         if (has_discrete_interface)
1092            discrete_sound_w(DS_SOUND7_INP,data & 1);
1093         break;
1094   }
1095   return;
1138   soundlatch_w(offset,data ^ 0x0f);
10961139}
10971140
1098READ8_HANDLER( dkong_in2_r )
1099{
1100   return input_port_2_r(offset) | (mcustatus << 6);
1101}
1102
11031141WRITE8_HANDLER( dkongjr_snd_w1 )
11041142{
11051143   static const int sample_order[7] = {1,2,1,2,0,1,0};
r1386r1387
11231161            }
11241162            break;
11251163         case 1:         /* jump */
1126      if (data)
1127               sample_start (6,0,0);
1164         if (data)
1165            sample_start (6,0,0);
11281166            break;
11291167         case 2:         /* land */
11301168            if (data)
r1386r1387
11361174               sample_start (7,2,0);
11371175            break;
11381176         case 4:         /* Port 4 write */
1139               t[1] = ~data & 1;
1177            I8035_T_W_AL(1, data & 1);
11401178            break;
11411179         case 5:         /* Port 5 write */
1142               t[0] = ~data & 1;
1180            I8035_T_W_AL(0, data & 1);
11431181            break;
11441182         case 6:         /* snapjaw */
11451183            if (data)
r1386r1387
11731211      dkongjr_latch[offset+8] = data;
11741212   }
11751213}
1214
1215
1216
1217/*************************************
1218 *
1219 *  Sound CPU memory handlers
1220 *
1221 *************************************/
1222
1223static ADDRESS_MAP_START( dkong_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1224   AM_RANGE(0x0000, 0x0fff) AM_ROM
1225ADDRESS_MAP_END
1226
1227static ADDRESS_MAP_START( dkong_sound_io_map, ADDRESS_SPACE_IO, 8 )
1228   AM_RANGE(0x00, 0xff) AM_READ(dkong_sh_tune_r)
1229   AM_RANGE(I8039_bus, I8039_bus) AM_READ(dkong_sh_tune_r)
1230   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(dkong_sh_p1_r, dkong_sh_p1_w)
1231   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, dkong_sh_p2_w)
1232   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
1233   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
1234ADDRESS_MAP_END
1235
1236static ADDRESS_MAP_START( radarsc1_sound_io_map, ADDRESS_SPACE_IO, 8 )
1237   AM_RANGE(0x00, 0xff) AM_READ(radarsc1_sh_tune_r)
1238   AM_RANGE(0x00, 0xff) AM_WRITE(dkong_sh_p1_w) // DAC here
1239   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(radarsc1_sh_p1_r, radarsc1_sh_p1_w)
1240   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, radarsc1_sh_p2_w)
1241   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
1242   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
1243ADDRESS_MAP_END
1244
1245static ADDRESS_MAP_START( dkong3_sound1_map, ADDRESS_SPACE_PROGRAM, 8 )
1246   AM_RANGE(0x0000, 0x01ff) AM_RAM
1247   AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch_r)      // overwrite default
1248   AM_RANGE(0x4017, 0x4017) AM_READ(soundlatch2_r)
1249   AM_RANGE(0x4000, 0x4017) AM_READ(NESPSG_0_r)
1250   AM_RANGE(0x4000, 0x4017) AM_WRITE(NESPSG_0_w)
1251   AM_RANGE(0xe000, 0xffff) AM_ROM
1252ADDRESS_MAP_END
1253
1254static ADDRESS_MAP_START( dkong3_sound2_map, ADDRESS_SPACE_PROGRAM, 8 )
1255   AM_RANGE(0x0000, 0x01ff) AM_RAM
1256   AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch3_r)      // overwrite default
1257   AM_RANGE(0x4000, 0x4017) AM_READ(NESPSG_1_r)
1258   AM_RANGE(0x4000, 0x4017) AM_WRITE(NESPSG_1_w)
1259   AM_RANGE(0xe000, 0xffff) AM_ROM
1260ADDRESS_MAP_END
1261
1262/*************************************
1263 *
1264 *  Sound interfaces
1265 *
1266 *************************************/
1267
1268static const char *dkongjr_sample_names[] =
1269{
1270   "*dkongjr",
1271   "jump.wav",
1272   "land.wav",
1273   "roar.wav",
1274   "climb0.wav",
1275   "climb1.wav",
1276   "climb2.wav",
1277   "death.wav",
1278   "drop.wav",
1279   "walk0.wav",
1280   "walk1.wav",
1281   "walk2.wav",
1282   "snapjaw.wav",
1283   0   /* end of array */
1284};
1285
1286static struct Samplesinterface dkongjr_samples_interface =
1287{
1288   8,   /* 8 channels */
1289   dkongjr_sample_names
1290};
1291
1292static const char *radarsc1_sample_names[] =
1293{
1294   "*radarsc1",
1295   "10.wav",
1296   "12.wav",
1297   "14.wav",
1298   "16.wav",
1299   "18.wav",
1300   "1A.wav",
1301   "1C.wav",
1302   "1E.wav",
1303   "20.wav",
1304   0   /* end of array */
1305};
1306
1307static struct Samplesinterface radarsc1_samples_interface =
1308{
1309   8,   /* 8 channels */
1310   radarsc1_sample_names
1311};
1312
1313static struct NESinterface nes_interface_1 = { REGION_CPU2 };
1314static struct NESinterface nes_interface_2 = { REGION_CPU3 };
1315
1316/*************************************
1317 *
1318 *  Machine driver
1319 *
1320 *************************************/
1321
1322MACHINE_DRIVER_START( dkong2b_audio )
1323
1324   MDRV_CPU_ADD_TAG("sound", I8035,I8035_CLOCK)
1325   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
1326   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
1327
1328   MDRV_SOUND_START(dkong)
1329   MDRV_SOUND_RESET(dkong)
1330
1331   MDRV_SPEAKER_STANDARD_MONO("mono")
1332   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1333   MDRV_SOUND_CONFIG_DISCRETE(dkong2b)
1334   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1335
1336MACHINE_DRIVER_END
1337
1338MACHINE_DRIVER_START( radarscp_audio )
1339
1340   MDRV_IMPORT_FROM( dkong2b_audio )
1341   MDRV_SOUND_MODIFY("discrete")
1342   MDRV_SOUND_CONFIG_DISCRETE(radarscp)
1343   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1344
1345MACHINE_DRIVER_END
1346
1347
1348MACHINE_DRIVER_START( radarsc1_audio )
1349
1350   MDRV_IMPORT_FROM( radarscp_audio )
1351   MDRV_CPU_MODIFY("sound")
1352   MDRV_CPU_IO_MAP(radarsc1_sound_io_map, 0)
1353
1354   MDRV_SOUND_START(radarsc1)
1355   MDRV_SOUND_RESET(radarsc1)
1356
1357   MDRV_SOUND_ADD(SAMPLES, 0)
1358   MDRV_SOUND_CONFIG(radarsc1_samples_interface)
1359   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 3.0)
1360
1361MACHINE_DRIVER_END
1362
1363MACHINE_DRIVER_START( dkongjr_audio )
1364
1365   MDRV_CPU_ADD(I8035,I8035_CLOCK)
1366   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
1367   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
1368
1369   MDRV_SOUND_START(dkongjr)
1370   MDRV_SOUND_RESET(dkong)
1371
1372   MDRV_SPEAKER_STANDARD_MONO("mono")
1373   MDRV_SOUND_ADD(DAC, 0)
1374   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
1375
1376   MDRV_SOUND_ADD(SAMPLES, 0)
1377   MDRV_SOUND_CONFIG(dkongjr_samples_interface)
1378   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
1379
1380MACHINE_DRIVER_END
1381
1382MACHINE_DRIVER_START( dkong3_audio )
1383
1384   MDRV_CPU_ADD_TAG("n2a03a", N2A03,N2A03_DEFAULTCLOCK)
1385   MDRV_CPU_PROGRAM_MAP(dkong3_sound1_map, 0)
1386   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
1387
1388   MDRV_CPU_ADD_TAG("n2a03b", N2A03,N2A03_DEFAULTCLOCK)
1389   MDRV_CPU_PROGRAM_MAP(dkong3_sound2_map, 0)
1390   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
1391
1392   MDRV_SPEAKER_STANDARD_MONO("mono")
1393   MDRV_SOUND_ADD(NES, N2A03_DEFAULTCLOCK)
1394   MDRV_SOUND_CONFIG(nes_interface_1)
1395   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1396
1397   MDRV_SOUND_ADD(NES, N2A03_DEFAULTCLOCK)
1398   MDRV_SOUND_CONFIG(nes_interface_2)
1399   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1400
1401MACHINE_DRIVER_END
1402
1403
src/mame/audio/blockade.c
r1386r1387
5757    return;
5858}
5959
60static const char *blockade_sample_names[] =
60static const char *const blockade_sample_names[] =
6161{
6262    "*blockade",
6363    "boom.wav",
6464    0
6565};
6666
67struct Samplesinterface blockade_samples_interface =
67const struct Samplesinterface blockade_samples_interface =
6868{
6969    1,   /* 1 channel */
7070   blockade_sample_names
src/mame/audio/segag80r.c
r1386r1387
173173
174174*/
175175
176static const char *astrob_sample_names[] =
176static const char *const astrob_sample_names[] =
177177{
178178   "*astrob",
179179   "invadr1.wav",      /* 0 */
r1386r1387
196196};
197197
198198
199static struct Samplesinterface astrob_samples_interface =
199static const struct Samplesinterface astrob_samples_interface =
200200{
201201   11,
202202   astrob_sample_names
r1386r1387
397397        The 4391 output is the final output.
398398*/
399399
400static const char *sega005_sample_names[] =
400static const char *const sega005_sample_names[] =
401401{
402402   "*005",
403403   "lexplode.wav",      /* 0 */
r1386r1387
411411};
412412
413413
414static struct Samplesinterface sega005_samples_interface =
414static const struct Samplesinterface sega005_samples_interface =
415415{
416416   7,
417417   sega005_sample_names
r1386r1387
632632
633633static SOUND_START( spaceod );
634634
635static const char *spaceod_sample_names[] =
635static const char *const spaceod_sample_names[] =
636636{
637637   "*spaceod",
638638   "fire.wav",         /* 0 */
r1386r1387
650650};
651651
652652
653static struct Samplesinterface spaceod_samples_interface =
653static const struct Samplesinterface spaceod_samples_interface =
654654{
655655   11,
656656   spaceod_sample_names
r1386r1387
766766*/
767767
768768
769static const char *monsterb_sample_names[] =
769static const char *const monsterb_sample_names[] =
770770{
771771   "*monsterb",
772772   "zap.wav",
r1386r1387
775775};
776776
777777
778static struct Samplesinterface monsterb_samples_interface =
778static const struct Samplesinterface monsterb_samples_interface =
779779{
780780   2,
781781   monsterb_sample_names
src/mame/audio/triplhnt.c
r1386r1387
88#include "sound/discrete.h"
99
1010
11static const char *triplhnt_sample_names[] =
11static const char *const triplhnt_sample_names[] =
1212{
1313   "*triplhnt",
1414   "bear_rac.wav",
r1386r1387
1616   0
1717};
1818
19struct Samplesinterface triplhnt_samples_interface =
19const struct Samplesinterface triplhnt_samples_interface =
2020{
2121   2,   /* 2 channels */
2222   triplhnt_sample_names
src/mame/audio/gottlieb.c
r1386r1387
103103   cpunum_set_input_line(1,INPUT_LINE_NMI,PULSE_LINE);
104104}
105105
106static const char *PhonemeTable[65] =
106static const char *const PhonemeTable[65] =
107107{
108108 "EH3","EH2","EH1","PA0","DT" ,"A1" ,"A2" ,"ZH",
109109 "AH2","I3" ,"I2" ,"I1" ,"M"  ,"N"  ,"B"  ,"V",
src/mame/audio/8080bw.c
r1386r1387
9494/*                                                     */
9595/*******************************************************/
9696
97static const char *lrescue_sample_names[] =
97static const char *const lrescue_sample_names[] =
9898{
9999   "*lrescue",
100100   "alienexplosion.wav",
r1386r1387
109109   0
110110};
111111
112struct Samplesinterface lrescue_samples_interface =
112const struct Samplesinterface lrescue_samples_interface =
113113{
114114   4,   /* 4 channels */
115115   lrescue_sample_names
r1386r1387
664664#define SCHASER_4V      SCHASER_HSYNC /2 /4
665665#define SCHASER_8V      SCHASER_HSYNC /2 /8
666666
667struct SN76477interface schaser_sn76477_interface =
667const struct SN76477interface schaser_sn76477_interface =
668668{
669669   RES_K( 47),   /*  4 noise_res         */
670670   RES_K(330),   /*  5 filter_res        */
src/mame/audio/mw8080bw.c
r1386r1387
115115 *
116116 *************************************/
117117
118static const char *seawolf_sample_names[] =
118static const char *const seawolf_sample_names[] =
119119{
120120   "*seawolf",
121121   "shiphit.wav",
r1386r1387
127127};
128128
129129
130static struct Samplesinterface seawolf_samples_interface =
130static const struct Samplesinterface seawolf_samples_interface =
131131{
132132   5,   /* 5 channels */
133133   seawolf_sample_names
r1386r1387
178178 *
179179 *************************************/
180180
181static const char *gunfight_sample_names[] =
181static const char *const gunfight_sample_names[] =
182182{
183183   "*gunfight",
184184   "gunshot.wav",
r1386r1387
187187};
188188
189189
190static struct Samplesinterface gunfight_samples_interface =
190static const struct Samplesinterface gunfight_samples_interface =
191191{
192192   1,   /* 1 channel */
193193   gunfight_sample_names
r1386r1387
15971597 *
15981598 *************************************/
15991599
1600static const char *gmissile_sample_names[] =
1600static const char *const gmissile_sample_names[] =
16011601{
16021602   "*gmissile",
16031603   "1.wav",   /* missle */
r1386r1387
16061606};
16071607
16081608
1609static struct Samplesinterface gmissile_samples_interface =
1609static const struct Samplesinterface gmissile_samples_interface =
16101610{
16111611   1,   /* 1 channel */
16121612   gmissile_sample_names
r1386r1387
16951695
16961696/* Noise clock was breadboarded and measured at 3760Hz */
16971697
1698static const char *m4_sample_names[] =
1698static const char *const m4_sample_names[] =
16991699{
17001700   "*m4",
17011701   "1.wav",   /* missle */
r1386r1387
17041704};
17051705
17061706
1707static struct Samplesinterface m4_samples_interface =
1707static const struct Samplesinterface m4_samples_interface =
17081708{
17091709   2,   /* 2 channels */
17101710   m4_sample_names
r1386r1387
19851985DISCRETE_SOUND_END
19861986
19871987
1988static const char *clowns_sample_names[] =
1988static const char *const clowns_sample_names[] =
19891989{
19901990   "*clowns",
19911991   "miss.wav",
19921992   0
19931993};
19941994
1995static struct Samplesinterface clowns_samples_interface =
1995static const struct Samplesinterface clowns_samples_interface =
19961996{
19971997   1,   /* 1 channel */
19981998   clowns_sample_names
r1386r1387
21772177 *  Apr 2007, D.R.
21782178 *************************************/
21792179
2180static struct SN76477interface spcenctr_sn76477_interface =
2180static const struct SN76477interface spcenctr_sn76477_interface =
21812181{
21822182   0,            /*  4 noise_res (N/C)        */
21832183   0,            /*  5 filter_res (N/C)       */
r1386r1387
27502750 *
27512751 *************************************/
27522752
2753static const char *phantom2_sample_names[] =
2753static const char *const phantom2_sample_names[] =
27542754{
27552755   "*phantom2",
27562756   "1.wav",   /* shot */
r1386r1387
27592759};
27602760
27612761
2762static struct Samplesinterface phantom2_samples_interface =
2762static const struct Samplesinterface phantom2_samples_interface =
27632763{
27642764   2,   /* 2 channels */
27652765   phantom2_sample_names
r1386r1387
29932993 *
29942994 *************************************/
29952995
2996static struct SN76477interface invaders_sn76477_interface =
2996static const struct SN76477interface invaders_sn76477_interface =
29972997{
29982998   0,         /*  4 noise_res (N/C)        */
29992999   0,         /*  5 filter_res (N/C)       */
r1386r1387
30223022
30233023
30243024
3025static const char *invaders_sample_names[] =
3025static const char *const invaders_sample_names[] =
30263026{
30273027   "*invaders",
30283028   "1.wav",      /* shot/missle */
r1386r1387
30383038};
30393039
30403040
3041static struct Samplesinterface invaders_samples_interface =
3041static const struct Samplesinterface invaders_samples_interface =
30423042{
30433043   6,   /* 6 channels */
30443044   invaders_sample_names
r1386r1387
38163816 *
38173817 *************************************/
38183818
3819static struct SN76477interface invad2ct_p1_sn76477_interface =
3819static const struct SN76477interface invad2ct_p1_sn76477_interface =
38203820{
38213821   0,         /*  4 noise_res (N/C)        */
38223822   0,         /*  5 filter_res (N/C)       */
r1386r1387
38443844};
38453845
38463846
3847static struct SN76477interface invad2ct_p2_sn76477_interface =
3847static const struct SN76477interface invad2ct_p2_sn76477_interface =
38483848{
38493849   0,           /*  4 noise_res (N/C)        */
38503850   0,           /*  5 filter_res (N/C)       */
src/mame/audio/targ.c
r1386r1387
3535};
3636
3737/* waveforms for the audio hardware */
38static INT16 waveform1[32] =
38static const INT16 waveform1[32] =
3939{
4040   /* sine-wave */
4141   0x0F0F, 0x0F0F, 0x0F0F, 0x0606, 0x0606, 0x0909, 0x0909, 0x0606, 0x0606, 0x0909, 0x0606, 0x0D0D, 0x0F0F, 0x0F0F, 0x0D0D, 0x0000,
src/mame/machine/flstory.c
r1386r1387
180180
181181#define VICTNINE_MCU_SEED   (memory_region(REGION_CPU1)[0xE685])
182182
183static UINT8 victnine_mcu_data[0x100] =
183static const UINT8 victnine_mcu_data[0x100] =
184184{
185185   0x3e, 0x08, 0xdd, 0x29, 0xcb, 0x14, 0xfd, 0x29,
186186   0xcb, 0x15, 0xd9, 0x29, 0xd9, 0x30, 0x0d, 0xd9,
src/mame/machine/asteroid.c
r1386r1387
107107   int bitmask;
108108
109109   res=readinputport(1);
110   bitmask = (1 << offset);
110   bitmask = (1 << (offset & 0x7));
111111
112112   if (res & bitmask)
113113      res = 0x80;
r1386r1387
186186
187187   if (avgdvg_done())
188188      res |= 0x01;
189   else
190      res &= ~0x01;
191
189192   if (activecpu_gettotalcycles() & 0x100)
190193      res |= 0x40;
194   else
195      res &= ~0x40;
191196
192197   return res;
193198}
src/mame/machine/leland.c
r1386r1387
676676
677677void leland_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type)
678678{
679   static struct EEPROM_interface eeprom_interface =
679   static const struct EEPROM_interface eeprom_interface =
680680   {
681681      6,
682682      16,
r1386r1387
769769
770770void ataxx_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offset)
771771{
772   static struct EEPROM_interface eeprom_interface =
772   static const struct EEPROM_interface eeprom_interface =
773773   {
774774      7,
775775      16,
src/mame/machine/scramble.c
r1386r1387
288288}
289289
290290
291static ppi8255_interface ppi8255_intf =
291static const ppi8255_interface ppi8255_intf =
292292{
293293   2,                         /* 2 chips */
294294   {input_port_0_r, 0},         /* Port A read */
r1386r1387
300300};
301301
302302/* extra chip for sample latch */
303static ppi8255_interface sfx_ppi8255_intf =
303static const ppi8255_interface sfx_ppi8255_intf =
304304{
305305   3,                            /* 3 chips */
306306   {input_port_0_r, 0, soundlatch2_r},   /* Port A read */
r1386r1387
312312};
313313
314314/* extra chip for sample latch */
315static ppi8255_interface monsterz_ppi8255_intf =
315static const ppi8255_interface monsterz_ppi8255_intf =
316316{
317317   3,                            /* 3 chips */
318318   {input_port_0_r, 0, 0},   /* Port A read */
src/mame/machine/kanekotb.h
r1386r1387
1717// MCU executed command: 4300 0100 - factory settings
1818// this command is issued whenever the nvram settings are corrupted
1919// the MCU writes directly to NVRAM
20static UINT16 bonkadv_mcu_43[] = {
20static const UINT16 bonkadv_mcu_43[] = {
2121   0x8BE0,0x8E71,0x0102,0x0102,0x0300,0x010C,0x0202,0x0202,
2222   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
2323   0x0030,0x0020,0x4F6B,0x0305,0x0000,0x0000,0x0000,0x0000,
r1386r1387
4040200E0E: 7E7F    moveq   #$7f, D7
4141200E10: 4E75    rts
4242*/
43static UINT16 bonkadv_mcu_4_34[] = {
43static const UINT16 bonkadv_mcu_4_34[] = {
4444   0x7071,0x7273,0x7475,0x7677,0x7879,0x7a7b,0x7c7d,0x7e7f,
4545   0x4e75
4646};
4747// MCU executed command: 0400 0180 0032 - 128 bytes at $200180
48static UINT16 bonkadv_mcu_4_32[] = {
48static const UINT16 bonkadv_mcu_4_32[] = {
4949   0x00cc,0xcc0c,0xc0c0,0xc080,0x0484,0xb6a6,0x0404,0x80c0,
5050   0x80b1,0xb1a1,0xa1b2,0xa2b3,0xb3a3,0xa3b1,0xb1b1,0xb1c0,
5151   0xc0a1,0xa1a1,0xa1b2,0xb2a2,0xa290,0x9090,0xb9b9,0xa9a9,
r1386r1387
5656   0xc0c0,0xa1a1,0xa1a1,0xb2b2,0xa2a2,0x9090,0x9000,0x0000
5757};
5858// MCU executed command: 0400 0280 0031 - 112 bytes at $200280
59static UINT16 bonkadv_mcu_4_31[] = {
59static const UINT16 bonkadv_mcu_4_31[] = {
6060   0x1013,0x1411,0x1216,0x1519,0x1a17,0x1824,0x2322,0x211f,
6161   0x201e,0x1d1c,0x1b27,0x2825,0x2629,0x2a2b,0x2e2f,0x2c2d,
6262   0x3130,0x3435,0x3233,0x3f3e,0x3d3c,0x3a3b,0x3938,0x3736,
r1386r1387
6666   0x7071,0x6f6e,0x6d6c,0x7879,0x7677,0x7a7b,0x7c7d,0x7e7f
6767};
6868// MCU executed command: 0400 0E50 0030 - 655 bytes at $200E50 (656 here)
69static UINT16 bonkadv_mcu_4_30[] = {
69static const UINT16 bonkadv_mcu_4_30[] = {
7070   0x8c00,0x9700,0xa000,0xa700,0xb200,0xb700,0xc000,0xcc00,
7171   0xd600,0xdf00,0xef00,0xf500,0xfd00,0x0501,0x0b01,0x1801,
7272   0x1e01,0x2901,0x3101,0x3701,0x4101,0x4901,0x0b01,0x5d01,
r1386r1387
112112   0xff00,0x0005,0x2495,0x96ff,0x0000,0x009a,0xff00,0x0000
113113};
114114// MCU executed command: 0400 0400 0033 - 2560 bytes at $200400
115static UINT16 bonkadv_mcu_4_33[] = {
115static const UINT16 bonkadv_mcu_4_33[] = {
116116   0x00a4,0x0001,0x00a5,0x005a,0x00a6,0x0074,0x00a7,0x009b,
117117   0x00a8,0x00d0,0x00a9,0x00fe,0x00aa,0x015d,0x00ab,0x01b0,
118118   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
r1386r1387
285285};
286286// dynamic, per-level (29), in level order
287287// PC=078896 : MCU executed command: 0400 0300 00xx - xx = subcmd
288static UINT16 bonkadv_mcu_4_00[] = { 0x0000,0x04C0,0x0000,0x0100,0x0600,0x0100 };
289static UINT16 bonkadv_mcu_4_02[] = { 0x0000,0x0760,0x0000,0x0100,0x0270,0x0100,0x0320,0x01B0,
288static const UINT16 bonkadv_mcu_4_00[] = { 0x0000,0x04C0,0x0000,0x0100,0x0600,0x0100 };
289static const UINT16 bonkadv_mcu_4_02[] = { 0x0000,0x0760,0x0000,0x0100,0x0270,0x0100,0x0320,0x01B0,
290290                                     0x0460,0x01B0,0x0510,0x0100,0x05E0,0x0100,0x0620,0x0120,
291291                                     0x08A0,0x0120 };
292static UINT16 bonkadv_mcu_4_01[] = { 0x0000,0x0670,0x0000,0x0100,0x0200,0x0100,0x02E0,0x0090,
292static const UINT16 bonkadv_mcu_4_01[] = { 0x0000,0x0670,0x0000,0x0100,0x0200,0x0100,0x02E0,0x0090,
293293                                     0x0400,0x0090,0x04E0,0x0100,0x07B0,0x0100 };
294static UINT16 bonkadv_mcu_4_05[] = { 0x0000,0x0610,0x0000,0x0100,0x0750,0x0100 };
295static UINT16 bonkadv_mcu_4_07[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 };
296static UINT16 bonkadv_mcu_4_06[] = { 0x0000,0x05F0,0x0000,0x0100,0x0730,0x0100 };
297static UINT16 bonkadv_mcu_4_09[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
298static UINT16 bonkadv_mcu_4_0D[] = { 0x0000,0x07A0,0x0000,0x0100,0x08E0,0x0100 };
299static UINT16 bonkadv_mcu_4_03[] = { 0x0000,0x0920,0x0000,0x0100,0x0A60,0x0100 };
300static UINT16 bonkadv_mcu_4_08[] = { 0x0000,0x0730,0x0000,0x0100,0x0870,0x0100 };
301static UINT16 bonkadv_mcu_4_04[] = { 0x0000,0x05C0,0x0000,0x0100,0x0200,0x0100,0x0280,0x00C0,
294static const UINT16 bonkadv_mcu_4_05[] = { 0x0000,0x0610,0x0000,0x0100,0x0750,0x0100 };
295static const UINT16 bonkadv_mcu_4_07[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 };
296static const UINT16 bonkadv_mcu_4_06[] = { 0x0000,0x05F0,0x0000,0x0100,0x0730,0x0100 };
297static const UINT16 bonkadv_mcu_4_09[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
298static const UINT16 bonkadv_mcu_4_0D[] = { 0x0000,0x07A0,0x0000,0x0100,0x08E0,0x0100 };
299static const UINT16 bonkadv_mcu_4_03[] = { 0x0000,0x0920,0x0000,0x0100,0x0A60,0x0100 };
300static const UINT16 bonkadv_mcu_4_08[] = { 0x0000,0x0730,0x0000,0x0100,0x0870,0x0100 };
301static const UINT16 bonkadv_mcu_4_04[] = { 0x0000,0x05C0,0x0000,0x0100,0x0200,0x0100,0x0280,0x00C0,
302302                                     0x02E0,0x0060,0x03A0,0x0000,0x0700,0x0000 };
303static UINT16 bonkadv_mcu_4_0C[] = { 0x0000,0x06E0,0x0000,0x0100,0x0820,0x0100 };
304static UINT16 bonkadv_mcu_4_0A[] = { 0x0000,0x05A0,0x0000,0x0100,0x06E0,0x0100 };
305static UINT16 bonkadv_mcu_4_0B[] = { 0x0000,0x0470,0x0000,0x0100,0x05B0,0x0100 };
306static UINT16 bonkadv_mcu_4_10[] = { 0x0000,0x06C0,0x0000,0x0100,0x03B0,0x0100,0x0460,0x0050,
303static const UINT16 bonkadv_mcu_4_0C[] = { 0x0000,0x06E0,0x0000,0x0100,0x0820,0x0100 };
304static const UINT16 bonkadv_mcu_4_0A[] = { 0x0000,0x05A0,0x0000,0x0100,0x06E0,0x0100 };
305static const UINT16 bonkadv_mcu_4_0B[] = { 0x0000,0x0470,0x0000,0x0100,0x05B0,0x0100 };
306static const UINT16 bonkadv_mcu_4_10[] = { 0x0000,0x06C0,0x0000,0x0100,0x03B0,0x0100,0x0460,0x0050,
307307                                     0x05E0,0x0050,0x0650,0xFFE0,0x0800,0xFFE0 };
308static UINT16 bonkadv_mcu_4_0E[] = { 0x0000,0x0630,0x0000,0x0100,0x0770,0x0100 };
309static UINT16 bonkadv_mcu_4_13[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
310static UINT16 bonkadv_mcu_4_0F[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
311static UINT16 bonkadv_mcu_4_11[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
312static UINT16 bonkadv_mcu_4_14[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
313static UINT16 bonkadv_mcu_4_12[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
314static UINT16 bonkadv_mcu_4_17[] = { 0x0000,0x0520,0x0000,0x0100,0x0660,0x0100 };
315static UINT16 bonkadv_mcu_4_1A[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 };
316static UINT16 bonkadv_mcu_4_15[] = { 0x0000,0x02C0,0x0000,0x0100,0x0400,0x0100 };
317static UINT16 bonkadv_mcu_4_18[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 };
318static UINT16 bonkadv_mcu_4_16[] = { 0x0000,0x02F0,0x0000,0x0100,0x0430,0x0100 };
319static UINT16 bonkadv_mcu_4_19[] = { 0x0000,0x03A0,0x0000,0x0100,0x04E0,0x0100 };
320static UINT16 bonkadv_mcu_4_1B[] = { 0x0000,0x0460,0x0000,0x0100,0x05A0,0x0100 };
321static UINT16 bonkadv_mcu_4_1C[] = { 0x0000,0x02C0,0x0000,0x0100,0x0400,0x0100 };
308static const UINT16 bonkadv_mcu_4_0E[] = { 0x0000,0x0630,0x0000,0x0100,0x0770,0x0100 };
309static const UINT16 bonkadv_mcu_4_13[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
310static const UINT16 bonkadv_mcu_4_0F[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
311static const UINT16 bonkadv_mcu_4_11[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
312static const UINT16 bonkadv_mcu_4_14[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
313static const UINT16 bonkadv_mcu_4_12[] = { 0x0000,0x05C0,0x0000,0x0100,0x0700,0x0100 };
314static const UINT16 bonkadv_mcu_4_17[] = { 0x0000,0x0520,0x0000,0x0100,0x0660,0x0100 };
315static const UINT16 bonkadv_mcu_4_1A[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 };
316static const UINT16 bonkadv_mcu_4_15[] = { 0x0000,0x02C0,0x0000,0x0100,0x0400,0x0100 };
317static const UINT16 bonkadv_mcu_4_18[] = { 0x0000,0x03C0,0x0000,0x0100,0x0500,0x0100 };
318static const UINT16 bonkadv_mcu_4_16[] = { 0x0000,0x02F0,0x0000,0x0100,0x0430,0x0100 };
319static const UINT16 bonkadv_mcu_4_19[] = { 0x0000,0x03A0,0x0000,0x0100,0x04E0,0x0100 };
320static const UINT16 bonkadv_mcu_4_1B[] = { 0x0000,0x0460,0x0000,0x0100,0x05A0,0x0100 };
321static const UINT16 bonkadv_mcu_4_1C[] = { 0x0000,0x02C0,0x0000,0x0100,0x0400,0x0100 };
322322
323323
324324/***************************************************************************
r1386r1387
336336// fighter: order is unclear - cmd 26 is probably the last (ends with 0xff)
337337
338338// --- unknown data ---
339static UINT16 bloodwar_mcu_4_01[] = { 0x00E6,0x00C6,0x00E8,0x00D0,0xFC9A,0x05C0,0x0F00,0x08C0, // Warrior 1
339static const UINT16 bloodwar_mcu_4_01[] = { 0x00E6,0x00C6,0x00E8,0x00D0,0xFC9A,0x05C0,0x0F00,0x08C0, // Warrior 1
340340                                      0x0001,0x0120,0x0090,0x021B,0x00B4,0x0094,0x00AC,0x0094 };
341static UINT16 bloodwar_mcu_4_02[] = { 0x00B4,0x0094,0x00AC,0x0094,0xFCD2,0x03C0,0x1000,0x0900, // Warrior 2
341static const UINT16 bloodwar_mcu_4_02[] = { 0x00B4,0x0094,0x00AC,0x0094,0xFCD2,0x03C0,0x1000,0x0900, // Warrior 2
342342                                      0x0001,0x0100,0x0080,0x0118,0x00F0,0x00D0,0x00F4,0x00DC };
343static UINT16 bloodwar_mcu_4_03[] = { 0x00F0,0x00D0,0x00F4,0x00DC,0xFC90,0x03C0,0x0C00,0x0CC0, // Warrior 3
343static const UINT16 bloodwar_mcu_4_03[] = { 0x00F0,0x00D0,0x00F4,0x00DC,0xFC90,0x03C0,0x0C00,0x0CC0, // Warrior 3
344344                                      0x0001,0x0200,0x0100,0x0930,0x00D2,0x00B2,0x00CA,0x00B0 };
345static UINT16 bloodwar_mcu_4_04[] = { 0x00D2,0x00B2,0x00CA,0x00B0,0xFCB5,0x05C0,0x1000,0x0C00, // Warrior 4
345static const UINT16 bloodwar_mcu_4_04[] = { 0x00D2,0x00B2,0x00CA,0x00B0,0xFCB5,0x05C0,0x1000,0x0C00, // Warrior 4
346346                                      0x0001,0x0140,0x00A0,0x031E,0x00A0,0x0080,0x00DC,0x00C4 };
347static UINT16 bloodwar_mcu_4_05[] = { 0x00A0,0x0080,0x00DC,0x00C4,0xFCA2,0x05C0,0x0AC0,0x0880, // Warrior 5
347static const UINT16 bloodwar_mcu_4_05[] = { 0x00A0,0x0080,0x00DC,0x00C4,0xFCA2,0x05C0,0x0AC0,0x0880, // Warrior 5
348348                                      0x0001,0x01A0,0x00D0,0x0627,0x00BE,0x009E,0x00C2,0x00A8 };
349static UINT16 bloodwar_mcu_4_06[] = { 0x00BE,0x009E,0x00C2,0x00A8,0xFCBF,0x04C0,0x1100,0x0C00, // Warrior 6
349static const UINT16 bloodwar_mcu_4_06[] = { 0x00BE,0x009E,0x00C2,0x00A8,0xFCBF,0x04C0,0x1100,0x0C00, // Warrior 6
350350                                      0x0001,0x0180,0x00C0,0x0524,0x00C8,0x00A8,0x00D6,0x009C };
351static UINT16 bloodwar_mcu_4_07[] = { 0x00C8,0x00A8,0x00D6,0x009C,0xFCC8,0x05C0,0x0F40,0x0CC0, // Warrior 7
351static const UINT16 bloodwar_mcu_4_07[] = { 0x00C8,0x00A8,0x00D6,0x009C,0xFCC8,0x05C0,0x0F40,0x0CC0, // Warrior 7
352352                                      0x0001,0x0160,0x00B0,0x0421,0x00AA,0x008A,0x00A0,0x0086 };
353static UINT16 bloodwar_mcu_4_08[] = { 0x00AA,0x008A,0x00A0,0x0086,0xFCDB,0x05C0,0x1380,0x0F80, // Warrior 8
353static const UINT16 bloodwar_mcu_4_08[] = { 0x00AA,0x008A,0x00A0,0x0086,0xFCDB,0x05C0,0x1380,0x0F80, // Warrior 8
354354                                      0x0000,0x01E0,0x00F0,0x082D,0x00DC,0x00BC,0x00D6,0x00BC };
355static UINT16 bloodwar_mcu_4_09[] = { 0x00DC,0x00BC,0x00D6,0x00BC,0xFCAC,0x04C0,0x10C0,0x1000, // Warrior 9
355static const UINT16 bloodwar_mcu_4_09[] = { 0x00DC,0x00BC,0x00D6,0x00BC,0xFCAC,0x04C0,0x10C0,0x1000, // Warrior 9
356356                                      0x0001,0x01C0,0x00E0,0x072A,0xFF08,0xFF02,0x0000,0xFF03 };
357357
358358// --- palette data ---
359359//  number of palettes (>=1)
360360//  palette data follows (each palette is 0x200 bytes long)
361361//  a negative word will end the palette
362static UINT16 bloodwar_mcu_4_0a[] = { // Warrior 1 Player 1
362static const UINT16 bloodwar_mcu_4_0a[] = { // Warrior 1 Player 1
363363   0x000B,0x0000,0x4232,0x56F8,0x2D8D,0x27FF,0x3BFF,0x53FF,
364364   0x63FF,0x381F,0x4C1F,0x581F,0x6C1F,0x7C1F,0x7E1F,0x7EBF,
365365   0x7BDE,0x2DAF,0x296E,0x298E,0x29AE,0x2DAE,0x31CF,0x31D0,
r1386r1387
544544   0x2340,0x2B60,0x3380,0x3FA0,0x47A0,0x4FC1,0x5BC0,0x67E2,
545545   0x6FE4,0x77E6,0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x000B
546546};
547static UINT16 bloodwar_mcu_4_0b[] = { // Warrior 1 Player 2
547static const UINT16 bloodwar_mcu_4_0b[] = { // Warrior 1 Player 2
548548   0x000B,0x292A,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
549549   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
550550   0x7BDE,0x2E2A,0x29E9,0x2609,0x29E9,0x2629,0x2A4A,0x2A4B,
r1386r1387
729729   0x2340,0x2B60,0x3380,0x3FA0,0x47A0,0x4FC1,0x5BC0,0x67E2,
730730   0x6FE4,0x77E6,0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x0004
731731};
732static UINT16 bloodwar_mcu_4_0c[] = { // Warrior 5 Player 1
732static const UINT16 bloodwar_mcu_4_0c[] = { // Warrior 5 Player 1
733733   0x0004,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
734734   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
735735   0x7BDE,0x1422,0x1423,0x2044,0x1803,0x1C23,0x2CA6,0x2445,
r1386r1387
810810   0x270A,0x32F1,0x2EAB,0x3BCF,0x3BD2,0x4BEE,0x53F6,0x5B94,
811811   0x6BB5,0x6FFB,0x7BDE,0xFFFF,0x0004,0x0000,0x4232,0x56F8
812812};
813static UINT16 bloodwar_mcu_4_0d[] = { // Warrior 5 Player 2
813static const UINT16 bloodwar_mcu_4_0d[] = { // Warrior 5 Player 2
814814   0x0004,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
815815   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
816816   0x7BDE,0x0C29,0x0C2A,0x184B,0x100A,0x142A,0x24AD,0x1C4C,
r1386r1387
891891   0x270A,0x32F1,0x2EAB,0x3BCF,0x3BD2,0x4BEE,0x53F6,0x5B94,
892892   0x6BB5,0x6FFB,0x7BDE,0xFFFF,0x0005,0x40CE,0x4232,0x56F8
893893};
894static UINT16 bloodwar_mcu_4_0e[] = { // Warrior 4 Player 2
894static const UINT16 bloodwar_mcu_4_0e[] = { // Warrior 4 Player 2
895895   0x0005,0x40CE,0x4232,0x56F8,0x2D8D,0x1D08,0x254A,0x2D8C,
896896   0x35CE,0x3E10,0x4652,0x4E94,0x56D6,0x5F18,0x675A,0x6F9C,
897897   0x7BDE,0x7BF9,0x6FF5,0x6BD4,0x63F1,0x538D,0x63F2,0x57EE,
r1386r1387
934934   0x4340,0x4760,0x4F80,0x57A1,0x5BC0,0x67E2,0x6FE4,0x77E6,
935935   0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x0005,0x40CE,0x4232
936936};
937static UINT16 bloodwar_mcu_4_0f[] = { // Warrior 4 Player 1
937static const UINT16 bloodwar_mcu_4_0f[] = { // Warrior 4 Player 1
938938   0x0005,0x40CE,0x4232,0x56F8,0x2D8D,0x20E9,0x292B,0x316D,
939939   0x39AF,0x41F1,0x4A33,0x5275,0x5AB7,0x62F9,0x6B3B,0x737D,
940940   0x7BDF,0x7FFA,0x73F6,0x6FF5,0x67F2,0x57CE,0x67F3,0x5BEF,
r1386r1387
977977   0x4340,0x4760,0x4F80,0x57A1,0x5BC0,0x67E2,0x6FE4,0x77E6,
978978   0x7BEF,0x7FF4,0x7FFB,0x7BDE,0xFFFF,0x0009,0x0000,0x4232
979979};
980static UINT16 bloodwar_mcu_4_10[] = { // Warrior 6 Player 1
980static const UINT16 bloodwar_mcu_4_10[] = { // Warrior 6 Player 1
981981   0x0009,0x0000,0x4232,0x56F8,0x2D8D,0x27FF,0x3BFF,0x53FF,
982982   0x63FF,0x401E,0x4C1F,0x581F,0x6C1F,0x7C1F,0x7E1F,0x7EBF,
983983   0x7BDE,0x4BCD,0x47EC,0x43CA,0x3BC8,0x2F45,0x2703,0x22E2,
r1386r1387
10461046   0x7C00,0x7C05,0x780A,0x7C0F,0x7C14,0x7C19,0x7C1F,0x7BDE,
10471047   0xFFFF,0x0009,0x0000,0x4232,0x56F8,0x2D8D,0x6C1F,0x7C1F
10481048};
1049static UINT16 bloodwar_mcu_4_11[] = { // Warrior 6 Player 2
1049static const UINT16 bloodwar_mcu_4_11[] = { // Warrior 6 Player 2
10501050   0x0009,0x0000,0x4232,0x56F8,0x2D8D,0x6C1F,0x7C1F,0x7E1F,
10511051   0x7EBF,0x5C13,0x5C52,0x6432,0x7075,0x7992,0x7DF6,0x7EF9,
10521052   0x7BDE,0x52F2,0x4F11,0x4AEF,0x42CD,0x368A,0x2E48,0x2A27,
r1386r1387
11151115   0x7C00,0x7C05,0x780A,0x7C0F,0x7C14,0x7C19,0x7C1F,0x7BDE,
11161116   0xFFFF,0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A
11171117};
1118static UINT16 bloodwar_mcu_4_12[] = { // Warrior 9 Player 1
1118static const UINT16 bloodwar_mcu_4_12[] = { // Warrior 9 Player 1
11191119   0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
11201120   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
11211121   0x7BDE,0x1AC2,0x1AE2,0x1B02,0x1703,0x1723,0x1743,0x1763,
r1386r1387
11751175   0x7FB6,0x7FB7,0x7FB8,0x7FB9,0x7FBF,0x7FBB,0x7FFF,0x7FFF,
11761176   0x0000,0xFFFF,0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108
11771177};
1178static UINT16 bloodwar_mcu_4_13[] = { // Warrior 9 Player 2
1178static const UINT16 bloodwar_mcu_4_13[] = { // Warrior 9 Player 2
11791179   0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
11801180   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
11811181   0x7BDE,0x146D,0x1CAF,0x24EF,0x24EF,0x2910,0x3553,0x3DB7,
r1386r1387
12351235   0x7FB6,0x7FB7,0x7FB8,0x7FB9,0x7FBF,0x7FBB,0x7FFF,0x7FFF,
12361236   0x0000,0xFFFF,0x0006,0x0000,0x4232,0x56F8,0x2D8D,0x2108
12371237};
1238static UINT16 bloodwar_mcu_4_14[] = { // Warrior 7 Player 1
1238static const UINT16 bloodwar_mcu_4_14[] = { // Warrior 7 Player 1
12391239   0x0006,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
12401240   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
12411241   0x7BDE,0x0D00,0x0D00,0x0D40,0x0D40,0x0D60,0x0D80,0x1140,
r1386r1387
13761376   0x77E2,0x77E4,0x77E6,0x77E8,0x7BEA,0x7BED,0x7BF0,0x7BF3,
13771377   0x7BF6,0x7BF9,0x7BFB,0x7FFF,0x0000,0xFFFF,0x0006,0x3CB1
13781378};
1379static UINT16 bloodwar_mcu_4_15[] = { // Warrior 7 Player 2
1379static const UINT16 bloodwar_mcu_4_15[] = { // Warrior 7 Player 2
13801380   0x0006,0x3CB1,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
13811381   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
13821382   0x7BDE,0x1CCB,0x1049,0x184A,0x18E9,0x1CAA,0x1C4C,0x20AE,
r1386r1387
15171517   0x77E2,0x77E4,0x77E6,0x77E8,0x7BEA,0x7BED,0x7BF0,0x7BF3,
15181518   0x7BF6,0x7BF9,0x7BFB,0x7FFF,0x0000,0xFFFF,0x0002,0x0000
15191519};
1520static UINT16 bloodwar_mcu_4_16[] = { // Warrior 8 Player 1
1520static const UINT16 bloodwar_mcu_4_16[] = { // Warrior 8 Player 1
15211521   0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
15221522   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
15231523   0x7BDE,0x29A9,0x2DCA,0x31EB,0x360C,0x3A0D,0x3A2D,0x3A4D,
r1386r1387
15541554
15551555   0x7BDE,0xFFFF,0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108
15561556};
1557static UINT16 bloodwar_mcu_4_17[] = { // Warrior 8 Player 2
1557static const UINT16 bloodwar_mcu_4_17[] = { // Warrior 8 Player 2
15581558   0x0002,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
15591559   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
15601560   0x7BDE,0x296A,0x2D8B,0x31AC,0x35CD,0x35EF,0x39F0,0x3A10,
r1386r1387
15911591
15921592   0x7BDE,0xFFFF,0x0003,0x0000,0x4232,0x56F8,0x2D8D,0x2108
15931593};
1594static UINT16 bloodwar_mcu_4_18[] = { // Warrior 2 Player 2
1594static const UINT16 bloodwar_mcu_4_18[] = { // Warrior 2 Player 2
15951595   0x0003,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
15961596   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
15971597   0x7BDE,0x1524,0x0CC2,0x0CE2,0x0CE3,0x10E3,0x1103,0x14E3,
r1386r1387
16511651   0x294A,0x318C,0x39CE,0x03A0,0x23E0,0x37E0,0x3FE0,0x4FE0,
16521652   0x67ED,0x77EE,0x7FFF,0xFFFF,0x0003,0x0000,0x4232,0x56F8
16531653};
1654static UINT16 bloodwar_mcu_4_19[] = { // Warrior 2 Player 1
1654static const UINT16 bloodwar_mcu_4_19[] = { // Warrior 2 Player 1
16551655   0x0003,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
16561656   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
16571657   0x7BDE,0x1524,0x0CC2,0x0CE2,0x0CE3,0x10E3,0x1103,0x14E3,
r1386r1387
17111711   0x294A,0x318C,0x39CE,0x03A0,0x23E0,0x37E0,0x3FE0,0x4FE0,
17121712   0x67ED,0x77EE,0x7FFF,0xFFFF,0x0005,0x0000,0x4232,0x56F8
17131713};
1714static UINT16 bloodwar_mcu_4_1a[] = { // Warrior 3 Player 1
1714static const UINT16 bloodwar_mcu_4_1a[] = { // Warrior 3 Player 1
17151715   0x0005,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
17161716   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
17171717   0x7BDE,0x08A0,0x0D02,0x1142,0x19C2,0x3EEB,0x430D,0x4B6C,
r1386r1387
18391839   0x0192,0x0194,0x0195,0x2597,0x2998,0x3599,0x3D99,0x0195,
18401840   0x0999,0x1199,0x21CF,0x25D4,0xFFFF,0x0005,0x0000,0x4232
18411841};
1842static UINT16 bloodwar_mcu_4_1b[] = { // Warrior 3 Player 2
1842static const UINT16 bloodwar_mcu_4_1b[] = { // Warrior 3 Player 2
18431843   0x0005,0x0000,0x4232,0x56F8,0x2D8D,0x2108,0x294A,0x318C,
18441844   0x39CE,0x4210,0x4A52,0x5294,0x5AD6,0x6318,0x6B5A,0x739C,
18451845   0x7BDE,0x08A0,0x0D02,0x1142,0x19C2,0x3EEB,0x430D,0x4B6C,
r1386r1387
19701970
19711971// --- tilemap data ---
19721972//  tile data (ff means no tiles) followed by routine index (end marker: 0xff00)
1973static UINT16 bloodwar_mcu_4_1c[] = { // Warrior 8
1973static const UINT16 bloodwar_mcu_4_1c[] = { // Warrior 8
19741974   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0D00,0xFF06,
19751975   0x01BF,0xFF06,0x00FF,0xFF06,0x0008,0x2C01,0xFF06,0x0001,
19761976   0xFF05,0x0002,0x2C02,0xFF06,0x0001,0xFF05,0x0002,0x2C55,
r1386r1387
20332033   0x000A,0x38BD,0xFF06,0x0004,0xFF06,0x000E,0xFF05,0x000A,
20342034   0x38C9,0xFF06,0x0004,0xFF06,0x00BF,0xFF00,0xFF08,0xFF02
20352035};
2036static UINT16 bloodwar_mcu_4_1d[] = { // Warrior 2
2036static const UINT16 bloodwar_mcu_4_1d[] = { // Warrior 2
20372037   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0000,0xFF06,
20382038   0x01BF,0xFF06,0x0003,0x4401,0xFF06,0x0002,0x4401,0xFF05,
20392039   0x0001,0x340B,0xFF06,0x0000,0x4401,0xFF06,0x0005,0xFF04,
r1386r1387
21802180   0xFF05,0x0007,0x2070,0xFF06,0x0003,0xFF06,0x009F,0xFF00,
21812181   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0200,0xFF06
21822182};
2183static UINT16 bloodwar_mcu_4_1e[] = { // Warrior 3
2183static const UINT16 bloodwar_mcu_4_1e[] = { // Warrior 3
21842184   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0200,0xFF06,
21852185   0x01BF,0xFF05,0x000F,0x2C01,0xFF05,0x000F,0x2C01,0xFF05,
21862186   0x000F,0x2C11,0xFF05,0x000F,0x2C11,0xFF05,0x0001,0x3C27,
r1386r1387
23192319
23202320   0x007F,0xFF00,0xFF08,0xFF02,0x0000,0xFF03,0x0200,0xFF01
23212321};
2322static UINT16 bloodwar_mcu_4_1f[] = { // Warrior 5
2322static const UINT16 bloodwar_mcu_4_1f[] = { // Warrior 5
23232323   0xFF08,0xFF02,0x0000,0xFF03,0x0200,0xFF01,0x0800,0xFF06,
23242324   0x01BF,0xFF06,0x007F,0xFF06,0x0009,0xFF05,0x0002,0x2801,
23252325   0xFF05,0x0004,0x3429,0xFF06,0x0000,0xFF05,0x0002,0x342E,
r1386r1387
24022402   0xFF05,0x0001,0x2C6B,0x2C6A,0xFF06,0x000C,0xFF05,0x0001,
24032403   0x2C6B,0x2C6A,0xFF06,0x0006,0xFF06,0x003F,0xFF00,0xFF08
24042404};
2405static UINT16 bloodwar_mcu_4_20[] = { // Warrior 4
2405static const UINT16 bloodwar_mcu_4_20[] = { // Warrior 4
24062406   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x1100,0xFF06,
24072407   0x01BF,0xFF06,0x00DF,0xFF06,0x0001,0xFF04,0x0002,0xFF09,
24082408   0x0001,0x2402,0xFF04,0x0000,0xFF06,0x0017,0xFF05,0x0001,
r1386r1387
24772477   0x2111,0xFF05,0x000F,0x2111,0xFF05,0x000F,0x2121,0xFF05,
24782478   0x000F,0x2121,0xFF06,0x013F,0xFF00,0xFF08,0xFF02,0x0000
24792479};
2480static UINT16 bloodwar_mcu_4_21[] = { // Warrior 6
2480static const UINT16 bloodwar_mcu_4_21[] = { // Warrior 6
24812481   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0F00,0xFF06,
24822482   0x01BF,0xFF06,0x005F,0xFF06,0x000F,0x4401,0xFF06,0x000E,
24832483   0xFF06,0x000C,0xFF05,0x0005,0x4402,0xFF06,0x000C,0xFF06,
r1386r1387
26412641   0x30EF,0xFF05,0x000F,0x3141,0xFF05,0x000F,0x3101,0xFF05,
26422642   0x000F,0x3151,0xFF05,0x000F,0x3111,0xFF00,0xFF08,0xFF02
26432643};
2644static UINT16 bloodwar_mcu_4_22[] = { // Warrior 1
2644static const UINT16 bloodwar_mcu_4_22[] = { // Warrior 1
26452645   0xFF08,0xFF02,0x0000,0xFF03,0x0300,0xFF01,0x0B00,0xFF06,
26462646   0x01BF,0xFF06,0x0001,0x3401,0xFF06,0x0000,0xFF05,0x0002,
26472647   0x3402,0xFF06,0x0010,0xFF05,0x0001,0x3440,0xFF06,0x0001,
r1386r1387
27642764   0x0005,0xFF05,0x0006,0x2CF7,0xFF06,0x0008,0xFF05,0x0006,
27652765   0x2CF7,0xFF06,0x0002,0xFF06,0x007F,0xFF00,0xFF08,0xFF02
27662766};
2767static UINT16 bloodwar_mcu_4_23[] = { // Warrior 9
2767static const UINT16 bloodwar_mcu_4_23[] = { // Warrior 9
27682768   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0A00,0xFF06,
27692769   0x01BF,0xFF06,0x0006,0xFF05,0x0001,0x3C88,0xFF06,0x0005,
27702770   0xFF05,0x0001,0x4001,0xFF06,0x0005,0xFF04,0x0002,0xFF09,
r1386r1387
29262926   0xFF05,0x0007,0x2881,0xFF05,0x0007,0x2881,0xFF05,0x0007,
29272927   0x2881,0xFF05,0x0007,0x2881,0xFF06,0x007F,0xFF00,0xFF08
29282928};
2929static UINT16 bloodwar_mcu_4_24[] = { // Warrior 7
2929static const UINT16 bloodwar_mcu_4_24[] = { // Warrior 7
29302930   0xFF08,0xFF02,0x0000,0xFF03,0x0400,0xFF01,0x0300,0xFF06,
29312931   0x01BF,0xFF06,0x0000,0x3402,0xFF05,0x0005,0x4C14,0x3402,
29322932   0xFF05,0x0006,0x4C14,0xFF05,0x0006,0x4C14,0xFF04,0x0002,
r1386r1387
30413041};
30423042
30433043// --- fighter data: pointers to ROM ---
3044static UINT16 bloodwar_mcu_4_25[] = { // Warrior 1
3044static const UINT16 bloodwar_mcu_4_25[] = { // Warrior 1
30453045   0x0007,0x2B72,0x0007,0x2B9E,0x0007,0x2C52,0x0007,0x2D36,
30463046   0x0007,0x3584,0x0007,0x2E3A,0x0007,0x2E54,0x0007,0x2E74,
30473047   0x0007,0x2F28,0x0007,0x3022,0x0007,0x35A0,0x0007,0x377C,
r1386r1387
31133113   0x0007,0x862A,0x0007,0x8644,0x0007,0x869C,0x0007,0x86A6,
31143114   0x0007,0xCC3C,0x0007,0xCC68,0x0007,0xCD1C,0x0007,0xCD9A
31153115};
3116static UINT16 bloodwar_mcu_4_26[] = { // Warrior 2
3116static const UINT16 bloodwar_mcu_4_26[] = { // Warrior 2
31173117   0x000B,0xB188,0x000B,0xB1C0,0x000B,0xB308,0x000B,0xB590,
31183118   0x000B,0xCF38,0x000B,0xBA00,0x000B,0xBA1A,0x000B,0xBA3A,
31193119   0x000B,0xBE62,0x000B,0xC4AA,0x000B,0xCF54,0x000B,0xD130,
r1386r1387
31813181   0x000C,0x1F4A,0x000C,0x1F5E,0x000C,0x1FC2,0x000C,0x1FCC,
31823182   0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF
31833183};
3184static UINT16 bloodwar_mcu_4_27[] = { // Warrior 3
3184static const UINT16 bloodwar_mcu_4_27[] = { // Warrior 3
31853185   0x0008,0x631C,0x0008,0x6348,0x0008,0x63EC,0x0008,0x6494,
31863186   0x0008,0x6C5C,0x0008,0x6598,0x0008,0x65B2,0x0008,0x65D2,
31873187   0x0008,0x6676,0x0008,0x674A,0x0008,0x6C78,0x0008,0x6E54,
r1386r1387
32543254   0x0008,0xB786,0x0008,0xB8F0,0x0008,0xB912,0x0008,0xB93A,
32553255   0x0008,0xF128,0x0008,0xF148,0x0008,0xF1EC,0x0008,0xF2AA
32563256};
3257static UINT16 bloodwar_mcu_4_28[] = { // Warrior 4
3257static const UINT16 bloodwar_mcu_4_28[] = { // Warrior 4
32583258   0x0008,0xF128,0x0008,0xF148,0x0008,0xF1EC,0x0008,0xF2AA,
32593259   0x0008,0xFA80,0x0008,0xF3AA,0x0008,0xF3C4,0x0008,0xF3E4,
32603260   0x0008,0xF4A8,0x0008,0xF56C,0x0008,0xFA9C,0x0008,0xFC78,
r1386r1387
33253325
33263326   0x0009,0x4A2A,0x0009,0x81A8,0x0009,0x81C8,0x0009,0x8270
33273327};
3328static UINT16 bloodwar_mcu_4_29[] = { // Warrior 5
3328static const UINT16 bloodwar_mcu_4_29[] = { // Warrior 5
33293329   0x0007,0xCC3C,0x0007,0xCC68,0x0007,0xCD1C,0x0007,0xCD9A,
33303330   0x0007,0xD616,0x0007,0xCE38,0x0007,0xCE52,0x0007,0xCE72,
33313331   0x0007,0xCF16,0x0007,0xCFAA,0x0007,0xD632,0x0007,0xD80E,
r1386r1387
33963396
33973397   0x0008,0x1E9A,0x0008,0x1EAC,0x0008,0x631C,0x0008,0x6348
33983398};
3399static UINT16 bloodwar_mcu_4_2a[] = { // Warrior 6
3399static const UINT16 bloodwar_mcu_4_2a[] = { // Warrior 6
34003400   0x000A,0x0E3C,0x000A,0x0E5C,0x000A,0x0F00,0x000A,0x0FA8,
34013401   0x000A,0x16E2,0x000A,0x105C,0x000A,0x1076,0x000A,0x1096,
34023402   0x000A,0x113A,0x000A,0x11DE,0x000A,0x16FE,0x000A,0x18DA,
r1386r1387
34653465   0x000A,0x62DA,0x000A,0x62A0,0x000A,0x62B4,0x000A,0x631E,
34663466   0x000A,0x6338,0x000A,0x94A4,0x000A,0x94C4,0x000A,0x9568
34673467};
3468static UINT16 bloodwar_mcu_4_2b[] = { // Warrior 7
3468static const UINT16 bloodwar_mcu_4_2b[] = { // Warrior 7
34693469   0x000A,0x94A4,0x000A,0x94C4,0x000A,0x9568,0x000A,0x9646,
34703470   0x000A,0x9DFC,0x000A,0x9746,0x000A,0x9760,0x000A,0x9780,
34713471   0x000A,0x9824,0x000A,0x98C8,0x000A,0x9E18,0x000A,0x9FF4,
r1386r1387
35333533   0x000A,0xF31E,0x000A,0xF344,0x000A,0xF39C,0x000A,0xF3A6,
35343534   0x000B,0x272C,0x000B,0x274C,0x000B,0x284C,0x000B,0x2924
35353535};
3536static UINT16 bloodwar_mcu_4_2c[] = { // Warrior 8
3536static const UINT16 bloodwar_mcu_4_2c[] = { // Warrior 8
35373537   0x000B,0x272C,0x000B,0x274C,0x000B,0x284C,0x000B,0x2924,
35383538   0x000B,0x3242,0x000B,0x2A0E,0x000B,0x2A28,0x000B,0x2A48,
35393539   0x000B,0x2B4C,0x000B,0x2C1A,0x000B,0x325E,0x000B,0x343A,
r1386r1387
36023602   0x000B,0x80C8,0x000B,0x808E,0x000B,0x80A2,0x000B,0x811C,
36033603   0x000B,0x813E,0x000B,0xB188,0x000B,0xB1C0,0x000B,0xB308
36043604};
3605static UINT16 bloodwar_mcu_4_2d[] = { // Warrior 9
3605static const UINT16 bloodwar_mcu_4_2d[] = { // Warrior 9
36063606   0x0009,0x81A8,0x0009,0x81C8,0x0009,0x8270,0x0009,0x8328,
36073607   0x0009,0x8A98,0x0009,0x8416,0x0009,0x8430,0x0009,0x8450,
36083608   0x0009,0x84E8,0x0009,0x8580,0x0009,0x8AB4,0x0009,0x8C90,
src/mame/machine/chaknpop.c
r1386r1387
1717
1818/* mcu data that is extracted from the real board! */
1919/* updated on 2st Jun 2003 */
20static UINT8 mcu_data[256] = {
20static const UINT8 mcu_data[256] = {
2121   0x3a, 0xe6, 0x80, 0xc6, 0x0e, 0xdd, 0x77, 0xfd,
2222   0x7e, 0xfe, 0x10, 0x38, 0x10, 0xdd, 0x7e, 0x03,
2323   0xc6, 0x08, 0xdd, 0x77, 0x03, 0xdd, 0x7e, 0xff,
src/mame/machine/steppers.c
r1386r1387
346346   0, //0001->0110 1->6
347347   0, //0001->0111 1->7
348348   0, //0001->1000 1->8
349   -1, //0001->1001 1->9
349   -1,//0001->1001 1->9
350350   0, //0001->1010 1->A
351351   0, //0001->1011 1->B
352352   0, //0001->1100 1->C
r1386r1387
357357   0, //0010->0000 2->0
358358   0, //0010->0001 2->1
359359   0, //0010->0010 2->2
360   -1, //0010->0011 2->3
360   -1,//0010->0011 2->3
361361   0, //0010->0100 2->4
362362   0, //0010->0101 2->5
363363   1, //0010->0110 2->6
364364   0, //0010->0111 2->7
365   0,//0010->1000 2->8
365   0, //0010->1000 2->8
366366   0, //0010->1001 2->9
367   0,//0010->1010 2->A
367   0, //0010->1010 2->A
368368   0, //0010->1011 2->B
369369   0, //0010->1100 2->C
370370   0, //0010->1101 2->D
r1386r1387
372372   0, //0010->1111 2->F
373373
374374   0, //0011->0000 3->0
375   -1, //0011->0001 3->1
375   -1,//0011->0001 3->1
376376   1, //0011->0010 3->2
377377   0, //0011->0011 3->3
378378   0, //0011->0100 3->4
r1386r1387
380380   2, //0011->0110 3->6
381381   0, //0011->0111 3->7
382382   0, //0011->1000 3->8
383   -2, //0011->1001 3->9
383   -2,//0011->1001 3->9
384384   0, //0011->1010 3->A
385385   0, //0011->1011 3->B
386386   0, //0011->1100 3->C
r1386r1387
390390
391391   0, //0100->0000 4->0
392392   0, //0100->0001 4->1
393   0,//0100->0010 4->2
393   0, //0100->0010 4->2
394394   0, //0100->0011 4->3
395395   0, //0100->0100 4->4
396396   0, //0100->0101 4->5
r1386r1387
409409   0, //0101->0001 5->1
410410   0, //0101->0010 5->2
411411   0, //0101->0011 5->3
412   0,//0101->0100 5->4
412   0, //0101->0100 5->4
413413   0, //0101->0101 5->5
414   0,//0101->0110 5->6
414   0, //0101->0110 5->6
415415   0, //0101->0111 5->7
416416   0, //0101->1000 5->8
417417   0, //0101->1001 5->9
r1386r1387
432432   0, //0110->0111 6->7
433433   0, //0110->1000 6->8
434434   0, //0110->1001 6->9
435   0,//0110->1010 6->A
435   0, //0110->1010 6->A
436436   0, //0110->1011 6->B
437437   2, //0110->1100 6->C
438438   0, //0110->1101 6->D
r1386r1387
457457   0, //0111->1111 7->F
458458
459459   0, //1000->0000 8->0
460   0,//1000->0001 8->1
460   0, //1000->0001 8->1
461461   0, //1000->0010 8->2
462462   0, //1000->0011 8->3
463463   0, //1000->0100 8->4
r1386r1387
468468   1, //1000->1001 8->9
469469   0, //1000->1010 8->A
470470   0, //1000->1011 8->B
471   -1, //1000->1100 8->C
471   -1,//1000->1100 8->C
472472   0, //1000->1101 8->D
473473   0, //1000->1110 8->E
474474   0, //1000->1111 8->F
r1386r1387
478478   0, //1001->0010 9->2
479479   2, //1001->0011 9->3
480480   0, //1001->0100 9->4
481   0,//1001->0101 9->5
481   0, //1001->0101 9->5
482482   0, //1001->0110 9->6
483483   0, //1001->0111 9->7
484   -1, //1001->1000 9->8
484   -1,//1001->1000 9->8
485485   0, //1001->1001 9->9
486486   0, //1001->1010 9->A
487487   0, //1001->1011 9->B
488   -2, //1001->1100 9->C
488   -2,//1001->1100 9->C
489489   0, //1001->1101 9->D
490490   0, //1001->1110 9->E
491491   0, //1001->1111 9->F
r1386r1387
498498   0, //1010->0101 A->5
499499   0, //1010->0110 A->6
500500   0, //1010->0111 A->7
501   0,//1010->1000 A->8
502   0,//1010->1001 A->9
501   0, //1010->1000 A->8
502   0, //1010->1001 A->9
503503   0, //1010->1010 A->A
504504   0, //1010->1011 A->B
505505   0, //1010->1100 A->C
r1386r1387
528528   0, //1100->0001 C->1
529529   0, //1100->0010 C->2
530530   0, //1100->0011 C->3
531   -1, //1100->0100 C->4
531   -1,//1100->0100 C->4
532532   0, //1100->0101 C->5
533   -2, //1100->0110 C->6
533   -2,//1100->0110 C->6
534534   0, //1100->0111 C->7
535535   1, //1100->1000 C->8
536536   2, //1100->1001 C->9
r1386r1387
605605      steppers[id].pattern     = 0;
606606      steppers[id].old_pattern = 0;
607607      steppers[id].step_pos    = 0;
608      steppers[id].max_steps   = (48*2)-1;
608      steppers[id].max_steps   = (48*2);
609609      steppers[id].type       = type;
610610
611611      switch ( steppers[id].type )
612612      {
613         case STEPPER_48STEP_REEL :     // STARPOINT RMxxx
613         case STARPOINT_48STEP_REEL :  // STARPOINT RMxxx
614614         break;
615         case BARCREST_48STEP_REEL :     // Barcrest reel units have different coil windings
616         steppers[id].index_pos   = 0;
617         steppers[id].index_len   = 16;
618         steppers[id].index_patt  = 0x09;
615         case BARCREST_48STEP_REEL :     // Barcrest reel units have different coil windings and optic tabs
616         Stepper_set_index(id,0,16,0x09);
619617         break;
620         case STEPPER_144STEPS_DICE :  // STARPOINT 1DCU DICE mechanism
621         steppers[id].max_steps = (144*2)-1;
618         case STARPOINT_144STEPS_DICE :// STARPOINT 1DCU DICE mechanism
619         steppers[id].max_steps = (144*2);
622620         break;
623621      }
624622      state_save_register_item("Stepper", id, steppers[id].index_pos);
r1386r1387
636634void Stepper_set_index(int id,int position,int length,int pattern)
637635{
638636   steppers[id].index_pos   = position;//location of first index value in half steps
639   steppers[id].index_len   = length;//number of half steps the index lasts
640   steppers[id].index_patt  = pattern;//hex value of coil pattern
637   steppers[id].index_len   = length;  //number of half steps the index lasts
638   steppers[id].index_patt  = pattern; //hex value of coil pattern
641639}
642640
643641int Stepper_get_position(int id)
r1386r1387
719717      switch ( steppers[id].type )
720718      {
721719         default:
722         case STEPPER_48STEP_REEL :     // STARPOINT RMxxx
723         case STEPPER_144STEPS_DICE :  // STARPOINT 1DCU DICE mechanism
720         case STARPOINT_48STEP_REEL :   // STARPOINT RMxxx
721         case STARPOINT_144STEPS_DICE :  // STARPOINT 1DCU DICE mechanism
724722         steps = StarpointStepTab[ index ];
725723         break;
726         case BARCREST_48STEP_REEL :     // Barcrest reel units have different optics
724         case BARCREST_48STEP_REEL :       // Barcrest reel units have different windings
727725         steps = BarcrestStepTab[ index ];
728726         break;
729727      }
src/mame/machine/steppers.h
r1386r1387
1818#ifndef INC_STEPPERS
1919#define INC_STEPPERS
2020
21#define MAX_STEPPERS        16         // maximum number of steppers
21#define MAX_STEPPERS          8         // maximum number of steppers
2222
23#define STEPPER_48STEP_REEL    0         // STARPOINT RMXXX reel unit
24#define BARCREST_48STEP_REEL   1         // Barcrest bespoke reel unit
25#define STEPPER_144STEPS_DICE  2         // STARPOINT 1DCU DICE mechanism - tech sheet available  on request
23#define STARPOINT_48STEP_REEL   0         // STARPOINT RMXXX reel unit
24#define BARCREST_48STEP_REEL    1         // Barcrest bespoke reel unit
25#define STARPOINT_144STEPS_DICE 2         // STARPOINT 1DCU DICE mechanism - tech sheet available  on request
2626
2727void Stepper_init(  int id, int type);      // init a stepper motor
2828
src/mame/machine/gaelco2.c
r1386r1387
164164
165165***************************************************************************/
166166
167static struct EEPROM_interface gaelco2_eeprom_interface =
167static const struct EEPROM_interface gaelco2_eeprom_interface =
168168{
169169   8,            /* address bits */
170170   16,            /* data bits */
src/mame/machine/strtheat.c
r1386r1387
180180
181181DRIVER_INIT( strtheat )
182182{
183
184   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MRA8_BANK1 );
185
183186   /* While the PAL supports up to 16 decryption methods, only four
184187        are actually used in the PAL.  Therefore, we'll take a little
185188        memory overhead and decrypt the ROMs using each method in advance. */
src/mame/machine/drakton.c
r1386r1387
103103
104104DRIVER_INIT( drakton )
105105{
106
107   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MRA8_BANK1 );
108
106109   /* While the PAL supports up to 16 decryption methods, only four
107110        are actually used in the PAL.  Therefore, we'll take a little
108111        memory overhead and decrypt the ROMs using each method in advance. */
112
109113   drakton_decrypt_rom_8();
110114   drakton_decrypt_rom_9();
111115   drakton_decrypt_rom_A();
src/mame/machine/simpsons.c
r1386r1387
1919static int init_eeprom_count;
2020
2121
22static struct EEPROM_interface eeprom_interface =
22static const struct EEPROM_interface eeprom_interface =
2323{
2424   7,            /* address bits */
2525   8,            /* data bits */
src/mame/machine/exctsccr.c
r1386r1387
3737/* Exciting Soccer */
3838
3939/* input = 0x6009 - data = 0x6170 */
40static UINT8 mcu_table1[MCU_KEY_TABLE_SIZE] = {
40static const UINT8 mcu_table1[MCU_KEY_TABLE_SIZE] = {
4141   0x23, 0x05, 0xfb, 0x07, 0x4d, 0x3b,   0x7d, 0x03,
4242   0x9a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
4343};
4444
4545/* input = 0x600d - data = 0x61f0 */
46static UINT8 mcu_table2[MCU_KEY_TABLE_SIZE] = {
46static const UINT8 mcu_table2[MCU_KEY_TABLE_SIZE] = {
4747   0x75, 0x25, 0x4b, 0x10, 0xa6, 0x06,   0x9a, 0x02,
4848   0x04, 0x11, 0x09, 0x09,   0x2a, 0x10, 0x3a, 0x10
4949};
5050
5151/* input = ?????? - data = 0x6300 */
52static UINT8 mcu_table3[MCU_KEY_TABLE_SIZE*4] = {
52static const UINT8 mcu_table3[MCU_KEY_TABLE_SIZE*4] = {
5353   0xba, 0x26,   0x53, 0x0d, 0x01, 0x24, 0x1d, 0x15,
5454   0xd0, 0x1d, 0x35, 0x1f, 0x32, 0x22,   0xa0, 0x2c,
5555
r1386r1387
6464};
6565
6666/* input = 0x6007 - data = 0x629b */
67static UINT8 mcu_table4[MCU_KEY_TABLE_SIZE] = {
67static const UINT8 mcu_table4[MCU_KEY_TABLE_SIZE] = {
6868   0xc5, 0x24, 0xc5, 0x24, 0x27, 0x3f,   0xd0, 0x07,
6969   0x07, 0x0b, 0xd8, 0x02, 0x9a, 0x08, 0x00, 0x00
7070};
7171
7272/* input = 0x6007 - data = 0x629b */
73static UINT8 mcu_table5[MCU_KEY_TABLE_SIZE] = {
73static const UINT8 mcu_table5[MCU_KEY_TABLE_SIZE] = {
7474   0x54, 0x43, 0xd0, 0x07, 0xd8, 0x02, 0x9a, 0x08,
7575   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
7676};
7777
7878/* input = 0x6007 - data = 0x629b */
79static UINT8 mcu_table6[MCU_KEY_TABLE_SIZE] = {
79static const UINT8 mcu_table6[MCU_KEY_TABLE_SIZE] = {
8080   0x2b, 0x03, 0xd0, 0x07, 0xd8, 0x02, 0x9a, 0x08,
8181   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
8282};
8383
8484/* input = 0x6007 - data = 0x629b */
85static UINT8 mcu_table7[MCU_KEY_TABLE_SIZE] = {
85static const UINT8 mcu_table7[MCU_KEY_TABLE_SIZE] = {
8686   0xfa, 0x0e, 0x9a, 0x08, 0x00, 0x00, 0x00, 0x00,
8787   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
8888};
8989
9090/* input = 0x6011 - data = 0x607f */
91static UINT8 mcu_table8[MCU_KEY_TABLE_SIZE*2] = {
91static const UINT8 mcu_table8[MCU_KEY_TABLE_SIZE*2] = {
9292   0x0b, 0x78, 0x47, 0x04, 0x36, 0x18, 0x23, 0xf1,
9393   0x10, 0xee, 0x16, 0x04, 0x11, 0x94, 0x16, 0xdd,
9494
r1386r1387
199199/* Exciting Soccer II */
200200
201201/* input = 0x6009 - data = 0x6170 */
202static UINT8 exctscc2_mcu_table1[MCU_KEY_TABLE_SIZE] = {
202static const UINT8 exctscc2_mcu_table1[MCU_KEY_TABLE_SIZE] = {
203203   0x56, 0x05, 0x90, 0x08, 0x19, 0x3e,   0xa8, 0x03,
204204   0x2f, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
205205};
206206
207207/* input = 0x600d - data = 0x61f0 */
208static UINT8 exctscc2_mcu_table2[MCU_KEY_TABLE_SIZE] = {
208static const UINT8 exctscc2_mcu_table2[MCU_KEY_TABLE_SIZE] = {
209209   0xff, 0x27, 0x35, 0x10, 0xd9, 0x06, 0xc3, 0x02,
210210   0x4d, 0x12, 0x9e, 0x09,   0x14, 0x10, 0x24, 0x10
211211};
212212
213213/* input = ?????? - data = 0x6300 */
214static UINT8 exctscc2_mcu_table3[MCU_KEY_TABLE_SIZE*4] = {
214static const UINT8 exctscc2_mcu_table3[MCU_KEY_TABLE_SIZE*4] = {
215215   0x41, 0x29,   0xb2, 0x12, 0x91, 0x26, 0xa6, 0x16, //0x12b2?
216216   0x5f, 0x20,   0xc4, 0x21, 0xc1, 0x24, 0x3e, 0x2f,
217217
r1386r1387
226226};
227227
228228/* input = 0x6007 - data = 0x629b */
229static UINT8 exctscc2_mcu_table4[MCU_KEY_TABLE_SIZE] = {
229static const UINT8 exctscc2_mcu_table4[MCU_KEY_TABLE_SIZE] = {
230230   0x55, 0x27, 0x55, 0x27, 0xf3, 0x41, 0x65, 0x08,
231231   0xe3, 0x0b, 0x01, 0x03, 0x2f, 0x09, 0x00, 0x00
232232};
233233
234234/* input = 0x6007 - data = 0x629b */
235static UINT8 exctscc2_mcu_table5[MCU_KEY_TABLE_SIZE] = {
235static const UINT8 exctscc2_mcu_table5[MCU_KEY_TABLE_SIZE] = {
236236   0xdd, 0x45, 0x65, 0x08, 0x01, 0x03, 0x2f, 0x09,
237237   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
238238};
239239
240240/* input = 0x6007 - data = 0x629b */
241static UINT8 exctscc2_mcu_table6[MCU_KEY_TABLE_SIZE] = {
241static const UINT8 exctscc2_mcu_table6[MCU_KEY_TABLE_SIZE] = {
242242   0x54, 0x03, 0x65, 0x08, 0x01, 0x03, 0x2f, 0x09,
243243   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
244244};
245245
246246/* input = 0x6007 - data = 0x629b */
247static UINT8 exctscc2_mcu_table7[MCU_KEY_TABLE_SIZE] = {
247static const UINT8 exctscc2_mcu_table7[MCU_KEY_TABLE_SIZE] = {
248248   0xe4, 0x0e, 0x2f, 0x09, 0x00, 0x00, 0x00, 0x00,
249249   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
250250};
251251
252252/* input = 0x6011 - data = 0x607f */
253static UINT8 exctscc2_mcu_table8[MCU_KEY_TABLE_SIZE*2] = {
253static const UINT8 exctscc2_mcu_table8[MCU_KEY_TABLE_SIZE*2] = {
254254   0x0c, 0x54, 0x4b, 0x0d, 0x38, 0xbd, 0x26, 0x81,
255255   0x12, 0x37, 0x18, 0x4a, 0x13, 0x0f, 0x19, 0x23,
256256
src/mame/machine/slapstic.c
r1386r1387
278278 *************************************/
279279
280280/* slapstic 137412-101: Empire Strikes Back/Tetris (NOT confirmed) */
281static struct slapstic_data slapstic101 =
281static const struct slapstic_data slapstic101 =
282282{
283283   /* basic banking */
284284   3,                        /* starting bank */
r1386r1387
305305
306306
307307/* slapstic 137412-103: Marble Madness (confirmed) */
308static struct slapstic_data slapstic103 =
308static const struct slapstic_data slapstic103 =
309309{
310310   /* basic banking */
311311   3,                        /* starting bank */
r1386r1387
332332
333333
334334/* slapstic 137412-104: Gauntlet (confirmed) */
335static struct slapstic_data slapstic104 =
335static const struct slapstic_data slapstic104 =
336336{
337337   /* basic banking */
338338   3,                        /* starting bank */
r1386r1387
359359
360360
361361/* slapstic 137412-105: Indiana Jones/Paperboy (confirmed) */
362static struct slapstic_data slapstic105 =
362static const struct slapstic_data slapstic105 =
363363{
364364   /* basic banking */
365365   3,                        /* starting bank */
r1386r1387
386386
387387
388388/* slapstic 137412-106: Gauntlet II (confirmed) */
389static struct slapstic_data slapstic106 =
389static const struct slapstic_data slapstic106 =
390390{
391391   /* basic banking */
392392   3,                        /* starting bank */
r1386r1387
413413
414414
415415/* slapstic 137412-107: Peter Packrat/Xybots/2p Gauntlet/720 (confirmed) */
416static struct slapstic_data slapstic107 =
416static const struct slapstic_data slapstic107 =
417417{
418418   /* basic banking */
419419   3,                        /* starting bank */
r1386r1387
440440
441441
442442/* slapstic 137412-108: Road Runner/Super Sprint (confirmed) */
443static struct slapstic_data slapstic108 =
443static const struct slapstic_data slapstic108 =
444444{
445445   /* basic banking */
446446   3,                        /* starting bank */
r1386r1387
467467
468468
469469/* slapstic 137412-109: Championship Sprint/Road Blasters (confirmed) */
470static struct slapstic_data slapstic109 =
470static const struct slapstic_data slapstic109 =
471471{
472472   /* basic banking */
473473   3,                        /* starting bank */
r1386r1387
494494
495495
496496/* slapstic 137412-110: Road Blasters/APB (confirmed) */
497static struct slapstic_data slapstic110 =
497static const struct slapstic_data slapstic110 =
498498{
499499   /* basic banking */
500500   3,                        /* starting bank */
r1386r1387
528528 *************************************/
529529
530530/* slapstic 137412-111: Pit Fighter (confirmed) */
531static struct slapstic_data slapstic111 =
531static const struct slapstic_data slapstic111 =
532532{
533533   /* basic banking */
534534   0,                        /* starting bank */
r1386r1387
554554
555555
556556/* slapstic 137412-112: Pit Fighter (Japan) (confirmed) */
557static struct slapstic_data slapstic112 =
557static const struct slapstic_data slapstic112 =
558558{
559559   /* basic banking */
560560   0,                        /* starting bank */
r1386r1387
580580
581581
582582/* slapstic 137412-113: Unknown (Europe) (confirmed) */
583static struct slapstic_data slapstic113 =
583static const struct slapstic_data slapstic113 =
584584{
585585   /* basic banking */
586586   0,                        /* starting bank */
r1386r1387
606606
607607
608608/* slapstic 137412-114: Unknown (Europe) (unconfirmed) */
609static struct slapstic_data slapstic114 =
609static const struct slapstic_data slapstic114 =
610610{
611611   /* basic banking */
612612   0,                        /* starting bank */
r1386r1387
632632
633633
634634/* slapstic 137412-115: Race Drivin' DSK board (confirmed) */
635static struct slapstic_data slapstic115 =
635static const struct slapstic_data slapstic115 =
636636{
637637   /* basic banking */
638638   0,                        /* starting bank */
r1386r1387
658658
659659
660660/* slapstic 137412-116: Hydra (confirmed) */
661static struct slapstic_data slapstic116 =
661static const struct slapstic_data slapstic116 =
662662{
663663   /* basic banking */
664664   0,                        /* starting bank */
r1386r1387
684684
685685
686686/* slapstic 137412-117: Race Drivin' main board (confirmed) */
687static struct slapstic_data slapstic117 =
687static const struct slapstic_data slapstic117 =
688688{
689689   /* basic banking */
690690   0,                        /* starting bank */
r1386r1387
710710
711711
712712/* slapstic 137412-118: Rampart/Vindicators II (confirmed) */
713static struct slapstic_data slapstic118 =
713static const struct slapstic_data slapstic118 =
714714{
715715   /* basic banking */
716716   0,                        /* starting bank */
r1386r1387
743743 *************************************/
744744
745745/* master table */
746static struct slapstic_data *slapstic_table[] =
746static const struct slapstic_data *const slapstic_table[] =
747747{
748748   &slapstic101,   /* NOT confirmed! */
749749   NULL,         /* never seen */
src/mame/mamedriv.c
r1386r1387
17011701   DRIVER( slapshot )   /* D71 (c) 1994 Taito Corporation (Japan) */
17021702   DRIVER( opwolf3 )   /* D74 (c) 1994 Taito */
17031703   DRIVER( opwolf3u )   /* D74 (c) 1994 Taito */
1704   DRIVER( scessjoe )   /* ??? (c) 1990 Wave / Taito */
17041705   DRIVER( ashnojoe )   /* ??? (c) 1990 Wave / Taito */
17051706
17061707   /* Taito multi-screen games */
r1386r1387
27402741   DRIVER( glpracr3 )   /* Gallop Racer 3 (JAPAN) */
27412742   DRIVER( flamegun )   /* Flame Gunner (USA) */
27422743   DRIVER( flameguj )   /* Flame Gunner (JAPAN) */
2744   DRIVER( tblkkuzu )   /* The Block Kuzushi (JAPAN) */
2745   DRIVER( 1on1gov )   /* 1 on 1 Government (JAPAN) */
27432746   DRIVER( tecmowcm )   /* Tecmo World Cup Millenium (JAPAN) */
27442747   DRIVER( mfjump )   /* Monster Farm Jump (JAPAN) */
27452748
r1386r1387
32713274   DRIVER( sscandal )   /* 834-5755 (c) 1985 Coreland / Sega (S1) */
32723275   DRIVER( myherok )   /* 834-5755 (c) 1985 Coreland / Sega (S1) */
32733276   DRIVER( shtngmst )   /* 834-5719/5720 (c) 1985 (S2) */
3274   DRIVER( shtngmsa )   /* 834-5719/5720 (c) 1985 (S2) */
3275    DRIVER( shtngmsb )   /* 834-5719/5720 (c) 1985 (S2) */
3277   DRIVER( shtngms1 )   /* 834-5719/5720 (c) 1985 (S2) */
3278    DRIVER( shtngmsa )   /* 834-5719/5720 (c) 1985 (S2) */
32763279   DRIVER( chplft )   /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */
32773280   DRIVER( chplftb )   /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */
32783281   DRIVER( chplftbl )   /* bootleg (S2) */
r1386r1387
36793682   DRIVER( puyosun )   /* (c) 1996 Compile */
36803683   DRIVER( rsgun )      /* (c) 1998 Treasure */
36813684   DRIVER( sandor )   /* (c) 1995 */
3685   DRIVER( sanjeon )   /* (c) 1999 Sega / Deniam */
36823686   DRIVER( thunt )      /* (c) 1995 Sega (Deniam License) */
3687   DRIVER( thuntk )   /* (c) 1995 Sega (Deniam License) */
36833688   DRIVER( sasissu )   /* (c) 1992 */
36843689   DRIVER( seabass )   /* (c) 1998 A wave Inc (Able License) */
36853690   DRIVER( shanhigw )   /* (c) 1996 */
r1386r1387
36893694   DRIVER( sss )      /* (c) 1998 Capcom / Cave / Victor */
36903695   DRIVER( suikoenb )   /* (c) 1995 Data East */
36913696   DRIVER( twcup98 )   /* (c) 1998 Techmo */
3697   DRIVER( stress )   /* (c) 1997 Sega */
36923698   DRIVER( vfkids )   /* (c) 1995 */
36933699   DRIVER( vfremix )   /* (c) 1996 */
36943700   DRIVER( vmahjong )   /* (c) 1997 Micronet */
r1386r1387
37033709
37043710   DRIVER( sfish2 )   /* (c) 1995 */
37053711   DRIVER( sfish2j )   /* (c) 1995 */
3712   DRIVER( magzun )   /* (c) 1995 */
37063713
37073714   /* Sega Model 2 Games */
37083715
r1386r1387
39163923            /* 45 */
39173924            /* 46 */
39183925   DRIVER( mt_astrm )   /* 47 */
3919            /* 48 */
3926   DRIVER( mt_wwar )   /* 48 */
39203927   DRIVER( mt_bbros )   /* 49 */
39213928            /* 50 */
39223929            /* 51 */
r1386r1387
78687875   DRIVER( jongkyo )   /* (c) 1985 Kiwako */
78697876   DRIVER( gtipoker )   /* (c) 1983 GTI Inc */
78707877   DRIVER( gamecstl )   /* MAME based bootleg */
7878   DRIVER( drw80pkr )
78717879
78727880#endif   /* DRIVER_RECURSIVE */
src/mame/includes/galaxian.h
r1386r1387
207207
208208/*----------- defined in audio/galaxian.c -----------*/
209209
210extern struct Samplesinterface galaxian_samples_interface;
210extern const struct Samplesinterface galaxian_samples_interface;
211211WRITE8_HANDLER( galaxian_pitch_w );
212212WRITE8_HANDLER( galaxian_vol_w );
213213WRITE8_HANDLER( galaxian_noise_enable_w );
src/mame/includes/astinvad.h
r1386r1387
1616
1717/*----------- defined in audio/astinvad.c -----------*/
1818
19extern struct Samplesinterface astinvad_samples_interface;
19extern const struct Samplesinterface astinvad_samples_interface;
2020
2121WRITE8_HANDLER( astinvad_sound1_w );
2222WRITE8_HANDLER( astinvad_sound2_w );
src/mame/includes/blockade.h
r1386r1387
99
1010/*----------- defined in audio/blockade.c -----------*/
1111
12extern struct Samplesinterface blockade_samples_interface;
12extern const struct Samplesinterface blockade_samples_interface;
1313DISCRETE_SOUND_EXTERN( blockade );
1414
1515WRITE8_HANDLER( blockade_sound_freq_w );
src/mame/includes/astrocde.h
r1386r1387
4343
4444/*----------- defined in audio/wow.c -----------*/
4545
46extern const char *wow_sample_names[];
46extern const char *const wow_sample_names[];
4747
4848READ8_HANDLER( wow_speech_r );
4949UINT32 wow_speech_status_r(void *param);
r1386r1387
5151
5252/*----------- defined in audio/gorf.c -----------*/
5353
54extern const char *gorf_sample_names[];
54extern const char *const gorf_sample_names[];
5555
5656READ8_HANDLER( gorf_speech_r );
5757UINT32 gorf_speech_status_r(void *param);
src/mame/includes/8080bw.h
r1386r1387
2424
2525WRITE8_HANDLER( lrescue_sh_port_1_w );
2626WRITE8_HANDLER( lrescue_sh_port_2_w );
27extern struct Samplesinterface lrescue_samples_interface;
27extern const struct Samplesinterface lrescue_samples_interface;
2828
2929WRITE8_HANDLER( cosmo_sh_port_2_w );
3030
r1386r1387
4545MACHINE_START( schaser );
4646WRITE8_HANDLER( schaser_sh_port_1_w );
4747WRITE8_HANDLER( schaser_sh_port_2_w );
48extern struct SN76477interface schaser_sn76477_interface;
48extern const struct SN76477interface schaser_sn76477_interface;
4949DISCRETE_SOUND_EXTERN( schaser );
5050
5151WRITE8_HANDLER( rollingc_sh_port_w );
src/mame/includes/circus.h
r1386r1387
1313DISCRETE_SOUND_EXTERN( circus );
1414DISCRETE_SOUND_EXTERN( robotbwl );
1515DISCRETE_SOUND_EXTERN( crash );
16extern struct Samplesinterface circus_samples_interface;
17extern struct Samplesinterface crash_samples_interface;
18extern struct Samplesinterface ripcord_samples_interface;
19extern struct Samplesinterface robotbwl_samples_interface;
16extern const struct Samplesinterface circus_samples_interface;
17extern const struct Samplesinterface crash_samples_interface;
18extern const struct Samplesinterface ripcord_samples_interface;
19extern const struct Samplesinterface robotbwl_samples_interface;
2020
2121/*----------- defined in video/circus.c -----------*/
2222
src/mame/includes/cclimber.h
r1386r1387
3939/*----------- defined in audio/cclimber.c -----------*/
4040
4141extern struct AY8910interface cclimber_ay8910_interface;
42extern struct Samplesinterface cclimber_samples_interface;
42extern const struct Samplesinterface cclimber_samples_interface;
4343WRITE8_HANDLER( cclimber_sample_trigger_w );
4444WRITE8_HANDLER( cclimber_sample_rate_w );
4545WRITE8_HANDLER( cclimber_sample_volume_w );
src/mame/includes/dkong.h
r1386r1387
4343#define I8035_DIVIDER         (15)
4444#define I8035_CLOCK            (I8035_MASTER_CLOCK/I8035_DIVIDER)
4545
46#define HARDWARE_TYPE_TAG      "HARDWARE_TYPE"
47#define HARDWARE_TKG04         0
48#define HARDWARE_TRS01         1
49#define HARDWARE_TRS02         2
50#define HARDWARE_TKG02         3
4651
52#define DK2B_PALETTE_LENGTH      (256+256+8+1) // (256)
53#define DK4B_PALETTE_LENGTH      (256+256+8+1) // (256)
54#define DK3_PALETTE_LENGTH      (256+256+8+1) // (256)
55#define RS_PALETTE_LENGTH      (256+256+8+1)
56
57typedef struct _dkong_state dkong_state;
58struct _dkong_state
59{
60   /* memory pointers */
61
62   /* machine states */
63   UINT8   hardware_type;
64
65   /* sound state */
66
67   /* video state */
68   tilemap *bg_tilemap;
69
70   mame_bitmap *   bg_bits;
71   const UINT8 *   color_codes;
72   emu_timer *      scanline_timer;
73   INT8          vidhw;         /* Selected video hardware RS Conversion / TKG04 */
74
75   /* radar scope */
76   UINT8   sig30Hz;
77   UINT8   grid_sig;
78   UINT8   rflip_sig;
79   UINT8   star_ff;
80   UINT8   blue_level;
81   double    cd4049_a;
82   double   cd4049_b;
83
84   /* Specific states */
85   INT8 decrypt_counter;
86   int hunchloopback;
87
88   /* Save state relevant */
89   UINT8   gfx_bank, palette_bank;
90   UINT8   grid_on;
91   UINT8   snd02_enable;
92   UINT8   sig_ansn;
93   UINT16   grid_col;
94   UINT8   sprite_bank;
95   UINT8   dma_latch;
96
97   /* reverse address lookup map - hunchbkd */
98   INT16 rev_map[0x200];
99
100};
101
47102/*----------- defined in video/dkong.c -----------*/
48103
49104WRITE8_HANDLER( radarscp_snd02_w ); /* to daisy chain sound 02 signal */
r1386r1387
59114
60115WRITE8_HANDLER( dkong_videoram_w );
61116
62PALETTE_INIT( dkong );
117PALETTE_INIT( dkong2b );
118PALETTE_INIT( dkong4b );
63119PALETTE_INIT( radarscp );
64120PALETTE_INIT( radarsc1 );
65121PALETTE_INIT( dkong3 );
66122
67123VIDEO_START( dkong );
68VIDEO_START( radarsc1 );
69VIDEO_START( radarscp );
70VIDEO_UPDATE( radarscp );
71124VIDEO_UPDATE( dkong );
72125VIDEO_UPDATE( pestplce );
73126VIDEO_UPDATE( spclforc );
r1386r1387
86139
87140/*----------- defined in audio/dkong.c -----------*/
88141
89READ8_HANDLER( dkong_sh_p1_r );
90READ8_HANDLER( dkong_sh_p2_r );
91READ8_HANDLER( dkong_sh_t0_r );
92READ8_HANDLER( dkong_sh_t1_r );
93READ8_HANDLER( dkong_sh_tune_r );
94READ8_HANDLER( dkong_in2_r );
142READ8_HANDLER( dkong_audio_status_r );
143WRITE8_HANDLER( dkong_audio_irq_w );
95144
96WRITE8_HANDLER( radarsc1_snd_disc_w );
97WRITE8_HANDLER( dkong_sh_w );
98WRITE8_HANDLER( dkong_sh_p1_w );
99WRITE8_HANDLER( dkong_sh_p2_w );
100
101145WRITE8_HANDLER( dkong_snd_disc_w );
102146WRITE8_HANDLER( dkong_sh_tuneselect_w );
103147
104148WRITE8_HANDLER( dkongjr_sh_test6_w );
105WRITE8_HANDLER( dkongjr_sh_test5_w );
106WRITE8_HANDLER( dkongjr_sh_test4_w );
107149WRITE8_HANDLER( dkongjr_sh_tuneselect_w );
108150
109151WRITE8_HANDLER( dkongjr_snd_w1 );
110152WRITE8_HANDLER( dkongjr_snd_w2 );
111153
112READ8_HANDLER( radarsc1_sh_tune_r );
113READ8_HANDLER( radarsc1_sh_p1_r );
114WRITE8_HANDLER( radarsc1_sh_p1_w );
115WRITE8_HANDLER( radarsc1_sh_p2_w );
154MACHINE_DRIVER_EXTERN( radarscp_audio );
155MACHINE_DRIVER_EXTERN( dkong2b_audio );
156MACHINE_DRIVER_EXTERN( dkongjr_audio );
157MACHINE_DRIVER_EXTERN( dkong3_audio );
158MACHINE_DRIVER_EXTERN( radarsc1_audio );
116159
117SOUND_START( dkong );
118SOUND_START( dkongjr );
119SOUND_START( hunchbkd );
120SOUND_START( radarsc1 );
121
122DISCRETE_SOUND_EXTERN( dkong );
123DISCRETE_SOUND_EXTERN( radarscp );
124
src/mame/includes/triplhnt.h
r1386r1387
2323/*----------- defined in audio/triplhnt.c -----------*/
2424
2525DISCRETE_SOUND_EXTERN( triplhnt );
26extern struct Samplesinterface triplhnt_samples_interface;
26extern const struct Samplesinterface triplhnt_samples_interface;
2727
2828
2929/*----------- defined in video/triplhnt.c -----------*/
src/mame/mame.mak
r1386r1387
15131513   $(DRIVERS)/dorachan.o \
15141514   $(DRIVERS)/dreamwld.o \
15151515   $(DRIVERS)/dribling.o $(VIDEO)/dribling.o \
1516   $(DRIVERS)/drw80pkr.o \
15161517   $(DRIVERS)/dwarfd.o \
15171518   $(DRIVERS)/dynadice.o \
15181519   $(DRIVERS)/epos.o $(VIDEO)/epos.o \
src/mame/video/midzeus.c
r1386r1387
1818 *************************************/
1919
2020#define WAVERAM_WIDTH   512
21#define WAVERAM_HEIGHT   4096
21#define WAVERAM_HEIGHT   2048
2222
2323
2424
r1386r1387
3131typedef struct _poly_extra_data poly_extra_data;
3232struct _poly_extra_data
3333{
34   const UINT32 *   palbase;
35   const UINT32 *   texbase;
34   const UINT64 *   palbase;
35   const UINT64 *   texbase;
3636   UINT16         transcolor;
3737   UINT16         texwidth;
3838   UINT16         color;
r1386r1387
5656static UINT8 zeuscmd_buffer_expected_words;
5757static INT16 zeus_matrix[3][3];
5858static INT32 zeus_point[3];
59static UINT32 *zeus_palbase;
59static UINT64 *zeus_renderbase;
60static UINT64 *zeus_palbase;
6061static int zeus_enable_logging;
6162static UINT32 zeus_blend;
6263static UINT32 zeus_texdata;
6364static UINT32 zeus_objdata;
6465
65static UINT32 *waveram;
66static UINT64 *waveram[2];
6667
6768static UINT8 single_step;
6869static poly_extra_data single_step_extra;
r1386r1387
9596 *
9697 *************************************/
9798
98INLINE UINT32 *waveram_ptr_from_addr(UINT32 addr)
99INLINE UINT64 *waveram_ptr_from_block_addr(UINT8 bank, UINT32 addr)
99100{
100   return &waveram[((addr & 0x1ff) | ((addr & 0xfff000) >> 3)) * 2];
101   return &waveram[bank][(addr % WAVERAM_WIDTH) + ((addr >> 12) % WAVERAM_HEIGHT) * WAVERAM_WIDTH];
101102}
102103
103104
104INLINE UINT32 *waveram_pixel_ptr(int bank, int y, int x)
105INLINE UINT64 *waveram_ptr_from_expanded_addr(UINT8 bank, UINT32 addr)
105106{
106   return &waveram[bank * (WAVERAM_HEIGHT * WAVERAM_WIDTH) + y * WAVERAM_WIDTH + (x & ~1)];
107   return &waveram[bank][(addr % WAVERAM_WIDTH) + ((addr >> 16) % WAVERAM_HEIGHT) * WAVERAM_WIDTH];
107108}
108109
109110
111INLINE UINT64 *waveram_ptr_from_texture_addr(UINT8 bank, UINT32 addr, int width)
112{
113   return &waveram[bank][(addr * width) / 8];
114}
115
116
117INLINE UINT16 *waveram_pixel_ptr(UINT64 *base, int y, int x, UINT16 **depthptr)
118{
119   UINT16 *baseptr = (UINT16 *)base + y * 512*2 + (x & ~1) * 2;
120   if (depthptr != NULL)
121      *depthptr = baseptr + BYTE4_XOR_LE((x & 1) + 2);
122   return baseptr + BYTE4_XOR_LE(x & 1);
123}
124
125
110126INLINE void waveram_plot(int y, int x, UINT16 color)
111127{
112128   if (x >= 0 && x < 400 && y >= 0 && y < 256)
113129   {
114      UINT32 *ptr = waveram_pixel_ptr(1, y, x);
115      if (x & 1)
116         *ptr = (*ptr & 0x0000ffff) | (color << 16);
117      else
118         *ptr = (*ptr & 0xffff0000) | color;
130      UINT16 *ptr = waveram_pixel_ptr(zeus_renderbase, y, x, NULL);
131      *ptr = color;
119132   }
120133}
121134
r1386r1387
124137{
125138   if (x >= 0 && x < 400 && y >= 0 && y < 256)
126139   {
127      UINT32 *ptr = waveram_pixel_ptr(1, y, x);
128      if (x & 1)
129      {
130         ptr[0] = (ptr[0] & 0x0000ffff) | (color << 16);
131         ptr[1] = (ptr[1] & 0x0000ffff) | (depth << 16);
132      }
133      else
134      {
135         ptr[0] = (ptr[0] & 0xffff0000) | color;
136         ptr[1] = (ptr[1] & 0xffff0000) | depth;
137      }
140      UINT16 *depthptr;
141      UINT16 *ptr = waveram_pixel_ptr(zeus_renderbase, y, x, &depthptr);
142      *ptr = color;
143      *depthptr = depth;
138144   }
139145}
140146
r1386r1387
143149{
144150   if (x >= 0 && x < 400 && y >= 0 && y < 256)
145151   {
146      UINT32 *ptr = waveram_pixel_ptr(1, y, x);
147      if (x & 1)
152      UINT16 *depthptr;
153      UINT16 *ptr = waveram_pixel_ptr(zeus_renderbase, y, x, &depthptr);
154      if (depth <= *depthptr)
148155      {
149         if (depth <= (ptr[1] >> 16))
150         {
151            ptr[0] = (ptr[0] & 0x0000ffff) | (color << 16);
152            ptr[1] = (ptr[1] & 0x0000ffff) | (depth << 16);
153         }
156         *ptr = color;
157         *depthptr = depth;
154158      }
155      else
156      {
157         if (depth <= (ptr[1] & 0xffff))
158         {
159            ptr[0] = (ptr[0] & 0xffff0000) | color;
160            ptr[1] = (ptr[1] & 0xffff0000) | depth;
161         }
162      }
163159   }
164160}
165161
166162
167INLINE UINT32 *zeus_pixaddr(void)
163INLINE UINT8 get_texel_8bit(const UINT64 *base, int y, int x, int width)
168164{
169   int bank = (zeusbase[0xb6] >> 31) & 1;
170   int x = (zeusbase[0xb4] & 0xff) << 1;
171   int y = ((zeusbase[0xb4] >> 15) & 0xffe) | ((zeusbase[0xb4] >> 8) & 0x01);
172   return waveram_pixel_ptr(bank, y, x);
165   const UINT8 *base8 = (const UINT8 *)base;
166   x &= width - 1;
167   base8 += BYTE8_XOR_LE((y / 2) * (width * 2) + (x / 4) * 8 + (y & 1) * 4 + (x & 3));
168   return *base8;
173169}
174170
175171
176INLINE UINT8 get_texel_8bit(const UINT32 *base, int y, int x, int width)
172INLINE UINT8 get_texel_4bit(const UINT64 *base, int y, int x, int width)
177173{
178   if (x >= width)
179      return 0;
180   base += (y / 2) * (width / 2) + (x / 4) * 2 + (y & 1);
181   return *base >> (8 * (x & 3));
174   const UINT8 *base8 = (const UINT8 *)base;
175   x &= (width * 2) - 1;
176   base8 += BYTE8_XOR_LE((y / 2) * (width * 2) + (x / 8) * 8 + (y & 1) * 4 + ((x / 2) & 3));
177   return (*base8 >> (4 * (x & 1))) & 0x0f;
182178}
183179
184180
185INLINE UINT8 get_texel_4bit(const UINT32 *base, int y, int x, int width)
181INLINE UINT16 get_palette_entry(const UINT64 *palbase, UINT8 texel)
186182{
187   if (x >= width * 2)
188      return 0;
189   base += (y / 2) * (width / 2) + (x / 8) * 2 + (y & 1);
190   return (*base >> (4 * (x & 7))) & 0x0f;
183   const UINT16 *base16 = (const UINT16 *)palbase;
184   return base16[BYTE4_XOR_LE(texel)];
191185}
192186
193187
r1386r1387
203197   int i;
204198
205199   /* allocate memory for "wave" RAM */
206   waveram = auto_malloc(2 * WAVERAM_WIDTH * WAVERAM_HEIGHT * sizeof(*waveram));
207   state_save_register_global_pointer(waveram, 2 * WAVERAM_WIDTH * WAVERAM_HEIGHT);
200   waveram[0] = auto_malloc(WAVERAM_WIDTH * WAVERAM_HEIGHT * sizeof(*waveram));
201   waveram[1] = auto_malloc(WAVERAM_WIDTH * WAVERAM_HEIGHT * sizeof(*waveram));
202   state_save_register_global_pointer(waveram[0], WAVERAM_WIDTH * WAVERAM_HEIGHT);
203   state_save_register_global_pointer(waveram[1], WAVERAM_WIDTH * WAVERAM_HEIGHT);
208204
209205   /* initialize a 5-5-5 palette */
210206   for (i = 0; i < 32768; i++)
r1386r1387
215211
216212   /* we need to cleanup on exit */
217213   add_exit_callback(machine, exit_handler);
214
215   zeus_renderbase = waveram[1];
218216}
219217
220218
221219static void exit_handler(running_machine *machine)
222220{
223221   FILE *f = fopen("waveram.dmp", "w");
222   int bank;
224223   int i;
225224
226   for (i = 0; i < 2 * WAVERAM_WIDTH * WAVERAM_HEIGHT; i += 2)
227   {
228      if (i % 8 == 0) fprintf(f, "%03X%03X: ", (i / 1024), (i / 2) & 0x1ff);
229      fprintf(f, " %08X %08X ", waveram[i+0], waveram[i+1]);
230      if (i % 8 == 6) fprintf(f, "\n");
231   }
225   for (bank = 0; bank < 2; bank++)
226      for (i = 0; i < WAVERAM_WIDTH * WAVERAM_HEIGHT; i++)
227      {
228         if (i % 4 == 0) fprintf(f, "%03X%03X: ", i / WAVERAM_WIDTH, i % WAVERAM_WIDTH);
229         fprintf(f, " %08X %08X ", (UINT32)(waveram[bank][i] >> 32), (UINT32)waveram[bank][i]);
230         if (i % 4 == 3) fprintf(f, "\n");
231      }
232232   fclose(f);
233
234   poly_free(poly);
233235}
234236
235237
r1386r1387
247249   /* normal update case */
248250   if (!input_code_pressed(KEYCODE_W))
249251   {
252      UINT64 *base = waveram_ptr_from_expanded_addr(1, zeusbase[0xcc]);
250253      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
251254      {
252         UINT32 *src = waveram_pixel_ptr(1, y, 0);
253255         UINT16 *dest = (UINT16 *)bitmap->base + y * bitmap->rowpixels;
254         for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
255         {
256            UINT32 pixels = *src;
257            dest[x+0] = pixels & 0x7fff;
258            dest[x+1] = (pixels >> 16) & 0x7fff;
259            src += 2;
260         }
256         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
257            dest[x] = *waveram_pixel_ptr(base, y, x, NULL);
261258      }
262259
263260      if (single_step)
264261      {
265262         int texwshift = ((single_step_val2 >> 6) + single_step_dx) & 7;
266         const UINT32 *texbase = &waveram[(single_step_val1 << ((7 + single_step_dy) - texwshift)) & 0x3fffff];
267263         int texwidth = 512 >> texwshift;
268264         int texdepth = (single_step_val2 & 0x20) ? 8 : 4;
265         const UINT64 *texbase = waveram_ptr_from_texture_addr(0, single_step_val1, texwidth);
269266         int x, y;
270267
271268         for (y = 0; y < 256; y++)
r1386r1387
274271            for (x = 0; x < 256; x++)
275272            {
276273               if (x < texwidth)
277                  dest[x] = single_step_extra.palbase[(texdepth == 8) ?
278                           get_texel_8bit(texbase, y, x, texwidth) :
279                           get_texel_4bit(texbase, y, x, texwidth)];
274                  dest[x] = get_palette_entry(single_step_extra.palbase, (texdepth == 8) ? get_texel_8bit(texbase, y, x, texwidth) : get_texel_4bit(texbase, y, x, texwidth));
280275               else
281276                  dest[x] = 0;
282277            }
r1386r1387
297292   {
298293      static int yoffs = 0;
299294      static int width = 256;
300      UINT32 *base;
295      const UINT64 *base;
301296
302297      if (input_code_pressed(KEYCODE_DOWN)) yoffs += input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
303298      if (input_code_pressed(KEYCODE_UP)) yoffs -= input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1;
r1386r1387
305300      if (input_code_pressed(KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(KEYCODE_RIGHT)) ; }
306301
307302      if (yoffs < 0) yoffs = 0;
308      base = waveram_ptr_from_addr(yoffs << 12);
303      base = waveram_ptr_from_block_addr(0, yoffs << 12);
309304
310305      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
311306      {
r1386r1387
940935   float doozdx = extent->param[0].dpdx;
941936   float duozdx = extent->param[1].dpdx;
942937   float dvozdx = extent->param[2].dpdx;
943   const UINT32 *texbase = extra->texbase;
944   const UINT32 *palbase = extra->palbase;
938   const UINT64 *texbase = extra->texbase;
939   const UINT64 *palbase = extra->palbase;
945940   UINT16 transcolor = extra->transcolor;
946941   int texwidth = extra->texwidth;
947942   int x;
r1386r1387
957952      UINT8 texel = get_texel_4bit(texbase, v, u, texwidth);
958953      if (texel != transcolor)
959954      {
960         UINT16 color = palbase[texel >> 1] >> (16 * (texel & 1));
961         INT32 depth = z * 256.0f;
955         UINT16 color = get_palette_entry(palbase, texel);
956         INT32 depth = z;
962957         if (depth > 0x7fff) depth = 0x7fff;
963958         if (depth >= 0)
964959            waveram_plot_check_depth(scanline, x, color, depth);
r1386r1387
980975   float doozdx = extent->param[0].dpdx;
981976   float duozdx = extent->param[1].dpdx;
982977   float dvozdx = extent->param[2].dpdx;
983   const UINT32 *texbase = extra->texbase;
984   const UINT32 *palbase = extra->palbase;
978   const UINT64 *texbase = extra->texbase;
979   const UINT64 *palbase = extra->palbase;
985980   UINT16 transcolor = extra->transcolor;
986981   int texwidth = extra->texwidth;
987982   int x;
r1386r1387
997992      UINT8 texel = get_texel_8bit(texbase, v, u, texwidth);
998993      if (texel != transcolor)
999994      {
1000         UINT16 color = palbase[texel >> 1] >> (16 * (texel & 1));
1001         INT32 depth = z * 256.0f;
995         UINT16 color = get_palette_entry(palbase, texel);
996         INT32 depth = z;
1002997         if (depth > 0x7fff) depth = 0x7fff;
1003998         if (depth >= 0)
1004999            waveram_plot_check_depth(scanline, x, color, depth);
r1386r1387
10111006}
10121007
10131008
1009static void render_poly_solid(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
1010{
1011   const poly_extra_data *extra = extradata;
1012   UINT16 color = extra->transcolor;
1013   int x;
1014
1015   for (x = extent->startx; x < extent->stopx; x++)
1016      waveram_plot_depth(scanline, x, color, 0x7fff);
1017}
1018
1019
10141020static void zeus_draw_model(UINT32 addr_and_count, UINT32 texdata, int logcmd)
10151021{
1016   static UINT32 *loglist[1000];
1017   static int loglist_last = 0;
1018   UINT32 *data = waveram_ptr_from_addr(addr_and_count);
10191022   UINT32 val1, val2;
1020   int i, logit = FALSE;
10211023   int texwshift;
10221024   int testbit = 0;
10231025
r1386r1387
10371039         );
10381040   }
10391041
1040   if (logcmd)
1041   {
1042      for (i = 0; i < loglist_last; i++)
1043         if (loglist[i] == data)
1044            break;
1045      logit = (i == loglist_last);
1046      if (i == loglist_last)
1047         loglist[loglist_last++] = data;
1048   }
1049
10501042   if (input_code_pressed(KEYCODE_Z)) testbit = 1;
10511043   if (input_code_pressed(KEYCODE_X)) testbit = 2;
10521044   if (input_code_pressed(KEYCODE_C)) testbit = 3;
r1386r1387
10601052
10611053   while (1)
10621054   {
1063      const UINT32 *data = waveram_ptr_from_addr(addr_and_count);
1064      int count = ((addr_and_count >> 24) + 1) * 2;
1055      const UINT64 *data = waveram_ptr_from_block_addr(0, addr_and_count);
1056      int count = (addr_and_count >> 24) + 1;
10651057      UINT32 next_addr_and_count = 0;
10661058      int datanum;
10671059      int length;
10681060
1069      for (datanum = 0; datanum < count; datanum += length * 2)
1061      for (datanum = 0; datanum < count; datanum += length)
10701062      {
1063         UINT8 cmd = data[datanum] >> 24;
10711064         int offs;
10721065
1073         length = ((data[datanum] >> 24) == 0x25 || (data[datanum] >> 24) == 0x30) ? 7 : 1;
1066         length = (cmd == 0x25 || cmd == 0x30) ? 7 : 1;
10741067
1075         if (logit)
1068         if (logcmd)
10761069         {
1077            logerror("\t%08X", data[datanum]);
1078            for (offs = 1; offs < length * 2; offs++)
1079               logerror(" %08X", data[datanum + offs]);
1070            logerror("\t");
1071            for (offs = 0; offs < length; offs++)
1072               logerror("%08X %08X ", (UINT32)data[datanum + offs], (UINT32)(data[datanum + offs] >> 32));
10801073            logerror("\n");
10811074         }
10821075
1083         if ((data[datanum] >> 24) == 0x25 || (data[datanum] >> 24) == 0x30 /* invasn */)
1076         if (cmd == 0x25 || cmd == 0x30 /* invasn */)
10841077         {
10851078            poly_draw_scanline callback;
10861079            poly_extra_data *extra;
1080            poly_vertex clipvert[8];
10871081            poly_vertex vert[4];
1082            int numverts;
10881083            int i;
10891084
10901085            callback = (val2 & 0x20) ? render_poly_8bit : render_poly_4bit;
10911086
10921087            for (i = 0; i < 4; i++)
10931088            {
1094               UINT32 ixy = data[datanum + 2 + 2*i];
1095               UINT32 iuvz = data[datanum + 3 + 2*i];
1089               UINT32 ixy = data[datanum + 1 + i];
1090               UINT32 iuvz = data[datanum + 1 + i] >> 32;
10961091               INT32 xo = (INT16)ixy;
10971092               INT32 yo = (INT16)(ixy >> 16);
10981093               INT32 zo = (INT16)iuvz;
10991094               UINT8 u = iuvz >> 16;
11001095               UINT8 v = iuvz >> 24;
1101               float z, ooz;
11021096
11031097               vert[i].x = (xo * zeus_matrix[0][0] + yo * zeus_matrix[0][1] + zo * zeus_matrix[0][2] + zeus_point[0]) * (1.0f / 65536.0f);
11041098               vert[i].y = (xo * zeus_matrix[1][0] + yo * zeus_matrix[1][1] + zo * zeus_matrix[1][2] + zeus_point[1]) * (1.0f / 65536.0f);
1105               z = (xo * zeus_matrix[2][0] + yo * zeus_matrix[2][1] + zo * zeus_matrix[2][2] + zeus_point[2]) * (1.0f / (512.0f * 65536.0f));
1099               vert[i].p[0] = (xo * zeus_matrix[2][0] + yo * zeus_matrix[2][1] + zo * zeus_matrix[2][2] + zeus_point[2]) * (1.0f / (512.0f * 65536.0f));
1100               vert[i].p[1] = u;
1101               vert[i].p[2] = v;
11061102
1107               ooz = 1.0f / z;
1108               vert[i].x *= ooz;
1109               vert[i].y *= ooz;
1110               vert[i].p[0] = ooz;
1111               vert[i].p[1] = u * ooz;
1112               vert[i].p[2] = v * ooz;
1103               if (logcmd)
1104                  logerror("  (%f,%f,%f) (%02X,%02X)\n", vert[i].x, vert[i].y, vert[i].p[0], (int)vert[i].p[1], (int)vert[i].p[2]);
1105            }
11131106
1114               vert[i].x += 200.0f;
1115               vert[i].y += 128.0f;
1107            numverts = poly_zclip_if_less(4, &vert[0], &clipvert[0], 3, 0.0f);
1108            if (numverts < 3)
1109               continue;
1110
1111            for (i = 0; i < numverts; i++)
1112            {
1113               float ooz = 1.0f / (0.005f + clipvert[i].p[0]);
1114
1115               clipvert[i].x *= ooz;
1116               clipvert[i].y *= ooz;
1117               clipvert[i].x += 200.0f;
1118               clipvert[i].y += 128.0f;
1119
1120               ooz *= 1.0f / 512.0f;
1121               clipvert[i].p[0] = ooz;
1122               clipvert[i].p[1] *= ooz;
1123               clipvert[i].p[2] *= ooz;
11161124            }
11171125
11181126            extra = poly_get_extra_data(poly);
11191127            extra->transcolor = 0x100;
1120            extra->texbase = &waveram[(val1 << (7 - texwshift)) & 0x3fffff];
11211128            extra->texwidth = 512 >> texwshift;
1129            extra->texbase = waveram_ptr_from_texture_addr(0, val1, extra->texwidth);
11221130            extra->palbase = zeus_palbase;
11231131            extra->alpha = zeus_blend;
11241132
r1386r1387
11311139               single_step_advance = FALSE;
11321140            }
11331141
1134            poly_render_quad(poly, NULL, &Machine->screen[0].visarea, callback, 3, &vert[0], &vert[1], &vert[2], &vert[3]);
1142            poly_render_triangle_fan(poly, NULL, &Machine->screen[0].visarea, callback, 3, numverts, &clipvert[0]);
11351143            poly_wait(poly, "Normal");
11361144
11371145            if (single_step)
11381146               while (!single_step_advance) video_frame_update(TRUE);
11391147         }
1140         else if (data[datanum] == 0x0c018000/* mk4 */ || data[datanum] == 0x0c008000/* invasn */)
1141            next_addr_and_count = data[datanum + 1];
1148         else if ((UINT32)data[datanum] == 0x0c018000/* mk4 */ || (UINT32)data[datanum] == 0x0c008000/* invasn */)
1149            next_addr_and_count = data[datanum] >> 32;
11421150      }
11431151      if (datanum != count)
11441152         logerror("Overran data\n");
r1386r1387
11831191         break;
11841192
11851193      case 0xf6:      // status -- they wait for this & 9 == 0
1194         // value & $9600 must == $9600 to pass Zeus system test
1195         result = 0x9600;
11861196         if (zeusbase[0xb6] == 0x80040000)
1187            result = 1;
1188         else
1189            result = 0;
1197            result |= 1;
11901198         logit = 0;
11911199         break;
11921200   }
r1386r1387
12521260
12531261static void zeus_write_16bit(offs_t offset, UINT16 data, int logit)
12541262{
1263   /* writes to register $CC need to force a partial update */
1264   if ((offset & ~1) == 0xcc)
1265      video_screen_update_partial(0, video_screen_get_vpos(0));
1266
12551267   /* write to high part on odd addresses */
12561268   if (offset & 1)
12571269      zeusbase[offset & ~1] = (zeusbase[offset & ~1] & 0x0000ffff) | (data << 16);
r1386r1387
12721284
12731285static void zeus_write_32bit(offs_t offset, UINT32 data, int logit)
12741286{
1287   /* writes to register $CC need to force a partial update */
1288   if ((offset & ~1) == 0xcc)
1289      video_screen_update_partial(0, video_screen_get_vpos(0));
1290
12751291   /* always write to low word? */
12761292   zeusbase[offset & ~1] = data;
12771293
r1386r1387
14391455         {
14401456            if ((zeusbase[0x80] & 0xffffff) == 0x22FCFF)
14411457            {
1442               int startx, stopx, starty, stopy;
1443               int x, y;
14441458               // zeusbase[0x00] = color
14451459               // zeusbase[0x02] = ??? = 0x000C0000
14461460               // zeusbase[0x04] = ??? = 0x00000E01
r1386r1387
14631477               // zeusbase[0x46] = ??? = 0x00000000
14641478               // zeusbase[0x4c] = ??? = 0x00808080 (brightness?)
14651479               // zeusbase[0x4e] = ??? = 0x00808080 (brightness?)
1466               startx = (zeusbase[0x08] & 0xffff);
1467               starty = zeusbase[0x08] >> 16;
1468               stopx = (zeusbase[0x0c] & 0xffff);
1469               stopy = zeusbase[0x0c] >> 16;
1470               for (y = starty; y <= stopy; y++)
1471                  for (x = startx; x <= stopx; x++)
1472                     waveram[(1 * WAVERAM_HEIGHT + (y % WAVERAM_HEIGHT)) * WAVERAM_WIDTH + x] = zeusbase[0x00];
1480               poly_extra_data *extra = poly_get_extra_data(poly);
1481               poly_vertex vert[4];
1482
1483               vert[0].x = (INT16)zeusbase[0x08];
1484               vert[0].y = (INT16)(zeusbase[0x08] >> 16);
1485               vert[1].x = (INT16)zeusbase[0x0a];
1486               vert[1].y = (INT16)(zeusbase[0x0a] >> 16);
1487               vert[2].x = (INT16)zeusbase[0x0c];
1488               vert[2].y = (INT16)(zeusbase[0x0c] >> 16);
1489               vert[3].x = (INT16)zeusbase[0x0e];
1490               vert[3].y = (INT16)(zeusbase[0x0e] >> 16);
1491
1492               extra->transcolor = zeusbase[0x00];
1493
1494               poly_render_quad(poly, NULL, &Machine->screen[0].visarea, render_poly_solid, 0, &vert[0], &vert[1], &vert[2], &vert[3]);
1495               poly_wait(poly, "Normal");
1496
14731497   single_step = input_code_pressed(KEYCODE_S);
14741498   if (single_step)
14751499      popmessage("Single Step");
r1386r1387
14831507      case 0xb2:
14841508         if ((zeusbase[0xb6] >> 16) != 0)
14851509         {
1486            UINT32 *dest = zeus_pixaddr();
14871510            if ((offset == 0xb0 && (zeusbase[0xb6] & 0x02000000) == 0) ||
14881511               (offset == 0xb2 && (zeusbase[0xb6] & 0x02000000) != 0))
14891512            {
1513               UINT16 *dest = (UINT16 *)waveram_ptr_from_expanded_addr(zeusbase[0xb6] >> 31, zeusbase[0xb4]);
14901514               if (zeusbase[0xb6] & 0x00100000)
1491                  dest[0] = (dest[0] & 0xffff0000) | (zeusbase[0xb0] & 0x0000ffff);
1515                  dest[BYTE4_XOR_LE(0)] = zeusbase[0xb0];
14921516               if (zeusbase[0xb6] & 0x00200000)
1493                  dest[0] = (dest[0] & 0x0000ffff) | (zeusbase[0xb0] & 0xffff0000);
1517                  dest[BYTE4_XOR_LE(1)] = zeusbase[0xb0] >> 16;
14941518               if (zeusbase[0xb6] & 0x00400000)
1495                  dest[1] = (dest[1] & 0xffff0000) | (zeusbase[0xb2] & 0x0000ffff);
1519                  dest[BYTE4_XOR_LE(2)] = zeusbase[0xb2];
14961520               if (zeusbase[0xb6] & 0x00800000)
1497                  dest[1] = (dest[1] & 0x0000ffff) | (zeusbase[0xb2] & 0xffff0000);
1521                  dest[BYTE4_XOR_LE(3)] = zeusbase[0xb2] >> 16;
14981522               if (zeusbase[0xb6] & 0x00020000)
14991523                  zeusbase[0xb4]++;
15001524            }
r1386r1387
15041528      case 0xb4:
15051529         if (zeusbase[0xb6] & 0x00010000)
15061530         {
1507            UINT32 *src = zeus_pixaddr();
1508            zeusbase[0xb0] = src[0];
1509            zeusbase[0xb2] = src[1];
1531            const UINT64 *src = waveram_ptr_from_expanded_addr(zeusbase[0xb6] >> 31, zeusbase[0xb4]);
1532            zeusbase[0xb0] = *src;
1533            zeusbase[0xb2] = *src >> 32;
15101534         }
15111535         break;
15121536
1513      case 0x84:
1514         /* MK4: Written in tandem with 0xcc */
1515         /* MK4: Writes either 0x80 (and 0x000000 to 0xcc) or 0x00 (and 0x800000 to 0xcc) */
1516         break;
1517
1518      case 0xcc:
1519         /* see 0x84 above */
1520         break;
1521
15221537      case 0x70:
15231538         zeus_point[0] = zeusbase[0x70] << 16;
15241539         break;
r1386r1387
15341549      case 0x4e:
15351550         zeus_blend = zeusbase[0x4e];
15361551         break;
1537//          if ((zeuscmd_buffer[0] >> 16) == 0x1770)
1538//              zeus_point[0] = zeuscmd_buffer[0] << 16;
1539//          if ((zeuscmd_buffer[0] >> 16) == 0x1772)
1540//              zeus_point[1] = zeuscmd_buffer[0] << 16;
1541//          if ((zeuscmd_buffer[0] >> 16) == 0x1774)
1542//              zeus_point[2] = zeuscmd_buffer[0] << 16;
1543//          if ((zeuscmd_buffer[0] >> 16) == 0x18ce)
1544//              zeus_blend = zeuscmd_buffer[1];
15451552
15461553      case 0x52:
15471554         zeusbase[0xb2] = zeusbase[0x52];
15481555         break;
1549//          if ((zeuscmd_buffer[0] >> 16) == 0x1752)
1550//          {
1551//              zeusbase[0xb2] = zeuscmd_buffer[0];
1552//              zeus_enable_logging = 1;
1553//          }
15541556
1557      case 0xcc:
1558         video_screen_update_partial(0, video_screen_get_vpos(0));
1559         break;
1560
1561      case 0x84:
1562         /* MK4: Written in tandem with 0xcc */
1563         /* MK4: Writes either 0x80 (and 0x000000 to 0xcc) or 0x00 (and 0x800000 to 0xcc) */
1564         zeus_renderbase = waveram_ptr_from_expanded_addr(1, zeusbase[0x84] << 16);
1565         break;
1566
15551567      case 0xe0:
15561568         zeuscmd_buffer[zeuscmd_buffer_words++] = zeusbase[0xe0];
15571569         if (zeuscmd_buffer_words == 1)
r1386r1387
15701582{
15711583   static struct
15721584   {
1573      UINT32 lab, checksum;
1585      UINT32 lab;
1586      UINT64 checksum;
15741587   } recent_entries[100];
15751588
15761589   UINT32 numoctets = (length_and_base >> 24) + 1;
1577   const UINT32 *ptr = waveram_ptr_from_addr(length_and_base);
1578   UINT32 checksum = length_and_base;
1590   const UINT64 *ptr = waveram_ptr_from_block_addr(0, length_and_base);
1591   UINT64 checksum = length_and_base;
15791592   int foundit = FALSE;
15801593   int i;
15811594
15821595   for (i = 0; i < numoctets; i++)
1583      checksum += ptr[i * 2 + 0] + ptr[i * 2 + 1];
1596      checksum += ptr[i];
15841597
15851598   for (i = 0; i < ARRAY_LENGTH(recent_entries); i++)
15861599      if (recent_entries[i].lab == length_and_base && recent_entries[i].checksum == checksum)
r1386r1387
16011614      return;
16021615
16031616   for (i = 0; i < numoctets; i++)
1604      logerror("\t%02X: %08X %08X\n", i, ptr[i * 2 + 0], ptr[i * 2 + 1]);
1617      logerror("\t%02X: %08X %08X\n", i, (UINT32)ptr[i], (UINT32)(ptr[i] >> 32));
16051618}
16061619
16071620
16081621static void zeuscmd_execute(int words)
16091622{
16101623   static int colorcount;
1611   int logcmd = 1;//input_code_pressed(KEYCODE_L);
1624   int logcmd = input_code_pressed(KEYCODE_L);
16121625   int wordnum;
16131626
16141627/* command observations:
r1386r1387
16611674        25000000 007F0018 01000400 B0F60008 -- during diagnostics screen
16621675        25000080 007F0018 01000400 B0F60008 -- alternate frames during text screen
16631676
1677        25008000 0000F833 A8040E4C 0000F8C0 A8FC0BD9 0000F731 08FC0B7F 0000F6A4 08040DF2 21010000
1678        25800000 FE58FD0C 00000000 FE58FD10 00000000 FE74FD10 00000000 FE74FD0C 00000000 200C0000
16641679
1680
16651681    write to ($60) = 1 after setting up:
16661682
16671683
r1386r1387
16981714            case 0x00c040:
16991715               if (logcmd)
17001716                  logerror(" -- setptr(palbase)\n");
1701               zeus_palbase = waveram_ptr_from_addr(zeuscmd_buffer[1]);
1717               zeus_palbase = waveram_ptr_from_block_addr(0, zeuscmd_buffer[1]);
17021718               break;
17031719
17041720            case 0x80c0a5:
r1386r1387
18331849
18341850      case 0x25:
18351851      case 0x30:      /* invasn */
1852         if (word & 0x808000)
1853            return 10;
18361854         return 4;   /* ??? */
18371855
18381856      case 0x1c:
src/mame/video/dkong.c
r1386r1387
1515#define RADARSCP_GRID_COL_OFFSET      (RADARSCP_BCK_COL_OFFSET + 256)
1616#define RADARSCP_STAR_COL            (RADARSCP_GRID_COL_OFFSET + 8)
1717
18#define HW_TRS01         1
19#define HW_TRS02         2
20#define HW_DK4            4
21
22static tilemap *bg_tilemap;
23
24static mame_bitmap *bg_bits;
25static const UINT8 *color_codes;
26static emu_timer *scanline_timer;
27
2818static const double cd4049_vl = 1.5/5.0;
2919static const double cd4049_vh = 3.5/5.0;
3020static const double cd4049_al = 0.01;
3121
32static UINT8   sig30Hz = 0;
33static UINT8   grid_sig = 0;
34static UINT8   rflip_sig = 0;
35static UINT8   star_ff = 0;
36
37static int   blue_level = 0;
38static double cd4049_a, cd4049_b;
39
40/* Save state relevant */
41
42static UINT8   gfx_bank, palette_bank;
43static UINT8   grid_on;
44static UINT8   snd02_enable;
45static UINT8   sig_ansn;
46static UINT16   grid_col;
47static UINT8   vid_hw;
48static UINT8   sprite_bank;
49
5022/***************************************************************************
5123
5224  Convert the color PROMs into a more useable format.
r1386r1387
156128   }
157129};
158130
131static const res_net_info radarscp_net_bck_info =
132{
133   RES_NET_VCC_5V | RES_NET_VBIAS_TTL | RES_NET_VIN_MB7052 |  RES_NET_MONITOR_SANYO_EZV20,
134   {
135      { RES_NET_AMP_DARLINGTON, 470,      0, 0, { 0 } },
136      { RES_NET_AMP_DARLINGTON, 470,      0, 0, { 0 } },
137      { RES_NET_AMP_DARLINGTON, 680, 150000, 0, { 0 } }    // radarscp
138   }
139};
140
159141/*
160142    radarsc1 interface
161143
r1386r1387
188170
189171/* Dummy struct to generate background palette entries */
190172
191static const res_net_info radarscp_bck_net_info =
173static const res_net_info radarscp_blue_net_info =
192174{
193175   RES_NET_VCC_5V | RES_NET_VBIAS_5V | RES_NET_VIN_VCC | RES_NET_MONITOR_SANYO_EZV20,
194176   {
195      { RES_NET_AMP_DARLINGTON,    1,   0, 0, { 0 } },   // bias/gnd exist in schematics, but not readable
196      { RES_NET_AMP_DARLINGTON,    1,   0, 0, { 0 } },   // bias/gnd exist in schematics, but not readable
197      { RES_NET_AMP_DARLINGTON,    0,   0, 8, { 128,64,32,16,8,4,2,1 } },   // dummy
177      { RES_NET_AMP_DARLINGTON,  470, 4700, 0, { 0 } },   // bias/gnd exist in schematics, readable in TKG3 schematics
178      { RES_NET_AMP_DARLINGTON,  470, 4700, 0, { 0 } },   // bias/gnd exist in schematics, readable in TKG3 schematics
179      { RES_NET_AMP_DARLINGTON,    0,    0, 8, { 128,64,32,16,8,4,2,1 } },   // dummy
198180   }
199181};
200182
r1386r1387
216198
217199***************************************************************************/
218200
219PALETTE_INIT( dkong )
201PALETTE_INIT( dkong2b)
220202{
203   dkong_state *state = Machine->driver_data;
221204   rgb_t   *rgb;
222205   int i;
223206
r1386r1387
240223
241224   color_prom += 512;
242225   /* color_prom now points to the beginning of the character color codes */
243   color_codes = color_prom;   /* we'll need it later */
226   state->color_codes = color_prom;   /* we'll need it later */
244227   free(rgb);
245228}
246229
230PALETTE_INIT( dkong4b )
231{
232   dkong_state *state = Machine->driver_data;
233   int i;
234   int r,g,b;
235
236   for (i = 0;i < 256;i++)
237   {
238
239      /* red component */
240      r = compute_res_net( (color_prom[256]>>1) & 0x07, 0, &radarscp_net_info );
241      /* green component */
242      g = compute_res_net( ((color_prom[256]<<2) & 0x04) | ((color_prom[0]>>2) & 0x03), 1, &radarscp_net_info );
243      /* blue component */
244      b = compute_res_net( (color_prom[0]>>0) & 0x03, 2, &radarscp_net_info );
245
246      palette_set_color_rgb(machine,i,r,g,b);
247      color_prom++;
248   }
249
250   /* Now treat tri-state black background generation */
251
252   for (i=0;i<256;i++)
253      if ( (i & 0x03) == 0x00 )  // NOR => CS=1 => Tristate => real black
254      {
255         r = compute_res_net( 1, 0, &radarscp_net_bck_info );
256         g = compute_res_net( 1, 1, &radarscp_net_bck_info );
257         b = compute_res_net( 1, 2, &radarscp_net_bck_info );
258         palette_set_color_rgb(machine,i,r,g,b);
259      }
260
261   palette_normalize_range(machine->palette, 0, 255, 0, 255);
262
263   color_prom += 256;
264   /* color_prom now points to the beginning of the character color codes */
265   state->color_codes = color_prom;   /* we'll need it later */
266}
267
247268PALETTE_INIT( radarscp )
248269{
270   dkong_state *state = Machine->driver_data;
249271   int i;
250272   int r,g,b;
251273
r1386r1387
268290   for (i=0;i<256;i++)
269291      if ( (i & 0x03) == 0x00 )  // NOR => CS=1 => Tristate => real black
270292      {
271         r = compute_res_net( 1, 0, &dkong_net_bck_info );
272         g = compute_res_net( 1, 1, &dkong_net_bck_info );
273         b = compute_res_net( 1, 2, &dkong_net_bck_info );
293         r = compute_res_net( 1, 0, &radarscp_net_bck_info );
294         g = compute_res_net( 1, 1, &radarscp_net_bck_info );
295         b = compute_res_net( 1, 2, &radarscp_net_bck_info );
274296         palette_set_color_rgb(machine,i,r,g,b);
275297      }
276298
r1386r1387
283305   /* Oscillating background */
284306   for (i = 0;i < 256;i++)
285307   {
286      r = compute_res_net( 0, 0, &radarscp_bck_net_info );
287      g = compute_res_net( 0, 1, &radarscp_bck_net_info );
288      b = compute_res_net( i, 2, &radarscp_bck_net_info );
308      r = compute_res_net( 0, 0, &radarscp_blue_net_info );
309      g = compute_res_net( 0, 1, &radarscp_blue_net_info );
310      b = compute_res_net( i, 2, &radarscp_blue_net_info );
289311
290312      palette_set_color_rgb(machine,RADARSCP_BCK_COL_OFFSET + i,r,g,b);
291313   }
r1386r1387
299321
300322      palette_set_color_rgb(machine,RADARSCP_GRID_COL_OFFSET + i,r,g,b);
301323   }
324
302325   palette_normalize_range(machine->palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
303326
304
305
306327   color_prom += 256;
307328   /* color_prom now points to the beginning of the character color codes */
308   color_codes = color_prom;   /* we'll need it later */
329   state->color_codes = color_prom;   /* we'll need it later */
309330}
310331
311332PALETTE_INIT( radarsc1 )
312333{
334   dkong_state *state = Machine->driver_data;
313335   int i;
314336   int r,g,b;
315337
316   printf("Here\n");
317338   for (i = 0;i < 256;i++)
318339   {
319340
r1386r1387
348369   /* Oscillating background */
349370   for (i = 0;i < 256;i++)
350371   {
351      r = compute_res_net( 0, 0, &radarscp_bck_net_info );
352      g = compute_res_net( 0, 1, &radarscp_bck_net_info );
353      b = compute_res_net( i, 2, &radarscp_bck_net_info );
372      r = compute_res_net( 0, 0, &radarscp_blue_net_info );
373      g = compute_res_net( 0, 1, &radarscp_blue_net_info );
374      b = compute_res_net( i, 2, &radarscp_blue_net_info );
354375
355376      palette_set_color_rgb(machine,RADARSCP_BCK_COL_OFFSET + i,r,g,b);
356377   }
r1386r1387
368389
369390   color_prom += 512;
370391   /* color_prom now points to the beginning of the character color codes */
371   color_codes = color_prom;   /* we'll need it later */
392   state->color_codes = color_prom;   /* we'll need it later */
372393}
373394
374395
396
375397/***************************************************************************
376398
377399  Convert the color PROMs into a more useable format.
r1386r1387
409431
410432PALETTE_INIT( dkong3 )
411433{
412
434   dkong_state *state = Machine->driver_data;
413435   rgb_t   *rgb;
414436
415437   rgb = compute_res_net_all(color_prom, &dkong3_decode_info, &dkong3_net_info);
r1386r1387
419441
420442   color_prom += 1024;
421443   /* color_prom now points to the beginning of the character color codes */
422   color_codes = color_prom;   /* we'll need it later */
444   state->color_codes = color_prom;   /* we'll need it later */
423445}
424446
425447static TILE_GET_INFO( dkong_bg_tile_info )
426448{
427   int code = videoram[tile_index] + 256 * gfx_bank;
428   int color = (color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * palette_bank;
449   dkong_state *state = machine->driver_data;
450   int code = videoram[tile_index] + 256 * state->gfx_bank;
451   int color = (state->color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * state->palette_bank;
429452
430453   SET_TILE_INFO(0, code, color, 0);
431454}
432455
433456static TILE_GET_INFO( radarsc1_bg_tile_info )
434457{
435   int code = videoram[tile_index] + 256 * gfx_bank;
436   int color = (color_codes[tile_index % 32] & 0x0f);
437   color = color | (palette_bank<<4);
458   dkong_state *state = machine->driver_data;
459   int code = videoram[tile_index] + 256 * state->gfx_bank;
460   int color = (state->color_codes[tile_index % 32] & 0x0f);
461   color = color | (state->palette_bank<<4);
438462
439463   SET_TILE_INFO(0, code, color, 0);
440464}
r1386r1387
447471
448472WRITE8_HANDLER( dkong_videoram_w )
449473{
474   dkong_state *state = Machine->driver_data;
475
450476   if (videoram[offset] != data)
451477   {
452478      videoram[offset] = data;
453      tilemap_mark_tile_dirty(bg_tilemap, offset);
479      tilemap_mark_tile_dirty(state->bg_tilemap, offset);
454480   }
455481}
456482
457483WRITE8_HANDLER( radarscp_snd02_w )
458484{
459   snd02_enable = data & 0x01;
485   dkong_state *state = Machine->driver_data;
486
487   state->snd02_enable = data & 0x01;
460488}
461489
462490WRITE8_HANDLER( radarsc1_ansn_w )
463491{
464   sig_ansn = data & 0x01;
492   dkong_state *state = Machine->driver_data;
493
494   state->sig_ansn = data & 0x01;
465495}
466496
467497WRITE8_HANDLER( dkongjr_gfxbank_w )
468498{
469   if (gfx_bank != (data & 0x01))
499   dkong_state *state = Machine->driver_data;
500
501   if (state->gfx_bank != (data & 0x01))
470502   {
471      gfx_bank = data & 0x01;
472      tilemap_mark_all_tiles_dirty(bg_tilemap);
503      state->gfx_bank = data & 0x01;
504      tilemap_mark_all_tiles_dirty(state->bg_tilemap);
473505   }
474506}
475507
476508WRITE8_HANDLER( dkong3_gfxbank_w )
477509{
478   if (gfx_bank != (~data & 0x01))
510   dkong_state *state = Machine->driver_data;
511
512   if (state->gfx_bank != (~data & 0x01))
479513   {
480      gfx_bank = ~data & 0x01;
481      tilemap_mark_all_tiles_dirty(bg_tilemap);
514      state->gfx_bank = ~data & 0x01;
515      tilemap_mark_all_tiles_dirty(state->bg_tilemap);
482516   }
483517}
484518
485519WRITE8_HANDLER( dkong_palettebank_w )
486520{
521   dkong_state *state = Machine->driver_data;
487522   int newbank;
488523
489   newbank = palette_bank;
524   newbank = state->palette_bank;
490525
491526   if (data & 1)
492527      newbank |= 1 << offset;
493528   else
494529      newbank &= ~(1 << offset);
495530
496   if (palette_bank != newbank)
531   if (state->palette_bank != newbank)
497532   {
498      palette_bank = newbank;
499      tilemap_mark_all_tiles_dirty(bg_tilemap);
533      state->palette_bank = newbank;
534      tilemap_mark_all_tiles_dirty(state->bg_tilemap);
500535   }
501536}
502537
503538WRITE8_HANDLER( radarscp_grid_enable_w )
504539{
505   grid_on = data & 0x01;
540   dkong_state *state = Machine->driver_data;
541
542   state->grid_on = data & 0x01;
506543}
507544
508545WRITE8_HANDLER( radarscp_grid_color_w )
509546{
510   grid_col = (data & 0x07) ^ 0x07;
511   popmessage("Gridcol: %d", grid_col);
547   dkong_state *state = Machine->driver_data;
548
549   state->grid_col = (data & 0x07) ^ 0x07;
550   popmessage("Gridcol: %d", state->grid_col);
512551}
513552
514553WRITE8_HANDLER( dkong_flipscreen_w )
r1386r1387
518557
519558WRITE8_HANDLER( dkong_spritebank_w )
520559{
521   sprite_bank = data & 0x01;
560   dkong_state *state = Machine->driver_data;
561
562   state->sprite_bank = data & 0x01;
522563}
523564
524565/***************************************************************************
r1386r1387
529570
530571static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, UINT32 mask_bank, UINT32 shift_bits)
531572{
573   dkong_state *state = machine->driver_data;
532574   int offs;
533575
534576   /* Draw the sprites. */
535   for (offs = sprite_bank<<9;offs < (sprite_bank<<9) + spriteram_size; offs += 4)
577   for (offs = state->sprite_bank<<9;offs < (state->sprite_bank<<9) + 0x200 /* spriteram_size */; offs += 4)
536578   {
537579      if (spriteram[offs])
538580      {
r1386r1387
554596
555597            drawgfx(bitmap,machine->gfx[1],
556598                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
557                  (spriteram[offs + 2] & 0x0f) + 16 * palette_bank,
599                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
558600                  !(spriteram[offs + 2] & 0x80),!(spriteram[offs + 1] & 0x80),
559601                  x,y,
560602                  cliprect,TRANSPARENCY_PEN,0);
r1386r1387
562604            /* draw with wrap around - this fixes the 'beheading' bug */
563605            drawgfx(bitmap,machine->gfx[1],
564606                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
565                  (spriteram[offs + 2] & 0x0f) + 16 * palette_bank,
607                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
566608                  (spriteram[offs + 2] & 0x80),(spriteram[offs + 1] & 0x80),
567609                  x-256,y,
568610                  cliprect,TRANSPARENCY_PEN,0);
r1386r1387
571613         {
572614            drawgfx(bitmap,machine->gfx[1],
573615                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
574                  (spriteram[offs + 2] & 0x0f) + 16 * palette_bank,
616                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
575617                  (spriteram[offs + 2] & 0x80),(spriteram[offs + 1] & 0x80),
576618                  x,y,
577619                  cliprect,TRANSPARENCY_PEN,0);
r1386r1387
579621            /* draw with wrap around - this fixes the 'beheading' bug */
580622            drawgfx(bitmap,machine->gfx[1],
581623                  (spriteram[offs + 1] & 0x7f) + ((spriteram[offs + 2] & mask_bank) << shift_bits),
582                  (spriteram[offs + 2] & 0x0f) + 16 * palette_bank,
624                  (spriteram[offs + 2] & 0x0f) + 16 * state->palette_bank,
583625                  (spriteram[offs + 2] & 0x80),(spriteram[offs + 1] & 0x80),
584626                  x+256,y,
585627                  cliprect,TRANSPARENCY_PEN,0);
r1386r1387
606648 * TODO: This should be part of the vblank routine
607649 */
608650
609INLINE double CD4049(double x)
651INLINE double CD4049(running_machine *machine, double x)
610652{
653   dkong_state *state = machine->driver_data;
654
611655   if (x>0)
612       return exp(-cd4049_a * pow(x,cd4049_b));
656       return exp(-state->cd4049_a * pow(x,state->cd4049_b));
613657   else
614658      return 1.0;
615659}
r1386r1387
618662 * a period of roughly 4.4 ms
619663 */
620664
621static void radarscp_step(int line_cnt)
665static void radarscp_step(running_machine *machine, int line_cnt)
622666{
667   dkong_state *state = machine->driver_data;
623668   /* Condensator is illegible in schematics for TRS2 board.
624669     * TRS1 board states 3.3u.
625670     */
r1386r1387
649694   if (line_cnt>=512)
650695      line_cnt=512-VTOTAL;
651696   if ( ( !(line_cnt & 0x40) && ((line_cnt+1) & 0x40) ) && (mame_rand(Machine) > RAND_MAX/2))
652      sig30Hz = (1-sig30Hz);
653   rflip_sig = snd02_enable & sig30Hz;
654   sig = rflip_sig ^ ((line_cnt & 0x80)>>7);
655   if (vid_hw & HW_TRS01)
656      rflip_sig = !rflip_sig;
697      state->sig30Hz = (1-state->sig30Hz);
698   state->rflip_sig = state->snd02_enable & state->sig30Hz;
699   sig = state->rflip_sig ^ ((line_cnt & 0x80)>>7);
700   if (state->hardware_type == HARDWARE_TRS01)
701      state->rflip_sig = !state->rflip_sig;
657702   if  (sig) // 128VF
658703      diff = (0.0 - cv1);
659704   else
r1386r1387
666711   cv2 += diff;
667712
668713   vg1 = (cv1 - cv2)*0.9 + 0.1 * vg2;
669   vg2 = 5*CD4049(vg1/5);
714   vg2 = 5*CD4049(machine, vg1/5);
670715
671716   /* on the real hardware, the gain would be 1.
672717     * This will not work here.
673718     */
674719   vg3i = 0.9*vg2 + 0.1 * vg3;
675   vg3 = 5*CD4049(vg3i/5);
720   vg3 = 5*CD4049(machine, vg3i/5);
676721
677   blue_level = (int)(vg3/5.0*255);
722   state->blue_level = (int)(vg3/5.0*255);
678723
679724   // Grid signal
680   if (grid_on && sig_ansn)
725   if (state->grid_on && state->sig_ansn)
681726   {
682727      diff = (0.0 - cv3);
683728      diff = diff - diff*exp(0.0 - (1.0/RC32 * dt) );
r1386r1387
693738   diff = diff - diff*exp(0.0 - (1.0/RC4 * dt) );
694739   cv4 += diff;
695740
696   if (CD4049(CD4049(vg2 - cv4))>2.4/5.0) //TTL - Level
697      grid_sig = 0;
741   if (CD4049(machine, CD4049(machine, vg2 - cv4))>2.4/5.0) //TTL - Level
742      state->grid_sig = 0;
698743   else
699      grid_sig = 1;
744      state->grid_sig = 1;
700745
701746   /* stars */
702747   pixelcnt += HTOTAL;
703748   if (pixelcnt > period2 )
704749   {
705      star_ff = !star_ff;
750      state->star_ff = !state->star_ff;
706751      pixelcnt = pixelcnt - period2;
707752   }
708753
r1386r1387
710755
711756static void radarscp_draw_background(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
712757{
758   dkong_state *state = machine->driver_data;
713759   const UINT8    *htable = NULL;
714760   int          x,y;
715761   UINT8          draw_ok;
716762   UINT16          *pixel;
717763
718   if (vid_hw & HW_TRS01)
764   if (state->hardware_type == HARDWARE_TRS01)
719765      htable = memory_region(REGION_GFX4);
720766
721767   y = machine->screen[0].visarea.min_y;
r1386r1387
726772      {
727773         pixel = BITMAP_ADDR16(bitmap, y, x);
728774         draw_ok = !(*pixel & 0x01) && !(*pixel & 0x02);
729         if (vid_hw & HW_TRS01) // Check again from schematics
730            draw_ok = draw_ok  && !((htable[ (!rflip_sig<<7) | (x>>2)] >>2) & 0x01);
775         if (state->hardware_type == HARDWARE_TRS01) // Check again from schematics
776            draw_ok = draw_ok  && !((htable[ (!state->rflip_sig<<7) | (x>>2)] >>2) & 0x01);
731777         if (draw_ok)
732            *pixel = *(BITMAP_ADDR16(bg_bits, y, x));
778            *pixel = *(BITMAP_ADDR16(state->bg_bits, y, x));
733779         x++;
734780      }
735781      y++;
r1386r1387
739785
740786static TIMER_CALLBACK( scanline_callback )
741787{
788   dkong_state *state = machine->driver_data;
742789   const UINT8 *table = memory_region(REGION_GFX3);
743790   int       table_len = memory_region_length(REGION_GFX3);
744791   int          x,y,offset;
r1386r1387
747794   int scanline = param;
748795
749796   y = scanline;
750   radarscp_step(y);
797   radarscp_step(machine, y);
751798   if (y <= machine->screen[0].visarea.min_y || y > machine->screen[0].visarea.max_y)
752799      counter = 0;
753   offset = ((-flip_screen) ^ rflip_sig) ? 0x000 : 0x400;
800   offset = ((-flip_screen) ^ state->rflip_sig) ? 0x000 : 0x400;
754801   x = 0;
755802   while (x < machine->screen[0].width)
756803   {
757      pixel = BITMAP_ADDR16(bg_bits, y, x);
804      pixel = BITMAP_ADDR16(state->bg_bits, y, x);
758805      if ((counter < table_len) && (x == 4 * (table[counter|offset] & 0x7f)))
759806      {
760         if ( star_ff && (table[counter|offset] & 0x80) )   /* star */
807         if ( state->star_ff && (table[counter|offset] & 0x80) )   /* star */
761808            *pixel = machine->pens[RADARSCP_STAR_COL];
762         else if (grid_sig && !(table[counter|offset] & 0x80))         /* radar */
763            *pixel = machine->pens[RADARSCP_GRID_COL_OFFSET+grid_col];
809         else if (state->grid_sig && !(table[counter|offset] & 0x80))         /* radar */
810            *pixel = machine->pens[RADARSCP_GRID_COL_OFFSET+state->grid_col];
764811         else
765            *pixel = machine->pens[RADARSCP_BCK_COL_OFFSET + blue_level];
812            *pixel = machine->pens[RADARSCP_BCK_COL_OFFSET + state->blue_level];
766813         counter++;
767814      }
768815      else
769         *pixel = machine->pens[RADARSCP_BCK_COL_OFFSET + blue_level];
816         *pixel = machine->pens[RADARSCP_BCK_COL_OFFSET + state->blue_level];
770817      x++;
771818   }
772819   while ((counter < table_len) && ( x < 4 * (table[counter|offset] & 0x7f)))
773820      counter++;
774821   scanline = (scanline+1) % VTOTAL;
775822   /* come back at the next appropriate scanline */
776   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
823   timer_adjust(state->scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
777824}
778825
826static void check_palette(running_machine *machine)
827{
828   dkong_state *state = machine->driver_data;
829   int newset;
830   int num;
831
832   num = port_tag_to_index("VIDHW");
833   if (num>=0)
834   {
835      newset = readinputport(num);
836      if (newset != state->vidhw)
837      {
838         state->vidhw = newset;
839         switch (newset)
840         {
841            case 0x00:
842               palette_init_radarscp(machine, (UINT16 *) machine->game_colortable, memory_region(REGION_PROMS));
843               break;
844            case 0x01:
845               palette_init_dkong2b(machine, (UINT16 *) machine->game_colortable, memory_region(REGION_PROMS));
846               break;
847         }
848      }
849   }
850}
851
779852static VIDEO_START( dkong_base )
780853{
854   dkong_state *state = machine->driver_data;
781855
782   cd4049_b = (log(0.0 - log(cd4049_al)) - log(0.0 - log((1.0-cd4049_al))) ) / log(cd4049_vh/cd4049_vl);
783   cd4049_a = log(0.0 - log(cd4049_al)) - cd4049_b * log(cd4049_vh);
856   state->cd4049_b = (log(0.0 - log(cd4049_al)) - log(0.0 - log((1.0-cd4049_al))) ) / log(cd4049_vh/cd4049_vl);
857   state->cd4049_a = log(0.0 - log(cd4049_al)) - state->cd4049_b * log(cd4049_vh);
784858
785   gfx_bank = 0;
786   palette_bank = 0;
787   sprite_bank = 0;
788   sig_ansn = 1;
789   vid_hw = HW_DK4;
859   state->gfx_bank = 0;
860   state->palette_bank = 0;
861   state->sprite_bank = 0;
862   state->sig_ansn = 1;
863   state->vidhw = -1;
790864
791   state_save_register_global(gfx_bank);
792   state_save_register_global(palette_bank);
793   state_save_register_global(sprite_bank);
794   state_save_register_global(grid_on);
865   state_save_register_global(state->gfx_bank);
866   state_save_register_global(state->palette_bank);
867   state_save_register_global(state->sprite_bank);
868   state_save_register_global(state->grid_on);
795869
796   state_save_register_global(snd02_enable);
797   state_save_register_global(sig_ansn);
798   state_save_register_global(grid_col);
870   state_save_register_global(state->snd02_enable);
871   state_save_register_global(state->sig_ansn);
872   state_save_register_global(state->grid_col);
799873
800874   /* this must be registered here - hmmm */
801875   state_save_register_global(flip_screen);
r1386r1387
804878
805879VIDEO_START( dkong )
806880{
881   dkong_state *state = machine->driver_data;
807882
808883   video_start_dkong_base(machine);
809884
810   bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
811   tilemap_set_scrolldx(bg_tilemap, 0, 128);
812}
885   switch (state->hardware_type)
886   {
887      case HARDWARE_TRS02:
888         state->bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
889         state->scanline_timer = timer_alloc(scanline_callback, NULL);
890         timer_adjust(state->scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
891          /* fall through */
892      case HARDWARE_TKG04:
893      case HARDWARE_TKG02:
894         state->bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
895         tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
896         break;
897      case HARDWARE_TRS01:
898         state->bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
899         tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
813900
814VIDEO_START( radarscp )
815{
901         state->bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
816902
817   video_start_dkong(machine);
818
819   vid_hw = HW_TRS02;
820
821   bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
822
823    scanline_timer = timer_alloc(scanline_callback, NULL);
824    timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
825
903         state->scanline_timer = timer_alloc(scanline_callback, NULL);
904         timer_adjust(state->scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
905         break;
906      default:
907         fatalerror("Invalid hardware type in dkong_video_start");
908   }
826909}
827910
828VIDEO_START( radarsc1 )
911VIDEO_UPDATE( dkong )
829912{
913   dkong_state *state = machine->driver_data;
830914
831   video_start_dkong_base(machine);
832
833   vid_hw = HW_TRS01;
834
835   bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
836   tilemap_set_scrolldx(bg_tilemap, 0, 128);
837
838   bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
839
840    scanline_timer = timer_alloc(scanline_callback, NULL);
841    timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
842
843}
844
845VIDEO_UPDATE( radarscp )
846{
847
848   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
849   draw_sprites(machine, bitmap, cliprect, 0x40, 1);
850   radarscp_draw_background(machine, bitmap, cliprect);
851
915   switch (state->hardware_type)
916   {
917      case HARDWARE_TKG02:
918      case HARDWARE_TKG04:
919         check_palette(machine);
920         tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
921         draw_sprites(machine, bitmap, cliprect, 0x40, 1);
922         break;
923      case HARDWARE_TRS01:
924      case HARDWARE_TRS02:
925         tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
926         draw_sprites(machine, bitmap, cliprect, 0x40, 1);
927         radarscp_draw_background(machine, bitmap, cliprect);
928         break;
929      default:
930         fatalerror("Invalid hardware type in dkong_video_update");
931   }
852932   return 0;
853933}
854934
855VIDEO_UPDATE( dkong )
856{
857   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
858   draw_sprites(machine, bitmap, cliprect, 0x40, 1);
859   return 0;
860}
861
862935VIDEO_UPDATE( pestplce )
863936{
937   dkong_state *state = machine->driver_data;
864938   int offs;
865939
866   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
940   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
867941
868942   /* Draw the sprites. */
869943   for (offs = 0;offs < spriteram_size;offs += 4)
r1386r1387
872946      {
873947         drawgfx(bitmap,machine->gfx[1],
874948               spriteram[offs + 2],
875               (spriteram[offs + 1] & 0x0f) + 16 * palette_bank,
949               (spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank,
876950               spriteram[offs + 1] & 0x80,spriteram[offs + 1] & 0x40,
877951               spriteram[offs + 3] - 8,240 - spriteram[offs] + 8,
878952               cliprect,TRANSPARENCY_PEN,0);
r1386r1387
883957
884958VIDEO_UPDATE( spclforc )
885959{
886   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
960   dkong_state *state = machine->driver_data;
887961
962   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
963
888964   /* it uses spriteram[offs + 2] & 0x10 for sprite bank */
889965   draw_sprites(machine, bitmap, cliprect, 0x10, 3);
890966   return 0;
src/mame/video/cps1.c
r1386r1387
230230   int kludge;  /* Ghouls n Ghosts sprite kludge */
231231};
232232
233static struct CPS1config *cps1_game_config;
233static const struct CPS1config *cps1_game_config;
234234
235235/*                 CPSB ID    multiply protection  ctrl     priority masks   unknwn     layer enable masks  */
236236#define CPS_B_01 0x00,0x0000, 0,0,0,0, /* n/a */   0x66,{0x68,0x6a,0x6c,0x6e},0x70, {0x02,0x04,0x08,0x30,0x30}
r1386r1387
262262#define HACK_B_1 0x00,0x0000, 0x00,0x00,0x00,0x00, 0x54,{0x52,0x50,0x4e,0x4c},0x5c, {0xff,0xff,0xff,0x00,0x00}
263263
264264
265static struct CPS1config cps1_config_table[]=
265static const struct CPS1config cps1_config_table[]=
266266{
267267   /* name       CPSB    banks        tile limits            kludge */
268268   {"forgottn",CPS_B_01, 0,0,0, 0x0000,0xffff,0x0000,0xffff, 7 },
r1386r1387
430430static MACHINE_RESET( cps )
431431{
432432   const char *gamename = machine->gamedrv->name;
433   struct CPS1config *pCFG=&cps1_config_table[0];
433   const struct CPS1config *pCFG=&cps1_config_table[0];
434434
435435   while(pCFG->name)
436436   {
src/mame/video/avgdvg.c
r1386r1387
263263static void dvg_draw_to(int x, int y, int intensity)
264264{
265265   if (((x | y) & 0x400) == 0)
266      vg_add_point_buf(xcenter + ((x - 0x200) << 16),
267                   ycenter - ((y - 0x200) << 16),
266      vg_add_point_buf((xmin + x - 512) << 16,
267                   (ymin + 512 - y) << 16,
268268                   VECTOR_COLOR111(7), intensity << 4);
269269}
270270
r1386r1387
12701270
12711271/*************************************
12721272 *
1273 *  Vector generator init
1274 *
1275 ************************************/
1276
1277static VIDEO_START( avgdvg )
1278{
1279   xmin = machine->screen[0].visarea.min_x;
1280   ymin = machine->screen[0].visarea.min_y;
1281   xmax = machine->screen[0].visarea.max_x;
1282   ymax = machine->screen[0].visarea.max_y;
1283
1284   xcenter = ((xmax + xmin) / 2) << 16;
1285   ycenter = ((ymax + ymin) / 2) << 16;
1286
1287   flip_x = flip_y = 0;
1288
1289   vg_halt_timer = timer_alloc(vg_set_halt_callback, NULL);
1290   vg_run_timer = timer_alloc(run_state_machine, NULL);
1291
1292   /*
1293     * The x and y DACs use 10 bit of the counter values which are in
1294     * two's complement representation. The DAC input is xored with
1295     * 0x200 to convert the value to unsigned.
1296     */
1297   vg->xdac_xor = 0x200;
1298   vg->ydac_xor = 0x200;
1299
1300   state_save_register_item("AVG", 0, vg->pc);
1301   state_save_register_item("AVG", 0, vg->sp);
1302   state_save_register_item("AVG", 0, vg->dvx);
1303   state_save_register_item("AVG", 0, vg->dvy);
1304   state_save_register_item("AVG", 0, vg->dvy12);
1305   state_save_register_item("AVG", 0, vg->timer);
1306   state_save_register_item_array("AVG", 0, vg->stack);
1307   state_save_register_item("AVG", 0, vg->data);
1308   state_save_register_item("AVG", 0, vg->state_latch);
1309   state_save_register_item("AVG", 0, vg->int_latch);
1310   state_save_register_item("AVG", 0, vg->scale);
1311   state_save_register_item("AVG", 0, vg->bin_scale);
1312   state_save_register_item("AVG", 0, vg->intensity);
1313   state_save_register_item("AVG", 0, vg->color);
1314   state_save_register_item("AVG", 0, vg->enspkl);
1315   state_save_register_item("AVG", 0, vg->spkl_shift);
1316   state_save_register_item("AVG", 0, vg->map);
1317   state_save_register_item("AVG", 0, vg->hst);
1318   state_save_register_item("AVG", 0, vg->lst);
1319   state_save_register_item("AVG", 0, vg->izblank);
1320   state_save_register_item("AVG", 0, vg->op);
1321   state_save_register_item("AVG", 0, vg->halt);
1322   state_save_register_item("AVG", 0, vg->sync_halt);
1323   state_save_register_item("AVG", 0, vg->xdac_xor);
1324   state_save_register_item("AVG", 0, vg->ydac_xor);
1325   state_save_register_item("AVG", 0, vg->xpos);
1326   state_save_register_item("AVG", 0, vg->ypos);
1327   state_save_register_item("AVG", 0, vg->clipx_min);
1328   state_save_register_item("AVG", 0, vg->clipy_min);
1329   state_save_register_item("AVG", 0, vg->clipx_max);
1330   state_save_register_item("AVG", 0, vg->clipy_max);
1331
1332   video_start_vector(machine);
1333}
1334
1335
1336/*************************************
1337 *
13381273 *  Configuration of VG variants
13391274 *
13401275 *************************************/
r1386r1387
14681403
14691404/*************************************
14701405 *
1471 *  Video startup
1406 *  Vector generator init
14721407 *
14731408 ************************************/
14741409
1410static void register_state (void)
1411{
1412   state_save_register_item("AVG", 0, vg->pc);
1413   state_save_register_item("AVG", 0, vg->sp);
1414   state_save_register_item("AVG", 0, vg->dvx);
1415   state_save_register_item("AVG", 0, vg->dvy);
1416   state_save_register_item("AVG", 0, vg->dvy12);
1417   state_save_register_item("AVG", 0, vg->timer);
1418   state_save_register_item_array("AVG", 0, vg->stack);
1419   state_save_register_item("AVG", 0, vg->data);
1420   state_save_register_item("AVG", 0, vg->state_latch);
1421   state_save_register_item("AVG", 0, vg->int_latch);
1422   state_save_register_item("AVG", 0, vg->scale);
1423   state_save_register_item("AVG", 0, vg->bin_scale);
1424   state_save_register_item("AVG", 0, vg->intensity);
1425   state_save_register_item("AVG", 0, vg->color);
1426   state_save_register_item("AVG", 0, vg->enspkl);
1427   state_save_register_item("AVG", 0, vg->spkl_shift);
1428   state_save_register_item("AVG", 0, vg->map);
1429   state_save_register_item("AVG", 0, vg->hst);
1430   state_save_register_item("AVG", 0, vg->lst);
1431   state_save_register_item("AVG", 0, vg->izblank);
1432   state_save_register_item("AVG", 0, vg->op);
1433   state_save_register_item("AVG", 0, vg->halt);
1434   state_save_register_item("AVG", 0, vg->sync_halt);
1435   state_save_register_item("AVG", 0, vg->xdac_xor);
1436   state_save_register_item("AVG", 0, vg->ydac_xor);
1437   state_save_register_item("AVG", 0, vg->xpos);
1438   state_save_register_item("AVG", 0, vg->ypos);
1439   state_save_register_item("AVG", 0, vg->clipx_min);
1440   state_save_register_item("AVG", 0, vg->clipy_min);
1441   state_save_register_item("AVG", 0, vg->clipx_max);
1442   state_save_register_item("AVG", 0, vg->clipy_max);
1443}
1444
1445static VIDEO_START( avg_common )
1446{
1447   xmin = machine->screen[0].visarea.min_x;
1448   ymin = machine->screen[0].visarea.min_y;
1449   xmax = machine->screen[0].visarea.max_x;
1450   ymax = machine->screen[0].visarea.max_y;
1451
1452   xcenter = ((xmax - xmin) / 2) << 16;
1453   ycenter = ((ymax - ymin) / 2) << 16;
1454
1455   flip_x = flip_y = 0;
1456
1457   vg_halt_timer = timer_alloc(vg_set_halt_callback, NULL);
1458   vg_run_timer = timer_alloc(run_state_machine, NULL);
1459
1460   /*
1461     * The x and y DACs use 10 bit of the counter values which are in
1462     * two's complement representation. The DAC input is xored with
1463     * 0x200 to convert the value to unsigned.
1464     */
1465   vg->xdac_xor = 0x200;
1466   vg->ydac_xor = 0x200;
1467
1468   register_state ();
1469   video_start_vector(machine);
1470}
1471
14751472VIDEO_START( dvg )
14761473{
14771474   vgc = &dvg_default;
14781475   vg = &vgd;
1479   video_start_avgdvg(machine);
1476
1477   xmin = machine->screen[0].visarea.min_x;
1478   ymin = machine->screen[0].visarea.min_y;
1479
1480   vg_halt_timer = timer_alloc(vg_set_halt_callback, NULL);
1481   vg_run_timer = timer_alloc(run_state_machine, NULL);
1482
1483   register_state ();
1484   video_start_vector(machine);
14801485}
14811486
14821487VIDEO_START( avg )
14831488{
14841489   vgc = &avg_default;
14851490   vg = &vgd;
1486   video_start_avgdvg(machine);
1491   video_start_avg_common(machine);
14871492}
14881493
14891494VIDEO_START( avg_starwars )
14901495{
14911496   vgc = &avg_starwars;
14921497   vg = &vgd;
1493   video_start_avgdvg(machine);
1498   video_start_avg_common(machine);
14941499}
14951500
14961501VIDEO_START( avg_tempest )
14971502{
14981503   vgc = &avg_tempest;
14991504   vg = &vgd;
1500   video_start_avgdvg(machine);
1505   video_start_avg_common(machine);
15011506}
15021507
15031508VIDEO_START( avg_mhavoc )
15041509{
15051510   vgc = &avg_mhavoc;
15061511   vg = &vgd;
1507   video_start_avgdvg(machine);
1512   video_start_avg_common(machine);
15081513}
15091514
15101515VIDEO_START( avg_bzone )
15111516{
15121517   vgc = &avg_bzone;
15131518   vg = &vgd;
1514   video_start_avgdvg(machine);
1519   video_start_avg_common(machine);
15151520}
15161521
15171522VIDEO_START( avg_quantum )
15181523{
15191524   vgc = &avg_quantum;
15201525   vg = &vgd;
1521   video_start_avgdvg(machine);
1526   video_start_avg_common(machine);
15221527}
15231528
src/mame/video/atari.c
r1386r1387
9393 * player/missile colors calculated for the first part (00-1F).
9494 * The priorities of combining priority bits (which games use!) are:
9595 ************************************************************************/
96static   UINT8   _pm_colors[32][8*2*8] = {
96static const UINT8 _pm_colors[32][8*2*8] = {
9797   {
9898      M0, PL0,P0, PL0,M1, PL1,P1, PL1,M2, PL2,P2, PL2,M3, PL3,P3, PL3,  // 00
9999      M0, PL0,P0, PL0,M1, PL1,P1, PL1,M2, PL2,P2, PL2,M3, PL3,P3, PL3,
r1386r1387
423423static void prio_init(void)
424424{
425425   int i, j, pm, p, c;
426   UINT8 * prio;
426   const UINT8 * prio;
427427
428428   /* 32 priority bit combinations */
429429   for( i = 0; i < 32; i++ )
src/mame/drivers/bfcobra.c
r1386r1387
6767    * escounts: Colours are completely wrong. Is there a palette register
6868    somewhere that affects blitter/video output?
6969    * qos: Game clock and score dividers aren't drawn (needs line draw mode)
70
70    * all games bar qos: NVRAM not saved.
7171******************************************************************************/
7272#include "driver.h"
7373#include "debugger.h"
7474#include "machine/6850acia.h"
75#include "machine/meters.h"
7576#include "cpu/z80/z80.h"
7677#include "cpu/m6809/m6809.h"
7778#include "sound/upd7759.h"
r1386r1387
11341135   return meter_latch;
11351136}
11361137
1137/* TODO */
1138/* TODO: This is borrowed from Scorpion 1 */
11381139static WRITE8_HANDLER( meter_w )
11391140{
1140   //int changed = meter_latch ^ data;
1141   int i;
1142   int  changed = meter_latch ^ data;
1143   long cycles  = ATTOTIME_TO_CYCLES(0, timer_get_time() );
11411144
11421145   meter_latch = data;
11431146
r1386r1387
11451148        When a meter is triggered, the current drawn is sensed. If a meter
11461149        is connected, the /FIRQ line will be pulsed.
11471150    */
1148   if ( data )
1149   {
1150      cpunum_set_input_line(1, M6809_FIRQ_LINE, PULSE_LINE );
1151   }
1151
1152   for (i = 0; i<8; i++)
1153    {
1154      if ( changed & (1 << i) )
1155      {
1156         Mechmtr_update(i, cycles, data & (1 << i) );
1157         cpunum_set_input_line(1, M6809_FIRQ_LINE, PULSE_LINE );
1158      }
1159    }
11521160}
11531161
11541162/* TODO */
r1386r1387
12271235ADDRESS_MAP_END
12281236
12291237static INPUT_PORTS_START( bfcobra )
1230PORT_START_TAG("STROBE0")
1238   PORT_START_TAG("STROBE0")
12311239   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("Coin: 10p")
12321240   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME("Coin: 20p")
12331241   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME("Coin: 50p")
12341242   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_NAME("Coin: 1 pound")
12351243   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12361244   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Green Test?") PORT_CODE(KEYCODE_F1)
1237   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1245   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Red Test?")
12381246   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
12391247
12401248   PORT_START_TAG("STROBE1")
r1386r1387
12581266   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12591267
12601268   PORT_START_TAG("STROBE3")
1261   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash box door") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
1262   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Unknown (resets)") PORT_CODE(KEYCODE_T) PORT_TOGGLE
1269   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_INTERLOCK) PORT_NAME("Cash box door") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
1270   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Front Door? (resets)") PORT_CODE(KEYCODE_T) PORT_TOGGLE
12631271   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
12641272   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12651273   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
src/mame/drivers/mitchell.c
r1386r1387
138138
139139***************************************************************************/
140140
141static struct EEPROM_interface eeprom_interface =
141static const struct EEPROM_interface eeprom_interface =
142142{
143143   6,      /* address bits */
144144   16,      /* data bits */
src/mame/drivers/rungun.c
r1386r1387
5757static int rng_z80_control;
5858static int rng_sound_status;
5959
60static struct EEPROM_interface eeprom_interface =
60static const struct EEPROM_interface eeprom_interface =
6161{
6262   7,         /* address bits */
6363   8,         /* data bits */
src/mame/drivers/senjyo.c
r1386r1387
649649
650650
651651
652static struct Samplesinterface senjyo_samples_interface =
652static const struct Samplesinterface senjyo_samples_interface =
653653{
654654   1,
655655   NULL,
src/mame/drivers/simpl156.c
r1386r1387
9999#include "deco16ic.h"
100100
101101static UINT32 *simpl156_systemram;
102static UINT8 *simpl156_default_eeprom;
102static const UINT8 *simpl156_default_eeprom;
103103
104104extern VIDEO_START( simpl156 );
105105extern VIDEO_UPDATE( simpl156 );
r1386r1387
10401040
10411041/* some default eeproms */
10421042
1043static UINT8 chainrec_eeprom[128] = {
1043static const UINT8 chainrec_eeprom[128] = {
10441044   0x52, 0x54, 0x00, 0x50, 0x00, 0x00, 0x39, 0x11, 0x41, 0x54, 0x00, 0x43, 0x00, 0x50, 0xFF, 0xFF,
10451045   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
10461046   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
r1386r1387
11091109
11101110*/
11111111
1112static UINT8 osman_eeprom[128] = {
1112static const UINT8 osman_eeprom[128] = {
11131113   0xFF, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11141114   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11151115   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
r1386r1387
11191119   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11201120   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
11211121};
1122static UINT8 candance_eeprom[128] = {
1122static const UINT8 candance_eeprom[128] = {
11231123   0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11241124   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11251125   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
r1386r1387
11291129   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11301130   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
11311131};
1132static UINT8 prtytime_eeprom[128] = {
1132static const UINT8 prtytime_eeprom[128] = {
11331133   0xAF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11341134   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11351135   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
r1386r1387
11401140   0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x7F, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF
11411141};
11421142
1143static UINT8 gangonta_eeprom[128] = {
1143static const UINT8 gangonta_eeprom[128] = {
11441144   0x2F, 0xFF, 0x2F, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0xED, 0xCB, 0xFF, 0xFF, 0xFF, 0xFF,
11451145   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
11461146   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
src/mame/drivers/thief.c
r1386r1387
417417
418418/***********************************************************/
419419
420static const char *sharkatt_sample_names[] =
420static const char *const sharkatt_sample_names[] =
421421{
422422   "*sharkatt",
423423   "talk.wav",
r1386r1387
425425   0   /* end of array */
426426};
427427
428static struct Samplesinterface sharkatt_samples_interface =
428static const struct Samplesinterface sharkatt_samples_interface =
429429{
430430   2,   /* number of channels */
431431   sharkatt_sample_names
r1386r1387
433433
434434/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
435435
436static const char *thief_sample_names[] =
436static const char *const thief_sample_names[] =
437437{
438438   "*thief",
439439   "talk.wav",
r1386r1387
441441   0   /* end of array */
442442};
443443
444static struct Samplesinterface thief_samples_interface =
444static const struct Samplesinterface thief_samples_interface =
445445{
446446   2,   /* number of channels */
447447   thief_sample_names
r1386r1387
449449
450450/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
451451
452static const char *natodef_sample_names[] =
452static const char *const natodef_sample_names[] =
453453{
454454   "*natodef",
455455   "talk.wav",
r1386r1387
457457   0   /* end of array */
458458};
459459
460static struct Samplesinterface natodef_samples_interface =
460static const struct Samplesinterface natodef_samples_interface =
461461{
462462   2,   /* number of channels */
463463   natodef_sample_names
src/mame/drivers/policetr.c
r1386r1387
269269 *
270270 *************************************/
271271
272static struct EEPROM_interface eeprom_interface_policetr =
272static const struct EEPROM_interface eeprom_interface_policetr =
273273{
274274   8,            // address bits 8
275275   16,            // data bits    16
src/mame/drivers/seibuspi.c
r1386r1387
16991699}
17001700
17011701/* this is a 93C46 but with reset delay */
1702static struct EEPROM_interface eeprom_interface =
1702static const struct EEPROM_interface eeprom_interface =
17031703{
17041704   6,            /* address bits */
17051705   16,            /* data bits */
src/mame/drivers/gaplus.c
r1386r1387
737737   REGION_SOUND1   /* memory region */
738738};
739739
740static const char *gaplus_sample_names[] =
740static const char *const gaplus_sample_names[] =
741741{
742742   "*gaplus",
743743   "bang.wav",
744744   0
745745};
746746
747static struct Samplesinterface samples_interface =
747static const struct Samplesinterface samples_interface =
748748{
749749   1,   /* one channel */
750750   gaplus_sample_names
src/mame/drivers/vroulet.c
r1386r1387
232232static WRITE8_HANDLER( ppi8255_b_w ){}// lamps ?
233233static WRITE8_HANDLER( ppi8255_c_w ){}
234234
235static ppi8255_interface ppi8255_intf =
235static const ppi8255_interface ppi8255_intf =
236236{
237237   2,                              // 2 chips
238238   { input_port_0_r,   NULL },           // Port A read
src/mame/drivers/system1.c
r1386r1387
26322632   ROM_LOAD( "epr-5318.86",   0x0000, 0x4000, CRC(6f2e1fd3) SHA1(326d538551245fce67d0fdba85975e27093b7a93) )
26332633   ROM_LOAD( "epr-5319.93",   0x4000, 0x4000, CRC(ebee4999) SHA1(bb331be270dc1da63699533d9f02d73ce28f1bc5) )
26342634
2635   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2635   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
26362636   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
26372637ROM_END
26382638
r1386r1387
26602660   ROM_LOAD( "a1_ic86.86",   0x0000, 0x4000, CRC(6f2e1fd3) SHA1(326d538551245fce67d0fdba85975e27093b7a93) )
26612661   ROM_LOAD( "a1_ic93.93",   0x4000, 0x4000, CRC(07987244) SHA1(8468b95684b1f62c6de6af1b1d405bfb333e4e26) )
26622662
2663   ROM_REGION( 0x0100, REGION_USER1, 0 )   /* misc PROMs, but no color so don't use REGION_PROMS! */
2663   ROM_REGION( 0x0100, REGION_USER1, 0 )   /* misc PROMs, but not color so don't use REGION_PROMS! */
26642664   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
26652665ROM_END
26662666
26672667ROM_START( regulus )
26682668   ROM_REGION( 0x10000, REGION_CPU1, 0 )
2669   ROM_LOAD( "epr5640a.129",   0x0000, 0x2000, CRC(dafb1528) SHA1(9140c5507bd931df3f8ef8d2910bc74f737b1a5a) ) /* encrypted */
2670   ROM_LOAD( "epr5641a.130",   0x2000, 0x2000, CRC(0fcc850e) SHA1(d2d6b06bf1e2dc404aa5451cc9f1b919fb5be0f5) ) /* encrypted */
2671   ROM_LOAD( "epr5642a.131",   0x4000, 0x2000, CRC(4feffa17) SHA1(9d9f4227c4e60a5cc53c369e7c9ce59ea8df3553) ) /* encrypted */
2672   ROM_LOAD( "epr5643a.132",   0x6000, 0x2000, CRC(b8ac7eb4) SHA1(f96bcde021060a8c1c5270b73487e24d1893e8e5) ) /* encrypted */
2669   ROM_LOAD( "epr-5640a.129",   0x0000, 0x2000, CRC(dafb1528) SHA1(9140c5507bd931df3f8ef8d2910bc74f737b1a5a) ) /* encrypted */
2670   ROM_LOAD( "epr-5641a.130",   0x2000, 0x2000, CRC(0fcc850e) SHA1(d2d6b06bf1e2dc404aa5451cc9f1b919fb5be0f5) ) /* encrypted */
2671   ROM_LOAD( "epr-5642a.131",   0x4000, 0x2000, CRC(4feffa17) SHA1(9d9f4227c4e60a5cc53c369e7c9ce59ea8df3553) ) /* encrypted */
2672   ROM_LOAD( "epr-5643a.132",   0x6000, 0x2000, CRC(b8ac7eb4) SHA1(f96bcde021060a8c1c5270b73487e24d1893e8e5) ) /* encrypted */
26732673   ROM_LOAD( "epr-5644.133",   0x8000, 0x2000, CRC(ffd05b7d) SHA1(6fe471548d227d834c012d5d148b1ea1c12dfd00) )
2674   ROM_LOAD( "epr5645a.134",   0xa000, 0x2000, CRC(6b4bf77c) SHA1(0200efb58b85a6873db44ffa70c3c14dbca958a6) )
2674   ROM_LOAD( "epr-5645a.134",   0xa000, 0x2000, CRC(6b4bf77c) SHA1(0200efb58b85a6873db44ffa70c3c14dbca958a6) )
26752675
26762676   ROM_REGION( 0x10000, REGION_CPU2, 0 )
26772677   ROM_LOAD( "epr-5652.3",      0x0000, 0x2000, CRC(74edcb98) SHA1(bc181c73a6009ca723e715650adb920b77bd311c) )
r1386r1387
26882688   ROM_LOAD( "epr-5638.86",   0x0000, 0x4000, CRC(617363dd) SHA1(c8024f541086a8a940e21219fa4522646aeb365a) )
26892689   ROM_LOAD( "epr-5639.93",   0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) )
26902690
2691   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2691   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
26922692   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
26932693ROM_END
26942694
r1386r1387
27162716   ROM_LOAD( "epr-5638.86",   0x0000, 0x4000, CRC(617363dd) SHA1(c8024f541086a8a940e21219fa4522646aeb365a) )
27172717   ROM_LOAD( "epr-5639.93",   0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) )
27182718
2719   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2719   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
27202720   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
27212721ROM_END
27222722
r1386r1387
27442744   ROM_LOAD( "epr-5638.86",   0x0000, 0x4000, CRC(617363dd) SHA1(c8024f541086a8a940e21219fa4522646aeb365a) )
27452745   ROM_LOAD( "epr-5639.93",   0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) )
27462746
2747   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2747   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
27482748   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
27492749ROM_END
27502750
r1386r1387
27722772   ROM_LOAD( "epr-5514.86",   0x0000, 0x4000, CRC(fcc0a88b) SHA1(ca7db3df10deb6720096e6c50eddd9b74c47f0a0) )
27732773   ROM_LOAD( "epr-5515.93",   0x4000, 0x4000, CRC(60908838) SHA1(aedff8ce07ab16942037e5aff212652e51c19e71) )
27742774
2775   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2775   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
27762776   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
27772777ROM_END
27782778
r1386r1387
28002800   ROM_LOAD( "epr-5514.86",   0x0000, 0x4000, CRC(fcc0a88b) SHA1(ca7db3df10deb6720096e6c50eddd9b74c47f0a0) )
28012801   ROM_LOAD( "epr-5515.93",   0x4000, 0x4000, CRC(60908838) SHA1(aedff8ce07ab16942037e5aff212652e51c19e71) )
28022802
2803   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2803   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
28042804   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
28052805ROM_END
28062806
r1386r1387
28282828   ROM_LOAD( "epr-5749.86",   0x0000, 0x4000, CRC(e24682cd) SHA1(3f626f3e5e2db486ccf727e9869ab488643b4a8c) )
28292829   ROM_LOAD( "epr-5750.93",   0x4000, 0x4000, CRC(6564d1ad) SHA1(f246afee7e73bc30054b0e5dcb83fa0edd2d2164) )
28302830
2831   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2831   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
28322832   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
28332833ROM_END
28342834
r1386r1387
28562856   ROM_LOAD( "epr-5749.86",   0x0000, 0x4000, CRC(e24682cd) SHA1(3f626f3e5e2db486ccf727e9869ab488643b4a8c) )
28572857   ROM_LOAD( "epr-5750.93",   0x4000, 0x4000, CRC(6564d1ad) SHA1(f246afee7e73bc30054b0e5dcb83fa0edd2d2164) )
28582858
2859   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2859   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
28602860   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
28612861ROM_END
28622862
r1386r1387
28842884   ROM_LOAD( "epr-5805.86",   0x0000, 0x4000, CRC(5a732865) SHA1(55c54e54f052187ddd957131e56400c9c432a6b2) )
28852885   ROM_LOAD( "epr-5806.93",   0x4000, 0x4000, CRC(26ac258c) SHA1(e4e9f929ab8ae7da74f885481cf94335d7553a1c) )
28862886
2887   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2887   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
28882888   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
28892889ROM_END
28902890
r1386r1387
29082908   ROM_LOAD( "epr-5855.117",   0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) )
29092909   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
29102910
2911   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2911   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
29122912   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
29132913ROM_END
29142914
r1386r1387
29322932   ROM_LOAD( "epr-5855.117",   0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) )
29332933   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
29342934
2935   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2935   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
29362936   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
29372937ROM_END
29382938
r1386r1387
29602960   ROM_LOAD( "epr-5855.117",   0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) )
29612961   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
29622962
2963   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2963   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
29642964   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
29652965ROM_END
29662966
r1386r1387
29862986   ROM_LOAD( "epr-5855.117",   0x0000, 0x4000, CRC(b5f894a1) SHA1(2c72dc16739dad155fcd572e1add067a7647f5bd) )
29872987   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
29882988
2989   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
2989   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
29902990   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
29912991ROM_END
29922992
r1386r1387
30143014   ROM_LOAD( "wm.86",         0x0000, 0x4000, CRC(238ae0e5) SHA1(af18cfe7f8103358a0ce2aef9bbd949fdc0bfbfc) )
30153015   ROM_LOAD( "wm.93",         0x4000, 0x4000, CRC(a2f19170) SHA1(47dacc380b09c6365c737d320145cedad54ecedb) )
30163016
3017   ROM_REGION( 0x0100, REGION_USER1, 0 )   /* misc PROMs, but no color so don't use REGION_PROMS! */
3017   ROM_REGION( 0x0100, REGION_USER1, 0 )   /* misc PROMs, but not color so don't use REGION_PROMS! */
30183018   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
30193019ROM_END
30203020
r1386r1387
30423042   ROM_LOAD( "epr-6069.86",   0x0000, 0x4000, CRC(fe691e41) SHA1(90faf26685202e2a25bb3024750456014d0722b3) ) /* epr-6069.86 */
30433043   ROM_LOAD( "epr-6070.93",   0x4000, 0x4000, CRC(34f080df) SHA1(0e7d28e3325c8c3f06438fde29ea0ffe57fc325f) ) /* epr-6070.93 */
30443044
3045   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3045   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
30463046   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
30473047                                              /* pr-5317.106 */
30483048ROM_END
r1386r1387
30683068   ROM_LOAD( "epr-6069.117",   0x0000, 0x4000, CRC(fe691e41) SHA1(90faf26685202e2a25bb3024750456014d0722b3) )
30693069   ROM_LOAD( "epr-6070.110",   0x4000, 0x4000, CRC(34f080df) SHA1(0e7d28e3325c8c3f06438fde29ea0ffe57fc325f) )
30703070
3071   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3071   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
30723072   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
30733073ROM_END
30743074
r1386r1387
30933093   ROM_LOAD( "epr6454a.117",   0x0000, 0x4000, CRC(a5d96780) SHA1(e0571f6fd031bbe2d971c3be7b96a017b0ea4be9) )
30943094   ROM_LOAD( "epr-6455.05",   0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) )
30953095
3096   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3096   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
30973097   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
30983098ROM_END
30993099
r1386r1387
31183118   ROM_LOAD( "epr6454a.117",   0x0000, 0x4000, CRC(a5d96780) SHA1(e0571f6fd031bbe2d971c3be7b96a017b0ea4be9) )
31193119   ROM_LOAD( "epr-6455.05",   0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) )
31203120
3121   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3121   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
31223122   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
31233123ROM_END
31243124
r1386r1387
31453145   ROM_LOAD( "epr-6547.110",   0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) )
31463146   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
31473147
3148   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3148   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
31493149   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
31503150ROM_END
31513151
r1386r1387
31723172   ROM_LOAD( "epr-6547.110",   0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) )
31733173   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
31743174
3175   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3175   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
31763176   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
31773177ROM_END
31783178
r1386r1387
32023202   ROM_LOAD( "epr-6547.110",   0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) /* epr-6547.4 */
32033203   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) /* epr-6549.2 */
32043204
3205   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3205   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
32063206   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
32073207                                              /* pr-5317.106 */
32083208ROM_END
r1386r1387
32303230   ROM_LOAD( "epr-6547.110",   0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) )
32313231   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
32323232
3233   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3233   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
32343234   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
32353235ROM_END
32363236
r1386r1387
32603260   ROM_LOAD( "epr-6547.110",   0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) ) /* epr-6547.4 */
32613261   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) /* epr-6549.2 */
32623262
3263   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3263   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
32643264   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
32653265ROM_END
32663266
r1386r1387
32873287   ROM_LOAD( "epr-6547.110",   0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) )
32883288   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
32893289
3290   ROM_REGION( 0x0220, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3290   ROM_REGION( 0x0220, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
32913291   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
32923292   ROM_LOAD( "nprinces.129",   0x0100, 0x0100, CRC(ae765f62) SHA1(9434b5a23d118a9c62015b479719826b38269cd4) ) /* decryption table (not used) */
32933293   ROM_LOAD( "nprinces.123",   0x0200, 0x0020, CRC(ed5146e9) SHA1(7044035c07636e4029f4b746c1a92e15173869e9) ) /* decryption table (not used) */
r1386r1387
33163316   ROM_LOAD( "epr-6547.110",   0x8000, 0x4000, CRC(34451b08) SHA1(ee8708f6c886b63f138bcc10dc2a053bfad96c37) )
33173317   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
33183318
3319   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3319   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
33203320   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
33213321ROM_END
33223322
r1386r1387
33413341   ROM_LOAD( "epr-6645.117",   0x0000, 0x4000, CRC(1ba167ee) SHA1(5a105cc3112f2533e7c5982233405d365402fba2) )
33423342   ROM_LOAD( "epr-6646.04",   0x4000, 0x4000, CRC(edda7ad6) SHA1(eef7dcde632787283c4cb522380b138060018204) )
33433343
3344   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3344   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
33453345   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
33463346ROM_END
33473347
r1386r1387
33663366   ROM_LOAD( "epr-6645.117",   0x0000, 0x4000, CRC(1ba167ee) SHA1(5a105cc3112f2533e7c5982233405d365402fba2) )
33673367   ROM_LOAD( "epr-6646.04",   0x4000, 0x4000, CRC(edda7ad6) SHA1(eef7dcde632787283c4cb522380b138060018204) )
33683368
3369   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3369   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
33703370   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
33713371ROM_END
33723372
r1386r1387
33933393   ROM_LOAD( "epr-6736.110",   0x8000, 0x4000, CRC(565c25d0) SHA1(5ae524ef01138c5042b223286d65eb9043c0f0d5) )
33943394   ROM_LOAD( "epr-6738.05",   0xc000, 0x4000, CRC(e116285f) SHA1(b6fb50b02a981b3b23385200045ae537092d26d6) )
33953395
3396   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3396   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
33973397   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
33983398ROM_END
33993399
r1386r1387
34203420   ROM_LOAD( "epr-6736.110",   0x8000, 0x4000, CRC(565c25d0) SHA1(5ae524ef01138c5042b223286d65eb9043c0f0d5) )
34213421   ROM_LOAD( "epr-6738.05",   0xc000, 0x4000, CRC(e116285f) SHA1(b6fb50b02a981b3b23385200045ae537092d26d6) )
34223422
3423   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3423   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
34243424   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
34253425ROM_END
34263426
r1386r1387
34783478   ROM_LOAD( "epr-6922.110",   0x8000, 0x4000, CRC(37f77a78) SHA1(01d8bd41303bd5e3a6f1cdafa4a1d682e4c659a2) )
34793479   ROM_LOAD( "epr-6924.05",   0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) )
34803480
3481   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3481   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
34823482   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
34833483ROM_END
34843484
r1386r1387
35053505   ROM_LOAD( "epr-6922.110",   0x8000, 0x4000, CRC(37f77a78) SHA1(01d8bd41303bd5e3a6f1cdafa4a1d682e4c659a2) )
35063506   ROM_LOAD( "epr-6924.05",   0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) )
35073507
3508   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3508   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
35093509   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
35103510ROM_END
35113511
r1386r1387
35333533   ROM_LOAD( "epr-6922.110",   0x8000, 0x4000, CRC(37f77a78) SHA1(01d8bd41303bd5e3a6f1cdafa4a1d682e4c659a2) )
35343534   ROM_LOAD( "epr-6924.05",   0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) )
35353535
3536   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3536   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
35373537   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
35383538ROM_END
35393539
35403540/*
3541    Shooting Master (SEGA) - Set 1, 8751 315-5159
3541    Shooting Master (SEGA) - Rev A, 8751 315-5159a
35423542    Year: 1985
35433543    System 2
35443544
r1386r1387
35493549ROM_START( shtngmst )
35503550   ROM_REGION( 0x20000, REGION_CPU1, 0 )
35513551    /* This rom is located on the daughter board .*/
3552   ROM_LOAD( "epr7100.ic18",  0x00000, 0x8000, CRC(45e64431) SHA1(7edf818dc1f65365641e51abc197d13db7a8d4d9) )
3552   ROM_LOAD( "epr7100a.ic18",  0x00000, 0x8000, CRC(661f0b6e) SHA1(a1d064839c95d8a6f6d89b0894259f666d637ec4) )
35533553    /* These roms are located on the main board. */
35543554   ROM_LOAD( "epr7101.ic91",   0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
35553555   ROM_LOAD( "epr7102.ic92",   0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
r1386r1387
35603560
35613561    /* This mcu is located on the main board. */
35623562   ROM_REGION( 0x10000, REGION_CPU3, 0 )   /* Internal i8751 MCU code */
3563   ROM_LOAD( "315-5159.ic74", 0x00000, 0x1000, NO_DUMP )
3563   ROM_LOAD( "315-5159a.ic74", 0x00000, 0x1000, NO_DUMP )
35643564
35653565    /* These roms are located on the main board. */
35663566   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
r1386r1387
35963596ROM_END
35973597
35983598/*
3599    Shooting Master (SEGA) - Set 2, 8751 315-5159a
3599    Shooting Master (SEGA) - Set 1, 8751 315-5159
36003600    Year: 1985
36013601    System 2
36023602
r1386r1387
36043604    Light Gun Board?  834-5720
36053605*/
36063606
3607ROM_START( shtngmsb )
3607ROM_START( shtngms1 )
36083608   ROM_REGION( 0x20000, REGION_CPU1, 0 )
36093609    /* This rom is located on the daughter board .*/
3610   ROM_LOAD( "epr7100a.ic18",  0x00000, 0x8000, CRC(661f0b6e) SHA1(a1d064839c95d8a6f6d89b0894259f666d637ec4) )
3610   ROM_LOAD( "epr7100.ic18",  0x00000, 0x8000, CRC(45e64431) SHA1(7edf818dc1f65365641e51abc197d13db7a8d4d9) )
36113611    /* These roms are located on the main board. */
36123612   ROM_LOAD( "epr7101.ic91",   0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
36133613   ROM_LOAD( "epr7102.ic92",   0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
r1386r1387
36183618
36193619    /* This mcu is located on the main board. */
36203620   ROM_REGION( 0x10000, REGION_CPU3, 0 )   /* Internal i8751 MCU code */
3621   ROM_LOAD( "315-5159a.ic74", 0x00000, 0x1000, NO_DUMP )
3621   ROM_LOAD( "315-5159.ic74", 0x00000, 0x1000, NO_DUMP )
36223622
36233623    /* These roms are located on the main board. */
36243624   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
r1386r1387
37063706ROM_START( shtngmsa )
37073707   ROM_REGION( 0x20000, REGION_CPU1, 0 )
37083708   ROM_LOAD( "7100.18",      0x00000, 0x8000, CRC(268ecb1d) SHA1(a9274c9718f7244235cc6df76331d6a0b7e4e4c8) ) // different..
3709   ROM_LOAD( "epr7101",      0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
3710   ROM_LOAD( "epr7102",      0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
3709   ROM_LOAD( "epr7101.ic91",   0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
3710   ROM_LOAD( "epr7102.ic92",   0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
37113711
37123712   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3713   ROM_LOAD( "epr7043",      0x0000, 0x8000, CRC(99a368ab) SHA1(a9451f39ee2613e5c3e2791d4d8d837b4a3ab666) )
3713   ROM_LOAD( "epr7043.ic126",  0x0000, 0x8000, CRC(99a368ab) SHA1(a9451f39ee2613e5c3e2791d4d8d837b4a3ab666) )
37143714
37153715   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
3716   ROM_LOAD( "epr7040",      0x00000, 0x8000, CRC(f30769fa) SHA1(366c1fbe4e1c8943b209f6c831c9a6b7e4372105) )
3717   ROM_LOAD( "epr7041",      0x08000, 0x8000, CRC(f3e273f9) SHA1(b8715c528299dc1e4f0c19c50d91ca9861a423a1) )
3718   ROM_LOAD( "epr7042",      0x10000, 0x8000, CRC(6841c917) SHA1(6553843eea0131eb7b5a9aa29dddf641e41d8cc3) )
3716   ROM_LOAD( "epr7040.ic4",    0x00000, 0x8000, CRC(f30769fa) SHA1(366c1fbe4e1c8943b209f6c831c9a6b7e4372105) )
3717   ROM_LOAD( "epr7041.ic5",    0x08000, 0x8000, CRC(f3e273f9) SHA1(b8715c528299dc1e4f0c19c50d91ca9861a423a1) )
3718   ROM_LOAD( "epr7042.ic6",    0x10000, 0x8000, CRC(6841c917) SHA1(6553843eea0131eb7b5a9aa29dddf641e41d8cc3) )
37193719
37203720   ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_ERASEFF )
37213721   ROM_LOAD( "epr7110",      0x00000, 0x8000, CRC(5d1a5048) SHA1(d1626ab1981080451c912df7e4ad7f76c0cb3459) )
r1386r1387
37273727   ROM_LOAD( "epr7107",      0x30000, 0x8000, CRC(8f50ea24) SHA1(781687e202dedca7b72c9bd5b97d9d46fcfd601c) )
37283728
37293729   ROM_REGION( 0x0400, REGION_PROMS, 0 )
3730   ROM_LOAD( "epr7113",      0x0000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */
3731   ROM_LOAD( "epr7112",      0x0100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */
3732   ROM_LOAD( "epr7111",      0x0200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component */
3733   ROM_LOAD( "epr5317",      0x0300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3730   ROM_LOAD( "epr7113.ic20",   0x00000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */
3731   ROM_LOAD( "epr7112.ic14",   0x00100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */
3732   ROM_LOAD( "epr7111.ic8",    0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */
3733   ROM_LOAD( "epr5317.ic37",   0x00300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) - N82S129AN */
37343734
37353735   ROM_REGION( 0x0400, REGION_PLDS, ROMREGION_DISPOSE )
3736   ROM_LOAD( "pal16r4a.ic9",  0x0000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) ) /* label on chip is: 315-5137 */
3737   ROM_LOAD( "pal16r4a(315-5137).bin",  0x0200, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) )
3736   ROM_LOAD( "315-5137.bin",   0x00000, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) ) /* TI PAL16R4A-2CN Located at IC10 */
3737   ROM_LOAD( "315-5138.bin",   0x00000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) ) /* TI PAL16R4ACN Located at IC11 */
37383738ROM_END
37393739
37403740/*
r1386r1387
38883888   ROM_LOAD( "4d.110",       0x8000, 0x4000, CRC(6ec5990a) SHA1(a26dbd470744c38a26a016e5d4792ac2f2b9bc4b) )
38893889   ROM_LOAD( "4d.05",        0xc000, 0x4000, CRC(f31a1e6a) SHA1(f49dbc4b381e7096d5ffe3c16660dd63121dabf7) )
38903890
3891   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3891   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
38923892   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
38933893ROM_END
38943894
r1386r1387
39443944   ROM_LOAD( "epr-7408.110",   0x8000, 0x4000, CRC(3189f33c) SHA1(8476c2c01920f0492cf643929d4f023f3afe0164) ) /* epr-7408.4 */
39453945   ROM_LOAD( "epr-7410.05",   0xc000, 0x4000, CRC(ced74789) SHA1(d0ad845bfe83412ac8d43125e1c50d0581a5b47e) ) /* epr-7410.2 */
39463946
3947   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3947   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
39483948   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
39493949                                              /* pr-5317.106 */
39503950ROM_END
r1386r1387
39723972   ROM_LOAD( "epr-6307.05",   0x8000, 0x4000, CRC(0a5ad543) SHA1(5acada30c1affc4ffbebc8365a9ba4465f213d47) )
39733973   ROM_LOAD( "epr-6309.110",   0xc000, 0x4000, CRC(7423ad98) SHA1(e19b4c64795f30e1491520160d315e4148d58df2) )
39743974
3975   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
3975   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
39763976   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
39773977                                              /* pr-5317.106 */
39783978ROM_END
r1386r1387
40004000   ROM_LOAD( "epr-6307.05",   0x8000, 0x4000, CRC(0a5ad543) SHA1(5acada30c1affc4ffbebc8365a9ba4465f213d47) )
40014001   ROM_LOAD( "epr-6309.110",   0xc000, 0x4000, CRC(7423ad98) SHA1(e19b4c64795f30e1491520160d315e4148d58df2) )
40024002
4003   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4003   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
40044004   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
40054005                                              /* pr-5317.106 */
40064006ROM_END
r1386r1387
40284028   ROM_LOAD( "epr-7486.110",   0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) )
40294029   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) )
40304030
4031   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4031   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
40324032   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
40334033ROM_END
40344034
r1386r1387
40554055   ROM_LOAD( "epr-7486.110",   0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) )
40564056   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) )
40574057
4058   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4058   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
40594059   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
40604060ROM_END
40614061
r1386r1387
40854085   ROM_LOAD( "epr-7486.110",   0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) /* epr-7486.4 */
40864086   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */
40874087
4088   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4088   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
40894089   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
40904090                                              /* pr-5317.106 */
40914091ROM_END
r1386r1387
41164116   ROM_LOAD( "epr-7486.110",   0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) /* epr-7486.4 */
41174117   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */
41184118
4119   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4119   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
41204120   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
41214121                                              /* pr-5317.106 */
41224122ROM_END
r1386r1387
41444144   ROM_LOAD( "epr-7486.110",   0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) )
41454145   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) )
41464146
4147   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4147   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
41484148   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
41494149ROM_END
41504150
r1386r1387
41784178   ROM_LOAD( "7578.87",  0x00000, 0x8000, CRC(6ff1637f) SHA1(9a6ddbd7b8d53273b30c3529b028c1f28bf3c63b) )   // epr7577.ic110
41794179   ROM_LOAD( "7577.86",  0x08000, 0x8000, CRC(58b3705e) SHA1(1a8ff3f1765a3b21145bd1a6c85441f806f7b17d) )   // epr7576.ic117
41804180
4181   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4181   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
41824182   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
41834183ROM_END
41844184
r1386r1387
42054205   ROM_LOAD( "ic110_86.bin",   0x8000, 0x4000, CRC(26d0fac4) SHA1(2e6a06f6850b2d19e3dd7dcdc6b700d0eda878cb) )
42064206   ROM_LOAD( "ic005_88.bin",   0xc000, 0x4000, CRC(2602e519) SHA1(00e94ec7ae37b5063137d4d49af7806fb0357c4b) )
42074207
4208   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4208   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
42094209   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
42104210ROM_END
42114211
r1386r1387
42594259   ROM_LOAD( "epr-7486.110",   0x8000, 0x4000, CRC(8d622c50) SHA1(9a76a50204c618347d3e8eee6cda841becd906eb) ) /* epr-7486.4 */
42604260   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */
42614261
4262   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4262   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
42634263   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
42644264                                              /* pr-5317.106 */
42654265ROM_END
r1386r1387
43444344   ROM_LOAD( "bg.110",       0x8000, 0x4000, CRC(064c812c) SHA1(673790dc5131fd280333386a0e9915fb94e9f3e1) )
43454345   ROM_LOAD( "bg.05",        0xc000, 0x4000, CRC(02e0b040) SHA1(fb626fc31dfe25bf9fac0c8d76d5041609b06e82) )
43464346
4347   ROM_REGION( 0x0100, REGION_USER2, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4347   ROM_REGION( 0x0100, REGION_USER2, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
43484348   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
43494349ROM_END
43504350
r1386r1387
43704370   ROM_LOAD( "bg.110",       0x8000, 0x4000, CRC(064c812c) SHA1(673790dc5131fd280333386a0e9915fb94e9f3e1) )
43714371   ROM_LOAD( "bg.05",        0xc000, 0x4000, CRC(02e0b040) SHA1(fb626fc31dfe25bf9fac0c8d76d5041609b06e82) )
43724372
4373   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but no color so don't use REGION_PROMS! */
4373   ROM_REGION( 0x0100, REGION_USER1, 0 ) /* misc PROMs, but not color so don't use REGION_PROMS! */
43744374   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
43754375ROM_END
43764376
r1386r1387
48214821}
48224822
48234823
4824GAME( 1983, starjack, 0,        small,    starjack, 0,        ROT270, "Sega",                 "Star Jacker (Sega)", GAME_SUPPORTS_SAVE )
4825GAME( 1983, starjacs, starjack, small,    starjacs, 0,        ROT270, "Stern",                 "Star Jacker (Stern)", GAME_SUPPORTS_SAVE )
4826GAME( 1983, regulus,  0,        small,     regulus,  regulus,  ROT270, "Sega",                 "Regulus (315-5033, New Ver.)", GAME_SUPPORTS_SAVE )
4827GAME( 1983, reguluso, regulus,  small,     reguluso, regulus,  ROT270, "Sega",                 "Regulus (315-5033, Old Ver.)", GAME_SUPPORTS_SAVE )
4828GAME( 1983, regulusu, regulus,  small,     regulus,  0,        ROT270, "Sega",                 "Regulus (not encrypted)", GAME_SUPPORTS_SAVE )
4829GAME( 1983, upndown,  0,        system1,  upndown,  nprinces, ROT270, "Sega",                 "Up'n Down (315-5030)", GAME_SUPPORTS_SAVE )
4830GAME( 1983, upndownu, upndown,  system1,  upndown,  0,        ROT270, "Sega",                 "Up'n Down (not encrypted)", GAME_SUPPORTS_SAVE )
4831GAME( 1984, mrviking, 0,        small,    mrviking, mrviking, ROT270, "Sega",                 "Mister Viking (315-5041)", GAME_SUPPORTS_SAVE )
4832GAME( 1984, mrvikngj, mrviking, small,    mrvikngj, mrviking, ROT270, "Sega",                 "Mister Viking (315-5041, Japan)", GAME_SUPPORTS_SAVE )
4833GAME( 1984, swat,     0,        system1,  swat,     swat,     ROT270, "Coreland / Sega",       "SWAT (315-5048)", GAME_SUPPORTS_SAVE )
4834GAME( 1984, flicky,   0,        system1,  flicky,   flicky,   ROT0,   "Sega",                 "Flicky (128k Version, System 2, 315-5051)", GAME_SUPPORTS_SAVE )
4835GAME( 1984, flicks2,  flicky,   system1,  flicky,   0,        ROT0,   "Sega",                 "Flicky (128k Version, System 2, not encrypted)", GAME_SUPPORTS_SAVE )
4836GAME( 1984, flickyo,  flicky,   system1,  flicky,   flicky,   ROT0,   "Sega",                 "Flicky (64k Version, System 1, 315-5051, set 1)", GAME_SUPPORTS_SAVE )
4837GAME( 1984, flicks1,  flicky,   system1,  flicky,   flicky,   ROT0,   "Sega",                 "Flicky (64k Version, System 1, 315-5051, set 2)", GAME_SUPPORTS_SAVE )
4838GAME( 1984, wmatch,   0,        small,      wmatch,   wmatch,   ROT270, "Sega",                 "Water Match (315-5064)", GAME_SUPPORTS_SAVE )
4839GAME( 1984, bullfgt,  0,        system1,  bullfgt,  bullfgtj, ROT0,   "Coreland / Sega",       "Bullfight (315-5065)", GAME_SUPPORTS_SAVE )
4840GAME( 1984, thetogyu, bullfgt,  system1,  bullfgt,  bullfgtj, ROT0,   "Coreland / Sega",       "The Togyu (315-5065, Japan)", GAME_SUPPORTS_SAVE )
4841GAME( 1984, spatter,  0,        small,    spatter,  spatter,  ROT0,   "Sega",                 "Spatter", GAME_SUPPORTS_SAVE )
4842GAME( 1984, ssanchan, spatter,  small,    spatter,  spatter,  ROT0,   "Sega",                 "Sanrin San Chan (Japan)", GAME_SUPPORTS_SAVE )
4843GAME( 1985, pitfall2, 0,        pitfall2, pitfall2, pitfall2, ROT0,   "Sega",                 "Pitfall II (315-5093)", GAME_SUPPORTS_SAVE )
4844GAME( 1985, pitfallu, pitfall2, pitfall2, pitfallu, 0,        ROT0,   "Sega",                 "Pitfall II (not encrypted)", GAME_SUPPORTS_SAVE )
4845GAME( 1985, seganinj, 0,        system1,  seganinj, seganinj, ROT0,   "Sega",                 "Sega Ninja (315-5102)", GAME_SUPPORTS_SAVE )
4846GAME( 1985, seganinu, seganinj, system1,  seganinj, 0,        ROT0,   "Sega",                 "Sega Ninja (not encrypted)", GAME_SUPPORTS_SAVE )
4847GAME( 1985, ninja,    seganinj, system1,  seganinj, seganinj, ROT0,   "Sega",                "Ninja (315-5102)", GAME_SUPPORTS_SAVE )
4848GAME( 1985, nprinces, seganinj, system1,  seganinj, flicky,   ROT0,   "bootleg?",              "Ninja Princess (315-5051, 64k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
4849GAME( 1985, nprincso, seganinj, system1,  seganinj, nprinces, ROT0,   "Sega",                 "Ninja Princess (315-5098, 128k Ver.)", GAME_SUPPORTS_SAVE )
4850GAME( 1985, nprincsu, seganinj, system1,  seganinj, 0,        ROT0,   "Sega",                 "Ninja Princess (64k Ver. not encrypted)", GAME_SUPPORTS_SAVE )
4851GAME( 1985, nprincsb, seganinj, system1,  seganinj, flicky,   ROT0,   "bootleg?",              "Ninja Princess (315-5051?, 128k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
4852GAME( 1985, imsorry,  0,        system1,  imsorry,  imsorry,  ROT0,   "Coreland / Sega",       "I'm Sorry (315-5110, US)", GAME_SUPPORTS_SAVE )
4853GAME( 1985, imsorryj, imsorry,  system1,  imsorry,  imsorry,  ROT0,   "Coreland / Sega",       "Gonbee no I'm Sorry (315-5110, Japan)", GAME_SUPPORTS_SAVE )
4854GAME( 1985, teddybb,  0,        system1,  teddybb,  teddybb,  ROT0,   "Sega",                 "TeddyBoy Blues (315-5115, New Ver.)", GAME_SUPPORTS_SAVE )
4855GAME( 1985, teddybbo, teddybb,  system1,  teddybb,  teddybb,  ROT0,   "Sega",                 "TeddyBoy Blues (315-5115, Old Ver.)", GAME_SUPPORTS_SAVE )
4856GAME( 1985, myhero,   0,        system1,  myhero,   0,        ROT0,   "Sega",                 "My Hero (US, not encrypted)", GAME_SUPPORTS_SAVE )
4857GAME( 1985, sscandal, myhero,   system1,  myhero,   myheroj,  ROT0,   "Coreland / Sega",       "Seishun Scandal (315-5132, Japan)", GAME_SUPPORTS_SAVE )
4858GAME( 1985, myherok,  myhero,   system1,  myhero,   myherok,  ROT0,   "Coreland / Sega",       "My Hero (Korea)", GAME_SUPPORTS_SAVE )
4859GAME( 1985, hvymetal, 0,        hvymetal, hvymetal, hvymetal, ROT0,   "Sega",                 "Heavy Metal (315-5135)", GAME_SUPPORTS_SAVE )
4860GAME( 1985, shtngmst, 0,        shtngmst, shtngmst, 0,        ROT0,   "Sega",                 "Shooting Master (set 1, 8751 315-5159)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection, mcu = 315-5159 */
4861GAME( 1985, shtngmsa, shtngmst, shtngmst, shtngmst, 0,        ROT0,   "Sega [EVG]",            "Shooting Master (EVG)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection, mcu = 315-5159 */
4862GAME( 1985, shtngmsb, shtngmst, shtngmst, shtngmst, 0,        ROT0,   "Sega",                  "Shooting Master (set 2, 8751 315-5159a)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection, mcu = 315-5159a */
4863GAME( 1985, chplft,   0,        chplft,   chplft,   0,        ROT0,   "Sega",                 "Choplifter (8751 315-5151)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection */
4864GAME( 1985, chplftb,  chplft,   chplft,   chplft,   0,        ROT0,   "Sega",                 "Choplifter (unprotected)", GAME_SUPPORTS_SAVE )
4865GAME( 1985, chplftbl, chplft,   chplft,   chplft,   0,        ROT0,   "bootleg",              "Choplifter (bootleg)", GAME_SUPPORTS_SAVE )
4866GAME( 1985, 4dwarrio, 0,        system1,  4dwarrio, 4dwarrio, ROT0,   "Coreland / Sega",       "4-D Warriors (315-5162)", GAME_SUPPORTS_SAVE )
4867GAME( 1986, brain,    0,        brain,    brain,    0,        ROT0,   "Coreland / Sega",       "Brain", GAME_SUPPORTS_SAVE )
4868GAME( 1986, raflesia, 0,        system1,  raflesia, 4dwarrio, ROT270, "Coreland / Sega",       "Rafflesia (315-5162)", GAME_SUPPORTS_SAVE )
4824GAME( 1983, starjack, 0,        small,    starjack, 0,        ROT270, "Sega",            "Star Jacker (Sega)", GAME_SUPPORTS_SAVE )
4825GAME( 1983, starjacs, starjack, small,    starjacs, 0,        ROT270, "Stern",           "Star Jacker (Stern)", GAME_SUPPORTS_SAVE )
4826GAME( 1983, regulus,  0,        small,     regulus,  regulus,  ROT270, "Sega",            "Regulus (315-5033, Rev A.)", GAME_SUPPORTS_SAVE )
4827GAME( 1983, reguluso, regulus,  small,     reguluso, regulus,  ROT270, "Sega",            "Regulus (315-5033)", GAME_SUPPORTS_SAVE )
4828GAME( 1983, regulusu, regulus,  small,     regulus,  0,        ROT270, "Sega",            "Regulus (not encrypted)", GAME_SUPPORTS_SAVE )
4829GAME( 1983, upndown,  0,        system1,  upndown,  nprinces, ROT270, "Sega",            "Up'n Down (315-5030)", GAME_SUPPORTS_SAVE )
4830GAME( 1983, upndownu, upndown,  system1,  upndown,  0,        ROT270, "Sega",            "Up'n Down (not encrypted)", GAME_SUPPORTS_SAVE )
4831GAME( 1984, mrviking, 0,        small,    mrviking, mrviking, ROT270, "Sega",            "Mister Viking (315-5041)", GAME_SUPPORTS_SAVE )
4832GAME( 1984, mrvikngj, mrviking, small,    mrvikngj, mrviking, ROT270, "Sega",            "Mister Viking (315-5041, Japan)", GAME_SUPPORTS_SAVE )
4833GAME( 1984, swat,     0,        system1,  swat,     swat,     ROT270, "Coreland / Sega", "SWAT (315-5048)", GAME_SUPPORTS_SAVE )
4834GAME( 1984, flicky,   0,        system1,  flicky,   flicky,   ROT0,   "Sega",            "Flicky (128k Version, System 2, 315-5051)", GAME_SUPPORTS_SAVE )
4835GAME( 1984, flicks2,  flicky,   system1,  flicky,   0,        ROT0,   "Sega",            "Flicky (128k Version, System 2, not encrypted)", GAME_SUPPORTS_SAVE )
4836GAME( 1984, flickyo,  flicky,   system1,  flicky,   flicky,   ROT0,   "Sega",            "Flicky (64k Version, System 1, 315-5051, set 1)", GAME_SUPPORTS_SAVE )
4837GAME( 1984, flicks1,  flicky,   system1,  flicky,   flicky,   ROT0,   "Sega",            "Flicky (64k Version, System 1, 315-5051, set 2)", GAME_SUPPORTS_SAVE )
4838GAME( 1984, wmatch,   0,        small,      wmatch,   wmatch,   ROT270, "Sega",            "Water Match (315-5064)", GAME_SUPPORTS_SAVE )
4839GAME( 1984, bullfgt,  0,        system1,  bullfgt,  bullfgtj, ROT0,   "Coreland / Sega", "Bullfight (315-5065)", GAME_SUPPORTS_SAVE )
4840GAME( 1984, thetogyu, bullfgt,  system1,  bullfgt,  bullfgtj, ROT0,   "Coreland / Sega", "The Togyu (315-5065, Japan)", GAME_SUPPORTS_SAVE )
4841GAME( 1984, spatter,  0,        small,    spatter,  spatter,  ROT0,   "Sega",            "Spatter", GAME_SUPPORTS_SAVE )
4842GAME( 1984, ssanchan, spatter,  small,    spatter,  spatter,  ROT0,   "Sega",            "Sanrin San Chan (Japan)", GAME_SUPPORTS_SAVE )
4843GAME( 1985, pitfall2, 0,        pitfall2, pitfall2, pitfall2, ROT0,   "Sega",            "Pitfall II (315-5093)", GAME_SUPPORTS_SAVE )
4844GAME( 1985, pitfallu, pitfall2, pitfall2, pitfallu, 0,        ROT0,   "Sega",            "Pitfall II (not encrypted)", GAME_SUPPORTS_SAVE )
4845GAME( 1985, seganinj, 0,        system1,  seganinj, seganinj, ROT0,   "Sega",            "Sega Ninja (315-5102)", GAME_SUPPORTS_SAVE )
4846GAME( 1985, seganinu, seganinj, system1,  seganinj, 0,        ROT0,   "Sega",            "Sega Ninja (not encrypted)", GAME_SUPPORTS_SAVE )
4847GAME( 1985, ninja,    seganinj, system1,  seganinj, seganinj, ROT0,   "Sega",            "Ninja (315-5102)", GAME_SUPPORTS_SAVE )
4848GAME( 1985, nprinces, seganinj, system1,  seganinj, flicky,   ROT0,   "bootleg?",        "Ninja Princess (315-5051, 64k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
4849GAME( 1985, nprincso, seganinj, system1,  seganinj, nprinces, ROT0,   "Sega",            "Ninja Princess (315-5098, 128k Ver.)", GAME_SUPPORTS_SAVE )
4850GAME( 1985, nprincsu, seganinj, system1,  seganinj, 0,        ROT0,   "Sega",            "Ninja Princess (64k Ver. not encrypted)", GAME_SUPPORTS_SAVE )
4851GAME( 1985, nprincsb, seganinj, system1,  seganinj, flicky,   ROT0,   "bootleg?",        "Ninja Princess (315-5051?, 128k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
4852GAME( 1985, imsorry,  0,        system1,  imsorry,  imsorry,  ROT0,   "Coreland / Sega", "I'm Sorry (315-5110, US)", GAME_SUPPORTS_SAVE )
4853GAME( 1985, imsorryj, imsorry,  system1,  imsorry,  imsorry,  ROT0,   "Coreland / Sega", "Gonbee no I'm Sorry (315-5110, Japan)", GAME_SUPPORTS_SAVE )
4854GAME( 1985, teddybb,  0,        system1,  teddybb,  teddybb,  ROT0,   "Sega",            "TeddyBoy Blues (315-5115, New Ver.)", GAME_SUPPORTS_SAVE )
4855GAME( 1985, teddybbo, teddybb,  system1,  teddybb,  teddybb,  ROT0,   "Sega",            "TeddyBoy Blues (315-5115, Old Ver.)", GAME_SUPPORTS_SAVE )
4856GAME( 1985, myhero,   0,        system1,  myhero,   0,        ROT0,   "Sega",            "My Hero (US, not encrypted)", GAME_SUPPORTS_SAVE )
4857GAME( 1985, sscandal, myhero,   system1,  myhero,   myheroj,  ROT0,   "Coreland / Sega", "Seishun Scandal (315-5132, Japan)", GAME_SUPPORTS_SAVE )
4858GAME( 1985, myherok,  myhero,   system1,  myhero,   myherok,  ROT0,   "Coreland / Sega", "My Hero (Korea)", GAME_SUPPORTS_SAVE )
4859GAME( 1985, hvymetal, 0,        hvymetal, hvymetal, hvymetal, ROT0,   "Sega",            "Heavy Metal (315-5135)", GAME_SUPPORTS_SAVE )
4860GAME( 1985, shtngmst, 0,        shtngmst, shtngmst, 0,        ROT0,   "Sega",            "Shooting Master (Rev A, 8751 315-5159a)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4861GAME( 1985, shtngms1, shtngmst, shtngmst, shtngmst, 0,        ROT0,   "Sega",            "Shooting Master (8751 315-5159)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4862GAME( 1985, shtngmsa, shtngmst, shtngmst, shtngmst, 0,        ROT0,   "Sega [EVG]",      "Shooting Master (EVG, 8751 315-5159)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4863GAME( 1985, chplft,   0,        chplft,   chplft,   0,        ROT0,   "Sega",            "Choplifter (8751 315-5151)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4864GAME( 1985, chplftb,  chplft,   chplft,   chplft,   0,        ROT0,   "Sega",            "Choplifter (unprotected)", GAME_SUPPORTS_SAVE )
4865GAME( 1985, chplftbl, chplft,   chplft,   chplft,   0,        ROT0,   "bootleg",         "Choplifter (bootleg)", GAME_SUPPORTS_SAVE )
4866GAME( 1985, 4dwarrio, 0,        system1,  4dwarrio, 4dwarrio, ROT0,   "Coreland / Sega", "4-D Warriors (315-5162)", GAME_SUPPORTS_SAVE )
4867GAME( 1986, brain,    0,        brain,    brain,    0,        ROT0,   "Coreland / Sega", "Brain", GAME_SUPPORTS_SAVE )
4868GAME( 1986, raflesia, 0,        system1,  raflesia, 4dwarrio, ROT270, "Coreland / Sega", "Rafflesia (315-5162)", GAME_SUPPORTS_SAVE )
48694869GAME( 1986, wboy,     0,        system1,  wboy,     wboy,     ROT0,   "Sega (Escape license)", "Wonder Boy (set 1, 315-5177)", GAME_SUPPORTS_SAVE )
48704870GAME( 1986, wboyo,    wboy,     system1,  wboy,     hvymetal, ROT0,   "Sega (Escape license)", "Wonder Boy (set 1, 315-5135)", GAME_SUPPORTS_SAVE )
48714871GAME( 1986, wboy2,    wboy,     system1,  wboy,     wboy2,    ROT0,   "Sega (Escape license)", "Wonder Boy (set 2, 315-5178)", GAME_SUPPORTS_SAVE )
r1386r1387
48754875GAME( 1986, wboyu,    wboy,     system1,  wboyu,    0,        ROT0,   "Sega (Escape license)", "Wonder Boy (not encrypted)", GAME_SUPPORTS_SAVE )
48764876GAME( 1986, wboysys2, wboy,     wbml,     wboysys2, wboy,     ROT0,   "Sega (Escape license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE )
48774877GAME( 1986, wbdeluxe, wboy,     system1,  wbdeluxe, 0,        ROT0,   "Sega (Escape license)", "Wonder Boy Deluxe", GAME_SUPPORTS_SAVE )
4878GAME( 1986, gardia,   0,        brain,    gardia,   gardia,   ROT270, "Sega / Coreland",       "Gardia (317-0006)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4879GAME( 1986, gardiab,  gardia,   brain,    gardia,   gardiab,  ROT270, "bootleg",              "Gardia (317-0007?, bootleg)", GAME_NOT_WORKING | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4880GAME( 1986, noboranb, 0,        noboranb, noboranb, noboranb, ROT270, "bootleg",              "Noboranka (Japan)", GAME_SUPPORTS_SAVE )
4881GAME( 1987, blockgal, 0,        system1,  blockgal, blockgal, ROT90,  "Sega / Vic Tokai",      "Block Gal (MC-8123B, 317-0029)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4882GAME( 1987, blckgalb, blockgal, blckgalb, blockgal, bootleg,  ROT90,  "bootleg",              "Block Gal (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4883GAME( 1987, tokisens, 0,        wbml,     tokisens, 0,        ROT90,  "Sega",                 "Toki no Senshi - Chrono Soldier", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4884GAME( 1987, wbml,     0,        wbml,     wbml,     wbml,     ROT0,   "Sega / Westone",        "Wonder Boy in Monster Land (Japan New Ver., MC-8123, 317-0043)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4885GAME( 1987, wbmljo,   wbml,     wbml,     wbml,     wbml,     ROT0,   "Sega / Westone",        "Wonder Boy in Monster Land (Japan Old Ver., MC-8123, 317-0043)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4886GAME( 1987, wbmljb,   wbml,     wbml,     wbml,     bootlegb, ROT0,   "bootleg",              "Wonder Boy in Monster Land (Japan not encrypted)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4887GAME( 1987, wbmlb,    wbml,     wbml,     wbml,     bootlegb, ROT0,   "bootleg",              "Wonder Boy in Monster Land (English bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4888GAME( 1987, wbmlbg,   wbml,     wbml,     wbml,     bootlegb, ROT0,   "bootleg",              "Wonder Boy in Monster Land (Galaxy Electronics English bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4889GAME( 1987, dakkochn, 0,        wbml,     wbml,     dakkochn, ROT0,   "Whiteboard",             "DakkoChan House (MC-8123, 317-0014)", GAME_NOT_WORKING | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4890GAME( 1988, ufosensi, 0,        ufosensi, ufosensi, ufosensi, ROT0,   "Sega",                 "Ufo Senshi Yohko Chan (MC-8123, 317-0064)", GAME_SUPPORTS_SAVE )
4891GAME( 1988, ufosensb, ufosensi, ufosensi, ufosensi, bootlegb, ROT0,   "bootleg",             "Ufo Senshi Yohko Chan (not encrypted)", GAME_SUPPORTS_SAVE )
4878GAME( 1986, gardia,   0,        brain,    gardia,   gardia,   ROT270, "Sega / Coreland", "Gardia (317-0006)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4879GAME( 1986, gardiab,  gardia,   brain,    gardia,   gardiab,  ROT270, "bootleg",         "Gardia (317-0007?, bootleg)", GAME_NOT_WORKING | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4880GAME( 1986, noboranb, 0,        noboranb, noboranb, noboranb, ROT270, "bootleg",         "Noboranka (Japan)", GAME_SUPPORTS_SAVE )
4881GAME( 1987, blockgal, 0,        system1,  blockgal, blockgal, ROT90,  "Sega / Vic Tokai", "Block Gal (MC-8123B, 317-0029)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4882GAME( 1987, blckgalb, blockgal, blckgalb, blockgal, bootleg,  ROT90,  "bootleg",         "Block Gal (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4883GAME( 1987, tokisens, 0,        wbml,     tokisens, 0,        ROT90,  "Sega",            "Toki no Senshi - Chrono Soldier", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4884GAME( 1987, wbml,     0,        wbml,     wbml,     wbml,     ROT0,   "Sega / Westone",  "Wonder Boy in Monster Land (Japan New Ver., MC-8123, 317-0043)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4885GAME( 1987, wbmljo,   wbml,     wbml,     wbml,     wbml,     ROT0,   "Sega / Westone",  "Wonder Boy in Monster Land (Japan Old Ver., MC-8123, 317-0043)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4886GAME( 1987, wbmljb,   wbml,     wbml,     wbml,     bootlegb, ROT0,   "bootleg",         "Wonder Boy in Monster Land (Japan not encrypted)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4887GAME( 1987, wbmlb,    wbml,     wbml,     wbml,     bootlegb, ROT0,   "bootleg",         "Wonder Boy in Monster Land (English bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4888GAME( 1987, wbmlbg,   wbml,     wbml,     wbml,     bootlegb, ROT0,   "bootleg",         "Wonder Boy in Monster Land (Galaxy Electronics English bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
4889GAME( 1987, dakkochn, 0,        wbml,     wbml,     dakkochn, ROT0,   "Whiteboard",      "DakkoChan House (MC-8123, 317-0014)", GAME_NOT_WORKING | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
4890GAME( 1988, ufosensi, 0,        ufosensi, ufosensi, ufosensi, ROT0,   "Sega",            "Ufo Senshi Yohko Chan (MC-8123, 317-0064)", GAME_SUPPORTS_SAVE )
4891GAME( 1988, ufosensb, ufosensi, ufosensi, ufosensi, bootlegb, ROT0,   "bootleg",         "Ufo Senshi Yohko Chan (not encrypted)", GAME_SUPPORTS_SAVE )
src/mame/drivers/zn.c
r1386r1387
8686static const UINT8 mg06[ 8 ] = { 0xc0, 0xe2, 0xe1, 0xfd, 0x04, 0x78, 0x70, 0xf0 };
8787static const UINT8 mg08[ 8 ] = { 0xf0, 0xfa, 0xf9, 0xc1, 0x20, 0x1c, 0x7c, 0x80 };
8888static const UINT8 mg09[ 8 ] = { 0xf0, 0x03, 0xe2, 0x18, 0x78, 0x7c, 0x3c, 0xc0 }; /* brute forced */
89static const UINT8 mg10[ 8 ] = { 0xfc, 0xf2, 0x30, 0xc1, 0xf9, 0x78, 0x60, 0xe0 };
8990static const UINT8 mg11[ 8 ] = { 0x80, 0xc2, 0x38, 0xf9, 0xfd, 0x1c, 0x10, 0xf0 };
91static const UINT8 mg12[ 8 ] = { 0x02, 0x40, 0x38, 0xf9, 0xfd, 0x1c, 0x10, 0xf0 };
9092static const UINT8 mg13[ 8 ] = { 0xc0, 0xe2, 0xe1, 0xf9, 0x04, 0x0c, 0x70, 0x80 };
9193static const UINT8 mg14[ 8 ] = { 0xfc, 0xf2, 0xfa, 0x18, 0x20, 0x40, 0x81, 0x01 };
9294static const UINT8 tt01[ 8 ] = { 0xe0, 0xf9, 0xfd, 0x7c, 0x70, 0x30, 0xc2, 0x02 };
r1386r1387
156158   { "flameguj", mg01, mg06 }, /* OK, geometry issues */
157159   { "glpracr3", mg01, mg08 },
158160   { "tondemo",  mg01, mg09 }, /* OK */
161   { "1on1gov",  mg01, mg10 }, /* OK */
159162   { "brvblade", mg01, mg11 }, /* OK */
163   { "tblkkuzu", mg01, mg12 }, /* OK */
160164   { "tecmowcm", mg01, mg13 }, /* OK */
161165   { "mfjump",   mg01, mg14 }, /* OK */
162166   { "sfchamp",  tt01, tt02 }, /* stuck in test mode */
r1386r1387
399403      }
400404      n_game++;
401405   }
406
407   at28c16_init( 0, memory_region( REGION_USER4 ), NULL );
402408}
403409
404410static struct PSXSPUinterface psxspu_interface =
r1386r1387
40154021   ROM_LOAD( "mfj.216",            0x0400000, 0x400000, CRC(0d518dba) SHA1(100cd4d0a1e678e660336027f067a9a1f5cbad3e) )
40164022ROM_END
40174023
4024ROM_START( tblkkuzu )
4025   TPS_BIOS
4026
4027   ROM_REGION32_LE( 0x02800000, REGION_USER2, 0 )
4028   ROM_LOAD16_BYTE( "tbk.u119",   0x0000001, 0x100000, CRC(621b07e1) SHA1(30773aaa333fdee7ef55db2f8adde010688abce1) )
4029   ROM_LOAD16_BYTE( "tbk.u120",   0x0000000, 0x100000, CRC(bb390f7d) SHA1(6bce88448fbb5308952f8c221e786be8aa51ceff) )
4030   ROM_LOAD( "tbk.u0216",          0x0400000, 0x400000, CRC(41f8285f) SHA1(3326ab83d96d51ed31fb5c2f30630ff480d45282) )
4031ROM_END
4032
4033ROM_START( 1on1gov )
4034   TPS_BIOS
4035
4036   ROM_REGION32_LE( 0x02800000, REGION_USER2, 0 )
4037   ROM_LOAD16_BYTE( "1on1.u119",   0x0000001, 0x100000, CRC(10aecc19) SHA1(ad2fe6011551935907568cc3b4028f481034537c) )
4038   ROM_LOAD16_BYTE( "1on1.u120",   0x0000000, 0x100000, CRC(eea158bd) SHA1(2b2a56fcce46557201bbbab7b170ee64549ddafe) )
4039   ROM_LOAD( "ooo-0.u0217",  0x0800000, 0x400000, CRC(8b42f365) SHA1(6035a370f477f0f33894f642717fa0b012540d36) )
4040   ROM_LOAD( "ooo-1.u0218",  0x0c00000, 0x400000, CRC(65162f46) SHA1(db420a2f0d996b32cd4b6e9352d46a36fa31eaaa) )
4041   ROM_LOAD( "ooo-2.u0219",  0x1000000, 0x400000, CRC(14cf3a84) SHA1(60175a1fb2c765e4c3d0e30e77961f84cfa8485c) )
4042   ROM_LOAD( "ooo-3.u0220",  0x1400000, 0x400000, CRC(9a45f6ff) SHA1(e0ee90c545c821bf1d6b4709b1e40f93314c51a6) )
4043   ROM_LOAD( "ooo-4.u0221",  0x1800000, 0x400000, CRC(ba20a1fd) SHA1(7893f50de730624b8447f39fc7e25e4e334df845) )
4044   ROM_LOAD( "ooo-5.u0222",  0x1c00000, 0x400000, CRC(eed1953d) SHA1(8d3e738a07b9c6b6ca55be7b47444b5e3725065c) )
4045   ROM_LOAD( "ooo-6.u0223",  0x2000000, 0x400000, CRC(f74f38b6) SHA1(ff7f0ebff85fc982f8d1c13d6649d4c7c5da6c45) )
4046   ROM_LOAD( "ooo-7.u0323",  0x2400000, 0x400000, CRC(0e58777c) SHA1(9f8ee3c6d6d8b1482522500e18217577056d8c98) )
4047
4048   ROM_REGION( 0x800, REGION_USER4, 0 ) /* at28c16 */
4049        ROM_LOAD( "at28c16",      0x0000000, 0x000800, BAD_DUMP CRC(ff7b63e3) SHA1(febf073c91041394cabdc1c37cbce344b14cd6bd) )
4050ROM_END
4051
40184052/* video system */
40194053
40204054#define KN_BIOS \
r1386r1387
46004634GAME( 1999, glpracr3, tps,      coh1002m, zn, coh1002m, ROT0, "Tecmo", "Gallop Racer 3 (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
46014635GAME( 1999, flamegun, tps,      coh1002m, zn, coh1002m, ROT0, "GAPS Inc.", "Flame Gunner", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
46024636GAME( 1999, flameguj, flamegun, coh1002m, zn, coh1002m, ROT0, "GAPS Inc.", "Flame Gunner (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4637GAME( 2000, tblkkuzu, tps,   coh1002m, zn, coh1002m, ROT0, "Tamsoft/D3 Publisher", "The Block Kuzushi (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4638GAME( 2000, 1on1gov,  tps,   coh1002m, zn, coh1002m, ROT0, "Tecmo", "1 on 1 Government (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
46034639GAME( 2000, tecmowcm, tps,      coh1002m, zn, coh1002m, ROT0, "Tecmo", "Tecmo World Cup Millennium (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
46044640GAME( 2001, mfjump,   tps,      coh1002m, zn, coh1002m, ROT0, "Tecmo", "Monster Farm Jump (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
46054641
src/mame/drivers/dribling.c
r1386r1387
186186 *
187187 *************************************/
188188
189static ppi8255_interface ppi8255_intf =
189static const ppi8255_interface ppi8255_intf =
190190{
191191   2,
192192   { dsr_r,        NULL           },
src/mame/drivers/filetto.c
r1386r1387
475475}
476476
477477
478static ppi8255_interface filetto_ppi8255_intf =
478static const ppi8255_interface filetto_ppi8255_intf =
479479{
480480   2,                      /* 2 chips */
481481   { port_a_r,NULL },         /* Port A read */
src/mame/drivers/ashnojoe.c
r1386r1387
11/***************************************************************************
22
3Ashita no Joe (Success Joe) [Wave]
3 Success Joe / Ashita no Joe [Wave]
44
55driver by David Haywood and bits from Pierpaolo Prazzoli
66
r1386r1387
99- frequencies
1010- 1 unused rom
1111
12there is an english logo in the roms, needs different program roms?
12Upper board marked: W9011
1313
14Tow sub-boards:
14Sticker on the upper pcb of Success Joe (World) labelled:
15M6100506A
16SUCCESS JOE
17900110149
1518
19Two sub-boards:
20
1621Upper:
1722
1823 Program
r1386r1387
2934 GFX?
3035  Mask ROMs 401, 402 & 403 (Hitachi HN62414 Mask ROMs)
3136
37 Note: the pcb has a place for a battery circuit but the components are not soldered.
38
3239Lower:
3340
3441 GFX?
r1386r1387
382389   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
383390MACHINE_DRIVER_END
384391
392ROM_START( scessjoe )
393   ROM_REGION( 0xc0000, REGION_CPU1, 0 )     /* 68000 code */
394   ROM_LOAD16_BYTE( "5.4q", 0x00000, 0x10000, CRC(c805f9e7) SHA1(e1e85701bde496b1fd64211b94bfb0def597ae51) )
395   ROM_LOAD16_BYTE( "6.4s", 0x00001, 0x10000, CRC(eda7a537) SHA1(3bb19fbdfb6c8af4e2078958fa445ac1f4434d0d) )
396   ROM_LOAD16_WORD_SWAP( "sj201-nw.6m", 0x80000, 0x40000, CRC(5a64ca42) SHA1(660b8bca21ef3c2230adce7cb7e7d1f018714f23) )
397
398   ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 32k for Z80 code */
399   ROM_LOAD( "9.8q", 0x0000, 0x8000, CRC(8767e212) SHA1(13bf927febedff9d7d164fbf0da7fb3a588c2a94) )
400
401   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
402   ROM_LOAD( "8.5e", 0x00000, 0x10000, CRC(9bcb160e) SHA1(1677048e5ce26562ff7ba36fcc2d0ed5a652b91e) )
403   ROM_LOAD( "7.5c", 0x10000, 0x10000, CRC(b250c69d) SHA1(594b1bb94a162b07944a971b7fedddca5c37f2cb) )
404
405   ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
406   ROM_LOAD( "4.4e", 0x00000, 0x10000, CRC(aa6336d3) SHA1(43f70cc3223f11d7929dd44b0edf0a31f5fe41c3) )
407   ROM_LOAD( "3.4c", 0x10000, 0x10000, CRC(7e2d86b5) SHA1(8b8d1b9240a700e29afc109eddf6e58a0a7666a4) )
408
409   ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE )
410   ROM_LOAD( "2.3m", 0x00000, 0x10000, CRC(c3254938) SHA1(fd57163f740cd4fdecca94cced91314c289741ae) )
411   ROM_LOAD( "1.1m", 0x10000, 0x10000, CRC(5d16a6fa) SHA1(2af907b0fcb9ff93340de3301da4b10e945455e5) )
412
413   ROM_REGION( 0x100000, REGION_GFX4, ROMREGION_DISPOSE )
414   ROM_LOAD16_WORD_SWAP( "sj402-nw.8e", 0x000000, 0x80000, CRC(b6d33d06) SHA1(688ccf467a5112ec522811894e2626ab5f155903) )
415   ROM_LOAD16_WORD_SWAP( "sj403-nw.7e", 0x080000, 0x80000, CRC(07143f56) SHA1(1b953c8826d3993a486eed6b9d94d37145fd2e79) )
416
417   ROM_REGION( 0x300000, REGION_GFX5, ROMREGION_DISPOSE )
418   ROM_LOAD16_WORD_SWAP( "sj404-nw.7a", 0x000000, 0x80000, CRC(8f134128) SHA1(026a6076d54cd5f1d06b29c51031cb79a6b2c11d) )
419   ROM_LOAD16_WORD_SWAP( "sj405-nw.7c", 0x080000, 0x80000, CRC(6fd81699) SHA1(8a4f9e47dd39b4b0213c3682da2221ca53bba658) )
420   ROM_LOAD16_WORD_SWAP( "sj406-nw.7d", 0x100000, 0x80000, CRC(634e33e6) SHA1(1d6a72a4ca80cd1c1fd6ce9359c304b45091cdfe) )
421   ROM_LOAD16_WORD_SWAP( "sj407-nw.7f", 0x180000, 0x80000, CRC(5c66ff06) SHA1(9923ba00679e1b47b5da63c1a13e0f8dd4c78bb5) )
422   ROM_LOAD16_WORD_SWAP( "sj408-nw.7g", 0x200000, 0x80000, CRC(6a3b1ea1) SHA1(e39a6e52d930f291bf237cf9db3d4b3d2fad53e0) )
423   ROM_LOAD16_WORD_SWAP( "sj409-nw.7j", 0x280000, 0x80000, CRC(d8764213) SHA1(89eadefb956863216c8e3d0380394aba35e8c856) )
424
425   ROM_REGION( 0x80000, REGION_SOUND1, 0 )   /* samples? */
426   ROM_LOAD( "sj401-nw.10r", 0x00000, 0x80000, CRC(25dfab59) SHA1(7d50159204ba05323a2442778f35192e66117dda) )
427ROM_END
428
385429ROM_START( ashnojoe )
386430   ROM_REGION( 0xc0000, REGION_CPU1, 0 )     /* 68000 code */
387431   ROM_LOAD16_BYTE( "5.bin", 0x00000, 0x10000, CRC(c61e1569) SHA1(422c18f5810539b5a9e3a9bd4e3b4d70bde8d1d5) )
388432   ROM_LOAD16_BYTE( "6.bin", 0x00001, 0x10000, CRC(c0a16338) SHA1(fb127b9d38f2c9807b6e23ff71935fc8a22a2e8f) )
389   ROM_LOAD16_WORD_SWAP( "sj201-nw.bin", 0x80000, 0x40000, CRC(5a64ca42) SHA1(660b8bca21ef3c2230adce7cb7e7d1f018714f23) )
433   ROM_LOAD16_WORD_SWAP( "sj201-nw.6m", 0x80000, 0x40000, CRC(5a64ca42) SHA1(660b8bca21ef3c2230adce7cb7e7d1f018714f23) )
390434
391435   ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 32k for Z80 code */
392   ROM_LOAD( "9.bin", 0x0000, 0x8000, CRC(8767e212) SHA1(13bf927febedff9d7d164fbf0da7fb3a588c2a94) )
436   ROM_LOAD( "9.8q", 0x0000, 0x8000, CRC(8767e212) SHA1(13bf927febedff9d7d164fbf0da7fb3a588c2a94) )
393437
394438   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
395   ROM_LOAD( "8.bin", 0x00000, 0x10000, CRC(9bcb160e) SHA1(1677048e5ce26562ff7ba36fcc2d0ed5a652b91e) )
439   ROM_LOAD( "8.5e", 0x00000, 0x10000, CRC(9bcb160e) SHA1(1677048e5ce26562ff7ba36fcc2d0ed5a652b91e) )
396440   ROM_LOAD( "7.bin", 0x10000, 0x10000, CRC(7e1efc42) SHA1(e3c282072fdaa0b98c2a1bf25fd02c680d9ca4d7) )
397441
398442   ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
399   ROM_LOAD( "4.bin", 0x00000, 0x10000, CRC(aa6336d3) SHA1(43f70cc3223f11d7929dd44b0edf0a31f5fe41c3) )
400   ROM_LOAD( "3.bin", 0x10000, 0x10000, CRC(7e2d86b5) SHA1(8b8d1b9240a700e29afc109eddf6e58a0a7666a4) )
443   ROM_LOAD( "4.4e", 0x00000, 0x10000, CRC(aa6336d3) SHA1(43f70cc3223f11d7929dd44b0edf0a31f5fe41c3) )
444   ROM_LOAD( "3.4c", 0x10000, 0x10000, CRC(7e2d86b5) SHA1(8b8d1b9240a700e29afc109eddf6e58a0a7666a4) )
401445
402446   ROM_REGION( 0x20000, REGION_GFX3, ROMREGION_DISPOSE )
403   ROM_LOAD( "2.bin", 0x00000, 0x10000, CRC(c3254938) SHA1(fd57163f740cd4fdecca94cced91314c289741ae) )
447   ROM_LOAD( "2.3m", 0x00000, 0x10000, CRC(c3254938) SHA1(fd57163f740cd4fdecca94cced91314c289741ae) )
404448   ROM_LOAD( "1.bin", 0x10000, 0x10000, CRC(1bf585f0) SHA1(4003941636e7fded95e880109c3c9dd1d8f28b07) )
405449
406450   ROM_REGION( 0x100000, REGION_GFX4, ROMREGION_DISPOSE )
407   ROM_LOAD16_WORD_SWAP( "sj402-nw.bin", 0x000000, 0x80000, CRC(b6d33d06) SHA1(688ccf467a5112ec522811894e2626ab5f155903) )
408   ROM_LOAD16_WORD_SWAP( "sj403-nw.bin", 0x080000, 0x80000, CRC(07143f56) SHA1(1b953c8826d3993a486eed6b9d94d37145fd2e79) )
451   ROM_LOAD16_WORD_SWAP( "sj402-nw.8e", 0x000000, 0x80000, CRC(b6d33d06) SHA1(688ccf467a5112ec522811894e2626ab5f155903) )
452   ROM_LOAD16_WORD_SWAP( "sj403-nw.7e", 0x080000, 0x80000, CRC(07143f56) SHA1(1b953c8826d3993a486eed6b9d94d37145fd2e79) )
409453
410454   ROM_REGION( 0x300000, REGION_GFX5, ROMREGION_DISPOSE )
411   ROM_LOAD16_WORD_SWAP( "sj404-nw.bin", 0x000000, 0x80000, CRC(8f134128) SHA1(026a6076d54cd5f1d06b29c51031cb79a6b2c11d) )
412   ROM_LOAD16_WORD_SWAP( "sj405-nw.bin", 0x080000, 0x80000, CRC(6fd81699) SHA1(8a4f9e47dd39b4b0213c3682da2221ca53bba658) )
413   ROM_LOAD16_WORD_SWAP( "sj406-nw.bin", 0x100000, 0x80000, CRC(634e33e6) SHA1(1d6a72a4ca80cd1c1fd6ce9359c304b45091cdfe) )
414   ROM_LOAD16_WORD_SWAP( "sj407-nw.bin", 0x180000, 0x80000, CRC(5c66ff06) SHA1(9923ba00679e1b47b5da63c1a13e0f8dd4c78bb5) )
415   ROM_LOAD16_WORD_SWAP( "sj408-nw.bin", 0x200000, 0x80000, CRC(6a3b1ea1) SHA1(e39a6e52d930f291bf237cf9db3d4b3d2fad53e0) )
416   ROM_LOAD16_WORD_SWAP( "sj409-nw.bin", 0x280000, 0x80000, CRC(d8764213) SHA1(89eadefb956863216c8e3d0380394aba35e8c856) )
455   ROM_LOAD16_WORD_SWAP( "sj404-nw.7a", 0x000000, 0x80000, CRC(8f134128) SHA1(026a6076d54cd5f1d06b29c51031cb79a6b2c11d) )
456   ROM_LOAD16_WORD_SWAP( "sj405-nw.7c", 0x080000, 0x80000, CRC(6fd81699) SHA1(8a4f9e47dd39b4b0213c3682da2221ca53bba658) )
457   ROM_LOAD16_WORD_SWAP( "sj406-nw.7d", 0x100000, 0x80000, CRC(634e33e6) SHA1(1d6a72a4ca80cd1c1fd6ce9359c304b45091cdfe) )
458   ROM_LOAD16_WORD_SWAP( "sj407-nw.7f", 0x180000, 0x80000, CRC(5c66ff06) SHA1(9923ba00679e1b47b5da63c1a13e0f8dd4c78bb5) )
459   ROM_LOAD16_WORD_SWAP( "sj408-nw.7g", 0x200000, 0x80000, CRC(6a3b1ea1) SHA1(e39a6e52d930f291bf237cf9db3d4b3d2fad53e0) )
460   ROM_LOAD16_WORD_SWAP( "sj409-nw.7j", 0x280000, 0x80000, CRC(d8764213) SHA1(89eadefb956863216c8e3d0380394aba35e8c856) )
417461
418462   ROM_REGION( 0x80000, REGION_SOUND1, 0 )   /* samples? */
419   ROM_LOAD( "sj401-nw.bin", 0x00000, 0x80000, CRC(25dfab59) SHA1(7d50159204ba05323a2442778f35192e66117dda) )
463   ROM_LOAD( "sj401-nw.10r", 0x00000, 0x80000, CRC(25dfab59) SHA1(7d50159204ba05323a2442778f35192e66117dda) )
420464ROM_END
421465
422GAME( 1990, ashnojoe, 0, ashnojoe, ashnojoe, ashnojoe, ROT0, "WAVE / Taito Corporation", "Ashita no Joe (Japan)", GAME_IMPERFECT_SOUND )
466GAME( 1990, scessjoe, 0,        ashnojoe, ashnojoe, ashnojoe, ROT0, "WAVE / Taito Corporation", "Success Joe (World)", GAME_IMPERFECT_SOUND )
467GAME( 1990, ashnojoe, scessjoe, ashnojoe, ashnojoe, ashnojoe, ROT0, "WAVE / Taito Corporation", "Ashita no Joe (Japan)", GAME_IMPERFECT_SOUND )
468
src/mame/drivers/findout.c
r1386r1387
110110//  popmessage("%02x",data);
111111}
112112
113static ppi8255_interface ppi8255_intf =
113static const ppi8255_interface ppi8255_intf =
114114{
115115   2,                            /* 2 chips */
116116   { input_port_0_r, input_port_2_r },   /* Port A read */
src/mame/drivers/undrfire.c
r1386r1387
174174                EPROM
175175**********************************************************/
176176
177static UINT8 default_eeprom[128]=
177static const UINT8 default_eeprom[128]=
178178{
179179   0x02,0x01,0x11,0x12,0x01,0x01,0x01,0x00,0x80,0x80,0x30,0x01,0x00,0x00,0x62,0x45,
180180   0xe0,0xa0,0xff,0x28,0xff,0xff,0xfa,0xd7,0x33,0x28,0x00,0x00,0x33,0x28,0x00,0x00,
r1386r1387
186186   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
187187};
188188
189static struct EEPROM_interface undrfire_eeprom_interface =
189static const struct EEPROM_interface undrfire_eeprom_interface =
190190{
191191   6,            /* address bits */
192192   16,            /* data bits */
src/mame/drivers/malzak.c
r1386r1387
414414}
415415
416416
417static struct SN76477interface sn76477_intf =
417static const struct SN76477interface sn76477_intf =
418418{
419419   0,   /* N/C */      /*  4  noise_res         */
420420   0,   /* N/C */      /*  5  filter_res        */
src/mame/drivers/deco32.c
r1386r1387
18361836   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
18371837};
18381838
1839static struct EEPROM_interface eeprom_interface_tattass =
1839static const struct EEPROM_interface eeprom_interface_tattass =
18401840{
18411841   10,            // address bits 10  ==> } 1024 byte eprom
18421842   8,            // data bits    8
src/mame/drivers/drw80pkr.c
r0r1387
1/**********************************************************************************
2
3
4    DRAW 80 POKER
5
6    Driver by Jim Stolis.
7
8
9    --- Technical Notes ---
10
11    Name:    Draw 80 Poker
12    Company: IGT - International Gaming Technology
13    Year:    1983
14
15    Hardware:
16
17    CPU =  INTEL 8039       ; I8039 compatible
18    VIDEO = SYS 6545        ; CRTC6845 compatible
19    SND =  AY-3-8912        ; AY8910 compatible
20
21    History:
22
23    This is one of the first video machines produced by IGT.  Originally, the
24    company was called SIRCOMA and was founded in 1979.  It became a public
25    company in 1981 and changed its name to IGT.  The motherboard has a date
26    of 1982 (c) IGT, but the game rom labels and backglass are dated 1983.
27
28***********************************************************************************/
29#include "driver.h"
30#include "sound/ay8910.h"
31#include "cpu/i8039/i8039.h"
32#include "video/crtc6845.h"
33
34static tilemap *bg_tilemap;
35
36static UINT8 p1, p2, p4, bus;
37
38static UINT8 *pkr_cmos_ram;
39
40
41/*****************
42* Write Handlers *
43******************/
44
45WRITE8_HANDLER( p1_w )
46{
47   p1 = data;
48}
49
50WRITE8_HANDLER( p2_w )
51{
52   p2 = data;
53}
54
55WRITE8_HANDLER( p4_w )
56{
57   p4 = data;
58}
59
60WRITE8_HANDLER( bus_w )
61{
62   bus = data;
63}
64
65WRITE8_HANDLER( drw80pkr_cmos_w )
66{
67    //if (p2 == 0xc7) CRTC Register
68    //if (p2 == 0xd7) CRTC Address
69    pkr_cmos_ram[offset] = data;
70}
71
72/****************
73* Read Handlers *
74****************/
75
76READ8_HANDLER( p1_r )
77{
78    return p1;
79}
80
81READ8_HANDLER( p2_r )
82{
83    return p2;
84}
85
86READ8_HANDLER( bus_r )
87{
88    return bus;
89}
90
91READ8_HANDLER( drw80pkr_cmos_r )
92{
93    return pkr_cmos_ram[offset];
94}
95
96/****************************
97* Video/Character functions *
98****************************/
99
100static TILE_GET_INFO( get_bg_tile_info )
101{
102    int vr = 0;
103   int code = vr;
104   int color = 0;
105
106   SET_TILE_INFO(0, code, color, 0);
107}
108
109VIDEO_START( drw80pkr )
110{
111   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 40, 25);
112}
113
114VIDEO_UPDATE( drw80pkr )
115{
116   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
117
118   return 0;
119}
120
121PALETTE_INIT( drw80pkr )
122{
123/*  prom bits
124    7654 3210
125    ---- -xxx   red component.
126    --xx x---   green component.
127    xx-- ----   blue component.
128*/
129   int i;
130
131   for (i = 0;i < machine->drv->total_colors;i++)
132   {
133      int bit0, bit1, bit2, r, g, b;
134
135      /* red component */
136      bit0 = (~color_prom[i] >> 0) & 0x01;
137      bit1 = (~color_prom[i] >> 1) & 0x01;
138      bit2 = (~color_prom[i] >> 2) & 0x01;
139      r = 0x21 * bit2 + 0x47 * bit1 + 0x97 * bit0;
140
141      /* green component */
142      bit0 = (~color_prom[i] >> 3) & 0x01;
143      bit1 = (~color_prom[i] >> 4) & 0x01;
144      bit2 = (~color_prom[i] >> 5) & 0x01;
145      g = 0x21 * bit2 + 0x47 * bit1 + 0x97 * bit0;
146
147      /* blue component */
148      bit0 = (~color_prom[i] >> 6) & 0x01;
149      bit1 = (~color_prom[i] >> 7) & 0x01;
150      bit2 = 0;
151      b = 0x21 * bit2 + 0x47 * bit1 + 0x97 * bit0;
152
153      palette_set_color(machine, i, MAKE_RGB(r, g, b));
154   }
155}
156
157
158/*************************
159*    Graphics Layouts    *
160*************************/
161
162static const gfx_layout charlayout =
163{
164   8,8,    /* 8x8 characters */
165   0x200, /* 512 characters */
166   2,  /* 2 bitplanes */
167   { 0x200*8*8*1, 0x200*8*8*0 }, /* bitplane offsets */
168   { 0, 1, 2, 3, 4, 5, 6, 7 },
169   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
170   8*8
171};
172
173
174/******************************
175* Graphics Decode Information *
176******************************/
177
178static GFXDECODE_START( drw80pkr )
179   GFXDECODE_ENTRY( REGION_GFX1, 0x00000, charlayout, 0, 16 )
180GFXDECODE_END
181
182
183/**************
184* Driver Init *
185***************/
186
187static DRIVER_INIT( drw80pkr )
188{
189
190}
191
192
193/*************************
194* Memory map information *
195*************************/
196
197static ADDRESS_MAP_START( drw80pkr_map, ADDRESS_SPACE_PROGRAM, 8 )
198   AM_RANGE(0x0000, 0x1fff) AM_READWRITE(MRA8_ROM, MWA8_ROM)
199ADDRESS_MAP_END
200
201static ADDRESS_MAP_START( drw80pkr_io_map, ADDRESS_SPACE_IO, 8 )
202   AM_RANGE(0x00, 0xff) AM_RAM AM_READWRITE(drw80pkr_cmos_r, drw80pkr_cmos_w) AM_BASE(&pkr_cmos_ram)
203   AM_RANGE(I8039_t1, I8039_t1) AM_RAM
204   AM_RANGE(I8039_p1, I8039_p1) AM_RAM AM_READWRITE(p1_r, p1_w)
205   AM_RANGE(I8039_p2, I8039_p2) AM_RAM AM_READWRITE(p2_r, p2_w)
206    AM_RANGE(I8039_p4, I8039_p4) AM_RAM AM_WRITE(p4_w)
207    AM_RANGE(I8039_bus, I8039_bus) AM_RAM AM_READWRITE(bus_r, bus_w)
208ADDRESS_MAP_END
209
210/*************************
211*      Input ports       *
212*************************/
213
214static INPUT_PORTS_START( drw80pkr )
215   // Unknown at this time
216INPUT_PORTS_END
217
218/*************************
219*     Machine Driver     *
220*************************/
221
222static MACHINE_DRIVER_START( drw80pkr )
223   // basic machine hardware
224   MDRV_CPU_ADD_TAG("main", I8039, 7864300)
225   MDRV_CPU_PROGRAM_MAP(drw80pkr_map, 0)
226    MDRV_CPU_IO_MAP(drw80pkr_io_map, 0)
227   MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
228
229   MDRV_SCREEN_REFRESH_RATE(60)
230   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
231
232   // video hardware
233   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
234   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
235   MDRV_SCREEN_SIZE((31+1)*8, (31+1)*8)
236   MDRV_SCREEN_VISIBLE_AREA(0*8, 24*8-1, 0*8, 27*8-1)
237
238   MDRV_GFXDECODE(drw80pkr)
239   MDRV_PALETTE_LENGTH(16*16)
240
241   MDRV_PALETTE_INIT(drw80pkr)
242   MDRV_VIDEO_START(drw80pkr)
243   MDRV_VIDEO_UPDATE(drw80pkr)
244
245   // sound hardware
246   MDRV_SOUND_ADD(AY8912, 20000000/12)
247   MDRV_SPEAKER_STANDARD_MONO("mono")
248   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
249MACHINE_DRIVER_END
250
251/*************************
252*        Rom Load        *
253*************************/
254
255ROM_START( drw80pkr )
256   ROM_REGION( 0x2000, REGION_CPU1, 0 )
257   ROM_LOAD( "pm0.u81",   0x0000, 0x1000, CRC(0f3e97d2) SHA1(aa9e4015246284f32435d7320de667e075412e5b) )
258    ROM_LOAD( "pm1.u82",   0x1000, 0x1000, CRC(5a6ad467) SHA1(0128bd70b65244a0f68031d5f451bf115eeb7609) )
259
260   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
261   ROM_LOAD( "cg0-a.u74",    0x0000, 0x1000, CRC(97f5eb92) SHA1(f6c7bb42ccef8a78e8d56104ad942ae5b8e5b0df) )
262   ROM_LOAD( "cg1-a.u76",    0x1000, 0x1000, CRC(2a3a750d) SHA1(db6183d11b2865b011c3748dc472cf5858dde78f) )
263
264   ROM_REGION( 0x100, REGION_PROMS, 0 ) // WRONG CAP
265   ROM_LOAD( "cap13.u92", 0x0000, 0x0100, CRC(42d6e973) SHA1(5c2983d5c80333ca45033070a2296fe58c339ee1) )
266ROM_END
267
268
269/*************************
270*      Game Drivers      *
271*************************/
272
273/*    YEAR  NAME      PARENT  MACHINE   INPUT     INIT      ROT    COMPANY                                  FULLNAME              FLAGS   */
274GAME( 1983, drw80pkr, 0,      drw80pkr, drw80pkr, drw80pkr, ROT0,  "IGT - International Gaming Technology", "Draw 80 Poker",      GAME_NOT_WORKING )
src/mame/drivers/segaorun.c
r1386r1387
7676 *
7777 *************************************/
7878
79static ppi8255_interface single_ppi_intf =
79static const ppi8255_interface single_ppi_intf =
8080{
8181   1,
8282   { unknown_porta_r },
src/mame/drivers/gticlub.c
r1386r1387
119119/******************************************************************/
120120
121121/* 93C56 EEPROM */
122static struct EEPROM_interface eeprom_interface =
122static const struct EEPROM_interface eeprom_interface =
123123{
124124   8,            /* address bits */
125125   16,            /* data bits */
src/mame/drivers/dkong.c
r1386r1387
44
55- dkongjr discrete interface
66- write a shootgal palette_init
7- when i am retired: implement 8257 DMA controller
7- Pestplce colors and origin
8- Shooting Gallery: Shootgal.txt mentions speech pcb, mikesarcade.com dk conversion
9  Clarify
10- 8ballact: read 1507 no mapped
11- drakton - add dkongjr conversion
12- implement 74LS259 (8bit addressable latches), 74LS175 (QUAD D FlipFlop), 74LS373 (Octal transparent latch)
813
14
15Done:
16- when i am retired: implement 8257 DMA controller
917- radarscp_grid_color_w() is wrong, it probably isn't supposed to change
1018  the grid color. There are reports of the grid being constantly blue in
1119  the real game, the flyer confirms this.
r1386r1387
2331    - combined memory maps
2432    - first attempts on decoding m58815
2533
34  Couriersud: 11/2007
35
36    - Added configuration switch to change palette between TKG02 (radarscp conversion) and TKG04 (dkong 2board)
37    - Added speech support (samples) to radarsc1
38    - Hooked up and written 8257 dma controller
39        All dkong and dkongjr based games now use the 8257
40        All epos and 2650 based games now use the 8257
41    - Fixed 2650 games to use dkong audio as well - only cpu replaced by addon board ...
42    - straightened memory maps
43    - Fixed bug in dkong3b memory map
44    - Externalized sound drivers to MACHINE_START in audio/dkong.c
45    - DAC Filter now uses lowpass sallen key filter
46    - Reorganized INPUT_PORTS
47    - Fixed sound for drakton and strtheat
48    - Added Dip-Switch locations to 8ballact
49    - Fixed 8ballact according to conversion manual
50    - Reorganized code
51    - http://members.cox.net/rcolbert/mame_cocktail_project.htm mentions, that radarscp to dkong conversions
52      have a sticker TKG-2 over the TRS-02 label.
53    - PCB Info (Dkong.txt) mentions, that TKG-3 is a 4 board set. This seems to be based on the radarscp 4-board set trs-02.
54      Schematics show, that these boards actually were based on TRS-02
55    - TKG-4 is a 2 board set.
56
2657Donkey Kong and Donkey Kong Jr. memory map (preliminary) (DKong 3 follows)
2758
28590000-3fff ROM (Donkey Kong Jr.and Donkey Kong 3: 0000-5fff)
r1386r1387
174205***************************************************************************/
175206
176207#include "driver.h"
177#include "cpu/i8039/i8039.h"
178208#include "cpu/s2650/s2650.h"
179209#include "cpu/m6502/m6502.h"
180#include "sound/dac.h"
181#include "sound/samples.h"
182#include "sound/nes_apu.h"
183210#include "includes/dkong.h"
211#include "machine/8257dma.h"
184212#include <math.h>
185213
186214/*************************************
187215 *
188 *  Globals
216 *  prototypes
189217 *
190218 *************************************/
191219
192static INT8 counter;
193static int hunchloopback;
220static UINT8 hb_dma_read_byte(int channel, offs_t offset);
221static void hb_dma_write_byte(int channel, offs_t offset, UINT8 data);
222static UINT8 dk_dma_read_byte(int channel, offs_t offset);
223static void dk_dma_write_byte(int channel, offs_t offset, UINT8 data);
224static UINT8 p8257_ctl_r(void);
225static void p8257_ctl_w(UINT8 data);
194226
195227/*************************************
196228 *
229 *  statics
230 *
231 *************************************/
232
233static struct dma8257_interface dk_dma =
234{
235   0,
236   CLOCK_1H,
237
238   dk_dma_read_byte,
239   dk_dma_write_byte,
240
241   { 0, p8257_ctl_r, 0, 0 },
242   { p8257_ctl_w, 0, 0, 0 },
243   { 0, 0, 0, 0 }
244};
245
246static struct dma8257_interface hb_dma =
247{
248   0,
249   CLOCK_1H,
250
251   hb_dma_read_byte,
252   hb_dma_write_byte,
253
254   { 0, p8257_ctl_r, 0, 0 },
255   { p8257_ctl_w, 0, 0, 0 },
256   { 0, 0, 0, 0 }
257};
258
259/*************************************
260 *
197261 *  VBLANK and IRQ generation
198262 *
199263 *************************************/
r1386r1387
209273 *
210274 *************************************/
211275
212/* EPOS games */
276static MACHINE_START( dkong2b )
277{
278   dkong_state *state = machine->driver_data;
213279
280   dma8257_init(1);
281   dma8257_config(0, &dk_dma);
282
283   state->hardware_type = HARDWARE_TKG04;
284
285   state_save_register_global(state->decrypt_counter);
286   state_save_register_global(state->dma_latch);
287
288}
289
290
291static MACHINE_START( hunchbkd )
292{
293   UINT8   *p = memory_region(REGION_PROMS);
294   int i;
295
296   dkong_state *state = Machine->driver_data;
297
298   machine_start_dkong2b(machine);
299   dma8257_config(0, &hb_dma);
300
301   for (i=0;i<0x200;i++)
302      state->rev_map[i] = -1;
303   for (i=0;i<0x200;i++)
304      state->rev_map[p[0x300+i]] = i;
305
306   state_save_register_global(state->hunchloopback);
307
308   state->hunchloopback = 0;
309
310}
311
312
313static MACHINE_START( radarscp )
314{
315   dkong_state *state = Machine->driver_data;
316
317   machine_start_dkong2b(machine);
318   state->hardware_type = HARDWARE_TRS02;
319}
320
321static MACHINE_START( radarsc1 )
322{
323   dkong_state *state = Machine->driver_data;
324
325   machine_start_dkong2b(machine);
326   state->hardware_type = HARDWARE_TRS01;
327}
328
329
214330static MACHINE_RESET( dkong )
215331{
332
333   dma8257_reset();
334
216335}
217336
218337static MACHINE_RESET( strtheat )
219338{
339   dkong_state *state = machine->driver_data;
220340   UINT8 *ROM = memory_region(REGION_CPU1);
221341
222342   machine_reset_dkong(machine);
223343
224344   /* The initial state of the counter is 0x08 */
225345   memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000);
226   counter = 0x08;
346   state->decrypt_counter = 0x08;
227347   memory_set_bank(1, 0);
228348}
229349
230350static MACHINE_RESET( drakton )
231351{
352   dkong_state *state = machine->driver_data;
232353   UINT8 *ROM = memory_region(REGION_CPU1);
233354
234355   machine_reset_dkong(machine);
235356
236357   /* The initial state of the counter is 0x09 */
237358   memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000);
238   counter = 0x09;
359   state->decrypt_counter = 0x09;
239360   memory_set_bank(1, 1);
240361}
241362
242static MACHINE_START( dkong )
363/*************************************
364 *
365 *  DMA handling
366 *
367 *************************************/
368
369static UINT8 dk_dma_read_byte(int channel, offs_t offset)
243370{
244   state_save_register_global(counter);
245   state_save_register_global(hunchloopback);
246   hunchloopback = 0;
371   UINT8 result;
372
373   cpuintrf_push_context(0);
374   result = program_read_byte(offset);
375   cpuintrf_pop_context();
376
377   return result;
247378}
248379
380static void dk_dma_write_byte(int channel, offs_t offset, UINT8 data)
381{
382   cpuintrf_push_context(0);
383   program_write_byte(offset, data);
384   cpuintrf_pop_context();
385}
386
387static UINT8 hb_dma_read_byte(int channel, offs_t offset)
388{
389   dkong_state *state = Machine->driver_data;
390   int     bucket = state->rev_map[(offset>>10) & 0x1ff];
391   int   addr;
392   UINT8 data;
393
394   if (bucket<0)
395      fatalerror("hb_dma_read_byte - unmapped access for 0x%02x - bucket 0x%02x\n", offset, bucket);
396
397   addr = ((bucket<<7) & 0x7c00) | (offset & 0x3ff);
398
399   cpuintrf_push_context(0);
400   data = program_read_byte(addr);
401   cpuintrf_pop_context();
402
403   return data;
404}
405
406static void hb_dma_write_byte(int channel, offs_t offset, UINT8 data)
407{
408   dkong_state *state = Machine->driver_data;
409   int     bucket = state->rev_map[(offset>>10) & 0x1ff];
410   int   addr;
411
412   if (bucket<0)
413      fatalerror("hb_dma_read_byte - unmapped access for 0x%02x - bucket 0x%02x\n", offset, bucket);
414
415   addr = ((bucket<<7) & 0x7c00) | (offset & 0x3ff);
416
417   cpuintrf_push_context(0);
418   program_write_byte(addr, data);
419   cpuintrf_pop_context();
420}
421
422static UINT8 p8257_ctl_r(void)
423{
424   dkong_state *state = Machine->driver_data;
425   return state->dma_latch;
426}
427
428static void p8257_ctl_w(UINT8 data)
429{
430   dkong_state *state = Machine->driver_data;
431   state->dma_latch = data;
432}
433
434
249435/*************************************
250436 *
251437 *  Output ports
252438 *
253439 *************************************/
254440
441static WRITE8_HANDLER( p8257_drq_w )
442{
443   dma8257_drq_write(0, 0, data & 0x01);
444   dma8257_drq_write(0, 1, data & 0x01);
445}
446
447static READ8_HANDLER( dkong_in2_r )
448{
449   return (readinputportbytag("IN2") & 0xBF) | (dkong_audio_status_r(0) << 6);
450}
451
255452static READ8_HANDLER( hunchbkd_mirror_r )
256453{
257454   return program_read_byte(0x1000+offset);
r1386r1387
264461
265462static READ8_HANDLER( epos_decrypt_rom )
266463{
464   dkong_state *state = Machine->driver_data;
465
267466   if (offset & 0x01)
268467   {
269      counter = counter - 1;
270      if (counter < 0)
271         counter = 0x0F;
468      state->decrypt_counter = state->decrypt_counter - 1;
469      if (state->decrypt_counter < 0)
470         state->decrypt_counter = 0x0F;
272471   }
273472   else
274473   {
275      counter = (counter + 1) & 0x0F;
474      state->decrypt_counter = (state->decrypt_counter + 1) & 0x0F;
276475   }
277476
278   switch(counter)
477   switch(state->decrypt_counter)
279478   {
280479      case 0x08:   memory_set_bank(1, 0);      break;
281480      case 0x09:   memory_set_bank(1, 1);      break;
282481      case 0x0A:   memory_set_bank(1, 2);      break;
283482      case 0x0B:   memory_set_bank(1, 3);      break;
284483      default:
285         logerror("Invalid counter = %02X\n",counter);
484         logerror("Invalid counter = %02X\n",state->decrypt_counter);
286485         break;
287486   }
288487
r1386r1387
291490
292491static WRITE8_HANDLER( hunchbkd_data_w )
293492{
294   hunchloopback=data;
493   dkong_state *state = Machine->driver_data;
494
495   state->hunchloopback = data;
295496}
296497
297498static READ8_HANDLER( hunchbkd_port0_r )
r1386r1387
309510
310511static READ8_HANDLER( hunchbkd_port1_r )
311512{
312   return hunchloopback;
513   dkong_state *state = Machine->driver_data;
514
515   return state->hunchloopback;
313516}
314517
315518static READ8_HANDLER( herbiedk_port1_r )
r1386r1387
387590
388591static ADDRESS_MAP_START( dkong_map, ADDRESS_SPACE_PROGRAM, 8 )
389592   AM_RANGE(0x0000, 0x3fff) AM_ROM
390   AM_RANGE(0x6000, 0x73ff) AM_RAM
391   AM_RANGE(0x6900, 0x6a7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
392   AM_RANGE(0x6a80, 0x6cff) AM_RAM /* 0x6b00: sprite set 2 */
593   AM_RANGE(0x6000, 0x6bff) AM_RAM
594   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
393595   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
394   AM_RANGE(0x7800, 0x780f) AM_NOP                                    /* P8257 control registers */
596   AM_RANGE(0x7800, 0x780f) AM_READWRITE(dma8257_0_r, dma8257_0_w)            /* P8257 control registers */
395597   AM_RANGE(0x7c00, 0x7c00) AM_READWRITE(input_port_0_r, dkong_sh_tuneselect_w) /* IN0, sound CPU intf */
396   AM_RANGE(0x7c80, 0x7c80) AM_READ(input_port_1_r)                     /* IN1 */
598   AM_RANGE(0x7c80, 0x7c80) AM_READWRITE(input_port_1_r, radarscp_grid_color_w)      /* IN1 */
397599   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)                        /* IN2/DSW2 */
398600   AM_RANGE(0x7d00, 0x7d07) AM_WRITE(dkong_snd_disc_w)                     /* Sound signals */
399   AM_RANGE(0x7d80, 0x7d80) AM_READWRITE(input_port_3_r, dkong_sh_w)         /* DSW1 */
601   AM_RANGE(0x7d80, 0x7d80) AM_READWRITE(input_port_3_r, dkong_audio_irq_w)         /* DSW1 */
602   AM_RANGE(0x7d81, 0x7d81) AM_WRITE(radarscp_grid_enable_w)
400603   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
401604   AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w)                  /* 2 PSL Signal */
402605   AM_RANGE(0x7d84, 0x7d84) AM_WRITE(interrupt_enable_w)
403   AM_RANGE(0x7d85, 0x7d85) AM_NOP                                    /* P8257 ==> /DRQ0 /DRQ1 */
606   AM_RANGE(0x7d85, 0x7d85) AM_WRITE(p8257_drq_w)                        /* P8257 ==> /DRQ0 /DRQ1 */
404607   AM_RANGE(0x7d86, 0x7d87) AM_WRITE(dkong_palettebank_w)
405   AM_RANGE(0xb000, 0xbfff) AM_READ(MRA8_ROM)   /* Pest Place only */
406608ADDRESS_MAP_END
407609
408static ADDRESS_MAP_START( epos_map, ADDRESS_SPACE_PROGRAM, 8 )
409   AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_BANK1)      /* DK: 0000-3fff */
410   AM_RANGE(0x6000, 0x61ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
411   AM_RANGE(0x6200, 0x6fff) AM_RAM
412   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
413   AM_RANGE(0x7800, 0x780f) AM_NOP                                    /* P8257 control registers */
414   AM_RANGE(0x7c00, 0x7c00) AM_READWRITE(input_port_0_r, dkong_sh_tuneselect_w)
415   AM_RANGE(0x7c80, 0x7c80) AM_READ(input_port_1_r)   /* IN1 */
416   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)      /* IN2/DSW2 */
417   AM_RANGE(0x7d00, 0x7d07) AM_WRITE(dkong_snd_disc_w) /* sound */
418   AM_RANGE(0x7d80, 0x7d80) AM_READWRITE(dkong_in2_r, dkong_sh_w)
419   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
420   AM_RANGE(0x7d83, 0x7d83) AM_NOP
421   AM_RANGE(0x7d84, 0x7d84) AM_WRITE(interrupt_enable_w)
422   AM_RANGE(0x7d85, 0x7d85) AM_NOP                                    /* P8257 ==> /DRQ0 /DRQ1 */
423   AM_RANGE(0x7d86, 0x7d87) AM_WRITE(dkong_palettebank_w)
424ADDRESS_MAP_END
425
426610static ADDRESS_MAP_START( epos_readport, ADDRESS_SPACE_IO, 8 )
427611   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
428612   AM_RANGE(0x00, 0xff) AM_READ(epos_decrypt_rom)    /* Switch protection logic */
429613ADDRESS_MAP_END
430614
431static ADDRESS_MAP_START( radarscp_map, ADDRESS_SPACE_PROGRAM, 8 )
432   AM_RANGE(0x0000, 0x3fff) AM_ROM
433   AM_RANGE(0x6000, 0x73ff) AM_RAM
434   AM_RANGE(0x6900, 0x6a7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
435   AM_RANGE(0x6a80, 0x6cff) AM_RAM /* 0x6b00: sprite set 2 */
436   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
437   AM_RANGE(0x7800, 0x780f) AM_NOP                                    /* P8257 control registers */
438   AM_RANGE(0x7c00, 0x7c00) AM_READWRITE(input_port_0_r, dkong_sh_tuneselect_w) /* IN0, sound CPU intf */
439   AM_RANGE(0x7c80, 0x7c80) AM_READWRITE(input_port_1_r, radarscp_grid_color_w)/* IN1 */
440   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)                        /* IN2/DSW2 */
441   AM_RANGE(0x7d00, 0x7d07) AM_WRITE(dkong_snd_disc_w)                     /* Sound signals */
442   AM_RANGE(0x7d80, 0x7d80) AM_READWRITE(input_port_3_r, dkong_sh_w)         /* DSW1 */
443   AM_RANGE(0x7d81, 0x7d81) AM_WRITE(radarscp_grid_enable_w)
444   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
445   AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w)                  /* 2 PSL Signal */
446   AM_RANGE(0x7d84, 0x7d84) AM_WRITE(interrupt_enable_w)
447   AM_RANGE(0x7d85, 0x7d85) AM_NOP                                    /* P8257 ==> /DRQ0 /DRQ1 */
448   AM_RANGE(0x7d86, 0x7d87) AM_WRITE(dkong_palettebank_w)
449   AM_RANGE(0xb000, 0xbfff) AM_READ(MRA8_ROM)   /* Pest Place only */
450ADDRESS_MAP_END
451
452static ADDRESS_MAP_START( radarsc1_map, ADDRESS_SPACE_PROGRAM, 8 )
453   AM_RANGE(0x0000, 0x3fff) AM_ROM
454   AM_RANGE(0x6000, 0x73ff) AM_RAM
455   AM_RANGE(0x6900, 0x6a7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
456   AM_RANGE(0x6a80, 0x6cff) AM_RAM /* 0x6b00: sprite set 2 */
457   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
458   AM_RANGE(0x7800, 0x780f) AM_NOP                                    /* P8257 control registers */
459   AM_RANGE(0x7c00, 0x7c00) AM_READWRITE(input_port_0_r, dkong_sh_tuneselect_w) /* IN0, sound CPU intf */
460   AM_RANGE(0x7c80, 0x7c80) AM_READWRITE(input_port_1_r, radarscp_grid_color_w)/* IN1 */
461   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)                        /* IN2/DSW2 */
462   AM_RANGE(0x7d00, 0x7d07) AM_WRITE(radarsc1_snd_disc_w)                  /* Sound signals */
463   AM_RANGE(0x7d80, 0x7d80) AM_READWRITE(input_port_3_r, dkong_sh_w)         /* DSW1 */
464   AM_RANGE(0x7d81, 0x7d81) AM_WRITE(radarscp_grid_enable_w)
465   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
466   AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w)                  /* 2 PSL Signal */
467   AM_RANGE(0x7d84, 0x7d84) AM_WRITE(interrupt_enable_w)
468   AM_RANGE(0x7d85, 0x7d85) AM_NOP                                    /* P8257 ==> /DRQ0 /DRQ1 */
469   AM_RANGE(0x7d86, 0x7d87) AM_WRITE(dkong_palettebank_w)
470   AM_RANGE(0xb000, 0xbfff) AM_READ(MRA8_ROM)   /* Pest Place only */
471ADDRESS_MAP_END
472
473615static ADDRESS_MAP_START( hunchbkd_map, ADDRESS_SPACE_PROGRAM, 8 )
474616   AM_RANGE(0x0000, 0x0fff) AM_ROM
617   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)         /* 0x7000 */
475618   AM_RANGE(0x1400, 0x1400) AM_READWRITE(input_port_0_r, dkong_sh_tuneselect_w)
476   AM_RANGE(0x1480, 0x1480) AM_READWRITE(input_port_1_r, dkongjr_gfxbank_w)
619   AM_RANGE(0x1480, 0x1480) AM_READ(input_port_1_r)
477620   AM_RANGE(0x1500, 0x1500) AM_READ(input_port_2_r)   /* IN2/DSW2 */
478   AM_RANGE(0x1580, 0x1580) AM_READWRITE(input_port_3_r, dkong_sh_w) /* DSW1 */
621   AM_RANGE(0x1580, 0x1580) AM_READWRITE(input_port_3_r, dkong_audio_irq_w) /* DSW1 */
479622   AM_RANGE(0x1582, 0x1582) AM_WRITE(dkong_flipscreen_w)
480623   AM_RANGE(0x1584, 0x1584) AM_NOP         /* Possibly still interupt enable */
481   AM_RANGE(0x1585, 0x1585) AM_NOP         /* written a lot - every int */
624   AM_RANGE(0x1585, 0x1585) AM_WRITE(p8257_drq_w)                        /* P8257 ==> /DRQ0 /DRQ1 */
482625   AM_RANGE(0x1586, 0x1587) AM_WRITE(dkong_palettebank_w)
483   AM_RANGE(0x1600, 0x17ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
484   AM_RANGE(0x1800, 0x1bff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
485   AM_RANGE(0x1C00, 0x1fff) AM_RAM
626   AM_RANGE(0x1600, 0x17ff) AM_RAM /* 0x6400  spriteram location */
627   AM_RANGE(0x1800, 0x1bff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram) /* 0x7400 */
628   AM_RANGE(0x1C00, 0x1f7f) AM_RAM /* 0x6000 */
629   AM_RANGE(0x1f80, 0x1f8f) AM_READWRITE(dma8257_0_r, dma8257_0_w)            /* P8257 control registers */
630   /* 0x6800 not remapped */
486631   AM_RANGE(0x2000, 0x2fff) AM_ROM
487632   AM_RANGE(0x3000, 0x3fff) AM_READWRITE(hunchbkd_mirror_r, hunchbkd_mirror_w)
488633   AM_RANGE(0x4000, 0x4fff) AM_ROM
r1386r1387
548693
549694static ADDRESS_MAP_START( dkongjr_map, ADDRESS_SPACE_PROGRAM, 8 )
550695   AM_RANGE(0x0000, 0x5fff) AM_ROM
551   AM_RANGE(0x6000, 0x68ff) AM_RAM
552   AM_RANGE(0x6900, 0x6a7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
553   AM_RANGE(0x6a80, 0x6cff) AM_RAM /* 0x6b00: sprite set 2 */
554   AM_RANGE(0x6d00, 0x6fff) AM_RAM
696   AM_RANGE(0x6000, 0x6bff) AM_RAM
697   AM_RANGE(0x6c00, 0x6fff) AM_RAM /* DK3 bootleg only */
698   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
555699   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
556   AM_RANGE(0x7800, 0x780f) AM_NOP            /* P8257 control registers */
700   AM_RANGE(0x7800, 0x780f) AM_READWRITE(dma8257_0_r, dma8257_0_w)            /* P8257 control registers */
557701   AM_RANGE(0x7c00, 0x7c00) AM_READWRITE(input_port_0_r, dkongjr_sh_tuneselect_w)
558702   AM_RANGE(0x7c80, 0x7c80) AM_READWRITE(input_port_1_r, dkongjr_gfxbank_w)
559703   AM_RANGE(0x7c81, 0x7c81) AM_WRITE(dkongjr_sh_test6_w)
r1386r1387
564708   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
565709   AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w)                  /* 2 PSL Signal */
566710   AM_RANGE(0x7d84, 0x7d84) AM_WRITE(interrupt_enable_w)
567   AM_RANGE(0x7d85, 0x7d85) AM_NOP            /* P8257 ==> /DRQ0 /DRQ1 */
711   AM_RANGE(0x7d85, 0x7d85) AM_WRITE(p8257_drq_w)                        /* P8257 ==> /DRQ0 /DRQ1 */
568712   AM_RANGE(0x7d86, 0x7d87) AM_WRITE(dkong_palettebank_w)
569   AM_RANGE(0x8000, 0x9fff) AM_WRITE(MWA8_ROM)   /* bootleg DKjr only */
570   AM_RANGE(0xd000, 0xdfff) AM_WRITE(MWA8_ROM)   /* DK3 bootleg only */
713   AM_RANGE(0x8000, 0x9fff) AM_ROM   /* bootleg DKjr only */
714   AM_RANGE(0xb000, 0xbfff) AM_ROM /* pestplce only */
715   AM_RANGE(0xd000, 0xdfff) AM_ROM   /* DK3 bootleg only */
571716ADDRESS_MAP_END
572717
573static ADDRESS_MAP_START( pestplce_map, ADDRESS_SPACE_PROGRAM, 8 )
574   AM_RANGE(0x0000, 0x5fff) AM_ROM
575   AM_RANGE(0x6000, 0x68ff) AM_RAM
576   AM_RANGE(0x6900, 0x6a7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
577   AM_RANGE(0x6a80, 0x6cff) AM_RAM /* 0x6b00: sprite set 2 */
578   AM_RANGE(0x6d00, 0x6fff) AM_RAM
579   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
580   AM_RANGE(0x7800, 0x780f) AM_NOP                                    /* P8257 control registers */
581   AM_RANGE(0x7c00, 0x7c00) AM_READWRITE(input_port_0_r, dkongjr_sh_tuneselect_w)
582   AM_RANGE(0x7c80, 0x7c80) AM_READWRITE(input_port_1_r, dkongjr_gfxbank_w)
583   AM_RANGE(0x7c81, 0x7c81) AM_WRITE(dkongjr_sh_test6_w)
584   AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)   /* IN2/DSW2 */
585   AM_RANGE(0x7d00, 0x7d07) AM_WRITE(dkong_snd_disc_w)    /* walk/jump/boom sample trigger */
586   AM_RANGE(0x7d80, 0x7d80) AM_READ(input_port_3_r) AM_WRITENOP //(dkong_sh_w)
587   AM_RANGE(0x7d82, 0x7d82) AM_WRITE(dkong_flipscreen_w)
588   //AM_RANGE(0x7d83, 0x7d83) AM_WRITE(dkong_spritebank_w)                     /* 2 PSL Signal */
589   AM_RANGE(0x7d84, 0x7d84) AM_WRITE(interrupt_enable_w)
590   AM_RANGE(0x7d85, 0x7d85) AM_NOP                                    /* P8257 ==> /DRQ0 /DRQ1 */
591   AM_RANGE(0x7d86, 0x7d87) AM_WRITE(dkong_palettebank_w)
592   AM_RANGE(0xb000, 0xbfff) AM_ROM
593ADDRESS_MAP_END
594718
595719/*************************************
596720 *
597 *  Sound CPU memory handlers
721 *  Port definitions
598722 *
599723 *************************************/
600724
601static ADDRESS_MAP_START( dkong_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
602   AM_RANGE(0x0000, 0x0fff) AM_ROM
603ADDRESS_MAP_END
725static INPUT_PORTS_START( radarscp_in0_2 )
726   PORT_START_TAG("IN0")      /* IN0 */
727   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
728   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
729   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
730   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
731   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
732   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
733   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
734   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
735INPUT_PORTS_END
604736
605static ADDRESS_MAP_START( dkong_sound_io_map, ADDRESS_SPACE_IO, 8 )
606   AM_RANGE(0x00, 0xff) AM_READ(dkong_sh_tune_r)
607   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(dkong_sh_p1_r, dkong_sh_p1_w)
608   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, dkong_sh_p2_w)
609   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
610   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
611ADDRESS_MAP_END
737static INPUT_PORTS_START( radarscp_in1_2 )
738   PORT_START_TAG("IN1")      /* IN1 */
739   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
740   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
741   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_COCKTAIL /* not connected - held to high */
742   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_COCKTAIL /* not connected - held to high */
743   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
744   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
745   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
746   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
747INPUT_PORTS_END
612748
613static ADDRESS_MAP_START( radarsc1_sound_io_map, ADDRESS_SPACE_IO, 8 )
614   AM_RANGE(0x00, 0xff) AM_READ(radarsc1_sh_tune_r)
615   AM_RANGE(0x00, 0xff) AM_WRITE(dkong_sh_p1_w) // DAC here
616   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(radarsc1_sh_p1_r, radarsc1_sh_p1_w)
617   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, radarsc1_sh_p2_w)
618   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
619   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
620ADDRESS_MAP_END
621
622static ADDRESS_MAP_START( hunchbkd_sound_io_map, ADDRESS_SPACE_IO, 8 )
623   AM_RANGE(I8039_bus, I8039_bus) AM_READ(soundlatch_r)
624   AM_RANGE(I8039_p1, I8039_p1) AM_READWRITE(dkong_sh_p1_r, dkong_sh_p1_w)
625   AM_RANGE(I8039_p2, I8039_p2) AM_READWRITE(dkong_sh_p2_r, dkong_sh_p2_w)
626   AM_RANGE(I8039_t0, I8039_t0) AM_READ(dkong_sh_t0_r)
627   AM_RANGE(I8039_t1, I8039_t1) AM_READ(dkong_sh_t1_r)
628ADDRESS_MAP_END
629
630static ADDRESS_MAP_START( dkong3_sound1_map, ADDRESS_SPACE_PROGRAM, 8 )
631   AM_RANGE(0x0000, 0x01ff) AM_RAM
632   AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch_r)      // overwrite default
633   AM_RANGE(0x4017, 0x4017) AM_READ(soundlatch2_r)
634   AM_RANGE(0x4000, 0x4017) AM_READ(NESPSG_0_r)
635   AM_RANGE(0x4000, 0x4017) AM_WRITE(NESPSG_0_w)
636   AM_RANGE(0xe000, 0xffff) AM_ROM
637ADDRESS_MAP_END
638
639static ADDRESS_MAP_START( dkong3_sound2_map, ADDRESS_SPACE_PROGRAM, 8 )
640   AM_RANGE(0x0000, 0x01ff) AM_RAM
641   AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch3_r)      // overwrite default
642   AM_RANGE(0x4000, 0x4017) AM_READ(NESPSG_1_r)
643   AM_RANGE(0x4000, 0x4017) AM_WRITE(NESPSG_1_w)
644   AM_RANGE(0xe000, 0xffff) AM_ROM
645ADDRESS_MAP_END
646
647/*************************************
648 *
649 *  Port definitions
650 *
651 *************************************/
652
653static INPUT_PORTS_START( dkong )
654   PORT_START      /* IN0 */
749static INPUT_PORTS_START( dkong_in0_4 )
750   PORT_START_TAG("IN0")      /* IN0 */
655751   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
656752   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
657753   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
r1386r1387
660756   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
661757   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
662758   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
759INPUT_PORTS_END
663760
664   PORT_START      /* IN1 */
761static INPUT_PORTS_START( dkong_in1_4 )
762   PORT_START_TAG("IN1")      /* IN1 */
665763   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
666764   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
667765   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
r1386r1387
670768   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
671769   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
672770   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
771INPUT_PORTS_END
673772
773static INPUT_PORTS_START( dkong_in0_8 )
774   PORT_START_TAG("IN0")      /* IN0 */
775   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
776   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
777   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
778   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
779   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
780   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
781   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
782   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
783INPUT_PORTS_END
784
785static INPUT_PORTS_START( dkong_in1_8 )
786   PORT_START_TAG("IN1")      /* IN1 */
787   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
788   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
789   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
790   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
791   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
792   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
793   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
794   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
795INPUT_PORTS_END
796
797static INPUT_PORTS_START( dkong_in2 )
674798   /* Bit 0x80 is (SERVICE OR COIN) !
675799     * Bit 0x01 is going to the connector but it is not labeled
676800     * It should be a IPT_UNKNOWN. In fact, it will reset the game.
677801     */
678   PORT_START      /* IN2 */
802   PORT_START_TAG("IN2")      /* IN2 */
679803   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME(DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
680804   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* connection not labeled in schematics */
681805                                      /* This may freeze or reset dkong       */
r1386r1387
685809   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* not connected - held to high */
686810   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
687811   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
812INPUT_PORTS_END
688813
689   PORT_START      /* DSW0 */
814static INPUT_PORTS_START( dkong_dsw0 )
815   PORT_START_TAG("DSW0")      /* DSW0 */
690816   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION( "SW1:!1,!2" )
691817   PORT_DIPSETTING(    0x00, "3" )
692818   PORT_DIPSETTING(    0x01, "4" )
r1386r1387
709835   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )      PORT_DIPLOCATION( "SW1:!8" )
710836   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
711837   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
838INPUT_PORTS_END
712839
840static INPUT_PORTS_START( dkong_config )
713841   PORT_START_TAG("VR2")
714842   PORT_ADJUSTER( 90, "VR2 - DAC Volume" )
715843
844   PORT_START_TAG("VIDHW")
845   PORT_CONFNAME( 0x01, 0x01, "Video Hardware" )
846   PORT_CONFSETTING(    0x00, "TKG-02 (Radarscope Conversion)" )
847   PORT_CONFSETTING(    0x01, "TKG-04 (Two board set)" )
848
716849INPUT_PORTS_END
717850
718static INPUT_PORTS_START( radarscp )
719   PORT_START      /* IN0 */
720   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
721   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
722   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
723   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
724   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
725   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
726   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
727   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not connected - held to high */
851static INPUT_PORTS_START( dkong )
852   PORT_INCLUDE( dkong_in0_4 )
853   PORT_INCLUDE( dkong_in1_4 )
854   PORT_INCLUDE( dkong_in2 )
855   PORT_INCLUDE( dkong_dsw0 )
728856
729   PORT_START      /* IN1 */
730   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
731   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
732   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_COCKTAIL /* not connected - held to high */
733   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_COCKTAIL /* not connected - held to high */
734   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
735   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
736   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
737   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* not connected - held to high */
857   PORT_INCLUDE( dkong_config )
858INPUT_PORTS_END
738859
860static INPUT_PORTS_START( radarscp )
861   PORT_INCLUDE( radarscp_in0_2 )
862   PORT_INCLUDE( radarscp_in1_2 )
739863   /* Bit 0x80 is (SERVICE OR COIN) !
740864     * Bit 0x01 is going to the connector and is labeled test switch
741865     * It should be a IPT_UNUSED. In fact, it will reset the game.
742866     */
743   PORT_START      /* IN2 */
744   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME(DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
745   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* connection not labeled in schematics */
746   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
747   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
867   PORT_INCLUDE( dkong_in2 )
868   PORT_MODIFY("IN2")
748869   PORT_DIPNAME( 0x10, 0x10, "TP3" )
749870   PORT_DIPSETTING(    0x00, "Gnd" )
750871   PORT_DIPSETTING(    0x10, "Open" )
751872   PORT_DIPNAME( 0x20, 0x20, "TP5" )
752873   PORT_DIPSETTING(    0x00, "Gnd" )
753874   PORT_DIPSETTING(    0x20, "Open" )
754   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* SACA - Sound Acknowledge*/
755   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
756875
757   PORT_START      /* DSW0 */
758   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
759   PORT_DIPSETTING(    0x00, "3" )
760   PORT_DIPSETTING(    0x01, "4" )
761   PORT_DIPSETTING(    0x02, "5" )
762   PORT_DIPSETTING(    0x03, "6" )
763   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
764   PORT_DIPSETTING(    0x00, "7000" )
765   PORT_DIPSETTING(    0x04, "10000" )
766   PORT_DIPSETTING(    0x08, "15000" )
767   PORT_DIPSETTING(    0x0c, "20000" )
768   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coinage ) )
769   PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
770   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
771   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )
772   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
773   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
774   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
775   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
776   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
777   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
778   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
779   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
876   PORT_INCLUDE( dkong_dsw0 )
780877
781878   PORT_START_TAG("VR2")
782879   PORT_ADJUSTER( 35, "VR2 - DAC Volume" )
r1386r1387
784881INPUT_PORTS_END
785882
786883static INPUT_PORTS_START( dkong3 )
787   PORT_START      /* IN0 */
884   PORT_START_TAG("IN0")      /* IN0 */
788885   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
789886   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
790887   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
r1386r1387
794891   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
795892   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN3 )
796893
797   PORT_START      /* IN1 */
894   PORT_START_TAG("IN1")      /* IN1 */
798895   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
799896   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
800897   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
r1386r1387
804901   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
805902   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
806903
807   PORT_START      /* DSW0 */
904   PORT_START_TAG("DSW0")      /* DSW0 */
808905   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )         PORT_DIPLOCATION("SW2:!1,!2,!3")
809906   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
810907   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
r1386r1387
822919   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
823920   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
824921
825   PORT_START      /* DSW1 */
922   PORT_START_TAG("DSW1")      /* DSW1 */
826923   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )         PORT_DIPLOCATION("SW1:!1,!2")
827924   PORT_DIPSETTING(    0x00, "3" )
828925   PORT_DIPSETTING(    0x01, "4" )
r1386r1387
846943INPUT_PORTS_END
847944
848945static INPUT_PORTS_START( dkong3b )
849   PORT_START      /* IN0 */
850   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
851   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
852   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
853   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
854   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
855   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
856   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
857   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
946   PORT_INCLUDE( dkong_in0_4 )
947   PORT_INCLUDE( dkong_in1_4 )
858948
859   PORT_START      /* IN1 */
860   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
861   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
862   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
863   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
864   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
865   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
866   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
867   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
949   PORT_INCLUDE( dkong_in2 )
868950
869   PORT_START      /* IN2 */
870   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
871   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
872   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
873   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
874   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
875   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
876   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
877   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
878   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
879   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
880   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
881   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
882   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
883   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
884   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
885   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
886
887   PORT_START      /* DSW0 */
951   PORT_START_TAG("DSW0")      /* DSW0 */
888952   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
889953   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
890954   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
r1386r1387
911975   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
912976INPUT_PORTS_END
913977
978static INPUT_PORTS_START( dkongjr )
979   PORT_INCLUDE( dkong_in0_4 )
980   PORT_INCLUDE( dkong_in1_4 )
981   PORT_INCLUDE( dkong_in2 )
982   PORT_INCLUDE( dkong_dsw0 )
983INPUT_PORTS_END
984
914985static INPUT_PORTS_START( hunchbkd )
915   PORT_START      /* IN0 */
916   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
917   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
918   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
919   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
920   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
921   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
922   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
923   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
924986
925   PORT_START      /* IN1 */
926   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
927   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
928   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
929   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
930   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
931   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
932   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
933   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
987   PORT_INCLUDE( dkong_in0_8 )
988   PORT_INCLUDE( dkong_in1_8 )
934989
935   PORT_START      /* IN2 */
990   PORT_INCLUDE( dkong_in2 )
991   PORT_MODIFY("IN2")
936992   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
937993   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
938994   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
939   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
940   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
941   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
942   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
943   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
944   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
945   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
946995
947   PORT_START      /* DSW0 */
948   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
996   PORT_INCLUDE( dkong_dsw0 )
997   PORT_MODIFY("DSW0")
998   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!1" )
949999   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
9501000   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
951   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
1001   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION( "SW1:!2" )
9521002   PORT_DIPSETTING(    0x00, "3" )
9531003   PORT_DIPSETTING(    0x02, "5" )
954   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1004   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION( "SW1:!3,!4" )
9551005   PORT_DIPSETTING(    0x00, "10000" )
9561006   PORT_DIPSETTING(    0x04, "20000" )
9571007   PORT_DIPSETTING(    0x08, "40000" )
9581008   PORT_DIPSETTING(    0x0c, "80000" )
959   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coinage ) )
960   PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
961   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
962   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )
963   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
964   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
965   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
966   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
967   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
968   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
969   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
970   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
9711009
9721010   PORT_START /* Sense */
9731011   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1012
1013   PORT_INCLUDE( dkong_config )
9741014INPUT_PORTS_END
9751015
9761016static INPUT_PORTS_START( shootgal )
977   PORT_START      /* IN0 */
1017   PORT_START_TAG("IN0")      /* IN0 */
9781018   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(4) PORT_REVERSE
9791019
980   PORT_START      /* IN1 */
1020   PORT_START_TAG("IN1")      /* IN1 */
9811021   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(4) PORT_REVERSE
9821022
983   PORT_START      /* IN2 */
1023   PORT_INCLUDE( dkong_in2 )
1024   PORT_MODIFY("IN2")
9841025   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
985   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
986   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
987   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
988   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
989   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
9901026   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
991   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
9921027
993   PORT_START      /* DSW0 */
1028   PORT_START_TAG("DSW0")      /* DSW0 */
9941029   PORT_DIPNAME( 0x01, 0x00, "1" )
9951030   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
9961031   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1386r1387
10141049   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
10151050   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
10161051
1017   PORT_START /* Sense */
1052   PORT_START_TAG("SENSE") /* Sense */
10181053   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1054
1055   PORT_INCLUDE( dkong_config )
1056
10191057INPUT_PORTS_END
10201058
10211059static INPUT_PORTS_START( sbdk )
1022   PORT_START      /* IN0 */
1023   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1024   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1025   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1026   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1027   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1028   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1029   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1030   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1060   PORT_INCLUDE( dkong_in0_8 )
1061   PORT_INCLUDE( dkong_in1_8 )
10311062
1032   PORT_START      /* IN1 */
1033   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1034   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1035   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1036   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1037   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1038   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1039   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1040   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1063   PORT_INCLUDE( dkong_in2 )
1064   PORT_MODIFY("IN2")
1065   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
1066   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 2") PORT_PLAYER(1)
10411067
1042   PORT_START      /* IN2 */
1043   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1068   PORT_INCLUDE( dkong_dsw0 )
1069   PORT_MODIFY("DSW0")
1070   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!1" )
10441071   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10451072   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1046   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1047   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1048   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
1049   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1050   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1051   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1052   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
1053
1054   PORT_START      /* DSW0 */
1055   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1056   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1057   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1058   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
1073   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION( "SW1:!2" )
10591074   PORT_DIPSETTING(    0x00, "3" )
10601075   PORT_DIPSETTING(    0x02, "5" )
1061   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1076   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!3" )
10621077   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10631078   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1064   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1079   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!4" )
10651080   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10661081   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1067   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coinage ) )
1068   PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
1069   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
1070   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )
1071   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1072   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1073   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
1074   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1075   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
1076   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
1077   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
1078   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
10791082
1080   PORT_START /* Sense */
1083   PORT_START_TAG("SENSE") /* Sense */
10811084   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1085
1086   PORT_INCLUDE( dkong_config )
1087
10821088INPUT_PORTS_END
10831089
10841090static INPUT_PORTS_START( herbiedk )
1085   PORT_START      /* IN0 */
1086   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1087   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1088   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1089   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1090   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1091   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1092   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1093   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1091   PORT_INCLUDE( dkong_in0_8 )
1092   PORT_INCLUDE( dkong_in1_8 )
10941093
1095   PORT_START      /* IN1 */
1096   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1097   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1098   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1099   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1100   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1101   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1102   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1103   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1094   PORT_INCLUDE( dkong_in2 )
11041095
1105   PORT_START      /* IN2 */
1106   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1096   PORT_INCLUDE( dkong_dsw0 )
1097   PORT_MODIFY("DSW0")
1098   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!1" )
11071099   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11081100   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1109   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1110   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
1111   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 2") PORT_PLAYER(1)
1112   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1113   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1114   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1115   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
1116
1117   PORT_START      /* DSW0 */
1118   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1101   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!2" )
11191102   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1120   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1121   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1122   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11231103   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1124   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1104   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!3" )
11251105   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11261106   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1127   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1107   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )      PORT_DIPLOCATION( "SW1:!4" )
11281108   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11291109   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1130   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coinage ) )
1131   PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
1132   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
1133   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )
1134   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1135   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1136   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
1137   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1138   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
1139   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
1140   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
1141   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
11421110
1143   PORT_START /* Sense */
1111   PORT_START_TAG("SENSE") /* Sense */
11441112   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1113
1114   PORT_INCLUDE( dkong_config )
11451115INPUT_PORTS_END
11461116
11471117/* Notes :
11481118     - you ALWAYS get an extra life at 150000 points.
11491119     - having more than 6 lives will reset the game.
11501120*/
1121
11511122static INPUT_PORTS_START( herodk )
1152   PORT_START      /* IN0 */
1153   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1154   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1155   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1156   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1157   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1123   PORT_INCLUDE( dkong_in0_8 )
1124   PORT_MODIFY("IN0")
11581125   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1159   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1160   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
11611126
1162   PORT_START      /* IN1 */
1163   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1164   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1165   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1166   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1167   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1127   PORT_INCLUDE( dkong_in1_8 )
1128   PORT_MODIFY("IN1")
11681129   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
1169   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1170   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
11711130
1172   PORT_START      /* IN2 */
1173   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1174   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1175   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1176   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1177   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1178   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
1179   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1180   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1181   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1182   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
1131   PORT_INCLUDE( dkong_in2 )
11831132
1184   PORT_START      /* DSW0 */
1185   PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH )
1186   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
1133   PORT_INCLUDE( dkong_dsw0 )
1134   PORT_MODIFY("DSW0")
1135   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:!1" )
1136   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION( "SW1:!2" )
11871137   PORT_DIPSETTING(    0x00, "3" )
11881138   PORT_DIPSETTING(    0x02, "5" )
1189   PORT_DIPNAME( 0x0c, 0x00, "Difficulty?" )      // Stored at 0x1c99
1139   PORT_DIPNAME( 0x0c, 0x00, "Difficulty?" )         PORT_DIPLOCATION( "SW1:!3,!4" ) // Stored at 0x1c99
11901140   PORT_DIPSETTING(    0x00, "0" )
11911141   PORT_DIPSETTING(    0x04, "1" )
11921142   PORT_DIPSETTING(    0x08, "2" )
11931143   PORT_DIPSETTING(    0x0c, "3" )
1194   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coinage ) )
1195   PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
1196   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
1197   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )
1198   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1199   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1200   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
1201   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1202   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
1203   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )
1204   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
1205   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
12061144
1207   PORT_START /* Sense */
1145   PORT_START_TAG("SENSE") /* Sense */
12081146   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1147
1148   PORT_INCLUDE( dkong_config )
12091149INPUT_PORTS_END
12101150
12111151
12121152static INPUT_PORTS_START( pestplce )
1213   PORT_START      /* IN0 */
1153   PORT_START_TAG("IN0")      /* IN0 */
12141154   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
12151155   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
12161156   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
r1386r1387
12201160   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12211161   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12221162
1223   PORT_START      /* IN1 */
1163   PORT_START_TAG("IN1")      /* IN1 */
12241164   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
12251165   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
12261166   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
r1386r1387
12301170   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12311171   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12321172
1233   PORT_START      /* IN2 */
1173   PORT_INCLUDE( dkong_in2 )
1174   PORT_MODIFY("IN2")
12341175   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1235   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1236   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1237   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
1238   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1239   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1240   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1241   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
12421176
1243   PORT_START      /* DSW0 */
1177   PORT_START_TAG("DSW0")      /* DSW0 */
12441178   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
12451179   PORT_DIPSETTING(    0x00, "3" )
12461180   PORT_DIPSETTING(    0x01, "4" )
r1386r1387
12631197   PORT_DIPSETTING(    0x40, "30000" )
12641198   PORT_DIPSETTING(    0x80, "40000" )
12651199   PORT_DIPSETTING(    0xc0, DEF_STR ( None ) )
1200
1201   PORT_INCLUDE( dkong_config )
12661202INPUT_PORTS_END
12671203
12681204
12691205static INPUT_PORTS_START( spclforc )
1270   PORT_START      /* IN0 */
1271   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1272   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1273   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1274   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1206   PORT_INCLUDE( dkong_in0_8 )
1207   PORT_MODIFY("IN0")
12751208   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1276   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1277   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1278   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12791209
1280   PORT_START      /* IN1 */
1281   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1282   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1283   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1284   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1210   PORT_INCLUDE( dkong_in1_8 )
1211   PORT_MODIFY("IN1")
12851212   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
12861213   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1287   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1288   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12891214
1290   PORT_START      /* IN2 */
1291   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1292   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1215   PORT_INCLUDE( dkong_in2 )
1216   PORT_MODIFY("IN2")
12931217   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Start 1 / P1 Button 1") PORT_PLAYER(1)
12941218   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start 2 / P1 Button 2") PORT_PLAYER(1)
1295   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1296   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1297   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1298   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
12991219
1300   PORT_START      /* DSW0 */
1220   PORT_START_TAG("DSW0")      /* DSW0 */
13011221   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
13021222   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
13031223   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1386r1387
13221242   PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
13231243   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
13241244
1325   PORT_START /* Sense */
1245   PORT_START_TAG("SENSE") /* Sense */
13261246   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1247
1248   PORT_INCLUDE( dkong_config )
1249
13271250INPUT_PORTS_END
13281251
13291252
13301253static INPUT_PORTS_START( 8ballact )
1331   PORT_START      /* IN0 */
1332   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1333   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1334   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1335   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1336   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1337   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1338   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1339   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1254   PORT_INCLUDE( dkong_in0_8 )
1255   PORT_INCLUDE( dkong_in1_8 )
13401256
1341   PORT_START      /* IN1 */
1342   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1343   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1344   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1345   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1346   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1347   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1348   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1349   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1257   PORT_INCLUDE( dkong_in2 )
13501258
1351   PORT_START      /* IN2 */
1352   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1353   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1354   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1355   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1356   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1357   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
1358   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1359   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1360   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1361   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
1362
1363   PORT_START      /* DSW0 */
1364   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1365   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1366   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1367   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1368   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1369   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1370   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1371   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1372   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1373   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1259   PORT_START_TAG("DSW0")      /* DSW0 */
1260   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:!1" )
1261   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:!2" )
1262   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION( "SW1:!3" )
13741263   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1375   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1376   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coinage ) )
1264   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
1265   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION( "SW1:!4" )
1266   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1267   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1268   PORT_DIPNAME( 0x70, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION( "SW1:!5,!6,!7" )
13771269   PORT_DIPSETTING(    0x70, DEF_STR( 5C_1C ) )
13781270   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
13791271   PORT_DIPSETTING(    0x30, DEF_STR( 3C_1C ) )
r1386r1387
13821274   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
13831275   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
13841276   PORT_DIPSETTING(    0x60, DEF_STR( 1C_4C ) )
1385   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1386   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1387   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1277   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:!8" )
13881278
1389   PORT_START /* Sense */
1279   PORT_START_TAG("SENSE") /* Sense */
13901280   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1391INPUT_PORTS_END
13921281
1282   PORT_INCLUDE( dkong_config )
13931283
1284INPUT_PORTS_END
1285
13941286static INPUT_PORTS_START( drakton )
1395   PORT_START      /* IN0 */
1396   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
1397   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
1398   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
1399   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
1400   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1401   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1402   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1403   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1287   PORT_INCLUDE( dkong_in0_4 )
1288   PORT_INCLUDE( dkong_in1_4 )
14041289
1405   PORT_START      /* IN1 */
1406   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1407   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1408   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1409   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1410   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1411   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1412   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1413   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1414
1415   PORT_START      /* IN2 */
1290   PORT_INCLUDE( dkong_in2 )
1291   PORT_MODIFY("IN2")
14161292   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1417   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1418   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1419   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
1420   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1421   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1422   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1423   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
14241293
1425   PORT_START      /* DSW0 */
1294   PORT_START_TAG("DSW0")      /* DSW0 */
14261295   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) )
14271296   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
14281297   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1386r1387
14461315   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
14471316   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
14481317   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
1318
1319   PORT_INCLUDE( dkong_config )
1320
14491321INPUT_PORTS_END
14501322
14511323
14521324static INPUT_PORTS_START( strtheat )
1453   PORT_START      /* IN0 */
1325   PORT_START_TAG("IN0")      /* IN0 */
14541326   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
14551327   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
14561328   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
r1386r1387
14601332   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
14611333   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
14621334
1463   PORT_START      /* IN1 */
1335   PORT_START_TAG("IN1")      /* IN1 */
14641336   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
14651337   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
14661338   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
r1386r1387
14701342   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
14711343   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
14721344
1473   PORT_START      /* IN2 */
1345   PORT_INCLUDE( dkong_in2 )
1346   PORT_MODIFY("IN2")
14741347   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1475   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1476   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
1477   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
1478   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1479   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1480   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
1481   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
14821348
1483   PORT_START      /* DSW0 */
1349   PORT_START_TAG("DSW0")      /* DSW0 */
14841350   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) )
14851351   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
14861352   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1386r1387
15051371   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
15061372   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
15071373
1508   PORT_START      /* IN4 */
1374   PORT_START_TAG("IN4")      /* IN4 */
15091375   PORT_BIT( 0x03, 0x00, IPT_DIAL ) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_REVERSE
15101376
1511   PORT_START      /* IN5 */
1377   PORT_START_TAG("IN5")      /* IN5 */
15121378   PORT_BIT( 0x03, 0x00, IPT_DIAL ) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_REVERSE PORT_COCKTAIL
1379
1380   PORT_INCLUDE( dkong_config )
1381
15131382INPUT_PORTS_END
15141383
15151384/*************************************
r1386r1387
15711440 *
15721441 *************************************/
15731442
1574static const char *dkongjr_sample_names[] =
1575{
1576   "*dkongjr",
1577   "jump.wav",
1578   "land.wav",
1579   "roar.wav",
1580   "climb0.wav",
1581   "climb1.wav",
1582   "climb2.wav",
1583   "death.wav",
1584   "drop.wav",
1585   "walk0.wav",
1586   "walk1.wav",
1587   "walk2.wav",
1588   "snapjaw.wav",
1589   0   /* end of array */
1590};
15911443
1592static struct Samplesinterface dkongjr_samples_interface =
1593{
1594   8,   /* 8 channels */
1595   dkongjr_sample_names
1596};
1597
1598static struct NESinterface nes_interface_1 = { REGION_CPU2 };
1599static struct NESinterface nes_interface_2 = { REGION_CPU3 };
1600
16011444/*************************************
16021445 *
16031446 *  Machine driver
16041447 *
16051448 *************************************/
16061449
1607static MACHINE_DRIVER_START( radarscp )
1450static MACHINE_DRIVER_START( dkong_base )
16081451
1452   /* driver data */
1453   MDRV_DRIVER_DATA(dkong_state)
1454
16091455   /* basic machine hardware */
1610   MDRV_CPU_ADD(Z80, CLOCK_1H)   /* 3.072 MHz (?) */
1611   MDRV_CPU_PROGRAM_MAP(radarscp_map, 0)
1456   MDRV_CPU_ADD_TAG("main", Z80, CLOCK_1H)
1457   MDRV_CPU_PROGRAM_MAP(dkong_map, 0)
16121458   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
16131459
1614   MDRV_CPU_ADD(I8035,I8035_CLOCK)
1615   MDRV_CPU_PROGRAM_MAP(dkong_sound_map, 0)
1616   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
1617
1618   MDRV_MACHINE_START(dkong)
1460   MDRV_MACHINE_START(dkong2b)
16191461   MDRV_MACHINE_RESET(dkong)
16201462
16211463   /* video hardware */
r1386r1387
16231465   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
16241466   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
16251467   MDRV_GFXDECODE(dkong)
1626   MDRV_PALETTE_LENGTH(256+256+8+1)
1468   MDRV_PALETTE_LENGTH(DK2B_PALETTE_LENGTH)
16271469
1470   MDRV_PALETTE_INIT(dkong2b)
1471   MDRV_VIDEO_START(dkong)
1472   MDRV_VIDEO_UPDATE(dkong)
1473
1474MACHINE_DRIVER_END
1475
1476static MACHINE_DRIVER_START( radarscp )
1477
1478   MDRV_IMPORT_FROM(dkong_base)
1479
1480   MDRV_MACHINE_START(radarscp)
1481   MDRV_PALETTE_LENGTH(RS_PALETTE_LENGTH)
16281482   MDRV_PALETTE_INIT(radarscp)
1629   MDRV_VIDEO_START(radarscp)
1630   MDRV_VIDEO_UPDATE(radarscp)
16311483
16321484   /* sound hardware */
1633   MDRV_SOUND_START(dkong)
1485   MDRV_IMPORT_FROM(radarscp_audio)
16341486
1635   MDRV_SPEAKER_STANDARD_MONO("mono")
1636   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1637   MDRV_SOUND_CONFIG_DISCRETE(radarscp)
1638   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1639
16401487MACHINE_DRIVER_END
16411488
16421489static MACHINE_DRIVER_START( radarsc1 )
16431490
1644   /* basic machine hardware */
1645   MDRV_CPU_ADD(Z80, CLOCK_1H)   /* 3.072 MHz (?) */
1646   MDRV_CPU_PROGRAM_MAP(radarsc1_map, 0)
1647   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
1491   MDRV_IMPORT_FROM(dkong_base)
16481492
1649   MDRV_CPU_ADD(I8035,I8035_CLOCK)
1650   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
1651   MDRV_CPU_IO_MAP(radarsc1_sound_io_map, 0)
1652
1653   MDRV_MACHINE_START(dkong)
1654   MDRV_MACHINE_RESET(dkong)
1655
1656   /* video hardware */
1657   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1658   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1659   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1660   MDRV_GFXDECODE(dkong)
1661   MDRV_PALETTE_LENGTH(256+256+8+1)
1662
1493   MDRV_MACHINE_START(radarsc1)
1494   MDRV_PALETTE_LENGTH(RS_PALETTE_LENGTH)
16631495   MDRV_PALETTE_INIT(radarsc1)
1664   MDRV_VIDEO_START(radarsc1)
1665   MDRV_VIDEO_UPDATE(radarscp)
16661496
16671497   /* sound hardware */
1668   MDRV_SOUND_START(radarsc1)
1498   MDRV_IMPORT_FROM(radarsc1_audio)
16691499
1670   MDRV_SPEAKER_STANDARD_MONO("mono")
1671
1672   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1673   MDRV_SOUND_CONFIG_DISCRETE(radarscp)
1674   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16751500MACHINE_DRIVER_END
16761501
1677static MACHINE_DRIVER_START( dkong )
16781502
1679   /* basic machine hardware */
1680   MDRV_CPU_ADD(Z80, CLOCK_1H)
1681   MDRV_CPU_PROGRAM_MAP(dkong_map, 0)
1682   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
1503static MACHINE_DRIVER_START( dkong2b )
16831504
1684   MDRV_CPU_ADD(I8035,I8035_CLOCK)
1685   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
1686   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
1505   MDRV_IMPORT_FROM(dkong_base)
16871506
1688   MDRV_MACHINE_START(dkong)
1689   MDRV_MACHINE_RESET(dkong)
1507   MDRV_MACHINE_START(dkong2b)
1508   MDRV_PALETTE_LENGTH(DK2B_PALETTE_LENGTH)
16901509
1691   /* video hardware */
1692   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1693   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1694   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1695   MDRV_GFXDECODE(dkong)
1696   MDRV_PALETTE_LENGTH(256)
1697
1698   MDRV_PALETTE_INIT(dkong)
1699   MDRV_VIDEO_START(dkong)
1700   MDRV_VIDEO_UPDATE(dkong)
1701
17021510   /* sound hardware */
1703   MDRV_SOUND_START(dkong)
1511   MDRV_IMPORT_FROM(dkong2b_audio)
17041512
1705   MDRV_SPEAKER_STANDARD_MONO("mono")
1706   MDRV_SOUND_ADD_TAG("discrete", DISCRETE, 0)
1707   MDRV_SOUND_CONFIG_DISCRETE(dkong)
1708   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.7)
17091513MACHINE_DRIVER_END
17101514
1515
17111516static MACHINE_DRIVER_START( hunchbkd )
17121517
1518   MDRV_IMPORT_FROM(dkong2b)
1519
17131520   /* basic machine hardware */
1714   MDRV_CPU_ADD_TAG("main", S2650, 3072000/2)   /* ??? */
1521   MDRV_CPU_REPLACE("main", S2650, CLOCK_1H / 2)   /* ??? */
17151522   MDRV_CPU_PROGRAM_MAP(hunchbkd_map, 0)
17161523   MDRV_CPU_IO_MAP(hunchbkd_io_map, 0)
17171524   MDRV_CPU_VBLANK_INT(hunchbkd_interrupt,1)
17181525
1719   MDRV_CPU_ADD_TAG("sound", I8035,I8035_CLOCK)
1720   MDRV_CPU_PROGRAM_MAP(dkong_sound_map, 0)
1721   MDRV_CPU_IO_MAP(hunchbkd_sound_io_map, 0)
1526   MDRV_MACHINE_START(hunchbkd)
17221527
1723   MDRV_MACHINE_START(dkong)
1724   MDRV_MACHINE_RESET(dkong)
1725
1726   /* video hardware */
1727   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1728   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1729   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1730   MDRV_GFXDECODE(dkong)
1731   MDRV_PALETTE_LENGTH(256)
1732
1733   MDRV_PALETTE_INIT(dkong)
1734   MDRV_VIDEO_START(dkong)
1735   MDRV_VIDEO_UPDATE(dkong)
1736
1737   /* sound hardware */
1738   MDRV_SOUND_START(hunchbkd)
1739
1740   MDRV_SPEAKER_STANDARD_MONO("mono")
1741   MDRV_SOUND_ADD(DAC, 0)
1742   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
17431528MACHINE_DRIVER_END
17441529
17451530static MACHINE_DRIVER_START( epos )
17461531
1747   /* basic machine hardware */
1748   MDRV_CPU_ADD(Z80, CLOCK_1H)
1749   MDRV_CPU_PROGRAM_MAP(epos_map, 0)
1532   MDRV_IMPORT_FROM(dkong2b)
1533
1534   MDRV_CPU_MODIFY("main")
17501535   MDRV_CPU_IO_MAP(epos_readport,0)
1751   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
17521536
1753   MDRV_CPU_ADD(I8035,I8035_CLOCK)
1754   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
1755   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
1756
1757   MDRV_MACHINE_START(dkong)
1758   MDRV_MACHINE_RESET(dkong)
1759
1760   /* video hardware */
1761   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1762   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1763   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1764   MDRV_GFXDECODE(dkong)
1765   MDRV_PALETTE_LENGTH(256)
1766
1767   MDRV_PALETTE_INIT(dkong)
1768   MDRV_VIDEO_START(dkong)
1769   MDRV_VIDEO_UPDATE(dkong)
1770
1771   /* sound hardware */
1772   MDRV_SOUND_START(hunchbkd)
1773
1774   MDRV_SPEAKER_STANDARD_MONO("mono")
1775   MDRV_SOUND_ADD(DAC, 0)
1776   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
17771537MACHINE_DRIVER_END
17781538
17791539static MACHINE_DRIVER_START( dkong3 )
17801540
1541   /* driver data */
1542   MDRV_DRIVER_DATA(dkong_state)
1543
17811544   /* basic machine hardware */
17821545   MDRV_CPU_ADD(Z80,8000000/2)   /* 4 MHz */
17831546   MDRV_CPU_PROGRAM_MAP(dkong3_map, 0)
17841547   MDRV_CPU_IO_MAP(0, dkong3_io_map)
17851548   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
17861549
1787   MDRV_CPU_ADD(N2A03,N2A03_DEFAULTCLOCK)
1788   MDRV_CPU_PROGRAM_MAP(dkong3_sound1_map, 0)
1789   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
1790
1791   MDRV_CPU_ADD(N2A03,N2A03_DEFAULTCLOCK)
1792   MDRV_CPU_PROGRAM_MAP(dkong3_sound2_map, 0)
1793   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
1794
1795   MDRV_MACHINE_START(dkong)
1550   MDRV_MACHINE_START(dkong2b)
17961551   MDRV_MACHINE_RESET(dkong)
17971552
17981553   /* video hardware */
r1386r1387
18001555   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
18011556   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
18021557   MDRV_GFXDECODE(dkong)
1803   MDRV_PALETTE_LENGTH(256)
1558   MDRV_PALETTE_LENGTH(DK3_PALETTE_LENGTH)
18041559
18051560   MDRV_PALETTE_INIT(dkong3)
18061561   MDRV_VIDEO_START(dkong)
18071562   MDRV_VIDEO_UPDATE(dkong)
18081563
18091564   /* sound hardware */
1810   MDRV_SPEAKER_STANDARD_MONO("mono")
1811   MDRV_SOUND_ADD(NES, N2A03_DEFAULTCLOCK)
1812   MDRV_SOUND_CONFIG(nes_interface_1)
1813   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1814
1815   MDRV_SOUND_ADD(NES, N2A03_DEFAULTCLOCK)
1816   MDRV_SOUND_CONFIG(nes_interface_2)
1817   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1565   MDRV_IMPORT_FROM(dkong3_audio)
18181566MACHINE_DRIVER_END
18191567
18201568static MACHINE_DRIVER_START( dkongjr )
18211569
1822   /* basic machine hardware */
1823   MDRV_CPU_ADD(Z80, CLOCK_1H)
1570   MDRV_IMPORT_FROM(dkong_base)
1571
1572   MDRV_CPU_MODIFY("main")
18241573   MDRV_CPU_PROGRAM_MAP(dkongjr_map, 0)
1825   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
18261574
1827   MDRV_CPU_ADD(I8035,I8035_CLOCK)
1828   MDRV_CPU_PROGRAM_MAP(dkong_sound_map,0)
1829   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
1830
1831   MDRV_MACHINE_START(dkong)
1832   MDRV_MACHINE_RESET(dkong)
1833
1834   /* video hardware */
1835   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1836   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1837   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
1838   MDRV_GFXDECODE(dkong)
1839   MDRV_PALETTE_LENGTH(256)
1840
1841   MDRV_PALETTE_INIT(dkong)
1842   MDRV_VIDEO_START(dkong)
1843   MDRV_VIDEO_UPDATE(dkong)
1844
18451575   /* sound hardware */
1846   MDRV_SOUND_START(dkongjr)
1576   MDRV_IMPORT_FROM(dkongjr_audio)
18471577
1848   MDRV_SPEAKER_STANDARD_MONO("mono")
1849   MDRV_SOUND_ADD(DAC, 0)
1850   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
1851
1852   MDRV_SOUND_ADD(SAMPLES, 0)
1853   MDRV_SOUND_CONFIG(dkongjr_samples_interface)
1854   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
18551578MACHINE_DRIVER_END
18561579
18571580static MACHINE_DRIVER_START( pestplce )
18581581
1859   /* basic machine hardware */
1860   MDRV_CPU_ADD(Z80, 3072000)   /* 3.072 MHz (?) */
1861   MDRV_CPU_PROGRAM_MAP(pestplce_map, 0)
1862   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
1582   MDRV_IMPORT_FROM(dkongjr)
18631583
1864   MDRV_CPU_ADD(I8035,I8035_CLOCK)
1865   MDRV_CPU_PROGRAM_MAP(dkong_sound_map, 0)
1866   MDRV_CPU_IO_MAP(dkong_sound_io_map, 0)
1867
1868   MDRV_MACHINE_START(dkong)
1869   MDRV_MACHINE_RESET(dkong)
1870
1871   /* video hardware */
1872   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1873   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1874   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
18751584   MDRV_GFXDECODE(pestplce)
1876   MDRV_PALETTE_LENGTH(256)
1877
1878   MDRV_PALETTE_INIT(dkong)   // wrong!
1879   MDRV_VIDEO_START(dkong)
1585   MDRV_PALETTE_LENGTH(DK2B_PALETTE_LENGTH)
1586   MDRV_PALETTE_INIT(dkong2b)   // wrong!
18801587   MDRV_VIDEO_UPDATE(pestplce)
18811588
1882   /* sound hardware */
1883   MDRV_SOUND_START(hunchbkd)
1884
1885   MDRV_SPEAKER_STANDARD_MONO("mono")
1886   MDRV_SOUND_ADD(DAC, 0)
1887   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.55)
1888
1889   /* samples */
18901589MACHINE_DRIVER_END
18911590
18921591static MACHINE_DRIVER_START( herbiedk )
r1386r1387
18961595   MDRV_CPU_MODIFY("main")
18971596   MDRV_CPU_IO_MAP(herbiedk_io_map, 0)
18981597
1899   //MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1000))
19001598MACHINE_DRIVER_END
19011599
19021600static MACHINE_DRIVER_START( spclforc )
r1386r1387
20561754   ROM_LOAD( "c-2k.bpr",     0x0000, 0x0100, CRC(e273ede5) SHA1(b50ec9e1837c00c20fb2a4369ec7dd0358321127) ) /* palette low 4 bits (inverted) */
20571755   ROM_LOAD( "c-2j.bpr",     0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */
20581756   ROM_LOAD( "v-5e.bpr",     0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
2059
2060/*********************************************************
2061I use more appropreate filenames for color PROMs.
2062    ROM_REGION( 0x0300, REGION_PROMS, 0 )
2063    ROM_LOAD( "dkong.2k",     0x0000, 0x0100, CRC(1e82d375) )
2064    ROM_LOAD( "dkong.2j",     0x0100, 0x0100, CRC(2ab01dc8) )
2065    ROM_LOAD( "dkong.5f",     0x0200, 0x0100, CRC(44988665) )
2066*********************************************************/
20671757ROM_END
20681758
20691759ROM_START( dkongo )
r1386r1387
20921782   ROM_LOAD( "c-2k.bpr",     0x0000, 0x0100, CRC(e273ede5) SHA1(b50ec9e1837c00c20fb2a4369ec7dd0358321127) ) /* palette low 4 bits (inverted) */
20931783   ROM_LOAD( "c-2j.bpr",     0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */
20941784   ROM_LOAD( "v-5e.bpr",     0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
2095
2096/*********************************************************
2097I use more appropreate filenames for color PROMs.
2098    ROM_REGION( 0x0300, REGION_PROMS, 0 )
2099    ROM_LOAD( "dkong.2k",     0x0000, 0x0100, CRC(1e82d375) )
2100    ROM_LOAD( "dkong.2j",     0x0100, 0x0100, CRC(2ab01dc8) )
2101    ROM_LOAD( "dkong.5f",     0x0200, 0x0100, CRC(44988665) )
2102*********************************************************/
21031785ROM_END
21041786
21051787ROM_START( dkongjp )
r1386r1387
21271809   ROM_LOAD( "c-2k.bpr",     0x0000, 0x0100, CRC(e273ede5) SHA1(b50ec9e1837c00c20fb2a4369ec7dd0358321127) ) /* palette low 4 bits (inverted) */
21281810   ROM_LOAD( "c-2j.bpr",     0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */
21291811   ROM_LOAD( "v-5e.bpr",     0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
2130
2131/*********************************************************
2132I use more appropreate filenames for color PROMs.
2133    ROM_REGION( 0x0300, REGION_PROMS, 0 )
2134    ROM_LOAD( "dkong.2k",     0x0000, 0x0100, CRC(1e82d375) )
2135    ROM_LOAD( "dkong.2j",     0x0100, 0x0100, CRC(2ab01dc8) )
2136    ROM_LOAD( "dkong.5f",     0x0200, 0x0100, CRC(44988665) )
2137*********************************************************/
21381812ROM_END
21391813
21401814ROM_START( dkongjo )
r1386r1387
21621836   ROM_LOAD( "c-2k.bpr",     0x0000, 0x0100, CRC(e273ede5) SHA1(b50ec9e1837c00c20fb2a4369ec7dd0358321127) ) /* palette low 4 bits (inverted) */
21631837   ROM_LOAD( "c-2j.bpr",     0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */
21641838   ROM_LOAD( "v-5e.bpr",     0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
2165
2166/*********************************************************
2167I use more appropreate filenames for color PROMs.
2168    ROM_REGION( 0x0300, REGION_PROMS, 0 )
2169    ROM_LOAD( "dkong.2k",     0x0000, 0x0100, CRC(1e82d375) )
2170    ROM_LOAD( "dkong.2j",     0x0100, 0x0100, CRC(2ab01dc8) )
2171    ROM_LOAD( "dkong.5f",     0x0200, 0x0100, CRC(44988665) )
2172*********************************************************/
21731839ROM_END
21741840
21751841ROM_START( dkongjo1 )
r1386r1387
21981864   ROM_LOAD( "c-2j.bpr",     0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */
21991865   ROM_LOAD( "v-5e.bpr",     0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
22001866
2201/*********************************************************
2202I use more appropreate filenames for color PROMs.
2203    ROM_REGION( 0x0300, REGION_PROMS, 0 )
2204    ROM_LOAD( "dkong.2k",     0x0000, 0x0100, CRC(1e82d375) )
2205    ROM_LOAD( "dkong.2j",     0x0100, 0x0100, CRC(2ab01dc8) )
2206    ROM_LOAD( "dkong.5f",     0x0200, 0x0100, CRC(44988665) )
2207*********************************************************/
22081867ROM_END
22091868
22101869ROM_START( dkongjr )
r1386r1387
25182177   ROM_LOAD( "hbprom.2e",    0x0000, 0x0100, CRC(37aab98f) SHA1(0b002ab82158854bdd4a9db05eee037711017313) )   /* palette low 4 bits (inverted) */
25192178   ROM_LOAD( "hbprom.2f",    0x0100, 0x0100, CRC(845b8dcc) SHA1(eebd0c024172e54b509f1f99d9159438d5f3a905) )   /* palette high 4 bits (inverted) */
25202179   ROM_LOAD( "hbprom.2n",    0x0200, 0x0100, CRC(dff9070a) SHA1(307b95749343b5106247d842f773b2b445faa156) )   /* character color codes on a per-column basis */
2521   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* unknown */
2180   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* address mapping */
2181
2182   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2183   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
25222184ROM_END
25232185
25242186ROM_START( sbdk )
r1386r1387
25412203   ROM_LOAD( "sb-dk.7e",     0x1000, 0x0800, CRC(8e48b13e) SHA1(b4589685a60a8463f656a4f5b0dedfb265c3b3e4) )
25422204   ROM_LOAD( "sb-dk.7f",     0x1800, 0x0800, CRC(989969f3) SHA1(de641082476ac3da3872461263566dfb398ea43a) )
25432205
2544   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2206   ROM_REGION( 0x0500, REGION_PROMS, 0 )
25452207   ROM_LOAD( "sb.2e",        0x0000, 0x0100, CRC(4f06f789) SHA1(0b2775dd8da1c20121639871ed291a015a34e1f6) )
25462208   ROM_LOAD( "sb.2f",        0x0100, 0x0100, CRC(2c15b1b2) SHA1(7c80eb77ba47e2f4d889fc10663a0391d4329a1d) )
25472209   ROM_LOAD( "sb.2n",        0x0200, 0x0100, CRC(dff9070a) SHA1(307b95749343b5106247d842f773b2b445faa156) )
2210   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* address mapping */
2211
2212   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2213   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
25482214ROM_END
25492215
25502216ROM_START( herbiedk )
r1386r1387
25712237   ROM_LOAD( "74s287.2k",     0x0000, 0x0100, CRC(7dc0a381) SHA1(7d974b2249392160e3b800e7113d4899c3600b7f) ) /* palette high 4 bits (inverted) */
25722238   ROM_LOAD( "74s287.2j",     0x0100, 0x0100, CRC(0a440c00) SHA1(e3249a646cd8aa50739e09ae101e796ea3aac37a) ) /* palette low 4 bits (inverted) */
25732239   ROM_LOAD( "74s287.vid",    0x0200, 0x0100, CRC(5a3446cc) SHA1(158de015006e6c400cb7ee758fda7ff760eb5835) ) /* character color codes on a per-column basis */
2574   ROM_LOAD( "82s147.hh",     0x0300, 0x0200, CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* unknown */
2240   ROM_LOAD( "82s147.hh",     0x0300, 0x0200, CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* address mapping */
25752241
25762242   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
25772243   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, CRC(d6a04bcc) SHA1(ef1ed4311869d46dec95c2bfb31875c2f022da4f) )
r1386r1387
26022268   ROM_LOAD( "yellow.7e",    0x1000, 0x0800, CRC(f6272e96) SHA1(a9608966613aedb36cfb04f85730efed9a44d17c) )
26032269   ROM_LOAD( "violet.7f",    0x1800, 0x0800, CRC(ca020685) SHA1(fe0d8d85c3bf244384e9c94f6a7f17db31083245) )
26042270
2605   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2271   ROM_REGION( 0x0500, REGION_PROMS, 0 )
26062272   ROM_LOAD( "82s129.2e",    0x0000, 0x0100, CRC(da4b47e6) SHA1(2cfc7d489002113eb91048cc29d24831dadbfabb) )   /* palette low 4 bits (inverted) */
26072273   ROM_LOAD( "82s129.2f",    0x0100, 0x0100, CRC(96e213a4) SHA1(38f21e7bce96fd2159aa61e64d66aa574d85873c) )   /* palette high 4 bits (inverted) */
26082274   ROM_LOAD( "82s126.2n",    0x0200, 0x0100, CRC(37aece4b) SHA1(08dbb470644278132b8126649fe41d70e7750bee) )   /* character color codes on a per-column basis */
2275   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, BAD_DUMP CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* no dump - taken from hunchbkd */
2276
2277   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2278   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
26092279ROM_END
26102280
26112281ROM_START( herodku )
r1386r1387
26312301   ROM_LOAD( "yellow.7e",    0x1000, 0x0800, CRC(f6272e96) SHA1(a9608966613aedb36cfb04f85730efed9a44d17c) )
26322302   ROM_LOAD( "violet.7f",    0x1800, 0x0800, CRC(ca020685) SHA1(fe0d8d85c3bf244384e9c94f6a7f17db31083245) )
26332303
2634   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2304   ROM_REGION( 0x0500, REGION_PROMS, 0 )
26352305   ROM_LOAD( "82s129.2e",    0x0000, 0x0100, CRC(da4b47e6) SHA1(2cfc7d489002113eb91048cc29d24831dadbfabb) )   /* palette low 4 bits (inverted) */
26362306   ROM_LOAD( "82s129.2f",    0x0100, 0x0100, CRC(96e213a4) SHA1(38f21e7bce96fd2159aa61e64d66aa574d85873c) )   /* palette high 4 bits (inverted) */
26372307   ROM_LOAD( "82s126.2n",    0x0200, 0x0100, CRC(37aece4b) SHA1(08dbb470644278132b8126649fe41d70e7750bee) )   /* character color codes on a per-column basis */
2308   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, BAD_DUMP CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* no dump - taken from hunchbkd */
2309
2310   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2311   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
26382312ROM_END
26392313
26402314ROM_START( spclforc )
r1386r1387
26542328   ROM_LOAD( "2732.7e",      0x2000, 0x1000, CRC(f6a113bd) SHA1(2f8776780284081f7858334766be6a6fde3a3371) )
26552329   ROM_LOAD( "2732.7f",      0x3000, 0x1000, CRC(42857a7a) SHA1(267dd954480bc87f14c758803cb26b7812d323b8) )
26562330
2657   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2331   ROM_REGION( 0x0500, REGION_PROMS, 0 )
26582332   ROM_LOAD( "82s126.2e",    0x0000, 0x0100, CRC(b3751a25) SHA1(4b444e8fd02ac8674ecaba2fee083cb9feb99fa0) )
26592333   ROM_LOAD( "82s126.2f",    0x0100, 0x0100, CRC(1026d438) SHA1(927009e6ed520c39c36c1d7966589c6778df1a3a) )
26602334   ROM_LOAD( "82s126.2n",    0x0200, 0x0100, CRC(9735998d) SHA1(c3f50f97369547b1fd25da64507a5c8b725de6d0) )
2335   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, BAD_DUMP CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* no dump - taken from hunchbkd */
2336
2337   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2338   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
26612339ROM_END
26622340
26632341ROM_START( spcfrcii )
r1386r1387
26772355   ROM_LOAD( "spfc2.7e",     0x2000, 0x1000, CRC(f6a113bd) SHA1(2f8776780284081f7858334766be6a6fde3a3371) )
26782356   ROM_LOAD( "spfc2.7f",     0x3000, 0x1000, CRC(42857a7a) SHA1(267dd954480bc87f14c758803cb26b7812d323b8) )
26792357
2680   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2358   ROM_REGION( 0x0500, REGION_PROMS, 0 )
26812359   ROM_LOAD( "spfc2.2e",     0x0000, 0x0100, CRC(b3751a25) SHA1(4b444e8fd02ac8674ecaba2fee083cb9feb99fa0) )
26822360   ROM_LOAD( "spfc2.2f",     0x0100, 0x0100, CRC(1026d438) SHA1(927009e6ed520c39c36c1d7966589c6778df1a3a) )
26832361   ROM_LOAD( "spfc2.2n",     0x0200, 0x0100, CRC(9735998d) SHA1(c3f50f97369547b1fd25da64507a5c8b725de6d0) )
2362   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, BAD_DUMP CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* no dump - taken from hunchbkd */
2363
2364   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2365   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
26842366ROM_END
26852367
26862368ROM_START( 8ballact )
r1386r1387
27062388   ROM_LOAD( "8b-dk.7e",     0x1000, 0x0800, CRC(655af8a8) SHA1(d434efc89226d28d24e858186fab9aff0e476deb) )
27072389   ROM_LOAD( "8b-dk.7f",     0x1800, 0x0800, CRC(a29b2763) SHA1(6b2ee88e96a1b74193f12f4fa64a6705f17557b1) )
27082390
2709   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2391   ROM_REGION( 0x0500, REGION_PROMS, 0 )
27102392   ROM_LOAD( "8b.2e",        0x0000, 0x0100, CRC(c7379a12) SHA1(e128e7d7c71ec61b934651c29648d0d2fc69e306) )
27112393   ROM_LOAD( "8b.2f",        0x0100, 0x0100, CRC(116612b4) SHA1(9a7c5329f211b13d5a757fdac761d7096d78b65a) )
27122394   ROM_LOAD( "8b.2n",        0x0200, 0x0100, CRC(30586988) SHA1(a9c246fd01cb3ff371ad33b55d5b2fe4898c4d1b) )
2395   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, BAD_DUMP CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* no dump - taken from hunchbkd */
2396
2397   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2398   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
27132399ROM_END
27142400
27152401ROM_START( 8ballat2 )
r1386r1387
27352421   ROM_LOAD( "8b-jr.7e",     0x1000, 0x0800, CRC(655af8a8) SHA1(d434efc89226d28d24e858186fab9aff0e476deb) )
27362422   ROM_LOAD( "8b-jr.7f",     0x1800, 0x0800, CRC(a29b2763) SHA1(6b2ee88e96a1b74193f12f4fa64a6705f17557b1) )
27372423
2738   ROM_REGION( 0x0300, REGION_PROMS, 0 )
2424   ROM_REGION( 0x0500, REGION_PROMS, 0 )
27392425   ROM_LOAD( "8b.2e",        0x0000, 0x0100, CRC(c7379a12) SHA1(e128e7d7c71ec61b934651c29648d0d2fc69e306) )
27402426   ROM_LOAD( "8b.2f",        0x0100, 0x0100, CRC(116612b4) SHA1(9a7c5329f211b13d5a757fdac761d7096d78b65a) )
27412427   ROM_LOAD( "8b.2n",        0x0200, 0x0100, CRC(30586988) SHA1(a9c246fd01cb3ff371ad33b55d5b2fe4898c4d1b) )
2428   ROM_LOAD( "82s147.prm",   0x0300, 0x0200, BAD_DUMP CRC(46e5bc92) SHA1(f4171f8650818c017d58ad7131a7aff100b1b99c) )   /* no dump - taken from hunchbkd */
2429
2430   ROM_REGION( 0x0100, REGION_PLDS, ROMREGION_DISPOSE )
2431   ROM_LOAD( "pls153h.bin", 0x0000, 0x00eb, NO_DUMP ) /* missing - pls153 ??? */
27422432ROM_END
27432433
27442434/* encrypted */
r1386r1387
27492439
27502440   ROM_REGION( 0x1000, REGION_CPU2, 0 )   /* sound */
27512441   /* one is used for dkong conversions, the other one for dkongjr conversions */
2752   ROM_LOAD( "2716.3h",      0x0000, 0x0800, CRC(3489a35b) SHA1(9ebcf4b20b212d54e6b1a6d9abbda3109298631b) )
2753   ROM_LOAD( "2716.3h1",     0x0000, 0x0800, CRC(2a6ec016) SHA1(c95e185a39c8029f00798ce0a00759a4deb45677) )
2442   ROM_LOAD( "2716.3h",      0x0000, 0x0800, CRC(3489a35b) SHA1(9ebcf4b20b212d54e6b1a6d9abbda3109298631b) ) /* dkong */
2443   ROM_LOAD( "2716.3h1",     0x0800, 0x0800, CRC(2a6ec016) SHA1(c95e185a39c8029f00798ce0a00759a4deb45677) ) /* dkongjr */
27542444
27552445   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
27562446   ROM_LOAD( "2716.3n",      0x0000, 0x0800, CRC(ea0e7f9a) SHA1(a8e2b43e15281d45e414eaae98e5248bad79c41b) )
r1386r1387
29012591   int A;
29022592   UINT8 *rom = memory_region(REGION_CPU1);
29032593
2904
29052594   /* swap data lines D3 and D4 */
29062595   for (A = 0;A < 0x8000;A++)
29072596   {
r1386r1387
29152604   }
29162605}
29172606
2607
2608
29182609/*************************************
29192610 *
29202611 *  Game drivers
29212612 *
29222613 *************************************/
29232614
2924GAME( 1980, radarscp, 0,        radarscp, radarscp, 0,        ROT90, "Nintendo", "Radar Scope", GAME_SUPPORTS_SAVE )
2925GAME( 1980, radarsc1, 0,        radarsc1, radarscp, 0,        ROT90, "Nintendo", "Radar Scope (TRS01)", GAME_SUPPORTS_SAVE )
2926GAME( 1981, dkong,    0,        dkong,    dkong,    0,        ROT90, "Nintendo of America", "Donkey Kong (US set 1)", GAME_SUPPORTS_SAVE )
2927GAME( 1981, dkongo,   dkong,    dkong,    dkong,    0,        ROT90, "Nintendo", "Donkey Kong (US set 2)", GAME_SUPPORTS_SAVE )
2928GAME( 1981, dkongjp,  dkong,    dkong,    dkong,    0,        ROT90, "Nintendo", "Donkey Kong (Japan set 1)", GAME_SUPPORTS_SAVE )
2929GAME( 1981, dkongjo,  dkong,    dkong,    dkong,    0,        ROT90, "Nintendo", "Donkey Kong (Japan set 2)", GAME_SUPPORTS_SAVE )
2930GAME( 1981, dkongjo1, dkong,    dkong,    dkong,    0,        ROT90, "Nintendo", "Donkey Kong (Japan set 3) (bad dump?)", GAME_SUPPORTS_SAVE )
2615GAME( 1980, radarscp, 0,        radarscp, radarscp,       0, ROT90, "Nintendo", "Radar Scope", GAME_SUPPORTS_SAVE )
2616GAME( 1980, radarsc1, radarscp, radarsc1, radarscp,       0, ROT90, "Nintendo", "Radar Scope (TRS01)", GAME_SUPPORTS_SAVE )
29312617
2932GAME( 1982, dkongjr,  0,        dkongjr,  dkong,    0,        ROT90, "Nintendo of America", "Donkey Kong Junior (US)", GAME_SUPPORTS_SAVE )
2933GAME( 1982, dkongjrj, dkongjr,  dkongjr,  dkong,    0,        ROT90, "Nintendo", "Donkey Kong Jr. (Japan)", GAME_SUPPORTS_SAVE )
2934GAME( 1982, dkngjnrj, dkongjr,  dkongjr,  dkong,    0,        ROT90, "Nintendo", "Donkey Kong Junior (Japan?)", GAME_SUPPORTS_SAVE )
2935GAME( 1982, dkongjrb, dkongjr,  dkongjr,  dkong,    0,        ROT90, "bootleg", "Donkey Kong Jr. (bootleg)", GAME_SUPPORTS_SAVE )
2936GAME( 1982, dkngjnrb, dkongjr,  dkongjr,  dkong,    0,        ROT90, "Nintendo of America", "Donkey Kong Junior (bootleg?)", GAME_SUPPORTS_SAVE )
2618GAME( 1981, dkong,    0,        dkong2b,  dkong,          0,  ROT90, "Nintendo of America", "Donkey Kong (US set 1)", GAME_SUPPORTS_SAVE )
2619GAME( 1981, dkongo,   dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (US set 2)", GAME_SUPPORTS_SAVE )
2620GAME( 1981, dkongjp,  dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 1)", GAME_SUPPORTS_SAVE )
2621GAME( 1981, dkongjo,  dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 2)", GAME_SUPPORTS_SAVE )
2622GAME( 1981, dkongjo1, dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 3) (bad dump?)", GAME_SUPPORTS_SAVE )
29372623
2938GAME( 1983, dkong3,   0,        dkong3,   dkong3,   0,        ROT90, "Nintendo of America", "Donkey Kong 3 (US)", GAME_SUPPORTS_SAVE )
2939GAME( 1983, dkong3j,  dkong3,   dkong3,   dkong3,   0,        ROT90, "Nintendo", "Donkey Kong 3 (Japan)", GAME_SUPPORTS_SAVE )
2940GAME( 1984, dkong3b,  dkong3,   dkong3b,  dkong3b,  0,        ROT90, "bootleg", "Donkey Kong 3 (bootleg on Donkey Kong Jr. hardware)", GAME_SUPPORTS_SAVE )
2624GAME( 1982, dkongjr,  0,        dkongjr,  dkongjr,        0,  ROT90, "Nintendo of America", "Donkey Kong Junior (US)", GAME_SUPPORTS_SAVE )
2625GAME( 1982, dkongjrj, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "Nintendo", "Donkey Kong Jr. (Japan)", GAME_SUPPORTS_SAVE )
2626GAME( 1982, dkngjnrj, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "Nintendo", "Donkey Kong Junior (Japan?)", GAME_SUPPORTS_SAVE )
2627GAME( 1982, dkongjrb, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "bootleg", "Donkey Kong Jr. (bootleg)", GAME_SUPPORTS_SAVE )
2628GAME( 1982, dkngjnrb, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "Nintendo of America", "Donkey Kong Junior (bootleg?)", GAME_SUPPORTS_SAVE )
29412629
2942GAME( 1984, herbiedk, huncholy, herbiedk, herbiedk, 0,        ROT90, "CVS", "Herbie at the Olympics (DK conversion)", GAME_SUPPORTS_SAVE )
2630GAME( 1983, dkong3,   0,        dkong3,   dkong3,         0,  ROT90, "Nintendo of America", "Donkey Kong 3 (US)", GAME_SUPPORTS_SAVE )
2631GAME( 1983, dkong3j,  dkong3,   dkong3,   dkong3,         0,  ROT90, "Nintendo", "Donkey Kong 3 (Japan)", GAME_SUPPORTS_SAVE )
2632GAME( 1984, dkong3b,  dkong3,   dkong3b,  dkong3b,        0,  ROT90, "bootleg", "Donkey Kong 3 (bootleg on Donkey Kong Jr. hardware)", GAME_SUPPORTS_SAVE )
29432633
2944GAME( 1983, hunchbkd, hunchbak, hunchbkd, hunchbkd, 0,        ROT90, "Century Electronics", "Hunchback (DK conversion)", GAME_WRONG_COLORS | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
2634GAME( 1984, herbiedk, huncholy, herbiedk, herbiedk,       0,  ROT90, "CVS", "Herbie at the Olympics (DK conversion)", GAME_SUPPORTS_SAVE )
29452635
2946GAME( 1984, sbdk,    superbik,   hunchbkd, sbdk,      0,        ROT90, "Century Electronics", "Super Bike (DK conversion)", GAME_SUPPORTS_SAVE )
2636GAME( 1983, hunchbkd, hunchbak, hunchbkd, hunchbkd,       0, ROT90, "Century Electronics", "Hunchback (DK conversion)", GAME_WRONG_COLORS | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
29472637
2638GAME( 1984, sbdk,     superbik,   hunchbkd, sbdk,            0,  ROT90, "Century Electronics", "Super Bike (DK conversion)", GAME_SUPPORTS_SAVE )
2639
29482640GAME( 1984, herodk,   hero,     hunchbkd, herodk,   herodk,   ROT90, "Seatongrove Ltd (Crown license)", "Hero in the Castle of Doom (DK conversion)", GAME_SUPPORTS_SAVE )
2949GAME( 1984, herodku,  hero,     hunchbkd, herodk,   0,        ROT90, "Seatongrove Ltd (Crown license)", "Hero in the Castle of Doom (DK conversion not encrypted)", GAME_SUPPORTS_SAVE )
2641GAME( 1984, herodku,  hero,     hunchbkd, herodk,         0,  ROT90, "Seatongrove Ltd (Crown license)", "Hero in the Castle of Doom (DK conversion not encrypted)", GAME_SUPPORTS_SAVE )
29502642
2951GAME( 1984, 8ballact, 0,       eightact, 8ballact, 0,        ROT90, "Seatongrove Ltd (Magic Eletronics USA licence)", "Eight Ball Action (DK conversion)", GAME_SUPPORTS_SAVE )
2952GAME( 1984, 8ballat2, 8ballact,   eightact, 8ballact, 0,        ROT90, "Seatongrove Ltd (Magic Eletronics USA licence)", "Eight Ball Action (DKJr conversion)", GAME_SUPPORTS_SAVE )
2643GAME( 1984, 8ballact, 0,       eightact, 8ballact,       0,  ROT90, "Seatongrove Ltd (Magic Eletronics USA licence)", "Eight Ball Action (DK conversion)", GAME_SUPPORTS_SAVE )
2644GAME( 1984, 8ballat2, 8ballact,   eightact, 8ballact,       0,  ROT90, "Seatongrove Ltd (Magic Eletronics USA licence)", "Eight Ball Action (DKJr conversion)", GAME_SUPPORTS_SAVE )
29532645
2954GAME( 1984, shootgal, 0,      shootgal, shootgal, 0,        ROT180, "Seatongrove Ltd (Zaccaria licence)", "Shooting Gallery", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
2646GAME( 1984, shootgal, 0,      shootgal, shootgal,       0,  ROT180, "Seatongrove Ltd (Zaccaria licence)", "Shooting Gallery", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
29552647
2956GAME( 1983, pestplce, mario,   pestplce, pestplce, 0,        ROT180, "bootleg", "Pest Place", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
2648GAME( 1983, pestplce, mario,   pestplce, pestplce,       0,  ROT180, "bootleg", "Pest Place", GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
29572649
2958GAME( 1985, spclforc, 0,      spclforc, spclforc, 0,        ROT90, "Senko Industries (Magic Eletronics Inc. licence)", "Special Forces", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
2959GAME( 1985, spcfrcii, 0,      spclforc, spclforc, 0,        ROT90, "Senko Industries (Magic Eletronics Inc. licence)", "Special Forces II", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
2650GAME( 1985, spclforc, 0,      spclforc, spclforc,       0,  ROT90, "Senko Industries (Magic Eletronics Inc. licence)", "Special Forces", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
2651GAME( 1985, spcfrcii, 0,      spclforc, spclforc,       0,  ROT90, "Senko Industries (Magic Eletronics Inc. licence)", "Special Forces II", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
29602652
2961GAME( 1984, drakton,  0,        drakton,  drakton,  drakton,  ROT90, "Epos Corporation", "Drakton", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
2962GAME( 1985, strtheat, 0,        strtheat, strtheat, strtheat, ROT90, "Epos Corporation", "Street Heat - Cardinal Amusements", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
2653//FIXME: move DRIVER_INIT here
2654GAME( 1984, drakton,  0,        drakton,  drakton,  drakton,  ROT90, "Epos Corporation", "Drakton", GAME_SUPPORTS_SAVE )
2655GAME( 1985, strtheat, 0,        strtheat, strtheat, strtheat, ROT90, "Epos Corporation", "Street Heat - Cardinal Amusements", GAME_SUPPORTS_SAVE )
src/mame/drivers/20pacgal.c
r1386r1387
5656
5757
5858
59static struct EEPROM_interface eeprom_interface =
59static const struct EEPROM_interface eeprom_interface =
6060{
6161   7,            /* address bits */
6262   8,            /* data bits */
src/mame/drivers/pipeline.c
r1386r1387
306306   { 0, 0, 0, 0, -1 }      /* end mark */
307307};
308308
309static ppi8255_interface ppi8255_intf =
309static const ppi8255_interface ppi8255_intf =
310310{
311311   3,
312312   { input_port_0_r, input_port_1_r, NULL },   /* Port A read */
src/mame/drivers/taito_b.c
r1386r1387
382382
383383***************************************************************************/
384384
385static struct EEPROM_interface eeprom_interface =
385static const struct EEPROM_interface eeprom_interface =
386386{
387387   6,            /* address bits */
388388   16,            /* data bits */
src/mame/drivers/suna8.c
r1386r1387
15391539   suna8_samples_number_w
15401540};
15411541
1542static struct Samplesinterface suna8_samples_interface =
1542static const struct Samplesinterface suna8_samples_interface =
15431543{
15441544   1,
15451545   NULL,
src/mame/drivers/cps1.c
r1386r1387
381381********************************************************************/
382382
383383#ifndef MESS
384static struct EEPROM_interface qsound_eeprom_interface =
384static const struct EEPROM_interface qsound_eeprom_interface =
385385{
386386   7,      /* address bits */
387387   8,      /* data bits */
r1386r1387
390390   "0111"   /* erase command */
391391};
392392
393static struct EEPROM_interface pang3_eeprom_interface =
393static const struct EEPROM_interface pang3_eeprom_interface =
394394{
395395   6,      /* address bits */
396396   16,      /* data bits */
src/mame/drivers/starcrus.c
r1386r1387
161161   memcpy(colortable,colortable_source,sizeof(colortable_source));
162162}
163163
164static const char *starcrus_sample_names[] =
164static const char *const starcrus_sample_names[] =
165165{
166166    "*starcrus",
167167    "engine.wav",   /* engine sound, channel 0 */
r1386r1387
171171    0
172172};
173173
174static struct Samplesinterface samples_interface =
174static const struct Samplesinterface samples_interface =
175175{
176176    4,   /* 4 channels */
177177   starcrus_sample_names
src/mame/drivers/namcos11.c
r1386r1387
881881   }
882882
883883   state_save_register_global( m_n_oldcoin );
884
885   at28c16_init( 0, NULL, NULL );
884886}
885887
886888static MACHINE_RESET( namcos11 )
src/mame/drivers/kickgoal.c
r1386r1387
427427}
428428
429429
430static UINT8 *kickgoal_default_eeprom;
430static const UINT8 *kickgoal_default_eeprom;
431431static int kickgoal_default_eeprom_length;
432432
433static UINT8 kickgoal_default_eeprom_type1[128] = {
433static const UINT8 kickgoal_default_eeprom_type1[128] = {
434434   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
435435   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
436436   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
src/mame/drivers/cosmic.c
r1386r1387
944944GFXDECODE_END
945945
946946
947static const char *panic_sample_names[] =
947static const char *const panic_sample_names[] =
948948{
949949   "*panic",
950950   "walk.wav",
r1386r1387
961961   0
962962};
963963
964static struct Samplesinterface panic_samples_interface =
964static const struct Samplesinterface panic_samples_interface =
965965{
966966   9,   /* 9 channels */
967967   panic_sample_names
968968};
969969
970static const char *cosmicg_sample_names[] =
970static const char *const cosmicg_sample_names[] =
971971{
972972   "*cosmicg",
973973   "cg_m0.wav",   /* 8 Different pitches of March Sound */
r1386r1387
988988   0
989989};
990990
991static struct Samplesinterface cosmicg_samples_interface =
991static const struct Samplesinterface cosmicg_samples_interface =
992992{
993993   9,   /* 9 channels */
994994   cosmicg_sample_names
src/mame/drivers/bmcbowl.c
r1386r1387
252252
253253// 'working' NVRAM
254254
255static int bmc_nv1[]=
255#ifdef NVRAM_HACK
256static const UINT8 bmc_nv1[]=
256257{
257258 0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x13,0x88,0x46,0xDD,0x0F,0xA0,
258259 0x5A,0xF5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x6E,0x55,
r1386r1387
270271 0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
271272 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,
272273 0x00,0x00,0x00,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
273 0x00,0x00,0xDC,0x00,0xFF,0xFF,0xFF,0xFF,-1
274 0x00,0x00,0xDC,0x00,0xFF,0xFF,0xFF,0xFF
274275};
275276
276static int bmc_nv2[]=
277static const UINT8 bmc_nv2[]=
277278{
278279 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
279280 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0x00,0x09,0x00,0x00,0x2B,0xF1,
280 0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,-1
281 0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
281282};
282283
283static int bmc_nv3[]=
284static const UINT8 bmc_nv3[]=
284285{
285 0xFA,0xFF,0x01,0x02,0x04,0x0A,0x1E,0xC8,0x02,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,-1
286 0xFA,0xFF,0x01,0x02,0x04,0x0A,0x1E,0xC8,0x02,0x01,0xFF,0xFF,0xFF,0xFF,0xFF
286287};
287288
288289
289static void init_stats(int *table , int address)
290static void init_stats(const UINT8 *table, int table_len, int address)
290291{
291   while(*table>=0)
292   {
293      stats_ram[address]=*table;
294      address+=2;
295      table++;
296   }
292   int i;
293   for (i=0; i<table_len; i++)
294      stats_ram[address+2*i]=table[i];
297295}
296#endif
298297
299298static NVRAM_HANDLER( bmcbowl )
300299{
r1386r1387
306305
307306#ifdef NVRAM_HACK
308307   for (i = 0; i < stats_ram_size; i++)
309      {
310         stats_ram[i] = 0xff;
311         init_stats(bmc_nv1,0);
312         init_stats(bmc_nv2,0x3b0);
313         init_stats(bmc_nv3,0xfe2);
314      }
308      stats_ram[i] = 0xff;
309
310   init_stats(bmc_nv1,ARRAY_LENGTH(bmc_nv1),0);
311   init_stats(bmc_nv2,ARRAY_LENGTH(bmc_nv2),0x3b0);
312   init_stats(bmc_nv3,ARRAY_LENGTH(bmc_nv3),0xfe2);
315313#else
316314   if (file)
317315      mame_fread(file, stats_ram, stats_ram_size);
src/mame/drivers/taxidrvr.c
r1386r1387
9393}
9494
9595
96static ppi8255_interface ppi8255_intf =
96static const ppi8255_interface ppi8255_intf =
9797{
9898   5,                               /* 5 chips */
9999   { p0a_r, NULL,  NULL,  NULL,  NULL  },   /* Port A read */
src/mame/drivers/cps2.c
r1386r1387
634634
635635
636636
637static struct EEPROM_interface cps2_eeprom_interface =
637static const struct EEPROM_interface cps2_eeprom_interface =
638638{
639639   6,      /* address bits */
640640   16,      /* data bits */
src/mame/drivers/lordgun.c
r1386r1387
408408
409409***************************************************************************/
410410
411static ppi8255_interface ppi8255_intf =
411static const ppi8255_interface ppi8255_intf =
412412{
413413   2,   // 2 chips
414414   { lordgun_eeprom_r,      input_port_1_r },      // Port A read
src/mame/drivers/segag80r.c
r1386r1387
15421542
15431543static DRIVER_INIT( sindbadm )
15441544{
1545   ppi8255_interface ppi_intf =
1545   static ppi8255_interface ppi_intf =
15461546   {
15471547      1,
15481548      { 0 },
src/mame/drivers/tmnt.c
r1386r1387
455455static int init_eeprom_count;
456456
457457
458static struct EEPROM_interface eeprom_interface =
458static const struct EEPROM_interface eeprom_interface =
459459{
460460   7,            /* address bits */
461461   8,            /* data bits */
r1386r1387
565565WRITE16_HANDLER( ssriders_eeprom_w );   /* in video/tmnt.c */
566566
567567
568static struct EEPROM_interface thndrx2_eeprom_interface =
568static const struct EEPROM_interface thndrx2_eeprom_interface =
569569{
570570   7,            /* address bits */
571571   8,            /* data bits */
r1386r1387
24852485   REGION_SOUND2      /* memory region */
24862486};
24872487
2488static struct Samplesinterface samples_interface =
2488static const struct Samplesinterface samples_interface =
24892489{
24902490   1,   /* 1 channel for the title music */
24912491   NULL,
src/mame/drivers/namcos12.c
r1386r1387
13381338   psx_driver_init();
13391339
13401340   psx_dma_install_read_handler( 5, namcos12_rom_read );
1341
1342   at28c16_init( 0, NULL, NULL );
13411343}
13421344
13431345static DRIVER_INIT( ptblank2 )
src/mame/drivers/psikyo.c
r1386r1387
184184      timer_call_after_resynch(NULL, (data >> 16) & 0xff, psikyo_soundlatch_callback);
185185}
186186
187static UINT8 s1945_table[256] = {
187static const UINT8 s1945_table[256] = {
188188   0x00, 0x00, 0x64, 0xae, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc,
189189   0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x1e,
190190   0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x5c, 0x00, 0x00, 0x2b, 0xc0
191191};
192192
193static UINT8 s1945a_table[256] = {
193static const UINT8 s1945a_table[256] = {
194194   0x00, 0x00, 0x64, 0xbe, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc,
195195   0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc7, 0x2a,
196196   0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xad, 0x4c, 0x00, 0x00, 0x2b, 0xc0
197197};
198198
199static UINT8 s1945j_table[256] = {
199static const UINT8 s1945j_table[256] = {
200200   0x00, 0x00, 0x64, 0xb6, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc,
201201   0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x92,
202202   0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x64, 0x00, 0x00, 0x2b, 0xc0
src/mame/drivers/playmark.c
r1386r1387
9797
9898***************************************************************************/
9999
100static struct EEPROM_interface eeprom_interface =
100static const struct EEPROM_interface eeprom_interface =
101101{
102102   6,            /* address bits */
103103   16,            /* data bits */
src/mame/drivers/model3.c
r1386r1387
916916/*****************************************************************************/
917917
918918/* this is a 93C46 but with reset delay that is needed by Lost World */
919static struct EEPROM_interface eeprom_interface =
919static const struct EEPROM_interface eeprom_interface =
920920{
921921   6,            /* address bits */
922922   16,            /* data bits */
src/mame/drivers/iqblock.c
r1386r1387
110110   /* bit 7 could be a second coin counter, but coin 2 doesn't seem to work... */
111111}
112112
113static ppi8255_interface ppi8255_intf =
113static const ppi8255_interface ppi8255_intf =
114114{
115115   1,                      /* 1 chip */
116116   { input_port_0_r },         /* Port A read */
src/mame/drivers/cbasebal.c
r1386r1387
9393
9494***************************************************************************/
9595
96static struct EEPROM_interface eeprom_interface =
96static const struct EEPROM_interface eeprom_interface =
9797{
9898   6,      /* address bits */
9999   16,      /* data bits */
src/mame/drivers/smstrv.c
r1386r1387
204204   return 0;
205205}
206206
207static ppi8255_interface ppi8255_intf =
207static const ppi8255_interface ppi8255_intf =
208208{
209209   2,                /* 2 chips */
210210   { r1, r4 },         /* Port A read */
src/mame/drivers/xexex.c
r1386r1387
8585static emu_timer *dmadelay_timer;
8686
8787
88static struct EEPROM_interface eeprom_interface =
88static const struct EEPROM_interface eeprom_interface =
8989{
9090   7,            /* address bits */
9191   8,            /* data bits */
src/mame/drivers/konamigq.c
r1386r1387
118118      }
119119      else
120120      {
121         static UINT8 def_eeprom[ 128 ] =
121         static const UINT8 def_eeprom[ 128 ] =
122122         {
123123            0x29, 0x2b, 0x52, 0x56, 0x20, 0x94, 0x41, 0x55, 0x00, 0x41, 0x14, 0x14, 0x00, 0x03, 0x01, 0x01,
124124            0x01, 0x03, 0x00, 0x00, 0x07, 0x07, 0x00, 0x01, 0xaa, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
src/mame/drivers/epos.c
r1386r1387
120120//  AM_RANGE(0x40, 0x40) AM_WRITE(watchdog_reset_w)
121121ADDRESS_MAP_END
122122
123static ppi8255_interface ppi8255_intf =
123static const ppi8255_interface ppi8255_intf =
124124{
125125   1,                /* 1 chip */
126126   { input_port_2_r },   /* Port A read */
src/mame/drivers/toaplan2.c
r1386r1387
12121212/*###################### Battle Bakraid ##############################*/
12131213
12141214/* EEPROM contents with Battle Bakraid Unlimited version features unlocked */
1215static UINT8 bbakraid_unlimited_nvram[512] = {
1215static const UINT8 bbakraid_unlimited_nvram[512] = {
12161216   0xc2,0x49,0x00,0x07,0xa1,0x20,0x2a,0x2a,0x2a,0x90,0x90,0x90,0x00,0x00,0x00,0x00,
12171217   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x06,0x1a,0x80,0x2a,0x2a,0x2a,0x94,
12181218   0x94,0x94,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,
r1386r1387
12491249
12501250
12511251
1252static struct EEPROM_interface eeprom_interface_93C66 =
1252static const struct EEPROM_interface eeprom_interface_93C66 =
12531253{
12541254   /* Pin 6 of the 93C66 is connected to Gnd!
12551255       So it's configured for 512 bytes */
src/mame/drivers/couple.c
r1386r1387
125125};
126126#endif
127127
128static ppi8255_interface ppi8255_intf =
128static const ppi8255_interface ppi8255_intf =
129129{
130130   2,
131131   { input_port_0_r,   input_port_1_r },   /* Port A read */
src/mame/drivers/crbaloon.c
r1386r1387
306306GFXDECODE_END
307307
308308
309static struct SN76477interface sn76477_interface =
309static const struct SN76477interface sn76477_interface =
310310{
311311   RES_K( 47),   /*  4 noise_res          */
312312   RES_K(330),   /*  5 filter_res         */
src/mame/drivers/tcl.c
r1386r1387
8686   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout2,     0, 16 ) /* wrong */
8787GFXDECODE_END
8888
89static ppi8255_interface ppi8255_intf =
89static const ppi8255_interface ppi8255_intf =
9090{
9191   2,
9292   { NULL, NULL },
src/mame/drivers/freekick.c
r1386r1387
597597   return memory_region(REGION_USER1)[romaddr & 0x7fff];
598598}
599599
600static ppi8255_interface ppi8255_intf =
600static const ppi8255_interface ppi8255_intf =
601601{
602602   2,                               /* 1 chips */
603603   { NULL,             input_port_0_r },   /* Port A read */
src/mame/drivers/rockola.c
r1386r1387
158158
159159/* audio */
160160
161extern const char *sasuke_sample_names[];
162extern const char *vanguard_sample_names[];
163extern const char *fantasy_sample_names[];
161extern const char *const sasuke_sample_names[];
162extern const char *const vanguard_sample_names[];
163extern const char *const fantasy_sample_names[];
164164
165165extern WRITE8_HANDLER( sasuke_sound_w );
166166extern WRITE8_HANDLER( satansat_sound_w );
r1386r1387
713713   rockola_sh_start
714714};
715715
716static struct Samplesinterface sasuke_samples_interface =
716static const struct Samplesinterface sasuke_samples_interface =
717717{
718718   4,   /* 4 channels */
719719   sasuke_sample_names
720720};
721721
722static struct Samplesinterface vanguard_samples_interface =
722static const struct Samplesinterface vanguard_samples_interface =
723723{
724724   3,   /* 3 channel */
725725   vanguard_sample_names
726726};
727727
728static struct Samplesinterface fantasy_samples_interface =
728static const struct Samplesinterface fantasy_samples_interface =
729729{
730730   1,   /* 1 channel */
731731   fantasy_sample_names
732732};
733733
734734
735static struct SN76477interface sasuke_sn76477_intf_1 =
735static const struct SN76477interface sasuke_sn76477_intf_1 =
736736{
737737   RES_K(470),      /*  4  noise_res     */
738738   RES_K(150),      /*  5  filter_res    */
r1386r1387
761761   // ic48     GND: 2,22,26,27,28  +5V: 1,15,25
762762};
763763
764static struct SN76477interface sasuke_sn76477_intf_2 =
764static const struct SN76477interface sasuke_sn76477_intf_2 =
765765{
766766   RES_K(340),      /*  4  noise_res     */
767767   RES_K(47),      /*  5  filter_res    */
r1386r1387
790790   // ic51     GND: 2,26,27        +5V: 1,15,22,25,28
791791};
792792
793static struct SN76477interface sasuke_sn76477_intf_3 =
793static const struct SN76477interface sasuke_sn76477_intf_3 =
794794{
795795   RES_K(330),      /*  4  noise_res     */
796796   RES_K(47),      /*  5  filter_res    */
r1386r1387
819819   // ic52     GND: 2,22,27,28     +5V: 1,15,25,26
820820};
821821
822static struct SN76477interface satansat_sn76477_intf =
822static const struct SN76477interface satansat_sn76477_intf =
823823{
824824   RES_K(470),      /*  4  noise_res     */
825825   RES_M(1.5),      /*  5  filter_res    */
r1386r1387
848848   // ???      GND: 2,26,27        +5V: 15,25
849849};
850850
851static struct SN76477interface vanguard_sn76477_intf_1 =
851static const struct SN76477interface vanguard_sn76477_intf_1 =
852852{
853853   RES_K(470),      /*  4  noise_res     */
854854   RES_M(1.5),      /*  5  filter_res    */
r1386r1387
877877   // SHOT A   GND: 2,9,26,27  +5V: 15,25
878878};
879879
880static struct SN76477interface vanguard_sn76477_intf_2 =
880static const struct SN76477interface vanguard_sn76477_intf_2 =
881881{
882882   RES_K(10),      /*  4  noise_res     */
883883   RES_K(30),      /*  5  filter_res    */
r1386r1387
906906   // SHOT B   GND: 1,2,26,27  +5V: 15,25,28
907907};
908908
909static struct SN76477interface fantasy_sn76477_intf =
909static const struct SN76477interface fantasy_sn76477_intf =
910910{
911911   RES_K(470),      /*  4  noise_res     */
912912   RES_M(1.5),      /*  5  filter_res    */
src/mame/drivers/getrivia.c
r1386r1387
359359
360360
361361
362static ppi8255_interface getrivia_ppi8255_intf =
362static const ppi8255_interface getrivia_ppi8255_intf =
363363{
364364   2,                   /* 2 chips */
365365   { input_port_0_r, input_port_2_r },  /* Port A read */
r1386r1387
370370   { sound_w,        lamps2_w },        /* Port C write */
371371};
372372
373static ppi8255_interface gselect_ppi8255_intf =
373static const ppi8255_interface gselect_ppi8255_intf =
374374{
375375   2,                   /* 2 chips */
376376   { input_port_0_r, input_port_2_r },  /* Port A read */
src/mame/drivers/mpu4drvr.c
r1386r1387
272272   /* set the new state of the IRQ lines */
273273   if (newstate)
274274   {
275      LOG(("68k IRQ, %x\n", newstate));
275      LOGSTUFF(("68k IRQ, %x\n", newstate));
276276      cpunum_set_input_line(1, newstate, ASSERT_LINE);
277277   }
278278   else
279279   {
280      LOG(("68k IRQ Clear, %x\n", newstate));
280      LOGSTUFF(("68k IRQ Clear, %x\n", newstate));
281281      cpunum_set_input_line(1, 7, CLEAR_LINE);
282282   }
283283}
src/mame/drivers/namcond1.c
r1386r1387
277277    }
278278}
279279
280static DRIVER_INIT( namcond1 )
281{
282   at28c16_init( 0, NULL, NULL );
283}
284
280285/******************************************
281286  ND-1 Master clock = 49.152MHz
282287  - 680000  = 12288000 (CLK/4)
r1386r1387
405410    ROM_LOAD( "ncs1voic.7c",     0x000000, 0x200000, CRC(ed05fd88) SHA1(ad88632c89a9946708fc6b4c9247e1bae9b2944b) )
406411ROM_END
407412
408GAME( 1995, ncv1,      0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
409GAME( 1995, ncv1j,  ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.00)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
410GAME( 1995, ncv1j2, ncv1, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.03)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
411GAME( 1996, ncv2,      0, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.2", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
412GAME( 1996, ncv2j,  ncv2, namcond1, namcond1, 0, ROT90, "Namco", "Namco Classics Collection Vol.2 (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
413GAME( 1995, ncv1,      0, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.1", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
414GAME( 1995, ncv1j,  ncv1, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.00)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
415GAME( 1995, ncv1j2, ncv1, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.1 (Japan, v1.03)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
416GAME( 1996, ncv2,      0, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.2", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
417GAME( 1996, ncv2j,  ncv2, namcond1, namcond1, namcond1, ROT90, "Namco", "Namco Classics Collection Vol.2 (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
src/mame/drivers/zaccaria.c
r1386r1387
229229};
230230
231231
232static ppi8255_interface ppi8255_intf =
232static const ppi8255_interface ppi8255_intf =
233233{
234234   1,                         /* 1 chip */
235235   {input_port_3_r},            /* Port A read */
src/mame/drivers/clayshoo.c
r1386r1387
132132 *
133133 *************************************/
134134
135static ppi8255_interface ppi8255_intf =
135static const ppi8255_interface ppi8255_intf =
136136{
137137   2,                      /* 2 chips */
138138   { 0, 0 },               /* Port A read */
src/mame/drivers/eolith.c
r1386r1387
6666#include "eolithsp.h"
6767
6868// It's configured for 512 bytes
69static struct EEPROM_interface eeprom_interface_93C66 =
69static const struct EEPROM_interface eeprom_interface_93C66 =
7070{
7171   9,            // address bits 9
7272   8,            // data bits    8
src/mame/drivers/ninjakd2.c
r1386r1387
449449   GFXDECODE_ENTRY( REGION_GFX3, 0, charlayout,   32*16, 16 )
450450GFXDECODE_END
451451
452static struct Samplesinterface samples_interface =
452static const struct Samplesinterface samples_interface =
453453{
454454   1,   /* 1 channel */
455455   NULL,
src/mame/drivers/turbo.c
r1386r1387
15261526
15271527static DRIVER_INIT( turbo )
15281528{
1529   static ppi8255_interface turbo_8255_intf =
1529   static const ppi8255_interface turbo_8255_intf =
15301530   {
15311531      4,
15321532      { NULL,          NULL,          NULL,            turbo_analog_r },
r1386r1387
15481548
15491549static DRIVER_INIT( subroc3d )
15501550{
1551   static ppi8255_interface subroc3d_8255_intf =
1551   static const ppi8255_interface subroc3d_8255_intf =
15521552   {
15531553      2,
15541554      { NULL,             NULL },
r1386r1387
15641564
15651565static DRIVER_INIT( buckrog )
15661566{
1567   static ppi8255_interface buckrog_8255_intf =
1567   static const ppi8255_interface buckrog_8255_intf =
15681568   {
15691569      2,
15701570      { NULL,            NULL },
src/mame/drivers/laserbat.c
r1386r1387
558558
559559/* Laser Battle sound **********************************/
560560
561static struct SN76477interface sn76477_interface =
561static const struct SN76477interface sn76477_interface =
562562{
563563   RES_K(47),       /*  4 noise_res         R21    47K */
564564   0,            /*  5 filter_res (variable) */
src/mame/drivers/tnzs.c
r1386r1387
12791279   irqhandler
12801280};
12811281
1282static struct Samplesinterface samples_interface =
1282static const struct Samplesinterface samples_interface =
12831283{
12841284   1,
12851285   NULL,
src/mame/drivers/plygonet.c
r1386r1387
7070static UINT16 *dsp56k_bank02_ram ;
7171static UINT16 *dsp56k_bank04_ram ;
7272
73static struct EEPROM_interface eeprom_interface =
73static const struct EEPROM_interface eeprom_interface =
7474{
7575   7,         /* address bits */
7676   8,         /* data bits */
src/mame/drivers/asteroid.c
r1386r1387
639639   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_VECTOR )
640640   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
641641   MDRV_SCREEN_SIZE(400,300)
642   MDRV_SCREEN_VISIBLE_AREA(0, 1044, 0, 800)
642   MDRV_SCREEN_VISIBLE_AREA(522, 1566, 394, 1182)
643643   MDRV_PALETTE_LENGTH(32768)
644644
645645   MDRV_VIDEO_START(dvg)
r1386r1387
693693   MDRV_SCREEN_REFRESH_RATE(40)
694694   MDRV_MACHINE_RESET(avgdvg)
695695
696   MDRV_SCREEN_VISIBLE_AREA(0, 1023, 0, 1023)
696   MDRV_SCREEN_VISIBLE_AREA(522, 1566, 270, 1070)
697697   MDRV_VIDEO_START(dvg)
698698   MDRV_VIDEO_UPDATE(vector)
699699
src/mame/drivers/powerbal.c
r1386r1387
2727static int xoffset;
2828static int yoffset;
2929
30static struct EEPROM_interface eeprom_interface =
30static const struct EEPROM_interface eeprom_interface =
3131{
3232   6,            /* address bits */
3333   16,            /* data bits */
src/mame/drivers/stv.c
r1386r1387
33063306   ROM_LOAD16_WORD_SWAP( "th-e-5.ic5",   0x1000000, 0x0400000, CRC(3914b805) SHA1(1331ce82ba0bdfc76fe3456a5252e69c00e2cf1f) )
33073307ROM_END
33083308
3309ROM_START( thuntk )
3310   STV_BIOS
3311
3312   ROM_REGION32_BE( 0x3000000, REGION_USER1, 0 ) /* SH2 code */
3313   ROM_FILL(                             0x0000000, 0x0400000, 0x00 )
3314   ROM_LOAD16_BYTE( "2.ic13_2",               0x0200000, 0x0080000, CRC(6cae2926) SHA1(e8d5745b4228de24672da5017cb3dab58344f59f) )
3315   ROM_LOAD16_BYTE( "1.ic13_1",    0x0200001, 0x0080000, CRC(460727c8) SHA1(da7171b65734264e10692e3408ac93beb374c65e) )
3316
3317   ROM_LOAD( "bom210-10.ic2",   0x1c00000, 0x0400000, CRC(f59d0827) SHA1(2bed4b2c78e9b4e9332f576e1b264a6343f4cfff) )
3318   ROM_RELOAD(                           0x0400000, 0x0400000 )
3319   ROM_LOAD( "bom210-11.ic3",   0x2000000, 0x0400000, CRC(44e5a13e) SHA1(aee3c06662a1d083f3bd01292cf2694132f63533) )
3320   ROM_RELOAD(                           0x0800000, 0x0400000 )
3321   ROM_LOAD( "bom210-12.ic4",   0x2400000, 0x0400000, CRC(deabc701) SHA1(cb313ae9bf6f115682fc76647a999e12c98f6120) )
3322   ROM_RELOAD(                           0x0c00000, 0x0400000 )
3323   ROM_LOAD( "bom210-13.ic5",   0x2800000, 0x0400000, CRC(5ece1d5c) SHA1(6d88f71b485bf2b3c164fa22f1c7ecaba4b3f5b1) )
3324   ROM_RELOAD(                           0x1000000, 0x0400000 )
3325ROM_END
3326
3327
3328ROM_START( sanjeon )
3329   STV_BIOS
3330
3331   ROM_REGION32_BE( 0x3000000, REGION_USER1, 0 ) /* SH2 code */
3332   ROM_LOAD( "ic11",               0x0000000, 0x0200000, CRC(9abae8d4) SHA1(ddbe4c8fff8fa59d63e278e95f245145d2da8aeb) ) // ic13 bad
3333   ROM_RELOAD ( 0x0100000, 0x0200000 )
3334   ROM_RELOAD ( 0x0200000, 0x0200000 )
3335   ROM_RELOAD ( 0x0300000, 0x0200000 )
3336
3337   ROM_LOAD( "ic13",    0x0400000, 0x0200000, CRC(f72c1d13) SHA1(a2b168d187034024b83fbbe2f5eec78816285da9) ) // ic2 good
3338   ROM_LOAD( "ic14",    0x0600000, 0x0200000, CRC(bcd72105) SHA1(fb88a1f2589fef5d9845027646259ec8e781771b) ) // ic2 good
3339   ROM_LOAD( "ic15",    0x0800000, 0x0200000, CRC(8c9c8352) SHA1(312e9e6435c6e9a4a19b72e234b087d4f5b069a5) ) // ic3 good
3340   ROM_LOAD( "ic16",    0x0a00000, 0x0200000, CRC(07e11512) SHA1(5fb5e93a167aae501bd799aba98f7dbc3762a795) ) // ic3 good
3341   ROM_LOAD( "ic17",    0x0c00000, 0x0200000, CRC(46b7b344) SHA1(a325b724e6346f585582bb2581d3063b1c8ddee9) ) // ic4 good
3342   ROM_LOAD( "ic18",    0x0e00000, 0x0200000, CRC(d48404e1) SHA1(e4927d17cb19f6825f41b41056b89de224cf97de) ) // ic4 good
3343   ROM_LOAD( "ic19",    0x1000000, 0x0200000, CRC(33d23bb9) SHA1(0179438a0b14ad7eb553a24d86fae778671fcc49) ) // ic5 good
3344   ROM_LOAD( "ic20",    0x1200000, 0x0200000, CRC(f8cc1038) SHA1(06bcb25eb5df77bd503b0692a96ec66c00976fe9) ) // ic5 good
3345   ROM_LOAD( "ic21",    0x1400000, 0x0200000, CRC(74ceb649) SHA1(91b7eb699b7167f890528149178644a74ef3ad17) ) // ic6 good
3346   ROM_LOAD( "ic22",    0x1600000, 0x0200000, CRC(85f31277) SHA1(277c28d44cabd9081a8151d6ec27d47b5606435a) ) // ic6 good
3347   ROM_LOAD( "ic12",    0x1800000, 0x0400000, CRC(d5ebc84e) SHA1(f990b793cdfadbbac69c680191660f4a2f282ba2) ) // ic1 good
3348ROM_END
3349
3350
33093351ROM_START( sasissu )
33103352   STV_BIOS
33113353
r1386r1387
36683710ROM_END
36693711
36703712
3713ROM_START( magzun )
3714   STV_BIOS
3715
3716   ROM_REGION32_BE( 0x3000000, REGION_USER1, 0 ) /* SH2 code */
3717   ROM_LOAD( "flash.ic13",               0x0000000, 0x0100000, CRC(e6f0aca0) SHA1(251d4d9c5a332d13af3a144c5eb9d8e7836bdd1b) ) // good
3718   ROM_RELOAD ( 0x0100000, 0x0100000 )
3719   ROM_RELOAD ( 0x0200000, 0x0100000 )
3720   ROM_RELOAD ( 0x0300000, 0x0100000 )
3721
3722   ROM_LOAD16_WORD_SWAP( "mpr-19354.ic2",    0x0400000, 0x0400000, CRC(a23822e7) SHA1(10ca5d39dcaaf35b80168a08d8a18d77fba1d2ce) ) // good
3723   ROM_LOAD16_WORD_SWAP( "mpr-19355.ic3",    0x0800000, 0x0400000, CRC(d70e5ebc) SHA1(2d560f6b6e693b2b91cf5ff5c4f0890cc2176f91) ) // good
3724   ROM_LOAD16_WORD_SWAP( "mpr-19356.ic4",    0x0c00000, 0x0400000, CRC(3bc43fe9) SHA1(f72b0f3208e2f411f4c9cc76c317a605acd32a67) ) // good
3725   ROM_LOAD16_WORD_SWAP( "mpr-19357.ic5",    0x1000000, 0x0400000, CRC(aa749370) SHA1(f09b0aa94fcc983419aaf2465dae5c9c64606158) ) // good
3726   ROM_LOAD16_WORD_SWAP( "mpr-19358.ic6",    0x1400000, 0x0400000, CRC(0969f1ec) SHA1(25b9671f0975172f283458d46e160080dd1d19e9) ) // good
3727   ROM_LOAD16_WORD_SWAP( "mpr-19359.ic1",    0x1800000, 0x0400000, CRC(b0d06f9c) SHA1(19e04c9c3a0bea5950aba8e1975962fa37722f32) ) // good
3728ROM_END
3729
3730
3731ROM_START( stress )
3732   STV_BIOS
3733
3734   ROM_REGION32_BE( 0x3000000, REGION_USER1, 0 ) /* SH2 code */
3735   ROM_LOAD( "epr-21300a.ic13",    0x0000000, 0x0100000, CRC(899d829e) SHA1(b6c6da92dc108353998b29c0659d288645541519) ) // good
3736   ROM_RELOAD ( 0x0100000, 0x0100000 )
3737   ROM_RELOAD ( 0x0200000, 0x0100000 )
3738   ROM_RELOAD ( 0x0300000, 0x0100000 )
3739   ROM_LOAD16_WORD_SWAP( "mpr-21290.ic2",    0x0400000, 0x0400000, CRC(a49d29f3) SHA1(8f6c26fd9e94a9e03dd0029026d205cf481fe151) ) // good
3740   ROM_LOAD16_WORD_SWAP( "mpr-21291.ic3",    0x0800000, 0x0400000, CRC(9452ba20) SHA1(8a9ff546901715f99bb911616c74ae30ebd7c6d7) ) // good
3741   ROM_LOAD16_WORD_SWAP( "mpr-21292.ic4",    0x0c00000, 0x0400000, CRC(f60268e2) SHA1(5c2febb94553a941a68e9611617750a89c82e783) ) // good
3742   ROM_LOAD16_WORD_SWAP( "mpr-21293.ic5",    0x1000000, 0x0400000, CRC(794946e0) SHA1(7881adb92fbf3efecb88f30834cdd1ed863b0b0e) ) // good
3743   ROM_LOAD16_WORD_SWAP( "mpr-21294.ic6",    0x1400000, 0x0400000, CRC(550843bb) SHA1(5e278a0ae60f7bee23b5f1ee10b8ce31effc9718) ) // good
3744   ROM_LOAD16_WORD_SWAP( "mpr-21289.ic1",    0x1800000, 0x0400000, CRC(c2ee8bea) SHA1(5fa0e6b492cc272c33b01adbef9233e6c8098827) ) // good
3745   ROM_LOAD16_WORD_SWAP( "mpr-21296.ic8",    0x1c00000, 0x0400000, CRC(b825c42a) SHA1(7c6f737b69b9283345f8fa23cb1d110b9b5f3d7e) ) // good
3746   ROM_LOAD16_WORD_SWAP( "mpr-21297.ic9",    0x2000000, 0x0400000, CRC(4bff7469) SHA1(8a36405a1a292d60b5918e604b460ed98740fae3) ) // good
3747   ROM_LOAD16_WORD_SWAP( "mpr-21298.ic10",   0x2400000, 0x0400000, CRC(68d07144) SHA1(5021f43d19105b484135ebddd3fa203233096c98) ) // good
3748   ROM_LOAD16_WORD_SWAP( "mpr-21299.ic11",   0x2800000, 0x0400000, CRC(ecc521c6) SHA1(f7ed4dd1cbe179652fdfdde34929b41a1fdcf9e2) ) // good
3749ROM_END
3750
36713751/*
36723752country codes:
36733753J = Japan
r1386r1387
36893769by Sega titles,and this is a Sunsoft game)It's likely to be a left-over...
36903770*/
36913771
3772DRIVER_INIT( sanjeon )
3773{
3774   UINT8 *src    = memory_region       ( REGION_USER1 );
3775   int x;
3776
3777   for (x=0;x<0x3000000;x++)
3778   {
3779      src[x] = src[x]^0xff;
3780
3781      src[x] = BITSWAP8(src[x],7,2,5,1,  3,6,4,0);
3782      src[x] = BITSWAP8(src[x],4,6,5,7,  3,2,1,0);
3783      src[x] = BITSWAP8(src[x],7,6,5,4,  2,3,1,0);
3784      src[x] = BITSWAP8(src[x],7,0,5,4,  3,2,1,6);
3785      src[x] = BITSWAP8(src[x],3,6,5,4,  7,2,1,0);
3786
3787   }
3788
3789
3790   driver_init_sasissu(Machine);
3791}
3792
36923793GAME( 1996, stvbios,   0, stv, stv,  stv,       ROT0,   "Sega",                      "ST-V Bios", GAME_IS_BIOS_ROOT )
36933794
36943795//GBX   YEAR, NAME,      PARENT,  BIOS,    MACH,INP,  INIT,      MONITOR
36953796/* Playable */
3696GAME( 1998, astrass,   stvbios, stv, stv,  astrass,   ROT0,   "Sunsoft",                  "Astra SuperStars (J 980514 V1.002)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3797GAME( 1998, astrass,   stvbios, stv, stv,  astrass,   ROT0,   "Sunsoft",               "Astra SuperStars (J 980514 V1.002)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
36973798GAME( 1995, bakubaku,  stvbios, stv, stv,  bakubaku,  ROT0,   "Sega",                   "Baku Baku Animal (J 950407 V1.000)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
3698GAME( 1996, batmanfr,  stvbios, stv, stv,  batmanfr,  ROT0,   "Acclaim",                  "Batman Forever (JUE 960507 V1.000)", GAME_NO_SOUND )
3799GAME( 1996, batmanfr,  stvbios, stv, stv,  batmanfr,  ROT0,   "Acclaim",               "Batman Forever (JUE 960507 V1.000)", GAME_NO_SOUND )
36993800GAME( 1996, colmns97,  stvbios, stv, stv,  colmns97,  ROT0,   "Sega",                   "Columns '97 (JET 961209 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37003801GAME( 1997, cotton2,   stvbios, stv, stv,  cotton2,   ROT0,   "Success",                "Cotton 2 (JUET 970902 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37013802GAME( 1998, cottonbm,  stvbios, stv, stv,  cottonbm,  ROT0,   "Success",                "Cotton Boomerang (JUET 980709 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3702GAME( 1995, critcrsh,  stvbios, stv, critcrsh, ic13, ROT0, "Sega",                    "Critter Crusher (EA 951204 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3703GAME( 1999, danchih,   stvbios, stv, stvmp,danchih,   ROT0,   "Altron (Tecmo license)",      "Danchi de Hanafuda (J 990607 V1.400)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3803GAME( 1995, critcrsh,  stvbios, stv, critcrsh, ic13,  ROT0, "Sega",                    "Critter Crusher (EA 951204 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3804GAME( 1999, danchih,   stvbios, stv, stvmp,danchih,   ROT0,   "Altron (Tecmo license)",   "Danchi de Hanafuda (J 990607 V1.400)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37043805GAME( 1996, diehard,   stvbios, stv, stv,  diehard,   ROT0,   "Sega",                   "Die Hard Arcade (UET 960515 V1.000)", GAME_IMPERFECT_SOUND  )
37053806GAME( 1996, dnmtdeka,  diehard, stv, stv,  dnmtdeka,  ROT0,   "Sega",                   "Dynamite Deka (J 960515 V1.000)", GAME_IMPERFECT_SOUND  )
37063807GAME( 1995, ejihon,    stvbios, stv, stv,  ic13,      ROT0,   "Sega",                   "Ejihon Tantei Jimusyo (J 950613 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37073808GAME( 1995, fhboxers,  stvbios, stv, stv,  fhboxers,  ROT0,   "Sega",                   "Funky Head Boxers (JUETBKAL 951218 V1.000)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
3708GAME( 1994, gaxeduel,  stvbios, stv, stv,  gaxeduel,   ROT0,   "Sega",                    "Golden Axe - The Duel (JUETL 950117 V1.000)", GAME_IMPERFECT_SOUND )
3809GAME( 1994, gaxeduel,  stvbios, stv, stv,  gaxeduel,  ROT0,   "Sega",                    "Golden Axe - The Duel (JUETL 950117 V1.000)", GAME_IMPERFECT_SOUND )
37093810GAME( 1998, grdforce,  stvbios, stv, stv,  grdforce,  ROT0,   "Success",                "Guardian Force (JUET 980318 V0.105)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37103811GAME( 1998, groovef,   stvbios, stv, stv,  groovef,   ROT0,   "Atlus",                  "Power Instinct 3 - Groove On Fight (J 970416 V1.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37113812GAME( 1997, hanagumi,  stvbios, stv, stv,  hanagumi,  ROT0,   "Sega",                   "Hanagumi Taisen Columns - Sakura Wars (J 971007 V1.010)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3712GAME( 1996, introdon,  stvbios, stv, stv,  ic13,      ROT0,   "Sunsoft / Success",         "Karaoke Quiz Intro Don Don! (J 960213 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3813GAME( 1996, introdon,  stvbios, stv, stv,  ic13,      ROT0,   "Sunsoft / Success",         "Karaoke Quiz Intro Don Don! (J 960213 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37133814GAME( 1995, kiwames,   stvbios, stv, stvmp,ic13,      ROT0,   "Athena",                 "Pro Mahjong Kiwame S (J 951020 V1.208)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37143815GAME( 1997, maruchan,  stvbios, stv, stv,  maruchan,  ROT0,   "Sega / Toyosuisan",          "Maru-Chan de Goo! (J 971216 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37153816GAME( 1996, mausuke,   stvbios, stv, stv,  mausuke,   ROT0,   "Data East",              "Mausuke no Ojama the World (J 960314 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37163817GAME( 1998, othellos,  stvbios, stv, stv,  othellos,  ROT0,   "Success",                "Othello Shiyouyo (J 980423 V1.002)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3717GAME( 1995, pblbeach,  stvbios, stv, stv,  pblbeach,  ROT0,   "T&E Soft",                 "Pebble Beach - The Great Shot (JUE 950913 V0.990)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3818GAME( 1995, pblbeach,  stvbios, stv, stv,  pblbeach,  ROT0,   "T&E Soft",                 "Pebble Beach - The Great Shot (JUE 950913 V0.990)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37183819GAME( 1996, prikura,   stvbios, stv, stv,  prikura,   ROT0,   "Atlus",                  "Princess Clara Daisakusen (J 960910 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37193820GAME( 1996, puyosun,   stvbios, stv, stv,  puyosun,   ROT0,   "Compile",                "Puyo Puyo Sun (J 961115 V0.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3720GAME( 1998, rsgun,     stvbios, stv, stv,  rsgun,     ROT0,   "Treasure",                 "Radiant Silvergun (JUET 980523 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3821GAME( 1998, rsgun,     stvbios, stv, stv,  rsgun,     ROT0,   "Treasure",              "Radiant Silvergun (JUET 980523 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
37213822GAME( 1998, sasissu,   stvbios, stv, stv,  sasissu,   ROT0,   "Sega",                    "Taisen Tanto-R Sashissu!! (J 980216 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3823GAME( 1999, sanjeon,   sasissu, stv, stv,  sanjeon,   ROT0,   "Sega / Deniam",             "DaeJeon! SanJeon SuJeon (Korea)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37223824GAME( 1997, seabass,   stvbios, stv, stv,  seabass,   ROT0,   "A wave inc. (Able license)","Sea Bass Fishing (JUET 971110 V0.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3723GAME( 1995, shanhigw,  stvbios, stv, stv,  shanhigw,   ROT0,   "Sunsoft / Activision",      "Shanghai - The Great Wall / Shanghai Triple Threat (JUE 950623 V1.005)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3825GAME( 1995, shanhigw,  stvbios, stv, stv,  shanhigw,  ROT0,   "Sunsoft / Activision",      "Shanghai - The Great Wall / Shanghai Triple Threat (JUE 950623 V1.005)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37243826GAME( 1997, shienryu,  stvbios, stv, stv,  shienryu,  ROT270, "Warashi",                "Shienryu (JUET 961226 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
37253827GAME( 1995, smleague,  stvbios, stv, stv,  smleague,  ROT0,   "Sega",                    "Super Major League (U 960108 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3726GAME( 1995, finlarch,  smleague, stv, stv,  finlarch,  ROT0,   "Sega",                    "Final Arch (J 950714 V1.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3828GAME( 1995, finlarch,  smleague,stv, stv,  finlarch,  ROT0,   "Sega",                    "Final Arch (J 950714 V1.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37273829GAME( 1998, sss,       stvbios, stv, stv,  sss,       ROT0,   "Capcom / Cave / Victor",     "Steep Slope Sliders (JUET 981110 V1.000)", GAME_IMPERFECT_SOUND )
37283830GAME( 1995, sandor,    stvbios, stv, stv,  sandor,    ROT0,   "Sega",                    "Puzzle & Action: Sando-R (J 951114 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3831GAME( 1997, thunt,     sandor,  stv, stv,  thunt,     ROT0,   "Sega",                     "Puzzle & Action: Treasure Hunt (JUET 970901 V2.00E)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3832GAME( 1997, thuntk,    sandor,  stv, stv,  sandor,    ROT0,   "Sega / Deniam",            "Puzzle & Action: BoMulEul Chajara (Korea)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37293833GAME( 1996, sokyugrt,  stvbios, stv, stv,  sokyugrt,  ROT0,   "Raizing / 8ing",            "Soukyugurentai / Terra Diver (JUET 960821 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3730GAME( 1995, suikoenb,  stvbios, stv, stv,  suikoenb,  ROT0,   "Data East",                "Suikoenbu / Outlaws of the Lost Dynasty (JUETL 950314 V2.001)", GAME_IMPERFECT_SOUND )
3731GAME( 1997, thunt,     sandor, stv, stv,  thunt,     ROT0,   "Sega",                      "Puzzle & Action: Treasure Hunt (JUET 970901 V2.00E)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3834GAME( 1995, suikoenb,  stvbios, stv, stv,  suikoenb,  ROT0,   "Data East",                "Suikoenbu / Outlaws of the Lost Dynasty (JUETL 950314 V2.001)", GAME_IMPERFECT_SOUND )
37323835GAME( 1996, vfkids,    stvbios, stv, stv,  ic13,      ROT0,   "Sega",                   "Virtua Fighter Kids (JUET 960319 V0.000)", GAME_IMPERFECT_SOUND )
37333836GAME( 1997, winterht,  stvbios, stv, stv,  winterht,  ROT0,   "Sega",                   "Winter Heat (JUET 971012 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37343837GAME( 1997, znpwfv,    stvbios, stv, stv,  znpwfv,    ROT0,   "Sega",                    "Zen Nippon Pro-Wrestling Featuring Virtua (J 971123 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
37353838
37363839/* Almost */
3737GAME( 1997, vmahjong,  stvbios, stv, stvmp,stv,       ROT0,   "Micronet",                 "Virtual Mahjong (J 961214 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3738GAME( 1998, myfairld,  stvbios, stv, stvmp,stv,       ROT0,   "Micronet",                 "Virtual Mahjong 2 - My Fair Lady (J 980608 V1.000)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
3739GAME( 1998, twcup98,   stvbios, stv, stv,  twcup98,   ROT0,   "Tecmo",                    "Tecmo World Cup '98 (JUET 980410 V1.000)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // player movement
3840GAME( 1997, vmahjong,  stvbios, stv, stvmp,stv,       ROT0,   "Micronet",                 "Virtual Mahjong (J 961214 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3841GAME( 1998, myfairld,  stvbios, stv, stvmp,stv,       ROT0,   "Micronet",                 "Virtual Mahjong 2 - My Fair Lady (J 980608 V1.000)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
3842GAME( 1998, twcup98,   stvbios, stv, stv,  twcup98,   ROT0,   "Tecmo",                    "Tecmo World Cup '98 (JUET 980410 V1.000)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) // player movement
3843GAME( 1997, stress,    stvbios, stv, stv,  ic13,      ROT0,   "Sega",                    "Stress Busters", GAME_NOT_WORKING ) // needs printer
37403844
37413845/* Doing Something.. but not enough yet */
37423846GAME( 1998, elandore,  stvbios, stv, stv,  elandore,  ROT0,   "Sai-Mate",                 "Elan Doree - Legend of Dragon (JUET 980922 V1.006)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )//japanese name?
r1386r1387
37493853/* CD games */
37503854GAME( 1995, sfish2,    0, stv, stv,  ic13,    ROT0,   "Sega",                   "Sport Fishing 2 (UET 951106 V1.10e)", GAME_NO_SOUND | GAME_NOT_WORKING )
37513855GAME( 1995, sfish2j,   sfish2, stv, stv,  ic13,    ROT0,   "Sega",                   "Sport Fishing 2 (J 951201 V1.100)", GAME_NO_SOUND | GAME_NOT_WORKING )
3856GAME( 1997, magzun,    stvbios, stv, stv,  ic13,      ROT0,   "Sega",                    "Magical Zunou Power", GAME_NOT_WORKING )
37523857
37533858/*
37543859This is the known list of undumped ST-V games:
src/mame/drivers/megatech.c
r1386r1387
6868Ghouls & Ghosts         171-5869A   -                 610-0239-23          MPR-12605    (40 pins) MPR-12606    (40 pins) EPR-12368-23 (27256)
6969Super Hang On           171-5782    837-6963-24       610-0239-24          MPR-12640    (234000)  EPR-12368-24 (27256)   n/a
7070Forgotten Worlds        171-5782    837-6963-26       610-0239-26          MPR-12672-H  (Mask)    EPR-12368-26 (27256)   n/a
71Arnold Palmer Tour Golf 171-5782    837-6963-31       610-0239-31          MPR-12645F   (23C4000) EPR-12368-31 (27256)   n/a
7172Super Real Basket Ball  171-5782    837-6963-32       610-0239-32          MPR-12904F   (838200A) EPR-12368-32 (27256)   n/a
73Wrestle War             171-5782    837-6963-48       610-0239-48          MPR-14025-F  (23C4000) EPR-12368-48 (27256)   n/a
74Bonanza Bros.           171-5782    837-6963-49       610-0239-49          MPR-13905A-F (23C4000) EPR-12368-49 (27256)   n/a
75Mario Lemeux Hockey     171-5782    837-6963-59       610-0239-59          MPR-14376-H  (234000)  EPR-12368-59 (27256)   n/a
7276Sonic Hedgehog 2        171-6215A   837-6963-62       610-0239-62          MPR-15000A-F (838200)  EPR-12368-62 (27256)   n/a
73Mario Lemeux Hockey     171-5782    837-6963-59       610-0239-59          MPR-14376-H  (234000)  EPR-12368-59 (27256)   n/a
7477
7578
7679*/
r1386r1387
878881   MEGATECH_GAME49(REGION_USER1, REGION_USER2)
879882ROM_END
880883
884/* Game 48 - Wrestle War */
885
886#define MEGATECH_GAME48(GAME_REGION, INSTRUCTION_REGION) \
887   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
888   ROM_LOAD16_WORD_SWAP( "mpr-14025-f.ic1", 0x000000, 0x080000, CRC(26e899fe) SHA1(6d28e154ae2e4196097a2aa96c5acd5dfe7e3d2b) ) \
889    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
890   ROM_LOAD( "12368-48.ic2", 0x000000, 0x08000, CRC(25817bc2) SHA1(ba1bbb952aff12fb4d3ecfb10d82c54128439395) ) \
891
892ROM_START( mt_wwar ) /* Wrestle War */
893   MEGATECH_BIOS
894   MEGATECH_GAME48(REGION_USER1, REGION_USER2)
895ROM_END
896
881897/* Game 62 - Sonic 2 */
882898
883899#define MEGATECH_GAME62(GAME_REGION, INSTRUCTION_REGION) \
r1386r1387
12931309/* 45 */ // unknown
12941310/* 46 */ // unknown
12951311/* 47 */ GAME( 1990, mt_astrm, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Alien Storm (Mega-Tech", GAME_NOT_WORKING )
1296/* 48 */ // unknown
1312/* 48 */ GAME( 1991, mt_wwar,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Wrestle War (Mega-Tech)", GAME_NOT_WORKING ) /* Copyright 1989, 1991 Sega */
12971313/* 49 */ GAME( 1991, mt_bbros, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Bonanza Bros. (Mega-Tech)", GAME_NOT_WORKING )
12981314/* 50 */ // unknown
12991315/* 51 */ // unknown
r1386r1387
13091325/* 60 */ GAME( 1992, mt_kcham, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Kid Chameleon (Mega-Tech)", GAME_NOT_WORKING )
13101326/* 61 */ // unknown
13111327/* 62 */ GAME( 1992, mt_soni2, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega-Tech)", GAME_NOT_WORKING )
1312/*
1313    Known to Exist, but nn number currently not known:
1314    Wrestle War
1315*/
1328
13161329/* more? */
13171330
13181331/* Compilations to test multi-game support */
src/mame/drivers/vamphalf.c
r1386r1387
513513GFXDECODE_END
514514
515515
516static UINT8 suplup_default_nvram[128] = {
516static const UINT8 suplup_default_nvram[128] = {
517517   0xE8, 0xFE, 0xFF, 0xFF, 0x10, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x96, 0x2D, 0xB4, 0x80, 0x00,
518518   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
519519   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
r1386r1387
524524   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAA
525525};
526526
527static UINT8 misncrft_default_nvram[128] = {
527static const UINT8 misncrft_default_nvram[128] = {
528528   0x67, 0xBE, 0x00, 0x01, 0x80, 0xFE, 0x04, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
529529   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
530530   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
src/mame/drivers/vegaeo.c
r1386r1387
265265static DRIVER_INIT( vegaeo )
266266{
267267   init_eolith_speedup(machine);
268
269   at28c16_init( 0, NULL, NULL );
268270}
269271
270272GAME( 2002, crazywar, 0, vega, crazywar, vegaeo, ROT0, "Eolith", "Crazy War",  GAME_NO_SOUND )
src/mame/drivers/gridlee.c
r1386r1387
408408};
409409
410410
411static const char *sample_names[] =
411static const char *const sample_names[] =
412412{
413413   "*gridlee",
414414   "bounce1.wav",
r1386r1387
416416   0   /* end of array */
417417};
418418
419static struct Samplesinterface samples_interface =
419static const struct Samplesinterface samples_interface =
420420{
421421   8,   /* 8 channels */
422422   sample_names
src/mame/drivers/rallyx.c
r1386r1387
817817   REGION_SOUND1   /* memory region */
818818};
819819
820static const char *rallyx_sample_names[] =
820static const char *const rallyx_sample_names[] =
821821{
822822   "*rallyx",
823823   "bang.wav",
824824   0   /* end of array */
825825};
826826
827static struct Samplesinterface samples_interface =
827static const struct Samplesinterface samples_interface =
828828{
829829   1,   /* 1 channel */
830830   rallyx_sample_names
src/mame/drivers/unico.c
r1386r1387
642642}
643643
644644
645static struct EEPROM_interface zeropnt2_eeprom_interface =
645static const struct EEPROM_interface zeropnt2_eeprom_interface =
646646{
647647   7,            // address bits 7
648648   8,            // data bits    8
src/mame/drivers/segag80v.c
r1386r1387
812812 *
813813 *************************************/
814814
815static const char *elim_sample_names[] =
815static const char *const elim_sample_names[] =
816816{
817817   "*elim2",
818818   "elim1.wav",
r1386r1387
830830   0   /* end of array */
831831};
832832
833static struct Samplesinterface elim2_samples_interface =
833static const struct Samplesinterface elim2_samples_interface =
834834{
835835   8,   /* 8 channels */
836836   elim_sample_names
r1386r1387
844844 *
845845 *************************************/
846846
847static const char *spacfury_sample_names[] =
847static const char *const spacfury_sample_names[] =
848848{
849849   "*spacfury",
850850   /* Sound samples */
r1386r1387
862862};
863863
864864
865static struct Samplesinterface spacfury_samples_interface =
865static const struct Samplesinterface spacfury_samples_interface =
866866{
867867   8,   /* 8 channels */
868868   spacfury_sample_names
r1386r1387
875875 *
876876 *************************************/
877877
878static const char *zektor_sample_names[] =
878static const char *const zektor_sample_names[] =
879879{
880880   "*zektor",
881881   "elim1.wav",  /*  0 fireball */
r1386r1387
893893};
894894
895895
896static struct Samplesinterface zektor_samples_interface =
896static const struct Samplesinterface zektor_samples_interface =
897897{
898898   8,
899899   zektor_sample_names
src/mame/drivers/superchs.c
r1386r1387
374374   f3_68681_reset();
375375}
376376
377static struct EEPROM_interface superchs_eeprom_interface =
377static const struct EEPROM_interface superchs_eeprom_interface =
378378{
379379   6,            /* address bits */
380380   16,            /* data bits */
r1386r1387
385385   "0100110000",   /* lock command */
386386};
387387
388static UINT8 default_eeprom[128]={
388static const UINT8 default_eeprom[128]={
389389   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
390390   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x53,0x00,0x2e,0x00,0x43,0x00,0x00,
391391   0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0xff,0xff,0xff,0xff,0x00,0x01,
src/mame/drivers/astrocde.c
r1386r1387
11891189 *
11901190 *************************************/
11911191
1192static const char *seawolf_sample_names[] =
1192static const char *const seawolf_sample_names[] =
11931193{
11941194   "*seawolf",
11951195   "shiphit.wav",
r1386r1387
12001200   0
12011201};
12021202
1203static struct Samplesinterface seawolf2_samples_interface =
1203static const struct Samplesinterface seawolf2_samples_interface =
12041204{
12051205   10,   /* 5*2 channels */
12061206   seawolf_sample_names
12071207};
12081208
1209static struct Samplesinterface wow_samples_interface =
1209static const struct Samplesinterface wow_samples_interface =
12101210{
12111211   1,
12121212   wow_sample_names
12131213};
12141214
1215static struct Samplesinterface gorf_samples_interface =
1215static const struct Samplesinterface gorf_samples_interface =
12161216{
12171217   1,
12181218   gorf_sample_names
src/mame/drivers/galaga.c
r1386r1387
15991599   .25            /* Combined gain of both filters */
16001600};
16011601
1602static const char *battles_sample_names[] =
1602static const char *const battles_sample_names[] =
16031603{
16041604   "*battles",
16051605   "explo1.wav",   /* ground target explosion */
r1386r1387
16071607   0   /* end of array */
16081608};
16091609
1610static struct Samplesinterface battles_samples_interface =
1610static const struct Samplesinterface battles_samples_interface =
16111611{
16121612   1,   /* one channel */
16131613   battles_sample_names
src/mame/drivers/othunder.c
r1386r1387
316316bits are different.
317317******************************************************************/
318318
319static UINT8 default_eeprom[128]=
319static const UINT8 default_eeprom[128]=
320320{
321321   0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0,
322322   0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0,
r1386r1387
328328   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
329329};
330330
331static struct EEPROM_interface eeprom_interface =
331static const struct EEPROM_interface eeprom_interface =
332332{
333333   6,            /* address bits */
334334   16,            /* data bits */
src/mame/drivers/psikyo4.c
r1386r1387
160160   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_16x16x8, 0x000, 0x80 ) // 8bpp tiles
161161GFXDECODE_END
162162
163static struct EEPROM_interface eeprom_interface_93C56 =
163static const struct EEPROM_interface eeprom_interface_93C56 =
164164{
165165   8,      // address bits 8
166166   8,      // data bits    8
src/mame/drivers/jack.c
r1386r1387
12261226   ROM_LOAD( "lover.s0", 0x0000, 0x1000, CRC(ec38111c) SHA1(09efded9e905658bdbcde4ad4f0b4cb9585bdb33) )
12271227
12281228   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE ) /* gfx - 8x8x3bpp */
1229   ROM_LOAD( "lover.p1", 0x0000, 0x2000, CRC(cda0d87e) SHA1(efff230e994e21705902f252e50ee40a20444c0f) )
1229   ROM_LOAD( "lover.p3", 0x0000, 0x2000, CRC(1a519c8f) SHA1(36f546deaf36e8cd3bd113d84fd5e5f6e98d5de5) )
12301230   ROM_LOAD( "lover.p2", 0x2000, 0x2000, CRC(e465372f) SHA1(345b769ebc33f60daa9692b64e8ef43062552a33) )
1231   ROM_LOAD( "lover.p3", 0x4000, 0x2000, CRC(1a519c8f) SHA1(36f546deaf36e8cd3bd113d84fd5e5f6e98d5de5) )
1231   ROM_LOAD( "lover.p1", 0x4000, 0x2000, CRC(cda0d87e) SHA1(efff230e994e21705902f252e50ee40a20444c0f) )
12321232
1233   ROM_REGION( 0x100, REGION_PROMS, 0 ) /* colours - not from this board, from joinem */
1234   ROM_LOAD_NIB_LOW( "l82s129.11n", 0x0000, 0x100, BAD_DUMP CRC(7b724211) SHA1(7396c773e8d48dea856d9482d6c48de966616c83) )
1235   ROM_LOAD_NIB_HIGH( "h82s129.12n", 0x0000, 0x100, BAD_DUMP CRC(2e81c5ff) SHA1(e103c8813af704d5de11fe705de5105ff3a691c3) )
1233   ROM_REGION( 0x200, REGION_PROMS, 0 )
1234   ROM_LOAD_NIB_LOW( "color.n11", 0x0000, 0x200, CRC(cf4a16ae) SHA1(e17c5dfd73c5bc55c0a929cf65ee5b516c9776a5) )
1235   ROM_LOAD_NIB_HIGH( "color.n12", 0x0000, 0x200, CRC(4b11ac21) SHA1(d9e7cecfb7237335288ab6f94bb35696d8291bdf) )
12361236ROM_END
12371237
12381238
src/mame/drivers/route16.c
r1386r1387
575575};
576576
577577
578static struct SN76477interface sn76477_interface =
578static const struct SN76477interface sn76477_interface =
579579{
580580   RES_K(47),      /*  4  noise_res                    */
581581   RES_K(150),      /*  5  filter_res                   */
src/mame/drivers/polyplay.c
r1386r1387
113113
114114
115115/* Polyplay Sound Interface */
116static struct Samplesinterface polyplay_samples_interface =
116static const struct Samplesinterface polyplay_samples_interface =
117117{
118118   2,
119119   NULL,
src/mame/drivers/tx1.c
r1386r1387
808808       coin_counter_w(0,data & 0x80);
809809       coin_counter_w(1,data & 0x40);
810810}
811static ppi8255_interface tx1_ppi8255_intf =
811static const ppi8255_interface tx1_ppi8255_intf =
812812{
813813   1,
814814   { input_port_2_r },         /* Accelerator and brake */
r1386r1387
821821
822822
823823/* Buggy Boy (3-monitor) uses a 8255 instead of the YM2149 ports for inputs */
824static ppi8255_interface buggyboy_ppi8255_intf =
824static const ppi8255_interface buggyboy_ppi8255_intf =
825825{
826826   1,
827827   { input_port_2_r },
src/mame/drivers/merit.c
r1386r1387
769769   GFXDECODE_ENTRY( REGION_GFX2, 8, tiles8x8x1_layout, 0, 128 ) // flipped tiles
770770GFXDECODE_END
771771
772static ppi8255_interface ppi8255_intf =
772static const ppi8255_interface ppi8255_intf =
773773{
774774   2,                   /* 2 chips */
775775   { input_port_0_r, input_port_3_r },   /* Port A read */
src/mame/drivers/gotya.c
r1386r1387
146146GFXDECODE_END
147147
148148
149static const char *sample_names[] =
149static const char *const sample_names[] =
150150{                                    // Address triggered at
151151   "*thehand",
152152   "01.wav",   /* game start tune */         // 075f
r1386r1387
182182   0
183183};
184184
185static struct Samplesinterface samples_interface =
185static const struct Samplesinterface samples_interface =
186186{
187187   4,   /* 4 channels */
188188   sample_names
src/mame/drivers/toratora.c
r1386r1387
167167 *
168168 *************************************/
169169
170static struct SN76477interface sn76477_interface =
170static const struct SN76477interface sn76477_interface =
171171{
172172   RES_K(47),   /*  4 noise_res                */
173173//  RES_K(120), /*  5 filter_res               */
src/mame/drivers/meadows.c
r1386r1387
578578 *
579579 *************************************/
580580
581static struct Samplesinterface meadows_samples_interface =
581static const struct Samplesinterface meadows_samples_interface =
582582{
583583   2,
584584   NULL,
585585   meadows_sh_start
586586};
587587
588static const char *bowl3d_sample_names[] =
588static const char *const bowl3d_sample_names[] =
589589{
590590   "*bowl3d",
591591   "roll.wav",     /* "roll" */
r1386r1387
597597    0   /* end of array */
598598};
599599
600static struct Samplesinterface bowl3d_samples_interface =
600static const struct Samplesinterface bowl3d_samples_interface =
601601{
602602    1,   /* one channel */
603603   bowl3d_sample_names
src/mame/drivers/m72.c
r1386r1387
234234#define CRC_LEN 18
235235
236236/* Battle Chopper / Mr. Heli */
237static UINT8 bchopper_code[CODE_LEN] =
237static const UINT8 bchopper_code[CODE_LEN] =
238238{
239239   0x68,0x00,0xa0,            // push 0a000h
240240   0x1f,                  // pop ds
r1386r1387
258258   0xc6,0x06,0x70,0x16,0x77,   // mov [1670h], byte 077h
259259   0xea,0x68,0x01,0x40,0x00   // jmp  0040:$0168
260260};
261static UINT8 bchopper_crc[CRC_LEN] =  {   0x1a,0x12,0x5c,0x08, 0x84,0xb6,0x73,0xd1,
261static const UINT8 bchopper_crc[CRC_LEN] =  {   0x1a,0x12,0x5c,0x08, 0x84,0xb6,0x73,0xd1,
262262                                    0x54,0x91,0x94,0xeb, 0x00,0x00 };
263static UINT8 mrheli_crc[CRC_LEN] =     {   0x24,0x21,0x1f,0x14, 0xf9,0x28,0xfb,0x47,
263static const UINT8 mrheli_crc[CRC_LEN] =     {   0x24,0x21,0x1f,0x14, 0xf9,0x28,0xfb,0x47,
264264                                    0x4c,0x77,0x9e,0xc2, 0x00,0x00 };
265265
266266/* Ninja Spirit */
267static UINT8 nspirit_code[CODE_LEN] =
267static const UINT8 nspirit_code[CODE_LEN] =
268268{
269269   0x68,0x00,0xa0,            // push 0a000h
270270   0x1f,                  // pop ds
r1386r1387
288288   0xc6,0x06,0x71,0x16,0x00,   // mov [1671h], byte 000h
289289   0xea,0x00,0x00,0x40,0x00   // jmp  0040:$0000
290290};
291static UINT8 nspirit_crc[CRC_LEN] =   {   0xfe,0x94,0x6e,0x4e, 0xc8,0x33,0xa7,0x2d,
291static const UINT8 nspirit_crc[CRC_LEN] =   {   0xfe,0x94,0x6e,0x4e, 0xc8,0x33,0xa7,0x2d,
292292                                    0xf2,0xa3,0xf9,0xe1, 0xa9,0x6c,0x02,0x95, 0x00,0x00 };
293static UINT8 nspiritj_crc[CRC_LEN] =  {   0x26,0xa3,0xa5,0xe9, 0xc8,0x33,0xa7,0x2d,
293static const UINT8 nspiritj_crc[CRC_LEN] =  {   0x26,0xa3,0xa5,0xe9, 0xc8,0x33,0xa7,0x2d,
294294                                    0xf2,0xa3,0xf9,0xe1, 0xbc,0x6c,0x01,0x95, 0x00,0x00 };
295295
296296/* Image Fight */
297static UINT8 imgfight_code[CODE_LEN] =
297static const UINT8 imgfight_code[CODE_LEN] =
298298{
299299   0x68,0x00,0xa0,            // push 0a000h
300300   0x1f,                  // pop ds
r1386r1387
321321   0xc6,0x06,0xb0,0x1c,0x57,   // mov [1cb0h], byte 057h
322322   0xea,0x00,0x00,0x40,0x00   // jmp  0040:$0000
323323};
324static UINT8 imgfight_crc[CRC_LEN] =  {   0x7e,0xcc,0xec,0x03, 0x04,0x33,0xb6,0xc5,
324static const UINT8 imgfight_crc[CRC_LEN] =  {   0x7e,0xcc,0xec,0x03, 0x04,0x33,0xb6,0xc5,
325325                                    0xbf,0x37,0x92,0x94, 0x00,0x00 };
326326
327327/* Legend of Hero Tonma */
328static UINT8 loht_code[CODE_LEN] =
328static const UINT8 loht_code[CODE_LEN] =
329329{
330330   0x68,0x00,0xa0,            // push 0a000h
331331   0x1f,                  // pop ds
r1386r1387
346346   0xea,0x5d,0x01,0x40,0x00   // jmp  0040:$015d
347347
348348};
349static UINT8 loht_crc[CRC_LEN] =     {   0x39,0x00,0x82,0xae, 0x2c,0x9d,0x4b,0x73,
349static const UINT8 loht_crc[CRC_LEN] =     {   0x39,0x00,0x82,0xae, 0x2c,0x9d,0x4b,0x73,
350350                                    0xfb,0xac,0xd4,0x6d, 0x6d,0x5b,0x77,0xc0, 0x00,0x00 };
351351/* service mode crashes at the moment (119u2), so I can't add the CRCs for lohtj */
352352
353353/* X Multiply */
354static UINT8 xmultipl_code[CODE_LEN] =
354static const UINT8 xmultipl_code[CODE_LEN] =
355355{
356356   0xea,0x30,0x02,0x00,0x0e   // jmp  0e00:$0230
357357};
358static UINT8 xmultipl_crc[CRC_LEN] =  {   0x73,0x82,0x4e,0x3f, 0xfc,0x56,0x59,0x06,
358static const UINT8 xmultipl_crc[CRC_LEN] =  {   0x73,0x82,0x4e,0x3f, 0xfc,0x56,0x59,0x06,
359359                                    0x05,0x48,0xa8,0xf4, 0x00,0x00 };
360360
361361/* Dragon Breed */
362static UINT8 dbreed72_code[CODE_LEN] =
362static const UINT8 dbreed72_code[CODE_LEN] =
363363{
364364   0xea,0x6c,0x00,0x00,0x00   // jmp  0000:$006c
365365};
366static UINT8 dbreed72_crc[CRC_LEN] =     {   0xa4,0x96,0x5f,0xc0, 0xab,0x49,0x9f,0x19,
366static const UINT8 dbreed72_crc[CRC_LEN] =     {   0xa4,0x96,0x5f,0xc0, 0xab,0x49,0x9f,0x19,
367367                                    0x84,0xe6,0xd6,0xca, 0x00,0x00 };
368368
369369/* Air Duel */
370static UINT8 airduel_code[CODE_LEN] =
370static const UINT8 airduel_code[CODE_LEN] =
371371{
372372   0x68,0x00,0xd0,            // push 0d000h
373373   0x1f,                  // pop ds
r1386r1387
377377   0xc6,0x06,0xc0,0x1c,0x57,   // mov [1cc0h], byte 057h
378378   0xea,0x69,0x0b,0x00,0x00   // jmp  0000:$0b69
379379};
380static UINT8 airduel_crc[CRC_LEN] =     {   0x72,0x9c,0xca,0x85, 0xc9,0x12,0xcc,0xea,
380static const UINT8 airduel_crc[CRC_LEN] =     {   0x72,0x9c,0xca,0x85, 0xc9,0x12,0xcc,0xea,
381381                                    0x00,0x00 };
382382
383383/* Daiku no Gensan */
384static UINT8 dkgenm72_code[CODE_LEN] =
384static const UINT8 dkgenm72_code[CODE_LEN] =
385385{
386386   0xea,0x3d,0x00,0x00,0x10   // jmp  1000:$003d
387387};
388static UINT8 dkgenm72_crc[CRC_LEN] =  {   0xc8,0xb4,0xdc,0xf8, 0xd3,0xba,0x48,0xed,
388static const UINT8 dkgenm72_crc[CRC_LEN] =  {   0xc8,0xb4,0xdc,0xf8, 0xd3,0xba,0x48,0xed,
389389                                    0x79,0x08,0x1c,0xb3, 0x00,0x00 };
390390
391391
r1386r1387
416416      copy_le(&protection_ram[0x0fe0],protection_crc,CRC_LEN);
417417}
418418
419static void install_protection_handler(UINT8 *code,UINT8 *crc)
419static void install_protection_handler(const UINT8 *code,const UINT8 *crc)
420420{
421421   protection_ram = auto_malloc(0x1000);
422422   protection_code = code;
src/mame/drivers/stlforce.c
r1386r1387
7474UINT16 *stlforce_bg_videoram, *stlforce_mlow_videoram, *stlforce_mhigh_videoram, *stlforce_tx_videoram;
7575UINT16 *stlforce_bg_scrollram, *stlforce_mlow_scrollram, *stlforce_mhigh_scrollram, *stlforce_vidattrram;
7676UINT16 *stlforce_spriteram;
77static UINT8 *default_eeprom;
77static const UINT8 *default_eeprom;
7878extern int stlforce_sprxoffs;
7979
8080VIDEO_START( stlforce );
r1386r1387
197197   GFXDECODE_ENTRY( REGION_GFX2, 0, stlforce_splayout, 0, 256  )
198198GFXDECODE_END
199199
200static UINT8 stlforce_default_eeprom[128] = {
200static const UINT8 stlforce_default_eeprom[128] = {
201201   0x7e, 0x01, 0x00, 0x00, 0x01, 0x03, 0x05, 0x01, 0x01, 0x00, 0x4e, 0x20, 0x00, 0x00, 0x4a, 0x4d,
202202   0x42, 0x00, 0x02, 0x01, 0x4e, 0x20, 0x00, 0x00, 0x4d, 0x41, 0x43, 0x00, 0x02, 0x01, 0x00, 0x64,
203203   0x00, 0x00, 0x41, 0x41, 0x41, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x41, 0x41, 0x41, 0x00,
r1386r1387
208208   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
209209};
210210
211static UINT8 twinbrat_default_eeprom[128] = {
211static const UINT8 twinbrat_default_eeprom[128] = {
212212   0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03,
213213   0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
214214   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b,
src/mame/drivers/overdriv.c
r1386r1387
8383
8484***************************************************************************/
8585
86static UINT8 default_eeprom[128] =
86static const UINT8 default_eeprom[128] =
8787{
8888   0x77,0x58,0xFF,0xFF,0x00,0x78,0x90,0x00,0x00,0x78,0x70,0x00,0x00,0x78,0x50,0x00,
8989   0x54,0x41,0x4B,0x51,0x31,0x36,0x46,0x55,0x4A,0xFF,0x03,0x00,0x02,0x70,0x02,0x50,
r1386r1387
9696};
9797
9898
99static struct EEPROM_interface eeprom_interface =
99static const struct EEPROM_interface eeprom_interface =
100100{
101101   6,            /* address bits */
102102   16,            /* data bits */
src/mame/drivers/mario.c
r1386r1387
353353
354354
355355
356static const char *mario_sample_names[] =
356static const char *const mario_sample_names[] =
357357{
358358   "*mario",
359359
r1386r1387
371371    0   /* end of array */
372372};
373373
374static struct Samplesinterface samples_interface =
374static const struct Samplesinterface samples_interface =
375375{
376376   3,   /* 3 channels */
377377   mario_sample_names
src/mame/drivers/xmen.c
r1386r1387
3838static int init_eeprom_count;
3939
4040
41static struct EEPROM_interface eeprom_interface =
41static const struct EEPROM_interface eeprom_interface =
4242{
4343   7,            /* address bits */
4444   8,            /* data bits */
src/mame/drivers/lethal.c
r1386r1387
184184
185185/* Default Eeprom for the parent.. otherwise it will always complain first boot */
186186/* its easy to init but this saves me a bit of time.. */
187static UINT8 lethalen_default_eeprom[48] = {
187static const UINT8 lethalen_default_eeprom[48] = {
188188   0x02, 0x1E, 0x00, 0x00, 0x39, 0x31, 0x39, 0x31, 0x55, 0x45, 0x77, 0x00, 0x00, 0x00, 0x00, 0x01,
189189   0x02, 0x01, 0x00, 0x03, 0x05, 0x01, 0x01, 0x02, 0x28, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
190190   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
191191};
192192
193static struct EEPROM_interface eeprom_interface =
193static const struct EEPROM_interface eeprom_interface =
194194{
195195   7,         /* address bits */
196196   8,         /* data bits */
src/mame/drivers/gunbustr.c
r1386r1387
336336}
337337
338338
339static UINT8 default_eeprom[128]={
339static const UINT8 default_eeprom[128]={
340340   0x00,0x01,0x00,0x85,0x00,0xfd,0x00,0xff,0x00,0x67,0x00,0x02,0x00,0x00,0x00,0x7b,
341341   0x00,0xff,0x00,0xff,0x00,0x78,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
342342   0x01,0x01,0x00,0x00,0x01,0x02,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x10,0x00,0x00,
src/mame/drivers/taito_z.c
r1386r1387
943943                              EEPROM
944944******************************************************************/
945945
946static UINT8 default_eeprom[128]=
946static const UINT8 default_eeprom[128]=
947947{
948948   0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0,
949949   0x00,0x00,0x00,0xff,0x00,0x01,0x41,0x41,0x00,0x00,0x00,0xff,0x00,0x00,0xf0,0xf0,
r1386r1387
955955   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
956956};
957957
958static struct EEPROM_interface eeprom_interface =
958static const struct EEPROM_interface eeprom_interface =
959959{
960960   6,            /* address bits */
961961   16,            /* data bits */
src/mame/drivers/superqix.c
r1386r1387
862862
863863
864864
865static struct Samplesinterface pbillian_samples_interface =
865static const struct Samplesinterface pbillian_samples_interface =
866866{
867867   1,
868868   NULL,
src/mame/drivers/pntnpuzl.c
r1386r1387
124124#include "machine/eeprom.h"
125125
126126
127static struct EEPROM_interface eeprom_interface =
127static const struct EEPROM_interface eeprom_interface =
128128{
129129   6,            /* address bits */
130130   16,            /* data bits */
src/mame/drivers/gijoe.c
r1386r1387
5252static int init_eeprom_count;
5353static emu_timer *dmadelay_timer;
5454
55static struct EEPROM_interface eeprom_interface =
55static const struct EEPROM_interface eeprom_interface =
5656{
5757   7,            /* address bits */
5858   8,            /* data bits */
src/mame/drivers/wilytowr.c
r1386r1387
501501GFXDECODE_END
502502
503503
504static struct Samplesinterface fghtbskt_samples_interface =
504static const struct Samplesinterface fghtbskt_samples_interface =
505505{
506506   1,
507507   NULL,
src/mame/drivers/psikyosh.c
r1386r1387
279279
280280#define ROMTEST 1 /* Does necessary stuff to perform rom test, uses RAM as it doesn't dispose of GFX after decoding */
281281
282static UINT8 factory_eeprom[16]  = { 0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00 };
283static UINT8 daraku_eeprom[16]   = { 0x03,0x02,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
284static UINT8 s1945iii_eeprom[16] = { 0x00,0x00,0x00,0x00,0x00,0x01,0x11,0x70,0x25,0x25,0x25,0x00,0x01,0x00,0x11,0xe0 };
285static UINT8 dragnblz_eeprom[16] = { 0x00,0x01,0x11,0x70,0x25,0x25,0x25,0x00,0x01,0x00,0x11,0xe0,0x00,0x00,0x00,0x00 };
286static UINT8 gnbarich_eeprom[16] = { 0x00,0x0f,0x42,0x40,0x08,0x0a,0x00,0x00,0x01,0x06,0x42,0x59,0x00,0x00,0x00,0x00 };
287static UINT8 mjgtaste_eeprom[16] = { 0x00,0x00,0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00 };
282static const UINT8 factory_eeprom[16]  = { 0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00 };
283static const UINT8 daraku_eeprom[16]   = { 0x03,0x02,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
284static const UINT8 s1945iii_eeprom[16] = { 0x00,0x00,0x00,0x00,0x00,0x01,0x11,0x70,0x25,0x25,0x25,0x00,0x01,0x00,0x11,0xe0 };
285static const UINT8 dragnblz_eeprom[16] = { 0x00,0x01,0x11,0x70,0x25,0x25,0x25,0x00,0x01,0x00,0x11,0xe0,0x00,0x00,0x00,0x00 };
286static const UINT8 gnbarich_eeprom[16] = { 0x00,0x0f,0x42,0x40,0x08,0x0a,0x00,0x00,0x01,0x06,0x42,0x59,0x00,0x00,0x00,0x00 };
287static const UINT8 mjgtaste_eeprom[16] = { 0x00,0x00,0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00 };
288288
289289static int use_factory_eeprom;
290290
src/mame/drivers/darkhors.c
r1386r1387
197197
198198***************************************************************************/
199199
200static struct EEPROM_interface eeprom_interface =
200static const struct EEPROM_interface eeprom_interface =
201201{
202202   7,            // address bits 7
203203   8,            // data bits    8
src/mame/drivers/omegrace.c
r1386r1387
503503   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_VECTOR )
504504   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
505505   MDRV_SCREEN_SIZE(400, 300)
506   MDRV_SCREEN_VISIBLE_AREA(0, 1044, 0, 1024)
506   MDRV_SCREEN_VISIBLE_AREA(522, 1566, 522, 1566)
507507   MDRV_PALETTE_LENGTH(32768)
508508
509509   MDRV_VIDEO_START(dvg)
src/mame/drivers/mystwarr.c
r1386r1387
5454static INT32 init_eeprom_count;
5555static UINT8 mw_irq_control;
5656
57static struct EEPROM_interface eeprom_interface =
57static const struct EEPROM_interface eeprom_interface =
5858{
5959   7,         /* address bits */
6060   8,         /* data bits */
r1386r1387
6767
6868/* Gaiapolis and Polygonet Commanders use the ER5911,
6969   but the command formats are slightly different.  Why? */
70static struct EEPROM_interface eeprom_interface_gaia =
70static const struct EEPROM_interface eeprom_interface_gaia =
7171{
7272   7,         /* address bits */
7373   8,         /* data bits */
src/mame/drivers/segas16a.c
r1386r1387
183183 *
184184 *************************************/
185185
186static ppi8255_interface single_ppi_intf =
186static const ppi8255_interface single_ppi_intf =
187187{
188188   1,
189189   { NULL },
src/mame/drivers/segahang.c
r1386r1387
6262 *
6363 *************************************/
6464
65static ppi8255_interface hangon_ppi_intf =
65static const ppi8255_interface hangon_ppi_intf =
6666{
6767   2,
6868   { NULL,            NULL },
src/mame/drivers/statriv2.c
r1386r1387
6565/* Default NVram, we seem to need one or statriv2 crashes during attract
6666   attempting to display an unterminated message */
6767
68static UINT8 statriv2_default_eeprom[256] = {
68static const UINT8 statriv2_default_eeprom[256] = {
6969   0x24,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
7070   0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x11,0x00,
7171   0x00,0x00,0x00,0x00,0x01,0x02,0x01,0x05,0x00,0x00,0x11,0x49,0x41,0x41,0x00,0x00,
r1386r1387
8484   0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
8585};
8686
87static UINT8 quaquiz2_default_eeprom[256] = {
87static const UINT8 quaquiz2_default_eeprom[256] = {
8888   0x6f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8989   0x00,0x00,0x02,0x00,0x10,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0xa5,0x6e,0x03,0xff,
9090   0x50,0x03,0xff,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
src/mame/drivers/stvinit.c
r1386r1387
100100EEPROM write ffff to address 3e
101101EEPROM write ffff to address 3f
102102*/
103/*static UINT8 stv_default_eeprom[128] = {
103#if 0
104static const UINT8 stv_default_eeprom[128] = {
104105    0x53,0x45,0xff,0xff,0xff,0xff,0x3b,0xe2,
105106    0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,
106107    0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x08,
r1386r1387
117118    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
118119    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
119120    0xff,0xff,0xff,0xff
120};*/
121};
122#endif
121123
122static UINT8 shienryu_default_eeprom[128] = {
124static const UINT8 shienryu_default_eeprom[128] = {
123125   0x53,0x45,0x47,0x41,0x3b,0xe2,0x5e,0x09,
124126   0x5e,0x09,0x00,0x00,0x00,0x00,0x00,0x02,
125127   0x01,0x00,0x01,0x01,0x00,0x00,0x00,0x00,
r1386r1387
138140   0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
139141};
140142
141static UINT8 *stv_default_eeprom;
143static const UINT8 *stv_default_eeprom;
142144static int stv_default_eeprom_length;
143145
144146NVRAM_HANDLER( stv )
src/mame/drivers/gottlieb.c
r1386r1387
14311431GFXDECODE_END
14321432
14331433
1434static const char *reactor_sample_names[] =
1434static const char *const reactor_sample_names[] =
14351435{
14361436   "*reactor",
14371437   "fx_53.wav", /* "8 left" */
r1386r1387
14571457     0   /* end of array */
14581458};
14591459
1460static const char *qbert_sample_names[] =
1460static const char *const qbert_sample_names[] =
14611461{
14621462   "*qbert",
14631463   "fx_17a.wav", /* random speech, voice clock 255 */
r1386r1387
15081508   0   /* end of array */
15091509};
15101510
1511static struct Samplesinterface qbert_samples_interface =
1511static const struct Samplesinterface qbert_samples_interface =
15121512{
15131513    1,   /* one channel */
15141514   qbert_sample_names
15151515};
15161516
1517static struct Samplesinterface reactor_samples_interface =
1517static const struct Samplesinterface reactor_samples_interface =
15181518{
15191519   1,   /* one channel */
15201520   reactor_sample_names
src/mame/drivers/asterix.c
r1386r1387
2323static UINT8 cur_control2;
2424static int init_eeprom_count;
2525
26static struct EEPROM_interface eeprom_interface =
26static const struct EEPROM_interface eeprom_interface =
2727{
2828   7,            /* address bits */
2929   8,            /* data bits */
src/mame/drivers/exidy.c
r1386r1387
791791 *
792792 *************************************/
793793
794static const char *targ_sample_names[] =
794static const char *const targ_sample_names[] =
795795{
796796   "*targ",
797797   "expl.wav",
r1386r1387
803803};
804804
805805
806static struct Samplesinterface targ_samples_interface =
806static const struct Samplesinterface targ_samples_interface =
807807{
808808   4,   /* 3 Channels */
809809   targ_sample_names,
src/mame/drivers/imolagp.c
r1386r1387
510510   ROM_LOAD( "xe.bin", 0x3c00, 0x400, CRC(e0e81120) SHA1(14a77dfd069be342df4dbb1b747443c6d121d3fe) ) // ? car+misc
511511ROM_END
512512
513static ppi8255_interface ppi8255_intf =
513static const ppi8255_interface ppi8255_intf =
514514{
515515   1,          /* 1 chips */
516516   {0},      /* Port A read */
src/mame/drivers/moo.c
r1386r1387
6060static UINT16 cur_control2;
6161
6262
63static struct EEPROM_interface eeprom_interface =
63static const struct EEPROM_interface eeprom_interface =
6464{
6565   7,         /* address bits */
6666   8,         /* data bits */
src/mame/drivers/eolith16.c
r1386r1387
1818static int vbuffer = 0;
1919
2020// It's configured for 512 bytes
21static struct EEPROM_interface eeprom_interface_93C66 =
21static const struct EEPROM_interface eeprom_interface_93C66 =
2222{
2323   9,            // address bits 9
2424   8,            // data bits    8
src/mame/drivers/groundfx.c
r1386r1387
115115                EPROM
116116**********************************************************/
117117
118static UINT8 default_eeprom[128]=
118static const UINT8 default_eeprom[128]=
119119{
120120   0x02,0x01,0x11,0x12,0x01,0x01,0x01,0x00,0x80,0x80,0x30,0x01,0x00,0x00,0x62,0x45,
121121   0xe0,0xa0,0xff,0x28,0xff,0xff,0xfa,0xd7,0x33,0x28,0x00,0x00,0x33,0x28,0x00,0x00,
src/mame/drivers/vendetta.c
r1386r1387
112112static int init_eeprom_count;
113113
114114
115static struct EEPROM_interface eeprom_interface =
115static const struct EEPROM_interface eeprom_interface =
116116{
117117   7,            /* address bits */
118118   8,            /* data bits */
src/mame/drivers/homerun.c
r1386r1387
3434static WRITE8_HANDLER(pb_w){homerun_xpb=data;}
3535static WRITE8_HANDLER(pc_w){homerun_xpc=data;}
3636
37static ppi8255_interface ppi8255_intf =
37static const ppi8255_interface ppi8255_intf =
3838{
3939   1,
4040   { 0 },
src/mame/drivers/mcr.c
r1386r1387
14781478 *
14791479 *************************************/
14801480
1481static const char *journey_sample_names[] =
1481static const char *const journey_sample_names[] =
14821482{
14831483   "*journey",
14841484   "sepways.wav",
14851485   0
14861486};
14871487
1488static struct Samplesinterface journey_samples_interface =
1488static const struct Samplesinterface journey_samples_interface =
14891489{
14901490   1,
14911491   journey_sample_names
src/mame/drivers/cave.c
r1386r1387
292292
293293***************************************************************************/
294294
295static UINT8 cave_default_eeprom_type1[16] =   {0x00,0x0C,0x11,0x0D,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x11,0x11,0xFF,0xFF,0xFF,0xFF};  /* DFeveron, Guwange */
296static UINT8 cave_default_eeprom_type1feversos[18] =   {0x00,0x0C,0x16,0x27,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x11,0x11,0xFF,0xFF,0xFF,0xFF,0x05,0x19};  /* Fever SOS (code checks for the 0x0519 or it won't boot) */
297static UINT8 cave_default_eeprom_type2[16] =   {0x00,0x0C,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};  /* Esprade, DonPachi, DDonPachi */
298static UINT8 cave_default_eeprom_type3[16] =   {0x00,0x03,0x08,0x00,0xFF,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF};  /* UoPoko */
299static UINT8 cave_default_eeprom_type4[16] =   {0xF3,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};  /* Hotdog Storm */
300static UINT8 cave_default_eeprom_type5[16] =   {0xED,0xFF,0x00,0x00,0x12,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};  /* Mazinger Z (6th byte is country code) */
301static UINT8 cave_default_eeprom_type6[18] =   {0xa5,0x00,0xa5,0x00,0xa5,0x00,0xa5,0x00,0xa5,0x01,0xa5,0x01,0xa5,0x04,0xa5,0x01,0xa5,0x02};   /* Sailor Moon (last byte is country code) */
295static const UINT8 cave_default_eeprom_type1[16] =   {0x00,0x0C,0x11,0x0D,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x11,0x11,0xFF,0xFF,0xFF,0xFF};  /* DFeveron, Guwange */
296static const UINT8 cave_default_eeprom_type1feversos[18] =   {0x00,0x0C,0x16,0x27,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x11,0x11,0xFF,0xFF,0xFF,0xFF,0x05,0x19};  /* Fever SOS (code checks for the 0x0519 or it won't boot) */
297static const UINT8 cave_default_eeprom_type2[16] =   {0x00,0x0C,0xFF,0xFB,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};  /* Esprade, DonPachi, DDonPachi */
298static const UINT8 cave_default_eeprom_type3[16] =   {0x00,0x03,0x08,0x00,0xFF,0xFF,0xFF,0xFF,0x08,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF};  /* UoPoko */
299static const UINT8 cave_default_eeprom_type4[16] =   {0xF3,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};  /* Hotdog Storm */
300static const UINT8 cave_default_eeprom_type5[16] =   {0xED,0xFF,0x00,0x00,0x12,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};  /* Mazinger Z (6th byte is country code) */
301static const UINT8 cave_default_eeprom_type6[18] =   {0xa5,0x00,0xa5,0x00,0xa5,0x00,0xa5,0x00,0xa5,0x01,0xa5,0x01,0xa5,0x04,0xa5,0x01,0xa5,0x02};   /* Sailor Moon (last byte is country code) */
302302// Air Gallet. Byte 1f is the country code (0==JAPAN,U.S.A,EUROPE,HONGKONG,TAIWAN,KOREA)
303static UINT8 cave_default_eeprom_type7[48] =   {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
303static const UINT8 cave_default_eeprom_type7[48] =   {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
304304                                     0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
305305                                     0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff};
306306
307static UINT8 *cave_default_eeprom;
307static const UINT8 *cave_default_eeprom;
308308static int cave_default_eeprom_length;
309309static int cave_region_byte;
310310
src/mame/drivers/pirates.c
r1386r1387
103103
104104
105105
106static struct EEPROM_interface eeprom_interface =
106static const struct EEPROM_interface eeprom_interface =
107107{
108108   6,            /* address bits */
109109   16,            /* data bits */
src/mame/drivers/tankbatt.c
r1386r1387
257257
258258
259259
260static const char *tankbatt_sample_names[] =
260static const char *const tankbatt_sample_names[] =
261261{
262262   "*tankbatt",
263263   "fire.wav",
r1386r1387
267267    0   /* end of array */
268268};
269269
270static struct Samplesinterface samples_interface =
270static const struct Samplesinterface samples_interface =
271271{
272272   3,   /* 3 channels */
273273   tankbatt_sample_names
src/tools/src2html.c
r1386r1387
6767};
6868
6969
70typedef struct _list_entry list_entry;
71struct _list_entry
72{
73   list_entry *   next;
74   const astring *   name;
75};
7076
77
78
7179/***************************************************************************
7280    GLOBAL VARIABLES
7381***************************************************************************/
r1386r1387
246254    CORE OUTPUT FUNCTIONS
247255***************************************************************************/
248256
257static int compare_list_entries(const void *p1, const void *p2)
258{
259   const list_entry *entry1 = *(const list_entry **)p1;
260   const list_entry *entry2 = *(const list_entry **)p2;
261   return strcmp(astring_c(entry1->name), astring_c(entry2->name));
262}
263
264
249265/*-------------------------------------------------
250266    recurse_dir - recurse through a directory
251267-------------------------------------------------*/
r1386r1387
281297   {
282298      osd_dir_entry_type entry_type = typelist[entindex];
283299      const osd_directory_entry *entry;
300      list_entry *list = NULL;
301      list_entry **listarray;
302      list_entry *curlist;
284303      osd_directory *dir;
285304      int found = 0;
286305
r1386r1387
292311         goto error;
293312      }
294313
295      /* iterate through each file */
296      while ((entry = osd_readdir(dir)) != NULL && result == 0)
314      /* build up the list of files */
315      while ((entry = osd_readdir(dir)) != NULL)
297316         if (entry->type == entry_type && entry->name[0] != '.')
298317         {
299            astring *srcfile, *dstfile;
318            list_entry *lentry = malloc(sizeof(*lentry));
319            lentry->name = astring_dupc(entry->name);
320            lentry->next = list;
321            list = lentry;
322            found++;
323         }
300324
301            /* add a header */
302            if (++found == 1)
303               core_fprintf(indexfile, "\t<h2>%s</h2>\n\t<ul>\n", (entry_type == ENTTYPE_DIR) ? "Directories" : "Files");
325      /* close the directory */
326      osd_closedir(dir);
304327
305            /* build the source filename */
306            srcfile = astring_alloc();
307            astring_printf(srcfile, "%s%c%s", astring_c(srcdir), PATH_SEPARATOR[0], entry->name);
328      /* skip if nothing found */
329      if (found == 0)
330         continue;
308331
309            /* if we have a file, output it */
310            dstfile = astring_alloc();
311            if (entry->type == ENTTYPE_FILE)
312            {
313               file_type type = FILE_TYPE_INVALID;
314               int extnum;
332      /* allocate memory for sorting */
333      listarray = malloc(sizeof(list_entry *) * found);
334      found = 0;
335      for (curlist = list; curlist != NULL; curlist = curlist->next)
336         listarray[found++] = curlist;
315337
316               /* make sure we care, first */
317               for (extnum = 0; extnum < ARRAY_LENGTH(extension_lookup); extnum++)
318                  if (core_filename_ends_with(entry->name, extension_lookup[extnum].extension))
319                  {
320                     type = extension_lookup[extnum].type;
321                     break;
322                  }
338      /* sort the list */
339      qsort(listarray, found, sizeof(listarray[0]), compare_list_entries);
323340
324               /* if we got a valid file, process it */
325               if (type != FILE_TYPE_INVALID)
341      /* rebuild the list */
342      list = NULL;
343      while (--found >= 0)
344      {
345         listarray[found]->next = list;
346         list = listarray[found];
347      }
348
349      /* iterate through each file */
350      for (curlist = list; curlist != NULL && result == 0; curlist = curlist->next)
351      {
352         astring *srcfile, *dstfile;
353
354         /* add a header */
355         if (curlist == list)
356            core_fprintf(indexfile, "\t<h2>%s</h2>\n\t<ul>\n", (entry_type == ENTTYPE_DIR) ? "Directories" : "Files");
357
358         /* build the source filename */
359         srcfile = astring_alloc();
360         astring_printf(srcfile, "%s%c%s", astring_c(srcdir), PATH_SEPARATOR[0], astring_c(curlist->name));
361
362         /* if we have a file, output it */
363         dstfile = astring_alloc();
364         if (entry_type == ENTTYPE_FILE)
365         {
366            file_type type = FILE_TYPE_INVALID;
367            int extnum;
368
369            /* make sure we care, first */
370            for (extnum = 0; extnum < ARRAY_LENGTH(extension_lookup); extnum++)
371               if (core_filename_ends_with(astring_c(curlist->name), extension_lookup[extnum].extension))
326372               {
327                  astring_printf(dstfile, "%s%c%s.html", astring_c(dstdir), PATH_SEPARATOR[0], entry->name);
328                  if (indexfile != NULL)
329                     core_fprintf(indexfile, "\t<li><a href=\"%s.html\">%s</a></li>\n", entry->name, entry->name);
330                  result = output_file(type, srcrootlen, dstrootlen, srcfile, dstfile);
373                  type = extension_lookup[extnum].type;
374                  break;
331375               }
332            }
333376
334            /* if we have a directory, recurse */
335            else
377            /* if we got a valid file, process it */
378            if (type != FILE_TYPE_INVALID)
336379            {
337               astring_printf(dstfile, "%s%c%s", astring_c(dstdir), PATH_SEPARATOR[0], entry->name);
380               astring_printf(dstfile, "%s%c%s.html", astring_c(dstdir), PATH_SEPARATOR[0], astring_c(curlist->name));
338381               if (indexfile != NULL)
339                  core_fprintf(indexfile, "\t<li><a href=\"%s/index.html\">%s/</a></li>\n", entry->name, entry->name);
340               result = recurse_dir(srcrootlen, dstrootlen, srcfile, dstfile);
382                  core_fprintf(indexfile, "\t<li><a href=\"%s.html\">%s</a></li>\n", astring_c(curlist->name), astring_c(curlist->name));
383               result = output_file(type, srcrootlen, dstrootlen, srcfile, dstfile);
341384            }
385         }
342386
343            /* free memory for the names */
344            astring_free(srcfile);
345            astring_free(dstfile);
387         /* if we have a directory, recurse */
388         else
389         {
390            astring_printf(dstfile, "%s%c%s", astring_c(dstdir), PATH_SEPARATOR[0], astring_c(curlist->name));
391            if (indexfile != NULL)
392               core_fprintf(indexfile, "\t<li><a href=\"%s/index.html\">%s/</a></li>\n", astring_c(curlist->name), astring_c(curlist->name));
393            result = recurse_dir(srcrootlen, dstrootlen, srcfile, dstfile);
346394         }
347395
396         /* free memory for the names */
397         astring_free(srcfile);
398         astring_free(dstfile);
399      }
400
348401      /* close the list if we found some stuff */
349      if (found > 0)
402      if (list != NULL)
350403         core_fprintf(indexfile, "\t</ul>\n");
351404
352      /* close the directory */
353      osd_closedir(dir);
405      /* free all the allocated entries */
406      while (list != NULL)
407      {
408         list_entry *next = list->next;
409         astring_free((astring *)list->name);
410         free(list);
411         list = next;
412      }
354413   }
355414
356415error:
src/osd/windows/winprefix.h
r1386r1387
2626#ifdef _MSC_VER
2727void *__cdecl _alloca(size_t);
2828#define alloca _alloca
29#if _MSC_VER < 1400
29#if _MSC_VER < 1500
3030#define vsnprintf _vsnprintf
3131#endif
3232#endif
src/osd/windows/drawd3d.c
r1386r1387
207207//  INLINES
208208//============================================================
209209
210INLINE BOOL GetClientRectExceptMenu(HWND hWnd, PRECT pRect, BOOL fullscreen)
211{
212   static HMENU last_menu;
213   static RECT last_rect;
214   static RECT cached_rect;
215   HMENU menu = GetMenu(hWnd);
216   BOOL result = GetClientRect(hWnd, pRect);
217
218   if (!fullscreen || !menu)
219      return result;
220
221   // to avoid flicker use cache if we can use
222   if (last_menu != menu || memcmp(&last_rect, pRect, sizeof *pRect) != 0)
223   {
224      last_menu = menu;
225      last_rect = *pRect;
226
227      SetMenu(hWnd, NULL);
228      result = GetClientRect(hWnd, &cached_rect);
229      SetMenu(hWnd, menu);
230   }
231
232   *pRect = cached_rect;
233   return result;
234}
235
236
210237INLINE UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr)
211238{
212239   /* original equations:
r1386r1387
535562   d3d_info *d3d = window->drawdata;
536563   RECT client;
537564
538   GetClientRect(window->hwnd, &client);
565   GetClientRectExceptMenu(window->hwnd, &client, window->fullscreen);
539566   if (rect_width(&client) > 0 && rect_height(&client) > 0)
540567   {
541568      render_target_set_bounds(window->target, rect_width(&client), rect_height(&client), winvideo_monitor_get_aspect(window->monitor));
r1386r1387
706733   d3d->presentation.MultiSampleType            = D3DMULTISAMPLE_NONE;
707734   d3d->presentation.SwapEffect               = D3DSWAPEFFECT_DISCARD;
708735   d3d->presentation.hDeviceWindow               = window->hwnd;
709   d3d->presentation.Windowed                  = !window->fullscreen || HAS_WINDOW_MENU;
736   d3d->presentation.Windowed                  = (!video_config.switchres || !window->fullscreen) || HAS_WINDOW_MENU;
710737   d3d->presentation.EnableAutoDepthStencil      = FALSE;
711738   d3d->presentation.AutoDepthStencilFormat      = D3DFMT_D16;
712739   d3d->presentation.Flags                     = 0;
r1386r1387
11121139      RECT client;
11131140
11141141      // bounds are from the window client rect
1115      GetClientRect(window->hwnd, &client);
1142      GetClientRectExceptMenu(window->hwnd, &client, window->fullscreen);
11161143      d3d->width = client.right - client.left;
11171144      d3d->height = client.bottom - client.top;
11181145
r1386r1387
12911318   RECT client;
12921319
12931320   // get the current window bounds
1294   GetClientRect(window->hwnd, &client);
1321   GetClientRectExceptMenu(window->hwnd, &client, window->fullscreen);
12951322
12961323   // if we have a device and matching width/height, nothing to do
12971324   if (d3d->device != NULL && rect_width(&client) == d3d->width && rect_height(&client) == d3d->height)
src/emu/cpu/m6805/m6805.c
r1386r1387
121121#define SET_H(a,b,r)   CC|=((a^b^r)&0x10)
122122#define SET_C8(a)      CC|=((a&0x100)>>8)
123123
124static UINT8 flags8i[256]=    /* increment */
124static const UINT8 flags8i[256]=    /* increment */
125125{
1261260x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1271270x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
r1386r1387
1401400x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
1411410x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04
142142};
143static UINT8 flags8d[256]= /* decrement */
143static const UINT8 flags8d[256]= /* decrement */
144144{
1451450x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1461460x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
src/emu/cpu/m6805/6805dasm.c
r1386r1387
3838   tstx,   txa
3939};
4040
41static const char *op_name_str[] = {
41static const char *const op_name_str[] = {
4242   "adca", "adda", "anda", "asl",  "asla", "aslx", "asr",  "asra",
4343   "asrx", "bcc",  "bclr", "bcs",  "beq",  "bhcc", "bhcs", "bhi",
4444   "bih",  "bil",  "bita", "bls",  "bmc",  "bmi",  "bms",  "bne",
r1386r1387
120120};
121121
122122#if 0
123static char *opcode_strings[0x0100] =
123static const char *const opcode_strings[0x0100] =
124124{
125125   "brset0",    "brclr0",    "brset1",    "brclr1",    "brset2",    "brclr2",   "brset3",   "brclr3",      /*00*/
126126   "brset4",   "brclr4",   "brset5",   "brclr5",   "brset6",   "brclr6",   "brset7",   "brclr7",
src/emu/cpu/v30mz/v30mz.c
r1386r1387
925925
926926static void nec_init(int index, int clock, const void *config, int (*irqcallback)(int), int type)
927927{
928   static const char *names[]={"V20","V30","V33","V30MZ"};
928   static const char *const names[]={"V20","V30","V33","V30MZ"};
929929
930930   state_save_register_item_array(names[type], index, I.regs.w);
931931   state_save_register_item_array(names[type], index, I.sregs);
src/emu/cpu/lh5801/5801dasm.c
r1386r1387
5454   P, S
5555} Regs;
5656
57static const char *RegNames[]= {
57static const char *const RegNames[]= {
5858   0, "A", "XL", "XH", "X", "YL", "YH", "Y", "UL", "UH", "U", "P", "S"
5959};
6060
r1386r1387
9292   RPV, SPV,// flip flop pv off
9393} Ins;
9494
95static const char *InsNames[]={
95static const char *const InsNames[]={
9696   "ILL", "ILL", 0, "NOP",
9797   "LDA", "STA", "LDI", "LDX", "STX",
9898   "LDE", "SDE", "LIN", "SIN",
src/emu/cpu/m6809/m6809.c
r1386r1387
258258#define SET_V8(a,b,r)   CC|=(((a^b^r^(r>>1))&0x80)>>6)
259259#define SET_V16(a,b,r)   CC|=(((a^b^r^(r>>1))&0x8000)>>14)
260260
261static UINT8 flags8i[256]=    /* increment */
261static const UINT8 flags8i[256]=    /* increment */
262262{
263263CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2642640x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
r1386r1387
277277CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,
278278CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N
279279};
280static UINT8 flags8d[256]= /* decrement */
280static const UINT8 flags8d[256]= /* decrement */
281281{
282282CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2832830x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
r1386r1387
360360
361361#if (!BIG_SWITCH)
362362/* timings for 1-byte opcodes */
363static UINT8 cycles1[] =
363static const UINT8 cycles1[] =
364364{
365365   /*   0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F */
366366  /*0*/  6, 0, 0, 6, 6, 0, 6, 6, 6, 6, 6, 0, 6, 6, 3, 6,
src/emu/cpu/m6809/6809dasm.c
r1386r1387
354354   sizeof(m6809_pg2opcodes) / sizeof(m6809_pg2opcodes[0])
355355};
356356
357static const char *m6809_regs[5] = { "X", "Y", "U", "S", "PC" };
357static const char *const m6809_regs[5] = { "X", "Y", "U", "S", "PC" };
358358
359static const char *m6809_regs_te[16] =
359static const char *const m6809_regs_te[16] =
360360{
361361   "D", "X",  "Y",  "U",   "S",  "PC", "inv", "inv",
362362   "A", "B", "CC", "DP", "inv", "inv", "inv", "inv"
src/emu/cpu/h83002/h8disasm.c
r1386r1387
1111#include "debugger.h"
1212#include "h83002.h"
1313
14static const char *bit_instr[8] = {"bset", "bnot", "bclr", "btst", "bor", "bxor", "band", "bld"};
15static const char *bit_instr2[8] = {"bset", "bnot", "bclr", "btst", "bior", "bixor", "biand", "bild"};
16static const char *imm32l_instr[8] = {"mov", "add", "cmp", "sub", "or", "xor", "and", "?"};
17static const char *branch_instr[16] = {"bt", "bf", "bhi", "bls", "bcc", "bcs", "bne", "beq", "bvc", "bvs", "bpl", "bmi", "bge", "blt", "bgt", "ble"};
18static const char *reg_names32[8] = {"ER0", "ER1", "ER2", "ER3", "ER4", "ER5", "ER6", "SP"};
19static const char *reg_names16[16] = {"R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7"};
20static const char *reg_names8[16] = {"R0H", "R1H", "R2H", "R3H", "R4H", "R5H", "R6H", "R7H","R0L", "R1L", "R2L", "R3L", "R4L", "R5L", "R6L", "R7L"};
14static const char *const bit_instr[8] = {"bset", "bnot", "bclr", "btst", "bor", "bxor", "band", "bld"};
15static const char *const bit_instr2[8] = {"bset", "bnot", "bclr", "btst", "bior", "bixor", "biand", "bild"};
16static const char *const imm32l_instr[8] = {"mov", "add", "cmp", "sub", "or", "xor", "and", "?"};
17static const char *const branch_instr[16] = {"bt", "bf", "bhi", "bls", "bcc", "bcs", "bne", "beq", "bvc", "bvs", "bpl", "bmi", "bge", "blt", "bgt", "ble"};
18static const char *const reg_names32[8] = {"ER0", "ER1", "ER2", "ER3", "ER4", "ER5", "ER6", "SP"};
19static const char *const reg_names16[16] = {"R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7"};
20static const char *const reg_names8[16] = {"R0H", "R1H", "R2H", "R3H", "R4H", "R5H", "R6H", "R7H","R0L", "R1L", "R2L", "R3L", "R4L", "R5L", "R6L", "R7L"};
2121
2222static UINT32 h8disasm_0(UINT32 address, UINT32 opcode, char *output, const UINT8 *oprom);
2323static UINT32 h8disasm_1(UINT32 address, UINT32 opcode, char *output, const UINT8 *oprom);
src/emu/cpu/z80gb/z80gbd.c
r1386r1387
3333   zSTOP, zSUB,  zXOR,  zSWAP
3434};
3535
36static const char *s_mnemonic[] =
36static const char *const s_mnemonic[] =
3737{
3838   "adc", "add", "and", "bit", "call","ccf", "cp",
3939   "cpl", "daa", "db",  "dec", "di",  "ei",  "halt",
r1386r1387
6363   const char *arguments;
6464}   z80gbdasm;
6565
66static z80gbdasm mnemonic_cb[256] = {
66static const z80gbdasm mnemonic_cb[256] = {
6767   {zRLC,"b"},     {zRLC,"c"},     {zRLC,"d"},     {zRLC,"e"},
6868   {zRLC,"h"},     {zRLC,"l"},     {zRLC,"(hl)"},  {zRLC,"a"},
6969   {zRRC,"b"},     {zRRC,"c"},     {zRRC,"d"},     {zRRC,"e"},
r1386r1387
130130   {zSET,"7,h"},   {zSET,"7,l"},   {zSET,"7,(hl)"},{zSET,"7,a"}
131131};
132132
133static z80gbdasm mnemonic_main[256]= {
133static const z80gbdasm mnemonic_main[256]= {
134134   {zNOP,0},      {zLD,"bc,N"},   {zLD,"(bc),a"}, {zINC,"bc"},
135135   {zINC,"b"},     {zDEC,"b"},     {zLD,"b,B"},    {zRLCA,0},
136136   {zLD,"(W),sp"}, {zADD,"hl,bc"}, {zLD,"a,(bc)"}, {zDEC,"bc"},
r1386r1387
203203
204204unsigned z80gb_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram )
205205{
206   z80gbdasm *d;
206   const z80gbdasm *d;
207207   const char *symbol, *src;
208208   char *dst;
209209   INT8 offset = 0;
src/emu/cpu/z80gb/z80gb.c
r1386r1387
131131/* Nr of cycles to run */
132132static int z80gb_ICount;
133133
134static int Cycles[256] =
134static const int Cycles[256] =
135135{
136136    4,12, 8, 8, 4, 4, 8, 4,20, 8, 8, 8, 4, 4, 8, 4,
137137    4,12, 8, 8, 4, 4, 8, 4,12, 8, 8, 8, 4, 4, 8, 4,
r1386r1387
151151   12,12, 8, 4, 4,16, 8,16,12, 8,16, 4, 4, 4, 8,16
152152};
153153
154static int CyclesCB[256] =
154static const int CyclesCB[256] =
155155{
156156    8, 8, 8, 8, 8, 8,16, 8, 8, 8, 8, 8, 8, 8,16, 8,
157157    8, 8, 8, 8, 8, 8,16, 8, 8, 8, 8, 8, 8, 8,16, 8,
src/emu/cpu/tms34010/dis34010.c
r1386r1387
99#include "34010dsm.c"
1010
1111
12static char *Options[]=
12static const char *const Options[]=
1313{
1414   "begin","end","offset",0
1515};
src/emu/cpu/tms34010/34010tbl.c
r1386r1387
394394
395395
396396/* Opcode Table */
397static void (*opcode_table[65536 >> 4])(void) =
397static void (*const opcode_table[65536 >> 4])(void) =
398398{
399399   /* 0x0000 0x0010 0x0020 0x0030 ... 0x00f0 */
400400   unimpl,      unimpl,      rev_a,      rev_b,      idle,      unimpl,      unimpl,      unimpl,
src/emu/cpu/tms34010/tms34010.c
r1386r1387
825825    PIXEL OPS
826826***************************************************************************/
827827
828static void (*pixel_write_ops[4][5])(offs_t offset,UINT32 data) =
828static void (*const pixel_write_ops[4][5])(offs_t offset,UINT32 data) =
829829{
830830   { write_pixel_1,     write_pixel_2,     write_pixel_4,     write_pixel_8,     write_pixel_16     },
831831   { write_pixel_r_1,   write_pixel_r_2,   write_pixel_r_4,   write_pixel_r_8,   write_pixel_r_16   },
r1386r1387
833833   { write_pixel_r_t_1, write_pixel_r_t_2, write_pixel_r_t_4, write_pixel_r_t_8, write_pixel_r_t_16 }
834834};
835835
836static UINT32 (*pixel_read_ops[5])(offs_t offset) =
836static UINT32 (*const pixel_read_ops[5])(offs_t offset) =
837837{
838838   read_pixel_1,        read_pixel_2,      read_pixel_4,      read_pixel_8,      read_pixel_16
839839};
r1386r1387
876876    RASTER OPS
877877***************************************************************************/
878878
879static INT32 (*raster_ops[32]) (INT32 newpix, INT32 oldpix) =
879static INT32 (*const raster_ops[32]) (INT32 newpix, INT32 oldpix) =
880880{
881881              0, raster_op_1 , raster_op_2 , raster_op_3,
882882   raster_op_4 , raster_op_5 , raster_op_6 , raster_op_7,
r1386r1387
11201120    I/O REGISTER WRITES
11211121***************************************************************************/
11221122
1123static const char *ioreg_name[] =
1123static const char *const ioreg_name[] =
11241124{
11251125   "HESYNC", "HEBLNK", "HSBLNK", "HTOTAL",
11261126   "VESYNC", "VEBLNK", "VSBLNK", "VTOTAL",
r1386r1387
12471247}
12481248
12491249
1250static const char *ioreg020_name[] =
1250static const char *const ioreg020_name[] =
12511251{
12521252   "VESYNC", "HESYNC", "VEBLNK", "HEBLNK",
12531253   "VSBLNK", "HSBLNK", "VTOTAL", "HTOTAL",
src/emu/cpu/tms34010/34010gfx.c
r1386r1387
251251static UINT32 pixel_op20(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { dstpix &= mask; return (srcpix > dstpix) ? srcpix : dstpix; }
252252static UINT32 pixel_op21(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { dstpix &= mask; return (srcpix < dstpix) ? srcpix : dstpix; }
253253
254static UINT32 (*pixel_op_table[])(UINT32, UINT32, UINT32) =
254static UINT32 (*const pixel_op_table[])(UINT32, UINT32, UINT32) =
255255{
256256   pixel_op00,   pixel_op01,   pixel_op02,   pixel_op03,   pixel_op04,   pixel_op05,   pixel_op06,   pixel_op07,
257257   pixel_op08,   pixel_op09,   pixel_op10,   pixel_op11,   pixel_op12,   pixel_op13,   pixel_op14,   pixel_op15,
258258   pixel_op16,   pixel_op17,   pixel_op18,   pixel_op19,   pixel_op20,   pixel_op21,   pixel_op00,   pixel_op00,
259259   pixel_op00,   pixel_op00,   pixel_op00,   pixel_op00,   pixel_op00,   pixel_op00,   pixel_op00,   pixel_op00
260260};
261static UINT8 pixel_op_timing_table[] =
261static const UINT8 pixel_op_timing_table[] =
262262{
263263   2,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,6,5,5,2,2,2,2,2,2,2,2,2,2,2
264264};
r1386r1387
353353
354354
355355/* tables */
356static void (*pixblt_op_table[])(int, int) =
356static void (*const pixblt_op_table[])(int, int) =
357357{
358358   pixblt_1_op0,   pixblt_1_op0_trans,      pixblt_1_opx,   pixblt_1_opx_trans,
359359   pixblt_1_opx,   pixblt_1_opx_trans,      pixblt_1_opx,   pixblt_1_opx_trans,
r1386r1387
441441   pixblt_16_opx,   pixblt_16_opx_trans,   pixblt_16_opx,   pixblt_16_opx_trans
442442};
443443
444static void (*pixblt_r_op_table[])(int, int) =
444static void (*const pixblt_r_op_table[])(int, int) =
445445{
446446   pixblt_r_1_op0,   pixblt_r_1_op0_trans,   pixblt_r_1_opx,   pixblt_r_1_opx_trans,
447447   pixblt_r_1_opx,   pixblt_r_1_opx_trans,   pixblt_r_1_opx,   pixblt_r_1_opx_trans,
r1386r1387
529529   pixblt_r_16_opx,pixblt_r_16_opx_trans,   pixblt_r_16_opx,pixblt_r_16_opx_trans
530530};
531531
532static void (*pixblt_b_op_table[])(int) =
532static void (*const pixblt_b_op_table[])(int) =
533533{
534534   pixblt_b_1_op0,   pixblt_b_1_op0_trans,   pixblt_b_1_opx,   pixblt_b_1_opx_trans,
535535   pixblt_b_1_opx,   pixblt_b_1_opx_trans,   pixblt_b_1_opx,   pixblt_b_1_opx_trans,
r1386r1387
617617   pixblt_b_16_opx,pixblt_b_16_opx_trans,   pixblt_b_16_opx,pixblt_b_16_opx_trans
618618};
619619
620static void (*fill_op_table[])(int) =
620static void (*const fill_op_table[])(int) =
621621{
622622   fill_1_op0,      fill_1_op0_trans,      fill_1_opx,      fill_1_opx_trans,
623623   fill_1_opx,      fill_1_opx_trans,      fill_1_opx,      fill_1_opx_trans,
r1386r1387
893893#undef PIXEL_OP_TIMING
894894#undef PIXEL_OP
895895
896static UINT8 pixelsize_lookup[32] =
896static const UINT8 pixelsize_lookup[32] =
897897{
898898   0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
899899};
src/emu/cpu/tms34010/34010fld.c
r1386r1387
184184}
185185
186186
187void (*tms34010_wfield_functions[32])(offs_t offset,UINT32 data) =
187void (*const tms34010_wfield_functions[32])(offs_t offset,UINT32 data) =
188188{
189189   wfield_32, wfield_01, wfield_02, wfield_03, wfield_04, wfield_05,
190190   wfield_06, wfield_07, wfield_08, wfield_09, wfield_10, wfield_11,
r1386r1387
665665   return ((INT32)(ret << 1)) >> 1;
666666}
667667
668UINT32 (*tms34010_rfield_functions[64])(offs_t offset) =
668UINT32 (*const tms34010_rfield_functions[64])(offs_t offset) =
669669{
670670   rfield_32  , rfield_z_01, rfield_z_02, rfield_z_03, rfield_z_04, rfield_z_05,
671671   rfield_z_06, rfield_z_07, rfield_z_08, rfield_z_09, rfield_z_10, rfield_z_11,
src/emu/cpu/tms32031/dis32031.c
r1386r1387
3737   return temp;
3838}
3939
40static const char *regname[32] =
40static const char *const regname[32] =
4141{
4242   "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
4343   "AR0", "AR1", "AR2", "AR3", "AR4", "AR5", "AR6", "AR7",
r1386r1387
4545   "IOF", "RS", "RE", "RC", "??", "??", "??", "??"
4646};
4747
48static const char *condition[32] =
48static const char *const condition[32] =
4949{
5050   "U", "LO", "LS", "HI", "HS", "EQ", "NE", "LT",
5151   "LE", "GT", "GE", "??", "NV", "V", "NUF", "UF",
src/emu/cpu/tms32031/32031ops.c
r1386r1387
6666    FORWARD DECLARATIONS
6767***************************************************************************/
6868
69void (*tms32031ops[])(void);
69void (*const tms32031ops[])(void);
7070
7171
7272
r1386r1387
12311231
12321232/* tables */
12331233
1234static UINT32 (*indirect_d[0x20])(UINT8) =
1234static UINT32 (*const indirect_d[0x20])(UINT8) =
12351235{
12361236   mod00_d,   mod01_d,   mod02_d,   mod03_d,   mod04_d,   mod05_d,   mod06_d,   mod07_d,
12371237   mod08,      mod09,      mod0a,      mod0b,      mod0c,      mod0d,      mod0e,      mod0f,
r1386r1387
12401240};
12411241
12421242
1243static UINT32 (*indirect_1[0x20])(UINT8) =
1243static UINT32 (*const indirect_1[0x20])(UINT8) =
12441244{
12451245   mod00_1,   mod01_1,   mod02_1,   mod03_1,   mod04_1,   mod05_1,   mod06_1,   mod07_1,
12461246   mod08,      mod09,      mod0a,      mod0b,      mod0c,      mod0d,      mod0e,      mod0f,
r1386r1387
12491249};
12501250
12511251
1252static UINT32 (*indirect_1_def[0x20])(UINT8) =
1252static UINT32 (*const indirect_1_def[0x20])(UINT8) =
12531253{
12541254   mod00_1,   mod01_1,   mod02_1_def,mod03_1_def,mod04_1_def,mod05_1_def,mod06_1_def,mod07_1_def,
12551255   mod08,      mod09,      mod0a_def,   mod0b_def,   mod0c_def,   mod0d_def,   mod0e_def,   mod0f_def,
r1386r1387
61036103    FUNCTION TABLE
61046104***************************************************************************/
61056105
6106void (*tms32031ops[])(void) =
6106void (*const tms32031ops[])(void) =
61076107{
61086108   absf_reg,      absf_dir,      absf_ind,      absf_imm,      /* 0x00 */
61096109   absi_reg,      absi_dir,      absi_ind,      absi_imm,
src/emu/cpu/cpu.mak
r1386r1387
10851085CPUDEFS += -DHAS_PPC601=$(if $(filter PPC601,$(CPUS)),1,0)
10861086CPUDEFS += -DHAS_PPC602=$(if $(filter PPC602,$(CPUS)),1,0)
10871087CPUDEFS += -DHAS_PPC603=$(if $(filter PPC603,$(CPUS)),1,0)
1088CPUDEFS += -DHAS_PPC604=$(if $(filter PPC604,$(CPUS)),1,0)
10881089CPUDEFS += -DHAS_MPC8240=$(if $(filter MPC8240,$(CPUS)),1,0)
10891090
1090ifneq ($(filter PPC403 PPC601 PPC602 PPC603 MPC8240,$(CPUS)),)
1091ifneq ($(filter PPC403 PPC601 PPC602 PPC603 PPC604 MPC8240,$(CPUS)),)
10911092OBJDIRS += $(CPUOBJ)/powerpc
10921093DBGOBJS += $(CPUOBJ)/powerpc/ppc_dasm.o
10931094
src/emu/cpu/m37710/m37710.c
r1386r1387
7070
7171/* interrupt control mapping */
7272
73int m37710_irq_levels[M37710_LINE_MAX] =
73const int m37710_irq_levels[M37710_LINE_MAX] =
7474{
7575   // maskable
7676   0x70,   // ADC
r1386r1387
9898   0,   // reset
9999};
100100
101static int m37710_irq_vectors[M37710_LINE_MAX] =
101static const int m37710_irq_vectors[M37710_LINE_MAX] =
102102{
103103   // maskable          C74
104104   0xffd6, // A-D converter     c68b
r1386r1387
129129// M37710 internal peripherals
130130
131131#if M37710_DEBUG
132static const char *m37710_rnames[128] =
132static const char *const m37710_rnames[128] =
133133{
134134   "",
135135   "",
r1386r1387
261261   "INT2 IRQ ctrl",
262262};
263263
264static const char *m37710_tnames[8] =
264static const char *const m37710_tnames[8] =
265265{
266266   "A0", "A1", "A2", "A3", "A4", "B0", "B1", "B2"
267267};
r1386r1387
684684   }
685685}
686686
687extern void (*m37710i_opcodes_M0X0[])(void);
688extern void (*m37710i_opcodes42_M0X0[])(void);
689extern void (*m37710i_opcodes89_M0X0[])(void);
687extern void (*const m37710i_opcodes_M0X0[])(void);
688extern void (*const m37710i_opcodes42_M0X0[])(void);
689extern void (*const m37710i_opcodes89_M0X0[])(void);
690690extern uint m37710i_get_reg_M0X0(int regnum);
691691extern void m37710i_set_reg_M0X0(int regnum, uint val);
692692extern void m37710i_set_line_M0X0(int line, int state);
693693extern int  m37710i_execute_M0X0(int cycles);
694694
695extern void (*m37710i_opcodes_M0X1[])(void);
696extern void (*m37710i_opcodes42_M0X1[])(void);
697extern void (*m37710i_opcodes89_M0X1[])(void);
695extern void (*const m37710i_opcodes_M0X1[])(void);
696extern void (*const m37710i_opcodes42_M0X1[])(void);
697extern void (*const m37710i_opcodes89_M0X1[])(void);
698698extern uint m37710i_get_reg_M0X1(int regnum);
699699extern void m37710i_set_reg_M0X1(int regnum, uint val);
700700extern void m37710i_set_line_M0X1(int line, int state);
701701extern int  m37710i_execute_M0X1(int cycles);
702702
703extern void (*m37710i_opcodes_M1X0[])(void);
704extern void (*m37710i_opcodes42_M1X0[])(void);
705extern void (*m37710i_opcodes89_M1X0[])(void);
703extern void (*const m37710i_opcodes_M1X0[])(void);
704extern void (*const m37710i_opcodes42_M1X0[])(void);
705extern void (*const m37710i_opcodes89_M1X0[])(void);
706706extern uint m37710i_get_reg_M1X0(int regnum);
707707extern void m37710i_set_reg_M1X0(int regnum, uint val);
708708extern void m37710i_set_line_M1X0(int line, int state);
709709extern int  m37710i_execute_M1X0(int cycles);
710710
711extern void (*m37710i_opcodes_M1X1[])(void);
712extern void (*m37710i_opcodes42_M1X1[])(void);
713extern void (*m37710i_opcodes89_M1X1[])(void);
711extern void (*const m37710i_opcodes_M1X1[])(void);
712extern void (*const m37710i_opcodes42_M1X1[])(void);
713extern void (*const m37710i_opcodes89_M1X1[])(void);
714714extern uint m37710i_get_reg_M1X1(int regnum);
715715extern void m37710i_set_reg_M1X1(int regnum, uint val);
716716extern void m37710i_set_line_M1X1(int line, int state);
717717extern int  m37710i_execute_M1X1(int cycles);
718718
719void (**m37710i_opcodes[4])(void) =
719void (*const *const m37710i_opcodes[4])(void) =
720720{
721721   m37710i_opcodes_M0X0,
722722   m37710i_opcodes_M0X1,
r1386r1387
724724   m37710i_opcodes_M1X1,
725725};
726726
727void (**m37710i_opcodes2[4])(void) =
727void (*const *const m37710i_opcodes2[4])(void) =
728728{
729729   m37710i_opcodes42_M0X0,
730730   m37710i_opcodes42_M0X1,
r1386r1387
732732   m37710i_opcodes42_M1X1,
733733};
734734
735void (**m37710i_opcodes3[4])(void) =
735void (*const *const m37710i_opcodes3[4])(void) =
736736{
737737   m37710i_opcodes89_M0X0,
738738   m37710i_opcodes89_M0X1,
r1386r1387
740740   m37710i_opcodes89_M1X1,
741741};
742742
743uint (*m37710i_get_reg[4])(int regnum) =
743uint (*const m37710i_get_reg[4])(int regnum) =
744744{
745745   m37710i_get_reg_M0X0,
746746   m37710i_get_reg_M0X1,
r1386r1387
748748   m37710i_get_reg_M1X1,
749749};
750750
751void (*m37710i_set_reg[4])(int regnum, uint val) =
751void (*const m37710i_set_reg[4])(int regnum, uint val) =
752752{
753753   m37710i_set_reg_M0X0,
754754   m37710i_set_reg_M0X1,
r1386r1387
756756   m37710i_set_reg_M1X1,
757757};
758758
759void (*m37710i_set_line[4])(int line, int state) =
759void (*const m37710i_set_line[4])(int line, int state) =
760760{
761761   m37710i_set_line_M0X0,
762762   m37710i_set_line_M0X1,
r1386r1387
764764   m37710i_set_line_M1X1,
765765};
766766
767int (*m37710i_execute[4])(int cycles) =
767int (*const m37710i_execute[4])(int cycles) =
768768{
769769   m37710i_execute_M0X0,
770770   m37710i_execute_M0X1,
src/emu/cpu/m37710/m7700ds.c
r1386r1387
5858  BBC,   BBS,   TBY,   ANDB,  PUL ,  PSH ,  PLAB,  XAB ,  PHB
5959};
6060
61static const char* g_opnames[] =
61static const char *const g_opnames[] =
6262{
6363 "ADC", "AND", "ASL", "BCC", "BCS", "BEQ", "BIT", "BMI", "BNE", "BPL", "BRA",
6464 "BRK", "BRL", "BVC", "BVS", "CLC", "CLD", "CLI", "CLV", "CMP", "COP", "CPX",
r1386r1387
7474 "BBC", "BBS", "TBY", "ANDB","PUL", "PSH", "PLB", "XAB", "PHB",
7575};
7676
77static opcode_struct g_opcodes[256] =
77static const opcode_struct g_opcodes[256] =
7878{
7979   {BRK, I, SIG }, {ORA, M, DXI }, {UNK, I, SIG }, {ORA, M, S   },
8080   {SEB, M, LDM4 }, {ORA, M, D   }, {ASL, M, D   }, {ORA, M, DLI },
r1386r1387
157157   {JSR, I, AXI }, {SBC, M, AX  }, {INC, M, AX  }, {SBC, M, ALX }
158158};
159159
160static opcode_struct g_opcodes_prefix42[256] =
160static const opcode_struct g_opcodes_prefix42[256] =
161161{
162162   {BRK, I, SIG }, {ORB, M, DXI }, {COP, I, SIG }, {ORB, M, S   },
163163   {TSB, M, D   }, {ORB, M, D   }, {ASL, M, D   }, {ORB, M, DLI },
r1386r1387
240240   {JSR, I, AXI }, {SBCB, M, AX  }, {INC, M, AX  }, {SBCB, M, ALX }
241241};
242242
243static opcode_struct g_opcodes_prefix89[256] =
243static const opcode_struct g_opcodes_prefix89[256] =
244244{
245245   {BRK, I, SIG }, {MPY, M, DXI }, {COP, I, SIG }, {MPY, M, S   },
246246   {TSB, M, D   }, {MPY, M, D   }, {ASL, M, D   }, {MPY, M, DLI },
r1386r1387
373373int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag)
374374{
375375   unsigned int instruction;
376   opcode_struct *opcode;
376   const opcode_struct *opcode;
377377   char* ptr;
378378   int var;
379379   signed char varS;
src/emu/cpu/m37710/m37710op.h
r1386r1387
23352335#if !FLAG_SET_M && !FLAG_SET_X
23362336#define OP(CODE, OPERATION) static void m37710i_ ## CODE ## _M0X0(void) {OPERATION;}
23372337#define O(CODE) m37710i_ ## CODE ## _M0X0
2338#define TABLE_OPCODES void (*m37710i_opcodes_M0X0[256])(void)
2339#define TABLE_OPCODES2 void (*m37710i_opcodes42_M0X0[256])(void)
2340#define TABLE_OPCODES3 void (*m37710i_opcodes89_M0X0[256])(void)
2338#define TABLE_OPCODES void (*const m37710i_opcodes_M0X0[256])(void)
2339#define TABLE_OPCODES2 void (*const m37710i_opcodes42_M0X0[256])(void)
2340#define TABLE_OPCODES3 void (*const m37710i_opcodes89_M0X0[256])(void)
23412341#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE m37710i_ ## NAME ## _M0X0 ARGS
23422342
23432343#elif !FLAG_SET_M && FLAG_SET_X
23442344
23452345#define OP(CODE, OPERATION) static void m37710i_ ## CODE ## _M0X1(void) {OPERATION;}
23462346#define O(CODE) m37710i_ ## CODE ## _M0X1
2347#define TABLE_OPCODES void (*m37710i_opcodes_M0X1[256])(void)
2348#define TABLE_OPCODES2 void (*m37710i_opcodes42_M0X1[256])(void)
2349#define TABLE_OPCODES3 void (*m37710i_opcodes89_M0X1[256])(void)
2347#define TABLE_OPCODES void (*const m37710i_opcodes_M0X1[256])(void)
2348#define TABLE_OPCODES2 void (*const m37710i_opcodes42_M0X1[256])(void)
2349#define TABLE_OPCODES3 void (*const m37710i_opcodes89_M0X1[256])(void)
23502350#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE m37710i_ ## NAME ## _M0X1 ARGS
23512351
23522352#elif FLAG_SET_M && !FLAG_SET_X
23532353
23542354#define OP(CODE, OPERATION) static void m37710i_ ## CODE ## _M1X0(void) {OPERATION;}
23552355#define O(CODE) m37710i_ ## CODE ## _M1X0
2356#define TABLE_OPCODES void (*m37710i_opcodes_M1X0[256])(void)
2357#define TABLE_OPCODES2 void (*m37710i_opcodes42_M1X0[256])(void)
2358#define TABLE_OPCODES3 void (*m37710i_opcodes89_M1X0[256])(void)
2356#define TABLE_OPCODES void (*const m37710i_opcodes_M1X0[256])(void)
2357#define TABLE_OPCODES2 void (*const m37710i_opcodes42_M1X0[256])(void)
2358#define TABLE_OPCODES3 void (*const m37710i_opcodes89_M1X0[256])(void)
23592359#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE m37710i_ ## NAME ## _M1X0 ARGS
23602360
23612361#elif FLAG_SET_M && FLAG_SET_X
23622362
23632363#define OP(CODE, OPERATION) static void m37710i_ ## CODE ## _M1X1(void) {OPERATION;}
23642364#define O(CODE) m37710i_ ## CODE ## _M1X1
2365#define TABLE_OPCODES void (*m37710i_opcodes_M1X1[256])(void)
2366#define TABLE_OPCODES2 void (*m37710i_opcodes42_M1X1[256])(void)
2367#define TABLE_OPCODES3 void (*m37710i_opcodes89_M1X1[256])(void)
2365#define TABLE_OPCODES void (*const m37710i_opcodes_M1X1[256])(void)
2366#define TABLE_OPCODES2 void (*const m37710i_opcodes42_M1X1[256])(void)
2367#define TABLE_OPCODES3 void (*const m37710i_opcodes89_M1X1[256])(void)
23682368#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE m37710i_ ## NAME ## _M1X1 ARGS
23692369
23702370#endif
src/emu/cpu/m37710/m37710cm.h
r1386r1387
9595   uint irq_level;      /* irq level */
9696   int (*int_ack)(int); /* Interrupt Acknowledge */
9797   uint stopped;      /* Sets how the CPU is stopped */
98   void (**opcodes)(void);      /* opcodes with no prefix */
99   void (**opcodes42)(void);   /* opcodes with 0x42 prefix */
100   void (**opcodes89)(void);   /* opcodes with 0x89 prefix */
98   void (*const *opcodes)(void);      /* opcodes with no prefix */
99   void (*const *opcodes42)(void);   /* opcodes with 0x42 prefix */
100   void (*const *opcodes89)(void);   /* opcodes with 0x89 prefix */
101101   uint (*get_reg)(int regnum);
102102   void (*set_reg)(int regnum, uint val);
103103   void (*set_line)(int line, int state);
r1386r1387
116116extern uint m37710i_adc_tbl[];
117117extern uint m37710i_sbc_tbl[];
118118
119extern void (**m37710i_opcodes[])(void);
120extern void (**m37710i_opcodes2[])(void);
121extern void (**m37710i_opcodes3[])(void);
122extern uint (*m37710i_get_reg[])(int regnum);
123extern void (*m37710i_set_reg[])(int regnum, uint val);
124extern void (*m37710i_set_line[])(int line, int state);
125extern int (*m37710i_execute[])(int cycles);
119extern void (*const *const m37710i_opcodes[])(void);
120extern void (*const *const m37710i_opcodes2[])(void);
121extern void (*const *const m37710i_opcodes3[])(void);
122extern uint (*const m37710i_get_reg[])(int regnum);
123extern void (*const m37710i_set_reg[])(int regnum, uint val);
124extern void (*const m37710i_set_line[])(int line, int state);
125extern int (*const m37710i_execute[])(int cycles);
126126
127127#define REG_A         m37710i_cpu.a      /* Accumulator */
128128#define REG_B         m37710i_cpu.b      /* Accumulator hi byte */
src/emu/cpu/z180/z180.c
r1386r1387
25892589#endif /* MAME_DEBUG */
25902590      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &z180_icount;         break;
25912591      case CPUINFO_PTR_TRANSLATE:                  info->translate = z180_translate;      break;
2592      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: info->p = cc[Z180_TABLE_op];         break;
2593      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb: info->p = cc[Z180_TABLE_cb];         break;
2594      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed: info->p = cc[Z180_TABLE_ed];         break;
2595      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy: info->p = cc[Z180_TABLE_xy];         break;
2596      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb: info->p = cc[Z180_TABLE_xycb];      break;
2597      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex: info->p = cc[Z180_TABLE_ex];         break;
2592      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: info->p = (void *)cc[Z180_TABLE_op];         break;
2593      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb: info->p = (void *)cc[Z180_TABLE_cb];         break;
2594      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed: info->p = (void *)cc[Z180_TABLE_ed];         break;
2595      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy: info->p = (void *)cc[Z180_TABLE_xy];         break;
2596      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb: info->p = (void *)cc[Z180_TABLE_xycb];      break;
2597      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex: info->p = (void *)cc[Z180_TABLE_ex];         break;
25982598
25992599      /* --- the following bits of info are returned as NULL-terminated strings --- */
26002600      case CPUINFO_STR_NAME:                     strcpy(info->s, "Z180");            break;
src/emu/cpu/z180/z180dasm.c
r1386r1387
6161   zSLP   ,zSRA   ,zSRL   ,zSUB   ,zTST   ,zTSTIO ,zXOR
6262};
6363
64static const char *s_mnemonic[] = {
64static const char *const s_mnemonic[] = {
6565   "adc"  ,"add"  ,"and"  ,"bit"  ,"call" ,"ccf"  ,"cp"   ,"cpd"  ,
6666   "cpdr" ,"cpi"  ,"cpir" ,"cpl"  ,"daa"  ,"db"   ,"dec"  ,"di"   ,
6767   "djnz" ,"ei"   ,"ex"   ,"exx"  ,"halt" ,"im"   ,"in"   ,"in0"  ,
r1386r1387
7979   const char *arguments;
8080}   z80dasm;
8181
82static z80dasm mnemonic_xx_cb[256]= {
82static const z80dasm mnemonic_xx_cb[256]= {
8383   {zRLC,"b=Y"},   {zRLC,"c=Y"},   {zRLC,"d=Y"},   {zRLC,"e=Y"},
8484   {zRLC,"h=Y"},   {zRLC,"l=Y"},   {zRLC,"Y"},     {zRLC,"a=Y"},
8585   {zRRC,"b=Y"},   {zRRC,"c=Y"},   {zRRC,"d=Y"},   {zRRC,"e=Y"},
r1386r1387
146146   {zSET,"h=7,Y"}, {zSET,"l=7,Y"}, {zSET,"7,Y"},   {zSET,"a=7,Y"}
147147};
148148
149static z80dasm mnemonic_cb[256] = {
149static const z80dasm mnemonic_cb[256] = {
150150   {zRLC,"b"},     {zRLC,"c"},     {zRLC,"d"},     {zRLC,"e"},
151151   {zRLC,"h"},     {zRLC,"l"},     {zRLC,"(hl)"},  {zRLC,"a"},
152152   {zRRC,"b"},     {zRRC,"c"},     {zRRC,"d"},     {zRRC,"e"},
r1386r1387
213213   {zSET,"7,h"},   {zSET,"7,l"},   {zSET,"7,(hl)"},{zSET,"7,a"}
214214};
215215
216static z80dasm mnemonic_ed[256]= {
216static const z80dasm mnemonic_ed[256]= {
217217   {zIN0,"b,(B)"}, {zOUT0,"(B),b"},{zDB,"?"},      {zDB,"?"},
218218   {zTST,"b"},     {zDB,"?"},      {zDB,"?"},      {zDB,"?"},
219219   {zIN0,"c,(B)"}, {zOUT0,"(B),c"},{zDB,"?"},      {zDB,"?"},
r1386r1387
280280   {zDB,"?"},      {zDB,"?"},      {zDB,"?"},      {zDB,"?"}
281281};
282282
283static z80dasm mnemonic_xx[256]= {
283static const z80dasm mnemonic_xx[256]= {
284284   {zDB,"?"},      {zDB,"?"},      {zDB,"?"},      {zDB,"?"},
285285   {zDB,"?"},      {zDB,"?"},      {zDB,"?"},      {zDB,"?"},
286286   {zDB,"?"},      {zADD,"I,bc"},  {zDB,"?"},      {zDB,"?"},
r1386r1387
347347   {zDB,"?"},      {zDB,"?"},      {zDB,"?"},      {zDB,"?"}
348348};
349349
350static z80dasm mnemonic_main[256]= {
350static const z80dasm mnemonic_main[256]= {
351351   {zNOP,0},      {zLD,"bc,N"},   {zLD,"(bc),a"}, {zINC,"bc"},
352352   {zINC,"b"},     {zDEC,"b"},     {zLD,"b,B"},    {zRLCA,0},
353353   {zEX,"af,af'"}, {zADD,"hl,bc"}, {zLD,"a,(bc)"}, {zDEC,"bc"},
r1386r1387
430430 ****************************************************************************/
431431offs_t z180_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
432432{
433   z80dasm *d;
433   const z80dasm *d;
434434   const char *src, *ixy;
435435   char *dst;
436436   unsigned PC = pc;
src/emu/cpu/z180/z180tbl.h
r1386r1387
11#if Z180_EXACT
22/* tmp1 value for ini/inir/outi/otir for [C.1-0][io.1-0] */
3static UINT8 irep_tmp1[4][4] = {
3static const UINT8 irep_tmp1[4][4] = {
44   {0,0,1,0},{0,1,0,1},{1,0,1,1},{0,1,1,0}
55};
66
77/* tmp1 value for ind/indr/outd/otdr for [C.1-0][io.1-0] */
8static UINT8 drep_tmp1[4][4] = {
8static const UINT8 drep_tmp1[4][4] = {
99   {0,1,0,0},{1,0,0,1},{0,0,1,0},{0,1,0,1}
1010};
1111
1212/* tmp2 value for all in/out repeated opcodes for B.7-0 */
13static UINT8 breg_tmp2[256] = {
13static const UINT8 breg_tmp2[256] = {
1414   0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,
1515   0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,
1616   1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,
r1386r1387
3030};
3131#endif
3232
33static UINT8 cc_op[0x100] = {
33static const UINT8 cc_op[0x100] = {
3434/*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */
3535   3, 9, 7, 4, 4, 4, 6, 3, 4, 7, 6, 4, 4, 4, 6, 3,
3636   7, 9, 7, 4, 4, 4, 6, 3, 8, 7, 6, 4, 4, 4, 6, 3,
r1386r1387
5050   5, 9, 6, 3, 6,11, 6,11, 5, 4, 6, 3, 6, 0, 6,11
5151};
5252
53static UINT8 cc_cb[0x100] = {
53static const UINT8 cc_cb[0x100] = {
5454/*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */
5555   7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7,
5656   7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7,
r1386r1387
7070   7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7
7171};
7272
73static UINT8 cc_ed[0x100] = {
73static const UINT8 cc_ed[0x100] = {
7474/*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */
7575  12,13, 6, 6, 9, 6, 6, 6,12,13, 6, 6, 9, 6, 6, 6,
7676  12,13, 6, 6, 9, 6, 6, 6,12,13, 6, 6, 9, 6, 6, 6,
r1386r1387
9090   6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
9191};
9292
93static UINT8 cc_xy[0x100] = {
93static const UINT8 cc_xy[0x100] = {
9494/*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */
9595   4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4,
9696   4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4,
r1386r1387
110110   4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4
111111};
112112
113static UINT8 cc_xycb[0x100] = {
113static const UINT8 cc_xycb[0x100] = {
114114/*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */
115115  19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
116116  19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,
r1386r1387
131131};
132132
133133/* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */
134static UINT8 cc_ex[0x100] = {
134static const UINT8 cc_ex[0x100] = {
135135/*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */
136136   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
137137   2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     /* DJNZ */
r1386r1387
151151   5, 0, 3, 0,10, 0, 0, 2, 5, 0, 3, 0,10, 0, 0, 2
152152};
153153
154static UINT8 *cc[6] = { cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex };
154static const UINT8 *cc[6] = { cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex };
155155#define Z180_TABLE_dd    Z180_TABLE_xy
156156#define Z180_TABLE_fd    Z180_TABLE_xy
157157
r1386r1387
222222   INLINE void prefix##_f4(void); INLINE void prefix##_f5(void); INLINE void prefix##_f6(void); INLINE void prefix##_f7(void); \
223223   INLINE void prefix##_f8(void); INLINE void prefix##_f9(void); INLINE void prefix##_fa(void); INLINE void prefix##_fb(void); \
224224   INLINE void prefix##_fc(void); INLINE void prefix##_fd(void); INLINE void prefix##_fe(void); INLINE void prefix##_ff(void); \
225static void (*tablename[0x100])(void) = {   \
225static void (*const tablename[0x100])(void) = {   \
226226   prefix##_00,prefix##_01,prefix##_02,prefix##_03,prefix##_04,prefix##_05,prefix##_06,prefix##_07, \
227227   prefix##_08,prefix##_09,prefix##_0a,prefix##_0b,prefix##_0c,prefix##_0d,prefix##_0e,prefix##_0f, \
228228   prefix##_10,prefix##_11,prefix##_12,prefix##_13,prefix##_14,prefix##_15,prefix##_16,prefix##_17, \
src/emu/cpu/z180/z180daa.h
r1386r1387
1static UINT16 DAATable[0x800] = {
1static const UINT16 DAATable[0x800] = {
22  (0x00<<8)   +ZF         +VF      ,
33  (0x01<<8)                        ,
44  (0x02<<8)                        ,
src/emu/cpu/i86/table186.h
r1386r1387
1static void (*PREFIX186(_instruction)[256])(void) =
1static void (*const PREFIX186(_instruction)[256])(void) =
22{
33    PREFIX86(_add_br8),           /* 0x00 */
44    PREFIX86(_add_wr16),          /* 0x01 */
src/emu/cpu/i86/table286.h
r1386r1387
33 * at the time the same like table186.h
44 */
55
6static void (*PREFIX286(_instruction)[256])(void) =
6static void (*const PREFIX286(_instruction)[256])(void) =
77{
88    PREFIX86(_add_br8),         /* 0x00 */
99    PREFIX86(_add_wr16),         /* 0x01 */
src/emu/cpu/i86/table86.h
r1386r1387
1static void (*PREFIX86(_instruction)[256])(void) =
1static void (*const PREFIX86(_instruction)[256])(void) =
22{
33    PREFIX86(_add_br8),          /* 0x00 */
44    PREFIX86(_add_wr16),         /* 0x01 */
src/emu/cpu/i86/tablev30.h
r1386r1387
11// special nec instructions missing
22// at the time the same like table186.h
33
4static void (*PREFIXV30(_instruction)[256])(void) =
4static void (*const PREFIXV30(_instruction)[256])(void) =
55{
66    PREFIX86(_add_br8),           /* 0x00 */
77    PREFIX86(_add_wr16),          /* 0x01 */
src/emu/cpu/upd7810/7810tbl.c
r1386r1387
10241024static void XRI_TMM_xx(void);
10251025static void XRI_V_xx(void);
10261026
1027static struct opcode_s op48[256] =
1027static const struct opcode_s op48[256] =
10281028{
10291029   {illegal,      2, 8, 8,L0|L1}, /* 00: 0100 1000 0000 0000                      */
10301030   {SLRC_A,      2, 8, 8,L0|L1}, /* 01: 0100 1000 0000 0001                      */
r1386r1387
13031303};
13041304
13051305/* prefix 4C */
1306static struct opcode_s op4C[256] =
1306static const struct opcode_s op4C[256] =
13071307{
13081308   {illegal2,      2, 8, 8,L0|L1}, /* 00: 0100 1100 0000 0000                      */
13091309   {illegal2,      2, 8, 8,L0|L1}, /* 01: 0100 1100 0000 0001                      */
r1386r1387
15801580};
15811581
15821582/* prefix 4D */
1583static struct opcode_s op4D[256] =
1583static const struct opcode_s op4D[256] =
15841584{
15851585   {illegal2,      2, 8, 8,L0|L1}, /* 00: 0100 1101 0000 0000                      */
15861586   {illegal2,      2, 8, 8,L0|L1}, /* 01: 0100 1101 0000 0001                      */
r1386r1387
18561856};
18571857
18581858/* prefix 60 */
1859static struct opcode_s op60[256] =
1859static const struct opcode_s op60[256] =
18601860{
18611861   {illegal2,      2, 8, 8,L0|L1}, /* 00: 0110 0000 0000 0000                      */
18621862   {illegal2,      2, 8, 8,L0|L1}, /* 01: 0110 0000 0000 0001                      */
r1386r1387
21322132};
21332133
21342134/* prefix 64 */
2135static struct opcode_s op64[256] =
2135static const struct opcode_s op64[256] =
21362136{
21372137   {MVI_PA_xx,    3,14,11,L0|L1}, /* 00: 0110 0100 0000 0000 xxxx xxxx            */
21382138   {MVI_PB_xx,    3,14,11,L0|L1}, /* 01: 0110 0100 0000 0001 xxxx xxxx            */
r1386r1387
24082408};
24092409
24102410/* prefix 70 */
2411static struct opcode_s op70[256] =
2411static const struct opcode_s op70[256] =
24122412{
24132413   {illegal2,      2, 8, 8,L0|L1}, /* 00: 0111 0000 0000 0000                      */
24142414   {illegal2,      2, 8, 8,L0|L1}, /* 01: 0111 0000 0000 0001                      */
r1386r1387
26852685};
26862686
26872687/* prefix 74 */
2688static struct opcode_s op74[256] =
2688static const struct opcode_s op74[256] =
26892689{
26902690   {illegal2,      2, 8, 8,L0|L1}, /* 00: 0111 0100 0000 0000                      */
26912691   {illegal2,      2, 8, 8,L0|L1}, /* 01: 0111 0100 0000 0001                      */
r1386r1387
29612961};
29622962
29632963/* main opcodes */
2964static struct opcode_s opXX_7810[256] =
2964static const struct opcode_s opXX_7810[256] =
29652965{
29662966   {NOP,         1, 4, 4,L0|L1}, /* 00: 0000 0000                                */
29672967   {LDAW_wa,      2,10,10,L0|L1}, /* 01: 0000 0001 oooo oooo                      */
r1386r1387
32363236   {JR,         1,10,10,L0|L1}   /* ff: 1111 1111                                */
32373237};
32383238
3239static struct opcode_s opXX_7807[256] =
3239static const struct opcode_s opXX_7807[256] =
32403240{
32413241   {NOP,         1, 4, 4,L0|L1}, /* 00: 0000 0000                                */
32423242   {LDAW_wa,      2,10,10,L0|L1}, /* 01: 0000 0001 oooo oooo                      */
src/emu/cpu/upd7810/7810dasm.c
r1386r1387
189189   XRI
190190};
191191
192static const char* token[] =
192static const char *const token[] =
193193{
194194   "",
195195   "illegal",
r1386r1387
364364
365365
366366/* prefix 48 */
367static struct dasm_s dasm48_7810[256] =
367static const struct dasm_s dasm48_7810[256] =
368368{
369369   {illegal,0,     2, 8}, /* 00: 0100 1000 0000 0000                      */
370370   {SLRC,"A",       2, 8}, /* 01: 0100 1000 0000 0001                      */
r1386r1387
639639   {illegal,0,     2, 8}   /* ff: 0100 1000 1111 1111                      */
640640};
641641
642static struct dasm_s dasm48_7807[256] =
642static const struct dasm_s dasm48_7807[256] =
643643{
644644   {illegal,0,     2, 8}, /* 00: 0100 1000 0000 0000                      */
645645   {SLRC,"A",       2, 8}, /* 01: 0100 1000 0000 0001                      */
r1386r1387
915915};
916916
917917/* prefix 4C */
918static struct dasm_s  dasm4C_7810[256] =
918static const struct dasm_s  dasm4C_7810[256] =
919919{
920920   {illegal,0,     2, 8}, /* 00: 0100 1100 0000 0000                      */
921921   {illegal,0,     2, 8}, /* 01: 0100 1100 0000 0001                      */
r1386r1387
11901190   {illegal,0,     2,10}   /* ff: 0100 1100 1111 1111                      */
11911191};
11921192
1193static struct dasm_s  dasm4C_7807[256] =
1193static const struct dasm_s  dasm4C_7807[256] =
11941194{
11951195   {illegal,0,     2, 8}, /* 00: 0100 1100 0000 0000                      */
11961196   {illegal,0,     2, 8}, /* 01: 0100 1100 0000 0001                      */
r1386r1387
14661466};
14671467
14681468/* prefix 4D */
1469static struct dasm_s  dasm4D_7810[256] =
1469static const struct dasm_s  dasm4D_7810[256] =
14701470{
14711471   {illegal,0,     2, 8}, /* 00: 0100 1101 0000 0000                      */
14721472   {illegal,0,     2, 8}, /* 01: 0100 1101 0000 0001                      */
r1386r1387
17411741   {illegal,0,     2,10}   /* ff: 0100 1101 1111 1111                      */
17421742};
17431743
1744static struct dasm_s  dasm4D_7807[256] =
1744static const struct dasm_s  dasm4D_7807[256] =
17451745{
17461746   {illegal,0,     2, 8}, /* 00: 0100 1101 0000 0000                      */
17471747   {illegal,0,     2, 8}, /* 01: 0100 1101 0000 0001                      */
r1386r1387
20172017};
20182018
20192019/* prefix 60 */
2020static struct dasm_s  dasm60[256] =
2020static const struct dasm_s  dasm60[256] =
20212021{
20222022   {illegal,0,     2, 8}, /* 00: 0110 0000 0000 0000                      */
20232023   {illegal,0,     2, 8}, /* 01: 0110 0000 0000 0001                      */
r1386r1387
22932293};
22942294
22952295/* prefix 64 */
2296static struct dasm_s  dasm64_7810[256] =
2296static const struct dasm_s  dasm64_7810[256] =
22972297{
22982298   {MVI,"PA,%b",    3,14}, /* 00: 0110 0100 0000 0000 xxxx xxxx            */
22992299   {MVI,"PB,%b",    3,14}, /* 01: 0110 0100 0000 0001 xxxx xxxx            */
r1386r1387
25682568   {illegal,0,     3,20}   /* ff: 0110 0100 1111 1111 xxxx xxxx            */
25692569};
25702570
2571static struct dasm_s  dasm64_7807[256] =
2571static const struct dasm_s  dasm64_7807[256] =
25722572{
25732573   {MVI,"PA,%b",    3,14}, /* 00: 0110 0100 0000 0000 xxxx xxxx            */
25742574   {MVI,"PB,%b",    3,14}, /* 01: 0110 0100 0000 0001 xxxx xxxx            */
r1386r1387
28442844};
28452845
28462846/* prefix 70 */
2847static struct dasm_s  dasm70[256] =
2847static const struct dasm_s  dasm70[256] =
28482848{
28492849   {illegal,0,     2, 8}, /* 00: 0111 0000 0000 0000                      */
28502850   {illegal,0,     2, 8}, /* 01: 0111 0000 0000 0001                      */
r1386r1387
31203120};
31213121
31223122/* prefix 74 */
3123static struct dasm_s  dasm74[256] =
3123static const struct dasm_s  dasm74[256] =
31243124{
31253125   {illegal,0,     2, 8}, /* 00: 0111 0100 0000 0000                      */
31263126   {illegal,0,     2, 8}, /* 01: 0111 0100 0000 0001                      */
r1386r1387
33963396};
33973397
33983398/* main opcodes */
3399static struct dasm_s  dasmXX_7810[256] =
3399static const struct dasm_s  dasmXX_7810[256] =
34003400{
34013401   {NOP,0,        1, 4}, /* 00: 0000 0000                                */
34023402   {LDAW,"%a",      2,10}, /* 01: 0000 0001 oooo oooo                      */
r1386r1387
36713671   {JR,"%o",        1,10}  /* ff: 11oo oooo                                */
36723672};
36733673
3674static struct dasm_s  dasmXX_7807[256] =
3674static const struct dasm_s  dasmXX_7807[256] =
36753675{
36763676   {NOP,0,        1, 4}, /* 00: 0000 0000                                */
36773677   {LDAW,"%a",      2,10}, /* 01: 0000 0001 oooo oooo                      */
r1386r1387
39473947
39483948
39493949/* register names for bit manipulation instructions */
3950static const char *regname[32] =
3950static const char *const regname[32] =
39513951{
39523952   "illegal", "illegal", "illegal", "illegal",
39533953   "illegal", "illegal", "illegal", "illegal",
r1386r1387
39613961
39623962static unsigned upd7810_get_reg(int reg) { cpuinfo info; upd7810_get_info(CPUINFO_INT_REGISTER + (reg), &info); return info.i; }
39633963
3964static unsigned Dasm( char *buffer, unsigned pc, struct dasm_s *dasmXX, const UINT8 *oprom, const UINT8 *opram )
3964static unsigned Dasm( char *buffer, unsigned pc, const struct dasm_s *dasmXX, const UINT8 *oprom, const UINT8 *opram )
39653965{
39663966   unsigned opc = pc;
39673967   UINT8 op = oprom[pc++ - opc], op2, t, l;
src/emu/cpu/minx/minxd.c
r1386r1387
5959   OP, OP1
6060};
6161
62static const char *s_mnemonic[] = {
62static const char *const s_mnemonic[] = {
6363   "add", "addc", "and", "bcdd", "bcde", "bcdx", "call", "callc", "callg", "callge", "calll",
6464   "callle", "calln", "callnc", "callno", "callnz", "callo", "callp", "callnx0",
6565   "callnx1", "callnx2", "callnx3", "callx0", "callx1", "callx2", "callx3", "callz",
src/emu/cpu/minx/minxops.h
r1386r1387
274274OP(FE) { /* illegal operation? */ }
275275OP(FF) { }
276276
277static void (*insnminx[256])(void) = {
277static void (*const insnminx[256])(void) = {
278278   minx_00, minx_01, minx_02, minx_03, minx_04, minx_05, minx_06, minx_07,
279279   minx_08, minx_09, minx_0A, minx_0B, minx_0C, minx_0D, minx_0E, minx_0F,
280280   minx_10, minx_11, minx_12, minx_13, minx_14, minx_15, minx_16, minx_17,
r1386r1387
309309   minx_F8, minx_F9, minx_FA, minx_FB, minx_FC, minx_FD, minx_FE, minx_FF
310310};
311311
312static int insnminx_cycles[256] = {
312static const int insnminx_cycles[256] = {
313313   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314314   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315315   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
src/emu/cpu/minx/minxopce.h
r1386r1387
274274OP(FE) { INT8 d8 = rdop(); if ( ( regs.E & EXEC_X2 ) ) { CALL( regs.PC + d8 - 1 ); } }
275275OP(FF) { INT8 d8 = rdop(); if ( ( regs.E & EXEC_DZ ) ) { CALL( regs.PC + d8 - 1 ); } }
276276
277static void (*insnminx_CE[256])(void) = {
277static void (*const insnminx_CE[256])(void) = {
278278   minx_CE_00, minx_CE_01, minx_CE_02, minx_CE_03, minx_CE_04, minx_CE_05, minx_CE_06, minx_CE_07,
279279   minx_CE_08, minx_CE_09, minx_CE_0A, minx_CE_0B, minx_CE_0C, minx_CE_0D, minx_CE_0E, minx_CE_0F,
280280   minx_CE_10, minx_CE_11, minx_CE_12, minx_CE_13, minx_CE_14, minx_CE_15, minx_CE_16, minx_CE_17,
r1386r1387
309309   minx_CE_F8, minx_CE_F9, minx_CE_FA, minx_CE_FB, minx_CE_FC, minx_CE_FD, minx_CE_FE, minx_CE_FF
310310};
311311
312static int insnminx_cycles_CE[256] = {
312static const int insnminx_cycles_CE[256] = {
313313        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314314        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315315        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
src/emu/cpu/minx/minxopcf.h
r1386r1387
274274OP(FE) { regs.Y = regs.SP; }
275275OP(FF) { /* illegal instruction? */ }
276276
277static void (*insnminx_CF[256])(void) = {
277static void (*const insnminx_CF[256])(void) = {
278278   minx_CF_00, minx_CF_01, minx_CF_02, minx_CF_03, minx_CF_04, minx_CF_05, minx_CF_06, minx_CF_07,
279279   minx_CF_08, minx_CF_09, minx_CF_0A, minx_CF_0B, minx_CF_0C, minx_CF_0D, minx_CF_0E, minx_CF_0F,
280280   minx_CF_10, minx_CF_11, minx_CF_12, minx_CF_13, minx_CF_14, minx_CF_15, minx_CF_16, minx_CF_17,
r1386r1387
309309   minx_CF_F8, minx_CF_F9, minx_CF_FA, minx_CF_FB, minx_CF_FC, minx_CF_FD, minx_CF_FE, minx_CF_FF
310310};
311311
312static int insnminx_cycles_CF[256] = {
312static const int insnminx_cycles_CF[256] = {
313313        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314314        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315315        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
src/emu/cpu/v60/v60.c
r1386r1387
160160//29-31 reserved
161161
162162// Register names
163const char *v60_reg_names[69] = {
163const char *const v60_reg_names[69] = {
164164   "R0", "R1", "R2", "R3",
165165   "R4", "R5", "R6", "R7",
166166   "R8", "R9", "R10", "R11",
src/emu/cpu/v60/v60.h
r1386r1387
7575   V60_REGMAX
7676};
7777
78extern const char *v60_reg_names[];
78extern const char *const v60_reg_names[];
7979void v60_stall(void);
8080
8181#if HAS_V60
src/emu/cpu/spc700/spc700ds.c
r1386r1387
5454};
5555
5656
57static const char* g_opnames[] =
57static const char *const g_opnames[] =
5858{
5959   "ADC  ", "ADDW ", "AND  ", "AND1 ", "ASL  ", "BBC  ", "BBS  ", "BCC  ",
6060   "BCS  ", "BEQ  ", "BMI  ", "BNE  ", "BPL  ", "BRA  ", "BRK  ", "BVC  ",
r1386r1387
6767   "TCLR1", "TSET1", "XCN  "
6868};
6969
70static opcode_struct g_opcodes[256] =
70static const opcode_struct g_opcodes[256] =
7171{
7272/* 00 */ {NOP    , {IMP , IMP }},
7373/* 01 */ {TCALL  , {N0  , IMP }},
r1386r1387
346346
347347offs_t spc700_dasm(char *buff, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
348348{
349   opcode_struct* opcode;
349   const opcode_struct* opcode;
350350   UINT32 flags = 0;
351351   char* ptr;
352352   int var;
src/emu/cpu/i8039/8039dasm.c
r1386r1387
2929#define FMT(a,b) a, b
3030#define PTRS_PER_FORMAT 2
3131
32static const char *Formats[] = {
32static const char *const Formats[] = {
3333   FMT("00000011dddddddd", "add  a,#$%X"),
3434   FMT("01101rrr", "add  a,%R"),
3535   FMT("0110000r", "add  a,@%R"),
r1386r1387
148148
149149static void InitDasm8039(void)
150150{
151   const char *p, **ops;
151   const char *p;
152   const char *const *ops;
152153   byte mask, bits;
153154   int bit;
154155   int i;
src/emu/cpu/i8039/i8039.c
r1386r1387
9393   UINT16   A11;
9494   UINT8   irq_state, irq_extra_cycles;
9595   int      (*irq_callback)(int irqline);
96   UINT8   Old_T1;
9697} I8039_Regs;
9798
9899static I8039_Regs R;
99100static int      i8039_ICount;
100101static int    inst_cycles;
101static UINT8 Old_T1;
102102
103103/* The opcode table now is a combination of cycle counts and function pointers */
104104typedef struct {
r1386r1387
106106   void (*function) (void);
107107}   s_opcode;
108108
109#define POSITIVE_EDGE_T1  (( (int)(T1-Old_T1) > 0) ? 1 : 0)
110#define NEGATIVE_EDGE_T1  (( (int)(Old_T1-T1) > 0) ? 1 : 0)
109#define POSITIVE_EDGE_T1  (( (int)(T1-R.Old_T1) > 0) ? 1 : 0)
110#define NEGATIVE_EDGE_T1  (( (int)(R.Old_T1-T1) > 0) ? 1 : 0)
111111
112112#define M_Cy   ((R.PSW & C_FLAG) >> 7)
113113#define M_Cn   (!M_Cy)
r1386r1387
462462static void sel_rb0(void)    { CLR(B_FLAG); regPTR = 0;  }
463463static void sel_rb1(void)    { SET(B_FLAG); regPTR = 24; }
464464static void stop_tcnt(void)    { R.timerON = R.countON = 0; }
465static void strt_cnt(void)    { R.countON = 1; R.timerON = 0; Old_T1 = test_r(1); }   /* NS990113 */
465static void strt_cnt(void)    { R.countON = 1; R.timerON = 0; R.Old_T1 = test_r(1); }   /* NS990113 */
466466static void strt_t(void)    { R.timerON = 1; R.countON = 0; R.masterClock = 0; }   /* NS990113 */
467467static void swap_a(void)    { UINT8 i=R.A >> 4; R.A <<= 4; R.A |= i; }
468468static void xch_a_r0(void)    { UINT8 i=R.A; R.A=R0; R0=i; }
r1386r1387
489489static void xrl_a_xr0(void)    { R.A ^= intRAM[R0 & 0x7f]; }
490490static void xrl_a_xr1(void)    { R.A ^= intRAM[R1 & 0x7f]; }
491491
492static s_opcode opcode_main[256]=
492static const s_opcode opcode_main[256]=
493493{
494494   {1, nop       },{0, illegal   },{2, outl_bus_a },{2, add_a_n     },{2, jmp       },{1, en_i      },{0, illegal    },{1, dec_a     },
495495   {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  },
r1386r1387
558558   state_save_register_item("i8039", index, R.A11);
559559   state_save_register_item("i8039", index, R.irq_state);
560560   state_save_register_item("i8039", index, R.irq_extra_cycles);
561   state_save_register_item("i8039", index, R.Old_T1);
561562}
562563
563564/****************************************************************************
r1386r1387
690691                  i8039_ICount -= count;
691692               }
692693            }
693            Old_T1 = T1;
694            R.Old_T1 = T1;
694695         }
695696      }
696697
src/emu/cpu/hd6309/6309tbl.c
r1386r1387
439439INLINE void pref10( void );
440440INLINE void pref11( void );
441441
442static UINT8 flags8i[256]=    /* increment */
442static const UINT8 flags8i[256]=    /* increment */
443443{
444444CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
4454450x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
r1386r1387
458458CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,
459459CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N
460460};
461static UINT8 flags8d[256]= /* decrement */
461static const UINT8 flags8d[256]= /* decrement */
462462{
463463CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
4644640x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
r1386r1387
478478CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N
479479};
480480
481static UINT8 index_cycle_em[256] = {        /* Index Loopup cycle counts, emulated 6809 */
481static const UINT8 index_cycle_em[256] = {        /* Index Loopup cycle counts, emulated 6809 */
482482/*           0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
483483
484484/* 0x0X */      1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
r1386r1387
499499/* 0xFX */      4,    6,   20,    6,    3,    4,    4,    4,    4,    7,    4,    7,    4,    8,    7,   20
500500};
501501
502static UINT8 index_cycle_na[256] = {         /* Index Loopup cycle counts,
502static const UINT8 index_cycle_na[256] = {         /* Index Loopup cycle counts,
503503native 6309 */
504504/*       X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, XA, XB, XC, XD, XE, XF */
505505
r1386r1387
524524#define IIP0   19         /* Illegal instruction cycle count page 0 */
525525#define IIP1   20         /* Illegal instruction cycle count page 01 & 11 */
526526
527static UINT8 ccounts_page0_em[256] =    /* Cycle Counts Page zero, Emulated 6809 */
527static const UINT8 ccounts_page0_em[256] =    /* Cycle Counts Page zero, Emulated 6809 */
528528{
529529/*           0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
530530/* 0x0X */     6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    3,    6,
r1386r1387
545545/* 0xFX */     5,    5,    5,    7,    5,    5,    5,    5,    5,    5,    5,    5,    6,    6,    6,    6
546546};
547547
548static UINT8 ccounts_page0_na[256] =   /* Cycle Counts Page zero, Native 6309 */
548static const UINT8 ccounts_page0_na[256] =   /* Cycle Counts Page zero, Native 6309 */
549549{
550550/*           0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
551551/* 0x0X */     5,    6,    6,    5,    5,    6,    5,    5,    5,    5,    5,    6,    5,    4,    2,    5,
r1386r1387
566566/* 0xFX */     4,    4,    4,    5,    4,    4,    4,    4,    4,    4,    4,    4,    5,    5,    5,    5
567567};
568568
569static UINT8 ccounts_page01_em[256] =    /* Cycle Counts Page 01, Emulated 6809 */
569static const UINT8 ccounts_page01_em[256] =    /* Cycle Counts Page 01, Emulated 6809 */
570570{
571571/*           0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
572572/* 0x0X */   IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1,
r1386r1387
587587/* 0xFX */   IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1,    9,    9,    7,    7
588588};
589589
590static UINT8 ccounts_page01_na[256] =   /* Cycle Counts Page 01, Native 6309 */
590static const UINT8 ccounts_page01_na[256] =   /* Cycle Counts Page 01, Native 6309 */
591591{
592592/*           0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
593593/* 0x0X */   IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1,
r1386r1387
608608/* 0xFX */   IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1,    8,    8,    6,    6
609609};
610610
611static UINT8 ccounts_page11_em[256] =    /* Cycle Counts Page 11, Emulated 6809 */
611static const UINT8 ccounts_page11_em[256] =    /* Cycle Counts Page 11, Emulated 6809 */
612612{
613613/*           0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
614614/* 0x0X */   IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1,
r1386r1387
629629/* 0xFX */      6,    6, IIP1, IIP1, IIP1, IIP1,    6,    6, IIP1, IIP1, IIP1,    6, IIP1, IIP1, IIP1, IIP1
630630};
631631
632static UINT8 ccounts_page11_na[256] =    /* Cycle Counts Page 11, Native 6309 */
632static const UINT8 ccounts_page11_na[256] =    /* Cycle Counts Page 11, Native 6309 */
633633{
634634/*           0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7, 0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
635635/* 0x0X */   IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1, IIP1,
r1386r1387
652652
653653#ifndef BIG_SWITCH
654654
655static void (*hd6309_main[0x100])(void) = {
655static void (*const hd6309_main[0x100])(void) = {
656656/*          0xX0,   0xX1,     0xX2,    0xX3,    0xX4,    0xX5,    0xX6,    0xX7,
657657            0xX8,   0xX9,     0xXA,    0xXB,    0xXC,    0xXD,    0xXE,    0xXF   */
658658
r1386r1387
705705            eorb_ex, adcb_ex, orb_ex,  addb_ex, ldd_ex,  std_ex,  ldu_ex,  stu_ex
706706};
707707
708static void (*hd6309_page01[0x100])(void) = {
708static void (*const hd6309_page01[0x100])(void) = {
709709/*          0xX0,   0xX1,     0xX2,    0xX3,    0xX4,    0xX5,    0xX6,    0xX7,
710710            0xX8,   0xX9,     0xXA,    0xXB,    0xXC,    0xXD,    0xXE,    0xXF   */
711711
r1386r1387
757757/* 0xFX */  IIError, IIError, IIError, IIError, IIError, IIError, IIError, IIError,
758758         IIError, IIError, IIError, IIError, ldq_ex,  stq_ex,  lds_ex,  sts_ex
759759};
760static void (*hd6309_page11[0x100])(void) = {
760static void (*const hd6309_page11[0x100])(void) = {
761761/*          0xX0,   0xX1,     0xX2,    0xX3,    0xX4,    0xX5,    0xX6,    0xX7,
762762            0xX8,   0xX9,     0xXA,    0xXB,    0xXC,    0xXD,    0xXE,    0xXF   */
763763
src/emu/cpu/hd6309/6309dasm.c
r1386r1387
586586   sizeof(hd6309_pg2opcodes) / sizeof(hd6309_pg2opcodes[0])
587587};
588588
589static const char *hd6309_regs[5] = { "X", "Y", "U", "S", "PC" };
589static const char *const hd6309_regs[5] = { "X", "Y", "U", "S", "PC" };
590590
591static const char *hd6309_btwregs[5] = { "CC", "A", "B", "inv" };
591static const char *const hd6309_btwregs[5] = { "CC", "A", "B", "inv" };
592592
593static const char *hd6309_teregs[16] =
593static const char *const hd6309_teregs[16] =
594594{
595595   "D", "X",  "Y",  "U", "S", "PC", "W", "V",
596596   "A", "B", "CC", "DP", "0",  "0", "E", "F"
597597};
598598
599static const char *hd6309_tfmregs[16] = {
599static const char *const hd6309_tfmregs[16] = {
600600     "D",   "X",   "Y",   "U",   "S", "inv", "inv", "inv",
601601   "inv", "inv", "inv", "inv", "inv", "inv", "inv", "inv"
602602};
603603
604static const char *tfm_s[] = { "%s+,%s+", "%s-,%s-", "%s+,%s", "%s,%s+" };
604static const char *const tfm_s[] = { "%s+,%s+", "%s-,%s-", "%s+,%s", "%s,%s+" };
605605
606606offs_t hd6309_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
607607{
src/emu/cpu/hd6309/hd6309.c
r1386r1387
277277#define SET_FLAGS8I(a)      {CC|=flags8i[(a)&0xff];}
278278#define SET_FLAGS8D(a)      {CC|=flags8d[(a)&0xff];}
279279
280static UINT8 *cycle_counts_page0;
281static UINT8 *cycle_counts_page01;
282static UINT8 *cycle_counts_page11;
283static UINT8 *index_cycle;
280static UINT8 const *cycle_counts_page0;
281static UINT8 const *cycle_counts_page01;
282static UINT8 const *cycle_counts_page11;
283static UINT8 const *index_cycle;
284284
285285/* combos */
286286#define SET_NZ8(a)         {SET_N8(a);SET_Z(a);}
src/emu/cpu/tlcs90/tlcs90.c
r1386r1387
6363typedef UINT16 e_r;
6464#define F   T90.af.b.l
6565
66static const char *r8_names[]   =   {   "b",   "c",   "d",   "e",   "h",   "l",   "a"                        };
67static const char *r16_names[]   =   {   "bc",   "de",   "hl",   "??",   "ix",   "iy",   "sp",   "af",   "af'",   "pc"   };
66static const char *const r8_names[]   =   {   "b",   "c",   "d",   "e",   "h",   "l",   "a"                        };
67static const char *const r16_names[]   =   {   "bc",   "de",   "hl",   "??",   "ix",   "iy",   "sp",   "af",   "af'",   "pc"   };
6868
6969// Condition Codes
7070
r1386r1387
107107static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */
108108static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */
109109
110static const char *cc_names[]   =   {   "f",   "lt",   "le",   "ule",   "ov",   "mi",   "z",   "c",   "",      "ge",   "gt",   "ugt",   "nov",   "pl",   "nz",   "nc"   };
110static const char *const cc_names[]   =   {   "f",   "lt",   "le",   "ule",   "ov",   "mi",   "z",   "c",   "",      "ge",   "gt",   "ugt",   "nov",   "pl",   "nz",   "nc"   };
111111
112112// Opcodes
113113
114114#define OP_16 0x80
115115typedef enum               {   UNKNOWN,   NOP,   EX,      EXX,   LD,      LDW,   LDA,   LDI,   LDIR,   LDD,   LDDR,   CPI,   CPIR,   CPD,   CPDR,   PUSH,   POP,   JP,      JR,      CALL,   CALLR,      RET,   RETI,   HALT,   DI,      EI,      SWI,   DAA,   CPL,   NEG,   LDAR,   RCF,   SCF,   CCF,   TSET,   BIT,   SET,   RES,   INC,   DEC,   INCX,   DECX,   INCW,   DECW,   ADD,   ADC,   SUB,   SBC,   AND,   XOR,   OR,      CP,      RLC,   RRC,   RL,      RR,      SLA,   SRA,   SLL,   SRL,   RLD,   RRD,   DJNZ,   MUL,   DIV      }   e_op;
116static const char *op_names[] =   {   "??",      "nop",   "ex",   "exx",   "ld",   "ldw",   "lda",   "ldi",   "ldir",   "ldd",   "lddr",   "cpi",   "cpir",   "cpd",   "cpdr",   "push",   "pop",   "jp",   "jr",   "call",   "callr",   "ret",   "reti",   "halt",   "di",   "ei",   "swi",   "daa",   "cpl",   "neg",   "ldar",   "rcf",   "scf",   "ccf",   "tset",   "bit",   "set",   "res",   "inc",   "dec",   "incx",   "decx",   "incw",   "decw",   "add",   "adc",   "sub",   "sbc",   "and",   "xor",   "or",   "cp",   "rlc",   "rrc",   "rl",   "rr",   "sla",   "sra",   "sll",   "srl",   "rld",   "rrd",   "djnz",   "mul",   "div"   };
116static const char *const op_names[] =   {   "??",      "nop",   "ex",   "exx",   "ld",   "ldw",   "lda",   "ldi",   "ldir",   "ldd",   "lddr",   "cpi",   "cpir",   "cpd",   "cpdr",   "push",   "pop",   "jp",   "jr",   "call",   "callr",   "ret",   "reti",   "halt",   "di",   "ei",   "swi",   "daa",   "cpl",   "neg",   "ldar",   "rcf",   "scf",   "ccf",   "tset",   "bit",   "set",   "res",   "inc",   "dec",   "incx",   "decx",   "incw",   "decw",   "add",   "adc",   "sub",   "sbc",   "and",   "xor",   "or",   "cp",   "rlc",   "rrc",   "rl",   "rr",   "sla",   "sra",   "sll",   "srl",   "rld",   "rrd",   "djnz",   "mul",   "div"   };
117117
118118typedef enum   {
119119   MODE_NONE,   MODE_BIT8,   MODE_CC,
r1386r1387
936936   OP( UNKNOWN,2 )      NONE( 1 )      NONE( 2 )
937937}
938938
939static const char *ir_names[] =   {
939static const char *const ir_names[] =   {
940940   "P0",      "P1",      "P01CR/IRFL",   "IRFH",      "P2",      "P2CR",      "P3",      "P3CR",
941941   "P4",      "P4CR",      "P5",         "SMMOD",   "P6",      "P7",      "P67CR",   "SMCR",
942942   "P8",      "P8CR",      "WDMOD",      "WDCR",      "TREG0",   "TREG1",   "TREG2",   "TREG3",
src/emu/cpu/s2650/s2650.c
r1386r1387
200200 * handy table to build PC relative offsets
201201 * from HR (holding register)
202202 ***************************************************************/
203static   int    S2650_relative[0x100] =
203static const int S2650_relative[0x100] =
204204{
205205     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
206206    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
src/emu/cpu/s2650/2650dasm.c
r1386r1387
2121#define MNEMO   1
2222
2323/* handy table to build relative offsets from HR (holding register) */
24static int rel[0x100] = {
24static const int rel[0x100] = {
2525     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
2626    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
2727    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
r1386r1387
6565}
6666
6767#if MNEMO
68static   char cc[4] = { 'z', 'p', 'm', 'a' };
68static const char cc[4] = { 'z', 'p', 'm', 'a' };
6969
7070/* format an immediate for PSL */
7171static char *IMM_PSL(int pc)
r1386r1387
136136   return buff;
137137}
138138#else
139static   char cc[4] = { '0', '1', '2', '3' };
139static const char cc[4] = { '0', '1', '2', '3' };
140140#define IMM_PSL IMM
141141#define IMM_PSU IMM
142142#endif
src/emu/cpu/e132xs/32xsdasm.c
r1386r1387
99#include "debugger.h"
1010#include "e132xs.h"
1111
12static const char *L_REG[] =
12static const char *const L_REG[] =
1313{
1414  "L0",  "L1",  "L2",  "L3",  "L4",  "L5",  "L6",  "L7",  "L8",  "L9",
1515  "L10", "L11", "L12", "L13", "L14", "L15", "L16", "L17", "L18", "L19",
r1386r1387
2020  "L60", "L61", "L62", "L63"
2121};
2222
23static const char *G_REG[] =
23static const char *const G_REG[] =
2424{
2525  "PC",  "SR",  "FER", "G03", "G04", "G05", "G06", "G07", "G08", "G09",
2626  "G10", "G11", "G12", "G13", "G14", "G15", "G16", "G17", "SP",  "UB",
r1386r1387
2828  "G30", "G31"
2929};
3030
31static const char *SETxx[] =
31static const char *const SETxx[] =
3232{
3333  "SETADR",   "Reserved", "SET1",   "SET0",     "SETLE",  "SETGT",  "SETLT",  "SETGE",
3434  "SETSE",    "SETHT",    "SETST",  "SETHE",    "SETE",   "SETNE",  "SETV",   "SETNV",
src/emu/cpu/e132xs/e132xsop.c
r1386r1387
18421842}
18431843
18441844
1845static void (*hyperstone_op[0x100])(UINT16 opcode) =
1845static void (*const hyperstone_op[0x100])(UINT16 opcode) =
18461846{
18471847   hyperstone_op00, hyperstone_op01, hyperstone_op02, hyperstone_op03,
18481848   hyperstone_op04, hyperstone_op05, hyperstone_op06, hyperstone_op07,
src/emu/cpu/i386/i386dasm.c
r1386r1387
10791079
10801080
10811081
1082static const char *i386_reg[3][16] =
1082static const char *const i386_reg[3][16] =
10831083{
10841084   {"ax",  "cx",  "dx",  "bx",  "sp",  "bp",  "si",  "di",  "r8w", "r9w", "r10w","r11w","r12w","r13w","r14w","r15w"},
10851085   {"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d","r11d","r12d","r13d","r14d","r15d"},
10861086   {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15"}
10871087};
10881088
1089static const char *i386_reg8[8] = {"al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"};
1090static const char *i386_reg8rex[16] = {"al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l"};
1091static const char *i386_sreg[8] = {"es", "cs", "ss", "ds", "fs", "gs", "???", "???"};
1089static const char *const i386_reg8[8] = {"al", "cl", "dl", "bl", "ah", "ch", "dh", "bh"};
1090static const char *const i386_reg8rex[16] = {"al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l"};
1091static const char *const i386_sreg[8] = {"es", "cs", "ss", "ds", "fs", "gs", "???", "???"};
10921092
10931093static int address_size;
10941094static int operand_size;
src/emu/cpu/i386/cycles.h
r1386r1387
337337   UINT8 cpu_cycles[X86_NUM_CPUS][2];
338338} X86_CYCLE_TABLE;
339339
340static X86_CYCLE_TABLE x86_cycle_table[] =
340static const X86_CYCLE_TABLE x86_cycle_table[] =
341341{
342342   // opcode                     rm/pmode
343343   //                            i386         i486         pentium      mediagx
src/emu/cpu/mc68hc11/hc11dasm.c
r1386r1387
3131   int address_mode;
3232} M68HC11_OPCODE;
3333
34static M68HC11_OPCODE opcode_table[256] =
34static const M68HC11_OPCODE opcode_table[256] =
3535{
3636   /* 0x00 - 0x0f */
3737   { "test",         0,                  },
r1386r1387
311311/*****************************************************************************/
312312
313313
314static M68HC11_OPCODE opcode_table_page2[256] =
314static const M68HC11_OPCODE opcode_table_page2[256] =
315315{
316316   /* 0x00 - 0x0f */
317317   { "?",            0,                  },
r1386r1387
591591/*****************************************************************************/
592592
593593
594static M68HC11_OPCODE opcode_table_page3[256] =
594static const M68HC11_OPCODE opcode_table_page3[256] =
595595{
596596   /* 0x00 - 0x0f */
597597   { "?",            0,                  },
r1386r1387
871871/*****************************************************************************/
872872
873873
874static M68HC11_OPCODE opcode_table_page4[256] =
874static const M68HC11_OPCODE opcode_table_page4[256] =
875875{
876876   /* 0x00 - 0x0f */
877877   { "?",            0,                  },
r1386r1387
11751175   return w;
11761176}
11771177
1178static UINT32 decode_opcode(UINT32 pc, M68HC11_OPCODE *op_table)
1178static UINT32 decode_opcode(UINT32 pc, const M68HC11_OPCODE *op_table)
11791179{
11801180   UINT8 imm8, mask;
11811181   INT8 rel8;
src/emu/cpu/mc68hc11/hc11ops.h
r1386r1387
44   void (*handler)(void);
55} HC11_OPCODE_LIST;
66
7static HC11_OPCODE_LIST hc11_opcode_list[] =
7static const HC11_OPCODE_LIST hc11_opcode_list[] =
88{
99   /*  page    opcode          handler                     */
1010   {   0,      0x1b,         HC11OP(aba)               },
src/emu/cpu/adsp2100/2100ops.c
r1386r1387
501501
502502#define READ_REG(grp,reg) ((*rd_reg[grp][reg])())
503503
504static INT32 (*rd_reg[4][16])(void) =
504static INT32 (*const rd_reg[4][16])(void) =
505505{
506506   {
507507      rd_ax0, rd_ax1, rd_mx0, rd_mx1, rd_ay0, rd_ay1, rd_my0, rd_my1,
src/emu/cpu/adsp2100/2100dasm.c
r1386r1387
11#include "adsp2100.h"
22
3static const char *flag_change[] = { "", "TOGGLE %s ", "RESET %s ", "SET %s " };
4static const char *mode_change[] = { "", "", "DIS %s ", "ENA %s " };
3static const char *const flag_change[] = { "", "TOGGLE %s ", "RESET %s ", "SET %s " };
4static const char *const mode_change[] = { "", "", "DIS %s ", "ENA %s " };
55
6static const char *alu_xop[] = { "AX0", "AX1", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" };
7static const char *alu_yop[] = { "AY0", "AY1", "AF", "0" };
8static const char *alu_dst[] = { "AR", "AF", "NONE" };
6static const char *const alu_xop[] = { "AX0", "AX1", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" };
7static const char *const alu_yop[] = { "AY0", "AY1", "AF", "0" };
8static const char *const alu_dst[] = { "AR", "AF", "NONE" };
99
10static const char *mac_xop[] = { "MX0", "MX1", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" };
11static const char *mac_yop[] = { "MY0", "MY1", "MF", "0" };
12static const char *mac_dst[] = { "MR", "MF" };
10static const char *const mac_xop[] = { "MX0", "MX1", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" };
11static const char *const mac_yop[] = { "MY0", "MY1", "MF", "0" };
12static const char *const mac_dst[] = { "MR", "MF" };
1313
14static const char *shift_xop[] = { "SI", "??", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" };
14static const char *const shift_xop[] = { "SI", "??", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" };
1515
16static const char *reg_grp[][16] =
16static const char *const reg_grp[][16] =
1717{
1818   { "AX0", "AX1", "MX0", "MX1", "AY0", "AY1", "MY0", "MY1", "SI", "SE", "AR", "MR0", "MR1", "MR2", "SR0", "SR1" },
1919   { "I0", "I1", "I2", "I3", "M0", "M1", "M2", "M3", "L0", "L1", "L2", "L3", "??", "??", "??", "??" },
2020   { "I4", "I5", "I6", "I7", "M4", "M5", "M6", "M7", "L4", "L5", "L6", "L7", "??", "??", "??", "??" },
2121   { "ASTAT", "MSTAT", "SSTAT", "IMASK", "ICNTL", "CNTR", "SB", "PX", "RX0", "TX0", "RX1", "TX1", "IFC", "OWRCNTR", "??", "??" }
2222};
23static const char *dual_xreg[] = { "AX0", "AX1", "MX0", "MX1" };
24static const char *dual_yreg[] = { "AY0", "AY1", "MY0", "MY1" };
23static const char *const dual_xreg[] = { "AX0", "AX1", "MX0", "MX1" };
24static const char *const dual_yreg[] = { "AY0", "AY1", "MY0", "MY1" };
2525
26static const char *condition[] =
26static const char *const condition[] =
2727{
2828   "IF EQ ",
2929   "IF NE ",
r1386r1387
4343   ""
4444};
4545
46static const char *do_condition[] =
46static const char *const do_condition[] =
4747{
4848   "NE",
4949   "EQ",
r1386r1387
6363   "FOREVER"
6464};
6565
66static const char *alumac_op[][2] =
66static const char *const alumac_op[][2] =
6767{
6868   { "",                            "" },
6969   { "%s = %s * %s (RND)",          "%s = %s * %s (RND)" },
r1386r1387
100100   { "%s = ABS %s",                 "%s = ABS %s" }
101101};
102102
103static const char *shift_op[] =
103static const char *const shift_op[] =
104104{
105105   "SR = LSHIFT %s (HI)",
106106   "SR = SR OR LSHIFT %s (HI)",
r1386r1387
120120   "SB = EXPADJ %s",
121121};
122122
123static const char *shift_by_op[] =
123static const char *const shift_by_op[] =
124124{
125125   "SR = LSHIFT %s BY %d (HI)",
126126   "SR = SR OR LSHIFT %s BY %d (HI)",
r1386r1387
140140   "???"
141141};
142142
143static const char *constants[] =
143static const char *const constants[] =
144144{
145145   "$0001",
146146   "$FFFE",
src/emu/cpu/dsp32/dsp32.c
r1386r1387
458458   return context;
459459}
460460
461static UINT32 regmap[4][16] =
461static const UINT32 regmap[4][16] =
462462{
463463   {   /* DSP32 compatible mode */
464464      PIO_PAR|LOWER, PIO_PAR|UPPER, PIO_PDR|LOWER, PIO_PDR|UPPER,
src/emu/cpu/dsp32/dsp32dis.c
r1386r1387
2222    CODE CODE
2323***************************************************************************/
2424
25static const char *sizesuffix[] = { "", "e" };
26static const char *unarysign[] = { "", "-" };
27static const char *sign[] = { "+", "-" };
28static const char *aMvals[] = { "a0", "a1", "a2", "a3", "0.0", "1.0", "Format 4", "Reserved" };
29static const char *memsuffix[] = { "h", "l", "", "e" };
30static const char *functable[] =
25static const char *const sizesuffix[] = { "", "e" };
26static const char *const unarysign[] = { "", "-" };
27static const char *const sign[] = { "+", "-" };
28static const char *const aMvals[] = { "a0", "a1", "a2", "a3", "0.0", "1.0", "Format 4", "Reserved" };
29static const char *const memsuffix[] = { "h", "l", "", "e" };
30static const char *const functable[] =
3131{
3232   "ic", "oc", "float", "int", "round", "ifalt", "ifaeq", "ifagt",
3333   "reserved8", "reserved9", "float24", "int24", "ieee", "dsp", "seed", "reservedf"
3434};
35static const char *condtable[] =
35static const char *const condtable[] =
3636{
3737   "false", "true",
3838   "pl", "mi",
r1386r1387
6767   "!?1e", "?1e",
6868   "!?1f", "?1f"
6969};
70static const char *regname[] =
70static const char *const regname[] =
7171{
7272   "0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
7373   "r8", "r9", "r10", "r11", "r12", "r13", "r14", "pc",
7474   "0", "r15", "r16", "r17", "r18", "r19", "-1", "1",
7575   "r20", "r21", "dauc", "ioc", "res1c", "r22", "pcsh", "res1f"
7676};
77static const char *regnamee[] =
77static const char *const regnamee[] =
7878{
7979   "0", "r1e", "r2e", "r3e", "r4e", "r5e", "r6e", "r7e",
8080   "r8e", "r9e", "r10e", "r11e", "r12e", "r13e", "r14e", "pce",
src/emu/cpu/dsp32/dsp32ops.c
r1386r1387
9696    FORWARD DECLARATIONS
9797***************************************************************************/
9898
99extern void (*dsp32ops[])(void);
99extern void (*const dsp32ops[])(void);
100100
101101
102102
r1386r1387
25342534    FUNCTION TABLE
25352535***************************************************************************/
25362536
2537void (*dsp32ops[])(void) =
2537void (*const dsp32ops[])(void) =
25382538{
25392539   nop,      goto_t,      goto_pl,   goto_mi,   goto_ne,   goto_eq,   goto_vc,   goto_vs,   /* 00 */
25402540   goto_cc,   goto_cs,   goto_ge,   goto_lt,   goto_gt,   goto_le,   goto_hi,   goto_ls,
src/emu/cpu/x86drc.c
r1386r1387
1919
2020
2121
22static UINT16 fp_control[4] = { 0x023f, 0x063f, 0x0a3f, 0x0e3f };
23static UINT32 sse_control[4] = { 0x9fc0, 0xbfc0, 0xdfc0, 0xffc0 };
22static const UINT16 fp_control[4] = { 0x023f, 0x063f, 0x0a3f, 0x0e3f };
23static const UINT32 sse_control[4] = { 0x9fc0, 0xbfc0, 0xdfc0, 0xffc0 };
2424
2525
2626static void append_entry_point(drc_core *drc);
src/emu/cpu/rsp/rsp_dasm.c
r1386r1387
77#include "cpuintrf.h"
88#include <stdarg.h>
99
10static const char *reg[32] =
10static const char *const reg[32] =
1111{
1212   "0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
1313   "r8",   "r9",   "r10",   "r11",   "r12",   "r13",   "r14",   "r15",
r1386r1387
1515   "r24",   "r25",   "r26",   "r27",   "r28",   "r29",   "r30",   "r31"
1616};
1717
18static const char *vreg[32] =
18static const char *const vreg[32] =
1919{
2020   " v0", " v1", " v2", " v3", " v4", " v5", " v6", " v7",
2121   " v8", " v9", "v10", "v11", "v12", "v13", "v14", "v15",
r1386r1387
2323   "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31"
2424};
2525
26static const char *cop0_regs[32] =
26static const char *const cop0_regs[32] =
2727{
2828   "SP_MEM_ADDR",  "SP_DRAM_ADDR",    "SP_RD_LEN",    "SP_WR_LEN",
2929   "SP_STATUS",    "SP_DMA_FULL",     "SP_DMA_BUSY",  "SP_SEMAPHORE",
r1386r1387
3535   "???",          "???",             "???",          "???"
3636};
3737
38static const char *element[16] =
38static const char *const element[16] =
3939{
4040   "",           "[???]",      "[00224466]", "[11335577]", "[00004444]", "[11115555]", "[22226666]", "[33337777]",
4141   "[00000000]", "[11111111]", "[22222222]", "[33333333]", "[44444444]", "[55555555]", "[66666666]", "[77777777]"
4242};
4343
44static const char *element2[16] =
44static const char *const element2[16] =
4545{
4646   "01234567", "????????", "00224466", "11335577", "00004444", "11115555", "22226666", "33337777",
4747   "00000000", "11111111", "22222222", "33333333", "44444444", "55555555", "66666666", "77777777"
src/emu/cpu/cop400/cop410.c
r1386r1387
5353
5454#include "410ops.c"
5555
56static s_opcode cop410_opcode_op33[256]=
56static const s_opcode cop410_opcode_op33[256]=
5757{
5858   {1, illegal    },{1, skgbz0   },{1, illegal   },{1, skgbz2   },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
5959   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
r1386r1387
9494   (*(cop410_opcode_op33[ROM(PC++)].function))();
9595}
9696
97static s_opcode cop410_opcode_main[256]=
97static const s_opcode cop410_opcode_main[256]=
9898{
9999   {1, clra      },{1, skmbz0   },{1, xor      },{1, skmbz2      },{1, xis0      },{1, ld0      },{1, x0      },{1, xds0      },
100100   {1, lbi0_9      },{1, lbi0_10   },{1, lbi0_11   },{1, lbi0_12      },{1, lbi0_13   },{1, lbi0_14   },{1, lbi0_15   },{1, lbi0_0   },
src/emu/cpu/cop400/cop420.c
r1386r1387
5757
5858#include "420ops.c"
5959
60static s_opcode cop420_opcode_op33[256]=
60static const s_opcode cop420_opcode_op33[256]=
6161{
6262   {1, inil       },{1, skgbz0    },{1, illegal    },{1, skgbz2    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
6363   {1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },{1, illegal    },
r1386r1387
9898   (*(cop420_opcode_op33[ROM(PC++)].function))();
9999}
100100
101static s_opcode cop420_opcode_main[256]=
101static const s_opcode cop420_opcode_main[256]=
102102{
103103   {1, clra      },{1, skmbz0   },{1, xor      },{1, skmbz2      },{1, xis0      },{1, ld0      },{1, x0      },{1, xds0      },
104104   {1, lbi0_9      },{1, lbi0_10   },{1, lbi0_11   },{1, lbi0_12      },{1, lbi0_13   },{1, lbi0_14   },{1, lbi0_15   },{1, lbi0_0   },
src/emu/cpu/m6502/6502dasm.c
r1386r1387
9797};
9898
9999
100static const char *token[]=
100static const char *const token[]=
101101{
102102   "adc", "and", "asl", "bcc", "bcs", "beq", "bit", "bmi",
103103   "bne", "bpl", "m6502_brk", "bvc", "bvs", "clc", "cld", "cli",
src/emu/cpu/m6502/tdeco16.c
r1386r1387
393393OP(df) { RD_DUM; ILL; }                           /* 2 ILL / 5 BBS5 ZPG ?? */
394394OP(ff) { RD_DUM; ILL; }                           /* 2 ILL / 5 BBS7 ZPG ?? */
395395
396static void (*insndeco16[0x100])(void) = {
396static void (*const insndeco16[0x100])(void) = {
397397   deco16_00,deco16_01,deco16_02,deco16_03,deco16_04,deco16_05,deco16_06,deco16_07,
398398   deco16_08,deco16_09,deco16_0a,deco16_0b,deco16_0c,deco16_0d,deco16_0e,deco16_0f,
399399   deco16_10,deco16_11,deco16_12,deco16_13,deco16_14,deco16_15,deco16_16,deco16_17,
src/emu/cpu/m6502/m4510.c
r1386r1387
125125
126126
127127typedef struct {
128   void   (**insn)(void); /* pointer to the function pointer table */
128   void   (*const *insn)(void); /* pointer to the function pointer table */
129129   PAIR   ppc;         /* previous program counter */
130130   PAIR   pc;          /* program counter */
131131   PAIR   sp;          /* stack pointer (always 100 - 1FF) */
src/emu/cpu/m6502/t65sc02.c
r1386r1387
4343 * op    temp     cycles             rdmem   opc  wrmem   ********************/
4444OP(63) { BSR;                                             } /* 5? BSR */
4545
46static void (*insn65sc02[0x100])(void) = {
46static void (*const insn65sc02[0x100])(void) = {
4747   m65c02_00,m65c02_01,m65c02_02,m65c02_03,m65c02_04,m65c02_05,m65c02_06,m65c02_07,
4848   m65c02_08,m65c02_09,m65c02_0a,m65c02_0b,m65c02_0c,m65c02_0d,m65c02_0e,m65c02_0f,
4949   m65c02_10,m65c02_11,m65c02_12,m65c02_13,m65c02_14,m65c02_15,m65c02_16,m65c02_17,
src/emu/cpu/m6502/tn2a03.c
r1386r1387
6060OP(7d) { int tmp; RD_ABX_P; ADC_NES;     } /* 4 ADC ABX page penalty */
6161OP(fd) { int tmp; RD_ABX_P; SBC_NES;     } /* 4 SBC ABX page penalty */
6262
63static void (*insn2a03[0x100])(void) = {
63static void (*const insn2a03[0x100])(void) = {
6464   m6502_00,m6502_01,m6502_02,m6502_03,m6502_04,m6502_05,m6502_06,m6502_07,
6565   m6502_08,m6502_09,m6502_0a,m6502_0b,m6502_0c,m6502_0d,m6502_0e,m6502_0f,
6666   m6502_10,m6502_11,m6502_12,m6502_13,m6502_14,m6502_15,m6502_16,m6502_17,
r1386r1387
9494   m6502_f0,n2a03_f1,m6502_f2,m6502_f3,m6502_f4,n2a03_f5,m6502_f6,m6502_f7,
9595   m6502_f8,n2a03_f9,m6502_fa,m6502_fb,m6502_fc,n2a03_fd,m6502_fe,m6502_ff
9696};
97
src/emu/cpu/m6502/m6502.c
r1386r1387
5959typedef struct
6060{
6161   UINT8   subtype;      /* currently selected cpu sub type */
62   void   (**insn)(void); /* pointer to the function pointer table */
62   void   (*const *insn)(void); /* pointer to the function pointer table */
6363   PAIR   ppc;         /* previous program counter */
6464   PAIR   pc;          /* program counter */
6565   PAIR   sp;          /* stack pointer (always 100 - 1FF) */
r1386r1387
127127 *
128128 *****************************************************************************/
129129
130static void m6502_common_init(int index, int clock, const void *config, int (*irqcallback)(int), UINT8 subtype, void (**insn)(void), const char *type)
130static void m6502_common_init(int index, int clock, const void *config, int (*irqcallback)(int), UINT8 subtype, void (*const *insn)(void), const char *type)
131131{
132132   memset(&m6502, 0, sizeof(m6502));
133133   m6502.irq_callback = irqcallback;
src/emu/cpu/m6502/m6509.c
r1386r1387
6262
6363typedef struct {
6464   UINT8   subtype;      /* currently selected cpu sub type */
65   void   (**insn)(void); /* pointer to the function pointer table */
65   void   (*const *insn)(void); /* pointer to the function pointer table */
6666   PAIR   ppc;         /* previous program counter */
6767   /* pc.w.h contains the current page pc_bank.w.h for better speed */
6868   PAIR   pc;          /* program counter */
src/emu/cpu/m6502/t6502.c
r1386r1387
323323
324324/* and here's the array of function pointers */
325325
326static void (*insn6502[0x100])(void) = {
326static void (*const insn6502[0x100])(void) = {
327327   m6502_00,m6502_01,m6502_02,m6502_03,m6502_04,m6502_05,m6502_06,m6502_07,
328328   m6502_08,m6502_09,m6502_0a,m6502_0b,m6502_0c,m6502_0d,m6502_0e,m6502_0f,
329329   m6502_10,m6502_11,m6502_12,m6502_13,m6502_14,m6502_15,m6502_16,m6502_17,
src/emu/cpu/m6502/t65c02.c
r1386r1387
326326OP(df) { int tmp; RD_ZPG; BBS(5);                   } /* 5-7 BBS5 ZPG */
327327OP(ff) { int tmp; RD_ZPG; BBS(7);                   } /* 5-7 BBS7 ZPG */
328328
329static void (*insn65c02[0x100])(void) = {
329static void (*const insn65c02[0x100])(void) = {
330330   m65c02_00,m65c02_01,m65c02_02,m65c02_03,m65c02_04,m65c02_05,m65c02_06,m65c02_07,
331331   m65c02_08,m65c02_09,m65c02_0a,m65c02_0b,m65c02_0c,m65c02_0d,m65c02_0e,m65c02_0f,
332332   m65c02_10,m65c02_11,m65c02_12,m65c02_13,m65c02_14,m65c02_15,m65c02_16,m65c02_17,
src/emu/cpu/m6502/t6509.c
r1386r1387
314314OP(df) { int tmp; RD_ABX_NP; WB_EA; DCP; WB_EA; } /* 7 DCP ABX */
315315OP(ff) { int tmp; RD_ABX_NP; WB_EA; ISB; WB_EA; } /* 7 ISB ABX */
316316
317static void (*insn6509[0x100])(void) = {
317static void (*const insn6509[0x100])(void) = {
318318   m6509_00,m6509_01,m6509_02,m6509_03,m6509_04,m6509_05,m6509_06,m6509_07,
319319   m6509_08,m6509_09,m6509_0a,m6509_0b,m6509_0c,m6509_0d,m6509_0e,m6509_0f,
320320   m6509_10,m6509_11,m6509_12,m6509_13,m6509_14,m6509_15,m6509_16,m6509_17,
src/emu/cpu/m6502/t65ce02.c
r1386r1387
326326OP(ff) { int tmp; RD_ZPG; BBS(7); } /* 4 BBS7 ZPG */
327327
328328#ifdef M4510
329static void (*insn4510[0x100])(void) = {
329static void (*const insn4510[0x100])(void) = {
330330   m4510_00,m4510_01,m4510_02,m4510_03,m4510_04,m4510_05,m4510_06,m4510_07,
331331   m4510_08,m4510_09,m4510_0a,m4510_0b,m4510_0c,m4510_0d,m4510_0e,m4510_0f,
332332   m4510_10,m4510_11,m4510_12,m4510_13,m4510_14,m4510_15,m4510_16,m4510_17,
r1386r1387
361361   m4510_f8,m4510_f9,m4510_fa,m4510_fb,m4510_fc,m4510_fd,m4510_fe,m4510_ff
362362};
363363#else
364static void (*insn65ce02[0x100])(void) = {
364static void (*const insn65ce02[0x100])(void) = {
365365   m65ce02_00,m65ce02_01,m65ce02_02,m65ce02_03,m65ce02_04,m65ce02_05,m65ce02_06,m65ce02_07,
366366   m65ce02_08,m65ce02_09,m65ce02_0a,m65ce02_0b,m65ce02_0c,m65ce02_0d,m65ce02_0e,m65ce02_0f,
367367   m65ce02_10,m65ce02_11,m65ce02_12,m65ce02_13,m65ce02_14,m65ce02_15,m65ce02_16,m65ce02_17,
src/emu/cpu/jaguar/jagdasm.c
r1386r1387
2323static const UINT8 convert_zero[32] =
2424{ 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 };
2525
26static const char *condition[32] =
26static const char *const condition[32] =
2727{
2828   "",
2929   "nz,",
src/emu/cpu/jaguar/jaguar.c
r1386r1387
9292   int         isdsp;
9393   int         op;
9494   int         interrupt_cycles;
95   void       (**table)(void);
95   void       (*const *table)(void);
9696   int       (*irq_callback)(int irqline);
9797   void      (*cpu_interrupt)(void);
9898} jaguar_regs;
r1386r1387
197197static void subqt_n_rn(void);
198198static void xor_rn_rn(void);
199199
200static void (*gpu_op_table[64])(void) =
200static void (*const gpu_op_table[64])(void) =
201201{
202202   /* 00-03 */   add_rn_rn,      addc_rn_rn,      addq_n_rn,      addqt_n_rn,
203203   /* 04-07 */   sub_rn_rn,      subc_rn_rn,      subq_n_rn,      subqt_n_rn,
r1386r1387
217217   /* 60-63 */   store_rn_r14rn,   store_rn_r15rn,   sat24_rn,      pack_rn
218218};
219219
220static void (*dsp_op_table[64])(void) =
220static void (*const dsp_op_table[64])(void) =
221221{
222222   /* 00-03 */   add_rn_rn,      addc_rn_rn,      addq_n_rn,      addqt_n_rn,
223223   /* 04-07 */   sub_rn_rn,      subc_rn_rn,      subq_n_rn,      subqt_n_rn,
src/emu/cpu/ssp1610/ssp1610d.c
r1386r1387
1010#include "cpuintrf.h"
1111
1212
13static const char* reg[] =
13static const char *const reg[] =
1414{
1515   "-", "X", "Y", "A", "ST", "STACK", "PC", "P", "AL", "?", "?", "XST", "PL", "?", "?", "SRCR", "BRCR", "BRER",
1616   "XRD0", "XRD1", "AE", "DIOR", "GR22", "GR23", "EXT0", "EXT1", "EXT2", "EXT3", "EXT4", "EXT5", "EXT6", "EXT7"
1717};
1818
19static const char* rij[] =
19static const char *const rij[] =
2020{
2121   "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7"
2222};
2323
24static const char* erij[] =
24static const char *const erij[] =
2525{
2626   "er0", "er1", "er2", "er3", "er4", "er5", "er6", "er7"
2727};
2828
29static const char* modifier[] =
29static const char *const modifier[] =
3030{
3131   "", "+!", "-", "+"
3232};
3333
34static const char* cond[] =
34static const char *const cond[] =
3535{
3636   "always", "always", "RESERVED", "RESERVED", "gpi0=0", "gpi0=1", "gpi1=0", "gpi1=1", "l=0", "l=1", "z=0", "z=1", "ov=0", "ov=1", "n=0", "n=1",
3737    "diof=0", "diof=1", "gpi2=0", "gpi2=1", "gpi3=0", "gpi3=1", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED", "RESERVED"
3838};
3939
40static const char* acc_op[] =
40static const char *const acc_op[] =
4141{
4242   "ror", "rol", "shr", "shl", "inc", "dec", "neg", "abs"
4343};
4444
4545// pag. 81 uses different addresses!
46static const char* flag_op[] =
46static const char *const flag_op[] =
4747{
4848   "?", "?", "resl", "setl", "resie", "setie", "?", "?", "resop", "setop", "?", "?", "?", "?", "res", "set"
4949};
5050
5151
52static const char* st_mod[] =
52static const char *const st_mod[] =
5353{
5454   "macs", "rpl", "gpo", "rb", "gpo0", "gpo1", "gpo2", "gpo3", "wte", "diof", "bre", "reserved", "reserved", "reserved", "reserved", "reserved"
5555};
src/emu/cpu/i8085/i8085daa.h
r1386r1387
1static UINT16 DAA[2048] = {
1static const UINT16 DAA[2048] = {
22  (0x00<<8)   +ZF         +VF      ,
33  (0x01<<8)                        ,
44  (0x02<<8)                        ,
src/emu/cpu/powerpc/drc_ops.h
r1386r1387
1static PPC_OPCODE ppcdrc_opcode_common[] =
1static const PPC_OPCODE ppcdrc_opcode_common[] =
22{
33   /*code  subcode         handler                 */
44   { 31,   266,         recompile_addx            },
src/emu/cpu/powerpc/ppc.c
r1386r1387
44#include "ppc.h"
55#include "debugger.h"
66
7#if (HAS_PPC603 || HAS_PPC601)
7#if (HAS_PPC603 || HAS_PPC601 || HAS_PPC604)
88void ppc603_exception(int exception);
99#endif
1010#if (HAS_PPC602)
r1386r1387
7171   if((ppc.msr & 0x2000) == 0){   \
7272   }
7373
74#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
74#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
7575static UINT32      ppc_field_xlat[256];
7676#endif
7777
r1386r1387
249249   FPR   fpr[32];
250250   UINT32 sr[16];
251251
252#if HAS_PPC603 || HAS_PPC601 || HAS_MPC8240
252#if HAS_PPC603 || HAS_PPC601 || HAS_MPC8240 || HAS_PPC604
253253   int is603;
254254#endif
255255#if HAS_PPC602
r1386r1387
281281   void (*write16_unaligned)(offs_t address, UINT16 data);
282282   void (*write32_unaligned)(offs_t address, UINT32 data);
283283   void (*write64_unaligned)(offs_t address, UINT64 data);
284
285   void (* optable19[1024])(UINT32);
286   void (* optable31[1024])(UINT32);
287   void (* optable59[1024])(UINT32);
288   void (* optable63[1024])(UINT32);
289   void (* optable[64])(UINT32);
284290} PPC_REGS;
285291
286292
r1386r1387
317323
318324INLINE int IS_PPC603(void)
319325{
320#if HAS_PPC603 || HAS_PPC601
326#if HAS_PPC603 || HAS_PPC601 || HAS_PPC604
321327   return ppc.is603;
322328#else
323329   return 0;
r1386r1387
480486      case SPR_PVR:      return;
481487   }
482488
483#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601)
489#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601 || HAS_PPC604)
484490   if(IS_PPC602() || IS_PPC603()) {
485491      switch(spr)
486492      {
r1386r1387
492498               if (IS_PPC602())
493499                  ppc602_exception(EXCEPTION_DECREMENTER);
494500#endif
495#if HAS_PPC603 || HAS_PPC601
501#if HAS_PPC603 || HAS_PPC601 || HAS_PPC604
496502               if (IS_PPC603())
497503                  ppc603_exception(EXCEPTION_DECREMENTER);
498504#endif
r1386r1387
691697   }
692698#endif
693699
694#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601)
700#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601 || HAS_PPC604)
695701   if (IS_PPC603() || IS_PPC602())
696702   {
697703      switch (spr)
r1386r1387
817823
818824/***********************************************************************/
819825
820static void (* optable19[1024])(UINT32);
821static void (* optable31[1024])(UINT32);
822static void (* optable59[1024])(UINT32);
823static void (* optable63[1024])(UINT32);
824static void (* optable[64])(UINT32);
825
826826#include "ppc_mem.c"
827827
828828#if (HAS_PPC403)
r1386r1387
833833#include "ppc602.c"
834834#endif
835835
836#if (HAS_PPC603 || HAS_PPC601 || HAS_MPC8240)
836#if (HAS_PPC603 || HAS_PPC601 || HAS_MPC8240 || HAS_PPC604)
837837#include "ppc603.c"
838838#endif
839839
r1386r1387
851851   memset(&ppc, 0, sizeof(ppc));
852852
853853   for( i=0; i < 64; i++ ) {
854      optable[i] = ppc_invalid;
854      ppc.optable[i] = ppc_invalid;
855855   }
856856   for( i=0; i < 1024; i++ ) {
857      optable19[i] = ppc_invalid;
858      optable31[i] = ppc_invalid;
859      optable59[i] = ppc_invalid;
860      optable63[i] = ppc_invalid;
857      ppc.optable19[i] = ppc_invalid;
858      ppc.optable31[i] = ppc_invalid;
859      ppc.optable59[i] = ppc_invalid;
860      ppc.optable63[i] = ppc_invalid;
861861   }
862862
863863   /* Fill the opcode tables */
r1386r1387
866866      switch(ppc_opcode_common[i].code)
867867      {
868868         case 19:
869            optable19[ppc_opcode_common[i].subcode] = ppc_opcode_common[i].handler;
869            ppc.optable19[ppc_opcode_common[i].subcode] = ppc_opcode_common[i].handler;
870870            break;
871871
872872         case 31:
873            optable31[ppc_opcode_common[i].subcode] = ppc_opcode_common[i].handler;
873            ppc.optable31[ppc_opcode_common[i].subcode] = ppc_opcode_common[i].handler;
874874            break;
875875
876876         case 59:
r1386r1387
878878            break;
879879
880880         default:
881            optable[ppc_opcode_common[i].code] = ppc_opcode_common[i].handler;
881            ppc.optable[ppc_opcode_common[i].code] = ppc_opcode_common[i].handler;
882882      }
883883
884884   }
r1386r1387
908908   ppc_init();
909909
910910   /* PPC403 specific opcodes */
911   optable31[454] = ppc_dccci;
912   optable31[486] = ppc_dcread;
913   optable31[262] = ppc_icbt;
914   optable31[966] = ppc_iccci;
915   optable31[998] = ppc_icread;
916   optable31[323] = ppc_mfdcr;
917   optable31[451] = ppc_mtdcr;
918   optable31[131] = ppc_wrtee;
919   optable31[163] = ppc_wrteei;
911   ppc.optable31[454] = ppc_dccci;
912   ppc.optable31[486] = ppc_dcread;
913   ppc.optable31[262] = ppc_icbt;
914   ppc.optable31[966] = ppc_iccci;
915   ppc.optable31[998] = ppc_icread;
916   ppc.optable31[323] = ppc_mfdcr;
917   ppc.optable31[451] = ppc_mtdcr;
918   ppc.optable31[131] = ppc_wrtee;
919   ppc.optable31[163] = ppc_wrteei;
920920
921921   // !!! why is rfci here !!!
922   optable19[51] = ppc_rfci;
922   ppc.optable19[51] = ppc_rfci;
923923
924924   ppc.spu.rx_timer = timer_alloc(ppc403_spu_rx_callback, NULL);
925925   ppc.spu.tx_timer = timer_alloc(ppc403_spu_tx_callback, NULL);
r1386r1387
957957
958958   ppc_init() ;
959959
960   optable[48] = ppc_lfs;
961   optable[49] = ppc_lfsu;
962   optable[50] = ppc_lfd;
963   optable[51] = ppc_lfdu;
964   optable[52] = ppc_stfs;
965   optable[53] = ppc_stfsu;
966   optable[54] = ppc_stfd;
967   optable[55] = ppc_stfdu;
968   optable31[631] = ppc_lfdux;
969   optable31[599] = ppc_lfdx;
970   optable31[567] = ppc_lfsux;
971   optable31[535] = ppc_lfsx;
972   optable31[595] = ppc_mfsr;
973   optable31[659] = ppc_mfsrin;
974   optable31[371] = ppc_mftb;
975   optable31[210] = ppc_mtsr;
976   optable31[242] = ppc_mtsrin;
977   optable31[758] = ppc_dcba;
978   optable31[759] = ppc_stfdux;
979   optable31[727] = ppc_stfdx;
980   optable31[983] = ppc_stfiwx;
981   optable31[695] = ppc_stfsux;
982   optable31[663] = ppc_stfsx;
983   optable31[370] = ppc_tlbia;
984   optable31[306] = ppc_tlbie;
985   optable31[566] = ppc_tlbsync;
986   optable31[310] = ppc_eciwx;
987   optable31[438] = ppc_ecowx;
960   ppc.optable[48] = ppc_lfs;
961   ppc.optable[49] = ppc_lfsu;
962   ppc.optable[50] = ppc_lfd;
963   ppc.optable[51] = ppc_lfdu;
964   ppc.optable[52] = ppc_stfs;
965   ppc.optable[53] = ppc_stfsu;
966   ppc.optable[54] = ppc_stfd;
967   ppc.optable[55] = ppc_stfdu;
968   ppc.optable31[631] = ppc_lfdux;
969   ppc.optable31[599] = ppc_lfdx;
970   ppc.optable31[567] = ppc_lfsux;
971   ppc.optable31[535] = ppc_lfsx;
972   ppc.optable31[595] = ppc_mfsr;
973   ppc.optable31[659] = ppc_mfsrin;
974   ppc.optable31[371] = ppc_mftb;
975   ppc.optable31[210] = ppc_mtsr;
976   ppc.optable31[242] = ppc_mtsrin;
977   ppc.optable31[758] = ppc_dcba;
978   ppc.optable31[759] = ppc_stfdux;
979   ppc.optable31[727] = ppc_stfdx;
980   ppc.optable31[983] = ppc_stfiwx;
981   ppc.optable31[695] = ppc_stfsux;
982   ppc.optable31[663] = ppc_stfsx;
983   ppc.optable31[370] = ppc_tlbia;
984   ppc.optable31[306] = ppc_tlbie;
985   ppc.optable31[566] = ppc_tlbsync;
986   ppc.optable31[310] = ppc_eciwx;
987   ppc.optable31[438] = ppc_ecowx;
988988
989   optable63[264] = ppc_fabsx;
990   optable63[21] = ppc_faddx;
991   optable63[32] = ppc_fcmpo;
992   optable63[0] = ppc_fcmpu;
993   optable63[14] = ppc_fctiwx;
994   optable63[15] = ppc_fctiwzx;
995   optable63[18] = ppc_fdivx;
996   optable63[72] = ppc_fmrx;
997   optable63[136] = ppc_fnabsx;
998   optable63[40] = ppc_fnegx;
999   optable63[12] = ppc_frspx;
1000   optable63[26] = ppc_frsqrtex;
1001   optable63[22] = ppc_fsqrtx;
1002   optable63[20] = ppc_fsubx;
1003   optable63[583] = ppc_mffsx;
1004   optable63[70] = ppc_mtfsb0x;
1005   optable63[38] = ppc_mtfsb1x;
1006   optable63[711] = ppc_mtfsfx;
1007   optable63[134] = ppc_mtfsfix;
1008   optable63[64] = ppc_mcrfs;
989   ppc.optable63[264] = ppc_fabsx;
990   ppc.optable63[21] = ppc_faddx;
991   ppc.optable63[32] = ppc_fcmpo;
992   ppc.optable63[0] = ppc_fcmpu;
993   ppc.optable63[14] = ppc_fctiwx;
994   ppc.optable63[15] = ppc_fctiwzx;
995   ppc.optable63[18] = ppc_fdivx;
996   ppc.optable63[72] = ppc_fmrx;
997   ppc.optable63[136] = ppc_fnabsx;
998   ppc.optable63[40] = ppc_fnegx;
999   ppc.optable63[12] = ppc_frspx;
1000   ppc.optable63[26] = ppc_frsqrtex;
1001   ppc.optable63[22] = ppc_fsqrtx;
1002   ppc.optable63[20] = ppc_fsubx;
1003   ppc.optable63[583] = ppc_mffsx;
1004   ppc.optable63[70] = ppc_mtfsb0x;
1005   ppc.optable63[38] = ppc_mtfsb1x;
1006   ppc.optable63[711] = ppc_mtfsfx;
1007   ppc.optable63[134] = ppc_mtfsfix;
1008   ppc.optable63[64] = ppc_mcrfs;
10091009
1010   optable59[21] = ppc_faddsx;
1011   optable59[18] = ppc_fdivsx;
1012   optable59[24] = ppc_fresx;
1013   optable59[22] = ppc_fsqrtsx;
1014   optable59[20] = ppc_fsubsx;
1010   ppc.optable59[21] = ppc_faddsx;
1011   ppc.optable59[18] = ppc_fdivsx;
1012   ppc.optable59[24] = ppc_fresx;
1013   ppc.optable59[22] = ppc_fsqrtsx;
1014   ppc.optable59[20] = ppc_fsubsx;
10151015
10161016   for(i = 0; i < 32; i++)
10171017   {
1018      optable63[i * 32 | 29] = ppc_fmaddx;
1019      optable63[i * 32 | 28] = ppc_fmsubx;
1020      optable63[i * 32 | 25] = ppc_fmulx;
1021      optable63[i * 32 | 31] = ppc_fnmaddx;
1022      optable63[i * 32 | 30] = ppc_fnmsubx;
1023      optable63[i * 32 | 23] = ppc_fselx;
1018      ppc.optable63[i * 32 | 29] = ppc_fmaddx;
1019      ppc.optable63[i * 32 | 28] = ppc_fmsubx;
1020      ppc.optable63[i * 32 | 25] = ppc_fmulx;
1021      ppc.optable63[i * 32 | 31] = ppc_fnmaddx;
1022      ppc.optable63[i * 32 | 30] = ppc_fnmsubx;
1023      ppc.optable63[i * 32 | 23] = ppc_fselx;
10241024
1025      optable59[i * 32 | 29] = ppc_fmaddsx;
1026      optable59[i * 32 | 28] = ppc_fmsubsx;
1027      optable59[i * 32 | 25] = ppc_fmulsx;
1028      optable59[i * 32 | 31] = ppc_fnmaddsx;
1029      optable59[i * 32 | 30] = ppc_fnmsubsx;
1025      ppc.optable59[i * 32 | 29] = ppc_fmaddsx;
1026      ppc.optable59[i * 32 | 28] = ppc_fmsubsx;
1027      ppc.optable59[i * 32 | 25] = ppc_fmulsx;
1028      ppc.optable59[i * 32 | 31] = ppc_fnmaddsx;
1029      ppc.optable59[i * 32 | 30] = ppc_fnmsubsx;
10301030   }
10311031
1032   ppc.optable31[978] = ppc_tlbld;
1033
10321034   for(i = 0; i < 256; i++)
10331035   {
10341036      ppc_field_xlat[i] =
r1386r1387
10991101
11001102   ppc_init() ;
11011103
1102   optable[48] = ppc_lfs;
1103   optable[49] = ppc_lfsu;
1104   optable[50] = ppc_lfd;
1105   optable[51] = ppc_lfdu;
1106   optable[52] = ppc_stfs;
1107   optable[53] = ppc_stfsu;
1108   optable[54] = ppc_stfd;
1109   optable[55] = ppc_stfdu;
1110   optable31[631] = ppc_lfdux;
1111   optable31[599] = ppc_lfdx;
1112   optable31[567] = ppc_lfsux;
1113   optable31[535] = ppc_lfsx;
1114   optable31[595] = ppc_mfsr;
1115   optable31[659] = ppc_mfsrin;
1116   optable31[371] = ppc_mftb;
1117   optable31[210] = ppc_mtsr;
1118   optable31[242] = ppc_mtsrin;
1119   optable31[758] = ppc_dcba;
1120   optable31[759] = ppc_stfdux;
1121   optable31[727] = ppc_stfdx;
1122   optable31[983] = ppc_stfiwx;
1123   optable31[695] = ppc_stfsux;
1124   optable31[663] = ppc_stfsx;
1125   optable31[370] = ppc_tlbia;
1126   optable31[306] = ppc_tlbie;
1127   optable31[566] = ppc_tlbsync;
1128   optable31[310] = ppc_eciwx;
1129   optable31[438] = ppc_ecowx;
1104   ppc.optable[48] = ppc_lfs;
1105   ppc.optable[49] = ppc_lfsu;
1106   ppc.optable[50] = ppc_lfd;
1107   ppc.optable[51] = ppc_lfdu;
1108   ppc.optable[52] = ppc_stfs;
1109   ppc.optable[53] = ppc_stfsu;
1110   ppc.optable[54] = ppc_stfd;
1111   ppc.optable[55] = ppc_stfdu;
1112   ppc.optable31[631] = ppc_lfdux;
1113   ppc.optable31[599] = ppc_lfdx;
1114   ppc.optable31[567] = ppc_lfsux;
1115   ppc.optable31[535] = ppc_lfsx;
1116   ppc.optable31[595] = ppc_mfsr;
1117   ppc.optable31[659] = ppc_mfsrin;
1118   ppc.optable31[371] = ppc_mftb;
1119   ppc.optable31[210] = ppc_mtsr;
1120   ppc.optable31[242] = ppc_mtsrin;
1121   ppc.optable31[758] = ppc_dcba;
1122   ppc.optable31[759] = ppc_stfdux;
1123   ppc.optable31[727] = ppc_stfdx;
1124   ppc.optable31[983] = ppc_stfiwx;
1125   ppc.optable31[695] = ppc_stfsux;
1126   ppc.optable31[663] = ppc_stfsx;
1127   ppc.optable31[370] = ppc_tlbia;
1128   ppc.optable31[306] = ppc_tlbie;
1129   ppc.optable31[566] = ppc_tlbsync;
1130   ppc.optable31[310] = ppc_eciwx;
1131   ppc.optable31[438] = ppc_ecowx;
11301132
1131   optable63[264] = ppc_fabsx;
1132   optable63[21] = ppc_faddx;
1133   optable63[32] = ppc_fcmpo;
1134   optable63[0] = ppc_fcmpu;
1135   optable63[14] = ppc_fctiwx;
1136   optable63[15] = ppc_fctiwzx;
1137   optable63[18] = ppc_fdivx;
1138   optable63[72] = ppc_fmrx;
1139   optable63[136] = ppc_fnabsx;
1140   optable63[40] = ppc_fnegx;
1141   optable63[12] = ppc_frspx;
1142   optable63[26] = ppc_frsqrtex;
1143   optable63[22] = ppc_fsqrtx;
1144   optable63[20] = ppc_fsubx;
1145   optable63[583] = ppc_mffsx;
1146   optable63[70] = ppc_mtfsb0x;
1147   optable63[38] = ppc_mtfsb1x;
1148   optable63[711] = ppc_mtfsfx;
1149   optable63[134] = ppc_mtfsfix;
1150   optable63[64] = ppc_mcrfs;
1133   ppc.optable63[264] = ppc_fabsx;
1134   ppc.optable63[21] = ppc_faddx;
1135   ppc.optable63[32] = ppc_fcmpo;
1136   ppc.optable63[0] = ppc_fcmpu;
1137   ppc.optable63[14] = ppc_fctiwx;
1138   ppc.optable63[15] = ppc_fctiwzx;
1139   ppc.optable63[18] = ppc_fdivx;
1140   ppc.optable63[72] = ppc_fmrx;
1141   ppc.optable63[136] = ppc_fnabsx;
1142   ppc.optable63[40] = ppc_fnegx;
1143   ppc.optable63[12] = ppc_frspx;
1144   ppc.optable63[26] = ppc_frsqrtex;
1145   ppc.optable63[22] = ppc_fsqrtx;
1146   ppc.optable63[20] = ppc_fsubx;
1147   ppc.optable63[583] = ppc_mffsx;
1148   ppc.optable63[70] = ppc_mtfsb0x;
1149   ppc.optable63[38] = ppc_mtfsb1x;
1150   ppc.optable63[711] = ppc_mtfsfx;
1151   ppc.optable63[134] = ppc_mtfsfix;
1152   ppc.optable63[64] = ppc_mcrfs;
11511153
1152   optable59[21] = ppc_faddsx;
1153   optable59[18] = ppc_fdivsx;
1154   optable59[24] = ppc_fresx;
1155   optable59[22] = ppc_fsqrtsx;
1156   optable59[20] = ppc_fsubsx;
1154   ppc.optable59[21] = ppc_faddsx;
1155   ppc.optable59[18] = ppc_fdivsx;
1156   ppc.optable59[24] = ppc_fresx;
1157   ppc.optable59[22] = ppc_fsqrtsx;
1158   ppc.optable59[20] = ppc_fsubsx;
11571159
11581160   for(i = 0; i < 32; i++)
11591161   {
1160      optable63[i * 32 | 29] = ppc_fmaddx;
1161      optable63[i * 32 | 28] = ppc_fmsubx;
1162      optable63[i * 32 | 25] = ppc_fmulx;
1163      optable63[i * 32 | 31] = ppc_fnmaddx;
1164      optable63[i * 32 | 30] = ppc_fnmsubx;
1165      optable63[i * 32 | 23] = ppc_fselx;
1162      ppc.optable63[i * 32 | 29] = ppc_fmaddx;
1163      ppc.optable63[i * 32 | 28] = ppc_fmsubx;
1164      ppc.optable63[i * 32 | 25] = ppc_fmulx;
1165      ppc.optable63[i * 32 | 31] = ppc_fnmaddx;
1166      ppc.optable63[i * 32 | 30] = ppc_fnmsubx;
1167      ppc.optable63[i * 32 | 23] = ppc_fselx;
11661168
1167      optable59[i * 32 | 29] = ppc_fmaddsx;
1168      optable59[i * 32 | 28] = ppc_fmsubsx;
1169      optable59[i * 32 | 25] = ppc_fmulsx;
1170      optable59[i * 32 | 31] = ppc_fnmaddsx;
1171      optable59[i * 32 | 30] = ppc_fnmsubsx;
1169      ppc.optable59[i * 32 | 29] = ppc_fmaddsx;
1170      ppc.optable59[i * 32 | 28] = ppc_fmsubsx;
1171      ppc.optable59[i * 32 | 25] = ppc_fmulsx;
1172      ppc.optable59[i * 32 | 31] = ppc_fnmaddsx;
1173      ppc.optable59[i * 32 | 30] = ppc_fnmsubsx;
11721174   }
11731175
11741176   for(i = 0; i < 256; i++)
r1386r1387
11851187   }
11861188
11871189   // PPC602 specific opcodes
1188   optable31[596] = ppc_esa;
1189   optable31[628] = ppc_dsa;
1190   optable31[1010] = ppc_tlbli;
1191   optable31[978] = ppc_tlbld;
1190   ppc.optable31[596] = ppc_esa;
1191   ppc.optable31[628] = ppc_dsa;
1192   ppc.optable31[1010] = ppc_tlbli;
1193   ppc.optable31[978] = ppc_tlbld;
11921194
11931195   ppc.is602 = 1;
11941196
r1386r1387
12431245
12441246   ppc_init();
12451247
1246   optable[48] = ppc_lfs;
1247   optable[49] = ppc_lfsu;
1248   optable[50] = ppc_lfd;
1249   optable[51] = ppc_lfdu;
1250   optable[52] = ppc_stfs;
1251   optable[53] = ppc_stfsu;
1252   optable[54] = ppc_stfd;
1253   optable[55] = ppc_stfdu;
1254   optable31[631] = ppc_lfdux;
1255   optable31[599] = ppc_lfdx;
1256   optable31[567] = ppc_lfsux;
1257   optable31[535] = ppc_lfsx;
1258   optable31[595] = ppc_mfsr;
1259   optable31[659] = ppc_mfsrin;
1260   optable31[371] = ppc_mftb;
1261   optable31[210] = ppc_mtsr;
1262   optable31[242] = ppc_mtsrin;
1263   optable31[758] = ppc_dcba;
1264   optable31[759] = ppc_stfdux;
1265   optable31[727] = ppc_stfdx;
1266   optable31[983] = ppc_stfiwx;
1267   optable31[695] = ppc_stfsux;
1268   optable31[663] = ppc_stfsx;
1269   optable31[370] = ppc_tlbia;
1270   optable31[306] = ppc_tlbie;
1271   optable31[566] = ppc_tlbsync;
1272   optable31[310] = ppc_eciwx;
1273   optable31[438] = ppc_ecowx;
1248   ppc.optable[48] = ppc_lfs;
1249   ppc.optable[49] = ppc_lfsu;
1250   ppc.optable[50] = ppc_lfd;
1251   ppc.optable[51] = ppc_lfdu;
1252   ppc.optable[52] = ppc_stfs;
1253   ppc.optable[53] = ppc_stfsu;
1254   ppc.optable[54] = ppc_stfd;
1255   ppc.optable[55] = ppc_stfdu;
1256   ppc.optable31[631] = ppc_lfdux;
1257   ppc.optable31[599] = ppc_lfdx;
1258   ppc.optable31[567] = ppc_lfsux;
1259   ppc.optable31[535] = ppc_lfsx;
1260   ppc.optable31[595] = ppc_mfsr;
1261   ppc.optable31[659] = ppc_mfsrin;
1262   ppc.optable31[371] = ppc_mftb;
1263   ppc.optable31[210] = ppc_mtsr;
1264   ppc.optable31[242] = ppc_mtsrin;
1265   ppc.optable31[758] = ppc_dcba;
1266   ppc.optable31[759] = ppc_stfdux;
1267   ppc.optable31[727] = ppc_stfdx;
1268   ppc.optable31[983] = ppc_stfiwx;
1269   ppc.optable31[695] = ppc_stfsux;
1270   ppc.optable31[663] = ppc_stfsx;
1271   ppc.optable31[370] = ppc_tlbia;
1272   ppc.optable31[306] = ppc_tlbie;
1273   ppc.optable31[566] = ppc_tlbsync;
1274   ppc.optable31[310] = ppc_eciwx;
1275   ppc.optable31[438] = ppc_ecowx;
12741276
1275   optable63[264] = ppc_fabsx;
1276   optable63[21] = ppc_faddx;
1277   optable63[32] = ppc_fcmpo;
1278   optable63[0] = ppc_fcmpu;
1279   optable63[14] = ppc_fctiwx;
1280   optable63[15] = ppc_fctiwzx;
1281   optable63[18] = ppc_fdivx;
1282   optable63[72] = ppc_fmrx;
1283   optable63[136] = ppc_fnabsx;
1284   optable63[40] = ppc_fnegx;
1285   optable63[12] = ppc_frspx;
1286   optable63[26] = ppc_frsqrtex;
1287   optable63[22] = ppc_fsqrtx;
1288   optable63[20] = ppc_fsubx;
1289   optable63[583] = ppc_mffsx;
1290   optable63[70] = ppc_mtfsb0x;
1291   optable63[38] = ppc_mtfsb1x;
1292   optable63[711] = ppc_mtfsfx;
1293   optable63[134] = ppc_mtfsfix;
1294   optable63[64] = ppc_mcrfs;
1277   ppc.optable63[264] = ppc_fabsx;
1278   ppc.optable63[21] = ppc_faddx;
1279   ppc.optable63[32] = ppc_fcmpo;
1280   ppc.optable63[0] = ppc_fcmpu;
1281   ppc.optable63[14] = ppc_fctiwx;
1282   ppc.optable63[15] = ppc_fctiwzx;
1283   ppc.optable63[18] = ppc_fdivx;
1284   ppc.optable63[72] = ppc_fmrx;
1285   ppc.optable63[136] = ppc_fnabsx;
1286   ppc.optable63[40] = ppc_fnegx;
1287   ppc.optable63[12] = ppc_frspx;
1288   ppc.optable63[26] = ppc_frsqrtex;
1289   ppc.optable63[22] = ppc_fsqrtx;
1290   ppc.optable63[20] = ppc_fsubx;
1291   ppc.optable63[583] = ppc_mffsx;
1292   ppc.optable63[70] = ppc_mtfsb0x;
1293   ppc.optable63[38] = ppc_mtfsb1x;
1294   ppc.optable63[711] = ppc_mtfsfx;
1295   ppc.optable63[134] = ppc_mtfsfix;
1296   ppc.optable63[64] = ppc_mcrfs;
12951297
1296   optable59[21] = ppc_faddsx;
1297   optable59[18] = ppc_fdivsx;
1298   optable59[24] = ppc_fresx;
1299   optable59[22] = ppc_fsqrtsx;
1300   optable59[20] = ppc_fsubsx;
1298   ppc.optable59[21] = ppc_faddsx;
1299   ppc.optable59[18] = ppc_fdivsx;
1300   ppc.optable59[24] = ppc_fresx;
1301   ppc.optable59[22] = ppc_fsqrtsx;
1302   ppc.optable59[20] = ppc_fsubsx;
13011303
13021304   for(i = 0; i < 32; i++)
13031305   {
1304      optable63[i * 32 | 29] = ppc_fmaddx;
1305      optable63[i * 32 | 28] = ppc_fmsubx;
1306      optable63[i * 32 | 25] = ppc_fmulx;
1307      optable63[i * 32 | 31] = ppc_fnmaddx;
1308      optable63[i * 32 | 30] = ppc_fnmsubx;
1309      optable63[i * 32 | 23] = ppc_fselx;
1306      ppc.optable63[i * 32 | 29] = ppc_fmaddx;
1307      ppc.optable63[i * 32 | 28] = ppc_fmsubx;
1308      ppc.optable63[i * 32 | 25] = ppc_fmulx;
1309      ppc.optable63[i * 32 | 31] = ppc_fnmaddx;
1310      ppc.optable63[i * 32 | 30] = ppc_fnmsubx;
1311      ppc.optable63[i * 32 | 23] = ppc_fselx;
13101312
1311      optable59[i * 32 | 29] = ppc_fmaddsx;
1312      optable59[i * 32 | 28] = ppc_fmsubsx;
1313      optable59[i * 32 | 25] = ppc_fmulsx;
1314      optable59[i * 32 | 31] = ppc_fnmaddsx;
1315      optable59[i * 32 | 30] = ppc_fnmsubsx;
1313      ppc.optable59[i * 32 | 29] = ppc_fmaddsx;
1314      ppc.optable59[i * 32 | 28] = ppc_fmsubsx;
1315      ppc.optable59[i * 32 | 25] = ppc_fmulsx;
1316      ppc.optable59[i * 32 | 31] = ppc_fnmaddsx;
1317      ppc.optable59[i * 32 | 30] = ppc_fnmsubsx;
13161318   }
13171319
13181320   for(i = 0; i < 256; i++)
r1386r1387
13291331   }
13301332
13311333   // MPC8240 specific opcodes
1332   optable31[978] = mpc8240_tlbld;
1333   optable31[1010] = mpc8240_tlbli;
1334   ppc.optable31[978] = mpc8240_tlbld;
1335   ppc.optable31[1010] = mpc8240_tlbli;
13341336
13351337   ppc.is603 = 1;
13361338
r1386r1387
13741376
13751377   ppc_init() ;
13761378
1377   optable[48] = ppc_lfs;
1378   optable[49] = ppc_lfsu;
1379   optable[50] = ppc_lfd;
1380   optable[51] = ppc_lfdu;
1381   optable[52] = ppc_stfs;
1382   optable[53] = ppc_stfsu;
1383   optable[54] = ppc_stfd;
1384   optable[55] = ppc_stfdu;
1385   optable31[631] = ppc_lfdux;
1386   optable31[599] = ppc_lfdx;
1387   optable31[567] = ppc_lfsux;
1388   optable31[535] = ppc_lfsx;
1389   optable31[595] = ppc_mfsr;
1390   optable31[659] = ppc_mfsrin;
1391   optable31[371] = ppc_mftb;
1392   optable31[210] = ppc_mtsr;
1393   optable31[242] = ppc_mtsrin;
1394   optable31[758] = ppc_dcba;
1395   optable31[759] = ppc_stfdux;
1396   optable31[727] = ppc_stfdx;
1397   optable31[983] = ppc_stfiwx;
1398   optable31[695] = ppc_stfsux;
1399   optable31[663] = ppc_stfsx;
1400   optable31[370] = ppc_tlbia;
1401   optable31[306] = ppc_tlbie;
1402   optable31[566] = ppc_tlbsync;
1403   optable31[310] = ppc_eciwx;
1404   optable31[438] = ppc_ecowx;
1379   ppc.optable[48] = ppc_lfs;
1380   ppc.optable[49] = ppc_lfsu;
1381   ppc.optable[50] = ppc_lfd;
1382   ppc.optable[51] = ppc_lfdu;
1383   ppc.optable[52] = ppc_stfs;
1384   ppc.optable[53] = ppc_stfsu;
1385   ppc.optable[54] = ppc_stfd;
1386   ppc.optable[55] = ppc_stfdu;
1387   ppc.optable31[631] = ppc_lfdux;
1388   ppc.optable31[599] = ppc_lfdx;
1389   ppc.optable31[567] = ppc_lfsux;
1390   ppc.optable31[535] = ppc_lfsx;
1391   ppc.optable31[595] = ppc_mfsr;
1392   ppc.optable31[659] = ppc_mfsrin;
1393   ppc.optable31[371] = ppc_mftb;
1394   ppc.optable31[210] = ppc_mtsr;
1395   ppc.optable31[242] = ppc_mtsrin;
1396   ppc.optable31[758] = ppc_dcba;
1397   ppc.optable31[759] = ppc_stfdux;
1398   ppc.optable31[727] = ppc_stfdx;
1399   ppc.optable31[983] = ppc_stfiwx;
1400   ppc.optable31[695] = ppc_stfsux;
1401   ppc.optable31[663] = ppc_stfsx;
1402   ppc.optable31[370] = ppc_tlbia;
1403   ppc.optable31[306] = ppc_tlbie;
1404   ppc.optable31[566] = ppc_tlbsync;
1405   ppc.optable31[310] = ppc_eciwx;
1406   ppc.optable31[438] = ppc_ecowx;
14051407
1406   optable63[264] = ppc_fabsx;
1407   optable63[21] = ppc_faddx;
1408   optable63[32] = ppc_fcmpo;
1409   optable63[0] = ppc_fcmpu;
1410   optable63[14] = ppc_fctiwx;
1411   optable63[15] = ppc_fctiwzx;
1412   optable63[18] = ppc_fdivx;
1413   optable63[72] = ppc_fmrx;
1414   optable63[136] = ppc_fnabsx;
1415   optable63[40] = ppc_fnegx;
1416   optable63[12] = ppc_frspx;
1417   optable63[26] = ppc_frsqrtex;
1418   optable63[22] = ppc_fsqrtx;
1419   optable63[20] = ppc_fsubx;
1420   optable63[583] = ppc_mffsx;
1421   optable63[70] = ppc_mtfsb0x;
1422   optable63[38] = ppc_mtfsb1x;
1423   optable63[711] = ppc_mtfsfx;
1424   optable63[134] = ppc_mtfsfix;
1425   optable63[64] = ppc_mcrfs;
1408   ppc.optable63[264] = ppc_fabsx;
1409   ppc.optable63[21] = ppc_faddx;
1410   ppc.optable63[32] = ppc_fcmpo;
1411   ppc.optable63[0] = ppc_fcmpu;
1412   ppc.optable63[14] = ppc_fctiwx;
1413   ppc.optable63[15] = ppc_fctiwzx;
1414   ppc.optable63[18] = ppc_fdivx;
1415   ppc.optable63[72] = ppc_fmrx;
1416   ppc.optable63[136] = ppc_fnabsx;
1417   ppc.optable63[40] = ppc_fnegx;
1418   ppc.optable63[12] = ppc_frspx;
1419   ppc.optable63[26] = ppc_frsqrtex;
1420   ppc.optable63[22] = ppc_fsqrtx;
1421   ppc.optable63[20] = ppc_fsubx;
1422   ppc.optable63[583] = ppc_mffsx;
1423   ppc.optable63[70] = ppc_mtfsb0x;
1424   ppc.optable63[38] = ppc_mtfsb1x;
1425   ppc.optable63[711] = ppc_mtfsfx;
1426   ppc.optable63[134] = ppc_mtfsfix;
1427   ppc.optable63[64] = ppc_mcrfs;
14261428
1427   optable59[21] = ppc_faddsx;
1428   optable59[18] = ppc_fdivsx;
1429   optable59[24] = ppc_fresx;
1430   optable59[22] = ppc_fsqrtsx;
1431   optable59[20] = ppc_fsubsx;
1429   ppc.optable59[21] = ppc_faddsx;
1430   ppc.optable59[18] = ppc_fdivsx;
1431   ppc.optable59[24] = ppc_fresx;
1432   ppc.optable59[22] = ppc_fsqrtsx;
1433   ppc.optable59[20] = ppc_fsubsx;
14321434
14331435   for(i = 0; i < 32; i++)
14341436   {
1435      optable63[i * 32 | 29] = ppc_fmaddx;
1436      optable63[i * 32 | 28] = ppc_fmsubx;
1437      optable63[i * 32 | 25] = ppc_fmulx;
1438      optable63[i * 32 | 31] = ppc_fnmaddx;
1439      optable63[i * 32 | 30] = ppc_fnmsubx;
1440      optable63[i * 32 | 23] = ppc_fselx;
1437      ppc.optable63[i * 32 | 29] = ppc_fmaddx;
1438      ppc.optable63[i * 32 | 28] = ppc_fmsubx;
1439      ppc.optable63[i * 32 | 25] = ppc_fmulx;
1440      ppc.optable63[i * 32 | 31] = ppc_fnmaddx;
1441      ppc.optable63[i * 32 | 30] = ppc_fnmsubx;
1442      ppc.optable63[i * 32 | 23] = ppc_fselx;
14411443
1442      optable59[i * 32 | 29] = ppc_fmaddsx;
1443      optable59[i * 32 | 28] = ppc_fmsubsx;
1444      optable59[i * 32 | 25] = ppc_fmulsx;
1445      optable59[i * 32 | 31] = ppc_fnmaddsx;
1446      optable59[i * 32 | 30] = ppc_fnmsubsx;
1444      ppc.optable59[i * 32 | 29] = ppc_fmaddsx;
1445      ppc.optable59[i * 32 | 28] = ppc_fmsubsx;
1446      ppc.optable59[i * 32 | 25] = ppc_fmulsx;
1447      ppc.optable59[i * 32 | 31] = ppc_fnmaddsx;
1448      ppc.optable59[i * 32 | 30] = ppc_fnmsubsx;
14471449   }
14481450
14491451   for(i = 0; i < 256; i++)
r1386r1387
14931495}
14941496#endif
14951497
1498#if (HAS_PPC604)
1499static void ppc604_init(int index, int clock, const void *_config, int (*irqcallback)(int))
1500{
1501   const ppc_config *config = _config;
1502   float multiplier;
1503   int i ;
14961504
1505   ppc_init() ;
14971506
1507   ppc.optable[48] = ppc_lfs;
1508   ppc.optable[49] = ppc_lfsu;
1509   ppc.optable[50] = ppc_lfd;
1510   ppc.optable[51] = ppc_lfdu;
1511   ppc.optable[52] = ppc_stfs;
1512   ppc.optable[53] = ppc_stfsu;
1513   ppc.optable[54] = ppc_stfd;
1514   ppc.optable[55] = ppc_stfdu;
1515   ppc.optable31[631] = ppc_lfdux;
1516   ppc.optable31[599] = ppc_lfdx;
1517   ppc.optable31[567] = ppc_lfsux;
1518   ppc.optable31[535] = ppc_lfsx;
1519   ppc.optable31[595] = ppc_mfsr;
1520   ppc.optable31[659] = ppc_mfsrin;
1521   ppc.optable31[371] = ppc_mftb;
1522   ppc.optable31[210] = ppc_mtsr;
1523   ppc.optable31[242] = ppc_mtsrin;
1524   ppc.optable31[758] = ppc_dcba;
1525   ppc.optable31[759] = ppc_stfdux;
1526   ppc.optable31[727] = ppc_stfdx;
1527   ppc.optable31[983] = ppc_stfiwx;
1528   ppc.optable31[695] = ppc_stfsux;
1529   ppc.optable31[663] = ppc_stfsx;
1530   ppc.optable31[370] = ppc_tlbia;
1531   ppc.optable31[306] = ppc_tlbie;
1532   ppc.optable31[566] = ppc_tlbsync;
1533   ppc.optable31[310] = ppc_eciwx;
1534   ppc.optable31[438] = ppc_ecowx;
1535
1536   ppc.optable63[264] = ppc_fabsx;
1537   ppc.optable63[21] = ppc_faddx;
1538   ppc.optable63[32] = ppc_fcmpo;
1539   ppc.optable63[0] = ppc_fcmpu;
1540   ppc.optable63[14] = ppc_fctiwx;
1541   ppc.optable63[15] = ppc_fctiwzx;
1542   ppc.optable63[18] = ppc_fdivx;
1543   ppc.optable63[72] = ppc_fmrx;
1544   ppc.optable63[136] = ppc_fnabsx;
1545   ppc.optable63[40] = ppc_fnegx;
1546   ppc.optable63[12] = ppc_frspx;
1547   ppc.optable63[26] = ppc_frsqrtex;
1548   ppc.optable63[22] = ppc_fsqrtx;
1549   ppc.optable63[20] = ppc_fsubx;
1550   ppc.optable63[583] = ppc_mffsx;
1551   ppc.optable63[70] = ppc_mtfsb0x;
1552   ppc.optable63[38] = ppc_mtfsb1x;
1553   ppc.optable63[711] = ppc_mtfsfx;
1554   ppc.optable63[134] = ppc_mtfsfix;
1555   ppc.optable63[64] = ppc_mcrfs;
1556
1557   ppc.optable59[21] = ppc_faddsx;
1558   ppc.optable59[18] = ppc_fdivsx;
1559   ppc.optable59[24] = ppc_fresx;
1560   ppc.optable59[22] = ppc_fsqrtsx;
1561   ppc.optable59[20] = ppc_fsubsx;
1562
1563   for(i = 0; i < 32; i++)
1564   {
1565      ppc.optable63[i * 32 | 29] = ppc_fmaddx;
1566      ppc.optable63[i * 32 | 28] = ppc_fmsubx;
1567      ppc.optable63[i * 32 | 25] = ppc_fmulx;
1568      ppc.optable63[i * 32 | 31] = ppc_fnmaddx;
1569      ppc.optable63[i * 32 | 30] = ppc_fnmsubx;
1570      ppc.optable63[i * 32 | 23] = ppc_fselx;
1571
1572      ppc.optable59[i * 32 | 29] = ppc_fmaddsx;
1573      ppc.optable59[i * 32 | 28] = ppc_fmsubsx;
1574      ppc.optable59[i * 32 | 25] = ppc_fmulsx;
1575      ppc.optable59[i * 32 | 31] = ppc_fnmaddsx;
1576      ppc.optable59[i * 32 | 30] = ppc_fnmsubsx;
1577   }
1578
1579   ppc.optable31[978] = ppc_tlbld;
1580
1581   for(i = 0; i < 256; i++)
1582   {
1583      ppc_field_xlat[i] =
1584         ((i & 0x80) ? 0xF0000000 : 0) |
1585         ((i & 0x40) ? 0x0F000000 : 0) |
1586         ((i & 0x20) ? 0x00F00000 : 0) |
1587         ((i & 0x10) ? 0x000F0000 : 0) |
1588         ((i & 0x08) ? 0x0000F000 : 0) |
1589         ((i & 0x04) ? 0x00000F00 : 0) |
1590         ((i & 0x02) ? 0x000000F0 : 0) |
1591         ((i & 0x01) ? 0x0000000F : 0);
1592   }
1593
1594   ppc.is603 = 1;
1595
1596   ppc.read8 = program_read_byte_64be;
1597   ppc.read16 = program_read_word_64be;
1598   ppc.read32 = program_read_dword_64be;
1599   ppc.read64 = program_read_qword_64be;
1600   ppc.write8 = program_write_byte_64be;
1601   ppc.write16 = program_write_word_64be;
1602   ppc.write32 = program_write_dword_64be;
1603   ppc.write64 = program_write_qword_64be;
1604   ppc.read16_unaligned = ppc_read16_unaligned;
1605   ppc.read32_unaligned = ppc_read32_unaligned;
1606   ppc.read64_unaligned = ppc_read64_unaligned;
1607   ppc.write16_unaligned = ppc_write16_unaligned;
1608   ppc.write32_unaligned = ppc_write32_unaligned;
1609   ppc.write64_unaligned = ppc_write64_unaligned;
1610
1611   ppc.irq_callback = irqcallback;
1612
1613   ppc.pvr = config->pvr;
1614
1615   multiplier = (float)((config->bus_frequency_multiplier >> 4) & 0xf) +
1616             (float)(config->bus_frequency_multiplier & 0xf) / 10.0f;
1617   bus_freq_multiplier = (int)(multiplier * 2);
1618
1619   ppc.hid1 = 0;
1620}
1621
1622static void ppc604_exit(void)
1623{
1624
1625}
1626#endif
1627
1628
1629
14981630static void ppc_get_context(void *dst)
14991631{
15001632   /* copy the context */
r1386r1387
19362068   }
19372069}
19382070#endif
2071
2072/* PPC604 */
2073
2074#if (HAS_PPC604)
2075static void ppc604_set_info(UINT32 state, cpuinfo *info)
2076{
2077   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
2078   {
2079      ppc603_set_irq_line(state-CPUINFO_INT_INPUT_STATE, info->i);
2080      return;
2081   }
2082   switch(state)
2083   {
2084      default:                              ppc_set_info(state, info);            break;
2085   }
2086}
2087
2088void ppc604_get_info(UINT32 state, cpuinfo *info)
2089{
2090   switch(state)
2091   {
2092      /* --- the following bits of info are returned as 64-bit signed integers --- */
2093      case CPUINFO_INT_INPUT_LINES:               info->i = 5;                     break;
2094      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
2095
2096      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM:   info->i = 64;               break;
2097      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32;               break;
2098
2099      /* --- the following bits of info are returned as pointers to data or functions --- */
2100      case CPUINFO_PTR_SET_INFO:                  info->setinfo = ppc604_set_info;      break;
2101      case CPUINFO_PTR_INIT:                     info->init = ppc604_init;            break;
2102      case CPUINFO_PTR_RESET:                     info->reset = ppc603_reset;            break;
2103      case CPUINFO_PTR_EXIT:                     info->exit = ppc604_exit;            break;
2104      case CPUINFO_PTR_EXECUTE:                  info->execute = ppc603_execute;         break;
2105      case CPUINFO_PTR_READ:                     info->read = ppc_read;               break;
2106      case CPUINFO_PTR_WRITE:                     info->write = ppc_write;            break;
2107      case CPUINFO_PTR_READOP:                  info->readop = ppc_readop;            break;
2108
2109      /* --- the following bits of info are returned as NULL-terminated strings --- */
2110      case CPUINFO_STR_NAME:                     strcpy(info->s, "PPC604");            break;
2111
2112      default:                              ppc_get_info(state, info);            break;
2113   }
2114}
2115#endif
src/emu/cpu/powerpc/ppc_dasm.c
r1386r1387
208208 * and print instructions.
209209 */
210210
211static IDESCR itab[] =
211static const IDESCR itab[] =
212212{
213213    { "add",    D_OP(31)|D_XO(266), M_RT|M_RA|M_RB|M_OE|M_RC,   F_RT_RA_RB,     FL_OE|FL_RC },
214214    { "addc",   D_OP(31)|D_XO(10),  M_RT|M_RA|M_RB|M_OE|M_RC,   F_RT_RA_RB,     FL_OE|FL_RC },
r1386r1387
423423 * Use an index of BI&3 into this table to obtain the CR field bit name.
424424 */
425425
426static char crbit[][4] = { "lt", "gt", "eq", "so" };
426static const char *const crbit[4] = { "lt", "gt", "eq", "so" };
427427
428428
429429/*
src/emu/cpu/powerpc/ppc.h
r1386r1387
360360void ppc601_get_info(UINT32 state, cpuinfo *info);
361361#endif
362362
363#if (HAS_PPC604)
364void ppc604_get_info(UINT32 state, cpuinfo *info);
365#endif
366
363367#ifdef MAME_DEBUG
364368extern offs_t ppc_dasm_one(char *buffer, offs_t pc, UINT32 op);
365369#endif
src/emu/cpu/powerpc/drc_ops.c
r1386r1387
295295   if (opcode != 0) {      // this is a little workaround for VF3
296296      switch(opcode >> 26)
297297      {
298         case 19:   return optable19[(opcode >> 1) & 0x3ff](drc, opcode);
299         case 31:   return optable31[(opcode >> 1) & 0x3ff](drc, opcode);
300         case 59:   return optable59[(opcode >> 1) & 0x3ff](drc, opcode);
301         case 63:   return optable63[(opcode >> 1) & 0x3ff](drc, opcode);
302         default:   return optable[opcode >> 26](drc, opcode);
298         case 19:   return ppc.optable19[(opcode >> 1) & 0x3ff](drc, opcode);
299         case 31:   return ppc.optable31[(opcode >> 1) & 0x3ff](drc, opcode);
300         case 59:   return ppc.optable59[(opcode >> 1) & 0x3ff](drc, opcode);
301         case 63:   return ppc.optable63[(opcode >> 1) & 0x3ff](drc, opcode);
302         default:   return ppc.optable[opcode >> 26](drc, opcode);
303303      }
304304   }
305305   return RECOMPILE_SUCCESSFUL | RECOMPILE_END_OF_STRING;
r1386r1387
484484
485485/*
486486// this table translates x86 SF and ZF flags to PPC CR values
487static UINT8 condition_table[4] =
487static const UINT8 condition_table[4] =
488488{
489489    0x4,    // x86 SF == 0, ZF == 0   -->   PPC GT (positive)
490490    0x2,    // x86 SF == 0, ZF == 1   -->   PPC EQ (zero)
src/emu/cpu/powerpc/ppc403.c
r1386r1387
184184
185185      switch(opcode >> 26)
186186      {
187         case 19:   optable19[(opcode >> 1) & 0x3ff](opcode); break;
188         case 31:   optable31[(opcode >> 1) & 0x3ff](opcode); break;
189         case 59:   optable59[(opcode >> 1) & 0x3ff](opcode); break;
190         case 63:   optable63[(opcode >> 1) & 0x3ff](opcode); break;
191         default:   optable[opcode >> 26](opcode); break;
187         case 19:   ppc.optable19[(opcode >> 1) & 0x3ff](opcode); break;
188         case 31:   ppc.optable31[(opcode >> 1) & 0x3ff](opcode); break;
189         case 59:   ppc.optable59[(opcode >> 1) & 0x3ff](opcode); break;
190         case 63:   ppc.optable63[(opcode >> 1) & 0x3ff](opcode); break;
191         default:   ppc.optable[opcode >> 26](opcode); break;
192192      }
193193
194194      ppc_icount--;
src/emu/cpu/powerpc/ppc602.c
r1386r1387
264264      ppc.npc = ppc.pc + 4;
265265      switch(opcode >> 26)
266266      {
267         case 19:   optable19[(opcode >> 1) & 0x3ff](opcode); break;
268         case 31:   optable31[(opcode >> 1) & 0x3ff](opcode); break;
269         case 59:   optable59[(opcode >> 1) & 0x3ff](opcode); break;
270         case 63:   optable63[(opcode >> 1) & 0x3ff](opcode); break;
271         default:   optable[opcode >> 26](opcode); break;
267         case 19:   ppc.optable19[(opcode >> 1) & 0x3ff](opcode); break;
268         case 31:   ppc.optable31[(opcode >> 1) & 0x3ff](opcode); break;
269         case 59:   ppc.optable59[(opcode >> 1) & 0x3ff](opcode); break;
270         case 63:   ppc.optable63[(opcode >> 1) & 0x3ff](opcode); break;
271         default:   ppc.optable[opcode >> 26](opcode); break;
272272      }
273273
274274      ppc_icount--;
src/emu/cpu/powerpc/ppc603.c
r1386r1387
272272      ppc.npc = ppc.pc + 4;
273273      switch(opcode >> 26)
274274      {
275         case 19:   optable19[(opcode >> 1) & 0x3ff](opcode); break;
276         case 31:   optable31[(opcode >> 1) & 0x3ff](opcode); break;
277         case 59:   optable59[(opcode >> 1) & 0x3ff](opcode); break;
278         case 63:   optable63[(opcode >> 1) & 0x3ff](opcode); break;
279         default:   optable[opcode >> 26](opcode); break;
275         case 19:   ppc.optable19[(opcode >> 1) & 0x3ff](opcode); break;
276         case 31:   ppc.optable31[(opcode >> 1) & 0x3ff](opcode); break;
277         case 59:   ppc.optable59[(opcode >> 1) & 0x3ff](opcode); break;
278         case 63:   ppc.optable63[(opcode >> 1) & 0x3ff](opcode); break;
279         default:   ppc.optable[opcode >> 26](opcode); break;
280280      }
281281
282282      ppc_icount--;
src/emu/cpu/powerpc/ppcdrc.c
r1386r1387
2020static void ppcdrc603_init(int index, int clock, const void *_config, int (*irqcallback)(int));
2121static void ppcdrc603_exit(void);
2222#endif
23#if (HAS_PPC601 || HAS_PPC603 || HAS_MPC8240)
23#if (HAS_PPC601 || HAS_PPC603 || HAS_MPC8240 || HAS_PPC604)
2424static void ppcdrc603_reset(void);
2525static int ppcdrc603_execute(int cycles);
2626static void ppcdrc603_set_irq_line(int irqline, int state);
r1386r1387
102102   if((ppc.msr & 0x2000) == 0){   \
103103   }
104104
105#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
105#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
106106static UINT32      ppc_field_xlat[256];
107107#endif
108108
r1386r1387
317317
318318   /* saved ESP when entering entry point */
319319   UINT32 host_esp;
320
321   UINT32 (* optable19[1024])(drc_core *, UINT32);
322   UINT32 (* optable31[1024])(drc_core *, UINT32);
323   UINT32 (* optable59[1024])(drc_core *, UINT32);
324   UINT32 (* optable63[1024])(drc_core *, UINT32);
325   UINT32 (* optable[64])(drc_core *, UINT32);
320326} PPC_REGS;
321327
322328
r1386r1387
522528      case SPR_PVR:      return;
523529   }
524530
525#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601)
531#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601 || HAS_PPC604)
526532   if(ppc.is603 || ppc.is602) {
527533      switch(spr)
528534      {
r1386r1387
735741   }
736742#endif
737743
738#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601)
744#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601 || HAS_PPC604)
739745   if (ppc.is603 || ppc.is602)
740746   {
741747      switch (spr)
r1386r1387
861867
862868/***********************************************************************/
863869
864static UINT32 (* optable19[1024])(drc_core *, UINT32);
865static UINT32 (* optable31[1024])(drc_core *, UINT32);
866static UINT32 (* optable59[1024])(drc_core *, UINT32);
867static UINT32 (* optable63[1024])(drc_core *, UINT32);
868static UINT32 (* optable[64])(drc_core *, UINT32);
869
870870#include "ppc_mem.c"
871871
872872#if (HAS_PPC403)
r1386r1387
10071007   int i,j;
10081008
10091009   for( i=0; i < 64; i++ ) {
1010      optable[i] = recompile_invalid;
1010      ppc.optable[i] = recompile_invalid;
10111011   }
10121012   for( i=0; i < 1024; i++ ) {
1013      optable19[i] = recompile_invalid;
1014      optable31[i] = recompile_invalid;
1015      optable59[i] = recompile_invalid;
1016      optable63[i] = recompile_invalid;
1013      ppc.optable19[i] = recompile_invalid;
1014      ppc.optable31[i] = recompile_invalid;
1015      ppc.optable59[i] = recompile_invalid;
1016      ppc.optable63[i] = recompile_invalid;
10171017   }
10181018
10191019   /* Fill the opcode tables */
r1386r1387
10221022      switch(ppcdrc_opcode_common[i].code)
10231023      {
10241024         case 19:
1025            optable19[ppcdrc_opcode_common[i].subcode] = ppcdrc_opcode_common[i].handler;
1025            ppc.optable19[ppcdrc_opcode_common[i].subcode] = ppcdrc_opcode_common[i].handler;
10261026            break;
10271027
10281028         case 31:
1029            optable31[ppcdrc_opcode_common[i].subcode] = ppcdrc_opcode_common[i].handler;
1029            ppc.optable31[ppcdrc_opcode_common[i].subcode] = ppcdrc_opcode_common[i].handler;
10301030            break;
10311031
10321032         case 59:
r1386r1387
10341034            break;
10351035
10361036         default:
1037            optable[ppcdrc_opcode_common[i].code] = ppcdrc_opcode_common[i].handler;
1037            ppc.optable[ppcdrc_opcode_common[i].code] = ppcdrc_opcode_common[i].handler;
10381038      }
10391039
10401040   }
r1386r1387
10631063   ppcdrc_init();
10641064
10651065   /* PPC403 specific opcodes */
1066   optable31[454] = recompile_dccci;
1067   optable31[486] = recompile_dcread;
1068   optable31[262] = recompile_icbt;
1069   optable31[966] = recompile_iccci;
1070   optable31[998] = recompile_icread;
1071   optable31[323] = recompile_mfdcr;
1072   optable31[451] = recompile_mtdcr;
1073   optable31[131] = recompile_wrtee;
1074   optable31[163] = recompile_wrteei;
1075   optable19[51] = recompile_rfci;
1066   ppc.optable31[454] = recompile_dccci;
1067   ppc.optable31[486] = recompile_dcread;
1068   ppc.optable31[262] = recompile_icbt;
1069   ppc.optable31[966] = recompile_iccci;
1070   ppc.optable31[998] = recompile_icread;
1071   ppc.optable31[323] = recompile_mfdcr;
1072   ppc.optable31[451] = recompile_mtdcr;
1073   ppc.optable31[131] = recompile_wrtee;
1074   ppc.optable31[163] = recompile_wrteei;
1075   ppc.optable19[51] = recompile_rfci;
10761076
10771077   ppc.spu.rx_timer = timer_alloc(ppc403_spu_rx_callback, NULL);
10781078   ppc.spu.tx_timer = timer_alloc(ppc403_spu_tx_callback, NULL);
r1386r1387
12081208   ppc_init();
12091209   ppcdrc_init();
12101210
1211   optable[48] = recompile_lfs;
1212   optable[49] = recompile_lfsu;
1213   optable[50] = recompile_lfd;
1214   optable[51] = recompile_lfdu;
1215   optable[52] = recompile_stfs;
1216   optable[53] = recompile_stfsu;
1217   optable[54] = recompile_stfd;
1218   optable[55] = recompile_stfdu;
1219   optable31[631] = recompile_lfdux;
1220   optable31[599] = recompile_lfdx;
1221   optable31[567] = recompile_lfsux;
1222   optable31[535] = recompile_lfsx;
1223   optable31[595] = recompile_mfsr;
1224   optable31[659] = recompile_mfsrin;
1225   optable31[371] = recompile_mftb;
1226   optable31[210] = recompile_mtsr;
1227   optable31[242] = recompile_mtsrin;
1228   optable31[758] = recompile_dcba;
1229   optable31[759] = recompile_stfdux;
1230   optable31[727] = recompile_stfdx;
1231   optable31[983] = recompile_stfiwx;
1232   optable31[695] = recompile_stfsux;
1233   optable31[663] = recompile_stfsx;
1234   optable31[370] = recompile_tlbia;
1235   optable31[306] = recompile_tlbie;
1236   optable31[566] = recompile_tlbsync;
1237   optable31[310] = recompile_eciwx;
1238   optable31[438] = recompile_ecowx;
1211   ppc.optable[48] = recompile_lfs;
1212   ppc.optable[49] = recompile_lfsu;
1213   ppc.optable[50] = recompile_lfd;
1214   ppc.optable[51] = recompile_lfdu;
1215   ppc.optable[52] = recompile_stfs;
1216   ppc.optable[53] = recompile_stfsu;
1217   ppc.optable[54] = recompile_stfd;
1218   ppc.optable[55] = recompile_stfdu;
1219   ppc.optable31[631] = recompile_lfdux;
1220   ppc.optable31[599] = recompile_lfdx;
1221   ppc.optable31[567] = recompile_lfsux;
1222   ppc.optable31[535] = recompile_lfsx;
1223   ppc.optable31[595] = recompile_mfsr;
1224   ppc.optable31[659] = recompile_mfsrin;
1225   ppc.optable31[371] = recompile_mftb;
1226   ppc.optable31[210] = recompile_mtsr;
1227   ppc.optable31[242] = recompile_mtsrin;
1228   ppc.optable31[758] = recompile_dcba;
1229   ppc.optable31[759] = recompile_stfdux;
1230   ppc.optable31[727] = recompile_stfdx;
1231   ppc.optable31[983] = recompile_stfiwx;
1232   ppc.optable31[695] = recompile_stfsux;
1233   ppc.optable31[663] = recompile_stfsx;
1234   ppc.optable31[370] = recompile_tlbia;
1235   ppc.optable31[306] = recompile_tlbie;
1236   ppc.optable31[566] = recompile_tlbsync;
1237   ppc.optable31[310] = recompile_eciwx;
1238   ppc.optable31[438] = recompile_ecowx;
12391239
1240   optable63[264] = recompile_fabsx;
1241   optable63[21] = recompile_faddx;
1242   optable63[32] = recompile_fcmpo;
1243   optable63[0] = recompile_fcmpu;
1244   optable63[14] = recompile_fctiwx;
1245   optable63[15] = recompile_fctiwzx;
1246   optable63[18] = recompile_fdivx;
1247   optable63[72] = recompile_fmrx;
1248   optable63[136] = recompile_fnabsx;
1249   optable63[40] = recompile_fnegx;
1250   optable63[12] = recompile_frspx;
1251   optable63[26] = recompile_frsqrtex;
1252   optable63[22] = recompile_fsqrtx;
1253   optable63[20] = recompile_fsubx;
1254   optable63[583] = recompile_mffsx;
1255   optable63[70] = recompile_mtfsb0x;
1256   optable63[38] = recompile_mtfsb1x;
1257   optable63[711] = recompile_mtfsfx;
1258   optable63[134] = recompile_mtfsfix;
1259   optable63[64] = recompile_mcrfs;
1240   ppc.optable63[264] = recompile_fabsx;
1241   ppc.optable63[21] = recompile_faddx;
1242   ppc.optable63[32] = recompile_fcmpo;
1243   ppc.optable63[0] = recompile_fcmpu;
1244   ppc.optable63[14] = recompile_fctiwx;
1245   ppc.optable63[15] = recompile_fctiwzx;
1246   ppc.optable63[18] = recompile_fdivx;
1247   ppc.optable63[72] = recompile_fmrx;
1248   ppc.optable63[136] = recompile_fnabsx;
1249   ppc.optable63[40] = recompile_fnegx;
1250   ppc.optable63[12] = recompile_frspx;
1251   ppc.optable63[26] = recompile_frsqrtex;
1252   ppc.optable63[22] = recompile_fsqrtx;
1253   ppc.optable63[20] = recompile_fsubx;
1254   ppc.optable63[583] = recompile_mffsx;
1255   ppc.optable63[70] = recompile_mtfsb0x;
1256   ppc.optable63[38] = recompile_mtfsb1x;
1257   ppc.optable63[711] = recompile_mtfsfx;
1258   ppc.optable63[134] = recompile_mtfsfix;
1259   ppc.optable63[64] = recompile_mcrfs;
12601260
1261   optable59[21] = recompile_faddsx;
1262   optable59[18] = recompile_fdivsx;
1263   optable59[24] = recompile_fresx;
1264   optable59[22] = recompile_fsqrtsx;
1265   optable59[20] = recompile_fsubsx;
1261   ppc.optable59[21] = recompile_faddsx;
1262   ppc.optable59[18] = recompile_fdivsx;
1263   ppc.optable59[24] = recompile_fresx;
1264   ppc.optable59[22] = recompile_fsqrtsx;
1265   ppc.optable59[20] = recompile_fsubsx;
12661266
12671267   for(i = 0; i < 32; i++)
12681268   {
1269      optable63[i * 32 | 29] = recompile_fmaddx;
1270      optable63[i * 32 | 28] = recompile_fmsubx;
1271      optable63[i * 32 | 25] = recompile_fmulx;
1272      optable63[i * 32 | 31] = recompile_fnmaddx;
1273      optable63[i * 32 | 30] = recompile_fnmsubx;
1274      optable63[i * 32 | 23] = recompile_fselx;
1269      ppc.optable63[i * 32 | 29] = recompile_fmaddx;
1270      ppc.optable63[i * 32 | 28] = recompile_fmsubx;
1271      ppc.optable63[i * 32 | 25] = recompile_fmulx;
1272      ppc.optable63[i * 32 | 31] = recompile_fnmaddx;
1273      ppc.optable63[i * 32 | 30] = recompile_fnmsubx;
1274      ppc.optable63[i * 32 | 23] = recompile_fselx;
12751275
1276      optable59[i * 32 | 29] = recompile_fmaddsx;
1277      optable59[i * 32 | 28] = recompile_fmsubsx;
1278      optable59[i * 32 | 25] = recompile_fmulsx;
1279      optable59[i * 32 | 31] = recompile_fnmaddsx;
1280      optable59[i * 32 | 30] = recompile_fnmsubsx;
1276      ppc.optable59[i * 32 | 29] = recompile_fmaddsx;
1277      ppc.optable59[i * 32 | 28] = recompile_fmsubsx;
1278      ppc.optable59[i * 32 | 25] = recompile_fmulsx;
1279      ppc.optable59[i * 32 | 31] = recompile_fnmaddsx;
1280      ppc.optable59[i * 32 | 30] = recompile_fnmsubsx;
12811281   }
12821282
1283#if (HAS_PPC602 || HAS_MPC8240)
1284   ppc.optable31[978] = recompile_tlbld;
1285#endif /* (HAS_PPC602 || HAS_MPC8240) */
1286
12831287   for(i = 0; i < 256; i++)
12841288   {
12851289      ppc_field_xlat[i] =
r1386r1387
13431347}
13441348#endif
13451349
1346#if (HAS_PPC601 || HAS_PPC603 || HAS_MPC8240)
1350#if (HAS_PPC601 || HAS_PPC603 || HAS_MPC8240 || HAS_PPC604)
13471351static void ppcdrc603_reset(void)
13481352{
13491353   ppc.pc = ppc.npc = 0xfff00100;
r1386r1387
14071411   ppc_init();
14081412   ppcdrc_init();
14091413
1410   optable[48] = recompile_lfs;
1411   optable[49] = recompile_lfsu;
1412   optable[50] = recompile_lfd;
1413   optable[51] = recompile_lfdu;
1414   optable[52] = recompile_stfs;
1415   optable[53] = recompile_stfsu;
1416   optable[54] = recompile_stfd;
1417   optable[55] = recompile_stfdu;
1418   optable31[631] = recompile_lfdux;
1419   optable31[599] = recompile_lfdx;
1420   optable31[567] = recompile_lfsux;
1421   optable31[535] = recompile_lfsx;
1422   optable31[595] = recompile_mfsr;
1423   optable31[659] = recompile_mfsrin;
1424   optable31[371] = recompile_mftb;
1425   optable31[210] = recompile_mtsr;
1426   optable31[242] = recompile_mtsrin;
1427   optable31[758] = recompile_dcba;
1428   optable31[759] = recompile_stfdux;
1429   optable31[727] = recompile_stfdx;
1430   optable31[983] = recompile_stfiwx;
1431   optable31[695] = recompile_stfsux;
1432   optable31[663] = recompile_stfsx;
1433   optable31[370] = recompile_tlbia;
1434   optable31[306] = recompile_tlbie;
1435   optable31[566] = recompile_tlbsync;
1436   optable31[310] = recompile_eciwx;
1437   optable31[438] = recompile_ecowx;
1414   ppc.optable[48] = recompile_lfs;
1415   ppc.optable[49] = recompile_lfsu;
1416   ppc.optable[50] = recompile_lfd;
1417   ppc.optable[51] = recompile_lfdu;
1418   ppc.optable[52] = recompile_stfs;
1419   ppc.optable[53] = recompile_stfsu;
1420   ppc.optable[54] = recompile_stfd;
1421   ppc.optable[55] = recompile_stfdu;
1422   ppc.optable31[631] = recompile_lfdux;
1423   ppc.optable31[599] = recompile_lfdx;
1424   ppc.optable31[567] = recompile_lfsux;
1425   ppc.optable31[535] = recompile_lfsx;
1426   ppc.optable31[595] = recompile_mfsr;
1427   ppc.optable31[659] = recompile_mfsrin;
1428   ppc.optable31[371] = recompile_mftb;
1429   ppc.optable31[210] = recompile_mtsr;
1430   ppc.optable31[242] = recompile_mtsrin;
1431   ppc.optable31[758] = recompile_dcba;
1432   ppc.optable31[759] = recompile_stfdux;
1433   ppc.optable31[727] = recompile_stfdx;
1434   ppc.optable31[983] = recompile_stfiwx;
1435   ppc.optable31[695] = recompile_stfsux;
1436   ppc.optable31[663] = recompile_stfsx;
1437   ppc.optable31[370] = recompile_tlbia;
1438   ppc.optable31[306] = recompile_tlbie;
1439   ppc.optable31[566] = recompile_tlbsync;
1440   ppc.optable31[310] = recompile_eciwx;
1441   ppc.optable31[438] = recompile_ecowx;
14381442
1439   optable63[264] = recompile_fabsx;
1440   optable63[21] = recompile_faddx;
1441   optable63[32] = recompile_fcmpo;
1442   optable63[0] = recompile_fcmpu;
1443   optable63[14] = recompile_fctiwx;
1444   optable63[15] = recompile_fctiwzx;
1445   optable63[18] = recompile_fdivx;
1446   optable63[72] = recompile_fmrx;
1447   optable63[136] = recompile_fnabsx;
1448   optable63[40] = recompile_fnegx;
1449   optable63[12] = recompile_frspx;
1450   optable63[26] = recompile_frsqrtex;
1451   optable63[22] = recompile_fsqrtx;
1452   optable63[20] = recompile_fsubx;
1453   optable63[583] = recompile_mffsx;
1454   optable63[70] = recompile_mtfsb0x;
1455   optable63[38] = recompile_mtfsb1x;
1456   optable63[711] = recompile_mtfsfx;
1457   optable63[134] = recompile_mtfsfix;
1458   optable63[64] = recompile_mcrfs;
1443   ppc.optable63[264] = recompile_fabsx;
1444   ppc.optable63[21] = recompile_faddx;
1445   ppc.optable63[32] = recompile_fcmpo;
1446   ppc.optable63[0] = recompile_fcmpu;
1447   ppc.optable63[14] = recompile_fctiwx;
1448   ppc.optable63[15] = recompile_fctiwzx;
1449   ppc.optable63[18] = recompile_fdivx;
1450   ppc.optable63[72] = recompile_fmrx;
1451   ppc.optable63[136] = recompile_fnabsx;
1452   ppc.optable63[40] = recompile_fnegx;
1453   ppc.optable63[12] = recompile_frspx;
1454   ppc.optable63[26] = recompile_frsqrtex;
1455   ppc.optable63[22] = recompile_fsqrtx;
1456   ppc.optable63[20] = recompile_fsubx;
1457   ppc.optable63[583] = recompile_mffsx;
1458   ppc.optable63[70] = recompile_mtfsb0x;
1459   ppc.optable63[38] = recompile_mtfsb1x;
1460   ppc.optable63[711] = recompile_mtfsfx;
1461   ppc.optable63[134] = recompile_mtfsfix;
1462   ppc.optable63[64] = recompile_mcrfs;
14591463
1460   optable59[21] = recompile_faddsx;
1461   optable59[18] = recompile_fdivsx;
1462   optable59[24] = recompile_fresx;
1463   optable59[22] = recompile_fsqrtsx;
1464   optable59[20] = recompile_fsubsx;
1464   ppc.optable59[21] = recompile_faddsx;
1465   ppc.optable59[18] = recompile_fdivsx;
1466   ppc.optable59[24] = recompile_fresx;
1467   ppc.optable59[22] = recompile_fsqrtsx;
1468   ppc.optable59[20] = recompile_fsubsx;
14651469
14661470   for(i = 0; i < 32; i++)
14671471   {
1468      optable63[i * 32 | 29] = recompile_fmaddx;
1469      optable63[i * 32 | 28] = recompile_fmsubx;
1470      optable63[i * 32 | 25] = recompile_fmulx;
1471      optable63[i * 32 | 31] = recompile_fnmaddx;
1472      optable63[i * 32 | 30] = recompile_fnmsubx;
1473      optable63[i * 32 | 23] = recompile_fselx;
1472      ppc.optable63[i * 32 | 29] = recompile_fmaddx;
1473      ppc.optable63[i * 32 | 28] = recompile_fmsubx;
1474      ppc.optable63[i * 32 | 25] = recompile_fmulx;
1475      ppc.optable63[i * 32 | 31] = recompile_fnmaddx;
1476      ppc.optable63[i * 32 | 30] = recompile_fnmsubx;
1477      ppc.optable63[i * 32 | 23] = recompile_fselx;
14741478
1475      optable59[i * 32 | 29] = recompile_fmaddsx;
1476      optable59[i * 32 | 28] = recompile_fmsubsx;
1477      optable59[i * 32 | 25] = recompile_fmulsx;
1478      optable59[i * 32 | 31] = recompile_fnmaddsx;
1479      optable59[i * 32 | 30] = recompile_fnmsubsx;
1479      ppc.optable59[i * 32 | 29] = recompile_fmaddsx;
1480      ppc.optable59[i * 32 | 28] = recompile_fmsubsx;
1481      ppc.optable59[i * 32 | 25] = recompile_fmulsx;
1482      ppc.optable59[i * 32 | 31] = recompile_fnmaddsx;
1483      ppc.optable59[i * 32 | 30] = recompile_fnmsubsx;
14801484   }
14811485
14821486   for(i = 0; i < 256; i++)
r1386r1387
14931497   }
14941498
14951499   // PPC602 specific opcodes
1496   optable31[596] = recompile_esa;
1497   optable31[628] = recompile_dsa;
1498   optable31[1010] = recompile_tlbli;
1499   optable31[978] = recompile_tlbld;
1500   ppc.optable31[596] = recompile_esa;
1501   ppc.optable31[628] = recompile_dsa;
1502   ppc.optable31[1010] = recompile_tlbli;
1503   ppc.optable31[978] = recompile_tlbld;
15001504
15011505   ppc.is603 = 0;
15021506   ppc.is602 = 1;
r1386r1387
15971601   ppc_init();
15981602   ppcdrc_init();
15991603
1600   optable[48] = recompile_lfs;
1601   optable[49] = recompile_lfsu;
1602   optable[50] = recompile_lfd;
1603   optable[51] = recompile_lfdu;
1604   optable[52] = recompile_stfs;
1605   optable[53] = recompile_stfsu;
1606   optable[54] = recompile_stfd;
1607   optable[55] = recompile_stfdu;
1608   optable31[631] = recompile_lfdux;
1609   optable31[599] = recompile_lfdx;
1610   optable31[567] = recompile_lfsux;
1611   optable31[535] = recompile_lfsx;
1612   optable31[595] = recompile_mfsr;
1613   optable31[659] = recompile_mfsrin;
1614   optable31[371] = recompile_mftb;
1615   optable31[210] = recompile_mtsr;
1616   optable31[242] = recompile_mtsrin;
1617   optable31[758] = recompile_dcba;
1618   optable31[759] = recompile_stfdux;
1619   optable31[727] = recompile_stfdx;
1620   optable31[983] = recompile_stfiwx;
1621   optable31[695] = recompile_stfsux;
1622   optable31[663] = recompile_stfsx;
1623   optable31[370] = recompile_tlbia;
1624   optable31[306] = recompile_tlbie;
1625   optable31[566] = recompile_tlbsync;
1626   optable31[310] = recompile_eciwx;
1627   optable31[438] = recompile_ecowx;
1604   ppc.optable[48] = recompile_lfs;
1605   ppc.optable[49] = recompile_lfsu;
1606   ppc.optable[50] = recompile_lfd;
1607   ppc.optable[51] = recompile_lfdu;
1608   ppc.optable[52] = recompile_stfs;
1609   ppc.optable[53] = recompile_stfsu;
1610   ppc.optable[54] = recompile_stfd;
1611   ppc.optable[55] = recompile_stfdu;
1612   ppc.optable31[631] = recompile_lfdux;
1613   ppc.optable31[599] = recompile_lfdx;
1614   ppc.optable31[567] = recompile_lfsux;
1615   ppc.optable31[535] = recompile_lfsx;
1616   ppc.optable31[595] = recompile_mfsr;
1617   ppc.optable31[659] = recompile_mfsrin;
1618   ppc.optable31[371] = recompile_mftb;
1619   ppc.optable31[210] = recompile_mtsr;
1620   ppc.optable31[242] = recompile_mtsrin;
1621   ppc.optable31[758] = recompile_dcba;
1622   ppc.optable31[759] = recompile_stfdux;
1623   ppc.optable31[727] = recompile_stfdx;
1624   ppc.optable31[983] = recompile_stfiwx;
1625   ppc.optable31[695] = recompile_stfsux;
1626   ppc.optable31[663] = recompile_stfsx;
1627   ppc.optable31[370] = recompile_tlbia;
1628   ppc.optable31[306] = recompile_tlbie;
1629   ppc.optable31[566] = recompile_tlbsync;
1630   ppc.optable31[310] = recompile_eciwx;
1631   ppc.optable31[438] = recompile_ecowx;
16281632
1629   optable63[264] = recompile_fabsx;
1630   optable63[21] = recompile_faddx;
1631   optable63[32] = recompile_fcmpo;
1632   optable63[0] = recompile_fcmpu;
1633   optable63[14] = recompile_fctiwx;
1634   optable63[15] = recompile_fctiwzx;
1635   optable63[18] = recompile_fdivx;
1636   optable63[72] = recompile_fmrx;
1637   optable63[136] = recompile_fnabsx;
1638   optable63[40] = recompile_fnegx;
1639   optable63[12] = recompile_frspx;
1640   optable63[26] = recompile_frsqrtex;
1641   optable63[22] = recompile_fsqrtx;
1642   optable63[20] = recompile_fsubx;
1643   optable63[583] = recompile_mffsx;
1644   optable63[70] = recompile_mtfsb0x;
1645   optable63[38] = recompile_mtfsb1x;
1646   optable63[711] = recompile_mtfsfx;
1647   optable63[134] = recompile_mtfsfix;
1648   optable63[64] = recompile_mcrfs;
1633   ppc.optable63[264] = recompile_fabsx;
1634   ppc.optable63[21] = recompile_faddx;
1635   ppc.optable63[32] = recompile_fcmpo;
1636   ppc.optable63[0] = recompile_fcmpu;
1637   ppc.optable63[14] = recompile_fctiwx;
1638   ppc.optable63[15] = recompile_fctiwzx;
1639   ppc.optable63[18] = recompile_fdivx;
1640   ppc.optable63[72] = recompile_fmrx;
1641   ppc.optable63[136] = recompile_fnabsx;
1642   ppc.optable63[40] = recompile_fnegx;
1643   ppc.optable63[12] = recompile_frspx;
1644   ppc.optable63[26] = recompile_frsqrtex;
1645   ppc.optable63[22] = recompile_fsqrtx;
1646   ppc.optable63[20] = recompile_fsubx;
1647   ppc.optable63[583] = recompile_mffsx;
1648   ppc.optable63[70] = recompile_mtfsb0x;
1649   ppc.optable63[38] = recompile_mtfsb1x;
1650   ppc.optable63[711] = recompile_mtfsfx;
1651   ppc.optable63[134] = recompile_mtfsfix;
1652   ppc.optable63[64] = recompile_mcrfs;
16491653
1650   optable59[21] = recompile_faddsx;
1651   optable59[18] = recompile_fdivsx;
1652   optable59[24] = recompile_fresx;
1653   optable59[22] = recompile_fsqrtsx;
1654   optable59[20] = recompile_fsubsx;
1654   ppc.optable59[21] = recompile_faddsx;
1655   ppc.optable59[18] = recompile_fdivsx;
1656   ppc.optable59[24] = recompile_fresx;
1657   ppc.optable59[22] = recompile_fsqrtsx;
1658   ppc.optable59[20] = recompile_fsubsx;
16551659
16561660   for(i = 0; i < 32; i++)
16571661   {
1658      optable63[i * 32 | 29] = recompile_fmaddx;
1659      optable63[i * 32 | 28] = recompile_fmsubx;
1660      optable63[i * 32 | 25] = recompile_fmulx;
1661      optable63[i * 32 | 31] = recompile_fnmaddx;
1662      optable63[i * 32 | 30] = recompile_fnmsubx;
1663      optable63[i * 32 | 23] = recompile_fselx;
1662      ppc.optable63[i * 32 | 29] = recompile_fmaddx;
1663      ppc.optable63[i * 32 | 28] = recompile_fmsubx;
1664      ppc.optable63[i * 32 | 25] = recompile_fmulx;
1665      ppc.optable63[i * 32 | 31] = recompile_fnmaddx;
1666      ppc.optable63[i * 32 | 30] = recompile_fnmsubx;
1667      ppc.optable63[i * 32 | 23] = recompile_fselx;
16641668
1665      optable59[i * 32 | 29] = recompile_fmaddsx;
1666      optable59[i * 32 | 28] = recompile_fmsubsx;
1667      optable59[i * 32 | 25] = recompile_fmulsx;
1668      optable59[i * 32 | 31] = recompile_fnmaddsx;
1669      optable59[i * 32 | 30] = recompile_fnmsubsx;
1669      ppc.optable59[i * 32 | 29] = recompile_fmaddsx;
1670      ppc.optable59[i * 32 | 28] = recompile_fmsubsx;
1671      ppc.optable59[i * 32 | 25] = recompile_fmulsx;
1672      ppc.optable59[i * 32 | 31] = recompile_fnmaddsx;
1673      ppc.optable59[i * 32 | 30] = recompile_fnmsubsx;
16701674   }
16711675
16721676   for(i = 0; i < 256; i++)
r1386r1387
16831687   }
16841688
16851689   // MPC8240 specific opcodes
1686   optable31[978] = recompile_tlbld;
1687   optable31[1010] = recompile_tlbli;
1690   ppc.optable31[978] = recompile_tlbld;
1691   ppc.optable31[1010] = recompile_tlbli;
16881692
16891693   ppc.is603 = 1;
16901694
r1386r1387
17301734   ppc_init();
17311735   ppcdrc_init();
17321736
1733   optable[48] = recompile_lfs;
1734   optable[49] = recompile_lfsu;
1735   optable[50] = recompile_lfd;
1736   optable[51] = recompile_lfdu;
1737   optable[52] = recompile_stfs;
1738   optable[53] = recompile_stfsu;
1739   optable[54] = recompile_stfd;
1740   optable[55] = recompile_stfdu;
1741   optable31[631] = recompile_lfdux;
1742   optable31[599] = recompile_lfdx;
1743   optable31[567] = recompile_lfsux;
1744   optable31[535] = recompile_lfsx;
1745   optable31[595] = recompile_mfsr;
1746   optable31[659] = recompile_mfsrin;
1747   optable31[371] = recompile_mftb;
1748   optable31[210] = recompile_mtsr;
1749   optable31[242] = recompile_mtsrin;
1750   optable31[758] = recompile_dcba;
1751   optable31[759] = recompile_stfdux;
1752   optable31[727] = recompile_stfdx;
1753   optable31[983] = recompile_stfiwx;
1754   optable31[695] = recompile_stfsux;
1755   optable31[663] = recompile_stfsx;
1756   optable31[370] = recompile_tlbia;
1757   optable31[306] = recompile_tlbie;
1758   optable31[566] = recompile_tlbsync;
1759   optable31[310] = recompile_eciwx;
1760   optable31[438] = recompile_ecowx;
1737   ppc.optable[48] = recompile_lfs;
1738   ppc.optable[49] = recompile_lfsu;
1739   ppc.optable[50] = recompile_lfd;
1740   ppc.optable[51] = recompile_lfdu;
1741   ppc.optable[52] = recompile_stfs;
1742   ppc.optable[53] = recompile_stfsu;
1743   ppc.optable[54] = recompile_stfd;
1744   ppc.optable[55] = recompile_stfdu;
1745   ppc.optable31[631] = recompile_lfdux;
1746   ppc.optable31[599] = recompile_lfdx;
1747   ppc.optable31[567] = recompile_lfsux;
1748   ppc.optable31[535] = recompile_lfsx;
1749   ppc.optable31[595] = recompile_mfsr;
1750   ppc.optable31[659] = recompile_mfsrin;
1751   ppc.optable31[371] = recompile_mftb;
1752   ppc.optable31[210] = recompile_mtsr;
1753   ppc.optable31[242] = recompile_mtsrin;
1754   ppc.optable31[758] = recompile_dcba;
1755   ppc.optable31[759] = recompile_stfdux;
1756   ppc.optable31[727] = recompile_stfdx;
1757   ppc.optable31[983] = recompile_stfiwx;
1758   ppc.optable31[695] = recompile_stfsux;
1759   ppc.optable31[663] = recompile_stfsx;
1760   ppc.optable31[370] = recompile_tlbia;
1761   ppc.optable31[306] = recompile_tlbie;
1762   ppc.optable31[566] = recompile_tlbsync;
1763   ppc.optable31[310] = recompile_eciwx;
1764   ppc.optable31[438] = recompile_ecowx;
17611765
1762   optable63[264] = recompile_fabsx;
1763   optable63[21] = recompile_faddx;
1764   optable63[32] = recompile_fcmpo;
1765   optable63[0] = recompile_fcmpu;
1766   optable63[14] = recompile_fctiwx;
1767   optable63[15] = recompile_fctiwzx;
1768   optable63[18] = recompile_fdivx;
1769   optable63[72] = recompile_fmrx;
1770   optable63[136] = recompile_fnabsx;
1771   optable63[40] = recompile_fnegx;
1772   optable63[12] = recompile_frspx;
1773   optable63[26] = recompile_frsqrtex;
1774   optable63[22] = recompile_fsqrtx;
1775   optable63[20] = recompile_fsubx;
1776   optable63[583] = recompile_mffsx;
1777   optable63[70] = recompile_mtfsb0x;
1778   optable63[38] = recompile_mtfsb1x;
1779   optable63[711] = recompile_mtfsfx;
1780   optable63[134] = recompile_mtfsfix;
1781   optable63[64] = recompile_mcrfs;
1766   ppc.optable63[264] = recompile_fabsx;
1767   ppc.optable63[21] = recompile_faddx;
1768   ppc.optable63[32] = recompile_fcmpo;
1769   ppc.optable63[0] = recompile_fcmpu;
1770   ppc.optable63[14] = recompile_fctiwx;
1771   ppc.optable63[15] = recompile_fctiwzx;
1772   ppc.optable63[18] = recompile_fdivx;
1773   ppc.optable63[72] = recompile_fmrx;
1774   ppc.optable63[136] = recompile_fnabsx;
1775   ppc.optable63[40] = recompile_fnegx;
1776   ppc.optable63[12] = recompile_frspx;
1777   ppc.optable63[26] = recompile_frsqrtex;
1778   ppc.optable63[22] = recompile_fsqrtx;
1779   ppc.optable63[20] = recompile_fsubx;
1780   ppc.optable63[583] = recompile_mffsx;
1781   ppc.optable63[70] = recompile_mtfsb0x;
1782   ppc.optable63[38] = recompile_mtfsb1x;
1783   ppc.optable63[711] = recompile_mtfsfx;
1784   ppc.optable63[134] = recompile_mtfsfix;
1785   ppc.optable63[64] = recompile_mcrfs;
17821786
1783   optable59[21] = recompile_faddsx;
1784   optable59[18] = recompile_fdivsx;
1785   optable59[24] = recompile_fresx;
1786   optable59[22] = recompile_fsqrtsx;
1787   optable59[20] = recompile_fsubsx;
1787   ppc.optable59[21] = recompile_faddsx;
1788   ppc.optable59[18] = recompile_fdivsx;
1789   ppc.optable59[24] = recompile_fresx;
1790   ppc.optable59[22] = recompile_fsqrtsx;
1791   ppc.optable59[20] = recompile_fsubsx;
17881792
17891793   for(i = 0; i < 32; i++)
17901794   {
1791      optable63[i * 32 | 29] = recompile_fmaddx;
1792      optable63[i * 32 | 28] = recompile_fmsubx;
1793      optable63[i * 32 | 25] = recompile_fmulx;
1794      optable63[i * 32 | 31] = recompile_fnmaddx;
1795      optable63[i * 32 | 30] = recompile_fnmsubx;
1796      optable63[i * 32 | 23] = recompile_fselx;
1795      ppc.optable63[i * 32 | 29] = recompile_fmaddx;
1796      ppc.optable63[i * 32 | 28] = recompile_fmsubx;
1797      ppc.optable63[i * 32 | 25] = recompile_fmulx;
1798      ppc.optable63[i * 32 | 31] = recompile_fnmaddx;
1799      ppc.optable63[i * 32 | 30] = recompile_fnmsubx;
1800      ppc.optable63[i * 32 | 23] = recompile_fselx;
17971801
1798      optable59[i * 32 | 29] = recompile_fmaddsx;
1799      optable59[i * 32 | 28] = recompile_fmsubsx;
1800      optable59[i * 32 | 25] = recompile_fmulsx;
1801      optable59[i * 32 | 31] = recompile_fnmaddsx;
1802      optable59[i * 32 | 30] = recompile_fnmsubsx;
1802      ppc.optable59[i * 32 | 29] = recompile_fmaddsx;
1803      ppc.optable59[i * 32 | 28] = recompile_fmsubsx;
1804      ppc.optable59[i * 32 | 25] = recompile_fmulsx;
1805      ppc.optable59[i * 32 | 31] = recompile_fnmaddsx;
1806      ppc.optable59[i * 32 | 30] = recompile_fnmsubsx;
18031807   }
18041808
18051809   for(i = 0; i < 256; i++)
r1386r1387
18661870#endif
18671871
18681872
1873#if (HAS_PPC604)
1874static void ppc604drc_init(int index, int clock, const void *_config, int (*irqcallback)(int))
1875{
1876   float multiplier;
1877   const ppc_config *config = _config;
1878   int i;
1879
1880   ppc_init();
1881   ppcdrc_init();
1882
1883   ppc.optable[48] = recompile_lfs;
1884   ppc.optable[49] = recompile_lfsu;
1885   ppc.optable[50] = recompile_lfd;
1886   ppc.optable[51] = recompile_lfdu;
1887   ppc.optable[52] = recompile_stfs;
1888   ppc.optable[53] = recompile_stfsu;
1889   ppc.optable[54] = recompile_stfd;
1890   ppc.optable[55] = recompile_stfdu;
1891   ppc.optable31[631] = recompile_lfdux;
1892   ppc.optable31[599] = recompile_lfdx;
1893   ppc.optable31[567] = recompile_lfsux;
1894   ppc.optable31[535] = recompile_lfsx;
1895   ppc.optable31[595] = recompile_mfsr;
1896   ppc.optable31[659] = recompile_mfsrin;
1897   ppc.optable31[371] = recompile_mftb;
1898   ppc.optable31[210] = recompile_mtsr;
1899   ppc.optable31[242] = recompile_mtsrin;
1900   ppc.optable31[758] = recompile_dcba;
1901   ppc.optable31[759] = recompile_stfdux;
1902   ppc.optable31[727] = recompile_stfdx;
1903   ppc.optable31[983] = recompile_stfiwx;
1904   ppc.optable31[695] = recompile_stfsux;
1905   ppc.optable31[663] = recompile_stfsx;
1906   ppc.optable31[370] = recompile_tlbia;
1907   ppc.optable31[306] = recompile_tlbie;
1908   ppc.optable31[566] = recompile_tlbsync;
1909   ppc.optable31[310] = recompile_eciwx;
1910   ppc.optable31[438] = recompile_ecowx;
1911
1912   ppc.optable63[264] = recompile_fabsx;
1913   ppc.optable63[21] = recompile_faddx;
1914   ppc.optable63[32] = recompile_fcmpo;
1915   ppc.optable63[0] = recompile_fcmpu;
1916   ppc.optable63[14] = recompile_fctiwx;
1917   ppc.optable63[15] = recompile_fctiwzx;
1918   ppc.optable63[18] = recompile_fdivx;
1919   ppc.optable63[72] = recompile_fmrx;
1920   ppc.optable63[136] = recompile_fnabsx;
1921   ppc.optable63[40] = recompile_fnegx;
1922   ppc.optable63[12] = recompile_frspx;
1923   ppc.optable63[26] = recompile_frsqrtex;
1924   ppc.optable63[22] = recompile_fsqrtx;
1925   ppc.optable63[20] = recompile_fsubx;
1926   ppc.optable63[583] = recompile_mffsx;
1927   ppc.optable63[70] = recompile_mtfsb0x;
1928   ppc.optable63[38] = recompile_mtfsb1x;
1929   ppc.optable63[711] = recompile_mtfsfx;
1930   ppc.optable63[134] = recompile_mtfsfix;
1931   ppc.optable63[64] = recompile_mcrfs;
1932
1933   ppc.optable59[21] = recompile_faddsx;
1934   ppc.optable59[18] = recompile_fdivsx;
1935   ppc.optable59[24] = recompile_fresx;
1936   ppc.optable59[22] = recompile_fsqrtsx;
1937   ppc.optable59[20] = recompile_fsubsx;
1938
1939   for(i = 0; i < 32; i++)
1940   {
1941      ppc.optable63[i * 32 | 29] = recompile_fmaddx;
1942      ppc.optable63[i * 32 | 28] = recompile_fmsubx;
1943      ppc.optable63[i * 32 | 25] = recompile_fmulx;
1944      ppc.optable63[i * 32 | 31] = recompile_fnmaddx;
1945      ppc.optable63[i * 32 | 30] = recompile_fnmsubx;
1946      ppc.optable63[i * 32 | 23] = recompile_fselx;
1947
1948      ppc.optable59[i * 32 | 29] = recompile_fmaddsx;
1949      ppc.optable59[i * 32 | 28] = recompile_fmsubsx;
1950      ppc.optable59[i * 32 | 25] = recompile_fmulsx;
1951      ppc.optable59[i * 32 | 31] = recompile_fnmaddsx;
1952      ppc.optable59[i * 32 | 30] = recompile_fnmsubsx;
1953   }
1954
1955   ppc.optable31[978] = recompile_tlbld;
1956
1957   for(i = 0; i < 256; i++)
1958   {
1959      ppc_field_xlat[i] =
1960         ((i & 0x80) ? 0xF0000000 : 0) |
1961         ((i & 0x40) ? 0x0F000000 : 0) |
1962         ((i & 0x20) ? 0x00F00000 : 0) |
1963         ((i & 0x10) ? 0x000F0000 : 0) |
1964         ((i & 0x08) ? 0x0000F000 : 0) |
1965         ((i & 0x04) ? 0x00000F00 : 0) |
1966         ((i & 0x02) ? 0x000000F0 : 0) |
1967         ((i & 0x01) ? 0x0000000F : 0);
1968   }
1969
1970   ppc.is603 = 1;
1971
1972   ppc.read8 = program_read_byte_64be;
1973   ppc.read16 = program_read_word_64be;
1974   ppc.read32 = program_read_dword_64be;
1975   ppc.read64 = program_read_qword_64be;
1976   ppc.write8 = program_write_byte_64be;
1977   ppc.write16 = program_write_word_64be;
1978   ppc.write32 = program_write_dword_64be;
1979   ppc.write64 = program_write_qword_64be;
1980   ppc.read16_unaligned = ppc_read16_unaligned;
1981   ppc.read32_unaligned = ppc_read32_unaligned;
1982   ppc.read64_unaligned = ppc_read64_unaligned;
1983   ppc.write16_unaligned = ppc_write16_unaligned;
1984   ppc.write32_unaligned = ppc_write32_unaligned;
1985   ppc.write64_unaligned = ppc_write64_unaligned;
1986
1987   ppc.irq_callback = irqcallback;
1988
1989   ppc.pvr = config->pvr;
1990
1991   multiplier = (float)((config->bus_frequency_multiplier >> 4) & 0xf) +
1992             (float)(config->bus_frequency_multiplier & 0xf) / 10.0f;
1993   bus_freq_multiplier = (int)(multiplier * 2);
1994}
1995
1996static void ppc604drc_exit(void)
1997{
1998#if LOG_CODE
1999   //if (symfile) fclose(symfile);
2000#endif
2001   drc_exit(ppc.drc);
2002}
2003#endif
2004
2005
18692006static void ppc_get_context(void *dst)
18702007{
18712008   /* copy the context */
r1386r1387
23002437   }
23012438}
23022439#endif
2440
2441/* PPC604 */
2442
2443#if (HAS_PPC604)
2444static void ppc604_set_info(UINT32 state, cpuinfo *info)
2445{
2446   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
2447   {
2448      ppcdrc603_set_irq_line(state-CPUINFO_INT_INPUT_STATE, info->i);
2449      return;
2450   }
2451   switch(state)
2452   {
2453      default:                              ppc_set_info(state, info);            break;
2454   }
2455}
2456
2457void ppc604_get_info(UINT32 state, cpuinfo *info)
2458{
2459   switch(state)
2460   {
2461      /* --- the following bits of info are returned as 64-bit signed integers --- */
2462      case CPUINFO_INT_INPUT_LINES:               info->i = 5;                     break;
2463      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_BE;               break;
2464
2465      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM:   info->i = 64;               break;
2466      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32;               break;
2467
2468      /* --- the following bits of info are returned as pointers to data or functions --- */
2469      case CPUINFO_PTR_SET_INFO:                  info->setinfo = ppc604_set_info;      break;
2470      case CPUINFO_PTR_INIT:                     info->init = ppc604drc_init;         break;
2471      case CPUINFO_PTR_RESET:                     info->reset = ppcdrc603_reset;         break;
2472      case CPUINFO_PTR_EXIT:                     info->exit = ppc604drc_exit;         break;
2473      case CPUINFO_PTR_EXECUTE:                  info->execute = ppcdrc603_execute;      break;
2474      case CPUINFO_PTR_READ:                     info->read = ppc_read;               break;
2475      case CPUINFO_PTR_WRITE:                     info->write = ppc_write;            break;
2476      case CPUINFO_PTR_READOP:                  info->readop = ppc_readop;            break;
2477
2478      /* --- the following bits of info are returned as NULL-terminated strings --- */
2479      case CPUINFO_STR_NAME:                     strcpy(info->s, "PPC604");            break;
2480
2481      default:                              ppc_get_info(state, info);            break;
2482   }
2483}
2484#endif
src/emu/cpu/arm/armdasm.c
r1386r1387
2222static char *WriteDataProcessingOperand( char *pBuf, UINT32 opcode, int printOp0, int printOp1, int printOp2 )
2323{
2424   /* ccccctttmmmm */
25   static const char *pRegOp[4] = { "LSL","LSR","ASR","ROR" };
25   static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" };
2626
2727   if (printOp0)
2828      pBuf += sprintf(pBuf,"R%d, ", (opcode>>12)&0xf);
r1386r1387
5555static char *WriteRegisterOperand1( char *pBuf, UINT32 opcode )
5656{
5757   /* ccccctttmmmm */
58   static const char *pRegOp[4] = { "LSL","LSR","ASR","ROR" };
58   static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" };
5959
6060   pBuf += sprintf(
6161      pBuf,
r1386r1387
103103{
104104   const char *pBuf0;
105105
106   static const char *pConditionCodeTable[16] =
106   static const char *const pConditionCodeTable[16] =
107107   {
108108      "EQ","NE","CS","CC",
109109      "MI","PL","VS","VC",
110110      "HI","LS","GE","LT",
111111      "GT","LE","","NV"
112112   };
113   static const char *pOperation[16] =
113   static const char *const pOperation[16] =
114114   {
115115      "AND","EOR","SUB","RSB",
116116      "ADD","ADC","SBC","RSC",
src/emu/cpu/z8000/z8000tbl.c
r1386r1387
2121 *
2222 *****************************************************************************/
2323
24static Z8000_init table[] = {
24static const Z8000_init table[] = {
2525{0x0000,0x000f, 1,2,  7,Z00_0000_dddd_imm8,                 "addb    %rb3,%#b3"},
2626{0x0010,0x00ff, 1,1,  7,Z00_ssN0_dddd,                      "addb    %rb3,@%rw2"},
2727{0x0100,0x010f, 1,2,  7,Z01_0000_dddd_imm16,                "add     %rw3,%#w1"},
r1386r1387
538538void z8000_init(int index, int clock, const void *config, int (*irqcallback)(int))
539539{
540540    int i;
541   Z8000_init *init;
541   const Z8000_init *init;
542542
543543   /* already initialized? */
544544   if( z8000_exec )
src/emu/cpu/z8000/makedab.c
r1386r1387
6969    printf(" * 0..7    result value                           \n");
7070    printf(" * 8       carry flag after                       \n");
7171    printf(" ************************************************/\n");
72    printf("static UINT16 Z8000_dab[0x800] = {\n");
72    printf("static const UINT16 Z8000_dab[0x800] = {\n");
7373    for (i = 0; i < 0x800; i++) {
7474      if ((i & 0x3ff) == 0) {
7575         if (i & 0x400)
src/emu/cpu/z8000/8000dasm.c
r1386r1387
6464   n[i*4+3] = opcode & 0x0f;
6565}
6666
67static const char *cc[16] = {
67static const char *const cc[16] = {
6868   "n",   "lt",  "le",  "ule",  "pe/ov",   "mi",  "eq/z",   "c/ult",
6969   "a",   "ge",  "gt",  "ugt",  "po/nov",  "pl",  "ne/nz",  "nc/uge"
7070};
7171
72static const char *flg[16] = {
72static const char *const flg[16] = {
7373   "",    "p/v",  "s",   "p/v,s",   "z",   "p/v,z",  "s,z",  "p/v,s,z",
7474   "c",   "p/v,c","s,c", "p/v,s,c", "z,c", "p/v,z,c","s,z,c","p/v,s,z,c"
7575};
7676
77static const char *ints[4] = {
77static const char *const ints[4] = {
7878   "",    "vi",  "nvi",   "vi,nvi"
7979};
8080
src/emu/cpu/z8000/z8000dab.h
r1386r1387
1313 * 0..7    result value
1414 * 8       carry flag after
1515 ************************************************/
16static UINT16 Z8000_dab[0x800] = {
16static const UINT16 Z8000_dab[0x800] = {
1717   /* add/adc results */
1818   0x000,0x001,0x002,0x003,0x004,0x005,0x006,0x007,
1919   0x008,0x009,0x010,0x011,0x012,0x013,0x014,0x015,
src/emu/cpu/tms32010/32010dsm.c
r1386r1387
5252#define FMT(a,b) a, b
5353#define PTRS_PER_FORMAT 2
5454
55static const char *arith[4] = { "*" , "*-" , "*+" , "??" } ;
56static const char *nextar[4] = { ",AR0" , ",AR1" , "" , "" } ;
55static const char *const arith[4] = { "*" , "*-" , "*+" , "??" } ;
56static const char *const nextar[4] = { ",AR0" , ",AR1" , "" , "" } ;
5757
5858
59static const char *TMS32010Formats[] = {
59static const char *const TMS32010Formats[] = {
6060   FMT("0000ssss0aaaaaaa", "add  %A%S"),
6161   FMT("0000ssss10mmn00n", "add  %M%S%N"),
6262   FMT("0001ssss0aaaaaaa", "sub  %A%S"),
r1386r1387
183183
184184static void InitDasm32010(void)
185185{
186   const char *p, **ops;
186   const char *p;
187   const char *const *ops;
187188   word mask, bits;
188189   int bit;
189190   int i;
src/emu/cpu/tms32010/tms32010.c
r1386r1387
665665 *  Opcode Table
666666 ***********************************************************************/
667667
668static opcode_fn opcode_main[256]=
668static const opcode_fn opcode_main[256]=
669669{
670670/*00*/  add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh
671671/*08*/ ,add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh      ,add_sh
r1386r1387
701701/*F8*/ ,call      ,br         ,blz      ,blez      ,bgz      ,bgez      ,bnz      ,bz
702702};
703703
704static opcode_fn opcode_7F_other[32]=
704static const opcode_fn opcode_7F_other[32]=
705705{
706706/*80*/  nop         ,dint      ,eint      ,illegal   ,illegal   ,illegal   ,illegal   ,illegal
707707/*88*/ ,abst      ,zac      ,rovm      ,sovm      ,cala      ,ret      ,pac      ,apac
src/emu/cpu/sm8500/sm8500d.c
r1386r1387
32325A, 5B,
3333*/
3434
35static const char *s_mnemonic[] =
35static const char *const s_mnemonic[] =
3636{
3737   "adc",  "adcw", "add",  "addw", "and",  "andw",  "band", "bbc",  "bbs",
3838   "bclr", "bcmp", "bmov", "bor",  "br",   "btst", "bset",  "bxor", "call", "cals", "clr",
r1386r1387
7171   UINT8   arguments;
7272}   sm8500dasm;
7373
74static const char *sm8500_cond[16] = {
74static const char *const sm8500_cond[16] = {
7575   "F", "LT", "LE", "ULE", "OV",  "MI", "Z",  "C",
7676   "T", "GE", "GT", "UGT", "NOV", "PL", "NZ", "NC"
7777};
src/emu/cpu/sm8500/sm8500.c
r1386r1387
5555/* nr of cycles to run */
5656static int sm8500_icount;
5757
58static UINT8 sm8500_b2w[8] = {
58static const UINT8 sm8500_b2w[8] = {
5959        0, 8, 2, 10, 4, 12, 6, 14
6060};
6161
src/emu/cpu/sh2/sh2dasm.c
r1386r1387
77#define Rn ((opcode >> 8) & 15)
88#define Rm ((opcode >> 4) & 15)
99
10static const char *regname[16] = {
10static const char *const regname[16] = {
1111   "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
1212   "R8", "R9", "R10","R11","R12","R13","R14","SP"
1313};
src/emu/cpu/tms32051/32051ops.h
r1386r1387
1static void (* tms32051_opcode_table[256])(void) =
1static void (*const tms32051_opcode_table[256])(void) =
22{
33   /* 0x00 - 0x0f */
44   op_lar_mem,      op_lar_mem,      op_lar_mem,      op_lar_mem,
r1386r1387
8282   op_retcd,      op_retcd,      op_retcd,      op_retcd
8383};
8484
85static void (* tms32051_opcode_table_be[256])(void) =
85static void (*const tms32051_opcode_table_be[256])(void) =
8686{
8787   /* 0x00 - 0x0f */
8888   op_abs,         op_cmpl,      op_neg,         op_pac,
r1386r1387
166166   op_invalid,      op_invalid,      op_invalid,      op_invalid,
167167};
168168
169static void (* tms32051_opcode_table_bf[256])(void) =
169static void (*const tms32051_opcode_table_bf[256])(void) =
170170{
171171   /* 0x00 - 0x0f */
172172   op_spm,         op_spm,         op_spm,         op_spm,
src/emu/cpu/tms32051/dis32051.c
r1386r1387
33
44
55
6static const char *zl_condition_codes[] =
6static const char *const zl_condition_codes[] =
77{
88   // bit 3, 2 (ZL), bit 1, 0 (MASK)
99   "",            // Z=0, L=0, ZM=0, ZL=0
r1386r1387
2424   "leq",         // Z=1, L=1, ZM=1, ZL=1
2525};
2626
27static const char *cv_condition_codes[16] =
27static const char *const cv_condition_codes[16] =
2828{
2929   "",            // C=0, V=0, CM=0, VM=0
3030   "nov",         // C=0, V=0, CM=0, VM=1
r1386r1387
4444   "c ov",         // C=1, V=1, CM=1, VM=1
4545};
4646
47static const char *tp_condition_codes[4] =
47static const char *const tp_condition_codes[4] =
4848{
4949   "bio",
5050   "tc",
src/emu/cpu/sh4/sh4dasm.c
r1386r1387
77#define Rn ((opcode >> 8) & 15)
88#define Rm ((opcode >> 4) & 15)
99
10static const char *regname[16] = {
10static const char *const regname[16] = {
1111   "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
1212   "R8", "R9", "R10","R11","R12","R13","R14","SP"
1313};
src/emu/cpu/alph8201/8201dasm.c
r1386r1387
1515#define FMT(a,b) a, b
1616#define PTRS_PER_FORMAT 2
1717
18static const char *Formats[] = {
18static const char *const Formats[] = {
1919   FMT("0000_0000", "NOP"),         // 00
2020   FMT("0000_0001", "RRCA"),         // 01
2121   FMT("0000_0010", "RLCA"),         // 02
src/emu/cpu/g65816/g65816.c
r1386r1387
102102   return 1;
103103}
104104
105extern void (*g65816i_opcodes_M0X0[])(void);
105extern void (*const g65816i_opcodes_M0X0[])(void);
106106extern uint g65816i_get_reg_M0X0(int regnum);
107107extern void g65816i_set_reg_M0X0(int regnum, uint val);
108108extern void g65816i_set_line_M0X0(int line, int state);
109109extern int  g65816i_execute_M0X0(int cycles);
110110
111extern void (*g65816i_opcodes_M0X1[])(void);
111extern void (*const g65816i_opcodes_M0X1[])(void);
112112extern uint g65816i_get_reg_M0X1(int regnum);
113113extern void g65816i_set_reg_M0X1(int regnum, uint val);
114114extern void g65816i_set_line_M0X1(int line, int state);
115115extern int  g65816i_execute_M0X1(int cycles);
116116
117extern void (*g65816i_opcodes_M1X0[])(void);
117extern void (*const g65816i_opcodes_M1X0[])(void);
118118extern uint g65816i_get_reg_M1X0(int regnum);
119119extern void g65816i_set_reg_M1X0(int regnum, uint val);
120120extern void g65816i_set_line_M1X0(int line, int state);
121121extern int  g65816i_execute_M1X0(int cycles);
122122
123extern void (*g65816i_opcodes_M1X1[])(void);
123extern void (*const g65816i_opcodes_M1X1[])(void);
124124extern uint g65816i_get_reg_M1X1(int regnum);
125125extern void g65816i_set_reg_M1X1(int regnum, uint val);
126126extern void g65816i_set_line_M1X1(int line, int state);
127127extern int  g65816i_execute_M1X1(int cycles);
128128
129extern void (*g65816i_opcodes_E[])(void);
129extern void (*const g65816i_opcodes_E[])(void);
130130extern uint g65816i_get_reg_E(int regnum);
131131extern void g65816i_set_reg_E(int regnum, uint val);
132132extern void g65816i_set_line_E(int line, int state);
133133extern int  g65816i_execute_E(int cycles);
134134
135void (**g65816i_opcodes[5])(void) =
135void (*const *const g65816i_opcodes[5])(void) =
136136{
137137   g65816i_opcodes_M0X0,
138138   g65816i_opcodes_M0X1,
r1386r1387
141141   g65816i_opcodes_E
142142};
143143
144uint (*g65816i_get_reg[5])(int regnum) =
144uint (*const g65816i_get_reg[5])(int regnum) =
145145{
146146   g65816i_get_reg_M0X0,
147147   g65816i_get_reg_M0X1,
r1386r1387
150150   g65816i_get_reg_E
151151};
152152
153void (*g65816i_set_reg[5])(int regnum, uint val) =
153void (*const g65816i_set_reg[5])(int regnum, uint val) =
154154{
155155   g65816i_set_reg_M0X0,
156156   g65816i_set_reg_M0X1,
r1386r1387
159159   g65816i_set_reg_E
160160};
161161
162void (*g65816i_set_line[5])(int line, int state) =
162void (*const g65816i_set_line[5])(int line, int state) =
163163{
164164   g65816i_set_line_M0X0,
165165   g65816i_set_line_M0X1,
r1386r1387
168168   g65816i_set_line_E
169169};
170170
171int (*g65816i_execute[5])(int cycles) =
171int (*const g65816i_execute[5])(int cycles) =
172172{
173173   g65816i_execute_M0X0,
174174   g65816i_execute_M0X1,
src/emu/cpu/g65816/g65816op.h
r1386r1387
19541954#if FLAG_SET_E
19551955#define OP(CODE, OPERATION) static void g65816i_ ## CODE ## _E(void) {OPERATION;}
19561956#define O(CODE) g65816i_ ## CODE ## _E
1957#define TABLE_OPCODES void (*g65816i_opcodes_E[256])(void)
1957#define TABLE_OPCODES void (*const g65816i_opcodes_E[256])(void)
19581958#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE g65816i_ ## NAME ## _E ARGS
19591959
19601960#else
r1386r1387
19621962#if !FLAG_SET_M && !FLAG_SET_X
19631963#define OP(CODE, OPERATION) static void g65816i_ ## CODE ## _M0X0(void) {OPERATION;}
19641964#define O(CODE) g65816i_ ## CODE ## _M0X0
1965#define TABLE_OPCODES void (*g65816i_opcodes_M0X0[256])(void)
1965#define TABLE_OPCODES void (*const g65816i_opcodes_M0X0[256])(void)
19661966#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE g65816i_ ## NAME ## _M0X0 ARGS
19671967
19681968#elif !FLAG_SET_M && FLAG_SET_X
19691969
19701970#define OP(CODE, OPERATION) static void g65816i_ ## CODE ## _M0X1(void) {OPERATION;}
19711971#define O(CODE) g65816i_ ## CODE ## _M0X1
1972#define TABLE_OPCODES void (*g65816i_opcodes_M0X1[256])(void)
1972#define TABLE_OPCODES void (*const g65816i_opcodes_M0X1[256])(void)
19731973#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE g65816i_ ## NAME ## _M0X1 ARGS
19741974
19751975#elif FLAG_SET_M && !FLAG_SET_X
19761976
19771977#define OP(CODE, OPERATION) static void g65816i_ ## CODE ## _M1X0(void) {OPERATION;}
19781978#define O(CODE) g65816i_ ## CODE ## _M1X0
1979#define TABLE_OPCODES void (*g65816i_opcodes_M1X0[256])(void)
1979#define TABLE_OPCODES void (*const g65816i_opcodes_M1X0[256])(void)
19801980#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE g65816i_ ## NAME ## _M1X0 ARGS
19811981
19821982#elif FLAG_SET_M && FLAG_SET_X
19831983
19841984#define OP(CODE, OPERATION) static void g65816i_ ## CODE ## _M1X1(void) {OPERATION;}
19851985#define O(CODE) g65816i_ ## CODE ## _M1X1
1986#define TABLE_OPCODES void (*g65816i_opcodes_M1X1[256])(void)
1986#define TABLE_OPCODES void (*const g65816i_opcodes_M1X1[256])(void)
19871987#define TABLE_FUNCTION(RTYPE, NAME, ARGS)   RTYPE g65816i_ ## NAME ## _M1X1 ARGS
19881988
19891989#endif
src/emu/cpu/g65816/g65816cm.h
r1386r1387
8989   int (*int_ack)(int); /* Interrupt Acknowledge */
9090   read8_handler read_vector;   /* Read vector override */
9191   uint stopped;      /* Sets how the CPU is stopped */
92   void (**opcodes)(void);
92   void (*const *opcodes)(void);
9393   uint (*get_reg)(int regnum);
9494   void (*set_reg)(int regnum, uint val);
9595   void (*set_line)(int line, int state);
r1386r1387
101101extern uint g65816i_source;
102102extern uint g65816i_destination;
103103
104extern void (**g65816i_opcodes[])(void);
105extern uint (*g65816i_get_reg[])(int regnum);
106extern void (*g65816i_set_reg[])(int regnum, uint val);
107extern void (*g65816i_set_line[])(int line, int state);
108extern int (*g65816i_execute[])(int cycles);
104extern void (*const *const g65816i_opcodes[])(void);
105extern uint (*const g65816i_get_reg[])(int regnum);
106extern void (*const g65816i_set_reg[])(int regnum, uint val);
107extern void (*const g65816i_set_line[])(int line, int state);
108extern int (*const g65816i_execute[])(int cycles);
109109
110110#define REGISTER_A      g65816i_cpu.a      /* Accumulator */
111111#define REGISTER_B      g65816i_cpu.b      /* Accumulator hi byte */
src/emu/cpu/g65816/g65816ds.c
r1386r1387
6363  TYA ,  TYX ,  WAI ,  WDM ,  XBA ,  XCE
6464};
6565
66static const char* g_opnames[] =
66static const char *const g_opnames[] =
6767{
6868 "ADC", "AND", "ASL", "BCC", "BCS", "BEQ", "BIT", "BMI", "BNE", "BPL", "BRA",
6969 "BRK", "BRL", "BVC", "BVS", "CLC", "CLD", "CLI", "CLV", "CMP", "COP", "CPX",
src/emu/cpu/nec/nec.c
r1386r1387
10061006
10071007static void nec_init(int index, int clock, const void *config, int (*irqcallback)(int), int type)
10081008{
1009   static const char *names[]={"V20","V30","V33"};
1009   static const char *const names[]={"V20","V30","V33"};
10101010
10111011   state_save_register_item_array(names[type], index, I.regs.w);
10121012   state_save_register_item_array(names[type], index, I.sregs);
src/emu/cpu/nec/necdasm.c
r1386r1387
802802
803803
804804
805static const char *nec_reg[8] = { "aw",  "cw",  "dw",  "bw",  "sp",  "bp",  "ix",  "iy" };
806static const char *neg_reg8[8] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" };
807static const char *nec_sreg[8] = { "ds1", "ps", "ss", "ds0", "???", "???", "???", "???" };
805static const char *const nec_reg[8] = { "aw",  "cw",  "dw",  "bw",  "sp",  "bp",  "ix",  "iy" };
806static const char *const neg_reg8[8] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" };
807static const char *const nec_sreg[8] = { "ds1", "ps", "ss", "ds0", "???", "???", "???", "???" };
808808
809809static UINT32 pc;
810810static UINT8 modrm;
src/emu/cpu/i8051/i8051.c
r1386r1387
456456#define R_B      i8051.b
457457
458458/* # of oscilations each opcode requires*/
459static UINT8 i8051_cycles[] = {
459static const UINT8 i8051_cycles[] = {
460460   12,24,24,12,12,12,12,12,12,12,12,12,12,12,12,12,
461461   24,24,24,12,12,12,12,12,12,12,12,12,12,12,12,12,
462462   24,24,24,12,12,12,12,12,12,12,12,12,12,12,12,12,
src/emu/cpu/mips/mips3dsm.c
r1386r1387
99#include "cpuintrf.h"
1010
1111
12static const char *reg[32] =
12static const char *const reg[32] =
1313{
1414   "0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
1515   "r8",   "r9",   "r10",   "r11",   "r12",   "r13",   "r14",   "r15",
r1386r1387
1818};
1919
2020
21static const char *cpreg[4][32] =
21static const char *const cpreg[4][32] =
2222{
2323   {
2424      "Index","Random","EntryLo0","EntryLo1","Context","PageMask","Wired","Error",
r1386r1387
4747};
4848
4949
50static const char *ccreg[4][32] =
50static const char *const ccreg[4][32] =
5151{
5252   {
5353      "ccr0",   "ccr1",   "ccr2",   "ccr3",   "ccr4",   "ccr5",   "ccr6",   "ccr7",
r1386r1387
148148
149149static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer)
150150{
151   static const char *format_table[] =
151   static const char *const format_table[] =
152152   {
153153      "?","?","?","?","?","?","?","?","?","?","?","?","?","?","?","?",
154154      "s","d","?","?","w","l","?","?","?","?","?","?","?","?","?","?"
r1386r1387
231231
232232static UINT32 dasm_cop1x(UINT32 pc, UINT32 op, char *buffer)
233233{
234   static const char *format3_table[] =
234   static const char *const format3_table[] =
235235   {
236236      "s","d","?","?","w","l","?","?"
237237   };
src/emu/cpu/mips/mdrc64.c
r1386r1387
351351
352352static const UINT8 nvreg[] = { REG_NV0, REG_NV1, REG_NV2, REG_NV3, REG_NV4, REG_NV5, REG_NV6 };
353353
354static const char *x86regname[] = {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15"};
354static const char *const x86regname[] = {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15"};
355355
356356
357357
src/emu/cpu/mips/r3kdasm.c
r1386r1387
99#include "cpuintrf.h"
1010
1111
12static const char *reg[32] =
12static const char *const reg[32] =
1313{
1414   "0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
1515   "r8",   "r9",   "r10",   "r11",   "r12",   "r13",   "r14",   "r15",
r1386r1387
1818};
1919
2020
21static const char *cpreg[4][32] =
21static const char *const cpreg[4][32] =
2222{
2323   {
2424      "Index","Random","EntryLo","cpr3",   "Context",   "cpr5",   "cpr6",   "cpr7",
r1386r1387
4747};
4848
4949
50static const char *ccreg[4][32] =
50static const char *const ccreg[4][32] =
5151{
5252   {
5353      "ccr0",   "ccr1",   "ccr2",   "ccr3",   "ccr4",   "ccr5",   "ccr6",   "ccr7",
src/emu/cpu/mips/dismips.c
r1386r1387
4242
4343static UINT8 *filebuf;
4444static UINT32 offset;
45static UINT8 order[] = { 0, 1, 2, 3 };
45static const UINT8 order[] = { 0, 1, 2, 3 };
4646
47static char *Options[]=
47static const char *const Options[]=
4848{
4949   "begin", "end", "offset", "order", "format", "cpu", 0
5050};
src/emu/cpu/mips/psx.c
r1386r1387
6262#define CAUSE_CE2 ( 2L << 28 )
6363#define CAUSE_BD ( 1L << 31 )
6464
65static const char *delayn[] =
65static const char *const delayn[] =
6666{
6767   "pc", "at", "v0", "v1", "a0", "a1", "a2", "a3",
6868   "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
r1386r1387
9292
9393static int mips_ICount = 0;
9494
95static UINT32 mips_mtc0_writemask[]=
95static const UINT32 mips_mtc0_writemask[]=
9696{
9797   0xffffffff, /* INDEX */
9898   0x00000000, /* RANDOM */
r1386r1387
25132513   UINT16 n_v1;
25142514   UINT16 n_v2;
25152515   UINT16 n_v3;
2516   const UINT16 **p_n_mx;
2517   const UINT32 **p_n_cv;
2516   const UINT16 *const *p_n_mx;
2517   const UINT32 *const *p_n_cv;
25182518   static const UINT16 n_zm = 0;
25192519   static const UINT32 n_zc = 0;
2520   static const UINT16 *p_n_vx[] = { &VX0, &VX1, &VX2 };
2521   static const UINT16 *p_n_vy[] = { &VY0, &VY1, &VY2 };
2522   static const UINT16 *p_n_vz[] = { &VZ0, &VZ1, &VZ2 };
2523   static const UINT16 *p_n_rm[] = { &R11, &R12, &R13, &R21, &R22, &R23, &R31, &R32, &R33 };
2524   static const UINT16 *p_n_lm[] = { &L11, &L12, &L13, &L21, &L22, &L23, &L31, &L32, &L33 };
2525   static const UINT16 *p_n_cm[] = { &LR1, &LR2, &LR3, &LG1, &LG2, &LG3, &LB1, &LB2, &LB3 };
2526   static const UINT16 *p_n_zm[] = { &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm };
2527   static const UINT16 **p_p_n_mx[] = { p_n_rm, p_n_lm, p_n_cm, p_n_zm };
2528   static const UINT32 *p_n_tr[] = { &TRX, &TRY, &TRZ };
2529   static const UINT32 *p_n_bk[] = { &RBK, &GBK, &BBK };
2530   static const UINT32 *p_n_fc[] = { &RFC, &GFC, &BFC };
2531   static const UINT32 *p_n_zc[] = { &n_zc, &n_zc, &n_zc };
2532   static const UINT32 **p_p_n_cv[] = { p_n_tr, p_n_bk, p_n_fc, p_n_zc };
2520   static const UINT16 *const p_n_vx[] = { &VX0, &VX1, &VX2 };
2521   static const UINT16 *const p_n_vy[] = { &VY0, &VY1, &VY2 };
2522   static const UINT16 *const p_n_vz[] = { &VZ0, &VZ1, &VZ2 };
2523   static const UINT16 *const p_n_rm[] = { &R11, &R12, &R13, &R21, &R22, &R23, &R31, &R32, &R33 };
2524   static const UINT16 *const p_n_lm[] = { &L11, &L12, &L13, &L21, &L22, &L23, &L31, &L32, &L33 };
2525   static const UINT16 *const p_n_cm[] = { &LR1, &LR2, &LR3, &LG1, &LG2, &LG3, &LB1, &LB2, &LB3 };
2526   static const UINT16 *const p_n_zm[] = { &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm };
2527   static const UINT16 *const *p_p_n_mx[] = { p_n_rm, p_n_lm, p_n_cm, p_n_zm };
2528   static const UINT32 *const p_n_tr[] = { &TRX, &TRY, &TRZ };
2529   static const UINT32 *const p_n_bk[] = { &RBK, &GBK, &BBK };
2530   static const UINT32 *const p_n_fc[] = { &RFC, &GFC, &BFC };
2531   static const UINT32 *const p_n_zc[] = { &n_zc, &n_zc, &n_zc };
2532   static const UINT32 *const *p_p_n_cv[] = { p_n_tr, p_n_bk, p_n_fc, p_n_zc };
25332533
25342534   switch( GTE_FUNCT( gteop ) )
25352535   {
src/emu/cpu/mips/mipsdasm.c
r1386r1387
2121   return s_hex;
2222}
2323
24static const char *s_cpugenreg[] =
24static const char *const s_cpugenreg[] =
2525{
2626   "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
2727   "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
r1386r1387
2929   "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra"
3030};
3131
32static const char *s_cp0genreg[] =
32static const char *const s_cp0genreg[] =
3333{
3434   "Index", "Random", "EntryLo", "cp0r3", "Context", "cp0r5", "cp0r6", "cp0r7",
3535   "BadVAddr", "cp0r9", "EntryHi", "cp0r11", "SR", "Cause", "EPC", "PRId",
r1386r1387
3737   "cp0r24", "cp0r25", "cp0r26", "cp0r27", "cp0r28", "cp0r29", "cp0r30", "cp0r31"
3838};
3939
40static const char *s_cp1genreg[] =
40static const char *const s_cp1genreg[] =
4141{
4242   "cp1r0", "cp1r1", "cp1r2", "cp1r3", "cp1r4", "cp1r5", "cp1r6", "cp1r7",
4343   "cp1r8", "cp1r9", "cp1r10", "cp1r11", "cp1r12", "cp1r13", "cp1r14", "cp1r15",
r1386r1387
4545   "cp1r23", "cp1r24", "cp1r25", "cp1r26", "cp1r27", "cp1r28", "cp1r29", "cp1r30"
4646};
4747
48static const char *s_cp1ctlreg[] =
48static const char *const s_cp1ctlreg[] =
4949{
5050   "cp1cr0", "cp1cr1", "cp1cr2", "cp1cr3", "cp1cr4", "cp1cr5", "cp1cr6", "cp1cr7",
5151   "cp1cr8", "cp1cr9", "cp1cr10", "cp1cr11", "cp1cr12", "cp1cr13", "cp1cr14", "cp1cr15",
r1386r1387
5353   "cp1cr24", "cp1cr25", "cp1cr26", "cp1cr27", "cp1cr28", "cp1cr29", "cp1cr30", "cp1cr31"
5454};
5555
56static const char *s_cp2genreg[] =
56static const char *const s_cp2genreg[] =
5757{
5858   "vxy0", "vz0", "vxy1", "vz1", "vxy2", "vz2", "rgb", "otz",
5959   "ir0", "ir1", "ir2", "ir3", "sxy0", "sxy1", "sxy2", "sxyp",
r1386r1387
6161   "mac0", "mac1", "mac2", "mac3", "irgb", "orgb", "lzcs", "lzcr"
6262};
6363
64static const char *s_cp2ctlreg[] =
64static const char *const s_cp2ctlreg[] =
6565{
6666   "r11r12", "r13r21", "r22r23", "r31r32", "r33", "trx", "try", "trz",
6767   "l11l12", "l13l21", "l22l23", "l31l32", "l33", "rbk", "gbk", "bbk",
r1386r1387
6969   "ofx", "ofy", "h", "dqa", "dqb", "zsf3", "zsf4", "flag"
7070};
7171
72static const char *s_gtesf[] =
72static const char *const s_gtesf[] =
7373{
7474   "0", "12"
7575};
7676
77static const char *s_gtemx[] =
77static const char *const s_gtemx[] =
7878{
7979   "rm", "lm", "cm", "0"
8080};
8181
82static const char *s_gtev[] =
82static const char *const s_gtev[] =
8383{
8484   "v0", "v1", "v2", "ir"
8585};
8686
87static const char *s_gtecv[] =
87static const char *const s_gtecv[] =
8888{
8989   "tr", "bk", "fc", "0"
9090};
9191
92static const char *s_gtelm[] =
92static const char *const s_gtelm[] =
9393{
9494   "0", "1"
9595};
src/emu/cpu/mips/mips3.c
r1386r1387
136136static void sdl_le(UINT32 op);
137137static void sdr_le(UINT32 op);
138138
139static UINT8 fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 };
139static const UINT8 fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 };
140140
141141
142142
src/emu/cpu/tms7000/7000dasm.c
r1386r1387
1515   UINT32      s_flag;
1616} opcodeinfo;
1717
18static oprandinfo of[] = {
18static const oprandinfo of[] = {
1919/* 00 */ { {" B,A",      "",         "",         ""},      {NONE, DONE, DONE, DONE} },
2020/* 01 */ { {" R%u",      ",A",      "",       ""},      {UI8, NONE, DONE, DONE} },
2121/* 02 */ { {" R%u",      ",B",      "",       ""},      {UI8, NONE, DONE, DONE} },
r1386r1387
7575/* 45 */ { {" *R%u",   "",         "",         ""},      {UI8, DONE, DONE, DONE} }
7676};
7777
78static opcodeinfo opcodes[] = {
78static const opcodeinfo opcodes[] = {
7979   {0x69, "ADC", 0, 0 },
8080   {0x19, "ADC", 1, 0 },
8181   {0x39, "ADC", 2, 0 },
src/emu/cpu/f8/f8dasm.c
r1386r1387
22#include "debugger.h"
33#include "f8.h"
44
5static const char *rname[16] = {
5static const char *const rname[16] = {
66   "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
77   "R8", "J",  "HU", "HL", "KU", "KL", "QU", "QL"
88};
src/emu/cpu/z80/z80dasm.c
r1386r1387
3535   zSLL  ,zSRA  ,zSRL   ,zSUB  ,zXOR
3636};
3737
38static const char *s_mnemonic[] =
38static const char *const s_mnemonic[] =
3939{
4040   "adc" ,"add" ,"and" ,"bit" ,"call","ccf" ,"cp"  ,"cpd" ,
4141   "cpdr","cpi" ,"cpir","cpl" ,"daa" ,"db"  ,"dec" ,"di"  ,
src/emu/cpu/asap/asapdasm.c
r1386r1387
99#include "asap.h"
1010
1111
12static const char *reg[32] =
12static const char *const reg[32] =
1313{
1414   "0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
1515   "r8",   "r9",   "r10",   "r11",   "r12",   "r13",   "r14",   "r15",
r1386r1387
1717   "r24",   "r25",   "r26",   "r27",   "r28",   "r29",   "r30",   "r31"
1818};
1919
20static const char *setcond[2] =
20static const char *const setcond[2] =
2121{
2222   "  ", ".c"
2323};
2424
25static const char *condition[16] =
25static const char *const condition[16] =
2626{
2727   "sp", "mz", "gt", "le", "ge", "lt", "hi", "ls", "cc", "cs", "pl", "mi", "ne", "eq", "vc", "vs"
2828};
src/emu/cpu/tms9900/99xxcore.h
r1386r1387
23772377
23782378static int readCRU(int CRUAddr, int Number)
23792379{
2380   static int BitMask[] =
2380   static const int BitMask[] =
23812381   {
23822382      0, /* filler - saves a subtract to find mask */
23832383      0x0001,0x0003,0x0007,0x000F,0x001F,0x003F,0x007F,0x00FF,
r1386r1387
45274527
45284528   /* tms9900-like instruction set*/
45294529
4530   static void (* jumptable[128])(UINT16) =
4530   static void (*const jumptable[128])(UINT16) =
45314531   {
45324532      &illegal,&h0200,&h0400,&h0400,&h0800,&h0800,&illegal,&illegal,
45334533      &h1000,&h1000,&h1000,&h1000,&h1000,&h1000,&h1000,&h1000,
r1386r1387
45544554   /* tms9989 and tms9995 include 4 extra instructions, and one additionnal instruction type */
45554555   /* tms99000 includes yet another additional instruction */
45564556
4557   static void (* jumptable[256])(UINT16) =
4557   static void (*const jumptable[256])(UINT16) =
45584558   {
45594559      &h0040,&h0100,&h0200,&h0200,&h0400,&h0400,&h0400,&h0400,
45604560      &h0800,&h0800,&h0800,&h0800,&illegal,&illegal,&illegal,&illegal,
src/emu/cpu/i960/i960.c
r1386r1387
396396
397397static const char *i960_get_strflags(void)
398398{
399   static const char *conditions[8] =
399   static const char *const conditions[8] =
400400   {
401401      "no", "g", "e", "ge", "l", "ne", "le", "o"
402402   };
src/emu/cpu/i960/i960dis.c
r1386r1387
9090   { "ending_code",0 }
9191};
9292
93static const char *constnames[32] =
93static const char *const constnames[32] =
9494{
9595   "0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9", "0xa", "0xb", "0xc", "0xd", "0xe", "0xf",
9696   "0x10", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "0x17", "0x18", "0x19", "0x1a", "0x1b", "0x1c", "0x1d", "0x1e", "0x1f"
9797};
9898
99static const char *regnames[32] =
99static const char *const regnames[32] =
100100{
101101   "pfp","sp","rip","r3", "r4","r5","r6","r7", "r8","r9","r10","r11", "r12","r13","r14","r15",
102102   "g0","g1","g2","g3", "g4","g5","g6","g7", "g8","g9","g10","g11", "g12","g13","g14","fp",
src/emu/cpu/v810/v810.c
r1386r1387
877877   return clkIF+1;
878878}
879879
880static UINT32 (*OpCodeTable[64])(void) =
880static UINT32 (*const OpCodeTable[64])(void) =
881881{
882882   /* 0x00 */ opMOVr,     // mov r1,r2            1
883883   /* 0x01 */ opADDr,     // add r1,r2            1
src/emu/cpu/v810/v810dasm.c
r1386r1387
77#include "debugger.h"
88#include "v810.h"
99
10const static char *dRegs[]={
10static const char *const dRegs[]=
11{
1112"R0","R1","R2","SP","R4",
1213"R5","R6","R7","R8","R9",
1314"R10","R11","R12","R13",
src/emu/cpu/tms32025/32025dsm.c
r1386r1387
6060#define FMT(a,b) a, b
6161#define PTRS_PER_FORMAT 2
6262
63static const char *arith[8] = { "*", "*-", "*+", "??", "BR0-", "*0-", "*0+", "*BR0+" } ;
64static const char *nextar[16] = { "", "", "", "", "", "", "", "", ",AR0", ",AR1", ",AR2", ",AR3", ",AR4", ",AR5", ",AR6", ",AR7" } ;
65static const char *cmpmode[4] = { "0 (ARx = AR0)" , "1 (ARx < AR0)" , "2 (ARx > AR0)" , "3 (ARx <> AR0)" } ;
63static const char *const arith[8] = { "*", "*-", "*+", "??", "BR0-", "*0-", "*0+", "*BR0+" } ;
64static const char *const nextar[16] = { "", "", "", "", "", "", "", "", ",AR0", ",AR1", ",AR2", ",AR3", ",AR4", ",AR5", ",AR6", ",AR7" } ;
65static const char *const cmpmode[4] = { "0 (ARx = AR0)" , "1 (ARx < AR0)" , "2 (ARx > AR0)" , "3 (ARx <> AR0)" } ;
6666
6767
68static const char *TMS32025Formats[] = {
68static const char *const TMS32025Formats[] = {
6969   FMT("0000tttt0aaaaaaa", "add  %A,%T"),   /* 0xxx */
7070   FMT("0000tttt1mmmnnnn", "add  %M,%T%N"),
7171   FMT("0001tttt0aaaaaaa", "sub  %A,%T"),   /* 1xxx */
r1386r1387
347347
348348static void InitDasm32025(void)
349349{
350   const char *p, **ops;
350   const char *p;
351   const char *const *ops;
351352   word mask, bits;
352353   int bit;
353354   int i;
src/emu/cpu/tms32025/tms32025.c
r1386r1387
16431643 *  Opcode Table
16441644 ***********************************************************************/
16451645
1646static opcode_fn opcode_main[256]=
1646static const opcode_fn opcode_main[256]=
16471647{
16481648/*00*/ add,         add,      add,      add,      add,      add,      add,      add,
16491649/*08*/ add,         add,      add,      add,      add,      add,      add,      add,
r1386r1387
16791679/*F8*/ bbz,         bbnz,      bioz,      banz,      blkp,      blkd,      call,      br
16801680};
16811681
1682static opcode_fn opcode_DX_subset[8]=   /* Instructions living under the Dxxx opcode */
1682static const opcode_fn opcode_DX_subset[8]=   /* Instructions living under the Dxxx opcode */
16831683{
16841684/*00*/ lrlk,      lalk,      adlk,      sblk,      andk,      ork,      xork,      illegal
16851685};
16861686
1687static opcode_fn opcode_CE_subset[256]=
1687static const opcode_fn opcode_CE_subset[256]=
16881688{
16891689/*00*/ eint,      dint,      rovm,      sovm,      cnfd,      cnfp,      rsxm,      ssxm,
16901690/*08*/ spm,         spm,      spm,      spm,      rxf,      sxf,      fort,      fort,
src/emu/cpu/pic16c5x/16c5xdsm.c
r1386r1387
5252#define FMT(a,b) a, b
5353#define PTRS_PER_FORMAT 2
5454
55static const char *regfile[32] = { "Reg$00 (IND)",    "Reg$01 (TMR)",    "Reg$02 (PCL)",  "Reg$03 (ST)", "Reg$04 (FSR)", "Reg$05 (PTA)", "Reg$06 (PTB)", "Reg$07 (PTC)",
55static const char *const regfile[32] = { "Reg$00 (IND)",    "Reg$01 (TMR)",    "Reg$02 (PCL)",  "Reg$03 (ST)", "Reg$04 (FSR)", "Reg$05 (PTA)", "Reg$06 (PTB)", "Reg$07 (PTC)",
5656                         "Reg$08", "Reg$09", "Reg$0A", "Reg$0B", "Reg$0C", "Reg$0D", "Reg$0E", "Reg$0F",
5757                         "Reg$10", "Reg$11", "Reg$12", "Reg$13", "Reg$14", "Reg$15", "Reg$16", "Reg$17",
5858                         "Reg$18", "Reg$19", "Reg$1A", "Reg$1B", "Reg$1C", "Reg$1D", "Reg$1E", "Reg$1F" };
5959
60static const char *dest[2] = { "W", "Reg" };
60static const char *const dest[2] = { "W", "Reg" };
6161
62static const char *PIC16C5xFormats[] = {
62static const char *const PIC16C5xFormats[] = {
6363   FMT("000000000000", "nop"),
6464   FMT("000000000010", "option"),
6565   FMT("000000000011", "sleep"),
r1386r1387
113113
114114static void InitDasm16C5x(void)
115115{
116   const char *p, **ops;
116   const char *p;
117   const char *const *ops;
117118   word mask, bits;
118119   int bit;
119120   int i;
src/emu/cpu/t11/t11dasm.c
r1386r1387
1010#include "debugger.h"
1111#include "t11.h"
1212
13static const char *regs[8] = { "R0", "R1", "R2", "R3", "R4", "R5", "SP", "PC" };
13static const char *const regs[8] = { "R0", "R1", "R2", "R3", "R4", "R5", "SP", "PC" };
1414
1515static const UINT8 *rombase;
1616static offs_t pcbase;
src/emu/cpu/t11/t11table.c
r1386r1387
11091109
11101110
11111111
1112static void (*opcode_table[65536 >> 3])(void) =
1112static void (*const opcode_table[65536 >> 3])(void) =
11131113{
11141114   /* 0x0000 */
11151115   op_0000,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,   illegal,
src/emu/cpu/arm7/arm7dasm.c
r1386r1387
119119static char *WriteDataProcessingOperand( char *pBuf, UINT32 opcode, int printOp0, int printOp1, int printOp2 )
120120{
121121   /* ccccctttmmmm */
122   static const char *pRegOp[4] = { "LSL","LSR","ASR","ROR" };
122   static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" };
123123
124124   if (printOp0)
125125      pBuf += sprintf(pBuf,"R%d, ", (opcode>>12)&0xf);
r1386r1387
158158static char *WriteRegisterOperand1( char *pBuf, UINT32 opcode )
159159{
160160   /* ccccctttmmmm */
161   static const char *pRegOp[4] = { "LSL","LSR","ASR","ROR" };
161   static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" };
162162
163163   pBuf += sprintf(
164164      pBuf,
r1386r1387
202202{
203203   const char *pBuf0;
204204
205   static const char *pConditionCodeTable[16] =
205   static const char *const pConditionCodeTable[16] =
206206   {
207207      "EQ","NE","CS","CC",
208208      "MI","PL","VS","VC",
209209      "HI","LS","GE","LT",
210210      "GT","LE","","NV"
211211   };
212   static const char *pOperation[16] =
212   static const char *const pOperation[16] =
213213   {
214214      "AND","EOR","SUB","RSB",
215215      "ADD","ADC","SBC","RSC",
src/emu/cpu/h6280/6280dasm.c
r1386r1387
7676};
7777
7878
79static const char *token[]=
79static const char *const token[]=
8080{
8181   /* 6502 opcodes */
8282   "adc", "and", "asl", "bcc", "bcs", "beq", "bit", "bmi",
src/emu/cpu/h6280/h6280.c
r1386r1387
213213
214214   /* timer off by default */
215215   h6280.timer_status=0;
216   h6280.timer_load = 128 * 1024;
216217
217218    /* clear pending interrupts */
218219   for (i = 0; i < 3; i++)
src/emu/cpu/m6800/6800tbl.c
r1386r1387
251251static void trap(void);
252252#endif
253253
254static void (*m6800_insn[0x100])(void) = {
254static void (*const m6800_insn[0x100])(void) = {
255255illegal,nop,   illegal,illegal,illegal,illegal,tap,   tpa,
256256inx,   dex,   clv,   sev,   clc,   sec,   cli,   sei,
257257sba,   cba,   illegal,illegal,illegal,illegal,tab,   tba,
r1386r1387
287287};
288288
289289#if (HAS_M6801||HAS_M6803)
290static void (*m6803_insn[0x100])(void) = {
290static void (*const m6803_insn[0x100])(void) = {
291291illegal,nop,   illegal,illegal,lsrd,   asld,   tap,   tpa,
292292inx,   dex,   clv,   sev,   clc,   sec,   cli,   sei,
293293sba,   cba,   illegal,illegal,illegal,illegal,tab,   tba,
r1386r1387
324324#endif
325325
326326#if (HAS_HD63701)
327static void (*hd63701_insn[0x100])(void) = {
327static void (*const hd63701_insn[0x100])(void) = {
328328trap   ,nop,   trap   ,trap   ,lsrd,   asld,   tap,   tpa,
329329inx,   dex,   clv,   sev,   clc,   sec,   cli,   sei,
330330sba,   cba,   undoc1, undoc2, trap   ,trap   ,tab,   tba,
r1386r1387
361361#endif
362362
363363#if (HAS_NSC8105)
364static void (*nsc8105_insn[0x100])(void) = {
364static void (*const nsc8105_insn[0x100])(void) = {
365365illegal,illegal,nop,   illegal,illegal,tap,   illegal,tpa,
366366inx,   clv,   dex,   sev,   clc,   cli,   sec,   sei,
367367sba,   illegal,cba,   illegal,illegal,tab,   illegal,tba,
src/emu/cpu/m6800/6800dasm.c
r1386r1387
5252   tstb,   tsx,   txs,   asx1,   asx2,   xgdx,   addx,   adcx
5353};
5454
55static const char *op_name_str[] = {
55static const char *const op_name_str[] = {
5656   "aba",   "abx",   "adca",  "adcb",  "adda",  "addb",  "addd",  "aim",
5757   "anda",  "andb",  "asl",   "asla",  "aslb",  "asld",  "asr",   "asra",
5858   "asrb",  "bcc",   "bcs",   "beq",   "bge",   "bgt",   "bhi",   "bita",
r1386r1387
7979 * 2    invalid opcode for 1:6800/6802/6808, 2:6801/6803, 4:HD63701
8080 */
8181
82static UINT8 table[0x102][3] = {
82static const UINT8 table[0x102][3] = {
8383   {ill, inh,7},{nop, inh,0},{ill, inh,7},{ill, inh,7},/* 00 */
8484   {lsrd,inh,1},{asld,inh,1},{tap, inh,0},{tpa, inh,0},
8585   {inx, inh,0},{dex, inh,0},{clv, inh,0},{sev, inh,0},
src/emu/cpu/saturn/saturnds.c
r1386r1387
4444#define W "W"
4545#define A "A"
4646
47static const char *adr_b[]=
47static const char *const adr_b[]=
4848{ P, WP, XS, X, S, M, B, W };
4949
50static const char *adr_af[]=
50static const char *const adr_af[]=
5151{ P, WP, XS, X, S, M, B, W, 0, 0, 0, 0, 0, 0, 0, A };
5252
53static const char *adr_a[]=
53static const char *const adr_a[]=
5454{ P, WP, XS, X, S, M, B, W };
5555
5656static const char number_2_hex[]=
r1386r1387
587587   return 0;
588588}
589589
590static OPCODE opcodes[][0x10]= {
590static const OPCODE opcodes[][0x10]= {
591591   {
592592      // first digit
593593      { Opcode0 },
r1386r1387
12611261   int cont=1; // operation still not complete disassembled
12621262   char bin[10]; int binsize=0; // protocollizing fetched nibbles
12631263   char number[17];
1264   OPCODE *level=opcodes[0]; //pointer to current digit
1264   const OPCODE *level=opcodes[0]; //pointer to current digit
12651265   int op; // currently fetched nibble
12661266   int   pos = 0;
12671267
src/emu/cpu/i8x41/i8x41.c
r1386r1387
12821282 *  Cycle Timings
12831283 ***********************************************************************/
12841284
1285static UINT8 i8x41_cycles[] = {
1285static const UINT8 i8x41_cycles[] = {
12861286   1,1,1,2,2,1,1,1,2,2,2,2,2,2,2,2,
12871287   1,1,2,2,2,1,2,1,1,1,1,1,1,1,1,1,
12881288   1,1,1,2,2,1,2,1,1,1,1,1,1,1,1,1,
src/emu/cpu/konami/konami.c
r1386r1387
213213#define SET_V8(a,b,r)   CC|=(((a^b^r^(r>>1))&0x80)>>6)
214214#define SET_V16(a,b,r)   CC|=(((a^b^r^(r>>1))&0x8000)>>14)
215215
216static UINT8 flags8i[256]=    /* increment */
216static const UINT8 flags8i[256]=    /* increment */
217217{
218218CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2192190x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
r1386r1387
232232CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,
233233CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N,CC_N
234234};
235static UINT8 flags8d[256]= /* decrement */
235static const UINT8 flags8d[256]= /* decrement */
236236{
237237CC_Z,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
2382380x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
r1386r1387
332332}
333333
334334/* opcode timings */
335static UINT8 cycles1[] =
335static const UINT8 cycles1[] =
336336{
337337   /*   0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F */
338338  /*0*/  1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 5, 5, 5, 5,
src/emu/cpu/konami/knmidasm.c
r1386r1387
296296}
297297
298298/* Table for indexed operations */
299static char index_reg[8][3] = {
299static const char index_reg[8][3] = {
300300   "?", /* 0 - extended mode */
301301   "?", /* 1 */
302302   "x", /* 2 */
r1386r1387
308308};
309309
310310/* Table for tfr/exg operations */
311static char tfrexg_reg[8][3] = {
311static const char tfrexg_reg[8][3] = {
312312   "a", /* 0 */
313313   "b", /* 1 */
314314   "x", /* 2 */
r1386r1387
320320};
321321
322322/* Table for stack S operations */
323static char stack_reg_s[8][3] = {
323static const char stack_reg_s[8][3] = {
324324   "cc",
325325   "a",
326326   "b",
r1386r1387
332332};
333333
334334/* Table for stack U operations */
335static char stack_reg_u[8][3] = {
335static const char stack_reg_u[8][3] = {
336336   "cc",
337337   "a",
338338   "b",
r1386r1387
15851585   int confirmed;
15861586} konami_opcode_def;
15871587
1588static konami_opcode_def op_table[256] = {
1588static const konami_opcode_def op_table[256] = {
15891589   /* 00 */   { illegal, 0 },
15901590   /* 01 */   { illegal, 0 },
15911591   /* 02 */   { illegal, 0 },
src/emu/audio/generic.c
r1386r1387
158158
159159void soundlatch_setclearedvalue(int value)
160160{
161   assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!");
161162   latch_clear_value = value;
162163}
src/emu/info.c
r1386r1387
560560
561561   for( i = 0; i < MAX_SOUND && drv.sound[i].type != SOUND_DUMMY; i++ )
562562   {
563      const char **samplenames = NULL;
563      const char *const *samplenames = NULL;
564564      if( drv.sound[i].type == SOUND_SAMPLES )
565         samplenames = ((struct Samplesinterface *)drv.sound[i].config)->samplenames;
565         samplenames = ((const struct Samplesinterface *)drv.sound[i].config)->samplenames;
566566      if (samplenames != 0 && samplenames[0] != 0) {
567567         int k = 0;
568568         if (samplenames[k][0]=='*')
r1386r1387
587587
588588   for( i = 0; i < MAX_SOUND && drv.sound[i].type != SOUND_DUMMY; i++ )
589589   {
590      const char **samplenames = NULL;
590      const char *const *samplenames = NULL;
591591      if( drv.sound[i].type == SOUND_SAMPLES )
592         samplenames = ((struct Samplesinterface *)drv.sound[i].config)->samplenames;
592         samplenames = ((const struct Samplesinterface *)drv.sound[i].config)->samplenames;
593593      if (samplenames != 0 && samplenames[0] != 0) {
594594         int k = 0;
595595         if (samplenames[k][0]=='*')
src/emu/audit.c
r1386r1387
131131   for (sndnum = 0; sndnum < ARRAY_LENGTH(config.sound); sndnum++)
132132      if (config.sound[sndnum].type == SOUND_SAMPLES)
133133      {
134         struct Samplesinterface *intf = (struct Samplesinterface *)config.sound[sndnum].config;
134         const struct Samplesinterface *intf = (const struct Samplesinterface *)config.sound[sndnum].config;
135135
136136         if (intf->samplenames != NULL)
137137         {
r1386r1387
156156   for (sndnum = 0; sndnum < ARRAY_LENGTH(config.sound); sndnum++)
157157      if (config.sound[sndnum].type == SOUND_SAMPLES)
158158      {
159         struct Samplesinterface *intf = (struct Samplesinterface *)config.sound[sndnum].config;
159         const struct Samplesinterface *intf = (const struct Samplesinterface *)config.sound[sndnum].config;
160160         const char *sharedname = NULL;
161161
162162         if (intf->samplenames != NULL)
src/emu/emu.mak
r1386r1387
121121   $(EMUMACHINE)/74181.o \
122122   $(EMUMACHINE)/8042kbdc.o \
123123   $(EMUMACHINE)/8237dma.o \
124   $(EMUMACHINE)/8257dma.o \
124125   $(EMUMACHINE)/8255ppi.o \
125126   $(EMUMACHINE)/adc083x.o \
126127   $(EMUMACHINE)/adc1213x.o \
src/emu/machine/at28c16.c
r1386r1387
1111#include "driver.h"
1212#include "machine/at28c16.h"
1313
14#define DATA_SIZE ( 0x800 )
15#define ID_SIZE ( 0x020 )
16#define ID_OFFSET ( DATA_SIZE - ID_SIZE )
14#define SIZE_DATA ( 0x800 )
15#define SIZE_ID ( 0x020 )
16#define OFFSET_ID ( SIZE_DATA - SIZE_ID )
1717
1818struct at28c16_chip
1919{
20   UINT8 data[ DATA_SIZE ];
21   UINT8 id[ ID_SIZE ];
20   UINT8 *data;
21   UINT8 *id;
2222   UINT8 a9_12v;
2323};
2424
r1386r1387
3939
4040/* nvram handlers */
4141
42static void at28c16_init( int chip )
42void at28c16_init( int chip, UINT8 *data, UINT8 *id )
4343{
4444   struct at28c16_chip *c;
4545   if( chip >= MAX_AT28C16_CHIPS )
r1386r1387
5050   c = &at28c16[ chip ];
5151
5252   c->a9_12v = 0;
53   memset( c->data, 0, DATA_SIZE );
54   memset( c->id, 0, ID_SIZE );
5553
56   state_save_register_item_array( "at28c16", chip, c->data );
57   state_save_register_item_array( "at28c16", chip, c->id );
54   if( data == NULL )
55   {
56      data = auto_malloc( SIZE_DATA );
57   }
58
59   if( id == NULL )
60   {
61      id = auto_malloc( SIZE_ID );
62   }
63
64   c->data = data;
65   c->id = id;
66
67   state_save_register_item_pointer( "at28c16", chip, c->data, SIZE_DATA );
68   state_save_register_item_pointer( "at28c16", chip, c->id, SIZE_ID );
5869   state_save_register_item( "at28c16", chip, c->a9_12v );
5970}
6071
r1386r1387
7081
7182   if( read_or_write )
7283   {
73      mame_fwrite( file, c->data, DATA_SIZE );
74      mame_fwrite( file, c->id, ID_SIZE );
84      mame_fwrite( file, c->data, SIZE_DATA );
85      mame_fwrite( file, c->id, SIZE_ID );
7586   }
7687   else
7788   {
78      at28c16_init( chip );
7989      if( file )
8090      {
81         mame_fread( file, c->data, DATA_SIZE );
82         mame_fread( file, c->id, ID_SIZE );
91         mame_fread( file, c->data, SIZE_DATA );
92         mame_fread( file, c->id, SIZE_ID );
8393      }
8494   }
8595}
r1386r1387
101111   }
102112   c = &at28c16[ chip ];
103113
104   if( offset >= ID_OFFSET && c->a9_12v )
114   if( offset >= OFFSET_ID && c->a9_12v )
105115   {
106116      logerror( "at28c16_read( %04x ) id\n", offset );
107      return c->id[ offset - ID_OFFSET ];
117      return c->id[ offset - OFFSET_ID ];
108118   }
109119   else
110120   {
111//      logerror( "at28c16_read( %04x ) data\n", offset );
121//      logerror( "%08x: at28c16_read( %d, %04x ) %02x data\n", activecpu_get_pc(), chip, offset, c->data[ offset ] );
112122      return c->data[ offset ];
113123   }
114124}
r1386r1387
123133   }
124134   c = &at28c16[ chip ];
125135
126   if( offset >= ID_OFFSET && c->a9_12v )
136   if( offset >= OFFSET_ID && c->a9_12v )
127137   {
128138      logerror( "at28c16_write( %d, %04x, %02x ) id\n", chip, offset, data );
129      c->id[ offset - ID_OFFSET ] = data;
139      c->id[ offset - OFFSET_ID ] = data;
130140   }
131141   else
132142   {
133//      logerror( "at28c16_write( %d, %04x, %02x ) data\n", chip, offset, data );
143//      logerror( "%08x: at28c16_write( %d, %04x, %02x ) data\n", activecpu_get_pc(), chip, offset, data );
134144      c->data[ offset ] = data;
135145   }
136146}
src/emu/machine/at28c16.h
r1386r1387
1010
1111#define MAX_AT28C16_CHIPS ( 4 )
1212
13extern void at28c16_init( int chip, UINT8 *data, UINT8 *id );
1314extern void at28c16_a9_12v( int chip, int a9_12v );
1415
1516/* nvram handlers */
src/emu/machine/eeprom.c
r1386r1387
66#define SERIAL_BUFFER_LENGTH 40
77#define MEMORY_SIZE 1024
88
9static struct EEPROM_interface *intf;
9static const struct EEPROM_interface *intf;
1010
1111static int serial_count;
1212static UINT8 serial_buffer[SERIAL_BUFFER_LENGTH];
r1386r1387
7676}
7777
7878
79struct EEPROM_interface eeprom_interface_93C46 =
79const struct EEPROM_interface eeprom_interface_93C46 =
8080{
8181   6,            // address bits 6
8282   16,            // data bits    16
r1386r1387
9090//  "*10010xxxx"    // erase all    1 00 10xxxx
9191};
9292
93struct EEPROM_interface eeprom_interface_93C66B =
93const struct EEPROM_interface eeprom_interface_93C66B =
9494{
9595   8,            /* address bits */
9696   16,            /* data bits */
r1386r1387
126126   }
127127}
128128
129void EEPROM_init(struct EEPROM_interface *interface)
129void EEPROM_init(const struct EEPROM_interface *interface)
130130{
131131   intf = interface;
132132
src/emu/machine/8257dma.c
r0r1387
1/**********************************************************************
2
3    8257 DMA interface and emulation
4
5    For datasheet http://www.threedee.com/jcm/library/index.html
6
7    2007/11     couriersud
8
9        - architecture copied from 8237 DMA
10        - significant changes to implementation
11
12    The DMA works like this:
13
14    1.  The device asserts the DRQn line
15    2.  The DMA clears the TC (terminal count) line
16    3.  The DMA asserts the CPU's HRQ (halt request) line
17    4.  Upon acknowledgement of the halt, the DMA will let the device
18        know that it needs to send information by asserting the DACKn
19        line
20    5.  The DMA will read the byte from the device
21    6.  The device clears the DRQn line
22    7.  The DMA clears the CPU's HRQ line
23    8.  (steps 3-7 are repeated for every byte in the chain)
24
25**********************************************************************/
26
27#include "driver.h"
28#include "memconv.h"
29#include "8257dma.h"
30
31struct dma8257
32{
33   const struct dma8257_interface *intf;
34   emu_timer *timer;
35   emu_timer *msbflip_timer;
36
37   UINT16 registers[DMA8257_NUM_CHANNELS*2];
38
39   UINT16 address[DMA8257_NUM_CHANNELS];
40   UINT16 count[DMA8257_NUM_CHANNELS];
41   UINT8  rwmode[DMA8257_NUM_CHANNELS];
42
43   UINT8 mode;
44   UINT8 rr;
45
46   UINT8 msb;
47   UINT8 drq;
48
49   /* bits  0- 3 :  Terminal count for channels 0-3 */
50   UINT8 status;
51};
52
53static struct dma8257 *dma;
54static int dma_count;
55
56#define DMA_MODE_AUTOLOAD(mode)      ((mode) & 0x80)
57#define DMA_MODE_TCSTOP(mode)      ((mode) & 0x40)
58#define DMA_MODE_EXWRITE(mode)      ((mode) & 0x20)
59#define DMA_MODE_ROTPRIO(mode)      ((mode) & 0x10)
60#define DMA_MODE_CH_EN(mode, chan)   ((mode) & (1 << (chan)))
61
62static TIMER_CALLBACK( dma8257_timerproc );
63static TIMER_CALLBACK( dma8257_msbflip_timerproc );
64static void dma8257_update_status(int which);
65
66/* ----------------------------------------------------------------------- */
67
68int dma8257_init(int count)
69{
70   int which;
71
72   dma = auto_malloc(count * sizeof(struct dma8257));
73   memset(dma, 0, count * sizeof(struct dma8257));
74   dma_count = count;
75
76   for (which = 0; which < dma_count; which++)
77   {
78      dma[which].status = 0x0F;
79      dma[which].timer = timer_alloc(dma8257_timerproc, NULL);
80      dma[which].msbflip_timer = timer_alloc(dma8257_msbflip_timerproc, NULL);
81
82      state_save_register_item_array("8257", which, dma[which].address);
83      state_save_register_item_array("8257", which, dma[which].count);
84      state_save_register_item_array("8257", which, dma[which].rwmode);
85      state_save_register_item_array("8257", which, dma[which].registers);
86
87      state_save_register_item("8257", which, dma[which].mode);
88      state_save_register_item("8257", which, dma[which].rr);
89      state_save_register_item("8257", which, dma[which].msb);
90      state_save_register_item("8257", which, dma[which].drq);
91      state_save_register_item("8257", which, dma[which].status);
92
93   }
94
95   return 0;
96}
97
98
99
100void dma8257_config(int which, const struct dma8257_interface *intf)
101{
102   dma[which].intf = intf;
103}
104
105
106
107void dma8257_reset(void)
108{
109   int which;
110
111   for (which = 0; which < dma_count; which++)
112   {
113      dma[which].status &= 0xF0;
114      dma[which].mode = 0;
115      dma8257_update_status(which);
116   }
117}
118
119
120
121/* ----------------------------------------------------------------------- */
122
123
124
125static int dma8257_do_operation(int which, int channel)
126{
127   int done;
128   UINT8 data;
129   UINT8 mode;
130
131   mode = dma[which].rwmode[channel];
132   if (dma[which].count[channel] == 0x0000)
133   {
134      dma[which].status |=  (0x01 << channel);
135      if (dma[which].intf->out_tc_func[channel])
136         dma[which].intf->out_tc_func[channel](ASSERT_LINE);
137   }
138   switch(mode) {
139   case 1:
140      data = dma[which].intf->memory_read_func(channel, dma[which].address[channel]);
141      dma[which].intf->channel_write_func[channel](data);
142
143      dma[which].address[channel]++;
144      dma[which].count[channel]--;
145      done = (dma[which].count[channel] == 0xFFFF);
146      break;
147
148   case 2:
149      data = dma[which].intf->channel_read_func[channel]();
150      dma[which].intf->memory_write_func(channel, dma[which].address[channel], data);
151
152      dma[which].address[channel]++;
153      dma[which].count[channel]--;
154      done = (dma[which].count[channel] == 0xFFFF);
155      break;
156   case 0: /* verify */
157      dma[which].address[channel]++;
158      dma[which].count[channel]--;
159      done = (dma[which].count[channel] == 0xFFFF);
160      break;
161   default:
162      fatalerror("dma8257_do_operation: invalid mode!\n");
163      break;
164   }
165   if (done)
166   {
167      if (dma[which].intf->out_tc_func[channel])
168         dma[which].intf->out_tc_func[channel](CLEAR_LINE);
169   }
170   return done;
171}
172
173
174
175static TIMER_CALLBACK( dma8257_timerproc )
176{
177   int which = param;
178   int i, channel = 0, rr;
179   int done;
180
181   rr = DMA_MODE_ROTPRIO(dma[which].mode) ? dma[which].rr : 0;
182   for (i = 0; i < DMA8257_NUM_CHANNELS; i++)
183   {
184      channel = (i + rr) % DMA8257_NUM_CHANNELS;
185      if ((dma[which].status & (1 << channel)) == 0)
186         if (dma[which].mode & dma[which].drq & (1 << channel))
187            break;
188   }
189   done = dma8257_do_operation(which, channel);
190
191   dma[which].rr = (channel + 1) & 0x03;
192
193   if (done)
194   {
195      dma[which].drq    &= ~(0x01 << channel);
196      dma8257_update_status(which);
197      if (DMA_MODE_TCSTOP(dma[which].mode))
198         dma[which].mode &= ~(0x01 << channel);
199   }
200}
201
202
203
204static TIMER_CALLBACK( dma8257_msbflip_timerproc )
205{
206   dma[param].msb ^= 1;
207}
208
209
210
211static void dma8257_update_status(int which)
212{
213   UINT16 pending_transfer;
214   attotime next;
215
216   /* no transfer is active right now; is there a transfer pending right now? */
217   pending_transfer = dma[which].drq & (dma[which].mode & 0x0F);
218
219   if (pending_transfer)
220   {
221      next = ATTOTIME_IN_HZ(dma[which].intf->clockhz / 4 );
222      timer_adjust(dma[which].timer,
223         attotime_zero,
224         which,
225         /* 1 byte transferred in 4 clock cycles */
226         next);
227   }
228   else
229   {
230      /* no transfers active right now */
231      timer_reset(dma[which].timer, attotime_never);
232   }
233
234   /* set the halt line */
235   if (dma[which].intf && dma[which].intf->cpunum >= 0)
236   {
237      cpunum_set_input_line(dma[which].intf->cpunum, INPUT_LINE_HALT,
238         pending_transfer ? ASSERT_LINE : CLEAR_LINE);
239   }
240
241}
242
243
244
245/* ----------------------------------------------------------------------- */
246
247static void prepare_msb_flip(int which)
248{
249   timer_adjust(dma[which].msbflip_timer, attotime_zero, which, attotime_zero);
250}
251
252
253
254static UINT8 dma8257_read(int which, offs_t offset)
255{
256   UINT8 data = 0xFF;
257
258   switch(offset) {
259   case 0:
260   case 1:
261   case 2:
262   case 3:
263   case 4:
264   case 5:
265   case 6:
266   case 7:
267      /* DMA address/count register */
268      data = ( dma[which].registers[offset] >> (dma[which].msb ? 8 : 0) ) & 0xFF;
269      prepare_msb_flip(which);
270      break;
271
272   case 8:
273      /* DMA status register */
274      data = (UINT8) dma[which].status;
275      /* read resets status ! */
276      dma[which].status &= 0xF0;
277
278      break;
279
280   default:
281      logerror("8257: Read from register %d.\n", offset);
282      data = 0xFF;
283      break;
284   }
285   return data;
286}
287
288
289
290static void dma8257_write(int which, offs_t offset, UINT8 data)
291{
292
293   switch(offset) {
294   case 0:
295   case 1:
296   case 2:
297   case 3:
298   case 4:
299   case 5:
300   case 6:
301   case 7:
302      /* DMA address/count register */
303      if (dma[which].msb)
304         dma[which].registers[offset] |= ((UINT16) data) << 8;
305      else
306         dma[which].registers[offset] = data;
307      prepare_msb_flip(which);
308      break;
309
310   case 8:
311      /* DMA mode register */
312      if (DMA_MODE_AUTOLOAD(data)   )
313         fatalerror("8257: Autoload not supported!\n");
314      dma[which].mode = data;
315      break;
316
317   default:
318      logerror("8257: Write to register %d.\n", offset);
319      break;
320   }
321}
322
323
324
325static TIMER_CALLBACK( dma8257_drq_write_callback )
326{
327   int which = param >> 3;
328   int channel = (param >> 1) & 0x03;
329   int state = param & 0x01;
330
331   /* normalize state */
332   if (state)
333   {
334      dma[which].drq |= 0x01 << channel;
335      dma[which].address[channel] =  dma[which].registers[channel * 2];
336      dma[which].count[channel] =  dma[which].registers[channel * 2 + 1] & 0x3FF;
337      dma[which].rwmode[channel] =  dma[which].registers[channel * 2 + 1] >> 14;
338      /* clear channel TC */
339      dma[which].status &= ~(0x01 << channel);
340   }
341   else
342      dma[which].drq &= ~(0x01 << channel);
343
344   dma8257_update_status(which);
345}
346
347
348
349void dma8257_drq_write(int which, int channel, int state)
350{
351   int param;
352
353   param = (which << 3) | (channel << 1) | (state ? 1 : 0);
354   timer_call_after_resynch(NULL, param, dma8257_drq_write_callback);
355}
356
357
358/******************* Standard 8-bit/32-bit/64-bit CPU interfaces *******************/
359
360READ8_HANDLER( dma8257_0_r )   { return dma8257_read(0, offset); }
361READ8_HANDLER( dma8257_1_r )   { return dma8257_read(1, offset); }
362WRITE8_HANDLER( dma8257_0_w ) { dma8257_write(0, offset, data); }
363WRITE8_HANDLER( dma8257_1_w ) { dma8257_write(1, offset, data); }
364
365READ16_HANDLER( dma8257_16le_0_r ) { return read16le_with_read8_handler(dma8257_0_r, offset, mem_mask); }
366READ16_HANDLER( dma8257_16le_1_r ) { return read16le_with_read8_handler(dma8257_1_r, offset, mem_mask); }
367WRITE16_HANDLER( dma8257_16le_0_w ) { write16le_with_write8_handler(dma8257_0_w, offset, data, mem_mask); }
368WRITE16_HANDLER( dma8257_16le_1_w ) { write16le_with_write8_handler(dma8257_1_w, offset, data, mem_mask); }
369
370READ32_HANDLER( dma8257_32le_0_r ) { return read32le_with_read8_handler(dma8257_0_r, offset, mem_mask); }
371READ32_HANDLER( dma8257_32le_1_r ) { return read32le_with_read8_handler(dma8257_1_r, offset, mem_mask); }
372WRITE32_HANDLER( dma8257_32le_0_w ) { write32le_with_write8_handler(dma8257_0_w, offset, data, mem_mask); }
373WRITE32_HANDLER( dma8257_32le_1_w ) { write32le_with_write8_handler(dma8257_1_w, offset, data, mem_mask); }
374
375READ64_HANDLER( dma8257_64be_0_r ) { return read64be_with_read8_handler(dma8257_0_r, offset, mem_mask); }
376READ64_HANDLER( dma8257_64be_1_r ) { return read64be_with_read8_handler(dma8257_1_r, offset, mem_mask); }
377WRITE64_HANDLER( dma8257_64be_0_w ) { write64be_with_write8_handler(dma8257_0_w, offset, data, mem_mask); }
378WRITE64_HANDLER( dma8257_64be_1_w ) { write64be_with_write8_handler(dma8257_1_w, offset, data, mem_mask); }
src/emu/machine/eeprom.h
r1386r1387
1616};
1717
1818
19void EEPROM_init(struct EEPROM_interface *interface);
19void EEPROM_init(const struct EEPROM_interface *interface);
2020
2121void EEPROM_write_bit(int bit);
2222int EEPROM_read_bit(void);
r1386r1387
3030UINT8 * EEPROM_get_data_pointer(int * length);
3131
3232/* 93C46 */
33extern struct EEPROM_interface eeprom_interface_93C46;
33extern const struct EEPROM_interface eeprom_interface_93C46;
3434NVRAM_HANDLER( 93C46 );
3535
3636/* 93C66B */
37extern struct EEPROM_interface eeprom_interface_93C66B;
37extern const struct EEPROM_interface eeprom_interface_93C66B;
3838NVRAM_HANDLER( 93C66B );
3939
4040#endif
src/emu/machine/8257dma.h
r0r1387
1/**********************************************************************
2
3    8257 DMA interface and emulation
4
5**********************************************************************/
6
7#ifndef DMA8257_H
8#define DMA8257_H
9
10#define DMA8257_STATUS_UPDATE      0x10
11#define DMA8257_STATUS_TC_CH3      0x08
12#define DMA8257_STATUS_TC_CH2      0x04
13#define DMA8257_STATUS_TC_CH1      0x02
14#define DMA8257_STATUS_TC_CH0      0x01
15
16#define DMA8257_NUM_CHANNELS      (4)
17
18
19struct dma8257_interface
20{
21   /* CPU to halt when DMA is active */
22   int cpunum;
23
24   /* speed of DMA accesses (per byte) */
25   int clockhz;
26
27   /* accessors to main memory */
28   UINT8   (*memory_read_func)(int channel, offs_t offset);
29   void    (*memory_write_func)(int channel, offs_t offset, UINT8 data);
30
31   /* channel accesors */
32   UINT8     (*channel_read_func[DMA8257_NUM_CHANNELS])(void);
33   void    (*channel_write_func[DMA8257_NUM_CHANNELS])(UINT8 data);
34
35   /* function to call when DMA completes */
36   void    (*out_tc_func[DMA8257_NUM_CHANNELS])(int state);
37};
38
39
40
41int dma8257_init(int count);
42void dma8257_config(int which, const struct dma8257_interface *intf);
43void dma8257_reset(void);
44
45void dma8257_drq_write(int which, int channel, int state);
46
47READ8_HANDLER( dma8257_0_r );
48READ8_HANDLER( dma8257_1_r );
49WRITE8_HANDLER( dma8257_0_w );
50WRITE8_HANDLER( dma8257_1_w );
51
52READ16_HANDLER( dma8257_16le_0_r );
53READ16_HANDLER( dma8257_16le_1_r );
54WRITE16_HANDLER( dma8257_16le_0_w );
55WRITE16_HANDLER( dma8257_16le_1_w );
56
57READ32_HANDLER( dma8257_32le_0_r );
58READ32_HANDLER( dma8257_32le_1_r );
59WRITE32_HANDLER( dma8257_32le_0_w );
60WRITE32_HANDLER( dma8257_32le_1_w );
61
62READ64_HANDLER( dma8257_64be_0_r );
63READ64_HANDLER( dma8257_64be_1_r );
64WRITE64_HANDLER( dma8257_64be_0_w );
65WRITE64_HANDLER( dma8257_64be_1_w );
66
67#endif /* DMA8257_H */
src/emu/cpuintrf.c
r1386r1387
164164void ppc601_get_info(UINT32 state, cpuinfo *info);
165165void ppc602_get_info(UINT32 state, cpuinfo *info);
166166void ppc603_get_info(UINT32 state, cpuinfo *info);
167void ppc604_get_info(UINT32 state, cpuinfo *info);
167168void mpc8240_get_info(UINT32 state, cpuinfo *info);
168169void SE3208_get_info(UINT32 state, cpuinfo *info);
169170void mc68hc11_get_info(UINT32 state, cpuinfo *info);
r1386r1387
685686#if (HAS_PPC603)
686687   { CPU_PPC603, ppc603_get_info },
687688#endif
689#if (HAS_PPC604)
690   { CPU_PPC604, ppc604_get_info },
691#endif
688692#if (HAS_MPC8240)
689693   { CPU_MPC8240, mpc8240_get_info },
690694#endif
src/emu/cpuexec.h
r1386r1387
168168   CPU_PPC601,
169169   CPU_PPC602,
170170   CPU_PPC603,
171   CPU_PPC604,
171172   CPU_MPC8240,
172173   CPU_SE3208,
173174   CPU_MC68HC11,
src/emu/sound/k054539.c
r1386r1387
129129   };
130130
131131   int ch, reverb_pos;
132   short *rev_max;
133   short *rbase, *rbuffer, *rev_top;
132   short *rbase;
134133   unsigned char *samples;
135134   UINT32 rom_mask;
136135
137136   unsigned char *base1, *base2;
138137   struct K054539_channel *chan;
139138   stream_sample_t *bufl, *bufr;
140   short *revb;
141139   int cur_pos, cur_pfrac, cur_val, cur_pval;
142140   int delta, rdelta, fdelta, pdelta;
143141   int vol, bval, pan, i;
r1386r1387
146144
147145   reverb_pos = info->reverb_pos;
148146   rbase = (short *)(info->ram);
149   rbuffer = rbase + reverb_pos;
150   rev_max = rev_top = rbase + 0x4000;
151147
152148   memset(buffer[0], 0, length*sizeof(*buffer[0]));
153149   memset(buffer[1], 0, length*sizeof(*buffer[1]));
r1386r1387
199195         rdelta = (base1[6] | (base1[7] << 8)) >> 3;
200196//          rdelta = (reverb_pos + (int)((rdelta - 0x2000) * info->freq_ratio)) & 0x3fff;
201197         rdelta = (int)(rdelta + reverb_pos) & 0x3fff;
202         revb = rbase + rdelta;
203198
204199         cur_pos = (base1[0x0c] | (base1[0x0d] << 8) | (base1[0x0e] << 16)) & rom_mask;
205200
r1386r1387
231226         do {                                                      \
232227            *bufl++ += (INT16)(cur_val*lvol);                              \
233228            *bufr++ += (INT16)(cur_val*rvol);                              \
234            *revb++ += (INT16)(cur_val*rbvol);                              \
229            rbase[rdelta++] += (INT16)(cur_val*rbvol);                              \
230            rdelta &= 0x3fff;                              \
235231         } while(0)
236232
237233         switch(base2[0] & 0xc) {
r1386r1387
351347            base1[0x0d] = cur_pos>> 8 & 0xff;
352348            base1[0x0e] = cur_pos>>16 & 0xff;
353349         }
354
355         if(revb > rev_max)
356            rev_max = revb;
357350      }
358351
359   while(rev_max >= rev_top) {
360      rev_max[-0x4000] += rev_max[0];
361      rev_max[0] = 0;
362      rev_max--;
363   }
364
365352   //* drivers should be given the option to disable reverb when things go terribly wrong
366353   if(!(info->K054539_flags & K054539_DISABLE_REVERB))
367354   {
r1386r1387
372359      }
373360   }
374361
375   if(rbuffer+length > rev_top) {
376      i = rev_top-rbuffer; // delta
377      memset(rbuffer, 0, i*2);
362   if(reverb_pos + length > 0x4000) {
363      i = 0x4000 - reverb_pos;
364      memset(rbase + reverb_pos, 0, i*2);
378365      memset(rbase, 0, (length-i)*2);
379366   } else
380      memset(rbuffer, 0, length*2);
367      memset(rbase + reverb_pos, 0, length*2);
381368
382369   #if CHANNEL_DEBUG
383370   {
src/emu/sound/votrax.c
r1386r1387
4545 * 64 Phonemes - currently 1 sample per phoneme, will be combined sometime!
4646 ****************************************************************************/
4747
48static const char *VotraxTable[65] =
48static const char *const VotraxTable[65] =
4949{
5050 "EH3","EH2","EH1","PA0","DT" ,"A1" ,"A2" ,"ZH",
5151 "AH2","I3" ,"I2" ,"I1" ,"M"  ,"N"  ,"B"  ,"V",
src/emu/sound/samples.c
r1386r1387
66struct sample_channel
77{
88   sound_stream *stream;
9   INT16 *      source;
9   const INT16 *source;
1010   INT32      source_length;
1111   INT32      source_num;
1212   UINT32      pos;
r1386r1387
174174    readsamples - load all samples
175175-------------------------------------------------*/
176176
177struct loaded_samples *readsamples(const char **samplenames, const char *basename)
177struct loaded_samples *readsamples(const char *const *samplenames, const char *basename)
178178{
179179   struct loaded_samples *samples;
180180   int skipfirst = 0;
r1386r1387
270270}
271271
272272
273void sample_start_raw_n(int num,int channel,INT16 *sampledata,int samples,int frequency,int loop)
273void sample_start_raw_n(int num,int channel,const INT16 *sampledata,int samples,int frequency,int loop)
274274{
275275    struct samples_info *info = sndti_token(SOUND_SAMPLES, num);
276276    struct sample_channel *chan;
r1386r1387
293293   chan->loop = loop;
294294}
295295
296void sample_start_raw(int channel,INT16 *sampledata,int samples,int frequency,int loop)
296void sample_start_raw(int channel,const INT16 *sampledata,int samples,int frequency,int loop)
297297{
298298    sample_start_raw_n(0,channel,sampledata,samples,frequency,loop);
299299}
r1386r1387
452452      UINT32 pos = chan->pos;
453453      UINT32 frac = chan->frac;
454454      UINT32 step = chan->step;
455      INT16 *sample = chan->source;
455      const INT16 *sample = chan->source;
456456      UINT32 sample_length = chan->source_length;
457457
458458      while (length--)
src/emu/sound/scsp.c
r1386r1387
3838#define FIX(v)   ((UINT32) ((float) (1<<SHIFT)*(v)))
3939
4040
41#define EG_SHIFT   8
41#define EG_SHIFT   16
4242
4343// include the LFO handling code
4444#include "scsplfo.c"
r1386r1387
108108               920.0,790.0,690.0,550.0,460.0,390.0,340.0,270.0,230.0,200.0,170.0,140.0,110.0,98.0,85.0,68.0,57.0,49.0,43.0,34.0,
109109               28.0,25.0,22.0,18.0,14.0,12.0,11.0,8.5,7.1,6.1,5.4,4.3,3.6,3.1};
110110static UINT32 FNS_Table[0x400];
111static INT32 EG_TABLE[0x400];
111112
112113typedef enum {ATTACK,DECAY1,DECAY2,RELEASE} _STATE;
113114struct _EG
r1386r1387
365366   int Rate=base+(R<<1);
366367   if(Rate>63)   Rate=63;
367368   if(Rate<0) Rate=0;
368   return SCSP->ARTABLE[63-Rate];
369   return SCSP->DRTABLE[Rate];
369370}
370371
371372static void Compute_EG(struct _SCSP *SCSP,struct _SLOT *slot)
r1386r1387
378379   else
379380      rate=0; //rate=((FNS(slot)>>9)&1);
380381
381   slot->EG.volume=0;
382   slot->EG.volume=0x17F<<EG_SHIFT;
382383   slot->EG.AR=Get_AR(SCSP,rate,AR(slot));
383384   slot->EG.D1R=Get_DR(SCSP,rate,D1R(slot));
384385   slot->EG.D2R=Get_DR(SCSP,rate,D2R(slot));
r1386r1387
410411         break;
411412      case DECAY1:
412413         slot->EG.volume-=slot->EG.D1R;
413         if(slot->EG.volume>>(EG_SHIFT+5)<=slot->EG.DL)
414         if(slot->EG.volume>>(EG_SHIFT+5)<slot->EG.DL)
414415            slot->EG.state=DECAY2;
415416         break;
416417      case DECAY2:
r1386r1387
425426         slot->EG.volume-=slot->EG.RR;
426427         if(slot->EG.volume<=0)
427428         {
429            slot->EG.volume=0;
428430            SCSP_StopSlot(slot,0);
429            slot->EG.volume=0;
430            slot->EG.state=ATTACK;
431            //slot->EG.volume=0x17F<<EG_SHIFT;
432            //slot->EG.state=ATTACK;
431433         }
432434         break;
433435      default:
r1386r1387
461463
462464static void SCSP_StartSlot(struct _SCSP *SCSP, struct _SLOT *slot)
463465{
466   UINT32 start_offset;
467
464468   slot->active=1;
465   slot->base=SCSP->SCSPRAM+SA(slot);
469   start_offset = PCM8B(slot) ? SA(slot) : SA(slot) & 0x7FFFE;
470   slot->base=SCSP->SCSPRAM + start_offset;
466471   slot->cur_addr=0;
467472   slot->step=SCSP_Step(slot);
468473   Compute_EG(SCSP,slot);
469474   slot->EG.state=ATTACK;
470   slot->EG.volume=0;
475   slot->EG.volume=0x17F<<EG_SHIFT;
471476   slot->Prev=0;
472477   slot->Backwards=0;
473478   Compute_LFO(slot);
r1386r1387
477482
478483static void SCSP_StopSlot(struct _SLOT *slot,int keyoff)
479484{
480   if(keyoff && slot->EG.state!=RELEASE)
485   if(keyoff /*&& slot->EG.state!=RELEASE*/)
481486   {
482487      slot->EG.state=RELEASE;
483488   }
r1386r1387
485490   {
486491      slot->active=0;
487492   }
488
489493   slot->udata.data[0]&=~0x800;
490494}
491495
r1386r1387
536540      FNS_Table[i]=(float) (1<<SHIFT) *fcent;
537541   }
538542
543   for(i=0;i<0x400;++i)
544   {
545      float envDB=((float)(3*(i-0x3ff)))/32.0;
546      float scale=(float)(1<<SHIFT);
547      EG_TABLE[i]=(INT32)(pow(10.0,envDB/20.0)*scale);
548   }
549
539550   for(i=0;i<0x10000;++i)
540551   {
541552      int iTL =(i>>0x0)&0xff;
r1386r1387
613624   {
614625      SCSP->Slots[i].slot=i;
615626      SCSP->Slots[i].active=0;
616      SCSP->Slots[i].active=0;
617627      SCSP->Slots[i].base=NULL;
618628   }
619629
r1386r1387
645655            {
646656               struct _SLOT *s2=SCSP->Slots+sl;
647657               {
648                  if(KEYONB(s2) && !s2->active)
658                  if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/)
649659                  {
650660                     SCSP_StartSlot(SCSP, s2);
651661                  }
652                  if(!KEYONB(s2) && s2->active)
662                  if(!KEYONB(s2) /*&& s2->active*/)
653663                  {
654664                     SCSP_StopSlot(s2,1);
655665                  }
r1386r1387
12571267   if(!STWINH(slot))
12581268      *RBUFDST=sample;
12591269
1260   sample=(sample*EG_Update(slot))>>SHIFT;
1270   if(slot->EG.state==ATTACK)
1271      sample=(sample*EG_Update(slot))>>SHIFT;
1272   else
1273      sample=(sample*EG_TABLE[EG_Update(slot)>>(SHIFT-10)])>>SHIFT;
12611274
12621275   return sample;
12631276}
r1386r1387
13081321         if(EFSDL(slot))
13091322         {
13101323            unsigned short Enc=(TL(slot))|((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd);
1311            smpl+=(SCSP->DSP.EFREG[i]*SCSP->LPANTABLE[Enc])>>(SHIFT-5);
1312            smpr+=(SCSP->DSP.EFREG[i]*SCSP->RPANTABLE[Enc])>>(SHIFT-5);
1324            smpl+=(SCSP->DSP.EFREG[i]*SCSP->LPANTABLE[Enc])>>(SHIFT-4);
1325            smpr+=(SCSP->DSP.EFREG[i]*SCSP->RPANTABLE[Enc])>>(SHIFT-4);
13131326         }
13141327      }
13151328
src/emu/sound/samples.h
r1386r1387
1717struct Samplesinterface
1818{
1919    int         channels;   /* number of discrete audio channels needed */
20   const char **samplenames;
20    const char *const *samplenames;
2121    void        (*start)(void);
2222};
2323
2424
2525void sample_start_n(int num,int channel,int samplenum,int loop);
26void sample_start_raw_n(int num,int channel,INT16 *sampledata,int samples,int frequency,int loop);
26void sample_start_raw_n(int num,int channel,const INT16 *sampledata,int samples,int frequency,int loop);
2727void sample_set_freq_n(int num,int channel,int freq);
2828void sample_set_volume_n(int num,int channel,float volume);
2929void sample_set_pause_n(int num,int channel,int pause);
r1386r1387
3434
3535/* shortcuts for backwards compatibilty */
3636void sample_start(int channel,int samplenum,int loop);
37void sample_start_raw(int channel,INT16 *sampledata,int samples,int frequency,int loop);
37void sample_start_raw(int channel,const INT16 *sampledata,int samples,int frequency,int loop);
3838void sample_set_freq(int channel,int freq);
3939void sample_set_volume(int channel,float volume);
4040void sample_set_pause(int channel,int pause);
r1386r1387
4545
4646/* helper function that reads samples from disk - this can be used by other */
4747/* drivers as well (e.g. a sound chip emulator needing drum samples) */
48struct loaded_samples *readsamples(const char **samplenames, const char *name);
48struct loaded_samples *readsamples(const char *const *samplenames, const char *name);
4949
5050#endif
src/emu/sound/sn76477.c
r1386r1387
100100#if TEST_MODE
101101#include "input.h"
102102
103static struct SN76477interface empty_interface =
103static const struct SN76477interface empty_interface =
104104{
105105   0,         /*  4 noise_clock_res  */
106106   0,         /*  5 filter_res       */
src/emu/clifront.c
r1386r1387
566566         for (sndnum = 0; sndnum < MAX_SOUND && drv.sound[sndnum].type != SOUND_DUMMY; sndnum++)
567567            if (drv.sound[sndnum].type == SOUND_SAMPLES)
568568            {
569               const char **samplenames = ((struct Samplesinterface *)drv.sound[sndnum].config)->samplenames;
569               const char *const *samplenames = ((const struct Samplesinterface *)drv.sound[sndnum].config)->samplenames;
570570               int sampnum;
571571
572572               /* if the list is legit, walk it and print the sample info */
src/mess/osd/windows/menu.c
r1386r1387
118118//   customize_input
119119//============================================================
120120
121static void customize_input(HWND wnd, const char *title, int cust_type, int player, int inputclass, const char *section)
121static void customize_input(HWND wnd, const char *title, artwork_cust_type cust_type, int player, int inputclass, const char *section)
122122{
123123   dialog_box *dlg;
124124   input_port_entry *in;
src/mess/artworkx.c
r1386r1387
8080
8181/********************************************************************/
8282
83int artwork_get_inputscreen_customizations(png_info *png, int cust_type,
83int artwork_get_inputscreen_customizations(png_info *png, artwork_cust_type cust_type,
8484   const char *section,
8585   struct inputform_customization *customizations,
8686   int customizations_length)
src/mess/artworkx.h
r1386r1387
2121
2222***************************************************************************/
2323
24enum
24typedef enum
2525{
2626   ARTWORK_CUSTTYPE_JOYSTICK = 0,
2727   ARTWORK_CUSTTYPE_KEYBOARD,
2828   ARTWORK_CUSTTYPE_MISC,
2929   ARTWORK_CUSTTYPE_INVALID
30}
30} artwork_cust_type;
3131
3232
3333
r1386r1387
5454
5555void artwork_use_device_art(mess_image *img, const char *defaultartfile);
5656
57int artwork_get_inputscreen_customizations(png_info *png, int cust_type,
57int artwork_get_inputscreen_customizations(png_info *png, artwork_cust_type cust_type,
5858   const char *section,
5959   struct inputform_customization *customizations,
6060   int customizations_length);
docs/messnew.txt
r1386r1387
99System Driver Changes:
1010----------------------
1111- [FAMICOM] Fixed reads to $4031-2 when a disk is not mounted.  [MAMEPlus Team]
12
1213- [QL] Added sound. [Curt Coder]
1314
1415
r1386r1387
2728
2829Source Changes:
2930----------------
30- The core is based on MAME 0.121u2.  This incorporates all features of the
31- The core is based on MAME 0.121u3.  This incorporates all features of the
3132  update to this core.  [MAME team]
3233
3334- Changed spacing between natural keyboard key names.  [Nate Woods]
makefile
r1386r1387
105105# uncomment next line to use DRC PowerPC engine
106106X86_PPC_DRC = 1
107107
108# uncomment next line to use DRC Voodoo rasterizers
109# X86_VOODOO_DRC = 1
110108
111109
112
113110#-------------------------------------------------
114111# specify build options; see each option below
115112# for details
r1386r1387
191188AR = @ar
192189CC = @gcc
193190LD = @gcc
194HHC = @-hhc
195191MD = -mkdir$(EXE)
196192RM = @rm -f
197193
r1386r1387
273269DEFS += -DMAME_PROFILER
274270endif
275271
276# define VOODOO_DRC if we are building the DRC Voodoo engine
277ifdef X86_VOODOO_DRC
278DEFS += -DVOODOO_DRC
279endif
280272
281273
282
283274#-------------------------------------------------
284275# compile flags
285276#-------------------------------------------------
r1386r1387
403394LIBSOUND = $(OBJ)/libsound.a
404395LIBUTIL = $(OBJ)/libutil.a
405396LIBOCORE = $(OBJ)/libocore.a
406LIBOCORE_NOMAIN = $(OBJ)/libocore_nomain.a
407397LIBOSD = $(OBJ)/libosd.a
408398
409399VERSIONOBJ = $(OBJ)/version.o
r1386r1387
476466
477467tools: maketree $(TOOLS)
478468
479help: maketree $(HELP)
480
481469maketree: $(sort $(OBJDIRS))
482470
483471clean:
r1386r1387
507495# executable targets and dependencies
508496#-------------------------------------------------
509497
510ifndef EXECUTABLE_DEFINED
511
512498$(EMULATOR): $(VERSIONOBJ) $(DRVLIBS) $(LIBOSD) $(LIBEMU) $(LIBCPU) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(ZLIB) $(LIBOCORE) $(RESFILE)
513499# always recompile the version string
514500   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
515501   @echo Linking $@...
516502   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
517503
518endif
519504
520505
521
522506#-------------------------------------------------
523507# generic rules
524508#-------------------------------------------------

Previous 15994 Revisions Next


© 1998-2018 The MESS Team