Previous 15994 Revisions Next

r1491 Tuesday 8th January, 2008 at 01:52:30 UTC by Nathan Woods
Updated to MAME 0.122u4 core
[ROOT]makefile
[docs]messnew.txt
[src/build]build.mak file2str.c png2bdc.c
[src/emu]attotime.c attotime.h audit.c audit.h cheat.c cheat.h clifront.c clifront.h config.c config.h cpuexec.c cpuexec.h cpuint.c cpuint.h cpuintrf.c cpuintrf.h debugger.h drawgfx.c drawgfx.h driver.c driver.h eigccppc.h eigccx86.h eminline.h emu.mak emuopts.c emuopts.h emupal.c emupal.h fileio.c fileio.h hash.c hash.h info.c info.h inptport.c inptport.h input.c input.h inputseq.c inputseq.h mame.c mame.h mamecore.c mamecore.h memconv.h memory.c memory.h output.c output.h profiler.c profiler.h render.c render.h rendersw.c rendfont.c rendfont.h rendlay.c rendlay.h rendutil.c rendutil.h restrack.c restrack.h romload.c romload.h sndintrf.c sndintrf.h sound.c sound.h state.c state.h streams.c streams.h tilemap.c tilemap.h timer.c timer.h ui.c ui.h uigfx.c uigfx.h uimenu.c uimenu.h uitext.c uitext.h validity.c video.c video.h
[src/emu/audio]generic.c generic.h
[src/emu/cpu]cpu.mak drcfe.c drcfe.h x64drc.c x64drc.h x86drc.c x86drc.h x86emit.h x86log.c x86log.h
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/alph8201]8201dasm.c alph8201.c alph8201.h
[src/emu/cpu/arm]arm.c
[src/emu/cpu/arm7]arm7.c arm7.h arm7core.c arm7core.h arm7dasm.c arm7exec.c
[src/emu/cpu/asap]asap.c
[src/emu/cpu/ccpu]ccpu.c
[src/emu/cpu/cdp1802]1802dasm.c cdp1802.c
[src/emu/cpu/cop400]410ops.c 420ops.c cop400.h cop410.c cop410ds.c cop420.c cop420ds.c
[src/emu/cpu/cp1610]cp1610.c cp1610.h
[src/emu/cpu/f8]f8.c f8.h
[src/emu/cpu/g65816]g65816.c g65816.h g65816ds.c g65816ds.h
[src/emu/cpu/h6280]6280dasm.c h6280.c h6280.h h6280ops.h tblh6280.c
[src/emu/cpu/hd6309]6309dasm.c hd6309.c
[src/emu/cpu/i386]i386.c
[src/emu/cpu/i8039]8039dasm.c i8039.c i8039.h
[src/emu/cpu/i8051]8051dasm.c i8051.c i8051.h
[src/emu/cpu/i8085]8085dasm.c i8085.c
[src/emu/cpu/i8x41]i8x41.c i8x41.h
[src/emu/cpu/jaguar]jaguar.c
[src/emu/cpu/konami]konami.c
[src/emu/cpu/lh5801]5801dasm.c lh5801.c lh5801.h
[src/emu/cpu/m37710]m37710.c m7700ds.h
[src/emu/cpu/m6502]6502dasm.c ill02.h m4510.c m4510.h m6502.c m6502.h m6509.c m6509.h m65ce02.c m65ce02.h ops02.h ops09.h ops4510.h opsc02.h opsce02.h t6502.c t6509.c t6510.c t65c02.c t65ce02.c t65sc02.c tn2a03.c
[src/emu/cpu/m68000]m68k.h m68k_in.c m68kconf.h m68kcpu.c m68kcpu.h m68kdasm.c m68kmake.c m68kmame.c
[src/emu/cpu/m6809]6809dasm.c m6809.c
[src/emu/cpu/mb86233]mb86233.c
[src/emu/cpu/mb88xx]mb88xx.c
[src/emu/cpu/mc68hc11]mc68hc11.c
[src/emu/cpu/minx]minx.c
[src/emu/cpu/mips]mdrc64.c mdrcold.c mips3com.c mips3drc.c mips3fe.c mips3fe.h psx.c r3000.c
[src/emu/cpu/pic16c5x]16c5xdsm.c dis16c5x.c pic16c5x.c pic16c5x.h
[src/emu/cpu/powerpc]drc_ops.c ppc.c ppcdrc.c
[src/emu/cpu/rsp]rsp.c
[src/emu/cpu/s2650]s2650.c
[src/emu/cpu/saturn]saturn.c saturn.h saturnds.c
[src/emu/cpu/sc61860]sc61860.c sc61860.h scdasm.c scops.c
[src/emu/cpu/se3208]se3208.c
[src/emu/cpu/sh2]sh2.c sh2.h
[src/emu/cpu/sh4]sh4.c
[src/emu/cpu/sharc]sharc.c
[src/emu/cpu/sm8500]sm8500.c
[src/emu/cpu/spc700]spc700.c spc700ds.c spc700ds.h
[src/emu/cpu/t11]t11.c t11ops.c t11table.c
[src/emu/cpu/tms32010]32010dsm.c dis32010.c tms32010.c tms32010.h
[src/emu/cpu/tms32025]32025dsm.c dis32025.c tms32025.c tms32025.h
[src/emu/cpu/tms32031]tms32031.c
[src/emu/cpu/tms32051]tms32051.c
[src/emu/cpu/tms34010]34010fld.c 34010gfx.c 34010ops.c 34010ops.h 34010tbl.c dis34010.c tms34010.c tms34010.h
[src/emu/cpu/tms7000]tms7000.c tms7000.h tms70op.c tms70tb.c
[src/emu/cpu/tms9900]9900dasm.c
[src/emu/cpu/upd7810]7810dasm.c 7810ops.c 7810tbl.c upd7810.c
[src/emu/cpu/z180]z180.c z180dasm.c
[src/emu/cpu/z80]z80.c z80dasm.c
[src/emu/cpu/z8000]8000dasm.c z8000.c z8000cpu.h z8000ops.c z8000tbl.c
[src/emu/cpu/z80gb]z80gb.c z80gbd.c
[src/emu/debug]debugcmd.c debugcmd.h debugcmt.c debugcmt.h debugcon.c debugcon.h debugcpu.c debugcpu.h debughlp.c debughlp.h debugvw.c debugvw.h express.c express.h textbuf.c textbuf.h
[src/emu/drivers]empty.c xtal.h
[src/emu/machine]6522via.c 8257dma.h generic.c generic.h laserdsc.c laserdsc.h z80ctc.c z80ctc.h z80dma.c* z80dma.h* z80pio.c z80pio.h z80sio.c z80sio.h
[src/emu/sound]2151intf.c 2203intf.c 2413intf.c 2608intf.c 2610intf.c 2612intf.c 262intf.c 3812intf.c 5110intf.c 5220intf.c astrocde.c ay8910.c beep.c bsmt2000.c c140.c c352.c c6280.c cdda.c cdp1869.c cem3394.c custom.c dac.c discrete.c dmadac.c es5503.c es5506.c es8712.c flt_rc.c flt_vol.c fm.c fmopl.c gaelco.c hc55516.c ics2115.c iremga20.c k005289.c k007232.c k051649.c k053260.c k054539.c msm5205.c msm5232.c multipcm.c n63701x.c namco.c namco52.c namcona.c nes_apu.c okim6295.c pokey.c pokey.h psx.c qsound.c rf5c400.c rf5c68.c s14001a.c saa1099.c samples.c scsp.c segapcm.c sid.c sid6581.c sidw6581.h sn76477.c sn76496.c sound.mak sp0250.c sp0256.c sp0256.h speaker.c st0016.c tiaintf.c tiasound.c tiasound.h tms3615.c tms36xx.c upd7759.c vlm5030.c votrax.c vrender0.c wave.c x1_010.c ym2413.c ym2413.h ymf262.c ymf271.c ymf278b.c ymz280b.c
[src/emu/video]generic.c generic.h resnet.c resnet.h rgbgen.h rgbsse.h rgbutil.h rgbvmx.h s2636.c s2636.h vector.c
[src/lib]lib.mak
[src/lib/util]astring.c astring.h avcomp.c avcomp.h aviio.c aviio.h bitmap.c bitmap.h cdrom.c cdrom.h chd.c chd.h corefile.c corefile.h corestr.c corestr.h coreutil.c coreutil.h harddisk.c harddisk.h huffman.c huffman.h jedparse.c jedparse.h options.c options.h palette.c palette.h png.c png.h pool.c pool.h sha1.c sha1.h unicode.c unicode.h unzip.c unzip.h xmlfile.c xmlfile.h
[src/mame]mame.mak mamedriv.c tiny.c tiny.mak
[src/mame/audio]atarijsa.c atarijsa.h carnival.c dcs.c scramble.c segasnd.c snes.c starwars.c williams.c williams.h
[src/mame/drivers]arcadecl.c arkanoid.c atarifb.c atarig1.c atarig42.c atarigx2.c atarisy1.c batman.c beathead.c bfm_sc2.c bking2.c blstroid.c bnstars.c bogeyman.c btoads.c buggychl.c cherrym.c cherrym2.c cinemat.c cninja.c cps1.c cps2.c cps3.c cubocd32.c cvs.c cyberbal.c dkong.c eprom.c equites.c exidy.c funworld.c gamecstl.c gauntlet.c harddriv.c hyprduel.c igs_m027.c itech32.c jpmimpct.c ladybug.c laserbat.c liberate.c lvcards.c malzak.c mario.c mediagx.c metro.c midvunit.c midyunit.c midzeus.c model3.c ms32.c namcoic.c namcos1.c naomi.c neodrvr.c neogeo.c offtwall.c othunder.c peplus.c quasar.c rampart.c scramble.c segas16a.c segas24.c seta.c seta2.c skullxbo.c skychut.c stactics.c starwars.c suprridr.c surpratk.c taitojc.c taitowlf.c tatsumi.c tehkanwc.c thunderj.c toaplan2.c toobin.c vball.c vicdual.c vindictr.c viper.c xybots.c zac2650.c zn.c
[src/mame/etc]jrcrypt.c
[src/mame/includes]amiga.h atarifb.h cubocd32.h cvs.h* dc.h exidy.h galaxian.h itech32.h mario.h neogeo.h rampart.h skychut.h* suprridr.h tatsumi.h
[src/mame/layout]neogeo.lay*
[src/mame/machine]atarifb.c atarigen.c atarigen.h buggychl.c cubocd32.c dc.c fd1089.c fddebug.c mathbox.c mathbox.h mc8123.c midyunit.c slapstic.c starwars.c stvcd.c tatsumi.c
[src/mame/video]arcadecl.c arkanoid.c atarifb.c atarig1.c atarig42.c atarigt.c atarigx2.c atarirle.c atarirle.h atarisy1.c btoads.c cvs.c dc.c exidy.c flkatck.c itech32.c kingobox.c konamiic.c konamiic.h malzak.c mario.c matmania.c midvunit.c n64.c neogeo.c ninjaw.c othunder.c ppu2c0x.c quasar.c rampart.c skychut.c suprridr.c taitoic.c tatsumi.c zac2650.c
[src/osd]osdcomm.h osdcore.h osdepend.h
[src/osd/osdmini]minidir.c minifile.c minimisc.c minisync.c minitime.c miniwork.c osd_cpu.h osdmini.mak
[src/osd/windows]d3d8intf.c d3d9intf.c d3dintf.h debugwin.c debugwin.h drawd3d.c drawdd.c drawgdi.c drawnone.c eivc.h eivcx86.h input.c input.h ledutil.c main.c mame.rc osd_cpu.h osinline.h output.c output.h sound.c sound.h strconv.c strconv.h vconv.c verinfo.c video.c video.h winalloc.c windir.c window.c window.h windows.mak winfile.c winmain.c winmain.h winmisc.c winprefix.h winsync.c wintime.c winutf8.c winutf8.h winutil.c winutil.h winwork.c
[src/tools]chdcd.c chdcd.h chdman.c jedutil.c makemeta.c regrep.c romcmp.c src2html.c srcclean.c tools.mak

src/build/png2bdc.c
r1490r1491
22
33    Super-simple PNG to BDC file generator
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88****************************************************************************
src/build/build.mak
r1490r1491
44#
55#   MAME build tools makefile
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
src/build/file2str.c
r1490r1491
44
55    Simple file to string converter.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/mame/audio/snes.c
r1490r1491
1111
1212 ---------------------------------------------------------------------------
1313
14  Copyright (c) 2003-2005 Brad Martin.
14  Copyright Brad Martin.
1515
1616  OpenSPC is free software; you can redistribute it and/or modify
1717  it under the terms of the GNU Lesser General Public License as published by
src/mame/audio/atarijsa.c
r1490r1491
3939#include "machine/atarigen.h"
4040#include "audio/atarijsa.h"
4141
42
43#define JSA_MASTER_CLOCK         XTAL_3_579545MHz
44
45
4246static UINT8 *bank_base;
4347static UINT8 *bank_source_data;
4448
4549static UINT8 speech_data;
4650static UINT8 last_ctl;
4751
48static UINT8 cpu_num;
49static UINT8 input_port;
52static int cpu_num;
5053static UINT8 test_port;
5154static UINT16 test_mask;
5255
r1490r1491
101104 *
102105 *************************************/
103106
104void atarijsa_init(int cpunum, int inputport, int testport, int testmask)
107void atarijsa_init(running_machine *machine, int testport, int testmask)
105108{
106109   int i;
107110
108111   /* copy in the parameters */
109   cpu_num = cpunum;
110   input_port = inputport;
112   cpu_num = mame_find_cpu_index(machine, "jsa");
113   assert_always(cpu_num != -1, "Could not find JSA CPU!");
111114   test_port = testport;
112115   test_mask = testmask;
113116
114117   /* predetermine the bank base */
115   bank_base = &memory_region(REGION_CPU1+cpunum)[0x03000];
116   bank_source_data = &memory_region(REGION_CPU1+cpunum)[0x10000];
118   bank_base = &memory_region(REGION_CPU1+cpu_num)[0x03000];
119   bank_source_data = &memory_region(REGION_CPU1+cpu_num)[0x10000];
117120
118121   /* determine which sound hardware is installed */
119122   has_tms5220 = has_oki6295 = has_pokey = has_ym2151 = 0;
r1490r1491
141144   /* install POKEY memory handlers */
142145   if (has_pokey)
143146   {
144      memory_install_read8_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_r);
145      memory_install_write8_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_w);
147      memory_install_read8_handler(cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_r);
148      memory_install_write8_handler(cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_w);
146149   }
147150
148151   init_save_state();
r1490r1491
218221                0x02 = coin 2
219222                0x01 = coin 1
220223            */
221         result = readinputport(input_port);
224         result = readinputportbytag("JSAI");
222225         if (!(readinputport(test_port) & test_mask)) result ^= 0x80;
223226         if (atarigen_cpu_to_sound_ready) result ^= 0x40;
224227         if (atarigen_sound_to_cpu_ready) result ^= 0x20;
r1490r1491
282285            if (((data ^ last_ctl) & 0x02) && (data & 0x02))
283286               tms5220_data_w(0, speech_data);
284287            count = 5 | ((data >> 2) & 2);
285            tms5220_set_frequency(ATARI_CLOCK_3MHz*2 / (16 - count));
288            tms5220_set_frequency(JSA_MASTER_CLOCK*2 / (16 - count));
286289         }
287290
288291         /* coin counters */
r1490r1491
345348                0x02 = coin 2
346349                0x01 = coin 1
347350            */
348         result = readinputport(input_port);
351         result = readinputportbytag("JSAII");
349352         if (!(readinputport(test_port) & test_mask)) result ^= 0x80;
350353         if (atarigen_cpu_to_sound_ready) result ^= 0x40;
351354         if (atarigen_sound_to_cpu_ready) result ^= 0x20;
r1490r1491
464467                0x02 = coin L (active high)
465468                0x01 = coin R (active high)
466469            */
467         result = readinputport(input_port);
470         result = readinputportbytag("JSAIII");
468471         if (!(readinputport(test_port) & test_mask)) result ^= 0x90;
469472         if (atarigen_cpu_to_sound_ready) result ^= 0x40;
470473         if (atarigen_sound_to_cpu_ready) result ^= 0x20;
r1490r1491
601604                0x02 = coin L (active high)
602605                0x01 = coin R (active high)
603606            */
604         result = readinputport(input_port);
607         result = readinputportbytag("JSAIII");
605608         if (!(readinputport(test_port) & test_mask)) result ^= 0x90;
606609         if (atarigen_cpu_to_sound_ready) result ^= 0x40;
607610         if (atarigen_sound_to_cpu_ready) result ^= 0x20;
r1490r1491
729732 *
730733 *************************************/
731734
732static ADDRESS_MAP_START( atarijsa1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
733   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM)
734   AM_RANGE(0x2000, 0x2001) AM_READ(YM2151_status_port_0_r)
735   AM_RANGE(0x2800, 0x2bff) AM_READ(jsa1_io_r)
736   AM_RANGE(0x3000, 0xffff) AM_READ(MRA8_ROM)
737ADDRESS_MAP_END
738
739
740static ADDRESS_MAP_START( atarijsa1_writemem, ADDRESS_SPACE_PROGRAM, 8 )
741   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_RAM)
735static ADDRESS_MAP_START( atarijsa1_map, ADDRESS_SPACE_PROGRAM, 8 )
736   AM_RANGE(0x0000, 0x1fff) AM_RAM
742737   AM_RANGE(0x2000, 0x2000) AM_WRITE(YM2151_register_port_0_w)
743738   AM_RANGE(0x2001, 0x2001) AM_WRITE(YM2151_data_port_0_w)
744   AM_RANGE(0x2800, 0x2bff) AM_WRITE(jsa1_io_w)
745   AM_RANGE(0x3000, 0xffff) AM_WRITE(MWA8_ROM)
746ADDRESS_MAP_END
747
748
749static ADDRESS_MAP_START( atarijsa2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
750   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM)
751739   AM_RANGE(0x2000, 0x2001) AM_READ(YM2151_status_port_0_r)
752   AM_RANGE(0x2800, 0x2bff) AM_READ(jsa2_io_r)
753   AM_RANGE(0x3000, 0xffff) AM_READ(MRA8_ROM)
740   AM_RANGE(0x2800, 0x2bff) AM_READWRITE(jsa1_io_r, jsa1_io_w)
741   AM_RANGE(0x3000, 0xffff) AM_ROM
754742ADDRESS_MAP_END
755743
756744
757static ADDRESS_MAP_START( atarijsa2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
758   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_RAM)
745static ADDRESS_MAP_START( atarijsa2_map, ADDRESS_SPACE_PROGRAM, 8 )
746   AM_RANGE(0x0000, 0x1fff) AM_RAM
759747   AM_RANGE(0x2000, 0x2000) AM_WRITE(YM2151_register_port_0_w)
760748   AM_RANGE(0x2001, 0x2001) AM_WRITE(YM2151_data_port_0_w)
761   AM_RANGE(0x2800, 0x2bff) AM_WRITE(jsa2_io_w)
762   AM_RANGE(0x3000, 0xffff) AM_WRITE(MWA8_ROM)
749   AM_RANGE(0x2000, 0x2001) AM_READ(YM2151_status_port_0_r)
750   AM_RANGE(0x2800, 0x2bff) AM_READWRITE(jsa2_io_r, jsa2_io_w)
751   AM_RANGE(0x3000, 0xffff) AM_ROM
763752ADDRESS_MAP_END
764753
765754
r1490r1491
808797MACHINE_DRIVER_START( jsa_i_stereo )
809798
810799   /* basic machine hardware */
811   MDRV_CPU_ADD_TAG("jsa", M6502, ATARI_CLOCK_3MHz/2)
812   MDRV_CPU_PROGRAM_MAP(atarijsa1_readmem,atarijsa1_writemem)
813   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)ATARI_CLOCK_3MHz/4/16/16/14)
800   MDRV_CPU_ADD_TAG("jsa", M6502, JSA_MASTER_CLOCK/2)
801   MDRV_CPU_PROGRAM_MAP(atarijsa1_map,0)
802   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
814803
815804   /* sound hardware */
816805   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
817806
818   MDRV_SOUND_ADD_TAG("ym", YM2151, ATARI_CLOCK_3MHz)
807   MDRV_SOUND_ADD_TAG("ym", YM2151, JSA_MASTER_CLOCK)
819808   MDRV_SOUND_CONFIG(ym2151_interface)
820809   MDRV_SOUND_ROUTE(0, "left", 0.60)
821810   MDRV_SOUND_ROUTE(1, "right", 0.60)
r1490r1491
829818   MDRV_IMPORT_FROM(jsa_i_stereo)
830819
831820   /* sound hardware */
832   MDRV_SOUND_REPLACE("ym", YM2151, ATARI_CLOCK_3MHz)
821   MDRV_SOUND_REPLACE("ym", YM2151, JSA_MASTER_CLOCK)
833822   MDRV_SOUND_CONFIG(ym2151_interface)
834823   MDRV_SOUND_ROUTE(0, "right", 0.60)
835824   MDRV_SOUND_ROUTE(1, "left", 0.60)
r1490r1491
843832   MDRV_IMPORT_FROM(jsa_i_stereo)
844833
845834   /* sound hardware */
846   MDRV_SOUND_ADD(POKEY, ATARI_CLOCK_3MHz/2)
835   MDRV_SOUND_ADD(POKEY, JSA_MASTER_CLOCK/2)
847836   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.40)
848837   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.40)
849838MACHINE_DRIVER_END
r1490r1491
853842MACHINE_DRIVER_START( jsa_i_mono_speech )
854843
855844   /* basic machine hardware */
856   MDRV_CPU_ADD_TAG("jsa", M6502, ATARI_CLOCK_3MHz/2)
857   MDRV_CPU_PROGRAM_MAP(atarijsa1_readmem,atarijsa1_writemem)
858   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)ATARI_CLOCK_3MHz/4/16/16/14)
845   MDRV_CPU_ADD_TAG("jsa", M6502, JSA_MASTER_CLOCK/2)
846   MDRV_CPU_PROGRAM_MAP(atarijsa1_map,0)
847   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
859848
860849   /* sound hardware */
861850   MDRV_SPEAKER_STANDARD_MONO("mono")
862851
863   MDRV_SOUND_ADD_TAG("ym", YM2151, ATARI_CLOCK_3MHz)
852   MDRV_SOUND_ADD_TAG("ym", YM2151, JSA_MASTER_CLOCK)
864853   MDRV_SOUND_CONFIG(ym2151_interface)
865854   MDRV_SOUND_ROUTE(0, "mono", 0.60)
866855   MDRV_SOUND_ROUTE(1, "mono", 0.60)
867856
868   MDRV_SOUND_ADD(TMS5220, ATARI_CLOCK_3MHz*2/11) /* potentially ATARI_CLOCK_3MHz/9 as well */
857   MDRV_SOUND_ADD(TMS5220, JSA_MASTER_CLOCK*2/11) /* potentially JSA_MASTER_CLOCK/9 as well */
869858   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
870859MACHINE_DRIVER_END
871860
r1490r1491
874863MACHINE_DRIVER_START( jsa_ii_mono )
875864
876865   /* basic machine hardware */
877   MDRV_CPU_ADD_TAG("jsa", M6502, ATARI_CLOCK_3MHz/2)
878   MDRV_CPU_PROGRAM_MAP(atarijsa2_readmem,atarijsa2_writemem)
879   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)ATARI_CLOCK_3MHz/4/16/16/14)
866   MDRV_CPU_ADD_TAG("jsa", M6502, JSA_MASTER_CLOCK/2)
867   MDRV_CPU_PROGRAM_MAP(atarijsa2_map,0)
868   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
880869
881870   /* sound hardware */
882871   MDRV_SPEAKER_STANDARD_MONO("mono")
883872
884   MDRV_SOUND_ADD_TAG("ym", YM2151, ATARI_CLOCK_3MHz)
873   MDRV_SOUND_ADD_TAG("ym", YM2151, JSA_MASTER_CLOCK)
885874   MDRV_SOUND_CONFIG(ym2151_interface)
886875   MDRV_SOUND_ROUTE(0, "mono", 0.60)
887876   MDRV_SOUND_ROUTE(1, "mono", 0.60)
888877
889   MDRV_SOUND_ADD_TAG("adpcm", OKIM6295, ATARI_CLOCK_3MHz/3)
878   MDRV_SOUND_ADD_TAG("adpcm", OKIM6295, JSA_MASTER_CLOCK/3)
890879   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
891880   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
892881MACHINE_DRIVER_END
r1490r1491
917906MACHINE_DRIVER_START( jsa_iiis_stereo )
918907
919908   /* basic machine hardware */
920   MDRV_CPU_ADD_TAG("jsa", M6502, ATARI_CLOCK_3MHz/2)
909   MDRV_CPU_ADD_TAG("jsa", M6502, JSA_MASTER_CLOCK/2)
921910   MDRV_CPU_PROGRAM_MAP(atarijsa3s_map,0)
922   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)ATARI_CLOCK_3MHz/4/16/16/14)
911   MDRV_CPU_PERIODIC_INT(atarigen_6502_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14)
923912
924913   /* sound hardware */
925914   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
926915
927   MDRV_SOUND_ADD_TAG("ym", YM2151, ATARI_CLOCK_3MHz)
916   MDRV_SOUND_ADD_TAG("ym", YM2151, JSA_MASTER_CLOCK)
928917   MDRV_SOUND_CONFIG(ym2151_interface)
929918   MDRV_SOUND_ROUTE(0, "left", 0.60)
930919   MDRV_SOUND_ROUTE(1, "right", 0.60)
931920
932   MDRV_SOUND_ADD(OKIM6295, ATARI_CLOCK_3MHz/3)
921   MDRV_SOUND_ADD(OKIM6295, JSA_MASTER_CLOCK/3)
933922   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
934923   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.75)
935924
936   MDRV_SOUND_ADD(OKIM6295, ATARI_CLOCK_3MHz/3)
925   MDRV_SOUND_ADD(OKIM6295, JSA_MASTER_CLOCK/3)
937926   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
938927   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.75)
939928MACHINE_DRIVER_END
src/mame/audio/atarijsa.h
r1490r1491
55****************************************************************************/
66
77
8
9#define ATARI_CLOCK_3MHz      3579000
10
11
12void atarijsa_init(int cpunum, int inputport, int testport, int testmask);
8void atarijsa_init(running_machine *machine, int testport, int testmask);
139void atarijsa3_init_adpcm(int region);
1410void atarijsa_reset(void);
1511
src/mame/audio/segasnd.c
r1490r1491
44
55    Sound boards for early Sega G-80 based games.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/mame/audio/carnival.c
r1490r1491
11/*****************************************************************************/
22/*                                                                           */
3/*                    (C) Copyright 1998  Peter J.C.Clare                    */
3/*                    (C) Copyright       Peter J.C.Clare                    */
44/*                                                                           */
55/*****************************************************************************/
66/*                                                                           */
src/mame/audio/williams.c
r1490r1491
3232#include "sound/dac.h"
3333
3434
35#define NARC_MASTER_CLOCK      XTAL_8MHz
36#define NARC_FM_CLOCK         XTAL_3_579545MHz
37
38#define CVSD_MASTER_CLOCK      XTAL_8MHz
39#define CVSD_FM_CLOCK         XTAL_3_579545MHz
40
41#define ADPCM_MASTER_CLOCK      XTAL_8MHz
42#define ADPCM_FM_CLOCK         XTAL_3_579545MHz
43
44
45
3546/***************************************************************************
3647    STATIC GLOBALS
3748****************************************************************************/
r1490r1491
3950static UINT8 williams_sound_int_state;
4051
4152static UINT8 audio_talkback;
53static UINT8 audio_sync;
4254
4355static INT8 sound_cpunum;
4456static INT8 soundalt_cpunum;
r1490r1491
177189****************************************************************************/
178190
179191MACHINE_DRIVER_START( williams_cvsd_sound )
180   MDRV_CPU_ADD_TAG("cvsd", M6809, 8000000/4)
192   MDRV_CPU_ADD_TAG("cvsd", M6809E, CVSD_MASTER_CLOCK/4)
181193   MDRV_CPU_PROGRAM_MAP(williams_cvsd_map,0)
182194
183195   MDRV_SPEAKER_STANDARD_MONO("mono")
184196
185   MDRV_SOUND_ADD(YM2151, 3579580)
197   MDRV_SOUND_ADD(YM2151, CVSD_FM_CLOCK)
186198   MDRV_SOUND_CONFIG(cvsd_ym2151_interface)
187199   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
188200
r1490r1491
195207
196208
197209MACHINE_DRIVER_START( williams_narc_sound )
198   MDRV_CPU_ADD_TAG("narc1", M6809, 8000000/4)
210   MDRV_CPU_ADD_TAG("narc1", M6809E, NARC_MASTER_CLOCK/4)
199211   MDRV_CPU_PROGRAM_MAP(williams_narc_master_map,0)
200212
201   MDRV_CPU_ADD_TAG("narc2", M6809, 8000000/4)
213   MDRV_CPU_ADD_TAG("narc2", M6809E, NARC_MASTER_CLOCK/4)
202214   MDRV_CPU_PROGRAM_MAP(williams_narc_slave_map,0)
203215
204216   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
205217
206   MDRV_SOUND_ADD(YM2151, 3579580)
218   MDRV_SOUND_ADD(YM2151, NARC_FM_CLOCK)
207219   MDRV_SOUND_CONFIG(adpcm_ym2151_interface)
208220   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.10)
209221   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.10)
r1490r1491
223235
224236
225237MACHINE_DRIVER_START( williams_adpcm_sound )
226   MDRV_CPU_ADD_TAG("adpcm", M6809, 8000000/4)
238   MDRV_CPU_ADD_TAG("adpcm", M6809E, ADPCM_MASTER_CLOCK/4)
227239   MDRV_CPU_PROGRAM_MAP(williams_adpcm_map,0)
228240
229241   MDRV_SPEAKER_STANDARD_MONO("mono")
230242
231   MDRV_SOUND_ADD(YM2151, 3579580)
243   MDRV_SOUND_ADD(YM2151, ADPCM_FM_CLOCK)
232244   MDRV_SOUND_CONFIG(adpcm_ym2151_interface)
233245   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
234246
235247   MDRV_SOUND_ADD(DAC, 0)
236248   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
237249
238   MDRV_SOUND_ADD(OKIM6295, 8000000/8)
250   MDRV_SOUND_ADD(OKIM6295, ADPCM_MASTER_CLOCK/8)
239251   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) // clock frequency & pin 7 not verified
240252   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
241253MACHINE_DRIVER_END
r1490r1491
322334   /* register for save states */
323335   state_save_register_global(williams_sound_int_state);
324336   state_save_register_global(audio_talkback);
337   state_save_register_global(audio_sync);
325338}
326339
327340
r1490r1491
529542}
530543
531544
545static TIMER_CALLBACK( narc_sync_clear )
546{
547   audio_sync &= ~param;
548}
549
532550static WRITE8_HANDLER( narc_master_sync_w )
533551{
552   timer_set(double_to_attotime(TIME_OF_74LS123(180000, 0.000001)), NULL, 0x01, narc_sync_clear);
553   audio_sync |= 0x01;
534554   logerror("Master sync = %02X\n", data);
535555}
536556
r1490r1491
543563
544564static WRITE8_HANDLER( narc_slave_sync_w )
545565{
566   timer_set(double_to_attotime(TIME_OF_74LS123(180000, 0.000001)), NULL, 0x02, narc_sync_clear);
567   audio_sync |= 0x02;
546568   logerror("Slave sync = %02X\n", data);
547569}
548570
r1490r1491
584606}
585607
586608
609int williams_narc_talkback_r(void)
610{
611   return audio_talkback | (audio_sync << 8);
612}
587613
614
615
588616/***************************************************************************
589617    ADPCM READ/WRITE HANDLERS
590618****************************************************************************/
r1490r1491
601629}
602630
603631
632static TIMER_CALLBACK( clear_irq_state )
633{
634   williams_sound_int_state = 0;
635}
636
637
604638static READ8_HANDLER( adpcm_command_r )
605639{
606640   cpunum_set_input_line(sound_cpunum, M6809_IRQ_LINE, CLEAR_LINE);
607   williams_sound_int_state = 0;
641
642   /* don't clear the external IRQ state for a short while; this allows the
643       self-tests to pass */
644   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, clear_irq_state);
608645   return soundlatch_r(0);
609646}
610647
r1490r1491
628665   {
629666      cpunum_set_input_line(sound_cpunum, M6809_IRQ_LINE, ASSERT_LINE);
630667      williams_sound_int_state = 1;
668      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
631669   }
632670}
633671
r1490r1491
645683   else
646684      cpunum_set_input_line(sound_cpunum, INPUT_LINE_RESET, CLEAR_LINE);
647685}
686
687
688int williams_adpcm_sound_irq_r(void)
689{
690   return williams_sound_int_state;
691}
src/mame/audio/williams.h
r1490r1491
1515void williams_adpcm_init(void);
1616void williams_adpcm_data_w(int data);
1717void williams_adpcm_reset_w(int state);
18int williams_adpcm_sound_irq_r(void);
1819
1920void williams_narc_init(void);
2021void williams_narc_data_w(int data);
2122void williams_narc_reset_w(int state);
22
23int williams_narc_talkback_r(void);
src/mame/audio/scramble.c
r1490r1491
1111
1212***************************************************************************/
1313
14
1514#include "driver.h"
1615#include "cpu/z80/z80.h"
1716#include "machine/7474.h"
1817#include "sound/flt_rc.h"
18#include "sound/5110intf.h"
19#include "sound/tms5110.h"
20#include "sound/ay8910.h"
1921#include "includes/galaxian.h"
2022
23#define AD2083_TMS5110_CLOCK       XTAL_640kHz
2124
2225/* The timer clock in Scramble which feeds the upper 4 bits of          */
2326/* AY-3-8910 port A is based on the same clock                          */
r1490r1491
252255}
253256
254257
258/***************************************************************************
259    AD2083 TMS5110 implementation (still wrong!)
260
261    ROMA: BIT1: Hypersoni ?
262    ROMA: BIT2: Two thousand eighty three
263    ROMA: BIT4: Atomic City Attack
264    ROMA: BIT5: Thank you, please try again
265    ROMA: BIT6: Two, one, fire
266    ROMA: BIT7: Hyperjump
267    ROMB: BIT1: Noise (Explosion ?)
268    ROMB: BIT2: Welcome to the top 20
269    ROMB: BIT4: Atomic City Attack
270    ROMB: BIT5: Noise (Explosion ?)
271    ROMB: BIT6: Keep going pressing
272    ROMB: BIT7: You are the new champion
273
274    The circuit consist of
275
276    2x 2532 32Kbit roms
277    2x 74LS393 quad 4bit counters to address roms
278    1x 74LS174 hex-d-flipflops to latch control byte
279    2x 74LS139 decoder to decode rom selects
280    1x 74LS161 8bit input multiplexor to select sound bit from rom data
281    1x 74LS00  quad nand to decode signals (unknown) to latch control byte
282               ==> 74LS139
283    1x 74LS16  quad open collector inverters
284    1x 74S288  32x8 Prom
285
286    The prom obviously is used to provide the right timing when
287    fetching data bits. This circuit should be comparable to bagman.
288
289    Prom
290    Q0      ==> NC
291    Q1      ==> PDC
292    Q2      ==> CTL2/CTL8 (Speak/Reset)
293    Q7      ==> Reset Counters (LS393)
294    Q8      ==> Trigger Logic
295
296  ***************************************************************************/
297
298/*
299 *      Alt1 Alt2
300 * 1 ==> C     B   Bit select
301 * 2 ==> B     C   Bit select
302 * 3 ==> A     A   Bit select
303 * 4 ==> B1        Rom select
304 * 5 ==> A1        Rom select
305 *
306 *      ALT1      ALT2
307 * 321  CBA       CBA
308 * 000  000       000
309 * 001  100       010
310 * 010  010       100
311 * 011  110       110
312 * 100  001       001
313 * 101  101       011
314 * 110  011       101
315 * 111  111       111
316 *
317 * Alt1 provides more sensible sound. Both Alt1 and Alt2 are
318 * possible on PCB so Alt2 is left in for documentation.
319 *
320 */
321
322static UINT32 speech_rom_address;
323static UINT32 speech_rom_address_hi;
324static UINT8 speech_rom_bit;
325static UINT8 speech_cnt;
326
327static TIMER_CALLBACK( ad2083_step )
328{
329   /* only 16 bytes needed ... Stored here since
330     * prom is a bad dump
331     */
332   static const int prom[16] = {0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00,
333                 0x02, 0x00, 0x40, 0x00, 0x04, 0x06, 0x04, 0x84 };
334   UINT8 ctrl;
335
336   if (param == 0)
337   {
338      if (speech_cnt < 0x10)
339      {
340         /* Just reset and exit */
341         speech_cnt = 0;
342         return;
343      }
344      speech_cnt = 0;
345   }
346   ctrl = prom[speech_cnt++];
347
348   if (ctrl & 0x40)
349      speech_rom_address = 0;
350
351   tms5110_CTL_w(0, ctrl & 0x04 ? TMS5110_CMD_SPEAK : TMS5110_CMD_RESET);
352   tms5110_PDC_w(0, ctrl & 0x02 ? 0 : 1);
353
354   if (!(ctrl & 0x80))
355      timer_set(ATTOTIME_IN_HZ(AD2083_TMS5110_CLOCK / 2),NULL,1,ad2083_step);
356}
357
358static int ad2083_speech_rom_read_bit(void)
359{
360   UINT8 *ROM = memory_region(REGION_SOUND1);
361   int bit;
362
363   speech_rom_address %= 4096;
364
365   bit = (ROM[speech_rom_address | speech_rom_address_hi] >> speech_rom_bit) & 1;
366   speech_rom_address++;
367
368   return bit;
369}
370
371static WRITE8_HANDLER( ad2083_tms5110_ctrl_w )
372{
373   int tbl[8] = {0,4,2,6,1,5,3,7};
374
375   speech_rom_bit = tbl[data & 0x07];
376   switch (data>>3)
377   {
378      case 0x00:
379         logerror("Rom 0 select .. \n");
380         break;
381      case 0x01:
382         /* Rom 2 select */
383         speech_rom_address_hi = 0x1000;
384         break;
385      case 0x02:
386         logerror("Rom 1 select\n");
387         break;
388      case 0x03:
389         /* Rom 3 select */
390         speech_rom_address_hi = 0x0000;
391         break;
392   }
393   timer_set(attotime_zero,NULL,0,ad2083_step);
394}
395
396static const struct TMS5110interface ad2083_tms5110_interface =
397{
398   TMS5110_IS_5110A,
399   -1,                     /* rom_region */
400   ad2083_speech_rom_read_bit   /* M0 callback function. Called whenever chip requests a single bit of data */
401};
402
403
404static const struct AY8910interface ad2083_ay8910_interface_1 =
405{
406   scramble_portB_r
407};
408
409static const struct AY8910interface ad2083_ay8910_interface_2 =
410{
411   hotshock_soundlatch_r
412};
413
414static ADDRESS_MAP_START( ad2083_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
415   AM_RANGE(0x0000, 0x2fff) AM_ROM
416   AM_RANGE(0x8000, 0x83ff) AM_RAM
417ADDRESS_MAP_END
418
419static ADDRESS_MAP_START( ad2083_sound_io_map, ADDRESS_SPACE_IO, 8 )
420   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
421   AM_RANGE(0x01, 0x01) AM_WRITE(ad2083_tms5110_ctrl_w)
422   AM_RANGE(0x10, 0x10) AM_WRITE(AY8910_control_port_0_w)
423   AM_RANGE(0x20, 0x20) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
424   AM_RANGE(0x40, 0x40) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
425   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_control_port_1_w)
426ADDRESS_MAP_END
427
428static SOUND_START( ad2083 )
429{
430   speech_rom_address = 0;
431   speech_rom_address_hi = 0;
432   speech_rom_bit = 0;
433   speech_cnt = 0x10;
434
435   state_save_register_global(speech_rom_address);
436   state_save_register_global(speech_rom_address_hi);
437   state_save_register_global(speech_rom_bit);
438   state_save_register_global(speech_cnt);
439}
440
441MACHINE_DRIVER_START( ad2083_audio )
442
443   MDRV_CPU_ADD(Z80, 14318000/8)   /* 1.78975 MHz */
444   MDRV_CPU_PROGRAM_MAP(ad2083_sound_map,0)
445   MDRV_CPU_IO_MAP(ad2083_sound_io_map,0)
446
447   MDRV_SOUND_START(ad2083)
448
449   MDRV_SPEAKER_STANDARD_MONO("mono")
450   MDRV_SOUND_ADD(AY8910, 14318000/8)
451   MDRV_SOUND_CONFIG(ad2083_ay8910_interface_1)
452   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
453
454   MDRV_SOUND_ADD(AY8910, 14318000/8)
455   MDRV_SOUND_CONFIG(ad2083_ay8910_interface_2)
456   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
457
458   MDRV_SOUND_ADD(TMS5110, AD2083_TMS5110_CLOCK)
459   MDRV_SOUND_CONFIG(ad2083_tms5110_interface)
460   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
461MACHINE_DRIVER_END
src/mame/audio/starwars.c
r1490r1491
22
33    Atari Star Wars hardware
44
5    This file is Copyright 1997, Steve Baines.
5    This file is Copyright Steve Baines.
66    Modified by Frank Palazzolo for sound support
77
88***************************************************************************/
src/mame/audio/dcs.c
r1490r1491
774774
775775static TIMER_CALLBACK( dcs_reset )
776776{
777   if (LOG_DCS_IO)
778      logerror("dcs_reset\n");
779
777780   /* reset the memory banking */
778781   switch (dcs.rev)
779782   {
r1490r1491
892895   state_save_register_global(transfer.sum);
893896   state_save_register_global(transfer.fifo_entries);
894897
895   state_save_register_global_pointer(dcs_sram, 0x8000*4 / sizeof(dcs_sram[0]));
898   if (dcs_sram != NULL)
899      state_save_register_global_pointer(dcs_sram, 0x8000*4 / sizeof(dcs_sram[0]));
896900}
897901
898902
899903void dcs_init(void)
900904{
901   dcs_register_state();
902905   memset(&dcs, 0, sizeof(dcs));
906   dcs_sram = NULL;
903907
904908   /* find the DCS CPU and the sound ROMs */
905909   dcs.cpunum = mame_find_cpu_index(Machine, "dcs");
r1490r1491
919923   /* non-RAM based automatically acks */
920924   dcs.auto_ack = TRUE;
921925
926   /* register for save states */
927   dcs_register_state();
928
922929   /* reset the system */
923930   dcs_reset(Machine, NULL, 0);
924931}
src/mame/machine/cubocd32.c
r1490r1491
6868static TIMER_CALLBACK(akiko_dma_proc);
6969static TIMER_CALLBACK(akiko_frame_proc);
7070
71void amiga_akiko_init(void)
71static void amiga_akiko_exit(running_machine* machine)
7272{
73   if( akiko.cdrom ) {
74      cdrom_close(akiko.cdrom);
75      akiko.cdrom = (cdrom_file *)NULL;
76   }
77}
78
79void amiga_akiko_init(running_machine* machine)
80{
7381   i2cmem_init( 0, I2CMEM_SLAVE_ADDRESS, NVRAM_PAGE_SIZE, NVRAM_SIZE, NULL );
7482
7583   akiko.c2p_input_index = 0;
r1490r1491
99107   akiko.dma_timer = timer_alloc(akiko_dma_proc, NULL);
100108   akiko.frame_timer = timer_alloc(akiko_frame_proc, NULL);
101109
110   add_exit_callback(machine, amiga_akiko_exit);
111
102112   /* create the TOC table */
103113   if ( akiko.cdrom != NULL && cdrom_get_last_track(akiko.cdrom) )
104114   {
src/mame/machine/fd1089.c
r1490r1491
2222The FD1089 design is clearly derived from the MC8123. The MC8123 is a Z80 so it
2323made sense to encrypt all 8 data bits and use 12 of the 16 address bits. It makes
2424a lot less sense to encrypt only half of the 16 data bits; using 12 of the 24
25address bits might be ok, but not in the way they did it. The choice of address
25address bits might be ok, but not in the way it was done. The choice of address
2626bits to use was probably dictated by the need to not encrypt data in certain areas
2727of the address space, so they had to include the top 8 bits of the address.
2828However this means that if you pick e.g. area 000000-00FFFF, where most of the
r1490r1491
3232and security. Also, since only 8 of the 16 bits are encrypted, it is very easy
3333to use the unencrypted ones to search for known sequences of code or data.
3434
35It is almost certain that a linear congruential generator was used to generate
36the keys, like for MC8123 and FD1094, however this hasn't been figured out yet.
37The keys that control decryption are currently arbitrarily assigned so the only
38thing one can expect is that there should be a fixed 256 entries table to map the
39LCG output to the current arbitrary keys.
3540
41Note that when both FD1089A and FD1089B versions of a game exist, they use the
42same key. There are small differences in the current keys (only bit 2 of some
43values) which are caused by the arbitrary assignment of keys.
44
3645Known games that use this CPU are:
3746
3847CPU #   Status   Game                     Notes
r1490r1491
4150317-0018  [1] Action Fighter
4251317-0021? [2] Alex Kidd
4352317-0022  [1] Dunk Shot
44317-0028  [2] Defense
45317-0033  [1] Alien Syndrome
46317-0167  [2] Aurail
53317-0028  [2] Defense                  same key as 317-0028
54317-0033  [1] Alien Syndrome           same key as 317-0037
55317-0167  [2] Aurail                   same key as 317-0168
4756
4857FD1089B
4958317-0013A [1] Enduro Racer
5059317-0024  [2] Time Scanner             FD1089B 6J2 317-0024
51317-0027  [2] SDI
60317-0027  [2] SDI                      same key as 317-0027
5261317-0034  [1] Super Hang-On
53317-0168  [1] Aurail
62317-0037  [2] Alien Syndrome           same key as 317-0033
63317-0168  [1] Aurail                   same key as 317-0167
5464317-5021  [3] Sukeban Jansi Ryuko
5565
5666[1] Complete
r1490r1491
42304240};
42314241
42324242
4243/* 317-0037 FD1089B */
4244static const UINT8 key_0037[0x2000] =
4245{
4246   /* data */
4247   0xe7,0x57,0x69,0xa4,0x29,0x6c,0x18,0xa3,0x64,0x71,0x11,0x55,0x16,0x59,0xaa,0x2c,
4248   0x53,0xb4,0x82,0xce,0x26,0x3f,0xfb,0x44,0xaa,0xac,0xc9,0x76,0x63,0xc6,0x55,0x6e,
4249   0xbd,0x9e,0x8a,0x31,0x46,0x6a,0x4e,0x22,0x8a,0xca,0x31,0x48,0x84,0x3e,0x69,0x7c,
4250    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4251    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4252    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4253    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4254    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4255    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4256    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4257    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4258    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4259    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4260    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4261    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4262    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4263    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4264    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4265    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4266    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4267    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4268    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4269    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4270    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4271    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4272    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4273    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4274    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4275    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4276    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4277    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4278    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4279    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4280    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4281    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4282    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4283    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4284    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4285    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4286    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4287    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4288    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4289    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4290    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4291    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4292    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4293    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4294    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4295    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4296    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4297    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4298    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4299    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4300    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4301    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4302    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4303    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4304    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4305    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4306    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4307    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4308    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4309    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4310    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4311    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4312    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4313    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4314    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4315    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4316    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4317    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4318    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4319    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4320    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4321    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4322    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4323    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4324    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4325    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4326    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4327    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4328    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4329    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4330    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4331    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4332    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4333    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4334    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4335    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4336    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4337    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4338    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4339    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4340    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4341    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4342    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4343    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4344    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4345    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4346    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4347    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4348    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4349    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4350    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4351    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4352    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4353    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4354    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4355    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4356    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4357    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4358    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4359    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4360    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4361    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4362    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4363    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4364    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4365    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4366    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4367    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4368    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4369    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4370    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4371    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4372    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4373    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4374    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4375    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4376    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4377    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4378    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4379    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4380    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4381    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4382    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4383    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4384    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4385    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4386    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4387    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4388    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4389    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4390    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4391    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4392    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4393    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4394    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4395    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4396    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4397    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4398    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4399    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4400    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4401    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4402    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4403    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4404    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4405    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4406    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4407    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4408    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4409    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4410    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4411    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4412    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4413    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4414    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4415    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4416    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4417    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4418    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4419    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4420    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4421    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4422    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4423    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4424    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4425    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4426    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4427    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4428    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4429    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4430    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4431    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4432    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4433    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4434    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4435    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4436    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4437    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4438    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4439    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4440    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4441    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4442    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4443    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4444    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4445    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4446    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4447    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4448    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4449    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4450    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4451    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4452    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4453    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4454    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4455    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4456    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4457    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4458    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4459    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4460    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4461    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4462    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4463    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4464    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4465    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4466    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4467    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4468    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4469    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4470    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4471    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4472    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4473    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4474    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4475    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4476    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4477    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4478    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4479    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4480    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4481    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4482    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4483    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4484    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4485    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4486    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4487    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4488    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4489    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4490    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4491    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4492    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4493    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4494    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4495    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4496    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4497    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4498    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4499    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4500    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4501    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4502    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4503
4504   /* opcodes */
4505   0xf1,0x4e,0xd0,0xeb,0x26,0xd6,0x7d,0xaf,0x37,0x2f,0x78,0xd9,0xb4,0xad,0x7f,0x9d,
4506   0x57,0x96,0xb0,0xaa,0xd5,0x38,0xfe,0xc7,0x22,0x89,0x93,0x8c,0xc4,0x19,0x3f,0x1d,
4507    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4508    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4509    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4510    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4511    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4512    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4513    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4514    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4515    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4516    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4517    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4518    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4519    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4520    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4521    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4522    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4523    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4524    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4525    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4526    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4527    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4528    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4529    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4530    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4531    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4532    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4533    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4534    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4535    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4536    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4537    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4538    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4539    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4540    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4541    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4542    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4543    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4544    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4545    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4546    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4547    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4548    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4549    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4550    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4551    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4552    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4553    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4554    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4555    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4556    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4557    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4558    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4559    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4560    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4561    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4562    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4563    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4564    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4565    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4566    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4567    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4568    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4569    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4570    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4571    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4572    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4573    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4574    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4575    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4576    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4577    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4578    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4579    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4580    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4581    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4582    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4583    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4584    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4585    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4586    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4587    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4588    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4589    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4590    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4591    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4592    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4593    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4594    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4595    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4596    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4597    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4598    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4599    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4600    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4601    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4602    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4603    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4604    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4605    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4606    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4607    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4608    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4609    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4610    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4611    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4612    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4613    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4614    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4615    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4616    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4617    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4618    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4619    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4620    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4621    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4622    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4623    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4624    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4625    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4626    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4627    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4628    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4629    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4630    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4631    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4632    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4633    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4634    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4635    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4636    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4637    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4638    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4639    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4640    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4641    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4642    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4643    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4644    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4645    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4646    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4647    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4648    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4649    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4650    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4651    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4652    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4653    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4654    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4655    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4656    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4657    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4658    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4659    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4660    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4661    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4662    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4663    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4664    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4665    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4666    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4667    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4668    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4669    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4670    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4671    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4672    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4673    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4674    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4675    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4676    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4677    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4678    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4679    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4680    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4681    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4682    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4683    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4684    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4685    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4686    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4687    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4688    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4689    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4690    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4691    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4692    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4693    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4694    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4695    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4696    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4697    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4698    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4699    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4700    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4701    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4702    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4703    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4704    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4705    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4706    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4707    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4708    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4709    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4710    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4711    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4712    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4713    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4714    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4715    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4716    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4717    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4718    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4719    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4720    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4721    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4722    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4723    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4724    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4725    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4726    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4727    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4728    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4729    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4730    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4731    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4732    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4733    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4734    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4735    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4736    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4737    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4738    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4739    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4740    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4741    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4742    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4743    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4744    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4745    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4746    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4747    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4748    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4749    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4750    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4751    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4752    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4753    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4754    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4755    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4756    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4757    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4758    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4759    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4760    0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  , 0  ,
4761};
4762
4763
42334764/* 317-0034 FD1089B */
42344765static const UINT8 key_0034[0x2000] =
42354766{
r1490r1491
65957126   sys16_decrypt(key_0034,FD1089B);
65967127}
65977128
7129void fd1089_decrypt_0037(void)
7130{
7131   sys16_decrypt(key_0037,FD1089B);
7132}
7133
65987134void fd1089_decrypt_0167(void)
65997135{
66007136   sys16_decrypt(key_0167,FD1089A);
src/mame/machine/midyunit.c
r1490r1491
170170static WRITE16_HANDLER( term2_sound_w )
171171{
172172   if (offset == 0)
173      term2_analog_select = (data >> 0x0c) & 0x03;
173      term2_analog_select = (data >> 12) & 3;
174174
175   williams_adpcm_reset_w((~data & 0x100) >> 1);
175176   williams_adpcm_data_w(data);
176177}
177178
r1490r1491
330331}
331332
332333
334
333335/*************************************
334336 *
335337 *  Y-unit init (CVSD)
r1490r1491
563565
564566         case SOUND_CVSD_SMALL:
565567         case SOUND_CVSD:
568            williams_cvsd_reset_w((~data & 0x100) >> 8);
566569            williams_cvsd_data_w((data & 0xff) | ((data & 0x200) >> 1));
567570            break;
568571
569572         case SOUND_ADPCM:
573            williams_adpcm_reset_w((~data & 0x100) >> 8);
570574            williams_adpcm_data_w(data);
571575            break;
572576
src/mame/machine/stvcd.c
r1490r1491
12371237            cr3 = cr4 = 0;
12381238
12391239            // first 4 bytes = FAD
1240            finfbuf[0] =   (curdir[temp].firstfad>>24)&0xff;
1240            finfbuf[0] = (curdir[temp].firstfad>>24)&0xff;
12411241            finfbuf[1] = (curdir[temp].firstfad>>16)&0xff;
12421242            finfbuf[2] = (curdir[temp].firstfad>>8)&0xff;
12431243            finfbuf[3] = (curdir[temp].firstfad&0xff);
r1490r1491
15571557      free((void *)curdir);
15581558      curdir = (direntryT *)NULL;
15591559   }
1560
1561   if (cdrom)
1562   {
1563      cdrom_close(cdrom);
1564      cdrom = (cdrom_file *)NULL;
1565   }
15601566}
15611567
15621568static void cd_readTOC(void)
src/mame/machine/dc.c
r1490r1491
77#include "mamecore.h"
88#include "driver.h"
99#include "dc.h"
10#include "cpu/sh4/sh4.h"
1011
1112#define DEBUG_REGISTERS   (1)
1213
r1490r1491
115116   MAPLE_STATUS = 0x21,
116117};
117118
118static UINT32 sysctrl_regs[0x200/4];
119UINT32 sysctrl_regs[0x200/4];
119120static UINT32 maple_regs[0x100/4];
121static UINT32 dc_rtcregister[4];
120122
123static UINT32 maple0x82answer[]=
124{
125   0x07200083,0x2d353133,0x39343136,0x20202020,0x59504f43,0x48474952,0x45532054,0x45204147,
126   0x05200083,0x5245544e,0x53495250,0x43205345,0x544c2c4f,0x20202e44,0x38393931,0x5c525043
127};
128
121129// register decode helper
122130
123131INLINE int decode_reg_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift)
r1490r1491
126134
127135   *shift = 0;
128136
137   // non 32-bit accesses have not yet been seen here, we need to know when they are
138   if ((mem_mask != U64(0x00000000ffffffff)) && (mem_mask != U64(0xffffffff00000000)))
139   {
140      assert_always(0, "Wrong mask!\n");
141   }
142
129143   if (mem_mask == U64(0x00000000ffffffff))
130144   {
131145      reg++;
r1490r1491
135149   return reg;
136150}
137151
138// I/O functions
152int compute_interrupt_level(void)
153{
154   UINT32 ln,lx,le;
139155
156   ln=sysctrl_regs[SB_ISTNRM] & sysctrl_regs[SB_IML6NRM];
157   lx=sysctrl_regs[SB_ISTEXT] & sysctrl_regs[SB_IML6EXT];
158   le=sysctrl_regs[SB_ISTERR] & sysctrl_regs[SB_IML6ERR];
159   if (ln | lx | le)
160   {
161      return 6;
162   }
163
164   ln=sysctrl_regs[SB_ISTNRM] & sysctrl_regs[SB_IML4NRM];
165   lx=sysctrl_regs[SB_ISTEXT] & sysctrl_regs[SB_IML4EXT];
166   le=sysctrl_regs[SB_ISTERR] & sysctrl_regs[SB_IML4ERR];
167   if (ln | lx | le)
168   {
169      return 4;
170   }
171
172   ln=sysctrl_regs[SB_ISTNRM] & sysctrl_regs[SB_IML2NRM];
173   lx=sysctrl_regs[SB_ISTEXT] & sysctrl_regs[SB_IML2EXT];
174   le=sysctrl_regs[SB_ISTERR] & sysctrl_regs[SB_IML2ERR];
175   if (ln | lx | le)
176   {
177      return 2;
178   }
179
180   return 0;
181}
182
183void update_interrupt_status(void)
184{
185int level;
186
187   if (sysctrl_regs[SB_ISTERR])
188   {
189      sysctrl_regs[SB_ISTNRM] |= 0x80000000;
190   }
191   else
192   {
193      sysctrl_regs[SB_ISTNRM] &= 0x7fffffff;
194   }
195
196   if (sysctrl_regs[SB_ISTEXT])
197   {
198      sysctrl_regs[SB_ISTNRM] |= 0x40000000;
199   }
200   else
201   {
202      sysctrl_regs[SB_ISTNRM] &= 0xbfffffff;
203   }
204
205   level=compute_interrupt_level();
206   cpunum_set_info_int(0,CPUINFO_INT_SH4_IRLn_INPUT,15-level);
207}
208
140209READ64_HANDLER( dc_sysctrl_r )
141210{
142211   int reg;
r1490r1491
145214   reg = decode_reg_64(offset, mem_mask, &shift);
146215
147216   #if DEBUG_SYSCTRL
148   mame_printf_verbose("SYSCTRL: read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, activecpu_get_pc());
217   if ((reg != 0x40) && (reg != 0x42))   // filter out IRQ status reads
218   {
219      mame_printf_verbose("SYSCTRL: read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, activecpu_get_pc());
220   }
149221   #endif
150222
151223   return (UINT64)sysctrl_regs[reg] << shift;
r1490r1491
155227{
156228   int reg;
157229   UINT64 shift;
230   UINT32 old,dat;
231   struct sh4_ddt_dma ddtdata;
158232
159233   reg = decode_reg_64(offset, mem_mask, &shift);
234   dat = (UINT32)(data >> shift);
235   old = sysctrl_regs[reg];
236   sysctrl_regs[reg] = dat; // 5f6800+off*4=dat
237   switch (reg)
238   {
239      case SB_C2DST:
240         ddtdata.destination=sysctrl_regs[SB_C2DSTAT];
241         ddtdata.length=sysctrl_regs[SB_C2DLEN];
242         ddtdata.size=1;
243         ddtdata.direction=0;
244         ddtdata.channel=2;
245         ddtdata.mode=25; //011001
246         cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata);
247         sysctrl_regs[SB_C2DSTAT]=sysctrl_regs[SB_C2DSTAT]+ddtdata.length;
248         sysctrl_regs[SB_C2DLEN]=0;
249         sysctrl_regs[SB_C2DST]=0;
250         sysctrl_regs[SB_ISTNRM] |= (1 << 19);
251         break;
160252
253      case SB_ISTNRM:
254         sysctrl_regs[SB_ISTNRM] = old & ~(dat | 0xC0000000); // bits 31,30 ro
255         break;
256
257      case SB_ISTEXT:
258         sysctrl_regs[SB_ISTEXT] = old;
259         break;
260
261      case SB_ISTERR:
262         sysctrl_regs[SB_ISTERR] = old & ~dat;
263         break;
264   }
265   update_interrupt_status();
266
161267   #if DEBUG_SYSCTRL
162   mame_printf_verbose("SYSCTRL: write %llx to %x (reg %x: %s), mask %llx\n", data>>shift, offset, reg, sysctrl_names[reg], mem_mask);
268   if ((reg != 0x40) && (reg != 0x42))   // filter out IRQ acks
269   {
270      mame_printf_verbose("SYSCTRL: write %llx to %x (reg %x: %s), mask %llx\n", data>>shift, offset, reg, sysctrl_names[reg], mem_mask);
271   }
163272   #endif
164
165   sysctrl_regs[reg] |= data >> shift;
166273}
167274
168275READ64_HANDLER( dc_maple_r )
r1490r1491
179286{
180287   int reg;
181288   UINT64 shift;
289   UINT32 old,dat;
290   struct sh4_ddt_dma ddtdata;
291   UINT32 buff[512];
292   UINT32 endflag,port,pattern,length,command,dap,sap,destination;
293   int chk;
294   int a;
182295
183296   reg = decode_reg_64(offset, mem_mask, &shift);
297   dat = (UINT32)(data >> shift);
298   old = maple_regs[reg];
184299
185300   #if DEBUG_MAPLE
186301   mame_printf_verbose("MAPLE: write %llx to %x (reg %x: %s), mask %llx\n", data >> shift, offset, reg, maple_names[reg], mem_mask);
187302   #endif
188303
189   maple_regs[reg] |= data >> shift;
304   maple_regs[reg] = dat; // 5f6c00+reg*4=dat
305   switch (reg)
306   {
307   case SB_MDST:
308      maple_regs[reg] = old;
309      if (!(old & 1) && (dat & 1)) // 0 -> 1
310      {
311         if (!(maple_regs[SB_MDTSEL] & 1))
312         {
313            maple_regs[reg] = 1;
314            dat=maple_regs[SB_MDSTAR];
315            while (1) // do transfers
316            {
317               ddtdata.source=dat;
318               ddtdata.length=3;
319               ddtdata.size=4;
320               ddtdata.buffer=buff;
321               ddtdata.direction=0;
322               ddtdata.channel= -1;
323               ddtdata.mode= -1;
324               cpunum_set_info_ptr(0, CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata);
325
326               maple_regs[reg] = 0;
327               endflag=buff[0] & 0x80000000;
328               port=(buff[0] >> 16) & 3;
329               pattern=(buff[0] >> 8) & 7;
330               length=buff[0] & 255;
331               destination=buff[1];
332               command=buff[2] & 255;
333               dap=(buff[2] >> 8) & 255;
334               sap=(buff[2] >> 16) & 255;
335               buff[0]=0;
336               ddtdata.size=4;
337
338               if (pattern == 0)
339               {
340                  switch (command)
341                  {
342                     case 1:
343                        ddtdata.length=1;
344                        break;
345                     case 3:
346                        ddtdata.length=1;
347                        break;
348                     case 0x80: // compute checksum
349                        ddtdata.length=length;
350                        ddtdata.direction=0;
351                        ddtdata.channel= -1;
352                        ddtdata.mode=-1;
353                        cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata);
354                        chk=0;
355                        for (a=1;a < length;a++)
356                        {
357                           chk=chk+(signed char)(buff[a] & 255);
358                           chk=chk+(signed char)((buff[a] >> 8) & 255);
359                           chk=chk+(signed char)((buff[a] >> 16) & 255);
360                           chk=chk+(signed char)((buff[a] >> 24) & 255);
361                        }
362                        chk=chk+(buff[0] & 255);
363                        chk=chk+((buff[0] >> 8) & 255);
364                        chk=chk+((buff[0] >> 16) & 255);
365                        chk=chk+((buff[0] >> 24) & 255);
366                        buff[1]=chk;
367                        ddtdata.length=2;
368                        break;
369                     case 0x82: // get license string
370                        for (a=0;a < 16;a++)
371                        {
372                           buff[a]=maple0x82answer[a];
373                        }
374                        ddtdata.length=16;
375                        break;
376                     case 0x86:
377                        ddtdata.length=length;
378                        ddtdata.direction=0;
379                        ddtdata.channel= -1;
380                        ddtdata.mode=-1;
381                        cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata);
382
383                        if ((buff[0] & 0xff) == 3)
384                        {
385                           buff[1]=0x14131211;
386                           for (a=0;a < 31;a++)
387                           {
388                              buff[2+a]=buff[1+a]+0x04040404;
389                           }
390                           buff[1]=0x1413b1b9; // put checksum
391                           buff[5]=0x8ab82221; // put checksum
392                           ddtdata.length=0x84/4;
393                        }
394                        else if (((buff[0] & 0xff) == 0x31) || ((buff[0] & 0xff) == 0xb) || ((buff[0] & 0xff) == 0x1))
395                        {
396                           ddtdata.length=1;
397                        }
398                        else if ((buff[0] & 0xff) == 0x17) // send command into jvs serial bus !!!
399                        {
400                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,ff,2,f0,d9, 0
401                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,ff,2,f1,01, 0
402                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,01,1,10,    01,0
403                           switch (buff[2] & 0xff) // jvs command
404                           {
405                              case 0xf0:
406                              case 0xf1:
407                              case 0x10:
408                                 break;
409                           }
410                           buff[1]=0xe4e3e2e1;
411                           ddtdata.length=2;
412                        }
413                        else if ((buff[0] & 0xff) == 0x15)
414                        {
415                           // 15,0,0,0
416                           buff[1]=0xA4A3A2A1;
417                           for (a=0;a < 7;a++)
418                           {
419                              buff[2+a]=buff[1+a]+0x04040404;
420                           }
421                           buff[1]=buff[1] | 0x0c000000;
422                           buff[2]=buff[2] & 0xFFCFFFFF;
423
424                           a=readinputport(0); // mettere qui tasti
425                           buff[2]=buff[2] | (a << 20);
426                           *(((unsigned char *)buff)+0x18)=0;
427                           *(((unsigned char *)buff)+0x1d)=1;
428                           *(((unsigned char *)buff)+0x16)=0x8e;
429                           ddtdata.length=9;
430                        }
431                        else if ((buff[0] & 0xff) == 0x21)
432                        {
433                           // 21,*c295407 (77),*c295404,*c295405,*c295406,0,1,0
434                           ddtdata.length=1;
435                        }
436                        else //0x27
437                        {
438                           ddtdata.length=1;
439                        }
440                        break;
441                  }
442               }
443               ddtdata.destination=destination;
444               ddtdata.buffer=buff;
445               ddtdata.direction=1;
446               cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata);
447
448               if (endflag)
449               {
450                  break;
451               }
452               // skip fixed packet header
453               dat += 8;
454               // skip transfer data
455               dat += ((command & 0xff) + 1) * 4;
456            } // do transfers
457            maple_regs[reg] = 0;
458         }
459      }
460      break;
461   }
462#if DEBUG_MAPLE
463   mame_printf_verbose("MAPLE: write %llx to %x, mask %llx\n", data, offset, mem_mask);
464#endif
190465}
191466
192467READ64_HANDLER( dc_gdrom_r )
193468{
469   UINT32 off;
470
471   if ((int)mem_mask & 1)
472   {
473      off=(offset << 1) | 1;
474   }
475   else
476   {
477      off=offset << 1;
478   }
479
480   if (off*4 == 0x4c)
481      return -1;
482   if (off*4 == 8)
483      return 0;
484
194485   return 0;
195486}
196487
197488WRITE64_HANDLER( dc_gdrom_w )
198489{
490   UINT32 dat,off;
491
492   if ((int)mem_mask & 1)
493   {
494      dat=(UINT32)(data >> 32);
495      off=(offset << 1) | 1;
496   }
497   else
498   {
499      dat=(UINT32)data;
500      off=offset << 1;
501   }
502
199503   mame_printf_verbose("GDROM: write %llx to %x, mask %llx\n", data, offset, mem_mask);
200504}
201505
r1490r1491
236540
237541WRITE64_HANDLER( dc_rtc_w )
238542{
543UINT32 dat,off;
544UINT32 old;
545
546   if ((int)mem_mask & 1) {
547      dat=(UINT32)(data >> 32);
548      off=(offset << 1) | 1;
549   } else {
550      dat=(UINT32)data;
551      off=offset << 1;
552   }
553   old = dc_rtcregister[off];
554   dc_rtcregister[off] = dat & 0xFFFF; // 5f6c00+off*4=dat
555/*  switch (off)
556    {
557    case RTC1:
558        if (dc_rtcregister[RTC3])
559            dc_rtcregister[RTC3] = 0;
560        else
561            dc_rtcregister[off] = old;
562        break;
563    case RTC2:
564        if (dc_rtcregister[RTC3] == 0)
565            dc_rtcregister[off] = old;
566        break;
567    case RTC3:
568        dc_rtcregister[RTC3] &= 1;
569        break;
570    }*/
239571   mame_printf_verbose("RTC: write %llx to %x, mask %llx\n", data, offset, mem_mask);
240572}
241573
242READ64_HANDLER( dc_aica_reg_r )
574/*static void dc_rtc_increment(void)
243575{
244   return 0;
245}
576    dc_rtcregister[RTC2] = (dc_rtcregister[RTC2] + 1) & 0xFFFF;
577    if (dc_rtcregister[RTC2] == 0)
578        dc_rtcregister[RTC1] = (dc_rtcregister[RTC1] + 1) & 0xFFFF;
579}*/
246580
247WRITE64_HANDLER( dc_aica_reg_w )
248{
249   mame_printf_verbose("AICA REG: write %llx to %x, mask %llx\n", data, offset, mem_mask);
250}
251
252581MACHINE_RESET( dc )
253582{
254583   /* halt the ARM7 */
r1490r1491
256585
257586   memset(sysctrl_regs, 0, sizeof(sysctrl_regs));
258587   memset(maple_regs, 0, sizeof(maple_regs));
588   memset(dc_rtcregister, 0, sizeof(dc_rtcregister));
259589
260   sysctrl_regs[0x27] = 0x00000008;   // Naomi BIOS requires at least this version
590   sysctrl_regs[SB_SBREV] = 0x0b;
261591}
262592
263// called at vblank
264void dc_vblank( void )
593READ64_HANDLER( dc_aica_reg_r )
265594{
266   // is system control set for automatic polling on VBL?
267   if ((maple_regs[MAPLE_SYSCTRL] & 0xffff0000) == 0x3a980000)
268   {
269      // is enabled?
270      if (maple_regs[MAPLE_DMAENABLE] == 1)
271      {
272         // is started?
273         if (maple_regs[MAPLE_DMASTART] == 1)
274         {
275            UINT32 cmd, dest, addr = maple_regs[MAPLE_DMACMD];
595   int reg;
596   UINT64 shift;
276597
277            // process the command list
278            // first word: bit 31 set = last command in list, 16-17 = port, 8-10 = pattern, 0-7 = xfer length
279            // second word: destination address
280            // third word: what to send to port A
281            cmd = 0;
282            while (!(cmd & 0x80000000))
283            {
284               // read command word
285               cmd = program_read_dword(addr);
598   reg = decode_reg_64(offset, mem_mask, &shift);
286599
287               dest = program_read_dword(addr+4);
600//  logerror("dc_aica_reg_r:  Unmapped read %08x\n", 0x700000+reg*4);
601   return 0;
602}
288603
289               // just indicate "no connection" for now
290               program_write_dword(dest, 0);
291               program_write_dword(dest+4, 0xffffffff);
604WRITE64_HANDLER( dc_aica_reg_w )
605{
606   int reg;
607   UINT64 shift;
608   UINT32 dat;
292609
293               // skip fixed packet header
294               addr += 8;
295               // skip transfer data
296               addr += ((cmd & 0xff) + 1) * 4;
297            }
610   reg = decode_reg_64(offset, mem_mask, &shift);
611   dat = (UINT32)(data >> shift);
298612
299
300            #if DEBUG_MAPLE
301            mame_printf_verbose("MAPLE: automatic read, table @ %x\n", addr);
302            #endif
303
304            // indicate transfer completed
305            maple_regs[MAPLE_DMASTART] = 0;
306         }
613   if (reg == (0x2c00/4))
614   {
615      if (dat & 1)
616      {
617         /* halt the ARM7 */
618         cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE);
307619      }
308   }
620      else
621      {
622         /* it's alive ! */
623         cpunum_set_input_line(1, INPUT_LINE_RESET, CLEAR_LINE);
624      }
625        }
626   mame_printf_verbose("AICA REG: write %llx to %x, mask %llx\n", data, offset, mem_mask);
309627}
310
src/mame/machine/fddebug.c
r1490r1491
44
55    FD1094 decryption helper routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/mame/machine/buggychl.c
r1490r1491
33
44
55static UINT8 from_main,from_mcu;
6static int mcu_sent = 0,main_sent = 0;
6static int mcu_sent,main_sent;
77
8MACHINE_RESET( buggychl )
9{
10   mcu_sent = 0;
11   main_sent = 0;
12   cpunum_set_input_line(2,0,CLEAR_LINE);
13}
814
15
916/***************************************************************************
1017
1118 Buggy CHallenge 68705 protection interface
src/mame/machine/mc8123.c
r1490r1491
6262317-0042 Opa Opa                                      B31FD0  1C00
6363317-0043 Wonder Boy Monster Land                      640708  1C00
6464317-0054 Shinobi (sound CPU)       NEC MC-8123B 652   088992  1800
65317-0057 Fantasy Zone 2                               ADFACE    1800
65317-0057 Fantasy Zone 2                               ADFACE  1800
6666317-0064 Ufo Senshi Yohko Chan                        880603  1C00
6767317-0066 Altered Beast (sound CPU)                    ED8600  1800
6868317-5012 Ganbare Chinsan Ooshoubu  NEC MC-8123A       804B54  1C00
r1490r1491
7777
7878static int decrypt_type0(int val,int param,int swap)
7979{
80   int a = val;
80   if (swap == 0) val = BITSWAP8(val,7,5,3,1,2,0,6,4);
81   if (swap == 1) val = BITSWAP8(val,5,3,7,2,1,0,4,6);
82   if (swap == 2) val = BITSWAP8(val,0,3,4,6,7,1,5,2);
83   if (swap == 3) val = BITSWAP8(val,0,7,3,2,6,4,1,5);
8184
82   if (swap == 1) a = BITSWAP8(a,5,4,3,6,7,1,2,0);
83   if (swap == 2) a = BITSWAP8(a,0,5,3,2,4,7,6,1);
84   if (swap == 3) a = BITSWAP8(a,0,1,7,5,3,6,2,4);
85   if (BIT(param,3) && BIT(val,7))
86      val ^= (1<<5)|(1<<3)|(1<<0);
8587
86   val = 0x1c;
87   if (BIT(a,0)) val ^= 0x23;
88   if (BIT(a,1)) val ^= 0x08;
89   if (BIT(a,2)) val ^= 0x04;
90   if (BIT(a,3)) val ^= 0x20;
91   if (BIT(a,4)) val ^= 0x01;
92   if (BIT(a,6)) val ^= 0x10;
93   if (BIT(a,5))
94   {
95      val ^= 0x73;
88   if (BIT(param,2) && BIT(val,6))
89      val ^= (1<<7)|(1<<2)|(1<<1);
9690
97      if (param & 0x40)
98      {
99         val ^= 0xb3;
100         if (param & 0x01) val ^= 0x40;
101         if (param & 0x04) val ^= 0x40;
102         if (param & 0x08) val ^= 0x40;
103      }
104      if (~param & 0x02)
105      {
106         val ^= 0xb3;
107         if (param & 0x01) val ^= 0x40;
108         if (param & 0x04) val ^= 0x40;
109         if (param & 0x08) val ^= 0x40;
110      }
111      if (param & 0x01)
112      {
113         val ^= 0xb3;
114         if (param & 0x01) val ^= 0x40;
115         if (param & 0x04) val ^= 0x40;
116         if (param & 0x08) val ^= 0x40;
117      }
118   }
91   if (BIT(val,6)) val ^= (1<<7);
11992
120   if (BIT(a,7))
121   {
122      val ^= 0x80;
93   if (BIT(param,1) && BIT(val,7))
94      val ^= (1<<6);
12395
124      if (param & 0x01) val ^= 0x40;
125      if (param & 0x02) val ^= 0x25;
126      if (param & 0x04) val ^= 0x40;
127      if (param & 0x08) val ^= 0x40;
128      if (param & 0x40) val ^= 0x25;
129      if (param & 0x80) val ^= 0x25;
130   }
96   if (BIT(val,2)) val ^= (1<<5)|(1<<0);
13197
132   if (param & 0x01) val ^= 0xe3;
133   if (param & 0x02) val ^= 0x23;
134   if (param & 0x04) val ^= 0xc0;
135   if (param & 0x08) val ^= 0xc0;
136   if (param & 0x40) val ^= 0x23;
98   val ^= (1<<4)|(1<<3)|(1<<1);
13799
138   if (param & 0x01)
139      val ^= 0x21;
140   else
141      val = BITSWAP8(val,7,6,5,3,2,1,4,0);
100   if (BIT(param,2)) val ^= (1<<5)|(1<<2)|(1<<0);
101   if (BIT(param,1)) val ^= (1<<7)|(1<<6);
102   if (BIT(param,0)) val ^= (1<<5)|(1<<0);
142103
104   if (BIT(param,0)) val = BITSWAP8(val,7,6,5,1,4,3,2,0);
105
143106   return val;
144107}
145108
146static int decrypt_type1(int val,int param,int swap)
109
110static int decrypt_type1a(int val,int param,int swap)
147111{
148   if (BIT(~param,2) ^ BIT(param,0))
149   {
150      int a = val;
112   if (swap == 0) val = BITSWAP8(val,4,2,6,5,3,7,1,0);
113   if (swap == 1) val = BITSWAP8(val,6,0,5,4,3,2,1,7);
114   if (swap == 2) val = BITSWAP8(val,2,3,6,1,4,0,7,5);
115   if (swap == 3) val = BITSWAP8(val,6,5,1,3,2,7,0,4);
151116
152      if (swap == 0) a = BITSWAP8(a,7,4,2,0,5,3,6,1);
153      if (swap == 1) a = BITSWAP8(a,2,6,0,7,4,3,5,1);
154      if (swap == 2) a = BITSWAP8(a,0,2,3,5,1,4,6,7);
117   if (BIT(param,2)) val = BITSWAP8(val,7,6,1,5,3,2,4,0);
155118
156      if (BIT(~param,6) ^ BIT(param,1) ^ BIT(param,0))
157         a = BITSWAP8(a,7,6,5,4,0,2,3,1);
119   if (BIT(val,1)) val ^= (1<<0);
120   if (BIT(val,6)) val ^= (1<<3);
121   if (BIT(val,7)) val ^= (1<<6)|(1<<3);
122   if (BIT(val,2)) val ^= (1<<6)|(1<<3)|(1<<1);
123   if (BIT(val,4)) val ^= (1<<7)|(1<<6)|(1<<2);
158124
159      val = 0x4b;
160      if (BIT(a,0)) val ^= 0x20;
161      if (BIT(a,1)) val ^= 0xd4;
162      if (BIT(a,2)) val ^= 0x08;
163      if (BIT(a,3)) val ^= 0x03;
164      if (BIT(a,4)) val ^= 0x01;
165      if (BIT(a,5)) val ^= 0x48;
166      if (BIT(a,6)) val ^= 0xd8;
167      if (BIT(a,7)) val ^= 0x5e;
125   if (BIT(val,7) ^ BIT(val,2))
126      val ^= (1<<4);
168127
169      if (param & 0x01) val ^= 0x48;
170      if (param & 0x02) val ^= 0x84;
171      if (param & 0x04) val ^= 0x48;
172      if (param & 0x08) val ^= 0x48;
173      if (param & 0x40) val ^= 0x84;
174      if (param & 0x80) val ^= 0x84;
128   val ^= (1<<6)|(1<<3)|(1<<1)|(1<<0);
175129
176      if (param & 0x01) val = BITSWAP8(val,7,6,1,4,3,2,5,0);
130   if (BIT(param,3)) val ^= (1<<7)|(1<<2);
131   if (BIT(param,1)) val ^= (1<<6)|(1<<3);
177132
178      return val;
179   }
180   else
181   {
182      int a = val;
133   if (BIT(param,0)) val = BITSWAP8(val,7,6,1,4,3,2,5,0);
183134
184      if (swap == 1) a = BITSWAP8(a,3,4,7,6,5,1,2,0);
185      if (swap == 2) a = BITSWAP8(a,3,5,0,1,7,2,6,4);
186      if (swap == 3) a = BITSWAP8(a,4,2,0,5,3,6,7,1);
135   return val;
136}
187137
188      val = 0x51;
189      if (BIT(a,0)) val ^= 0x42;
190      if (BIT(a,1)) val ^= 0x84;
191      if (BIT(a,2)) val ^= 0x70;
192      if (BIT(a,3)) val ^= 0xa4;
193      if (BIT(a,4)) val ^= 0x22;
194      if (BIT(a,5)) val ^= 0xcf;
195      if (BIT(a,6)) val ^= 0x04;
196      if (BIT(a,7)) val ^= 0x47;
138static int decrypt_type1b(int val,int param,int swap)
139{
140   if (swap == 0) val = BITSWAP8(val,1,0,3,2,5,6,4,7);
141   if (swap == 1) val = BITSWAP8(val,2,0,5,1,7,4,6,3);
142   if (swap == 2) val = BITSWAP8(val,6,4,7,2,0,5,1,3);
143   if (swap == 3) val = BITSWAP8(val,7,1,3,6,0,2,5,4);
197144
198      if (BIT(a,7) && BIT(a,6))
199         val ^= 0xf4;
145   if (BIT(val,2) && BIT(val,0))
146      val ^= (1<<7)|(1<<4);
200147
201      if (param & 0x01) val ^= 0x96;
202      if (param & 0x02) val ^= 0xdb;
203      if (param & 0x04) val ^= 0x18;
204      if (param & 0x08) val ^= 0x18;
205      if (param & 0x40) val ^= 0xdb;
206      if (param & 0x80) val ^= 0x12;
148   if (BIT(val,7)) val ^= (1<<2);
149   if (BIT(val,5)) val ^= (1<<7)|(1<<2);
150   if (BIT(val,1)) val ^= (1<<5);
151   if (BIT(val,6)) val ^= (1<<1);
152   if (BIT(val,4)) val ^= (1<<6)|(1<<5);
153   if (BIT(val,0)) val ^= (1<<6)|(1<<2)|(1<<1);
154   if (BIT(val,3)) val ^= (1<<7)|(1<<6)|(1<<2)|(1<<1)|(1<<0);
207155
208      return val;
209   }
156   val ^= (1<<6)|(1<<4)|(1<<0);
157
158   if (BIT(param,3)) val ^= (1<<4)|(1<<1);
159   if (BIT(param,2)) val ^= (1<<7)|(1<<6)|(1<<3)|(1<<0);
160   if (BIT(param,1)) val ^= (1<<4)|(1<<3);
161   if (BIT(param,0)) val ^= (1<<6)|(1<<2)|(1<<1)|(1<<0);
162
163   return val;
210164}
211165
212static int decrypt_type2(int val,int param,int swap)
166static int decrypt_type2a(int val,int param,int swap)
213167{
214   if (BIT(~param,2) ^ BIT(param,0))
215   {
216      int a = val;
168   if (swap == 0) val = BITSWAP8(val,0,1,4,3,5,6,2,7);
169   if (swap == 1) val = BITSWAP8(val,6,3,0,5,7,4,1,2);
170   if (swap == 2) val = BITSWAP8(val,1,6,4,5,0,3,7,2);
171   if (swap == 3) val = BITSWAP8(val,4,6,7,5,2,3,1,0);
217172
218      if (swap == 1) a = BITSWAP8(a,2,4,7,0,5,1,3,6);
219      if (swap == 2) a = BITSWAP8(a,2,3,0,4,5,7,6,1);
220      if (swap == 3) a = BITSWAP8(a,0,3,2,7,5,1,6,4);
173   if (BIT(val,3) || (BIT(param,1) && BIT(val,2)))
174      val = BITSWAP8(val,6,0,7,4,3,2,1,5);
221175
222      val = 0xea;
223      if (BIT(a,0)) val ^= 0xa0;
224      if (BIT(a,1)) val ^= 0x80;
225      if (BIT(a,2)) val ^= 0x18;
226      if (BIT(a,3)) val ^= 0x07;
227      if (BIT(a,4)) val ^= 0x41;
228      if (BIT(a,5)) val ^= 0x04;
229      if (BIT(a,6)) val ^= 0x10;
230      if (BIT(a,7)) val ^= 0x60;
176   if (BIT(val,5)) val ^= (1<<7);
177   if (BIT(val,6)) val ^= (1<<5);
178   if (BIT(val,0)) val ^= (1<<6);
179   if (BIT(val,4)) val ^= (1<<3)|(1<<0);
180   if (BIT(val,1)) val ^= (1<<2);
231181
232      if (!BIT(a,5) && ((~param & 0x08) || !BIT(a,6)))
233      {
234         if (BIT(a,0)) val ^= 0x20;
235         if (BIT(a,7)) val ^= 0x21;
236         if (BIT(a,1)) val ^= 0xe0;
237         if (BIT(a,4)) val ^= 0xe1;
238      }
182   val ^= (1<<7)|(1<<6)|(1<<5)|(1<<4)|(1<<1);
239183
240      if (param & 0x01) val ^= 0x1f;
241      if (param & 0x02) val ^= 0x1f;
242      if (param & 0x40) val ^= 0x1f;
184   if (BIT(param,2)) val ^= (1<<4)|(1<<3)|(1<<2)|(1<<1)|(1<<0);
243185
244      if (BIT(param,6) ^ BIT(param,1) ^ BIT(param,7))
245      {
246         if (param & 0x01)
247            val = BITSWAP8(val,7,6,5,2,1,3,4,0);
248         else
249            val = BITSWAP8(val,7,6,5,3,4,1,2,0);
250      }
186   if (BIT(param,3))
187   {
188      if (BIT(param,0))
189         val = BITSWAP8(val,7,6,5,3,4,1,2,0);
251190      else
252      {
253         if (~param & 0x01)
254            val = BITSWAP8(val,7,6,5,1,2,4,3,0);
255      }
256
257      return val;
191         val = BITSWAP8(val,7,6,5,1,2,4,3,0);
258192   }
259193   else
260194   {
261      // only 0x20 possible encryptions for this method - all others have 0x40
195      if (BIT(param,0))
196         val = BITSWAP8(val,7,6,5,2,1,3,4,0);
197   }
262198
263      int a = val;
199   return val;
200}
264201
265      if (swap == 1) a = BITSWAP8(a,3,4,7,5,1,6,0,2);
266      if (swap == 2) a = BITSWAP8(a,2,1,6,4,5,7,3,0);
267      if (swap == 3) a = BITSWAP8(a,7,0,4,3,2,1,5,6);
202static int decrypt_type2b(int val,int param,int swap)
203{
204   // only 0x20 possible encryptions for this method - all others have 0x40
205   // this happens because BIT(param,2) cancels the other three
268206
269      val = 0x0e;
270      if (BIT(a,0)) val ^= 0x33;
271      if (BIT(a,1)) val ^= 0x8e;
272      if (BIT(a,2)) val ^= 0x01;
273      if (BIT(a,3)) val ^= 0xe0;
274      if (BIT(a,4)) val ^= 0x5b;
275      if (BIT(a,5)) val ^= 0xea;
276      if (BIT(a,6)) val ^= 0x58;
277      if (BIT(a,7)) val ^= 0x0e;
207   if (swap == 0) val = BITSWAP8(val,1,3,4,6,5,7,0,2);
208   if (swap == 1) val = BITSWAP8(val,0,1,5,4,7,3,2,6);
209   if (swap == 2) val = BITSWAP8(val,3,5,4,1,6,2,0,7);
210   if (swap == 3) val = BITSWAP8(val,5,2,3,0,4,7,6,1);
278211
279      if (BIT(a,1) && BIT(a,5))
280         val ^= 0xa8;
212   if (BIT(val,7) && BIT(val,3))
213      val ^= (1<<6)|(1<<4)|(1<<0);
281214
282      if (BIT(a,6))
283      {
284         if (BIT(a,0) ^ BIT(a,4) ^ BIT(a,1))
285            val ^= 0x11;
286      }
287      if (BIT(a,1))
288      {
289         if (!BIT(a,5))
290         {
291            if (BIT(a,0) ^ BIT(a,4))
292               val ^= 0x11;
293         }
294      }
215   if (BIT(val,7)) val ^= (1<<2);
216   if (BIT(val,5)) val ^= (1<<7)|(1<<3);
217   if (BIT(val,1)) val ^= (1<<5);
218   if (BIT(val,4)) val ^= (1<<7)|(1<<5)|(1<<3)|(1<<1);
295219
296      if (param & 0x01) val ^= 0xca;
297      if (param & 0x02) val ^= 0xa4;
298      if (param & 0x08) val ^= 0x80;
299      if (param & 0x40) val ^= 0xa4;
300      if (param & 0x80) val ^= 0x4a;
220   if (BIT(val,7) && BIT(val,5))
221      val ^= (1<<4)|(1<<0);
301222
302      return val;
303   }
223   if (BIT(val,5) && BIT(val,1))
224      val ^= (1<<4)|(1<<0);
225
226   if (BIT(val,6)) val ^= (1<<7)|(1<<5);
227   if (BIT(val,3)) val ^= (1<<7)|(1<<6)|(1<<5)|(1<<1);
228   if (BIT(val,2)) val ^= (1<<3)|(1<<1);
229
230   val ^= (1<<7)|(1<<3)|(1<<2)|(1<<1);
231
232   if (BIT(param,3)) val ^= (1<<6)|(1<<3)|(1<<1);
233   if (BIT(param,2)) val ^= (1<<7)|(1<<6)|(1<<5)|(1<<3)|(1<<2)|(1<<1);   // same as the other three combined
234   if (BIT(param,1)) val ^= (1<<7);
235   if (BIT(param,0)) val ^= (1<<5)|(1<<2);
236
237   return val;
304238}
305239
306static int decrypt_type3(int val,int param,int swap)
240static int decrypt_type3a(int val,int param,int swap)
307241{
308   if (BIT(~param,2) ^ BIT(param,0))
309   {
310      int a = val;
242   if (swap == 0) val = BITSWAP8(val,5,3,1,7,0,2,6,4);
243   if (swap == 1) val = BITSWAP8(val,3,1,2,5,4,7,0,6);
244   if (swap == 2) val = BITSWAP8(val,5,6,1,2,7,0,4,3);
245   if (swap == 3) val = BITSWAP8(val,5,6,7,0,4,2,1,3);
311246
312      if (swap == 0) a = BITSWAP8(a,2,4,7,0,5,1,3,6);
313      if (swap == 2) a = BITSWAP8(a,0,3,2,7,5,1,6,4);
314      if (swap == 3) a = BITSWAP8(a,2,3,0,4,5,7,6,1);
247   if (BIT(val,2)) val ^= (1<<7)|(1<<5)|(1<<4);
248   if (BIT(val,3)) val ^= (1<<0);
315249
316      if (BIT(param,6) ^ BIT(param,1) ^ BIT(param,7))
317         a = BITSWAP8(a,7,6,5,4,2,3,1,0);
250   if (BIT(param,0)) val = BITSWAP8(val,7,2,5,4,3,1,0,6);
318251
319      if (BIT(a,4))
320         a = BITSWAP8(a,7,6,5,4,2,3,1,0);
252   if (BIT(val,1)) val ^= (1<<6)|(1<<0);
253   if (BIT(val,3)) val ^= (1<<4)|(1<<2)|(1<<1);
321254
322      val = 0x78;
323      if (BIT(a,2)) val ^= 0x26;
324      if (BIT(a,3)) val ^= 0x80;
325      if (BIT(a,5)) val ^= 0x10;
326      if (param & 0x01)
327      {
328         if (BIT(a,0)) val ^= 0x04;
329         if (BIT(a,1)) val ^= 0x01;
330         if (BIT(a,4)) val ^= 0x5d;
331         if (BIT(a,6)) val ^= 0x43;
332         if (BIT(a,7)) val ^= 0xf6;
333      }
334      else
335      {
336         if (BIT(a,0)) val ^= 0x43;
337         if (BIT(a,1)) val ^= 0x40;
338         if (BIT(a,4)) val ^= 0x1f;
339         if (BIT(a,6)) val ^= 0x01;
340         if (BIT(a,7)) val ^= 0xb2;
341      }
255   if (BIT(param,3)) val ^= (1<<4)|(1<<3);
342256
343      if (param & 0x01) val ^= 0x81;
344      if (param & 0x02) val ^= 0x98;
345      if (param & 0x08) val ^= 0x10;
346      if (param & 0x40) val ^= 0x98;
347      if (param & 0x80) val ^= 0x18;
257   if (BIT(val,3)) val = BITSWAP8(val,5,6,7,4,3,2,1,0);
348258
349      return val;
350   }
351   else
352   {
353      int a = val;
259   if (BIT(val,5)) val ^= (1<<2)|(1<<1);
354260
355      if (swap == 0) a = BITSWAP8(a,3,4,7,5,1,6,0,2);
356      if (swap == 2) a = BITSWAP8(a,7,0,4,3,2,1,5,6);
357      if (swap == 3) a = BITSWAP8(a,2,1,6,4,5,7,3,0);
261   val ^= (1<<6)|(1<<5)|(1<<4)|(1<<3);
358262
359      if (BIT(param,6) ^ BIT(param,1) ^ BIT(param,7))
360      {
361         val = 0xaa;
362         if (param & 0x01) val ^= 0x04;
363         if (param & 0x80) val ^= 0x04;
263   if (BIT(param,2)) val ^= (1<<7);
264   if (BIT(param,1)) val ^= (1<<4);
265   if (BIT(param,0)) val ^= (1<<0);
364266
365         if (BIT(a,0)) val ^= 0xd6;
366         if (BIT(a,1)) val ^= 0x30;
367         if (BIT(a,2)) val ^= 0x11;
368         if (BIT(a,3)) val ^= 0x04;
369         if (BIT(a,4)) val ^= 0x08;
370         if (BIT(a,5)) val ^= 0x42;
371         if (BIT(a,6)) val ^= 0xc6;
372         if (BIT(a,7)) val ^= 0x03;
373      }
374      else
375      {
376         val = 0xac;
377         if (param & 0x01) val ^= 0x01;
378         if (param & 0x80) val ^= 0x01;
267   return val;
268}
379269
380         if (BIT(a,0)) val ^= 0x54;
381         if (BIT(a,1)) val ^= 0x08;
382         if (BIT(a,2)) val ^= 0x82;
383         if (BIT(a,3)) val ^= 0x01;
384         if (BIT(a,4)) val ^= 0x30;
385         if (BIT(a,5)) val ^= 0x40;
386         if (BIT(a,6)) val ^= 0x52;
387         if (BIT(a,7)) val ^= 0x86;
388      }
270static int decrypt_type3b(int val,int param,int swap)
271{
272   if (swap == 0) val = BITSWAP8(val,3,7,5,4,0,6,2,1);
273   if (swap == 1) val = BITSWAP8(val,7,5,4,6,1,2,0,3);
274   if (swap == 2) val = BITSWAP8(val,7,4,3,0,5,1,6,2);
275   if (swap == 3) val = BITSWAP8(val,2,6,4,1,3,7,0,5);
389276
390      if (param & 0x01) val ^= 0x08;
391      if (param & 0x08) val ^= 0x80;
277   if (BIT(val,2)) val ^= (1<<7);
392278
393      if (BIT(a,2) ^ BIT(a,7))
394      {
395         if (BIT(a,4) ^ BIT(a,1))
396            val ^= 0x38;
279   if (BIT(val,7)) val = BITSWAP8(val,7,6,3,4,5,2,1,0);
397280
398         if (BIT(a,0) ^ BIT(a,5) ^ BIT(a,6))
399            val ^= 0x02;
400      }
281   if (BIT(param,3)) val ^= (1<<7);
401282
402      return val;
403   }
404}
283   if (BIT(val,4)) val ^= (1<<6);
284   if (BIT(val,1)) val ^= (1<<6)|(1<<4)|(1<<2);
405285
286   if (BIT(val,7) && BIT(val,6))
287      val ^= (1<<1);
406288
407static int decrypt(int val,int param,int opcode)
289   if (BIT(val,7)) val ^= (1<<1);
290
291   if (BIT(param,3)) val ^= (1<<7);
292   if (BIT(param,2)) val ^= (1<<0);
293
294   if (BIT(param,3)) val = BITSWAP8(val,4,6,3,2,5,0,1,7);
295
296   if (BIT(val,4)) val ^= (1<<1);
297   if (BIT(val,5)) val ^= (1<<4);
298   if (BIT(val,7)) val ^= (1<<2);
299
300   val ^= (1<<5)|(1<<3)|(1<<2);
301
302   if (BIT(param,1)) val ^= (1<<7);
303   if (BIT(param,0)) val ^= (1<<3);
304
305   return val;
306}
307
308static int decrypt(int val, int key, int opcode)
408309{
409310   int type = 0;
410311   int swap = 0;
312   int param = 0;
411313
412   param ^= 0xff;
314   key ^= 0xff;
413315
414316   // no encryption
415   if (param == 0x00)
317   if (key == 0x00)
416318      return val;
417319
418   type ^= BIT(param,0) << 0;
419   type ^= BIT(param,1) << 0;
420   type ^= BIT(param,2) << 0;
421   type ^= BIT(param,4) << 0;
422   type ^= BIT(param,4) << 1;
423   type ^= BIT(param,5) << 1;
320   type ^= BIT(key,0) << 0;
321   type ^= BIT(key,2) << 0;
322   type ^= BIT(key,0) << 1;
323   type ^= BIT(key,1) << 1;
324   type ^= BIT(key,2) << 1;
325   type ^= BIT(key,4) << 1;
326   type ^= BIT(key,4) << 2;
327   type ^= BIT(key,5) << 2;
424328
425   swap ^= BIT(param,0) << 0;
426   swap ^= BIT(param,1) << 0;
427   swap ^= BIT(param,2) << 1;
428   swap ^= BIT(param,3) << 1;
329   swap ^= BIT(key,0) << 0;
330   swap ^= BIT(key,1) << 0;
331   swap ^= BIT(key,2) << 1;
332   swap ^= BIT(key,3) << 1;
429333
334   param ^= BIT(key,0) << 0;
335   param ^= BIT(key,0) << 1;
336   param ^= BIT(key,2) << 1;
337   param ^= BIT(key,3) << 1;
338   param ^= BIT(key,0) << 2;
339   param ^= BIT(key,1) << 2;
340   param ^= BIT(key,6) << 2;
341   param ^= BIT(key,1) << 3;
342   param ^= BIT(key,6) << 3;
343   param ^= BIT(key,7) << 3;
344
430345   if (!opcode)
431346   {
432      param ^= 1<<0;
433      param ^= 1<<1;
434      param ^= 1<<3;
435      param ^= 1<<7;
347      param ^= 1 << 0;
348      type ^= 1 << 0;
436349   }
437350
438351   switch (type)
439352   {
440353      default:
441354      case 0: return decrypt_type0(val,param,swap);
442
443      case 1: return decrypt_type1(val,param,swap);
444
445      case 2: return decrypt_type2(val,param,swap);
446
447      case 3: return decrypt_type3(val,param,swap);
355      case 1: return decrypt_type0(val,param,swap);
356      case 2: return decrypt_type1a(val,param,swap);
357      case 3: return decrypt_type1b(val,param,swap);
358      case 4: return decrypt_type2a(val,param,swap);
359      case 5: return decrypt_type2b(val,param,swap);
360      case 6: return decrypt_type3a(val,param,swap);
361      case 7: return decrypt_type3b(val,param,swap);
448362   }
449363}
450364
src/mame/machine/atarigen.c
r1490r1491
7171
7272static UINT8         atarigen_slapstic_num;
7373static UINT16 *         atarigen_slapstic;
74static UINT32         atarigen_slapstic_bank;
74static UINT8         atarigen_slapstic_bank;
7575static void *         atarigen_slapstic_bank0;
7676
7777static UINT8          sound_cpu_num;
r1490r1491
452452}
453453
454454
455static void slapstic_postload(void)
456{
457   update_bank(slapstic_bank());
458}
459
460
455461/*---------------------------------------------------------------
456462    atarigen_slapstic_init: Installs memory handlers for the
457463    slapstic and sets the chip number.
458464---------------------------------------------------------------*/
459465
460void atarigen_slapstic_init(int cpunum, int base, int chipnum)
466void atarigen_slapstic_init(int cpunum, offs_t base, offs_t mirror, int chipnum)
461467{
468   /* reset in case we have no state */
462469   atarigen_slapstic_num = chipnum;
463470   atarigen_slapstic = NULL;
464471
465472   /* if we have a chip, install it */
466   if (chipnum)
473   if (chipnum != 0)
467474   {
468475      /* initialize the slapstic */
469476      slapstic_init(chipnum);
470477
471478      /* install the memory handlers */
472      atarigen_slapstic = memory_install_read16_handler(cpunum, ADDRESS_SPACE_PROGRAM, base, base + 0x7fff, 0, 0, atarigen_slapstic_r);
473      atarigen_slapstic = memory_install_write16_handler(cpunum, ADDRESS_SPACE_PROGRAM, base, base + 0x7fff, 0, 0, atarigen_slapstic_w);
479      atarigen_slapstic = memory_install_readwrite16_handler(cpunum, ADDRESS_SPACE_PROGRAM, base, base + 0x7fff, 0, mirror, atarigen_slapstic_r, atarigen_slapstic_w);
474480
475481      /* allocate memory for a copy of bank 0 */
476482      atarigen_slapstic_bank0 = auto_malloc(0x2000);
477483      memcpy(atarigen_slapstic_bank0, atarigen_slapstic, 0x2000);
484
485      /* ensure we recopy memory for the bank */
486      atarigen_slapstic_bank = 0xff;
478487   }
479488}
480489
r1490r1491
486495
487496void atarigen_slapstic_reset(void)
488497{
489   if (atarigen_slapstic_num)
498   if (atarigen_slapstic_num != 0)
490499   {
491500      slapstic_reset();
492501      update_bank(slapstic_bank());
r1490r1491
722731   /* reset the sound write state */
723732   atarigen_sound_to_cpu_ready = 0;
724733   atarigen_sound_int_ack_w(0, 0, 0);
734
735   /* allocate a high frequency timer until a response is generated */
736   /* the main CPU is *very* sensistive to the timing of the response */
737   cpu_boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
725738}
726739
727740
r1490r1491
14971510
14981511   state_save_register_global(playfield_latch);
14991512   state_save_register_global(playfield2_latch);
1513
1514   /* need a postload to reset the state */
1515   state_save_register_func_postload(slapstic_postload);
15001516}
src/mame/machine/atarigen.h
r1490r1491
1717    CONSTANTS
1818##########################################################################*/
1919
20#define ATARI_CLOCK_14MHz   14318180
21#define ATARI_CLOCK_20MHz   20000000
22#define ATARI_CLOCK_32MHz   32000000
23#define ATARI_CLOCK_50MHz   50000000
20#define ATARI_CLOCK_14MHz   XTAL_14_31818MHz
21#define ATARI_CLOCK_20MHz   XTAL_20MHz
22#define ATARI_CLOCK_32MHz   XTAL_32MHz
23#define ATARI_CLOCK_50MHz   XTAL_50MHz
2424
2525
2626
r1490r1491
134134    SLAPSTIC HANDLING
135135---------------------------------------------------------------*/
136136
137void atarigen_slapstic_init(int cpunum, int base, int chipnum);
137void atarigen_slapstic_init(int cpunum, offs_t base, offs_t mirror, int chipnum);
138138void atarigen_slapstic_reset(void);
139139
140140WRITE16_HANDLER( atarigen_slapstic_w );
src/mame/machine/tatsumi.c
r1490r1491
352352   int r=YM2151_status_port_0_r(0);
353353
354354   if (activecpu_get_pc()==0x2aca || activecpu_get_pc()==0x29fe
355      || activecpu_get_pc()==0xf9721)
355      || activecpu_get_pc()==0xf9721
356      || activecpu_get_pc()==0x1b96 || activecpu_get_pc()==0x1c65) // BigFight
356357      return 0x80;
357358   return r;
358359}
r1490r1491
365366
366367   if (activecpu_get_pc()==0x2b70 || activecpu_get_pc()==0x2bb5
367368      || activecpu_get_pc()==0x2acc
369      || activecpu_get_pc()==0x1c79 // BigFight
370      || activecpu_get_pc()==0x1cbe // BigFight
368371      || activecpu_get_pc()==0xf9881)
369372      return 0xf;
370   if (activecpu_get_pc()==0x2ba3 || activecpu_get_pc()==0x2a9b || activecpu_get_pc()==0x2adc)
373   if (activecpu_get_pc()==0x2ba3 || activecpu_get_pc()==0x2a9b || activecpu_get_pc()==0x2adc
374      || activecpu_get_pc()==0x1cac) // BigFight
371375      return 0;
372376   return r;
373377}
src/mame/machine/mathbox.c
r1490r1491
11/*
22 * mathbox.c: math box simulation (Battlezone/Red Baron/Tempest)
33 *
4 * Copyright 1991, 1992, 1993, 1996 Eric Smith
4 * Copyright Eric Smith
55 *
66 */
77
src/mame/machine/mathbox.h
r1490r1491
11/*
22 * mathbox.h: math box simulation (Battlezone/Red Baron/Tempest)
33 *
4 * Copyright 1991, 1992, 1993, 1996 Eric Smith
4 * Copyright Eric Smith
55 *
66 */
77
src/mame/machine/starwars.c
r1490r1491
22
33    Atari Star Wars hardware
44
5    This file is Copyright 1997, Steve Baines.
5    This file is Copyright Steve Baines.
66    Modified by Frank Palazzolo for sound support
77
88***************************************************************************/
src/mame/machine/atarifb.c
r1490r1491
4545      if (data & 0x80)
4646      {
4747         /* Invert video */
48         palette_set_color(Machine,2,MAKE_RGB(0x00,0x00,0x00)); /* black  */
48         palette_set_color(Machine,1,MAKE_RGB(0x00,0x00,0x00)); /* black  */
4949         palette_set_color(Machine,0,MAKE_RGB(0xff,0xff,0xff)); /* white  */
5050      }
5151      else
5252      {
5353         /* Regular video */
5454         palette_set_color(Machine,0,MAKE_RGB(0x00,0x00,0x00)); /* black  */
55         palette_set_color(Machine,2,MAKE_RGB(0xff,0xff,0xff)); /* white  */
55         palette_set_color(Machine,1,MAKE_RGB(0xff,0xff,0xff)); /* white  */
5656      }
5757   }
5858}
src/mame/machine/slapstic.c
r1490r1491
252252 *
253253 *************************************/
254254
255enum state_type
255enum
256256{
257257   DISABLED,
258258   ENABLED,
r1490r1491
773773 *
774774 *************************************/
775775
776static enum state_type state;
777static INT8 current_bank;
778static int access_68k;
776static UINT8 state;
777static UINT8 current_bank;
778static UINT8 access_68k;
779779
780static INT8 alt_bank;
781static INT8 bit_bank;
782static INT8 add_bank;
780static UINT8 alt_bank;
781static UINT8 bit_bank;
782static UINT8 add_bank;
783783static UINT8 bit_xor;
784784
785785static struct slapstic_data slapstic;
r1490r1491
817817   /* see if we're 68k or 6502/6809 based */
818818   access_68k = (Machine->drv->cpu[0].type != CPU_M6809 &&
819819              Machine->drv->cpu[0].type != CPU_M6502);
820
821   /* save state */
822   state_save_register_item("slapstic", 0, state);
823   state_save_register_item("slapstic", 0, current_bank);
824   state_save_register_item("slapstic", 0, alt_bank);
825   state_save_register_item("slapstic", 0, bit_bank);
826   state_save_register_item("slapstic", 0, add_bank);
827   state_save_register_item("slapstic", 0, bit_xor);
820828}
821829
822830
src/mame/tiny.c
r1490r1491
44
55    mamedriv.c substitute file for "tiny" MAME builds.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010    The list of used drivers. Drivers have to be included here to be recognized
src/mame/mamedriv.c
r1490r1491
22
33    mamedriv.c
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88    The list of all available drivers. Drivers have to be included here to be
r1490r1491
688688   DRIVER( shadowld )   /* (c) 1987 */
689689   DRIVER( youkaidk )   /* (c) 1987 (Japan new version) */
690690   DRIVER( yokaidko )   /* (c) 1987 (Japan old version) */
691   DRIVER( dspirit )   /* (c) 1987 new version */
692   DRIVER( dspirito )   /* (c) 1987 old version */
691   DRIVER( dspirit )   /* (c) 1987 (Japan new version) */
692   DRIVER( dspirito )   /* (c) 1987 (Japan old version) */
693   DRIVER( dspirita )   /* (c) 1987 (Atari license) */
693694   DRIVER( blazer )   /* (c) 1987 (Japan) */
694695   DRIVER( quester )   /* (c) 1987 (Japan) */
695696   DRIVER( pacmania )   /* (c) 1987 */
r1490r1491
19911992   DRIVER( commandw )   /* prototype */
19921993
19931994   /* Taito JC System */
1994   DRIVER( landgear )   /* E17 (c) 199? Taito Corporation */
1995   DRIVER( dendeg )   /* E35 (c) 199? Taito Corporation */
1996   DRIVER( dendegx )   /* E35 (c) 199? Taito Corporation */
1997   DRIVER( dendeg2 )   /* E52 (c) 199? Taito Corporation */
1998   DRIVER( dendeg2x )   /* E52 (c) 199? Taito Corporation */
1999   DRIVER( sidebs )   /* E23 (c) 199? Taito Corporation */
2000   DRIVER( sidebs2 )   /* E38 (c) 199? Taito Corporation */
1995   DRIVER( landgear )   /* E17 (c) 1995 Taito Corporation */
1996   DRIVER( dendeg )   /* E35 (c) 1996 Taito Corporation */
1997   DRIVER( dendegx )   /* E35 (c) 1996 Taito Corporation */
1998   DRIVER( dendeg2 )   /* E52 (c) 1998 Taito Corporation */
1999   DRIVER( dendeg2x )   /* E52 (c) 1998 Taito Corporation */
2000   DRIVER( sidebs )   /* E23 (c) 1996 Taito Corporation */
2001   DRIVER( sidebs2 )   /* E38 (c) 1997 Taito Corporation */
2002   DRIVER( dangcurv )   /* E09 (c) 1995 Taito Corporation */
20012003
20022004   /* Taito "Wolf" System */
20032005   DRIVER( pf2012 )   /* E59 (c) 1997 Taito */
r1490r1491
60156017   /* Midway Zeus games */
60166018   DRIVER( mk4 )      /* (c) 1997 Midway */
60176019   DRIVER( mk4a )      /* (c) 1997 Midway */
6018   DRIVER( invasn )   /* (c) 1999 Midway */
6020   DRIVER( invasnab )   /* (c) 1999 Midway */
6021   DRIVER( invasnv4 )   /* (c) 1999 Midway */
60196022   DRIVER( crusnexo )   /* (c) 1999 Midway */
60206023   DRIVER( thegrid )   /* (c) 2001 Midway */
60216024
r1490r1491
73137316   DRIVER( hiryuken )   /* (c) 1985 Taito */
73147317
73157318   /* Tatsumi Games */
7316   DRIVER( lockon )   /* (c) 1986 */
7317   DRIVER( apache3 )   /* (c) 1988 */
7318   DRIVER( roundup5 )   /* (c) 1989 */
7319   DRIVER( cyclwarr )   /* (c) 1991 */
7319   DRIVER( tx1 )      /* (c) 1983 Tatsumi */
7320   DRIVER( tx1a )      /* (c) 1983 Tatsumi */
7321   DRIVER( buggyboy )   /* (c) 1985 Tatsumi */
7322   DRIVER( buggybjr )   /* (c) 1986 Tatsumi */
7323   DRIVER( lockon )   /* (c) 1986 Tatsumi */
7324   /* Gray Out */      /* (c) 1987 Tatsumi */
7325   DRIVER( apache3 )   /* (c) 1988 Tatsumi */
7326   DRIVER( roundup5 )   /* (c) 1989 Tatsumi */
7327   DRIVER( cyclwarr )   /* (c) 1991 Tatsumi */
7328   DRIVER( bigfight )   /* (c) 1992 Tatsumi */
73207329
73217330   /* Electronic Devices */
73227331   DRIVER( mugsmash )   /* (c) Electronic Devices (Italy) / 3D Games (England) */
r1490r1491
75017510   DRIVER( mosaic )   /* (c) 1990 Space */
75027511   DRIVER( mosaica )   /* (c) 1990 Space + Fuuki license */
75037512   DRIVER( gfire2 )   /* (c) 1992 Topis Corp */
7504   DRIVER( tx1 )      /* (c) 1983 Tatsumi */
7505   DRIVER( tx1a )      /* (c) 1983 Tatsumi */
7506   DRIVER( buggyboy )   /* (c) 1985 Tatsumi */
7507   DRIVER( buggybjr )   /* (c) 1986 Tatsumi */
75087513   DRIVER( sprcros2 )   /* (c) 1986 GM Shoji */
75097514   DRIVER( sprcrs2a )   /* (c) 1986 GM Shoji */
75107515   DRIVER( gcpinbal )   /* (c) 1994 Excellent System */
src/mame/includes/cubocd32.h
r1490r1491
99
1010/*----------- defined in machine/cubocd32.c -----------*/
1111
12extern void amiga_akiko_init(void);
12extern void amiga_akiko_init(running_machine* machine);
1313extern NVRAM_HANDLER( cd32 );
1414extern READ32_HANDLER(amiga_akiko32_r);
1515extern WRITE32_HANDLER(amiga_akiko32_w);
src/mame/includes/galaxian.h
r1490r1491
235235WRITE8_HANDLER( froggrmc_sh_irqtrigger_w );
236236WRITE8_HANDLER( hotshock_sh_irqtrigger_w );
237237
238MACHINE_DRIVER_EXTERN( ad2083_audio );
238239
src/mame/includes/cvs.h
r0r1491
1extern UINT8 *cvs_color_ram;
2extern UINT8 *cvs_video_ram;
3extern UINT8 *cvs_bullet_ram;
4extern mame_bitmap *cvs_collision_bitmap;
5extern mame_bitmap *cvs_collision_background;
6extern int cvs_collision_register;
7
8
9INTERRUPT_GEN( cvs_interrupt );
10PALETTE_INIT( cvs );
11VIDEO_UPDATE( cvs );
12VIDEO_START( cvs );
13
14READ8_HANDLER( cvs_video_or_color_ram_r );
15WRITE8_HANDLER( cvs_video_or_color_ram_w );
16
17READ8_HANDLER( cvs_bullet_ram_or_palette_r );
18WRITE8_HANDLER( cvs_bullet_ram_or_palette_w );
19
20READ8_HANDLER( cvs_s2636_1_or_character_ram_r );
21WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w );
22READ8_HANDLER( cvs_s2636_2_or_character_ram_r );
23WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w );
24READ8_HANDLER( cvs_s2636_3_or_character_ram_r );
25WRITE8_HANDLER( cvs_s2636_3_or_character_ram_w );
26
27WRITE8_HANDLER( cvs_scroll_w );
28WRITE8_HANDLER( cvs_video_fx_w );
29
30READ8_HANDLER( cvs_collision_r );
31READ8_HANDLER( cvs_collision_clear );
32READ8_HANDLER( cvs_input_r );
src/mame/includes/rampart.h
r1490r1491
77
88/*----------- defined in video/rampart.c -----------*/
99
10WRITE16_HANDLER( rampart_bitmap_w );
11
1210VIDEO_START( rampart );
1311VIDEO_UPDATE( rampart );
1412
15void rampart_bitmap_init(running_machine *machine, int _xdim, int _ydim);
1613void rampart_bitmap_render(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect);
1714
1815extern UINT16 *rampart_bitmap;
src/mame/includes/neogeo.h
r1490r1491
140140READ16_HANDLER( neogeo_video_register_r );
141141WRITE16_HANDLER( neogeo_video_register_w );
142142
143void neogeo_set_display_poisition_interrupt_control(UINT16 data);
143void neogeo_set_display_position_interrupt_control(UINT16 data);
144144
145145void neogeo_set_palette_bank(UINT8 data);
146146void neogeo_set_screen_dark(UINT8 data);
src/mame/includes/dc.h
r1490r1491
3030
3131void dc_vblank( void );
3232
33int compute_interrupt_level(void);
34void update_interrupt_status(void);
35
36extern UINT32 sysctrl_regs[0x200/4];
37
38                      /*address*/
39#define SB_C2DSTAT   ((0x005F6800-0x005F6800)/4)
40#define SB_C2DLEN   ((0x005F6804-0x005F6800)/4)
41#define SB_C2DST   ((0x005F6808-0x005F6800)/4)
42#define SB_SBREV   ((0x005F689c-0x005F6800)/4)
43#define SB_ISTNRM   ((0x005F6900-0x005F6800)/4)
44#define SB_ISTEXT   ((0x005F6904-0x005F6800)/4)
45#define SB_ISTERR   ((0x005F6908-0x005F6800)/4)
46#define SB_IML2NRM   ((0x005F6910-0x005F6800)/4)
47#define SB_IML2EXT   ((0x005F6914-0x005F6800)/4)
48#define SB_IML2ERR   ((0x005F6918-0x005F6800)/4)
49#define SB_IML4NRM   ((0x005F6920-0x005F6800)/4)
50#define SB_IML4EXT   ((0x005F6924-0x005F6800)/4)
51#define SB_IML4ERR   ((0x005F6928-0x005F6800)/4)
52#define SB_IML6NRM   ((0x005F6930-0x005F6800)/4)
53#define SB_IML6EXT   ((0x005F6934-0x005F6800)/4)
54#define SB_IML6ERR   ((0x005F6938-0x005F6800)/4)
55
56
57                      /*address*/
58#define SB_MDSTAR   ((0x005F6C04-0x005F6C00)/4)
59#define SB_MDST      ((0x005F6C18-0x005F6C00)/4)
60#define SB_MDTSEL   ((0x005F6C10-0x005F6C00)/4)
61#define SB_MSYS      ((0x005F6C80-0x005F6C00)/4)
62
63
3364/*----------- defined in video/dc.c -----------*/
3465
3566READ64_HANDLER( pvr_ctrl_r );
r1490r1491
4172VIDEO_START(dc);
4273VIDEO_UPDATE(dc);
4374
75                          /*address*/
76#define PVRID         ((0x005F8000-0x005F8000)/4)
77#define REVISION      ((0x005F8004-0x005F8000)/4)
78#define SOFTRESET      ((0x005F8008-0x005F8000)/4)
79#define STARTRENDER      ((0x005F8014-0x005F8000)/4)
80#define VO_BORDER_COL   ((0x005F8040-0x005F8000)/4)
81#define VO_CONTROL      ((0x005F80E8-0x005F8000)/4)
82#define SPG_STATUS      ((0x005F810c-0x005F8000)/4)
83#define TA_LIST_INIT   ((0x005F8144-0x005F8000)/4)
84
85
4486#endif
src/mame/includes/suprridr.h
r1490r1491
1717WRITE8_HANDLER( suprridr_fgdisable_w );
1818WRITE8_HANDLER( suprridr_fgscrolly_w );
1919WRITE8_HANDLER( suprridr_bgscrolly_w );
20int suprridr_is_screen_flipped(void);
2021
2122WRITE8_HANDLER( suprridr_fgram_w );
2223WRITE8_HANDLER( suprridr_bgram_w );
src/mame/includes/exidy.h
r1490r1491
5757extern UINT8 exidy_collision_mask;
5858extern UINT8 exidy_collision_invert;
5959
60extern UINT8 exidy_color_latch[3];
60extern UINT8 *exidy_color_latch;
6161
6262VIDEO_START( exidy );
6363VIDEO_EOF( exidy );
r1490r1491
6666INTERRUPT_GEN( exidy_vblank_interrupt );
6767INTERRUPT_GEN( teetert_vblank_interrupt );
6868
69WRITE8_HANDLER( exidy_characterram_w );
7069WRITE8_HANDLER( exidy_color_w );
7170WRITE8_HANDLER( exidy_sprite1_xpos_w );
7271WRITE8_HANDLER( exidy_sprite1_ypos_w );
src/mame/includes/skychut.h
r0r1491
1/***************************************************************************
2
3    IREM M-10,M-11 and M-15 based hardware
4
5****************************************************************************/
6
7
8#define IREMM10_MASTER_CLOCK      (25000000)
9
10#define IREMM10_CPU_CLOCK      (IREMM10_MASTER_CLOCK/20)
11#define IREMM10_PIXEL_CLOCK      (IREMM10_MASTER_CLOCK/5)
12#define IREMM10_HTOTAL         (318)
13#define IREMM10_HBSTART         (248)
14#define IREMM10_HBEND         (8)
15#define IREMM10_VTOTAL         (262)
16#define IREMM10_VBSTART         (240)
17#define IREMM10_VBEND         (16)
18
19#define IREMM15_MASTER_CLOCK   (11730000)
20
21#define IREMM15_CPU_CLOCK      (IREMM15_MASTER_CLOCK/10)
22#define IREMM15_PIXEL_CLOCK      (IREMM15_MASTER_CLOCK/2)
23#define IREMM15_HTOTAL         (372)
24#define IREMM15_HBSTART         (256)
25#define IREMM15_HBEND         (0)
26#define IREMM15_VTOTAL         (262)
27#define IREMM15_VBSTART         (240)
28#define IREMM15_VBEND         (16)
29
30typedef struct _irem_state irem_state;
31struct _irem_state
32{
33   /* memory pointers */
34   UINT8 *         chargen;
35   UINT8 *         memory;
36   UINT8 *         rom;
37
38   /* machine states */
39
40   /* sound state */
41
42   /* video state */
43   UINT8         bottomline;
44   UINT8          flip;
45
46   /* Specific states */
47};
48
49
50/*----------- defined in video/skychut.c -----------*/
51
52
53WRITE8_HANDLER( skychut_colorram_w );
54WRITE8_HANDLER( iremm15_chargen_w );
55
56VIDEO_UPDATE( iremm10 );
57VIDEO_UPDATE( iremm15 );
58
59VIDEO_START( iremm10 );
60VIDEO_START( iremm15 );
61
src/mame/includes/itech32.h
r1490r1491
55
66**************************************************************************/
77
8#define VIDEO_CLOCK      XTAL_8MHz         /* video (pixel) clock */
9#define CPU_CLOCK      XTAL_12MHz         /* clock for 68000-based systems */
10#define CPU020_CLOCK   XTAL_25MHz         /* clock for 68EC020-based systems */
11#define SOUND_CLOCK      XTAL_16MHz         /* clock for sound board */
12#define TMS_CLOCK      XTAL_40MHz         /* TMS320C31 clocks on drivedge */
13
14
815/*----------- defined in drivers/itech32.c -----------*/
916
1017void itech32_update_interrupts(int vint, int xint, int qint);
src/mame/includes/amiga.h
r1490r1491
289289#define MAX_PLANES 6 /* 0 to 6, inclusive ( but we count from 0 to 5 ) */
290290
291291/* Clock speeds */
292#define AMIGA_68000_NTSC_CLOCK      7159090 /* Hz */
293#define AMIGA_68000_PAL_CLOCK      7093790 /* Hz */
294#define AMIGA_68EC020_NTSC_CLOCK   14318180 /* Hz */
295#define AMIGA_68EC020_PAL_CLOCK      14187580 /* Hz */
296#define CDTV_CLOCK_X1               28636363 /* Hz */
297#define CDTV_CLOCK_X5               28375160 /* Hz */
292#define AMIGA_68000_NTSC_CLOCK      XTAL_28_63636MHz/4
293#define AMIGA_68000_PAL_CLOCK       XTAL_28_37516MHz/4
294#define AMIGA_68EC020_NTSC_CLOCK    XTAL_28_63636MHz/2
295#define AMIGA_68EC020_PAL_CLOCK     XTAL_28_37516MHz/2
296#define CDTV_CLOCK_X1               XTAL_28_63636MHz
297#define CDTV_CLOCK_X5               XTAL_28_37516MHz
298298
299299
300300#define ANGUS_CHIP_RAM_MASK      0x07fffe
src/mame/includes/tatsumi.h
r1490r1491
4646WRITE16_HANDLER( tatsumi_sprite_control_w );
4747WRITE16_HANDLER( roundup5_text_w );
4848WRITE16_HANDLER( roundup5_crt_w );
49READ16_HANDLER( cyclwarr_videoram_r );
50WRITE16_HANDLER( cyclwarr_videoram_w );
51READ16_HANDLER( cyclwarr_videoram2_r );
52WRITE16_HANDLER( cyclwarr_videoram2_w );
49READ16_HANDLER( cyclwarr_videoram0_r );
50WRITE16_HANDLER( cyclwarr_videoram0_w );
51READ16_HANDLER( cyclwarr_videoram1_r );
52WRITE16_HANDLER( cyclwarr_videoram1_w );
5353READ16_HANDLER(roundup5_vram_r);
5454WRITE16_HANDLER(roundup5_vram_w);
5555WRITE16_HANDLER(apache3_palette_w);
5656
5757extern UINT16* tatsumi_sprite_control_ram;
58extern UINT16 *cyclwarr_videoram, *cyclwarr_videoram2;
58extern UINT16 *cyclwarr_videoram0, *cyclwarr_videoram1;
5959extern UINT16 *roundup_r_ram, *roundup_p_ram, *roundup_l_ram;
6060
6161VIDEO_START( apache3 );
6262VIDEO_START( roundup5 );
6363VIDEO_START( cyclwarr );
64VIDEO_START( bigfight );
65
6466VIDEO_UPDATE( roundup5 );
6567VIDEO_UPDATE( apache3 );
6668VIDEO_UPDATE( cyclwarr );
69VIDEO_UPDATE( bigfight );
6770
src/mame/includes/mario.h
r1490r1491
5353WRITE8_HANDLER( mario_gfxbank_w );
5454WRITE8_HANDLER( mario_palettebank_w );
5555WRITE8_HANDLER( mario_scroll_w );
56WRITE8_HANDLER( mario_flip_w );
5657
5758PALETTE_INIT( mario );
5859VIDEO_START( mario );
src/mame/includes/atarifb.h
r1490r1491
4949extern UINT8 *atarifb_alphap2_vram;
5050extern UINT8 *atarifb_scroll_register;
5151
52WRITE8_HANDLER( atarifb_scroll_w );
53WRITE8_HANDLER( atarifb_alphap1_vram_w );
54WRITE8_HANDLER( atarifb_alphap2_vram_w );
55
5652VIDEO_UPDATE( atarifb );
src/mame/mame.mak
r1490r1491
44#
55#   MAME target makefile
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
r1490r1491
16851685
16861686$(DRIVERS)/nbmj8688.o:   $(LAYOUT)/nbmj8688.lh
16871687
1688$(DRIVERS)/neogeo.o:   $(LAYOUT)/neogeo.lh
1689
16881690$(DRIVERS)/peplus.o:   $(LAYOUT)/peplus.lh \
16891691                  $(LAYOUT)/pe_schip.lh \
16901692                  $(LAYOUT)/pe_poker.lh \
src/mame/video/rampart.c
r1490r1491
2222
2323/*************************************
2424 *
25 *  Statics
26 *
27 *************************************/
28
29static UINT8 *pfdirty;
30static mame_bitmap *pfbitmap;
31static int xdim, ydim;
32
33
34
35/*************************************
36 *
3725 *  Video system start
3826 *
3927 *************************************/
r1490r1491
7765      0,               /* callback routine for special entries */
7866   };
7967
80   /* initialize the playfield */
81   rampart_bitmap_init(machine, 43*8, 30*8);
82
8368   /* initialize the motion objects */
8469   atarimo_init(machine, 0, &modesc);
8570
8671   /* set the intial scroll offset */
87   atarimo_set_xscroll(0, -4);
72   atarimo_set_xscroll(0, -12);
8873}
8974
9075
r1490r1491
11499         for (x = rectlist.rect->min_x; x <= rectlist.rect->max_x; x++)
115100            if (mo[x])
116101            {
117               /* not yet verified
118                    */
102               /* the PCB supports more complex priorities, but the PAL is not stuffed, so we get the default */
119103               pf[x] = mo[x];
120104
121105               /* erase behind ourselves */
r1490r1491
129113
130114/*************************************
131115 *
132 *  Bitmap initialization
133 *
134 *************************************/
135
136void rampart_bitmap_init(running_machine *machine, int _xdim, int _ydim)
137{
138   /* set the dimensions */
139   xdim = _xdim;
140   ydim = _ydim;
141
142   /* allocate dirty map */
143   pfdirty = auto_malloc(sizeof(pfdirty[0]) * ydim);
144   memset(pfdirty, 1, sizeof(pfdirty[0]) * ydim);
145
146   /* allocate playfield bitmap */
147   pfbitmap = auto_bitmap_alloc(xdim, ydim, machine->screen[0].format);
148}
149
150
151
152/*************************************
153 *
154 *  Bitmap RAM write handler
155 *
156 *************************************/
157
158WRITE16_HANDLER( rampart_bitmap_w )
159{
160   int oldword = rampart_bitmap[offset];
161   int newword = oldword;
162   int x, y;
163
164   COMBINE_DATA(&newword);
165   if (oldword != newword)
166   {
167      rampart_bitmap[offset] = newword;
168
169      /* track color usage */
170      x = offset % 256;
171      y = offset / 256;
172      if (x < xdim && y < ydim)
173         pfdirty[y] = 1;
174   }
175}
176
177
178
179/*************************************
180 *
181116 *  Bitmap rendering
182117 *
183118 *************************************/
r1490r1491
187122   int x, y;
188123
189124   /* update any dirty scanlines */
190   for (y = 0; y < ydim; y++)
191      if (pfdirty[y])
192      {
193         const UINT16 *src = &rampart_bitmap[256 * y];
194         UINT8 scanline[512];
195         UINT8 *dst = scanline;
125   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
126   {
127      const UINT16 *src = &rampart_bitmap[256 * y];
128      UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
196129
197         /* regenerate the line */
198         for (x = 0; x < xdim / 2; x++)
199         {
200            int bits = *src++;
201            *dst++ = bits >> 8;
202            *dst++ = bits;
203         }
204         pfdirty[y] = 0;
205
206         /* draw it */
207         draw_scanline8(pfbitmap, 0, y, xdim, scanline, machine->pens, -1);
130      /* regenerate the line */
131      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
132      {
133         int bits = src[(x - 8) / 2];
134         dst[x + 0] = bits >> 8;
135         dst[x + 1] = bits & 0xff;
208136      }
209
210   /* copy the cached bitmap */
211   copybitmap(bitmap, pfbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
137   }
212138}
src/mame/video/flkatck.c
r1490r1491
7575   k007121_tilemap[0] = tilemap_create(get_tile_info_A,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
7676   k007121_tilemap[1] = tilemap_create(get_tile_info_B,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
7777
78   k007121_clip[0] = machine->screen[0].visarea;
79   k007121_clip[0].min_x += 40;
80
81   k007121_clip[1] = machine->screen[0].visarea;
82   k007121_clip[1].max_x = 39;
83   k007121_clip[1].min_x = 0;
8478}
8579
8680
r1490r1491
144138   K007121_ctrlram[0][0x00],K007121_ctrlram[0][0x01],K007121_ctrlram[0][0x02],K007121_ctrlram[0][0x03],K007121_ctrlram[0][0x04],K007121_ctrlram[0][0x05],K007121_ctrlram[0][0x06],K007121_ctrlram[0][0x07],
145139   K007121_ctrlram[1][0x00],K007121_ctrlram[1][0x01],K007121_ctrlram[1][0x02],K007121_ctrlram[1][0x03],K007121_ctrlram[1][0x04],K007121_ctrlram[1][0x05],K007121_ctrlram[1][0x06],K007121_ctrlram[1][0x07]);
146140#endif
141   if (k007121_flip_screen)
142   {
143      k007121_clip[0] = Machine->screen[0].visarea;
144      k007121_clip[0].max_x -= 40;
147145
148   /* set scroll registers */
149   tilemap_set_scrollx(k007121_tilemap[0],0,K007121_ctrlram[0][0x00] - 40);
150   tilemap_set_scrolly(k007121_tilemap[0],0,K007121_ctrlram[0][0x02]);
146      k007121_clip[1] = Machine->screen[0].visarea;
147      k007121_clip[1].min_x = k007121_clip[1].max_x-40;
151148
149      tilemap_set_scrollx(k007121_tilemap[0],0,K007121_ctrlram[0][0x00] - 56 );
150      tilemap_set_scrolly(k007121_tilemap[0],0,K007121_ctrlram[0][0x02]);
151      tilemap_set_scrollx(k007121_tilemap[1],0,-16);
152   }
153   else
154   {
155      k007121_clip[0] = machine->screen[0].visarea;
156      k007121_clip[0].min_x += 40;
157
158      k007121_clip[1] = machine->screen[0].visarea;
159      k007121_clip[1].max_x = 39;
160      k007121_clip[1].min_x = 0;
161
162      tilemap_set_scrollx(k007121_tilemap[0],0,K007121_ctrlram[0][0x00] - 40 );
163      tilemap_set_scrolly(k007121_tilemap[0],0,K007121_ctrlram[0][0x02]);
164      tilemap_set_scrollx(k007121_tilemap[1],0,0);
165   }
166
152167   /* compute clipping */
153168   final_clip[0] = k007121_clip[0];
154169   final_clip[1] = k007121_clip[1];
src/mame/video/itech32.c
r1490r1491
13781378
13791379            logerror("Configure Screen: HTOTAL: %x  HBSTART: %x  HBEND: %x  VTOTAL: %x  VBSTART: %x  VBEND: %x\n",
13801380               VIDEO_HTOTAL, VIDEO_HBLANK_START, VIDEO_HBLANK_END, VIDEO_VTOTAL, VIDEO_VBLANK_START, VIDEO_VBLANK_END);
1381            video_screen_configure(0, VIDEO_HTOTAL, VIDEO_VTOTAL, &visarea, Machine->screen[0].refresh);
1381            video_screen_configure(0, VIDEO_HTOTAL, VIDEO_VTOTAL, &visarea, HZ_TO_ATTOSECONDS(VIDEO_CLOCK) * VIDEO_HTOTAL * VIDEO_VTOTAL);
13821382         }
13831383         break;
13841384   }
src/mame/video/malzak.c
r1490r1491
5757   collision_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
5858
5959   saa5050_vidram = auto_malloc(0x800);
60   s2636_1_ram = auto_malloc(0x100);
61   s2636_2_ram = auto_malloc(0x100);
6260}
6361
6462VIDEO_UPDATE( malzak )
r1490r1491
215213   s2636_x_offset = -16;
216214//  s2636_y_offset = -8;
217215
218   s2636_update_bitmap(machine,bitmap,s2636_1_ram,s2636_1_dirty,1,collision_bitmap);
219   s2636_update_bitmap(machine,bitmap,s2636_2_ram,s2636_2_dirty,2,collision_bitmap);
216   s2636_update_bitmap(machine,bitmap,s2636_1_ram,1,collision_bitmap);
217   s2636_update_bitmap(machine,bitmap,s2636_2_ram,2,collision_bitmap);
220218   return 0;
221219}
222220
src/mame/video/taitoic.c
r1490r1491
23782378      xd = -x_offset;
23792379      yd = 8-y_offset;
23802380
2381#if 0
2381      // the multi-screen games need this, check the alignment grid screens..
23822382      if (chips==2)   /* Dual screen */
23832383      {
2384         if (i==1)  xd += (320-multiscrn_xoffs);
2384         if (i==1)  xd -= (multiscrn_xoffs);
23852385      }
23862386      if (chips==3)   /* Triple screen */
23872387      {
2388         if (i==1)  xd += (286-multiscrn_xoffs);
2389         if (i==2)  xd += (572-multiscrn_xoffs*2);
2388         if (i==1)  xd -= multiscrn_xoffs;
2389         if (i==2)  xd -= multiscrn_xoffs*2;
23902390      }
2391#endif
23922391      tilemap_set_scrolldx(TC0100SCN_tilemap[i][0][1], xd-16, -flip_xoffs -xd-16);
23932392      tilemap_set_scrolldy(TC0100SCN_tilemap[i][0][1], yd,    -flip_yoffs -yd);
23942393      tilemap_set_scrolldx(TC0100SCN_tilemap[i][1][1], xd-16, -flip_xoffs -xd-16);
src/mame/video/arcadecl.c
r1490r1491
6969      0,               /* callback routine for special entries */
7070   };
7171
72   /* initialize the playfield */
73   rampart_bitmap_init(machine, 43*8, 30*8);
74
7572   /* initialize the motion objects */
7673   atarimo_init(machine, 0, &modesc);
7774
src/mame/video/dc.c
r1490r1491
55
66#include "driver.h"
77#include "dc.h"
8#include "cpu/sh4/sh4.h"
89
9#define DEBUG_PVRCTRL (1)
10#define DEBUG_PVRTA   (1)
10#define DEBUG_FIFO_POLY (0)
11#define DEBUG_PVRCTRL   (0)
12#define DEBUG_PVRTA   (0)
13#define DEBUG_PVRTA_REGS (0)
14#define DEBUG_PVRDLIST   (0)
1115
1216static UINT32 pvrctrl_regs[0x100/4];
1317static UINT32 pvrta_regs[0x2000/4];
1418
15VIDEO_START(dc)
16{
17   memset(pvrctrl_regs, 0, sizeof(pvrctrl_regs));
18   memset(pvrta_regs, 0, sizeof(pvrta_regs));
19UINT64 *dc_texture_ram;
20static UINT32 tafifo_buff[32];
21static int tafifo_pos, tafifo_mask, tafifo_vertexwords, tafifo_listtype;
22static int start_render_received;
1923
20   pvrta_regs[0] = 0x17fd11db;   // vendor and device ID of HOLLY chip
21   pvrta_regs[1] = 1;      // chip revision
22}
23
24VIDEO_UPDATE(dc)
24struct testsprites
2525{
26   dc_vblank();
26   int positionx, positiony;
27   int sizex, sizey;
28   UINT32 textureaddress;
29   float u, v, du, dv;
30   int texturemode;
31   int texturesizex, texturesizey, texturesizes, texturepf;
32} showsprites[2048];
2733
28   return 0;
29}
34static int testsprites_size, toerasesprites;
35static UINT32 dilated0[11][1024];
36static UINT32 dilated1[11][1024];
37static int dilatechose[64];
3038
3139// register decode helper
32
3340INLINE int decode_reg_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift)
3441{
3542   int reg = offset * 2;
3643
3744   *shift = 0;
3845
46   // non 32-bit accesses have not yet been seen here, we need to know when they are
47   if ((mem_mask != U64(0x00000000ffffffff)) && (mem_mask != U64(0xffffffff00000000)))
48   {
49      assert_always(0, "Wrong mask!\n");
50   }
51
3952   if (mem_mask == U64(0x00000000ffffffff))
4053   {
4154      reg++;
r1490r1491
8093
8194   reg = decode_reg_64(offset, mem_mask, &shift);
8295
96   switch (reg)
97   {
98   case SPG_STATUS:
99      pvrta_regs[reg] = (video_screen_get_vblank(0) << 13) | (video_screen_get_hblank(0) << 12) | (video_screen_get_vpos(0) & 0x3ff);
100      break;
101   }
102
83103   #if DEBUG_PVRTA
84104   mame_printf_verbose("PVRTA: read %x @ %x (reg %x), mask %llx (PC=%x)\n", pvrta_regs[reg], offset, reg, mem_mask, activecpu_get_pc());
85105   #endif
86
87106   return (UINT64)pvrta_regs[reg] << shift;
88107}
89108
r1490r1491
91110{
92111   int reg;
93112   UINT64 shift;
113   UINT32 old,dat;
94114
95115   reg = decode_reg_64(offset, mem_mask, &shift);
116   dat = (UINT32)(data >> shift);
117   old = pvrta_regs[reg];
118   pvrta_regs[reg] = dat; // 5f8000+reg*4=dat
119   switch (reg)
120   {
121   case SOFTRESET:
122      #if DEBUG_PVRTA_REGS
123      if (dat & 1)
124      {
125         mame_printf_verbose("pvr_ta_w:  TA soft reset\n");
126      }
127      if (dat & 2)
128      {
129         mame_printf_verbose("pvr_ta_w:  Core Pipeline soft reset\n");
130      }
131      if (dat & 4)
132      {
133         mame_printf_verbose("pvr_ta_w:  sdram I/F soft reset\n");
134      }
135      #endif
136      break;
137   case STARTRENDER:
138      start_render_received=1;
139      break;
140   case TA_LIST_INIT:
141      tafifo_pos=0;
142      tafifo_mask=7;
143      tafifo_vertexwords=8;
144      tafifo_listtype= -1;
145      toerasesprites=1;
146      break;
147   }
96148
97149   #if DEBUG_PVRTA
98150   mame_printf_verbose("PVRTA: write %llx to %x (reg %x %x), mask %llx\n", data>>shift, offset, reg, (reg*4)+0x8000, mem_mask);
99151   #endif
100
101   pvrta_regs[reg] |= data >> shift;
102152}
103153
104
105154WRITE64_HANDLER( ta_fifo_poly_w )
106155{
107   mame_printf_verbose("Poly FIFO: write %llx to %x, mask %llx\n", data, offset, mem_mask);
156   UINT32 a;
157   static UINT32 paracontrol,paratype,endofstrip,listtype;
158   static UINT32 groupcontrol,groupen,striplen,userclip;
159   static UINT32 objcontrol,shadow,volume,coltype,texture,offfset,gouraud,uv16bit;
160   static UINT32 textureusize,texturevsize,texturesizes,textureaddress,scanorder,pixelformat;
161   static UINT32 srcalphainstr,dstalphainstr,srcselect,dstselect,fogcontrol,colorclamp,usealpha;
162   static UINT32 ignoretexalpha,flipuv,clampuv,filtermode,sstexture,mmdadjust,tsinstruction;
163   static UINT32 depthcomparemode,cullingmode,zwritedisable,cachebypass,dcalcctrl,volumeinstruction,mipmapped,vqcompressed,strideselect;
164
165   if (!mem_mask)    // 64 bit
166   {
167      tafifo_buff[tafifo_pos]=(UINT32)data;
168      tafifo_buff[tafifo_pos+1]=(UINT32)(data >> 32);
169      #if DEBUG_FIFO_POLY
170      mame_printf_debug("ta_fifo_poly_w:  Unmapped write64 %08x = %llx -> %08x %08x\n", 0x10000000+offset*8, data, tafifo_buff[tafifo_pos], tafifo_buff[tafifo_pos+1]);
171      #endif
172      tafifo_pos += 2;
173   }
174   else
175   {
176      logerror("ta_fifo_poly_w:  Only 64 bit writes supported!\n");
177   }
178
179   tafifo_pos &= tafifo_mask;
180   if (tafifo_pos == 0)
181   {
182      paracontrol=(tafifo_buff[0] >> 24) & 0xff;
183
184      // 0 end of list
185      // 1 user tile clip
186      // 2 object list set
187      // 3 reserved
188      // 4 polygon/modifier volume
189      // 5 sprite
190      // 6 reserved
191      // 7 vertex
192      paratype=(paracontrol >> 5) & 7;
193      endofstrip=(paracontrol >> 4) & 1;
194      listtype=(paracontrol >> 0) & 7;
195      groupcontrol=(tafifo_buff[0] >> 16) & 0xff;
196      groupen=(groupcontrol >> 7) & 1;
197      striplen=(groupcontrol >> 2) & 3;
198      userclip=(groupcontrol >> 0) & 3;
199      objcontrol=(tafifo_buff[0] >> 0) & 0xffff;
200      shadow=(objcontrol >> 7) & 1;
201      volume=(objcontrol >> 6) & 1;
202      coltype=(objcontrol >> 4) & 3;
203      texture=(objcontrol >> 3) & 1;
204      offfset=(objcontrol >> 2) & 1;
205      gouraud=(objcontrol >> 1) & 1;
206      uv16bit=(objcontrol >> 0) & 1;
207
208      if (toerasesprites == 1)
209      {
210         toerasesprites=0;
211         testsprites_size=0;
212      }
213
214      // check if we need 8 words more
215      if (tafifo_mask == 7)
216      {
217         if ((paratype == 4) && (((coltype >= 2) && (offfset == 1)) || ((coltype >= 2) && (volume == 1))))
218         {
219            tafifo_mask = 15;
220            tafifo_pos = 8;
221            return;
222         }
223
224         if ((paratype == 7) && (tafifo_vertexwords == 16))
225         {
226            tafifo_mask = 15;
227            tafifo_pos = 8;
228            return;
229         }
230      }
231      else
232      {
233         tafifo_mask = 7;
234      }
235
236      // now we heve all the needed words
237      // interpret their meaning
238      if (tafifo_buff[0] == 0)
239      {
240         a=0; // 6-10 0-3
241         switch (tafifo_listtype)
242         {
243         case 0:
244            a = 1 << 7;
245            break;
246         case 1:
247            a = 1 << 8;
248            break;
249         case 2:
250            a = 1 << 9;
251            break;
252         case 3:
253            a = 1 << 10;
254            break;
255         case 4:
256            a = 1 << 21;
257            break;
258            break;
259         }
260         sysctrl_regs[SB_ISTNRM] |= a;
261         update_interrupt_status();
262         tafifo_listtype= -1;
263      }
264      else
265      {
266         #if DEBUG_PVRDLIST
267         mame_printf_verbose("Para Type %d End of Strip %d List Type %d\n", paratype, endofstrip, listtype);
268         #endif
269
270         if (((paratype == 4) && (texture == 1)) || (paratype == 5))
271         {
272            depthcomparemode=(tafifo_buff[1] >> 29) & 7;
273            cullingmode=(tafifo_buff[1] >> 27) & 3;
274            zwritedisable=(tafifo_buff[1] >> 26) & 1;
275            cachebypass=(tafifo_buff[1] >> 21) & 1;
276            dcalcctrl=(tafifo_buff[1] >> 20) & 1;
277            volumeinstruction=(tafifo_buff[1] >> 29) & 7;
278            textureusize=1 << (3+((tafifo_buff[2] >> 3) & 7));
279            texturevsize=1 << (3+(tafifo_buff[2] & 7));
280            texturesizes=tafifo_buff[2] & 0x3f;
281            srcalphainstr=(tafifo_buff[2] >> 29) & 7;
282            dstalphainstr=(tafifo_buff[2] >> 26) & 7;
283            srcselect=(tafifo_buff[2] >> 25) & 1;
284            dstselect=(tafifo_buff[2] >> 24) & 1;
285            fogcontrol=(tafifo_buff[2] >> 22) & 3;
286            colorclamp=(tafifo_buff[2] >> 21) & 1;
287            usealpha=(tafifo_buff[2] >> 20) & 1;
288            ignoretexalpha=(tafifo_buff[2] >> 19) & 1;
289            flipuv=(tafifo_buff[2] >> 17) & 3;
290            clampuv=(tafifo_buff[2] >> 15) & 3;
291            filtermode=(tafifo_buff[2] >> 13) & 3;
292            sstexture=(tafifo_buff[2] >> 12) & 1;
293            mmdadjust=(tafifo_buff[2] >> 8) & 1;
294            tsinstruction=(tafifo_buff[2] >> 6) & 3;
295            textureaddress=(tafifo_buff[3] & 0x1FFFFF) << 3;
296            scanorder=(tafifo_buff[3] >> 26) & 1;
297            pixelformat=(tafifo_buff[3] >> 27) & 7;
298            mipmapped=(tafifo_buff[3] >> 31) & 1;
299            vqcompressed=(tafifo_buff[3] >> 30) & 1;
300            strideselect=(tafifo_buff[3] >> 25) & 1;
301
302            #if DEBUG_PVRDLIST
303            mame_printf_verbose(" Texture %d x %d at %08x format %d\n", textureusize, texturevsize, (tafifo_buff[3] & 0x1FFFFF) << 3, pixelformat);
304            #endif
305         }
306
307         if (paratype == 7)
308         { // vertex
309            #if DEBUG_PVRDLIST
310            mame_printf_verbose(" test vertex ");
311            for (a=1; a <= 11; a++)
312            {
313               mame_printf_verbose(" %e", u2f(tafifo_buff[a]));
314            }
315            mame_printf_verbose("\n");
316            mame_printf_verbose(" %e %e %e %e %e %e\n",u2f(tafifo_buff[13] & 0xffff0000),u2f((tafifo_buff[13] & 0xffff) << 16),u2f(tafifo_buff[14] & 0xffff0000),u2f((tafifo_buff[14] & 0xffff) << 16),u2f(tafifo_buff[15] & 0xffff0000),u2f((tafifo_buff[15] & 0xffff) << 16));
317            #endif
318/* test video start */
319            // pixely=u2f((tafifo_buff[13] & 0xffff) << 16)*1024
320            showsprites[testsprites_size].positionx=u2f(tafifo_buff[1]);
321            showsprites[testsprites_size].positiony=u2f(tafifo_buff[2]);
322            showsprites[testsprites_size].sizex=u2f(tafifo_buff[4])-u2f(tafifo_buff[1]);
323            showsprites[testsprites_size].sizey=u2f(tafifo_buff[8])-u2f(tafifo_buff[2]);
324            showsprites[testsprites_size].u=u2f(tafifo_buff[13] & 0xffff0000);
325            showsprites[testsprites_size].v=u2f((tafifo_buff[13] & 0xffff) << 16);
326            showsprites[testsprites_size].du=u2f(tafifo_buff[14] & 0xffff0000)-showsprites[testsprites_size].u;
327            showsprites[testsprites_size].dv=u2f((tafifo_buff[15] & 0xffff) << 16)-showsprites[testsprites_size].v;
328            showsprites[testsprites_size].textureaddress=textureaddress;
329            showsprites[testsprites_size].texturesizex=textureusize;
330            showsprites[testsprites_size].texturesizey=texturevsize;
331            showsprites[testsprites_size].texturemode=scanorder;
332            showsprites[testsprites_size].texturesizes=texturesizes;
333            showsprites[testsprites_size].texturepf=pixelformat;
334            testsprites_size=testsprites_size+1;
335/* test video end */
336         }
337
338         if (paratype != 7)
339         {
340            tafifo_vertexwords=8;
341         }
342         if (((paratype == 4) && ((texture == 1) || (coltype == 1))) || (paratype == 5))
343         {
344            tafifo_vertexwords=16;
345         }
346         if ((paratype == 4) || (paratype == 5) || (paratype == 6))
347         {
348            if (tafifo_listtype < 0)
349            {
350               tafifo_listtype = listtype;
351            }
352         }
353      }
354   } // if (tafifo_pos == 0)
108355}
109356
110357WRITE64_HANDLER( ta_fifo_yuv_w )
111358{
112359   mame_printf_verbose("YUV FIFO: write %llx to %x, mask %llx\n", data, offset, mem_mask);
113360}
361
362/* test video start */
363UINT32 dilate0(UINT32 value,int bits) // dilate first "bits" bits in "value"
364{
365   UINT32 x,m1,m2,m3;
366   int a;
367
368   x = value;
369   for (a=0;a < bits;a++)
370   {
371      m2 = 1 << (a << 1);
372      m1 = m2 - 1;
373      m3 = (~m1) << 1;
374      x = (x & m1) + (x & m2) + ((x & m3) << 1);
375   }
376   return x;
377}
378
379UINT32 dilate1(UINT32 value,int bits) // dilate first "bits" bits in "value"
380{
381   UINT32 x,m1,m2,m3;
382   int a;
383
384   x = value;
385   for (a=0;a < bits;a++)
386   {
387      m2 = 1 << (a << 1);
388      m1 = m2 - 1;
389      m3 = (~m1) << 1;
390      x = (x & m1) + ((x & m2) << 1) + ((x & m3) << 1);
391   }
392   return x;
393}
394
395void computedilated(void)
396{
397   int a,b;
398
399   for (b=0;b <= 10;b++)
400      for (a=0;a < 1024;a++) {
401         dilated0[b][a]=dilate0(a,b);
402         dilated1[b][a]=dilate1(a,b);
403      }
404   for (b=0;b <= 7;b++)
405      for (a=0;a < 7;a++)
406         dilatechose[(b << 3) + a]=3+(a < b ? a : b);
407}
408
409void testdrawscreen(bitmap_t *bitmap,const rectangle *cliprect)
410{
411   int cs,x,y,dx,dy,xi,yi,a;
412   float iu,iv,u,v;
413   UINT32 addrp;
414   UINT32 *bmpaddr;
415   int c,xt,yt,cd;
416
417   fillbitmap(bitmap,MAKE_RGB(128,128,128),cliprect);
418   for (cs=0;cs < testsprites_size;cs++)
419   {
420      dx=showsprites[cs].sizex;
421      dy=showsprites[cs].sizey;
422      iu=showsprites[cs].du/dx;
423      iv=showsprites[cs].dv/dy;
424      cd=dilatechose[showsprites[cs].texturesizes];
425
426      if ((showsprites[cs].positionx+dx) > 640)
427         dx=640-showsprites[cs].positionx;
428      if ((showsprites[cs].positiony+dy) > 480)
429         dy=480-showsprites[cs].positiony;
430      xi=0;
431      yi=0;
432
433      if (showsprites[cs].positionx < 0)
434         xi=-showsprites[cs].positionx;
435      if (showsprites[cs].positiony < 0)
436         yi=-showsprites[cs].positiony;
437
438      for (y = yi;y < dy;y++)
439      {
440         for (x = xi;x < dx;x++)
441         {
442            u=showsprites[cs].u+iu*x;
443            v=showsprites[cs].v+iv*y;
444            yt=v*(showsprites[cs].texturesizey-1);
445            xt=u*(showsprites[cs].texturesizex-1);
446
447            if (showsprites[cs].texturemode == 1)
448               addrp=showsprites[cs].textureaddress+(showsprites[cs].texturesizex*yt+xt)*2;
449            else
450               addrp=showsprites[cs].textureaddress+(dilated1[cd][xt] + dilated0[cd][yt])*2;
451
452            c=*(((UINT16 *)dc_texture_ram) + (WORD2_XOR_LE(addrp) >> 1));
453            if (showsprites[cs].texturepf == 2)
454            {
455               a=(c & 0xf000) >> 8;
456               bmpaddr=BITMAP_ADDR32(bitmap,showsprites[cs].positiony+y,showsprites[cs].positionx+x);
457               *bmpaddr = alpha_blend_r32(*bmpaddr, MAKE_RGB((c&0xf00) >> 4, c&0xf0, (c&0xf) << 4), a);
458            }
459            else
460            {
461               a=(c & 0x7000) >> 7;
462               bmpaddr=BITMAP_ADDR32(bitmap,showsprites[cs].positiony+y,showsprites[cs].positionx+x);
463               *bmpaddr = alpha_blend_r32(*bmpaddr, MAKE_RGB((c&0x7c00) >> 7, (c&0x3e0) >> 2, (c&0x1f) << 3), a);
464            }
465         }
466      }
467   }
468}
469/* test video end */
470
471VIDEO_START(dc)
472{
473   memset(pvrctrl_regs, 0, sizeof(pvrctrl_regs));
474   memset(pvrta_regs, 0, sizeof(pvrta_regs));
475
476   // if the next 2 registers do not have the correct values, the naomi bios will hang
477   pvrta_regs[PVRID]=0x17fd11db;
478   pvrta_regs[REVISION]=0x11;
479   pvrta_regs[VO_CONTROL]=0xC;
480   pvrta_regs[SOFTRESET]=0x7;
481   tafifo_pos=0;
482   tafifo_mask=7;
483   tafifo_vertexwords=8;
484   tafifo_listtype= -1;
485   start_render_received=0;
486
487   testsprites_size=0;
488   toerasesprites=0;
489   computedilated();
490}
491
492VIDEO_UPDATE(dc)
493{
494   int a;
495
496   if (pvrta_regs[VO_CONTROL] & (1 << 3))
497   {
498      fillbitmap(bitmap,pvrta_regs[VO_BORDER_COL] & 0xFFFFFF,cliprect);
499      return 0;
500   }
501
502   testdrawscreen(bitmap,cliprect);
503
504   if (start_render_received)
505   {
506      start_render_received=0;
507      a=4; // tsp end
508      sysctrl_regs[SB_ISTNRM] |= a;
509      update_interrupt_status();
510   }
511   return 0;
512}
513
514void dc_vblank(void)
515{
516   sysctrl_regs[SB_ISTNRM] |= 0x08; // V Blank-in interrupt
517   update_interrupt_status();
518}
519
src/mame/video/suprridr.c
r1490r1491
130130}
131131
132132
133int suprridr_is_screen_flipped(void)
134{
135   return flipx;  /* or is it flipy? */
136}
133137
138
139
134140/*************************************
135141 *
136142 *  Video RAM writes
src/mame/video/atarirle.c
r1490r1491
1/*##########################################################################
1/***************************************************************************
22
33    atarirle.c
44
55    RLE sprite handling for early-to-mid 90's Atari raster games.
66
7############################################################################
7****************************************************************************
88
99    Description:
1010
r1490r1491
1616    See the bottom of the source for more details on the operation of these
1717    components.
1818
19##########################################################################*/
19***************************************************************************/
2020
2121#include "driver.h"
2222#include "atarirle.h"
2323
2424
25/*##########################################################################
25/***************************************************************************
2626    TYPES & STRUCTURES
27##########################################################################*/
27***************************************************************************/
2828
2929/* internal structure containing a word index, shift and mask */
30typedef struct atarirle_mask atarirle_mask;
3031struct atarirle_mask
3132{
32   int               word;            /* word index */
33   int               shift;            /* shift amount */
34   int               mask;            /* final mask */
33   int            word;            /* word index */
34   int            shift;            /* shift amount */
35   int            mask;            /* final mask */
3536};
3637
3738/* internal structure for sorting the motion objects */
39typedef struct mo_sort_entry mo_sort_entry;
3840struct mo_sort_entry
3941{
40   struct mo_sort_entry *next;
41   int entry;
42   mo_sort_entry *   next;
43   int          entry;
4244};
4345
4446/* internal structure describing each object in the ROMs */
47typedef struct atarirle_info atarirle_info;
4548struct atarirle_info
4649{
47   INT16            width;
48   INT16             height;
49   INT16             xoffs;
50   INT16             yoffs;
51   UINT8             bpp;
50   INT16         width;
51   INT16          height;
52   INT16          xoffs;
53   INT16          yoffs;
54   UINT8          bpp;
5255   const UINT16 *   table;
5356   const UINT16 *   data;
5457};
5558
5659/* internal structure containing the state of the motion objects */
60typedef struct atarirle_data atarirle_data;
5761struct atarirle_data
5862{
59   int               bitmapwidth;      /* width of the full playfield bitmap */
60   int               bitmapheight;      /* height of the full playfield bitmap */
61   int               bitmapxmask;      /* x coordinate mask for the playfield bitmap */
62   int               bitmapymask;      /* y coordinate mask for the playfield bitmap */
63   int            bitmapwidth;      /* width of the full playfield bitmap */
64   int            bitmapheight;      /* height of the full playfield bitmap */
65   int            bitmapxmask;      /* x coordinate mask for the playfield bitmap */
66   int            bitmapymask;      /* y coordinate mask for the playfield bitmap */
6367
64   int               spriterammask;      /* combined mask when accessing sprite RAM with raw addresses */
65   int               spriteramsize;      /* total size of sprite RAM, in entries */
68   int            spriterammask;      /* combined mask when accessing sprite RAM with raw addresses */
69   int            spriteramsize;      /* total size of sprite RAM, in entries */
6670
67   int               palettebase;      /* base palette entry */
68   int               maxcolors;         /* maximum number of colors */
71   int            palettebase;      /* base palette entry */
72   int            maxcolors;         /* maximum number of colors */
6973
70   rectangle   cliprect;         /* clipping rectangle */
74   rectangle      cliprect;         /* clipping rectangle */
7175
72   struct atarirle_mask codemask;         /* mask for the code index */
73   struct atarirle_mask colormask;         /* mask for the color */
74   struct atarirle_mask xposmask;         /* mask for the X position */
75   struct atarirle_mask yposmask;         /* mask for the Y position */
76   struct atarirle_mask scalemask;         /* mask for the scale factor */
77   struct atarirle_mask hflipmask;         /* mask for the horizontal flip */
78   struct atarirle_mask ordermask;         /* mask for the order */
79   struct atarirle_mask prioritymask;      /* mask for the priority */
80   struct atarirle_mask vrammask;         /* mask for the VRAM target */
76   atarirle_mask    codemask;         /* mask for the code index */
77   atarirle_mask    colormask;         /* mask for the color */
78   atarirle_mask    xposmask;         /* mask for the X position */
79   atarirle_mask    yposmask;         /* mask for the Y position */
80   atarirle_mask    scalemask;         /* mask for the scale factor */
81   atarirle_mask    hflipmask;         /* mask for the horizontal flip */
82   atarirle_mask    ordermask;         /* mask for the order */
83   atarirle_mask    prioritymask;      /* mask for the priority */
84   atarirle_mask    vrammask;         /* mask for the VRAM target */
8185
8286   const UINT16 *   rombase;         /* pointer to the base of the GFX ROM */
83   int               romlength;         /* length of the GFX ROM */
84   int               objectcount;      /* number of objects in the ROM */
85   struct atarirle_info *info;            /* list of info records */
86   struct atarirle_entry *spriteram;      /* pointer to sprite RAM */
87   int            romlength;         /* length of the GFX ROM */
88   int            objectcount;      /* number of objects in the ROM */
89   atarirle_info *   info;            /* list of info records */
90   atarirle_entry *spriteram;         /* pointer to sprite RAM */
8791
88   mame_bitmap *vram[2][2];         /* pointers to VRAM bitmaps and backbuffers */
89   int               partial_scanline;   /* partial update scanline */
92   mame_bitmap *   vram[2][2];         /* pointers to VRAM bitmaps and backbuffers */
93   int            partial_scanline;   /* partial update scanline */
9094
91   UINT8            control_bits;      /* current control bits */
92   UINT8            command;         /* current command */
93   UINT8            is32bit;         /* 32-bit or 16-bit? */
94   UINT16            checksums[256];      /* checksums for each 0x40000 bytes */
95   UINT8         control_bits;      /* current control bits */
96   UINT8         command;         /* current command */
97   UINT8         is32bit;         /* 32-bit or 16-bit? */
98   UINT16         checksums[256];      /* checksums for each 0x40000 bytes */
9599};
96100
97101
98102
99/*##########################################################################
103/***************************************************************************
100104    MACROS
101##########################################################################*/
105***************************************************************************/
102106
103107/* data extraction */
104108#define EXTRACT_DATA(_input, _mask) (((_input)->data[(_mask).word] >> (_mask).shift) & (_mask).mask)
105109
106110
107111
108/*##########################################################################
112/***************************************************************************
109113    GLOBAL VARIABLES
110##########################################################################*/
114***************************************************************************/
111115
112116UINT16 *atarirle_0_spriteram;
113117UINT32 *atarirle_0_spriteram32;
114118
115//UINT16 *atarirle_0_command;
116//UINT32 *atarirle_0_command32;
117
118//UINT16 *atarirle_0_table;
119//UINT32 *atarirle_0_table32;
120
121119static int atarirle_hilite_index = -1;
122120
123121
124122
125/*##########################################################################
123/***************************************************************************
126124    STATIC VARIABLES
127##########################################################################*/
125***************************************************************************/
128126
129static struct atarirle_data atarirle[ATARIRLE_MAX];
127static atarirle_data atarirle[ATARIRLE_MAX];
130128
131129static UINT8 rle_bpp[8];
132130static UINT16 *rle_table[8];
133131
134132
135133
136/*##########################################################################
134/***************************************************************************
137135    STATIC FUNCTION DECLARATIONS
138##########################################################################*/
136***************************************************************************/
139137
140138static void build_rle_tables(void);
141139static int count_objects(const UINT16 *base, int length);
142static void prescan_rle(const struct atarirle_data *mo, int which);
143static void sort_and_render(struct atarirle_data *mo);
144static void compute_checksum(struct atarirle_data *mo);
145static void draw_rle(struct atarirle_data *mo, mame_bitmap *bitmap, int code, int color, int hflip, int vflip,
140static void prescan_rle(const atarirle_data *mo, int which);
141static void sort_and_render(atarirle_data *mo);
142static void compute_checksum(atarirle_data *mo);
143static void draw_rle(atarirle_data *mo, mame_bitmap *bitmap, int code, int color, int hflip, int vflip,
146144      int x, int y, int xscale, int yscale, const rectangle *clip);
147static void draw_rle_zoom(mame_bitmap *bitmap, const struct atarirle_info *gfx,
145static void draw_rle_zoom(mame_bitmap *bitmap, const atarirle_info *gfx,
148146      UINT32 palette, int sx, int sy, int scalex, int scaley,
149147      const rectangle *clip);
150static void draw_rle_zoom_hflip(mame_bitmap *bitmap, const struct atarirle_info *gfx,
148static void draw_rle_zoom_hflip(mame_bitmap *bitmap, const atarirle_info *gfx,
151149      UINT32 palette, int sx, int sy, int scalex, int scaley,
152150      const rectangle *clip);
153151
154152
155153
156/*##########################################################################
154/***************************************************************************
157155    INLINE FUNCTIONS
158##########################################################################*/
156***************************************************************************/
159157
160158/*---------------------------------------------------------------
161159    compute_log: Computes the number of bits necessary to
r1490r1491
222220    shift, and adjusted mask. Returns 0 if invalid.
223221---------------------------------------------------------------*/
224222
225INLINE int convert_mask(const struct atarirle_entry *input, struct atarirle_mask *result)
223INLINE int convert_mask(const atarirle_entry *input, atarirle_mask *result)
226224{
227225   int i, temp;
228226
r1490r1491
258256
259257
260258
261/*##########################################################################
259/***************************************************************************
262260    GLOBAL FUNCTIONS
263##########################################################################*/
261***************************************************************************/
264262
265263/*---------------------------------------------------------------
266264    atarirle_init: Configures the motion objects using the input
r1490r1491
268266    the attribute lookup table.
269267---------------------------------------------------------------*/
270268
271void atarirle_init(int map, const struct atarirle_desc *desc)
269void atarirle_init(int map, const atarirle_desc *desc)
272270{
273271   const UINT16 *base = (const UINT16 *)memory_region(desc->region);
274   struct atarirle_data *mo = &atarirle[map];
272   atarirle_data *mo = &atarirle[map];
275273   int i;
276274
277275   /* verify the map index */
r1490r1491
355353   }
356354
357355   mo->partial_scanline = -1;
356
357   /* register for save states */
358   state_save_register_item_pointer("atarirle", map, mo->spriteram[0].data, ARRAY_LENGTH(mo->spriteram[0].data) * mo->spriteramsize);
359   state_save_register_item_bitmap("atarirle", map, mo->vram[0][0]);
360   state_save_register_item_bitmap("atarirle", map, mo->vram[0][1]);
361   if (mo->vrammask.mask != 0)
362   {
363      state_save_register_item_bitmap("atarirle", map, mo->vram[1][0]);
364      state_save_register_item_bitmap("atarirle", map, mo->vram[1][1]);
365   }
366   state_save_register_item("atarirle", map, mo->partial_scanline);
367   state_save_register_item("atarirle", map, mo->control_bits);
368   state_save_register_item("atarirle", map, mo->command);
369   state_save_register_item("atarirle", map, mo->is32bit);
370   state_save_register_item_array("atarirle", map, mo->checksums);
358371}
359372
360373
r1490r1491
365378
366379void atarirle_control_w(int map, UINT8 bits)
367380{
368   struct atarirle_data *mo = &atarirle[map];
381   atarirle_data *mo = &atarirle[map];
369382   int scanline = video_screen_get_vpos(0);
370383   int oldbits = mo->control_bits;
371384
r1490r1491
421434
422435void atarirle_command_w(int map, UINT8 command)
423436{
424   struct atarirle_data *mo = &atarirle[map];
437   atarirle_data *mo = &atarirle[map];
425438   mo->command = command;
426439}
427440
r1490r1491
440453   /* loop over all RLE handlers */
441454   for (i = 0; i < ATARIRLE_MAX; i++)
442455   {
443      struct atarirle_data *mo = &atarirle[i];
456      atarirle_data *mo = &atarirle[i];
444457
445458      /* if the erase flag is set, erase to the end of the screen */
446459      if (mo->control_bits & ATARIRLE_CONTROL_ERASE)
r1490r1491
511524
512525mame_bitmap *atarirle_get_vram(int map, int idx)
513526{
514   struct atarirle_data *mo = &atarirle[map];
527   atarirle_data *mo = &atarirle[map];
515528//logerror("atarirle_get_vram (frame %d)\n", (mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2);
516529   return mo->vram[idx][(mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2];
517530}
r1490r1491
605618    width, height, and other goodies.
606619---------------------------------------------------------------*/
607620
608static void prescan_rle(const struct atarirle_data *mo, int which)
621static void prescan_rle(const atarirle_data *mo, int which)
609622{
610   struct atarirle_info *rledata = &mo->info[which];
623   atarirle_info *rledata = &mo->info[which];
611624   UINT16 *base = (UINT16 *)&mo->rombase[which * 4];
612625   const UINT16 *end = mo->rombase + mo->romlength / 2;
613626   int width = 0, height, flags, offset;
r1490r1491
685698    compute_checksum: Compute the checksum values on the ROMs.
686699---------------------------------------------------------------*/
687700
688static void compute_checksum(struct atarirle_data *mo)
701static void compute_checksum(atarirle_data *mo)
689702{
690703   int reqsums = mo->spriteram[0].data[0] + 1;
691704   int i;
r1490r1491
715728    sort_and_render: Render all motion objects in order.
716729---------------------------------------------------------------*/
717730
718static void sort_and_render(struct atarirle_data *mo)
731static void sort_and_render(atarirle_data *mo)
719732{
720733   mame_bitmap *bitmap1 = mo->vram[0][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2];
721734   mame_bitmap *bitmap2 = mo->vram[1][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2];
722   struct atarirle_entry *obj = mo->spriteram;
723   struct mo_sort_entry sort_entry[256];
724   struct mo_sort_entry *list_head[256];
725   struct mo_sort_entry *current;
735   atarirle_entry *obj = mo->spriteram;
736   mo_sort_entry sort_entry[256];
737   mo_sort_entry *list_head[256];
738   mo_sort_entry *current;
726739   int i;
727740
728struct atarirle_entry *hilite = NULL;
741atarirle_entry *hilite = NULL;
729742int count = 0;
730743
731744   /* sort the motion objects into their proper priorities */
r1490r1491
799812      int x = EXTRACT_DATA(obj, mo->xposmask);
800813      int y = EXTRACT_DATA(obj, mo->yposmask);
801814      int scaled_xoffs, scaled_yoffs;
802      const struct atarirle_info *info;
815      const atarirle_info *info;
803816
804817      if (x & ((mo->xposmask.mask + 1) >> 1))
805818         x = (INT16)(x | ~mo->xposmask.mask);
r1490r1491
889902    object.
890903---------------------------------------------------------------*/
891904
892void draw_rle(struct atarirle_data *mo, mame_bitmap *bitmap, int code, int color, int hflip, int vflip,
905void draw_rle(atarirle_data *mo, mame_bitmap *bitmap, int code, int color, int hflip, int vflip,
893906   int x, int y, int xscale, int yscale, const rectangle *clip)
894907{
895908   UINT32 palettebase = mo->palettebase + color;
896   const struct atarirle_info *info = &mo->info[code];
909   const atarirle_info *info = &mo->info[code];
897910   int scaled_xoffs = (xscale * info->xoffs) >> 12;
898911   int scaled_yoffs = (yscale * info->yoffs) >> 12;
899912
r1490r1491
930943    bitmap.
931944---------------------------------------------------------------*/
932945
933void draw_rle_zoom(mame_bitmap *bitmap, const struct atarirle_info *gfx,
946void draw_rle_zoom(mame_bitmap *bitmap, const atarirle_info *gfx,
934947      UINT32 palette, int sx, int sy, int scalex, int scaley,
935948      const rectangle *clip)
936949{
r1490r1491
11201133    16-bit bitmap with horizontal flip.
11211134---------------------------------------------------------------*/
11221135
1123void draw_rle_zoom_hflip(mame_bitmap *bitmap, const struct atarirle_info *gfx,
1136void draw_rle_zoom_hflip(mame_bitmap *bitmap, const atarirle_info *gfx,
11241137      UINT32 palette, int sx, int sy, int scalex, int scaley,
11251138      const rectangle *clip)
11261139{
src/mame/video/atarirle.h
r1490r1491
1/*##########################################################################
1/***************************************************************************
22
33    atarirle.h
44
55    Common RLE-based motion object management functions for early 90's
66    Atari raster games.
77
8##########################################################################*/
8***************************************************************************/
99
1010#ifndef __ATARIRLE__
1111#define __ATARIRLE__
1212
1313
14/*##########################################################################
14/***************************************************************************
1515    CONSTANTS
16##########################################################################*/
16***************************************************************************/
1717
1818/* maximum number of motion object processors */
1919#define ATARIRLE_MAX            1
r1490r1491
3232#define ATARIRLE_COMMAND_CHECKSUM   2
3333
3434
35/*##########################################################################
35
36/***************************************************************************
3637    TYPES & STRUCTURES
37##########################################################################*/
38***************************************************************************/
3839
3940/* description for an eight-word mask */
41typedef struct atarirle_entry atarirle_entry;
4042struct atarirle_entry
4143{
4244   UINT16         data[8];
4345};
4446
4547/* description of the motion objects */
48typedef struct atarirle_desc atarirle_desc;
4649struct atarirle_desc
4750{
48   UINT8            region;            /* region where the GFX data lives */
49   UINT16            spriteramentries;   /* number of entries in sprite RAM */
50   UINT16            leftclip;         /* left clip coordinate */
51   UINT16            rightclip;         /* right clip coordinate */
51   UINT8         region;            /* region where the GFX data lives */
52   UINT16         spriteramentries;   /* number of entries in sprite RAM */
53   UINT16         leftclip;         /* left clip coordinate */
54   UINT16         rightclip;         /* right clip coordinate */
5255
53   UINT16            palettebase;      /* base palette entry */
54   UINT16            maxcolors;         /* maximum number of colors */
56   UINT16         palettebase;      /* base palette entry */
57   UINT16         maxcolors;         /* maximum number of colors */
5558
56   struct atarirle_entry codemask;         /* mask for the code index */
57   struct atarirle_entry colormask;      /* mask for the color */
58   struct atarirle_entry xposmask;         /* mask for the X position */
59   struct atarirle_entry yposmask;         /* mask for the Y position */
60   struct atarirle_entry scalemask;      /* mask for the scale factor */
61   struct atarirle_entry hflipmask;      /* mask for the horizontal flip */
62   struct atarirle_entry ordermask;      /* mask for the order */
63   struct atarirle_entry prioritymask;      /* mask for the priority */
64   struct atarirle_entry vrammask;         /* mask for the VRAM target */
59   atarirle_entry    codemask;         /* mask for the code index */
60   atarirle_entry    colormask;         /* mask for the color */
61   atarirle_entry    xposmask;         /* mask for the X position */
62   atarirle_entry    yposmask;         /* mask for the Y position */
63   atarirle_entry    scalemask;         /* mask for the scale factor */
64   atarirle_entry    hflipmask;         /* mask for the horizontal flip */
65   atarirle_entry    ordermask;         /* mask for the order */
66   atarirle_entry    prioritymask;      /* mask for the priority */
67   atarirle_entry    vrammask;         /* mask for the VRAM target */
6568};
6669
6770
6871
69/*##########################################################################
72/***************************************************************************
7073    FUNCTION PROTOTYPES
71##########################################################################*/
74***************************************************************************/
7275
7376/* setup/shutdown */
74void atarirle_init(int map, const struct atarirle_desc *desc);
77void atarirle_init(int map, const atarirle_desc *desc);
7578
7679/* control handlers */
7780void atarirle_control_w(int map, UINT8 bits);
r1490r1491
8790
8891
8992
90/*##########################################################################
93/***************************************************************************
9194    GLOBAL VARIABLES
92##########################################################################*/
95***************************************************************************/
9396
9497extern UINT16 *atarirle_0_spriteram;
9598extern UINT32 *atarirle_0_spriteram32;
src/mame/video/btoads.c
r1490r1491
294294   else if (address >= 0xa4000000 && address <= 0xa7ffffff)
295295   {
296296      sprite_dest_base = &vram_fg_draw[TOWORD(address & 0x3fc000)];
297      sprite_dest_offs = (INT16)((address & 0x3ff) << 2) >> 2;
297      sprite_dest_offs = (address & 0x003fff) >> 5;
298298   }
299299
300300   /* reads from this region set the sprite source address */
r1490r1491
351351   int coladdr = fulladdr & 0x3ff;
352352   int x;
353353
354   if (BT_DEBUG)
355      popmessage("screen_control = %02X", screen_control);
356
357354   /* for each scanline, switch off the render mode */
358355   switch (screen_control & 3)
359356   {
360357      /* mode 0: used in ship level, snake boss, title screen (free play) */
361358      /* priority is:
362            1. BG1 pixels with the high bit set
363            2. Sprites
364            3. BG1
365            4. BG0
359            1. Sprite pixels with high bit clear
360            2. BG1 pixels with the high bit set
361            3. Sprites
362            4. BG1
363            5. BG0
366364        */
367365      case 0:
368366         for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++)
369367         {
370            UINT16 bg0pix = bg0_base[(coladdr + xscroll0) & 0xff];
371            UINT16 bg1pix = bg1_base[(coladdr + xscroll1) & 0xff];
372368            UINT8 sprpix = spr_base[coladdr & 0xff];
373369
374            if (bg1pix & 0x80)
375               dst[x + 0] = bg1pix & 0xff;
376            else if (sprpix)
370            if (sprpix && !(sprpix & 0x80))
371            {
377372               dst[x + 0] = sprpix;
378            else if (bg1pix & 0xff)
379               dst[x + 0] = bg1pix & 0xff;
373               dst[x + 1] = sprpix;
374            }
380375            else
381               dst[x + 0] = bg0pix & 0xff;
376            {
377               UINT16 bg0pix = bg0_base[(coladdr + xscroll0) & 0xff];
378               UINT16 bg1pix = bg1_base[(coladdr + xscroll1) & 0xff];
379               UINT8 sprpix = spr_base[coladdr & 0xff];
382380
383            if (bg1pix & 0x8000)
384               dst[x + 1] = bg1pix >> 8;
385            else if (sprpix)
386               dst[x + 1] = sprpix;
387            else if (bg1pix >> 8)
388               dst[x + 1] = bg1pix >> 8;
389            else
390               dst[x + 1] = bg0pix >> 8;
381               if (bg1pix & 0x80)
382                  dst[x + 0] = bg1pix & 0xff;
383               else if (sprpix)
384                  dst[x + 0] = sprpix;
385               else if (bg1pix & 0xff)
386                  dst[x + 0] = bg1pix & 0xff;
387               else
388                  dst[x + 0] = bg0pix & 0xff;
389
390               if (bg1pix & 0x8000)
391                  dst[x + 1] = bg1pix >> 8;
392               else if (sprpix)
393                  dst[x + 1] = sprpix;
394               else if (bg1pix >> 8)
395                  dst[x + 1] = bg1pix >> 8;
396               else
397                  dst[x + 1] = bg0pix >> 8;
398            }
391399         }
392400         break;
393401
r1490r1491
396404            1. Sprite pixels with high bit clear
397405            2. BG0
398406            3. BG1 pixels with high bit set
399            4. Sprite pixels with high bit set
407            4. Sprites
400408            5. BG1
401409        */
402410      case 1:
r1490r1491
511519
512520   /* debugging - dump the screen contents to a file */
513521#if BT_DEBUG
522   popmessage("screen_control = %02X", screen_control & 0x7f);
523
514524   if (input_code_pressed(KEYCODE_X))
515525   {
516526      static int count = 0;
r1490r1491
518528      FILE *f;
519529      int i;
520530
531      while (input_code_pressed(KEYCODE_X)) ;
532
521533      sprintf(name, "disp%d.log", count++);
522534      f = fopen(name, "w");
523535      fprintf(f, "screen_control = %04X\n\n", screen_control << 8);
src/mame/video/atarisy1.c
r1490r1491
6464static UINT8 bank_gfx[3][8];
6565static UINT8 bank_color_shift[MAX_GFX_ELEMENTS];
6666
67/* basic form of a graphics bank */
68static gfx_layout objlayout =
67static const gfx_layout objlayout_4bpp =
6968{
7069   8,8,   /* 8*8 sprites */
7170   4096,   /* 4096 of them */
71   4,      /* 4 bits per pixel */
72   { 3*8*0x10000, 2*8*0x10000, 1*8*0x10000, 0*8*0x10000 },
73   { 0, 1, 2, 3, 4, 5, 6, 7 },
74   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
75   8*8      /* every sprite takes 8 consecutive bytes */
76};
77
78static const gfx_layout objlayout_5bpp =
79{
80   8,8,   /* 8*8 sprites */
81   4096,   /* 4096 of them */
82   5,      /* 5 bits per pixel */
83   { 4*8*0x10000, 3*8*0x10000, 2*8*0x10000, 1*8*0x10000, 0*8*0x10000 },
84   { 0, 1, 2, 3, 4, 5, 6, 7 },
85   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
86   8*8      /* every sprite takes 8 consecutive bytes */
87};
88
89static const gfx_layout objlayout_6bpp =
90{
91   8,8,   /* 8*8 sprites */
92   4096,   /* 4096 of them */
7293   6,      /* 6 bits per pixel */
7394   { 5*8*0x10000, 4*8*0x10000, 3*8*0x10000, 2*8*0x10000, 1*8*0x10000, 0*8*0x10000 },
7495   { 0, 1, 2, 3, 4, 5, 6, 7 },
r1490r1491
607628
608629static int get_bank(running_machine *machine, UINT8 prom1, UINT8 prom2, int bpp)
609630{
610   int bank_index, i, gfx_index;
631   int bank_index, gfx_index;
611632
612633   /* determine the bank index */
613634   if ((prom1 & PROM1_BANK_1) == 0)
r1490r1491
644665         break;
645666   assert(gfx_index != MAX_GFX_ELEMENTS);
646667
647   /* tweak the structure for the number of bitplanes we have */
648   objlayout.planes = bpp;
649   for (i = 0; i < bpp; i++)
650      objlayout.planeoffset[i] = (bpp - i - 1) * 0x10000 * 8;
668   /* decode the graphics */
669   switch (bpp)
670   {
671   case 4:
672      machine->gfx[gfx_index] = allocgfx(&objlayout_4bpp);
673      break;
651674
652   /* decode the graphics */
653   machine->gfx[gfx_index] = allocgfx(&objlayout);
675   case 5:
676      machine->gfx[gfx_index] = allocgfx(&objlayout_5bpp);
677      break;
678
679   case 6:
680      machine->gfx[gfx_index] = allocgfx(&objlayout_6bpp);
681      break;
682
683   default:
684      fatalerror("Unsupported bpp");
685   }
654686   decodegfx(machine->gfx[gfx_index], &memory_region(REGION_GFX2)[0x80000 * (bank_index - 1)], 0, machine->gfx[gfx_index]->total_elements);
655687
656688   /* set the color information */
src/mame/video/atarig42.c
r1490r1491
9393
9494VIDEO_START( atarig42 )
9595{
96   static const struct atarirle_desc modesc =
96   static const atarirle_desc modesc =
9797   {
9898      REGION_GFX3,/* region where the GFX data lives */
9999      256,      /* number of entries in sprite RAM */
r1490r1491
113113      {{ 0,0x0e00,0,0,0,0,0,0 }},   /* mask for the priority */
114114      {{ 0 }}                  /* mask for the VRAM target */
115115   };
116   struct atarirle_desc adjusted_modesc = modesc;
116   atarirle_desc adjusted_modesc = modesc;
117117   int i;
118118
119119   /* blend the playfields and free the temporary one */
src/mame/video/midvunit.c
r1490r1491
7979   scanline_timer = timer_alloc(scanline_timer_cb, NULL);
8080   poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
8181   add_exit_callback(machine, midvunit_exit);
82
83   state_save_register_global_array(video_regs);
84   state_save_register_global_array(dma_data);
85   state_save_register_global(dma_data_index);
86   state_save_register_global(page_control);
87   state_save_register_global(video_changed);
8288}
8389
8490
src/mame/video/cvs.c
r1490r1491
1313#define MAX_STARS        250
1414#define STARS_COLOR_BASE 16
1515
16
1617#ifdef LSB_FIRST
1718#define BL0 0
1819#define BL1 1
r1490r1491
2930#define WL1 0
3031#endif
3132
33
3234struct star
3335{
3436   int x,y,code;
3537};
3638
37static struct star stars[MAX_STARS];
38static int    total_stars;
39static int    scroll[8];
40static int    stars_on=0;
41static int      character_mode=0;
42static int    character_page=0;
43static int    scroll_reg = 0;
44static int    stars_scroll=0;
4539
46static UINT8 *dirty_character;
47static UINT8 *character_1_ram;
48static UINT8 *character_2_ram;
49static UINT8 *character_3_ram;
40UINT8 *cvs_color_ram;
41UINT8 *cvs_video_ram;
5042UINT8 *cvs_bullet_ram;
5143
44static UINT8 *palette_ram;
45static UINT8 *character_ram;
46
47static struct star stars[MAX_STARS];
48static int    total_stars;
49static int    stars_on;
50static UINT8  character_mode;
51static UINT16 character_ram_page;
52static UINT8  scroll_reg;
53static int    stars_scroll;
54
55static mame_bitmap *background_bitmap;
5256mame_bitmap *cvs_collision_bitmap;
5357mame_bitmap *cvs_collision_background;
5458static mame_bitmap *scrolled_background;
5559
56int cvs_collision_register=0;
60int cvs_collision_register;
5761
58static const int ModeOffset[4] = {223,191,255,127};
5962
6063/******************************************************
6164 * Convert Colour prom to format for Mame Colour Map  *
r1490r1491
8083        {
8184             map = color_prom[(col * 256) + attr];
8285
83            /* bits 1 and 3 are swopped over */
86            /* bits 0 and 2 are swapped */
8487
8588            COLOR(0,attr*8 + col) = ((map & 1) << 2) + (map & 2) + ((map & 4) >> 2);
8689        }
r1490r1491
103106       COLOR(0,map*2 + 2073) = 8 + map;
104107    }
105108
106    /* Initialise Dirty Character Array */
107   dirty_character = auto_malloc(0x100);
108   character_1_ram = auto_malloc(0x2000);
109   character_2_ram = character_1_ram + 0x800;
110   character_3_ram = character_2_ram + 0x800;
111
112   memset(dirty_character, 0, 256);
113    memset(character_1_ram, 0, 1024);
114    memset(character_2_ram, 0, 1024);
115    memset(character_3_ram, 0, 1024);
116
117    /* Set Sprite chip offsets */
118
109    /* set the sprite chip offsets */
119110   s2636_x_offset = -26;
120111   s2636_y_offset = 3;
121
122    /* Set Scroll fixed areas */
123
124    scroll[0]=0;
125    scroll[6]=0;
126    scroll[7]=0;
127112}
128113
114
129115WRITE8_HANDLER( cvs_video_fx_w )
130116{
131   logerror("%4x : Data Port = %2x\n",activecpu_get_pc(),data);
117   if (data & 0xce)
118      logerror("%4x : Unimplemented CVS video fx = %2x\n",activecpu_get_pc(),data);
132119
133    /* Unimplemented */
120    stars_on = data & 0x01;
134121
135    if(data & 2)   logerror("       SHADE BRIGHTER TO RIGHT\n");
136    if(data & 4)   logerror("       SCREEN ROTATE\n");
137    if(data & 8)   logerror("       SHADE BRIGHTER TO LEFT\n");
138    if(data & 64)  logerror("       SHADE BRIGHTER TO BOTTOM\n");
139    if(data & 128) logerror("       SHADE BRIGHTER TO TOP\n");
122    if (data & 0x02)   logerror("       SHADE BRIGHTER TO RIGHT\n");
123    if (data & 0x04)   logerror("       SCREEN ROTATE\n");
124    if (data & 0x08)   logerror("       SHADE BRIGHTER TO LEFT\n");
140125
141    /* Implemented */
126    set_led_status(1, data & 0x10);   /* lamp 1 */
127    set_led_status(2, data & 0x20);   /* lamp 2 */
142128
143    stars_on = data & 1;
144    set_led_status(1,data & 16);   /* Lamp 1 */
145    set_led_status(2,data & 32);   /* Lamp 2 */
129    if (data & 0x40)   logerror("       SHADE BRIGHTER TO BOTTOM\n");
130    if (data & 0x80)   logerror("       SHADE BRIGHTER TO TOP\n");
146131}
147132
148READ8_HANDLER( cvs_character_mode_r )
133
134
135READ8_HANDLER( cvs_input_r )
149136{
150   /* Really a write - uses address info */
137   UINT8 ret;
151138
152    int value   = offset + 0x10;
153    int newmode = (value >> 4) & 3;
139   /* the upper 4 bits of the address is used to select the tile banking attributes */
140   character_mode = (offset >> 4) & 0x03;
141   character_ram_page = (offset << 2) & 0x300;
154142
155    character_mode = newmode;
156    character_page = (value << 2) & 0x300;
143   /* the lower 4 (or 3?) bits select the port to read */
144   switch (offset & 0x0f)   /* might be 0x07 */
145   {
146   case 0x00:  ret = input_port_0_r(0); break;
147   case 0x02:  ret = input_port_1_r(0); break;
148   case 0x03:  ret = input_port_2_r(0); break;
149   case 0x04:  ret = input_port_3_r(0); break;
150   case 0x06:  ret = input_port_4_r(0); break;
151   case 0x07:  ret = input_port_5_r(0); break;
152   default:    ret = 0x00; break;
153   }
157154
158    return 0;
155   return ret;
159156}
160157
158
161159READ8_HANDLER( cvs_collision_r )
162160{
163161   return cvs_collision_register;
r1490r1491
165163
166164READ8_HANDLER( cvs_collision_clear )
167165{
168   cvs_collision_register=0;
166   cvs_collision_register = 0;
167
169168   return 0;
170169}
171170
171
172172WRITE8_HANDLER( cvs_scroll_w )
173173{
174174   scroll_reg = 255 - data;
175
176    scroll[1]=scroll_reg;
177    scroll[2]=scroll_reg;
178    scroll[3]=scroll_reg;
179    scroll[4]=scroll_reg;
180    scroll[5]=scroll_reg;
181175}
182176
183WRITE8_HANDLER( cvs_videoram_w )
184{
185   if(!activecpu_get_reg(S2650_FO))
186    {
187       // Colour Map
188177
189        colorram_w(offset,data);
190    }
191    else
192    {
193       // Data
194
195        videoram_w(offset,data);
196    }
178READ8_HANDLER( cvs_video_or_color_ram_r )
179{
180   if (!activecpu_get_reg(S2650_FO))
181      return cvs_color_ram[offset];
182   else
183      return cvs_video_ram[offset];
197184}
198185
199READ8_HANDLER( cvs_videoram_r )
186WRITE8_HANDLER( cvs_video_or_color_ram_w )
200187{
201   if(!activecpu_get_reg(S2650_FO))
202    {
203       // Colour Map
204
205        return colorram[offset];
206    }
207    else
208    {
209       // Data
210
211        return videoram[offset];
212    }
188   if (!activecpu_get_reg(S2650_FO))
189      cvs_color_ram[offset] = data;
190   else
191      cvs_video_ram[offset] = data;
213192}
214193
215WRITE8_HANDLER( cvs_bullet_w )
216{
217   if(!activecpu_get_reg(S2650_FO))
218    {
219       // Bullet Ram
220194
221        cvs_bullet_ram[offset] = data;
222    }
223    else
224    {
225       // Pallette Ram - Inverted ?
226      offset &= 0x0f;
227      data ^= 0xff;
228
229      paletteram[offset] = data;
230      palette_set_color_rgb(Machine, offset, pal2bit(data >> 0), pal3bit(data >> 2), pal3bit(data >> 5));
231    }
195READ8_HANDLER( cvs_bullet_ram_or_palette_r )
196{
197   if (!activecpu_get_reg(S2650_FO))
198      return cvs_bullet_ram[offset];
199   else
200      return palette_ram[offset & 0x0f];
232201}
233202
234READ8_HANDLER( cvs_bullet_r )
203WRITE8_HANDLER( cvs_bullet_ram_or_palette_w )
235204{
236   if(!activecpu_get_reg(S2650_FO))
237    {
238       // Bullet Ram
239
240        return cvs_bullet_ram[offset];
241    }
242    else
243    {
244       // Pallette Ram
245
246        return (paletteram[offset] ^ 0xff);
247    }
205   if (!activecpu_get_reg(S2650_FO))
206      cvs_bullet_ram[offset] = data;
207   else
208      palette_ram[offset & 0x0f] = data;
248209}
249210
250WRITE8_HANDLER( cvs_2636_1_w )
251{
252   if(!activecpu_get_reg(S2650_FO))
253    {
254       // First 2636
255211
256        s2636_w(s2636_1_ram,offset,data,s2636_1_dirty);
257    }
258    else
259    {
260       // Character Ram 1
261
262        if(character_1_ram[character_page + offset] != data)
263        {
264           character_1_ram[character_page + offset] = data;
265         dirty_character[128+((character_page + offset)>>3)] = 1;
266        }
267   }
212READ8_HANDLER( cvs_s2636_1_or_character_ram_r )
213{
214   if (!activecpu_get_reg(S2650_FO))
215      return s2636_1_ram[offset];
216   else
217      return character_ram[(0 * 0x800) | 0x400 | character_ram_page | offset];
268218}
269219
270READ8_HANDLER( cvs_2636_1_r )
220WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w )
271221{
272   if(!activecpu_get_reg(S2650_FO))
273    {
274       // First 2636
275
276        return s2636_1_ram[offset];
277    }
278    else
279    {
280       // Character Ram 1
281
282        return character_1_ram[character_page + offset];
283    }
222   if (!activecpu_get_reg(S2650_FO))
223      s2636_1_ram[offset] = data;
224   else
225      character_ram[(0 * 0x800) | 0x400 | character_ram_page | offset] = data;
284226}
285227
286WRITE8_HANDLER( cvs_2636_2_w )
287{
288   if(!activecpu_get_reg(S2650_FO))
289    {
290       // Second 2636
291228
292        s2636_w(s2636_2_ram,offset,data,s2636_2_dirty);
293    }
294    else
295    {
296       // Character Ram 2
297
298        if(character_2_ram[character_page + offset] != data)
299        {
300           character_2_ram[character_page + offset] = data;
301         dirty_character[128+((character_page + offset)>>3)] = 1;
302        }
303    }
229READ8_HANDLER( cvs_s2636_2_or_character_ram_r )
230{
231   if (!activecpu_get_reg(S2650_FO))
232      return s2636_2_ram[offset];
233   else
234      return character_ram[(1 * 0x800) | 0x400 | character_ram_page | offset];
304235}
305236
306READ8_HANDLER( cvs_2636_2_r )
237WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w )
307238{
308   if(!activecpu_get_reg(S2650_FO))
309    {
310       // Second 2636
311
312        return s2636_2_ram[offset];
313    }
314    else
315    {
316       // Character Ram 2
317
318        return character_2_ram[character_page + offset];
319    }
239   if (!activecpu_get_reg(S2650_FO))
240      s2636_2_ram[offset] = data;
241   else
242      character_ram[(1 * 0x800) | 0x400 | character_ram_page | offset] = data;
320243}
321244
322WRITE8_HANDLER( cvs_2636_3_w )
323{
324   if(!activecpu_get_reg(S2650_FO))
325    {
326       // Third 2636
327245
328        s2636_w(s2636_3_ram,offset,data,s2636_3_dirty);
329    }
330    else
331    {
332       // Character Ram 3
333
334        if(character_3_ram[character_page + offset] != data)
335        {
336           character_3_ram[character_page + offset] = data;
337         dirty_character[128+((character_page + offset)>>3)] = 1;
338        }
339    }
246READ8_HANDLER( cvs_s2636_3_or_character_ram_r )
247{
248   if (!activecpu_get_reg(S2650_FO))
249      return s2636_3_ram[offset];
250   else
251      return character_ram[(2 * 0x800) | 0x400 | character_ram_page | offset];
340252}
341253
342READ8_HANDLER( cvs_2636_3_r )
254WRITE8_HANDLER( cvs_s2636_3_or_character_ram_w )
343255{
344   if(!activecpu_get_reg(S2650_FO))
345    {
346       // Third 2636
347
348        return s2636_3_ram[offset];
349    }
350    else
351    {
352       // Character Ram 3
353
354        return character_3_ram[character_page + offset];
355    }
256   if (!activecpu_get_reg(S2650_FO))
257      s2636_3_ram[offset] = data;
258   else
259      character_ram[(2 * 0x800) | 0x400 | character_ram_page | offset] = data;
356260}
357261
262
358263VIDEO_START( cvs )
359264{
360265   int generator = 0;
361    int x,y;
266   int y;
362267
363   colorram = auto_malloc(0x400);
364   paletteram = auto_malloc(0x100);
365268
366   video_start_generic(machine);
269   /* allocate memory */
270   cvs_color_ram = auto_malloc(0x400);
271   palette_ram = auto_malloc(0x10);
272   character_ram = auto_malloc(3 * 0x800);  /* only half is used, but
273                                                by allocating twice the amount,
274                                                we can use the same gfx_layout */
367275
368276   /* precalculate the star background */
369277
r1490r1491
371279
372280   for (y = 255;y >= 0;y--)
373281   {
282      int x;
283
374284      for (x = 511;x >= 0;x--)
375285      {
376286         int bit1,bit2;
r1490r1491
398308      }
399309   }
400310
401   /* Need 3 bitmaps for 2636 chips */
402311
403   s2636_1_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
404   s2636_2_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
405   s2636_3_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
312   /* create the bitmaps for the S2636 chips */
313   s2636_1_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
314   s2636_2_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
315   s2636_3_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
406316
407   /* 3 bitmaps for collision detection */
408317
409   cvs_collision_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
410   cvs_collision_background = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
411   scrolled_background = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
318   /* create helper bitmaps */
319   background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
320   cvs_collision_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
321   cvs_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
322   scrolled_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
412323}
413324
325
326
414327INTERRUPT_GEN( cvs_interrupt )
415328{
416329   stars_scroll++;
r1490r1491
419332   cpunum_set_input_line(0,0,PULSE_LINE);
420333}
421334
422INLINE void plot_star(running_machine* machine, mame_bitmap *bitmap, int x, int y)
423{
424   if (flip_screen_x)
425   {
426      x = 255 - x;
427   }
428   if (flip_screen_y)
429   {
430      y = 255 - y;
431   }
432335
433   if (*BITMAP_ADDR16(bitmap, y, x) == machine->pens[0])
434   {
435      *BITMAP_ADDR16(bitmap, y, x) = machine->pens[7];
436   }
437}
438336
439337VIDEO_UPDATE( cvs )
440338{
441   int offs;
339   const int ram_based_char_start_indecies[] = { 0xe0, 0xc0, 0x100, 0x80 };
340   int code;
341   offs_t offs;
342   int scroll[8];
442343
443   /* for every character in the Video RAM, check if it has been modified */
444   /* since last time and update it accordingly. */
445344
446   for (offs = videoram_size - 1;offs >= 0;offs--)
345   /* set the palette */
346   for (offs = 0; offs < 0x10; offs++)
447347   {
448      int character_bank;
449      int forecolor;
348      UINT8 data = palette_ram[offs];
450349
451        int character = videoram[offs];
350      palette_set_color_rgb(machine, offs, pal2bit(~data >> 0), pal3bit(~data >> 2), pal3bit(~data >> 5));
351   }
452352
453      int sx = (offs % 32) * 8;
454      int sy = (offs / 32) * 8;
455353
456      /* Decide if RAM or ROM based character */
354   /* create our background character set, which is a software
355       selectable mixture of RAM and ROM based tiles */
457356
458      if(character > ModeOffset[character_mode])
459      {
460         /* re-generate character if dirty */
357   /* ROM based tiles first */
358   for (code = 0; code < ram_based_char_start_indecies[character_mode]; code++)
359      decodechar(machine->gfx[0], code, memory_region(REGION_GFX1),
360                 machine->drv->gfxdecodeinfo[0].gfxlayout);
461361
462         if (dirty_character[character])
463         {
464            decodechar(machine->gfx[1],character,character_1_ram-1024,machine->drv->gfxdecodeinfo[1].gfxlayout);
362   /* now the RAM based ones */
363   for (; code < 0x100; code++)
364      decodechar(machine->gfx[0], code, character_ram,
365                 machine->drv->gfxdecodeinfo[0].gfxlayout);
465366
466            dirty_character[character] = 0;
467         }
468367
469         character_bank=1;
470      }
471      else
472      {
473         character_bank=0;
474      }
368   /* draw the background */
369   for (offs = 0; offs < 0x0400; offs++)
370   {
371      int collision_color = 0;
475372
476      /* Main Screen */
373      UINT8 code = cvs_video_ram[offs];
374      UINT8 color = cvs_color_ram[offs];
477375
478      drawgfx(tmpbitmap,machine->gfx[character_bank],
479            character,
480            colorram[offs],
481            0,0,
482            sx,sy,
483            0,TRANSPARENCY_NONE,0);
376      UINT8 x = offs << 3;
377      UINT8 y = offs >> 5 << 3;
484378
379      drawgfx(background_bitmap, machine->gfx[0],
380            code, color,
381            0, 0,
382            x, y,
383            0, TRANSPARENCY_NONE, 0);
485384
486      /* Foreground for Collision Detection */
487
488      forecolor = 0;
489      if(colorram[offs] & 0x80)
490      {
491         forecolor=258;
492      }
385      /* foreground for collision detection */
386      if (color & 0x80)
387         collision_color = 258;
493388      else
494389      {
495         if((colorram[offs] & 0x03) == 3) forecolor=256;
496         else if((colorram[offs] & 0x01) == 0) forecolor=257;
390         if ((color & 0x03) == 3)
391            collision_color = 256;
392         else if((color & 0x01) == 0)
393            collision_color = 257;
497394      }
498395
499      if(forecolor)
500         drawgfx(cvs_collision_background,machine->gfx[character_bank],
501               character,
502               forecolor,
503               0,0,
504               sx,sy,
505               0,TRANSPARENCY_NONE,0);
396      if (collision_color)
397         drawgfx(cvs_collision_background, machine->gfx[0],
398               code, collision_color,
399               0, 0,
400               x, y,
401               0, TRANSPARENCY_NONE, 0);
506402   }
507403
508404
509405    /* Update screen - 8 regions, fixed scrolling area */
510406
511   copyscrollbitmap(bitmap,tmpbitmap,0,0,8,scroll,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
407    scroll[0] = 0;
408    scroll[1] = scroll_reg;
409    scroll[2] = scroll_reg;
410    scroll[3] = scroll_reg;
411    scroll[4] = scroll_reg;
412    scroll[5] = scroll_reg;
413    scroll[6] = 0;
414    scroll[7] = 0;
415
416   copyscrollbitmap(bitmap,background_bitmap,0,0,8,scroll,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
512417   copyscrollbitmap(scrolled_background,cvs_collision_background,0,0,8,scroll,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
513418
514419    /* 2636's */
515420
516421   fillbitmap(s2636_1_bitmap,0,0);
517   s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,s2636_1_dirty,2,cvs_collision_bitmap);
422   s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,1,cvs_collision_bitmap);
518423
519424   fillbitmap(s2636_2_bitmap,0,0);
520   s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,s2636_2_dirty,3,cvs_collision_bitmap);
425   s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,2,cvs_collision_bitmap);
521426
522427   fillbitmap(s2636_3_bitmap,0,0);
523   s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,s2636_3_dirty,4,cvs_collision_bitmap);
428   s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,3,cvs_collision_bitmap);
524429
525430    /* Bullet Hardware */
526431
527432    for (offs = 8; offs < 256; offs++ )
528433    {
529        if(cvs_bullet_ram[offs] != 0)
434        if (cvs_bullet_ram[offs] != 0)
530435        {
531436           int ct;
532437            for(ct=0;ct<4;ct++)
r1490r1491
559464    /* Update 2636 images */
560465
561466    {
562      int sx;
467      int x;
563468        UINT32 S1,S2,S3,SB,pen;
564469
565        for(sx=255;sx>7;sx--)
470        for(x=255;x>7;x--)
566471        {
567           UINT32 *sp1 = (UINT32 *)BITMAP_ADDR8(s2636_1_bitmap, sx, 0);
568          UINT32 *sp2 = (UINT32 *)BITMAP_ADDR8(s2636_2_bitmap, sx, 0);
569          UINT32 *sp3 = (UINT32 *)BITMAP_ADDR8(s2636_3_bitmap, sx, 0);
570           UINT64 *dst = (UINT64 *)BITMAP_ADDR16(bitmap, sx, 0);
571          UINT8  *spb = (UINT8  *)BITMAP_ADDR8(scrolled_background, sx, 0);
472           UINT32 *sp1 = (UINT32 *)BITMAP_ADDR8(s2636_1_bitmap, x, 0);
473          UINT32 *sp2 = (UINT32 *)BITMAP_ADDR8(s2636_2_bitmap, x, 0);
474          UINT32 *sp3 = (UINT32 *)BITMAP_ADDR8(s2636_3_bitmap, x, 0);
475           UINT64 *dst = (UINT64 *)BITMAP_ADDR16(bitmap, x, 0);
476          UINT8  *spb = (UINT8  *)BITMAP_ADDR8(scrolled_background, x, 0);
572477
573478            for(offs=0;offs<62;offs++)
574479            {
r1490r1491
612517        }
613518    }
614519
615    /* Stars */
616520
617    if(stars_on)
618    {
521    /* stars circuit */
522
523   if (stars_on)
524   {
619525      for (offs = 0;offs < total_stars;offs++)
620526      {
621         int x,y;
527         UINT8 x = (stars[offs].x + stars_scroll) >> 1;
528         UINT8 y = stars[offs].y + ((stars_scroll + stars[offs].x) >> 9);
622529
623
624         x = ((stars[offs].x + stars_scroll) % 512) / 2;
625         y = (stars[offs].y + (stars_scroll + stars[offs].x) / 512) % 256;
626
627530         if (y >= machine->screen[0].visarea.min_y &&
628531            y <= machine->screen[0].visarea.max_y)
629532         {
630533            if ((y & 1) ^ ((x >> 4) & 1))
631534            {
632               plot_star(machine, bitmap, x, y);
535               if (flip_screen_x)
536                  x = ~x;
537
538               if (flip_screen_y)
539                  y = ~y;
540
541               if (*BITMAP_ADDR16(bitmap, y, x) == machine->pens[0])
542               {
543                  *BITMAP_ADDR16(bitmap, y, x) = machine->pens[7];
544               }
633545            }
634546         }
635547      }
548   }
636549
637    }
550
638551   return 0;
639552}
src/mame/video/othunder.c
r1490r1491
3838
3939VIDEO_START( othunder )
4040{
41   /* There is a problem here. 4 is correct for text layer/sprite
42       alignment, but the bg layers [or one of them] are wrong */
43
4441   taito_hide_pixels = 4;
4542   video_start_othunder_core(machine);
4643}
src/mame/video/quasar.c
r1490r1491
1515***************************************************************************/
1616
1717#include "driver.h"
18#include "cvs.h"
1819#include "video/s2636.h"
1920#include "cpu/s2650/s2650.h"
2021
r1490r1491
3435#define WL1 0
3536#endif
3637
37// All defined in video/cvs.c
3838
39VIDEO_START( cvs );
40
41extern UINT8 *cvs_bullet_ram;
42
43extern mame_bitmap *cvs_collision_bitmap;
44extern mame_bitmap *cvs_collision_background;
45
46
47extern int cvs_collision_register;
48
49
5039// Used here
5140//static int    scroll[8];
5241//static int    scroll_reg = 0;
r1490r1491
5544int quasar_effectcontrol;
5645
5746static mame_bitmap *effect_bitmap;
47static mame_bitmap *background_bitmap;
5848
5949PALETTE_INIT( quasar )
6050{
r1490r1491
127117
128118   s2636_x_offset = -26;
129119   s2636_y_offset = 3;
130
131   memset(s2636_1_dirty,0,sizeof(s2636_1_dirty));
132   memset(s2636_2_dirty,0,sizeof(s2636_2_dirty));
133   memset(s2636_3_dirty,0,sizeof(s2636_3_dirty));
134120}
135121
136122VIDEO_START( quasar )
r1490r1491
138124   quasar_effectram   = auto_malloc(0x400);
139125
140126   effect_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
127   background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
141128
142129   video_start_cvs(machine);
143130}
r1490r1491
151138   /* for every character in the Video RAM, check if it has been modified */
152139   /* since last time and update it accordingly. */
153140
154   for (offs = videoram_size - 1;offs >= 0;offs--)
141   for (offs = 0; offs < 0x0400; offs++)
155142   {
156        character = videoram[offs];
143        character = cvs_video_ram[offs];
157144
158145      sx = (offs % 32) * 8;
159146      sy = (offs / 32) * 8;
r1490r1491
172159
173160      /* Main Screen */
174161
175      drawgfx(tmpbitmap,machine->gfx[0],
162      drawgfx(background_bitmap,machine->gfx[0],
176163            character,
177            colorram[offs],
164            cvs_color_ram[offs],
178165            0,0,
179166            sx,sy,
180167            0,TRANSPARENCY_NONE,0);
r1490r1491
182169
183170      /* background for Collision Detection (it can only hit certain items) */
184171
185      if((colorram[offs] & 7) == 0)
172      if((cvs_color_ram[offs] & 7) == 0)
186173      {
187174         drawgfx(cvs_collision_background,machine->gfx[0],
188175               character,
r1490r1491
196183    /* Update screen */
197184
198185   copybitmap(bitmap,effect_bitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
199   copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN,0);
186   copybitmap(bitmap,background_bitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_PEN,0);
200187
201188    /* 2636's */
202189
203190   fillbitmap(s2636_1_bitmap,0,0);
204   s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,s2636_1_dirty,2,cvs_collision_bitmap);
191   s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,1,cvs_collision_bitmap);
205192
206193   fillbitmap(s2636_2_bitmap,0,0);
207   s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,s2636_2_dirty,3,cvs_collision_bitmap);
194   s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,2,cvs_collision_bitmap);
208195
209196   fillbitmap(s2636_3_bitmap,0,0);
210   s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,s2636_3_dirty,4,cvs_collision_bitmap);
197   s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,3,cvs_collision_bitmap);
211198
212199    /* Bullet Hardware */
213200
src/mame/video/kingobox.c
r1490r1491
201201{
202202   int offs;
203203
204   for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
204   for (offs = 0; offs < spriteram_size; offs += 4)
205205   {
206      int bank = (spriteram[offs + 3] & 0x04) >> 2;
207      int code = spriteram[offs + 2] + ((spriteram[offs + 3] & 0x03) << 8);
208      int color = ((spriteram[offs + 3] & 0x70) >> 4) + 8 * palette_bank;
209      int flipx = 0;
210      int flipy = spriteram[offs + 3] & 0x80;
211      int sx = spriteram[offs+1];
212      int sy = spriteram[offs];
206      int roffs,bank,code,color,flipx,flipy,sx,sy;
213207
208      /* the offset into spriteram seems scrambled */
209      roffs = BITSWAP16(offs,15,14,13,12,11,10,4,7,6,5,9,8,3,2,1,0) ^ 0x3c;
210      if (roffs & 0x200) roffs ^= 0x1c0;
211
212      bank = (spriteram[roffs + 3] & 0x04) >> 2;
213      code = spriteram[roffs + 2] + ((spriteram[roffs + 3] & 0x03) << 8);
214      color = ((spriteram[roffs + 3] & 0x70) >> 4) + 8 * palette_bank;
215      flipx = 0;
216      flipy = spriteram[roffs + 3] & 0x80;
217      sx = spriteram[roffs+1];
218      sy = spriteram[roffs];
219
214220      if (flip_screen)
215221      {
216222         sx = 240 - sx;
src/mame/video/tatsumi.c
r1490r1491
22#include "tatsumi.h"
33#include <math.h>
44
5static tilemap *bg_layer,*tx_layer;
5static tilemap *tx_layer;
6static tilemap *layer0, *layer1, *layer2, *layer3;
7
68static mame_bitmap *temp_bitmap;
79
810UINT16 *roundup_r_ram, *roundup_p_ram, *roundup_l_ram;
9UINT16 *cyclwarr_videoram, *cyclwarr_videoram2;
11UINT16 *cyclwarr_videoram0, *cyclwarr_videoram1;
1012UINT16* tatsumi_sprite_control_ram;
1113static UINT16* roundup5_vram;
1214
15extern UINT16 bigfight_a20000[8], bigfight_a40000[2], bigfight_a60000[8];
16static UINT16 bigfight_bank, bigfight_last_bank;
17
18static UINT8 roundupt_crt_selected_reg;
19static UINT8 roundupt_crt_reg[64];
20extern UINT16 debugA,debugB,debugC,debugD;
21
22static UINT8* shadow_pen_array;
23
1324/******************************************************************************/
1425
1526WRITE16_HANDLER(tatsumi_sprite_control_w)
r1490r1491
113124   tilemap_mark_tile_dirty( tx_layer,offset);
114125}
115126
116READ16_HANDLER( cyclwarr_videoram_r )
127READ16_HANDLER( cyclwarr_videoram0_r )
117128{
118    return cyclwarr_videoram[offset];
129    return cyclwarr_videoram0[offset];
119130}
120131
121READ16_HANDLER( cyclwarr_videoram2_r )
132READ16_HANDLER( cyclwarr_videoram1_r )
122133{
123    return cyclwarr_videoram2[offset];
134    return cyclwarr_videoram1[offset];
124135}
125136
126WRITE16_HANDLER( cyclwarr_videoram_w )
137WRITE16_HANDLER( cyclwarr_videoram0_w )
127138{
128   COMBINE_DATA(&cyclwarr_videoram[offset]);
129   if (offset>=0x400 && offset<0x1400)
130      tilemap_mark_tile_dirty( tx_layer,offset - 0x400);
131   if (offset>=0x1400 && offset<0x3400)
132      tilemap_mark_tile_dirty( bg_layer,offset - 0x1400);
139   COMBINE_DATA(&cyclwarr_videoram0[offset]);
140   if (offset>=0x400)
141   {
142      tilemap_mark_tile_dirty( layer0, offset-0x400);
143      tilemap_mark_tile_dirty( layer1, offset-0x400);
144   }
133145}
134146
135WRITE16_HANDLER( cyclwarr_videoram2_w )
147WRITE16_HANDLER( cyclwarr_videoram1_w )
136148{
137   COMBINE_DATA(&cyclwarr_videoram2[offset]);
138   if (offset>=0x400 && offset<0x1400)
139      tilemap_mark_tile_dirty( tx_layer,offset - 0x400);
140   if (offset>=0x1400 && offset<0x3400)
141      tilemap_mark_tile_dirty( bg_layer,offset - 0x1400);
149   COMBINE_DATA(&cyclwarr_videoram1[offset]);
150   if (offset>=0x400)
151   {
152      tilemap_mark_tile_dirty( layer2, offset-0x400);
153      tilemap_mark_tile_dirty( layer3, offset-0x400);
154   }
142155}
143156
144static UINT8 roundupt_crt_selected_reg;
145static UINT8 roundupt_crt_reg[64];
146extern UINT16 debugA,debugB,debugC,debugD;
147
148static UINT8* shadow_pen_array;
149
150157WRITE16_HANDLER( roundup5_crt_w )
151158{
152159   if (offset==0 && ACCESSING_LSB)
r1490r1491
170177         0);
171178}
172179
173static TILE_GET_INFO( get_bg_tile_info_cyclwarr )
180static TILE_GET_INFO( get_tile_info_bigfight_0 )
174181{
175   int tile=cyclwarr_videoram2[tile_index+0x1400];
176   int color=tile >> 14;
177
178   tile=(tile&0x3fff) | 0x000;
179
180   SET_TILE_INFO(
181         1,
182         tile,
183         color,
184         0);
182   int tile=cyclwarr_videoram0[(tile_index+0x400)%0x8000];
183   int bank = (bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf;
184   SET_TILE_INFO(1,(tile&0x3ff)+(bank<<10),(tile>>12)&0xf,0);
185185}
186186
187static TILE_GET_INFO( get_text_tile_info_cyclwarr )
187static TILE_GET_INFO( get_tile_info_bigfight_1 )
188188{
189   int tile=cyclwarr_videoram[tile_index+0x400];
190   int color=tile >> 12;
191
192   tile=tile&0xfff;
193
194   SET_TILE_INFO(
195         1,
196         tile,
197         color,
198         0);
189   int tile=cyclwarr_videoram1[(tile_index+0x400)%0x8000];
190   int bank = (bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf;
191   SET_TILE_INFO(1,(tile&0x3ff)+(bank<<10),(tile>>12)&0xf,0);
199192}
200193
201194/********************************************************************/
r1490r1491
222215
223216VIDEO_START( cyclwarr )
224217{
225   bg_layer = tilemap_create(get_bg_tile_info_cyclwarr,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,256,256);
226   tx_layer = tilemap_create(get_text_tile_info_cyclwarr,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
218   layer0 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
219   //layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
220   layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
221   layer2 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
222   layer3 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
223
227224   shadow_pen_array = auto_malloc(8192);
225   memset(shadow_pen_array, 0, 8192);
226}
228227
228VIDEO_START( bigfight )
229{
230   layer0 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
231   layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
232   layer2 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
233   layer3 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
234
235   shadow_pen_array = auto_malloc(8192);
229236   memset(shadow_pen_array, 0, 8192);
230   tilemap_set_transparent_pen(bg_layer,0);
231   tilemap_set_transparent_pen(tx_layer,0);
232237}
233238
234239/********************************************************************/
r1490r1491
537542                    0x0007 - ?
538543            Word 2: 0xffff - X position
539544            Word 3: 0xffff - Y position
540            Word 4: 0x01ff - Rotation
545            Word 4: 0x01ff - Scale
546            Word 5: 0x01ff - Rotation
541547
542548            Sprite ROM table format, alternate lines come from each bank, with the
543549            very first line indicating control information:
r1490r1491
556562        */
557563      y = spriteram16[offs+3];
558564      x = spriteram16[offs+2];
559      scale = spriteram16[offs+4]&0xff;
565      scale = spriteram16[offs+4]&0x1ff;
560566      color = (spriteram16[offs+1]>>3)&0x1ff;
561567      fx = spriteram16[offs+1]&0x8000;
562568      rotate = 0;//spriteram16[offs+5]&0x1ff; // Todo:  Turned off for now
r1490r1491
570576      if (index==0xffff || spriteram16[offs+4]==0xffff) //todo
571577         return;
572578
573      if (index>=0x1000)
579      if (index>=0x4000)
574580         continue;
575581
576582      src1 = tatsumi_rom_sprite_lookup1 + (index*4);
r1490r1491
618624            if (!rotate)
619625            {
620626               if (fx)
621                  x_pos=render_x-x_offs;
627                  x_pos=render_x-x_offs-scale*8;
622628               else
623629                  x_pos=render_x+x_offs;
624630            }
r1490r1491
955961
956962/**********************************************************************/
957963
964static void draw_bg(running_machine *machine, mame_bitmap *dst, tilemap *src, const UINT16* scrollx, const UINT16* scrolly, const UINT16* tilemap_ram, int tile_bank, int xscroll_offset, int yscroll_offset, int xsize, int ysize)
965{
966   /*
967        Each tile (0x4000 of them) has a lookup table in ROM to build an individual 3-bit palette
968        from sets of 8 bit palettes!
969    */
970   const UINT8* tile_cluts = memory_region(REGION_GFX4);
971   const mame_bitmap *src_bitmap = tilemap_get_pixmap(src);
972   int src_y_mask=ysize-1;
973   int src_x_mask=xsize-1;
974   int tile_y_mask=(ysize/8)-1;
975   int tile_x_mask=(xsize/8)-1;
976   int tiles_per_x_line=(xsize/8);
977   int x, y, p, pp, ppp;
978
979   for (y=0; y<240; y++)
980   {
981      for (x=0; x<320; x++)
982      {
983         int src_x = x + scrollx[y] + xscroll_offset;
984         int src_y = y + scrolly[y] + yscroll_offset;
985         int tile_index = (((src_x>>3)&tile_x_mask) + (((src_y>>3)&tile_y_mask) * tiles_per_x_line));
986         int bank = (tile_bank >> (((tilemap_ram[(tile_index+0x400)&0x7fff]&0xc00)>>10)*4))&0xf;
987         int tile = (tilemap_ram[(tile_index+0x400)&0x7fff]&0x3ff) | (bank<<10);
988
989         p=*BITMAP_ADDR16(src_bitmap, src_y&src_y_mask, src_x&src_x_mask);
990         pp=tile_cluts[tile*8 + (p&0x7)];
991         ppp=pp + ((p&0x78)<<5);
992
993         if ((p&0x7)!=0 || ((p&0x7)==0 && (pp&0x7)!=0)) // Transparent pixels are set by both the tile pixel data==0 AND colour palette==0
994            *BITMAP_ADDR32(dst, y, x) = machine->pens[ppp];
995      }
996   }
997}
998
999/**********************************************************************/
1000
9581001VIDEO_UPDATE( apache3 )
9591002{
9601003   update_cluts(machine, 1024, 0, 2048);
r1490r1491
9881031
9891032VIDEO_UPDATE( cyclwarr )
9901033{
1034   bigfight_bank=bigfight_a40000[0];
1035   if (bigfight_bank!=bigfight_last_bank)
1036   {
1037      tilemap_mark_all_tiles_dirty(layer0);
1038      tilemap_mark_all_tiles_dirty(layer1);
1039      tilemap_mark_all_tiles_dirty(layer2);
1040      tilemap_mark_all_tiles_dirty(layer3);
1041      bigfight_last_bank=bigfight_bank;
1042   }
1043
9911044   fillbitmap(bitmap,machine->pens[0],cliprect);
992//  tilemap_draw(bitmap,cliprect,bg_layer,0,0);
1045
1046   draw_bg(machine, bitmap, layer3, &cyclwarr_videoram1[0x000], &cyclwarr_videoram1[0x100], cyclwarr_videoram1, bigfight_a40000[0], 8, -0x80, 512, 4096);
1047   draw_bg(machine, bitmap, layer2, &cyclwarr_videoram1[0x200], &cyclwarr_videoram1[0x300], cyclwarr_videoram1, bigfight_a40000[0], 8, -0x80, 512, 4096);
1048   draw_bg(machine, bitmap, layer1, &cyclwarr_videoram0[0x000], &cyclwarr_videoram0[0x100], cyclwarr_videoram0, bigfight_a40000[0], 8, -0x40, 1024, 2048);
9931049   update_cluts(machine, 8192, 4096, 8192);
9941050   draw_sprites(machine, bitmap,cliprect,0,(tatsumi_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
995   tilemap_draw(bitmap,cliprect,tx_layer,0,0);
1051   draw_bg(machine, bitmap, layer0, &cyclwarr_videoram0[0x200], &cyclwarr_videoram0[0x300], cyclwarr_videoram0, bigfight_a40000[0], 0x10, -0x80, 512, 4096);
1052
9961053   return 0;
9971054}
1055
1056VIDEO_UPDATE( bigfight )
1057{
1058   bigfight_bank=bigfight_a40000[0];
1059   if (bigfight_bank!=bigfight_last_bank)
1060   {
1061      tilemap_mark_all_tiles_dirty(layer0);
1062      tilemap_mark_all_tiles_dirty(layer1);
1063      tilemap_mark_all_tiles_dirty(layer2);
1064      tilemap_mark_all_tiles_dirty(layer3);
1065      bigfight_last_bank=bigfight_bank;
1066   }
1067
1068   fillbitmap(bitmap,machine->pens[0],cliprect);
1069   draw_bg(machine, bitmap, layer3, &cyclwarr_videoram1[0x000], &cyclwarr_videoram1[0x100], cyclwarr_videoram1, bigfight_a40000[0], 8, -0x40, 1024, 2048);
1070   draw_bg(machine, bitmap, layer2, &cyclwarr_videoram1[0x200], &cyclwarr_videoram1[0x300], cyclwarr_videoram1, bigfight_a40000[0], 8, -0x40, 1024, 2048);
1071   draw_bg(machine, bitmap, layer1, &cyclwarr_videoram0[0x000], &cyclwarr_videoram0[0x100], cyclwarr_videoram0, bigfight_a40000[0], 8, -0x40, 1024, 2048);
1072   update_cluts(machine, 8192, 4096, 8192);
1073   draw_sprites(machine, bitmap,cliprect,0,(tatsumi_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
1074   draw_bg(machine, bitmap, layer0, &cyclwarr_videoram0[0x200], &cyclwarr_videoram0[0x300], cyclwarr_videoram0, bigfight_a40000[0], 0x10, -0x40, 1024, 2048);
1075
1076   return 0;
1077}
src/mame/video/konamiic.c
r1490r1491
12051205}
12061206
12071207
1208static void decode_gfx(running_machine *machine, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp)
1209{
1210   gfx_layout gl;
12081211
1212   memcpy(&gl, layout, sizeof(gl));
1213   gl.total = total;
1214   machine->gfx[gfx_index] = allocgfx(&gl);
1215   decodegfx(machine->gfx[gfx_index], data, 0, machine->gfx[gfx_index]->total_elements);
12091216
1217   /* set the color information */
1218   if (machine->drv->color_table_len)
1219      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / (1 << bpp);
1220   else
1221      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / (1 << bpp);
1222}
12101223
12111224
1225
1226
1227
12121228/***************************************************************************/
12131229/*                                                                         */
12141230/*                                 007121                                  */
r1490r1491
18851901static UINT8 *K052109_videoram_A,*K052109_videoram2_A,*K052109_colorram_A;
18861902static UINT8 *K052109_videoram_B,*K052109_videoram2_B,*K052109_colorram_B;
18871903static UINT8 K052109_charrombank[4];
1904static UINT8 K052109_charrombank_2[4];
18881905static UINT8 has_extra_video_ram;
18891906static INT32 K052109_RMRD_line;
18901907static int K052109_tileflip_enable;
r1490r1491
19581975}
19591976
19601977
1961void K052109_vh_start(running_machine *machine,int gfx_memory_region,int plane0,int plane1,int plane2,int plane3,
1978void K052109_vh_start(running_machine *machine,int gfx_memory_region,int plane_order,
19621979      void (*callback)(int tmap,int bank,int *code,int *color,int *flags,int *priority))
19631980{
19641981   int gfx_index, i;
1965   static gfx_layout charlayout =
1982   UINT32 total;
1983   static const gfx_layout charlayout =
19661984   {
19671985      8,8,
1968      0,            /* filled in later */
1986      0,
19691987      4,
1970      { 0, 0, 0, 0 },   /* filled in later */
1988      { 24, 16, 8, 0 },
19711989      { 0, 1, 2, 3, 4, 5, 6, 7 },
19721990      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
19731991      32*8
r1490r1491
19801998         break;
19811999   assert(gfx_index != MAX_GFX_ELEMENTS);
19822000
1983   /* tweak the structure for the number of tiles we have */
1984   charlayout.total = memory_region_length(gfx_memory_region) / 32;
1985   charlayout.planeoffset[0] = plane3 * 8;
1986   charlayout.planeoffset[1] = plane2 * 8;
1987   charlayout.planeoffset[2] = plane1 * 8;
1988   charlayout.planeoffset[3] = plane0 * 8;
1989
19902001   /* decode the graphics */
1991   machine->gfx[gfx_index] = allocgfx(&charlayout);
1992   decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
2002   switch (plane_order)
2003   {
2004   case NORMAL_PLANE_ORDER:
2005      total = memory_region_length(gfx_memory_region) / 32;
2006      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout, 4);
2007      break;
19932008
1994   /* set the color information */
1995   if (machine->drv->color_table_len)
1996      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / 16;
1997   else
1998      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
2009   default:
2010      fatalerror("Unsupported plane_order");
2011   }
19992012
20002013   K052109_memory_region = gfx_memory_region;
20012014   K052109_gfxnum = gfx_index;
r1490r1491
20382051   state_save_register_global(K052109_scrollctrl);
20392052   state_save_register_global(K052109_irq_enabled);
20402053   state_save_register_global_array(K052109_charrombank);
2054   state_save_register_global_array(K052109_charrombank_2);
20412055   state_save_register_global_array(K052109_dx);
20422056   state_save_register_global_array(K052109_dy);
20432057   state_save_register_global(has_extra_video_ram);
r1490r1491
20452059   state_save_register_func_postload(K052109_tileflip_reset);
20462060}
20472061
2048
2049
20502062READ8_HANDLER( K052109_r )
20512063{
20522064   if (K052109_RMRD_line == CLEAR_LINE)
r1490r1491
20782090      int bank = K052109_charrombank[(color & 0x0c) >> 2] >> 2;   /* discard low bits (TMNT) */
20792091      int addr;
20802092
2093      bank |= (K052109_charrombank_2[(color & 0x0c) >> 2] >> 2); // Surprise Attack uses this 2nd bank in the rom test
2094
20812095if (has_extra_video_ram) code |= color << 8;   /* kludge for X-Men */
20822096else
20832097      (*K052109_callback)(0,bank,&code,&color,&flags,&priority);
r1490r1491
20852099      addr = (code << 5) + (offset & 0x1f);
20862100      addr &= memory_region_length(K052109_memory_region)-1;
20872101
2088//  popmessage("%04x: off%04x sub%02x (bnk%x) adr%06x",activecpu_get_pc(),offset,K052109_romsubbank,bank,addr);
2102//      logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n",activecpu_get_pc(),offset,K052109_romsubbank,bank,addr);
20892103
20902104      return memory_region(K052109_memory_region)[addr];
20912105   }
r1490r1491
21392153            for (i = 0;i < 0x1800;i++)
21402154            {
21412155               int bank = (K052109_ram[i]&0x0c) >> 2;
2142               if ((bank == 0 && (dirty & 1)) || (bank == 1 && dirty & 2))
2156               if ((bank == 0 && (dirty & 1)) || (bank == 1 && (dirty & 2)))
21432157               {
21442158                  tilemap_mark_tile_dirty(K052109_tilemap[(i & 0x1800) >> 11],i & 0x7ff);
21452159               }
21462160            }
21472161         }
21482162      }
2149      else if (offset == 0x1e00)
2163      else if (offset == 0x1e00 || offset == 0x3e00) // Surprise Attack uses offset 0x3e00
21502164      {
21512165//logerror("%04x: 052109 register 1e00 = %02x\n",activecpu_get_pc(),data);
21522166         K052109_romsubbank = data;
r1490r1491
21822196            for (i = 0;i < 0x1800;i++)
21832197            {
21842198               int bank = (K052109_ram[i] & 0x0c) >> 2;
2185               if ((bank == 2 && (dirty & 1)) || (bank == 3 && dirty & 2))
2199               if ((bank == 2 && (dirty & 1)) || (bank == 3 && (dirty & 2)))
21862200                  tilemap_mark_tile_dirty(K052109_tilemap[(i & 0x1800) >> 11],i & 0x7ff);
21872201            }
21882202         }
r1490r1491
21912205      {   /* B y scroll */   }
21922206      else if (offset >= 0x3a00 && offset < 0x3c00)
21932207      {   /* B x scroll */   }
2208      else if (offset == 0x3d80) // Surprise Attack uses offset 0x3d80 in rom test
2209      {
2210         // mirroring this write, breaks Surprise Attack in game tilemaps
2211         K052109_charrombank_2[0] = data & 0x0f;
2212         K052109_charrombank_2[1] = (data >> 4) & 0x0f;
2213      }
2214      else if (offset == 0x3f00) // Surprise Attack uses offset 0x3f00 in rom test
2215      {
2216         // mirroring this write, breaks Surprise Attack in game tilemaps
2217         K052109_charrombank_2[2] = data & 0x0f;
2218         K052109_charrombank_2[3] = (data >> 4) & 0x0f;
2219      }
21942220//      else
2195//logerror("%04x: write %02x to unknown 052109 address %04x\n",activecpu_get_pc(),data,offset);
2221//          logerror("%04x: write %02x to unknown 052109 address %04x\n",activecpu_get_pc(),data,offset);
21962222   }
21972223}
21982224
r1490r1491
24202446static int K051960_irq_enabled, K051960_nmi_enabled;
24212447
24222448
2423void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane0,int plane1,int plane2,int plane3,
2449void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane_order,
24242450      void (*callback)(int *code,int *color,int *priority,int *shadow))
24252451{
24262452   int gfx_index,i;
2427   static gfx_layout spritelayout =
2453   UINT32 total;
2454   static const gfx_layout spritelayout =
24282455   {
24292456      16,16,
2430      0,            /* filled in later */
2457      0,
24312458      4,
2432      { 0, 0, 0, 0 },   /* filled in later */
2459      { 0, 8, 16, 24 },
24332460      { 0, 1, 2, 3, 4, 5, 6, 7,
24342461            8*32+0, 8*32+1, 8*32+2, 8*32+3, 8*32+4, 8*32+5, 8*32+6, 8*32+7 },
24352462      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
24362463            16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
24372464      128*8
24382465   };
2466   static const gfx_layout spritelayout_reverse =
2467   {
2468      16,16,
2469      0,
2470      4,
2471      { 24, 16, 8, 0 },
2472      { 0, 1, 2, 3, 4, 5, 6, 7,
2473            8*32+0, 8*32+1, 8*32+2, 8*32+3, 8*32+4, 8*32+5, 8*32+6, 8*32+7 },
2474      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
2475            16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
2476      128*8
2477   };
24392478
2440
24412479   /* find first empty slot to decode gfx */
24422480   for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
24432481      if (machine->gfx[gfx_index] == 0)
r1490r1491
24452483
24462484   assert(gfx_index != MAX_GFX_ELEMENTS);
24472485
2448   /* tweak the structure for the number of tiles we have */
2449   spritelayout.total = memory_region_length(gfx_memory_region) / 128;
2450   spritelayout.planeoffset[0] = plane0 * 8;
2451   spritelayout.planeoffset[1] = plane1 * 8;
2452   spritelayout.planeoffset[2] = plane2 * 8;
2453   spritelayout.planeoffset[3] = plane3 * 8;
2454
24552486   /* decode the graphics */
2456   machine->gfx[gfx_index] = allocgfx(&spritelayout);
2457   decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
2487   switch (plane_order)
2488   {
2489   case NORMAL_PLANE_ORDER:
2490      total = memory_region_length(gfx_memory_region) / 128;
2491      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &spritelayout, 4);
2492      break;
24582493
2459   /* set the color information */
2460   if (machine->drv->color_table_len)
2461      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / 16;
2462   else
2463      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
2494   case REVERSE_PLANE_ORDER:
2495      total = memory_region_length(gfx_memory_region) / 128;
2496      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &spritelayout_reverse, 4);
2497      break;
24642498
2499   default:
2500      fatalerror("Unknown plane_order");
2501   }
2502
24652503   if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
24662504      popmessage("driver should use VIDEO_HAS_SHADOWS");
24672505
r1490r1491
29132951static UINT8 K053244_regs[MAX_K053245_CHIPS][0x10];
29142952static int K053245_dx[MAX_K053245_CHIPS], K053245_dy[MAX_K053245_CHIPS];
29152953
2916void K053245_vh_start(running_machine *machine,int chip, int gfx_memory_region,int plane0,int plane1,int plane2,int plane3,
2954void K053245_vh_start(running_machine *machine,int chip, int gfx_memory_region,int plane_order,
29172955      void (*callback)(int *code,int *color,int *priority))
29182956{
29192957   int gfx_index,i;
2920   static gfx_layout spritelayout =
2958   UINT32 total;
2959   static const gfx_layout spritelayout =
29212960   {
29222961      16,16,
2923      0,            /* filled in later */
2962      0,
29242963      4,
2925        { 0, 0, 0, 0 },   /* filled in later */
2964        { 24, 16, 8, 0 },
29262965      { 0, 1, 2, 3, 4, 5, 6, 7,
29272966            8*32+0, 8*32+1, 8*32+2, 8*32+3, 8*32+4, 8*32+5, 8*32+6, 8*32+7 },
29282967      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
r1490r1491
29422981         break;
29432982   assert(gfx_index != MAX_GFX_ELEMENTS);
29442983
2945   /* tweak the structure for the number of tiles we have */
2946   spritelayout.total = memory_region_length(gfx_memory_region) / 128;
2947   spritelayout.planeoffset[0] = plane3 * 8;
2948   spritelayout.planeoffset[1] = plane2 * 8;
2949   spritelayout.planeoffset[2] = plane1 * 8;
2950   spritelayout.planeoffset[3] = plane0 * 8;
2951
29522984   /* decode the graphics */
2953   machine->gfx[gfx_index] = allocgfx(&spritelayout);
2954   decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
2985   switch (plane_order)
2986   {
2987   case NORMAL_PLANE_ORDER:
2988      total = memory_region_length(gfx_memory_region) / 128;
2989      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &spritelayout, 4);
2990      break;
29552991
2956   /* set the color information */
2957   if (machine->drv->color_table_len)
2958      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / 16;
2959   else
2960      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
2992   default:
2993      fatalerror("Unsupported plane_order");
2994   }
29612995
29622996   if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
29632997      popmessage("driver should use VIDEO_HAS_SHADOWS");
r1490r1491
36643698   K053247_wraparound = status;
36653699}
36663700
3667void K053247_vh_start(running_machine *machine, int gfx_memory_region, int dx, int dy, int plane0,int plane1,int plane2,int plane3,
3701void K053247_vh_start(running_machine *machine, int gfx_memory_region, int dx, int dy, int plane_order,
36683702                void (*callback)(int *code,int *color,int *priority))
36693703{
36703704   int gfx_index,i;
3671   static gfx_layout spritelayout =
3705   UINT32 total;
3706   static const gfx_layout spritelayout =
36723707   {
36733708      16,16,
3674      0,            /* filled in later */
3709      0,
36753710      4,
3676      { 0, 0, 0, 0 },   /* filled in later */
3711      { 0, 1, 2, 3 },
36773712      { 2*4, 3*4, 0*4, 1*4, 6*4, 7*4, 4*4, 5*4,
36783713            10*4, 11*4, 8*4, 9*4, 14*4, 15*4, 12*4, 13*4 },
36793714      { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
r1490r1491
36883723         break;
36893724   assert(gfx_index != MAX_GFX_ELEMENTS);
36903725
3691   /* tweak the structure for the number of tiles we have */
3692   spritelayout.total = memory_region_length(gfx_memory_region) / 128;
3693   spritelayout.planeoffset[0] = plane0;
3694   spritelayout.planeoffset[1] = plane1;
3695   spritelayout.planeoffset[2] = plane2;
3696   spritelayout.planeoffset[3] = plane3;
3697
36983726   /* decode the graphics */
3699   machine->gfx[gfx_index] = allocgfx(&spritelayout);
3700   decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
3727   switch (plane_order)
3728   {
3729   case NORMAL_PLANE_ORDER:
3730      total = memory_region_length(gfx_memory_region) / 128;
3731      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &spritelayout, 4);
3732      break;
37013733
3702   /* set the color information */
3703   if (machine->drv->color_table_len)
3704      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / 16;
3705   else
3706      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
3734   default:
3735      fatalerror("Unsupported plane_order");
3736   }
37073737
37083738   if (VERBOSE)
37093739   {
r1490r1491
37493779void K055673_vh_start(running_machine *machine, int gfx_memory_region, int layout, int dx, int dy, void (*callback)(int *code,int *color,int *priority))
37503780{
37513781   int gfx_index;
3782   UINT32 total;
37523783
3753   static gfx_layout spritelayout =   /* System GX sprite layout */
3784   static const gfx_layout spritelayout =   /* System GX sprite layout */
37543785   {
37553786      16,16,
3756      32768,            /* filled in later */
3787      0,
37573788      5,
37583789      { 32, 24, 16, 8, 0 },
37593790      { 0, 1, 2, 3, 4, 5, 6, 7, 40, 41, 42, 43, 44, 45, 46, 47 },
r1490r1491
37613792        10*8*9, 10*8*10, 10*8*11, 10*8*12, 10*8*13, 10*8*14, 10*8*15 },
37623793      16*16*5
37633794   };
3764   static gfx_layout spritelayout2 =   /* Run and Gun sprite layout */
3795   static const gfx_layout spritelayout2 =   /* Run and Gun sprite layout */
37653796   {
37663797      16,16,
3767      32768,            /* filled in later */
3798      0,
37683799      4,
37693800      { 24, 16, 8, 0 },
37703801      { 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39 },
37713802      { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 },
37723803      16*16*4
37733804   };
3774   static gfx_layout spritelayout3 =   /* Lethal Enforcers II sprite layout */
3805   static const gfx_layout spritelayout3 =   /* Lethal Enforcers II sprite layout */
37753806   {
37763807      16,16,
3777      32768,            /* filled in later */
3808      0,
37783809      8,
37793810      { 8*1,8*0,8*3,8*2,8*5,8*4,8*7,8*6 },
37803811      {  0,1,2,3,4,5,6,7,64+0,64+1,64+2,64+3,64+4,64+5,64+6,64+7 },
r1490r1491
37823813        128*8, 128*9, 128*10, 128*11, 128*12, 128*13, 128*14, 128*15 },
37833814      128*16
37843815   };
3785   static gfx_layout spritelayout4 =   /* System GX 6bpp sprite layout */
3816   static const gfx_layout spritelayout4 =   /* System GX 6bpp sprite layout */
37863817   {
37873818      16,16,
3788      32768,            /* filled in later */
3819      0,
37893820      6,
37903821      { 40, 32, 24, 16, 8, 0 },
37913822      { 0, 1, 2, 3, 4, 5, 6, 7, 48, 49, 50, 51, 52, 53, 54, 55 },
r1490r1491
37963827   UINT8 *s1, *s2, *d;
37973828   long i, c;
37983829   UINT16 *K055673_rom;
3830   int size4;
37993831
38003832   /* find first empty slot to decode gfx */
38013833   for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
r1490r1491
38033835         break;
38043836   assert(gfx_index != MAX_GFX_ELEMENTS);
38053837
3806   switch(layout) {
3807   case K055673_LAYOUT_GX:
3838   K055673_rom = (UINT16 *)memory_region(gfx_memory_region);
3839
3840   /* decode the graphics */
3841   switch(layout)
38083842   {
3809      int size4 = (memory_region_length(gfx_memory_region)/(1024*1024))/5;
3843   case K055673_LAYOUT_GX:
3844      size4 = (memory_region_length(gfx_memory_region)/(1024*1024))/5;
38103845      size4 *= 4*1024*1024;
38113846      /* set the # of tiles based on the 4bpp section */
3812      spritelayout.total = size4 / 128;
38133847      K055673_rom = auto_malloc(size4 * 5);
38143848      d = (UINT8 *)K055673_rom;
38153849      // now combine the graphics together to form 5bpp
r1490r1491
38233857         *d++ = *s1++;
38243858         *d++ = *s2++;
38253859      }
3826      /* decode the graphics */
3827      machine->gfx[gfx_index] = allocgfx(&spritelayout);
3828      decodegfx(machine->gfx[gfx_index], (UINT8 *)K055673_rom, 0, machine->gfx[gfx_index]->total_elements);
3860
3861      total = size4 / 128;
3862      decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout, 4);
38293863      break;
3830   }
3831   case K055673_LAYOUT_RNG:
3832      K055673_rom = (UINT16 *)memory_region(gfx_memory_region);
3833      spritelayout2.total = memory_region_length(gfx_memory_region) / (16*16/2);
38343864
3835      /* decode the graphics */
3836      machine->gfx[gfx_index] = allocgfx(&spritelayout2);
3837      decodegfx(machine->gfx[gfx_index], (UINT8 *)K055673_rom, 0, machine->gfx[gfx_index]->total_elements);
3865   case K055673_LAYOUT_RNG:
3866      total = memory_region_length(gfx_memory_region) / (16*16/2);
3867      decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout2, 4);
38383868      break;
3839   case K055673_LAYOUT_LE2:
3840      K055673_rom = (UINT16 *)memory_region(gfx_memory_region);
3841      spritelayout3.total = memory_region_length(gfx_memory_region) / (16*16);
38423869
3843      /* decode the graphics */
3844      machine->gfx[gfx_index] = allocgfx(&spritelayout3);
3845      decodegfx(machine->gfx[gfx_index], (UINT8 *)K055673_rom, 0, machine->gfx[gfx_index]->total_elements);
3870   case K055673_LAYOUT_LE2:
3871      total = memory_region_length(gfx_memory_region) / (16*16);
3872      decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout3, 4);
38463873      break;
3847   case K055673_LAYOUT_GX6:
3848      K055673_rom = (UINT16 *)memory_region(gfx_memory_region);
3849      spritelayout4.total = memory_region_length(gfx_memory_region) / (16*16*6/8);
38503874
3851      /* decode the graphics */
3852      machine->gfx[gfx_index] = allocgfx(&spritelayout4);
3853      decodegfx(machine->gfx[gfx_index], (UINT8 *)K055673_rom, 0, machine->gfx[gfx_index]->total_elements);
3875   case K055673_LAYOUT_GX6:
3876      total = memory_region_length(gfx_memory_region) / (16*16*6/8);
3877      decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout4, 4);
38543878      break;
3879
3880   default:
3881      fatalerror("Unsupported layout");
38553882   }
38563883
3857   assert(machine->gfx[gfx_index]);
3858
3859   /* set the color information */
3860   if (machine->drv->color_table_len)
3861      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / 16;
3862   else
3863      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
3864
38653884   if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS))
38663885      popmessage("driver should use VIDEO_HAS_SHADOWS");
38673886
r1490r1491
45414560      void (*callback)(int *code,int *color,int *flags))
45424561{
45434562   int gfx_index;
4563   UINT32 total;
4564   static const gfx_layout charlayout4 =
4565   {
4566      16,16,
4567      0,
4568      4,
4569      { 0, 1, 2, 3 },
4570      { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
4571            8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
4572      { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
4573            8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
4574      128*8
4575   };
4576   static const gfx_layout charlayout7 =
4577   {
4578      16,16,
4579      0,
4580      7,
4581      { 1,2,3,4,5,6,7 },
4582      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
4583            8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
4584      { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128,
4585            8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 },
4586      256*8
4587   };
4588   static const gfx_layout charlayout8 =
4589   {
4590      16,16,
4591      0,
4592      8,
4593      { 0,1,2,3,4,5,6,7 },
4594      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
4595            8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
4596      { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128,
4597            8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 },
4598      256*8
4599   };
45444600   static const tile_get_info_callback get_tile_info[3] = { K051316_get_tile_info0,K051316_get_tile_info1,K051316_get_tile_info2 };
45454601
45464602   /* find first empty slot to decode gfx */
r1490r1491
45494605         break;
45504606   assert(gfx_index != MAX_GFX_ELEMENTS);
45514607
4552   assert((bpp == 4) || (bpp == 7) || (bpp == 8));
4553
4554   if (bpp == 4)
4608   /* decode the graphics */
4609   switch (bpp)
45554610   {
4556      static gfx_layout charlayout =
4557      {
4558         16,16,
4559         0,            /* filled in later */
4560         4,
4561         { 0, 1, 2, 3 },
4562         { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
4563               8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
4564         { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
4565               8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
4566         128*8
4567      };
4611   case 4:
4612      total = memory_region_length(gfx_memory_region) / 128;
4613      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout4, 4);
4614      break;
45684615
4616   case 7:
4617      total = memory_region_length(gfx_memory_region) / 256;
4618      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout7, 7);
4619      break;
45694620
4570      /* tweak the structure for the number of tiles we have */
4571      charlayout.total = memory_region_length(gfx_memory_region) / 128;
4621   case 8:
4622      total = memory_region_length(gfx_memory_region) / 256;
4623      decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout8, 8);
4624      break;
45724625
4573      /* decode the graphics */
4574      machine->gfx[gfx_index] = allocgfx(&charlayout);
4575      decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
4626   default:
4627      fatalerror("Unsupported bpp");
45764628   }
4577   else
4578   {
4579      static gfx_layout charlayout =
4580      {
4581         16,16,
4582         0,            /* filled in later */
4583         0,            /* filled in later */
4584         { 0 },         /* filled in later */
4585         { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
4586               8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
4587         { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128,
4588               8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 },
4589         256*8
4590      };
4591      int i;
45924629
4593
4594      /* tweak the structure for the number of tiles we have */
4595      charlayout.total = memory_region_length(gfx_memory_region) / 256;
4596      charlayout.planes = bpp;
4597      if (bpp == 7) for (i = 0;i < 7;i++) charlayout.planeoffset[i] = i+1;
4598      else for (i = 0;i < 8;i++) charlayout.planeoffset[i] = i;
4599
4600      /* decode the graphics */
4601      machine->gfx[gfx_index] = allocgfx(&charlayout);
4602      decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
4603   }
4604
4605   assert(machine->gfx[gfx_index]);
4606
4607   /* set the color information */
4608   if (machine->drv->color_table_len)
4609      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / (1 << bpp);
4610   else
4611      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / (1 << bpp);
4612
46134630   K051316_memory_region[chip] = gfx_memory_region;
46144631   K051316_gfxnum[chip] = gfx_index;
46154632   K051316_bpp[chip] = bpp;
r1490r1491
55385555   tilemap *tmap;
55395556   int gfx_index;
55405557   int i;
5541   gfx_layout charlayout8 =
5558   UINT32 total;
5559   static const gfx_layout charlayout8 =
55425560   {
55435561      8, 8,
5544      0, /* filled in later */
5562      0,
55455563      8,
55465564      { 8*7,8*3,8*5,8*1,8*6,8*2,8*4,8*0 },
55475565      { 0, 1, 2, 3, 4, 5, 6, 7 },
55485566      { 0, 8*8, 8*8*2, 8*8*3, 8*8*4, 8*8*5, 8*8*6, 8*8*7 },
55495567      8*8*8
55505568   };
5551   gfx_layout charlayout8le =
5569   static const gfx_layout charlayout8le =
55525570   {
55535571      8, 8,
55545572      0,
r1490r1491
55595577      { 0*8*4, 1*8*4, 2*8*4, 3*8*4, 4*8*4, 5*8*4, 6*8*4, 7*8*4 },
55605578      8*8*4
55615579   };
5562   gfx_layout charlayout6 =
5580   static const gfx_layout charlayout6 =
55635581   {
55645582      8, 8,
5565      0, /* filled in later */
5583      0,
55665584      6,
55675585      { 40, 32, 24, 8, 16, 0 },
55685586      { 0, 1, 2, 3, 4, 5, 6, 7 },
55695587      { 0, 6*8, 6*8*2, 6*8*3, 6*8*4, 6*8*5, 6*8*6, 6*8*7 },
55705588      8*8*6
55715589   };
5572   gfx_layout charlayout5 =
5590   static const gfx_layout charlayout5 =
55735591   {
55745592      8, 8,
5575      0, /* filled in later */
5593      0,
55765594      5,
55775595      { 32, 24, 8, 16, 0 },
55785596      { 0, 1, 2, 3, 4, 5, 6, 7 },
55795597      { 0, 5*8, 5*8*2, 5*8*3, 5*8*4, 5*8*5, 5*8*6, 5*8*7 },
55805598      8*8*5
55815599   };
5582   gfx_layout charlayout4 =
5600   static const gfx_layout charlayout4 =
55835601   {
55845602      8, 8,
55855603      0,
r1490r1491
55895607      { 0*8*4, 1*8*4, 2*8*4, 3*8*4, 4*8*4, 5*8*4, 6*8*4, 7*8*4 },
55905608      8*8*4
55915609   };
5592   static gfx_layout charlayout4dj =
5610   static const gfx_layout charlayout4dj =
55935611   {
55945612      8, 8,
5595      0,            /* filled in later */
5613      0,
55965614      4,
55975615      { 8*3,8*1,8*2,8*0 },
55985616      { 0, 1, 2, 3, 4, 5, 6, 7 },
r1490r1491
56125630   /* handle the various graphics formats */
56135631   i = (big) ? 8 : 16;
56145632
5633   /* decode the graphics */
56155634   switch (bpp)
56165635   {
56175636      case K056832_BPP_4:
5618         charlayout4.total = memory_region_length(gfx_memory_region) / (i*4);
5619
5620         /* decode the graphics */
5621         machine->gfx[gfx_index] = allocgfx(&charlayout4);
5622         decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
5637         total = memory_region_length(gfx_memory_region) / (i*4);
5638         decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout4, 4);
56235639         break;
56245640
56255641      case K056832_BPP_5:
5626         /* tweak the structure for the number of tiles we have */
5627         charlayout5.total = memory_region_length(gfx_memory_region) / (i*5);
5628
5629         /* decode the graphics */
5630         machine->gfx[gfx_index] = allocgfx(&charlayout5);
5631         decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
5642         total = memory_region_length(gfx_memory_region) / (i*5);
5643         decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout5, 4);
56325644         break;
56335645
56345646      case K056832_BPP_6:
5635         /* tweak the structure for the number of tiles we have */
5636         charlayout6.total = memory_region_length(gfx_memory_region) / (i*6);
5637
5638         /* decode the graphics */
5639         machine->gfx[gfx_index] = allocgfx(&charlayout6);
5640         decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
5647         total = memory_region_length(gfx_memory_region) / (i*6);
5648         decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout6, 4);
56415649         break;
56425650
56435651      case K056832_BPP_8:
5644         /* tweak the structure for the number of tiles we have */
5645         charlayout8.total = memory_region_length(gfx_memory_region) / (i*8);
5646
5647         /* decode the graphics */
5648         machine->gfx[gfx_index] = allocgfx(&charlayout8);
5649         decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
5652         total = memory_region_length(gfx_memory_region) / (i*8);
5653         decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout8, 4);
56505654         break;
56515655
56525656      case K056832_BPP_8LE:
5653         /* tweak the structure for the number of tiles we have */
5654         charlayout8le.total = memory_region_length(gfx_memory_region) / (i*8);
5655
5656         /* decode the graphics */
5657         machine->gfx[gfx_index] = allocgfx(&charlayout8le);
5658         decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
5657         total = memory_region_length(gfx_memory_region) / (i*8);
5658         decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout8le, 4);
56595659         break;
56605660
56615661      case K056832_BPP_4dj:
5662         charlayout4dj.total = memory_region_length(gfx_memory_region) / (i*4);
5663
5664         /* decode the graphics */
5665         machine->gfx[gfx_index] = allocgfx(&charlayout4dj);
5666         decodegfx(machine->gfx[gfx_index], memory_region(gfx_memory_region), 0, machine->gfx[gfx_index]->total_elements);
5662         total = memory_region_length(gfx_memory_region) / (i*4);
5663         decode_gfx(machine, gfx_index, memory_region(gfx_memory_region), total, &charlayout4dj, 4);
56675664         break;
5665
5666      default:
5667         fatalerror("Unsupported bpp");
56685668   }
56695669
5670   /* make sure the decode went OK */
5671   assert(machine->gfx[gfx_index]);
5672
5673   /* set the color information */
5674   if (machine->drv->color_table_len)
5675      machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / 16;
5676   else
5677      machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / 16;
56785670   machine->gfx[gfx_index]->color_granularity = 16; /* override */
56795671
56805672   K056832_memory_region = gfx_memory_region;
src/mame/video/konamiic.h
r1490r1491
4444you in most cases (but see tmnt.c for additional bit rotations or byte
4545permutations which may be required).
4646*/
47#define NORMAL_PLANE_ORDER 0,1,2,3
48#define REVERSE_PLANE_ORDER 3,2,1,0
47#define NORMAL_PLANE_ORDER 0x0123
48#define REVERSE_PLANE_ORDER 0x3210
4949
5050
5151/*
r1490r1491
6464*/
6565extern tilemap *K052109_tilemap[3];
6666
67void K052109_vh_start(running_machine *machine,int gfx_memory_region,int plane0,int plane1,int plane2,int plane3,
67void K052109_vh_start(running_machine *machine,int gfx_memory_region,int plane_order,
6868      void (*callback)(int layer,int bank,int *code,int *color,int *flags,int *priority));
6969/* plain 8-bit access */
7070READ8_HANDLER( K052109_r );
r1490r1491
9292  shadow is preloaded with color & 0x80 so it doesn't need to be changed unless
9393  the game has special treatment (Aliens)
9494*/
95void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane0,int plane1,int plane2,int plane3,
95void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane_order,
9696      void (*callback)(int *code,int *color,int *priority,int *shadow));
9797READ8_HANDLER( K051960_r );
9898WRITE8_HANDLER( K051960_w );
r1490r1491
112112WRITE8_HANDLER( K052109_051960_w );
113113
114114
115void K053245_vh_start(running_machine *machine,int chip, int gfx_memory_region,int plane0,int plane1,int plane2,int plane3,
115void K053245_vh_start(running_machine *machine,int chip, int gfx_memory_region,int plane_order,
116116      void (*callback)(int *code,int *color,int *priority_mask));
117117READ16_HANDLER( K053245_word_r );
118118WRITE16_HANDLER( K053245_word_w );
r1490r1491
152152#define K053247_CUSTOMSHADOW   0x20000000
153153#define K053247_SHDSHIFT      20
154154
155void K053247_vh_start(running_machine *machine, int gfx_memory_region,int dx,int dy,int plane0,int plane1,int plane2,int plane3,
155void K053247_vh_start(running_machine *machine, int gfx_memory_region,int dx,int dy,int plane_order,
156156      void (*callback)(int *code,int *color,int *priority_mask));
157157READ8_HANDLER( K053247_r );
158158WRITE8_HANDLER( K053247_w );
src/mame/video/atarig1.c
r1490r1491
6868
6969VIDEO_START( atarig1 )
7070{
71   static const struct atarirle_desc modesc_hydra =
71   static const atarirle_desc modesc_hydra =
7272   {
7373      REGION_GFX3,/* region where the GFX data lives */
7474      256,      /* number of entries in sprite RAM */
r1490r1491
8989      {{ 0 }}                  /* mask for the VRAM target */
9090   };
9191
92   static const struct atarirle_desc modesc_pitfight =
92   static const atarirle_desc modesc_pitfight =
9393   {
9494      REGION_GFX3,/* region where the GFX data lives */
9595      256,      /* number of entries in sprite RAM */
r1490r1491
129129   playfield_tile_bank = 0;
130130   playfield_xscroll = 0;
131131   playfield_yscroll = 0;
132
133   /* state saving */
134   state_save_register_global(current_control);
135   state_save_register_global(playfield_tile_bank);
136   state_save_register_global(playfield_xscroll);
137   state_save_register_global(playfield_yscroll);
132138}
133139
134140
r1490r1491
158164   /* keep in range */
159165   if (base >= &atarigen_alpha[0x800])
160166      return;
167   video_screen_update_partial(0, scanline - 1);
161168
162169   /* update the playfield scrolls */
163170   for (i = 0; i < 8; i++)
src/mame/video/mario.c
r1490r1491
111111   tilemap_set_scrolly(bg_tilemap, 0, data + 17);
112112}
113113
114WRITE8_HANDLER( mario_flip_w )
115{
116
117   flip_screen_set(data & 0x01);
118   tilemap_set_scrollx(bg_tilemap, 0, flip_screen ? (HTOTAL-HBSTART) : 0);
119}
120
114121static TILE_GET_INFO( get_bg_tile_info )
115122{
116123   int code = videoram[tile_index] + 256 * gfx_bank;
r1490r1491
130137   state_save_register_global(palette_bank);
131138}
132139
140/*
141 * Erratic line at top when scrolling down "Marios Bros" Title
142 * confirmed on mametests.org as being present on real PCB as well.
143 */
144
133145static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
134146{
135147   int offs;
r1490r1491
138150   {
139151      if (spriteram[offs])
140152      {
141         drawgfx(bitmap,machine->gfx[1],
142               spriteram[offs + 2],
143               (spriteram[offs + 1] & 0x0f) + 16 * palette_bank+32 * monitor,
144               spriteram[offs + 1] & 0x80,spriteram[offs + 1] & 0x40,
145               spriteram[offs + 3] - 8,(VBSTART - 1) - spriteram[offs] + 8,
146               cliprect,TRANSPARENCY_PEN,0);
153         int x, y;
154
155         // from schematics ....
156         y = (spriteram[offs] + (flip_screen ? 0xF7 : 0xF9) + 1) & 0xFF;
157         x = spriteram[offs+3];
158         // sprite will be drawn if (y + scanline) & 0xF0 = 0xF0
159         y = 240 - y; /* logical screen position */
160
161         y = y ^ (flip_screen ? 0xFF : 0x00); /* physical screen location */
162         x = x ^ (flip_screen ? 0xFF : 0x00); /* physical screen location */
163
164         if (flip_screen)
165         {
166            y -= 6;
167            x -= 7;
168            drawgfx(bitmap,machine->gfx[1],
169                  spriteram[offs + 2],
170                  (spriteram[offs + 1] & 0x0f) + 16 * palette_bank+32 * monitor,
171                  !(spriteram[offs + 1] & 0x80),!(spriteram[offs + 1] & 0x40),
172                  x, y,
173                  cliprect,TRANSPARENCY_PEN,0);
174         }
175         else
176         {
177            y += 1;
178            x -= 8;
179            drawgfx(bitmap,machine->gfx[1],
180                  spriteram[offs + 2],
181                  (spriteram[offs + 1] & 0x0f) + 16 * palette_bank+32 * monitor,
182                  (spriteram[offs + 1] & 0x80),(spriteram[offs + 1] & 0x40),
183                  x, y,
184                  cliprect,TRANSPARENCY_PEN,0);
185         }
147186      }
148187   }
149188}
src/mame/video/atarifb.c
r1490r1491
2020static const rectangle left_area =     {  0*8,  3*8-1, 0*8, 32*8-1 };
2121static const rectangle right_area =    { 34*8, 38*8-1, 0*8, 32*8-1 };
2222
23/***************************************************************************
24***************************************************************************/
25WRITE8_HANDLER( atarifb_alphap1_vram_w )
26{
27   atarifb_alphap1_vram[offset] = data;
28}
2923
30WRITE8_HANDLER( atarifb_alphap2_vram_w )
31{
32   atarifb_alphap2_vram[offset] = data;
33}
34
35/***************************************************************************
36***************************************************************************/
37WRITE8_HANDLER( atarifb_scroll_w )
38{
39   *atarifb_scroll_register = data - 8;
40}
41
42
4324VIDEO_UPDATE( atarifb )
4425{
4526   int offs,obj;
r1490r1491
10384      int flipx,flipy;
10485      int sx,sy;
10586
106      dirtybuffer[offs]=0;
107
10887      charcode = videoram[offs] & 0x3f;
10988      flipx = (videoram[offs] & 0x40) >> 6;
11089      flipy = (videoram[offs] & 0x80) >> 7;
11190
112      sx = (8 * (offs % 32) - *atarifb_scroll_register);
91      sx = 8 * (offs % 32) - *atarifb_scroll_register + 8;
11392      sy = 8 * (offs / 32) + 8;
11493
11594      /* Soccer hack */
src/mame/video/neogeo.c
r1490r1491
799799   set_auto_animation_speed(data >> 8);
800800   set_auto_animation_disabled(data & 0x0008);
801801
802   neogeo_set_display_poisition_interrupt_control(data & 0x00f0);
802   neogeo_set_display_position_interrupt_control(data & 0x00f0);
803803}
804804
805805
src/mame/video/ppu2c0x.c
r1490r1491
237237}
238238
239239/* the charlayout we use for the chargen */
240static gfx_layout ppu_charlayout =
240static const gfx_layout ppu_charlayout =
241241{
242242   8,8,   /* 8*8 characters */
243   512,   /* 512 characters - modified at runtime */
243   0,
244244   2,      /* 2 bits per pixel */
245245   { 8*8, 0 },   /* the two bitplanes are separated */
246246   { 0, 1, 2, 3, 4, 5, 6, 7 },
r1490r1491
256256void ppu2c0x_init(running_machine *machine, const ppu2c0x_interface *interface )
257257{
258258   int i;
259   UINT32 total;
259260
260261   /* keep a local copy of the interface */
261262   intf = auto_malloc(sizeof(*interface));
r1490r1491
326327         chips[i].videorom_banks = memory_region_length( intf->vrom_region[i] ) / 0x2000;
327328
328329         /* tweak the layout accordingly */
329         ppu_charlayout.total = chips[i].videorom_banks * CHARGEN_NUM_CHARS;
330         total = chips[i].videorom_banks * CHARGEN_NUM_CHARS;
330331      }
331332      else
332333      {
333334         chips[i].has_videorom = chips[i].videorom_banks = 0;
334335
335336         /* we need to reset this in case of mame running multisession */
336         ppu_charlayout.total = CHARGEN_NUM_CHARS;
337         total = CHARGEN_NUM_CHARS;
337338      }
338339
339340      /* now create the gfx region */
340341      {
342         gfx_layout gl;
341343         UINT8 *src = chips[i].has_videorom ? memory_region( intf->vrom_region[i] ) : chips[i].videoram;
342         machine->gfx[intf->gfx_layout_number[i]] = allocgfx( &ppu_charlayout );
344
345         memcpy(&gl, &ppu_charlayout, sizeof(gl));
346         gl.total = total;
347         machine->gfx[intf->gfx_layout_number[i]] = allocgfx( &gl );
343348         decodegfx( machine->gfx[intf->gfx_layout_number[i]], src, 0, machine->gfx[intf->gfx_layout_number[i]]->total_elements );
344349         machine->gfx[intf->gfx_layout_number[i]]->total_colors = 8;
345350      }
src/mame/video/n64.c
r1490r1491
230230static UINT8 *texture_cache;
231231static UINT32 tlut[256];
232232
233#define MASK(S, T)                                                        \
234do                                                                        \
235{                                                                        \
236    if (mask_s != 0)                                                    \
237    {                                                                    \
238        S &= (((UINT32)(0xffffffff) >> (32-mask_s)));                    \
239    }                                                                    \
240    if (mask_t != 0)                                                    \
241    {                                                                    \
242        T &= (((UINT32)(0xffffffff) >> (32-mask_t)));                    \
243    }                                                                    \
244}                                                                        \
245while (0)
246
233247#define CLAMP(S, T)                                          \
234248do                                                      \
235249{                                                      \
r1490r1491
243257      if (S < (tsl >> 2)) S = abs(S - (tsl >> 2));               \
244258      if (S > (tsh >> 2)) S = abs(S - (tsh >> 2));               \
245259   }                                                   \
246   if (mask_s != 0)                                       \
247   {                                                   \
248      S &= (((UINT32)(0xffffffff) >> (32-mask_s)));               \
249   }                                                   \
250260   if (clamp_t)                                          \
251261   {                                                   \
252262      if (T < (ttl >> 2)) T = (ttl >> 2);                        \
r1490r1491
257267      if (T < (ttl >> 2)) T = abs(T - (ttl >> 2));               \
258268      if (T > (tth >> 2)) T = abs(T - (tth >> 2));               \
259269   }                                                   \
260   if (mask_t != 0)                                       \
261   {                                                   \
262      T &= (((UINT32)(0xffffffff) >> (32-mask_t)));               \
263   }                                                   \
264270}                                                      \
265271while (0)
266272
r1490r1491
832838            case PIXEL_SIZE_32BIT:
833839            {
834840               UINT32 *tc = (UINT32*)texture_cache;
835               int taddr = ((tbase/4) + ((t) * (twidth/2)) + (s)) ^ ((t & 1) ? XOR_SWAP_DWORD : 0);
841                    int taddr = ((tbase/4) + ((t) * (twidth/2)) + (s)) ^ ((t & 1) ? XOR_SWAP_DWORD : 0);
836842               UINT32 c = tc[taddr];
837843
838844               color->r = ((c >> 24) & 0xff);
r1490r1491
10111017                                                                                                   \
10121018      /* bilinear */                                                                                    \
10131019                                                                                                   \
1014      sss1 = (SSS >> 10) - (tsl >> 2);                                                                     \
1015      sss2 = sss1 + 1;                                                                                 \
1016                                                                                                   \
1017      sst1 = (SST >> 10) - (ttl >> 2);                                                                     \
1018      sst2 = sst1 + 1;                                                                                 \
1019                                                                                                   \
1020        sss1 = SSS >> 10;                                                                                                           \
1021        sss2 = sss1 + 1;                                                                                                            \
1022                                                                                                                                    \
1023        sst1 = SST >> 10;                                                                                                           \
1024        sst2 = sst1 + 1;                                                                                                            \
1025                                                                                                                                    \
10201026      CLAMP(sss1, sst1);                                                                                 \
10211027      CLAMP(sss2, sst2);                                                                                 \
10221028                                                                                                   \
1029        sss1 -= tsl >> 2;                                                                                                           \
1030        sss2 -= tsl >> 2;                                                                                                           \
1031                                                                                                                                    \
1032        sst1 -= ttl >> 2;                                                                                                           \
1033        sst2 -= ttl >> 2;                                                                                                           \
1034                                                                                                                                    \
1035        MASK(sss1, sst1);                                                                                                           \
1036        MASK(sss2, sst2);                                                                                                           \
1037                                                                                                                                    \
10231038      FETCH_TEXEL(&t0, sss1, sst1, twidth, tformat, tsize, tbase);                                                \
10241039      FETCH_TEXEL(&t1, sss2, sst1, twidth, tformat, tsize, tbase);                                                \
10251040      FETCH_TEXEL(&t2, sss1, sst2, twidth, tformat, tsize, tbase);                                                \
r1490r1491
10401055   else                                                                                             \
10411056   {                                                                                                \
10421057      int sss1, sst1;                                                                                    \
1043      sss1 = (SSS >> 10) - (tsl >> 2);                                                                     \
1044      if ((SSS & 0x3ff) >= 0x200) sss1++;                                                                     \
1045                                                                                                   \
1046      sst1 = (SST >> 10) - (ttl >> 2);                                                                     \
1047      if ((SST & 0x3ff) >= 0x200) sst1++;                                                                     \
1048                                                                                                   \
1058        sss1 = SSS >> 10;                                                                                                           \
1059        if ((SSS & 0x3ff) >= 0x200) sss1++;                                                                                         \
1060                                                                                                                                    \
1061        sst1 = SST >> 10;                                                                                                           \
1062        if ((SST & 0x3ff) >= 0x200) sst1++;                                                                                         \
1063                                                                                                                                    \
10491064      CLAMP(sss1, sst1);                                                                                 \
10501065                                                                                                   \
1066        sss1 -= tsl >> 2;                                                                                                           \
1067        sst1 -= ttl >> 2;                                                                                                           \
1068                                                                                                                                    \
1069        MASK(sss1, sst1);                                                                                                           \
1070                                                                                                                                    \
10511071      /* point sample */                                                                                 \
10521072      FETCH_TEXEL(&TEX, sss1, sst1, twidth, tformat, tsize, tbase);                                                \
10531073   }                                                                                                \
r1490r1491
11851205   tsize = tile[rect->tilenum].size;
11861206   tbase = tile[rect->tilenum].tmem;
11871207
1188   // FIXME?: clamping breaks at least Rampage World Tour
1189   clamp_t = 0; //tile[rect->tilenum].ct;
1190   clamp_s = 0; //tile[rect->tilenum].cs;
1208    clamp_t = tile[rect->tilenum].ct;
1209    clamp_s = tile[rect->tilenum].cs;
11911210
11921211   mirror_t = tile[rect->tilenum].mt;
11931212   mirror_s = tile[rect->tilenum].ms;
r1490r1491
15661585   tsize = tile[rect->tilenum].size;
15671586   tbase = tile[rect->tilenum].tmem;
15681587
1569   // FIXME?: clamping breaks at least Rampage World Tour
1570   clamp_t = 0; //tile[rect->tilenum].ct;
1571   clamp_s = 0; //tile[rect->tilenum].cs;
1588    clamp_t = tile[rect->tilenum].ct;
1589    clamp_s = tile[rect->tilenum].cs;
15721590
15731591   mirror_t = tile[rect->tilenum].mt;
15741592   mirror_s = tile[rect->tilenum].ms;
r1490r1491
18141832
18151833         if (x >= clipx1 && x < clipx2)
18161834         {
1835                int alpha_out = 0;
18171836            COLOR c1, c2;
18181837            c1.r = c1.g = c1.b = c1.a = 0;
18191838            c2.r = c2.g = c2.b = c2.a = 0;
r1490r1491
18981917            if (other_modes.cycle_type == CYCLE_TYPE_1)
18991918            {
19001919               c1 = COLOR_COMBINER(0);
1920                    if( c1.a == 0 )
1921                    {
1922                        alpha_out = 1;
1923                    }
19011924            }
19021925            else if (other_modes.cycle_type == CYCLE_TYPE_2)
19031926            {
19041927               c1 = COLOR_COMBINER(0);
19051928               c2 = COLOR_COMBINER(1);
1929                    if( c2.a == 0 )
1930                    {
1931                        alpha_out = 1;
1932                    }
19061933            }
19071934
1908            oz = (UINT16)zb[(fb_index + x) ^ WORD_ADDR_XOR];
1909            if (zbuffer)
1910            {
1911               if (sz < oz /*&& c.a != 0*/)
1912               {
1913                  if (other_modes.cycle_type == CYCLE_TYPE_1)
1914                  {
1915                     BLENDER1_32(&fb[(fb_index + x)], c1);
1916                  }
1917                  else
1918                  {
1919                     BLENDER2_32(&fb[(fb_index + x)], c1, c2);
1920                  }
1935                /* SGINUT 1/6/08: This fixes things in some games and breaks things in others.
1936                                  I believe the pixels should be discarded based on the alpha
1937                                  value stored in memory, but alpha and coverage are stored in
1938                                  anciliary bits in the framebuffer which are not currently
1939                                  emulated by MESS. */
1940                if( /*!alpha_out*/ 1 )
1941                {
1942                    oz = (UINT16)zb[(fb_index + x) ^ WORD_ADDR_XOR];
1943                    if (zbuffer)
1944                    {
1945                        if (sz < oz /*&& c.a != 0*/)
1946                        {
1947                            if (other_modes.cycle_type == CYCLE_TYPE_1)
1948                            {
1949                                BLENDER1_32(&fb[(fb_index + x)], c1);
1950                            }
1951                            else
1952                            {
1953                                BLENDER2_32(&fb[(fb_index + x)], c1, c2);
1954                            }
19211955
1922                  if (other_modes.z_compare_en && other_modes.z_update_en)
1923                  {
1924                     zb[(fb_index + x) ^ WORD_ADDR_XOR] = sz;
1925                  }
1926               }
1927            }
1928            else
1929            {
1930               if (other_modes.cycle_type == CYCLE_TYPE_1)
1931               {
1932                  BLENDER1_32(&fb[(fb_index + x)], c1);
1933               }
1934               else
1935               {
1936                  BLENDER2_32(&fb[(fb_index + x)], c1, c2);
1937               }
1938            }
1956                            if (other_modes.z_compare_en && other_modes.z_update_en)
1957                            {
1958                                zb[(fb_index + x) ^ WORD_ADDR_XOR] = sz;
1959                            }
1960                        }
1961                    }
1962                    else
1963                    {
1964                        if (other_modes.cycle_type == CYCLE_TYPE_1)
1965                        {
1966                            BLENDER1_32(&fb[(fb_index + x)], c1);
1967                        }
1968                        else
1969                        {
1970                            BLENDER2_32(&fb[(fb_index + x)], c1, c2);
1971                        }
1972                    }
1973                }
19391974         }
19401975
19411976         r += drinc;
r1490r1491
21032138         UINT16 sz = z >> 16;
21042139         int oz;
21052140         int sss = 0, sst = 0;
2141            int alpha_out = 0;
21062142         COLOR c1, c2;
21072143         c1.r = c1.g = c1.b = c1.a = 0;
21082144         c2.r = c2.g = c2.b = c2.a = 0;
r1490r1491
21892225            if (other_modes.cycle_type == CYCLE_TYPE_1)
21902226            {
21912227               c1 = COLOR_COMBINER(0);
2228                    if( c1.a == 0 )
2229                    {
2230                        alpha_out = 1;
2231                    }
21922232            }
21932233            else if (other_modes.cycle_type == CYCLE_TYPE_2)
21942234            {
21952235               c1 = COLOR_COMBINER(0);
21962236               c2 = COLOR_COMBINER(1);
2237                    if( c2.a == 0 )
2238                    {
2239                        alpha_out = 1;
2240                    }
21972241            }
21982242
2199            oz = (UINT16)zb[(fb_index + x) ^ WORD_ADDR_XOR];
2200            if (zbuffer)
2201            {
2202               if (sz < oz /*&& c.a != 0*/)
2203               {
2204                  //BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c);
2205                  {
2206                     int dith = dither_matrix_4x4[(((j) & 3) << 2) + ((i^WORD_ADDR_XOR) & 3)];
2207                     if (other_modes.cycle_type == CYCLE_TYPE_1)
2208                     {
2209                        BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, dith);
2210                     }
2211                     else
2212                     {
2213                        BLENDER2_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, c2, dith);
2214                     }
2215                  }
2243                /* SGINUT 1/6/08: This fixes things in some games and breaks things in others.
2244                                  I believe the pixels should be discarded based on the alpha
2245                                  value stored in memory, but alpha and coverage are stored in
2246                                  anciliary bits in the framebuffer which are not currently
2247                                  emulated by MESS. */
2248                if( /*!alpha_out*/ 1 )
2249                {
2250                    oz = (UINT16)zb[(fb_index + x) ^ WORD_ADDR_XOR];
2251                    if (zbuffer)
2252                    {
2253                        if (sz < oz /*&& c.a != 0*/)
2254                        {
2255                            //BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c);
2256                            {
2257                                int dith = dither_matrix_4x4[(((j) & 3) << 2) + ((i^WORD_ADDR_XOR) & 3)];
2258                                if (other_modes.cycle_type == CYCLE_TYPE_1)
2259                                {
2260                                    BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, dith);
2261                                }
2262                                else
2263                                {
2264                                    BLENDER2_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, c2, dith);
2265                                }
2266                            }
22162267
2217                  if (other_modes.z_compare_en && other_modes.z_update_en)
2218                  {
2219                     zb[(fb_index + x) ^ WORD_ADDR_XOR] = sz;
2220                  }
2221               }
2222            }
2223            else
2224            {
2225               //BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c);
2268                            if (other_modes.z_compare_en && other_modes.z_update_en)
2269                            {
2270                                zb[(fb_index + x) ^ WORD_ADDR_XOR] = sz;
2271                            }
2272                        }
2273                    }
2274                    else
2275                    {
2276                        //BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c);
22262277
2227               {
2228                  int dith = dither_matrix_4x4[(((j) & 3) << 2) + ((i^WORD_ADDR_XOR) & 3)];
2229                  if (other_modes.cycle_type == CYCLE_TYPE_1)
2230                  {
2231                     BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, dith);
2232                  }
2233                  else
2234                  {
2235                     BLENDER2_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, c2, dith);
2236                  }
2237               }
2238            }
2278                        {
2279                            int dith = dither_matrix_4x4[(((j) & 3) << 2) + ((i^WORD_ADDR_XOR) & 3)];
2280                            if (other_modes.cycle_type == CYCLE_TYPE_1)
2281                            {
2282                                BLENDER1_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, dith);
2283                            }
2284                            else
2285                            {
2286                                BLENDER2_16(&fb[(fb_index + x) ^ WORD_ADDR_XOR], c1, c2, dith);
2287                            }
2288                        }
2289                    }
2290                }
22392291         }
22402292
22412293         r += drinc;
r1490r1491
32383290
32393291         for (j=0; j < height; j++)
32403292         {
3241            int tline = tb + ((tile[tilenum].line / 4) * j);
3293            int tline = tb + ((tile[tilenum].line / 2) * j);
32423294            int s = ((j + tl) * ti_width) + sl;
32433295
32443296            for (i=0; i < width; i++)
src/mame/video/exidy.c
r1490r1491
88#include "exidy.h"
99
1010UINT8 *exidy_characterram;
11UINT8 *exidy_color_latch;
1112
1213UINT8 exidy_collision_mask;
1314UINT8 exidy_collision_invert;
r1490r1491
1617static mame_bitmap *motion_object_2_vid;
1718static mame_bitmap *motion_object_2_clip;
1819
19static UINT8 chardirty[256];
2020static UINT8 update_complete;
2121
2222static UINT8 int_condition;
r1490r1491
2828static UINT8 sprite2_xpos;
2929static UINT8 sprite2_ypos;
3030
31UINT8 exidy_color_latch[3];
3231
3332
34
3533/*************************************
3634 *
3735 *  Video startup
r1490r1491
4543   motion_object_1_vid = auto_bitmap_alloc(16, 16, machine->screen[0].format);
4644   motion_object_2_vid = auto_bitmap_alloc(16, 16, machine->screen[0].format);
4745   motion_object_2_clip = auto_bitmap_alloc(16, 16, machine->screen[0].format);
48
49   exidy_color_w(0, exidy_color_latch[0]);
50   exidy_color_w(1, exidy_color_latch[1]);
51   exidy_color_w(2, exidy_color_latch[2]);
5246}
5347
5448
r1490r1491
10195
10296/*************************************
10397 *
104 *  Character RAM
105 *
106 *************************************/
107
108WRITE8_HANDLER( exidy_characterram_w )
109{
110   if (exidy_characterram[offset] != data)
111   {
112      exidy_characterram[offset] = data;
113      chardirty[offset / 8 % 256] = 1;
114   }
115}
116
117
118
119/*************************************
120 *
12198 *  Palette RAM
12299 *
123100 *************************************/
124101
125INLINE void set_1_color(int index, int palette)
102INLINE void set_1_color(running_machine *machine, int index, int palette)
126103{
127   palette_set_color_rgb(Machine, index, pal1bit(exidy_color_latch[2] >> palette), pal1bit(exidy_color_latch[1] >> palette), pal1bit(exidy_color_latch[0] >> palette));
104   palette_set_color_rgb(machine, index, pal1bit(exidy_color_latch[2] >> palette), pal1bit(exidy_color_latch[1] >> palette), pal1bit(exidy_color_latch[0] >> palette));
128105}
129106
130WRITE8_HANDLER( exidy_color_w )
107static void set_colors(running_machine *machine)
131108{
132   exidy_color_latch[offset] = data;
133
134109   /* motion object 1 */
135   set_1_color(0, 0);
136   set_1_color(1, 7);
110   set_1_color(machine, 0, 0);
111   set_1_color(machine, 1, 7);
137112
138113   /* motion object 2 */
139   set_1_color(2, 0);
140   set_1_color(3, 6);
114   set_1_color(machine, 2, 0);
115   set_1_color(machine, 3, 6);
141116
142117   /* one-bit characters */
143   if (Machine->gfx[0]->color_granularity == 2)
118   if (machine->gfx[0]->color_granularity == 2)
144119   {
145      set_1_color(4, 0);      /* chars 0x00-0x3F */
146      set_1_color(5, 4);
147      set_1_color(6, 0);      /* chars 0x40-0x7F */
148      set_1_color(7, 3);
149      set_1_color(8, 0);      /* chars 0x80-0xBF */
150      set_1_color(9, 2);
151      set_1_color(10, 0);      /* chars 0xC0-0xFF */
152      set_1_color(11, 1);
120      set_1_color(machine, 4, 0);      /* chars 0x00-0x3F */
121      set_1_color(machine, 5, 4);
122      set_1_color(machine, 6, 0);      /* chars 0x40-0x7F */
123      set_1_color(machine, 7, 3);
124      set_1_color(machine, 8, 0);      /* chars 0x80-0xBF */
125      set_1_color(machine, 9, 2);
126      set_1_color(machine, 10, 0);      /* chars 0xC0-0xFF */
127      set_1_color(machine, 11, 1);
153128   }
154129
155130   /* two-bit characters */
156131   else
157132   {
158      set_1_color(4, 0);      /* chars 0x00-0x3F */
159      set_1_color(5, 0);
160      set_1_color(6, 4);
161      set_1_color(7, 3);
162      set_1_color(8, 0);      /* chars 0x40-0x7F */
163      set_1_color(9, 0);
164      set_1_color(10, 4);
165      set_1_color(11, 3);
166      set_1_color(12, 0);      /* chars 0x80-0xBF */
167      set_1_color(13, 0);
168      set_1_color(14, 2);
169      set_1_color(15, 1);
170      set_1_color(16, 0);      /* chars 0xC0-0xFF */
171      set_1_color(17, 0);
172      set_1_color(18, 2);
173      set_1_color(19, 1);
133      set_1_color(machine, 4, 0);      /* chars 0x00-0x3F */
134      set_1_color(machine, 5, 0);
135      set_1_color(machine, 6, 4);
136      set_1_color(machine, 7, 3);
137      set_1_color(machine, 8, 0);      /* chars 0x40-0x7F */
138      set_1_color(machine, 9, 0);
139      set_1_color(machine, 10, 4);
140      set_1_color(machine, 11, 3);
141      set_1_color(machine, 12, 0);      /* chars 0x80-0xBF */
142      set_1_color(machine, 13, 0);
143      set_1_color(machine, 14, 2);
144      set_1_color(machine, 15, 1);
145      set_1_color(machine, 16, 0);      /* chars 0xC0-0xFF */
146      set_1_color(machine, 17, 0);
147      set_1_color(machine, 18, 2);
148      set_1_color(machine, 19, 1);
174149   }
175150}
176151
r1490r1491
222197
223198static void update_background(running_machine *machine)
224199{
225   int x, y, offs;
200   int x, y, code, offs;
226201
227   /* update the background and any dirty characters in it */
202   /* decode chars */
203   const gfx_layout *gfx = machine->drv->gfxdecodeinfo[0].gfxlayout;
204
205   for (code = 0; code < gfx->total; code++)
206         decodechar(machine->gfx[0], code, exidy_characterram, gfx);
207
208   /* update the background */
228209   for (y = offs = 0; y < 32; y++)
229210      for (x = 0; x < 32; x++, offs++)
230211      {
231         int code = videoram[offs];
212         int color;
232213
233         /* see if the character is dirty */
234         if (chardirty[code] == 1)
235         {
236            decodechar(machine->gfx[0], code, exidy_characterram, machine->drv->gfxdecodeinfo[0].gfxlayout);
237            chardirty[code] = 2;
238         }
214         code = videoram[offs];
215         color = code >> 6;
239216
240         /* see if the bitmap is dirty */
241         if (dirtybuffer[offs] || chardirty[code])
242         {
243            int color = code >> 6;
244            drawgfx(tmpbitmap, machine->gfx[0], code, color, 0, 0, x * 8, y * 8, NULL, TRANSPARENCY_NONE, 0);
245            dirtybuffer[offs] = 0;
246         }
217         drawgfx(tmpbitmap, machine->gfx[0], code, color, 0, 0, x * 8, y * 8, NULL, TRANSPARENCY_NONE, 0);
247218      }
248
249   /* reset the char dirty array */
250   for (y = 0; y < 256; y++)
251      if (chardirty[y] == 2)
252         chardirty[y] = 0;
253219}
254220
255221
r1490r1491
290256   return (!(sprite_enable & 0x80) || (sprite_enable & 0x10) || (exidy_collision_mask == 0x00));
291257}
292258
293INLINE int sprite_2_enabled(void)
294{
295   return (!(sprite_enable & 0x40));
296}
297
298259VIDEO_EOF( exidy )
299260{
300   UINT8 enable_set = ((sprite_enable & 0x20) != 0);
261   UINT8 enable_set_1 = ((sprite_enable & 0x20) != 0);
262   UINT8 enable_set_2 = ((sprite_enable & 0x40) != 0);
301263    static const rectangle clip = { 0, 15, 0, 15 };
302264    int bgmask = machine->gfx[0]->color_granularity - 1;
303265    int org_1_x = 0, org_1_y = 0;
r1490r1491
309271   if (exidy_collision_mask == 0)
310272      return;
311273
312   /* if the sprites aren't enabled, we can't collide */
313   if (!sprite_1_enabled() && !sprite_2_enabled())
314   {
315      update_complete = 0;
316      return;
317   }
318
319274   /* update the background if necessary */
320275   if (!update_complete)
321276      update_background(machine);
r1490r1491
328283      org_1_x = 236 - sprite1_xpos - 4;
329284      org_1_y = 244 - sprite1_ypos - 4;
330285      drawgfx(motion_object_1_vid, machine->gfx[1],
331         (spriteno & 0x0f) + 16 * enable_set, 0,
286         (spriteno & 0x0f) + 16 * enable_set_1, 0,
332287         0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
333288   }
334289
335290   /* draw sprite 2 */
336291   fillbitmap(motion_object_2_vid, 0xff, &clip);
337   if (sprite_2_enabled())
338   {
339      org_2_x = 236 - sprite2_xpos - 4;
340      org_2_y = 244 - sprite2_ypos - 4;
341      drawgfx(motion_object_2_vid, machine->gfx[1],
342         ((spriteno >> 4) & 0x0f) + 32, 0,
343         0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
344   }
292   org_2_x = 236 - sprite2_xpos - 4;
293   org_2_y = 244 - sprite2_ypos - 4;
294   drawgfx(motion_object_2_vid, machine->gfx[1],
295      ((spriteno >> 4) & 0x0f) + 32 + 16 * enable_set_2, 0,
296      0, 0, 0, 0, &clip, TRANSPARENCY_PEN, 0);
345297
346298    /* draw sprite 2 clipped to sprite 1's location */
347299   fillbitmap(motion_object_2_clip, 0xff, &clip);
348   if (sprite_1_enabled() && sprite_2_enabled())
300   if (sprite_1_enabled())
349301   {
350302      sx = org_2_x - org_1_x;
351303      sy = org_2_y - org_1_y;
352304      drawgfx(motion_object_2_clip, machine->gfx[1],
353         ((spriteno >> 4) & 0x0f) + 32, 0,
305         ((spriteno >> 4) & 0x0f) + 32 + 16 * enable_set_2, 0,
354306         0, 0, sx, sy, &clip, TRANSPARENCY_PEN, 0);
355307   }
356308
r1490r1491
395347VIDEO_UPDATE( exidy )
396348{
397349   int sx, sy;
350   UINT8 enable_set_2;
398351
352   /* refresh the colors from the palette (static or dynamic) */
353   set_colors(machine);
354
399355   /* update the background and draw it */
400356   update_background(machine);
401357   copybitmap(bitmap, tmpbitmap, 0, 0, 0, 0, cliprect, TRANSPARENCY_NONE, 0);
402358
403359   /* draw sprite 2 first */
404   if (sprite_2_enabled())
405   {
406      sx = 236 - sprite2_xpos - 4;
407      sy = 244 - sprite2_ypos - 4;
360   enable_set_2 = ((sprite_enable & 0x40) != 0);
408361
409      drawgfx(bitmap, machine->gfx[1],
410         ((spriteno >> 4) & 0x0f) + 32, 1,
411         0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
412   }
362   sx = 236 - sprite2_xpos - 4;
363   sy = 244 - sprite2_ypos - 4;
413364
365   drawgfx(bitmap, machine->gfx[1],
366      ((spriteno >> 4) & 0x0f) + 32 + 16 * enable_set_2, 1,
367      0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
368
414369   /* draw sprite 1 next */
415370   if (sprite_1_enabled())
416371   {
417      UINT8 enable_set = ((sprite_enable & 0x20) != 0);
372      UINT8 enable_set_1 = ((sprite_enable & 0x20) != 0);
418373
419374      sx = 236 - sprite1_xpos - 4;
420375      sy = 244 - sprite1_ypos - 4;
r1490r1491
422377      if (sy < 0) sy = 0;
423378
424379      drawgfx(bitmap, machine->gfx[1],
425         (spriteno & 0x0f) + 16 * enable_set, 0,
380         (spriteno & 0x0f) + 16 * enable_set_1, 0,
426381         0, 0, sx, sy, cliprect, TRANSPARENCY_PEN, 0);
427382   }
428383
src/mame/video/skychut.c
r1490r1491
66
77  (c) 12/2/1998 Lee Taylor
88
9  2006 - major rewrite by couriersud
10
911***************************************************************************/
1012
1113#include "driver.h"
14#include "skychut.h"
1215
16static tilemap *      tx_tilemap;
17static gfx_element *   back_gfx;
18static UINT32         extyoffs[32*8];
19static UINT32         extxoffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
1320
21static const gfx_layout backlayout =
22{
23   8,8*32,   /* 8*8 characters */
24   4,   /* 256 characters */
25   1,   /* 1 bits per pixel */
26   { 0 },
27   { 0, 1, 2, 3, 4, 5, 6, 7 },
28   { 0*8*32, 1*8*32, 2*8*32, 3*8*32, 4*8*32, 5*8*32, 6*8*32, 7*8*32 },
29   32*8*8,   /* every char takes 8 consecutive bytes */
30   extxoffs, extyoffs
31};
1432
15UINT8 *iremm15_chargen;
16static int bottomline;
33static const gfx_layout charlayout =
34{
35   8,8,   /* 8*8 characters */
36   256,   /* 256 characters */
37   1,   /* 1 bits per pixel */
38   { 0 },
39   { 0, 1, 2, 3, 4, 5, 6, 7 },
40   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
41   8*8   /* every char takes 8 consecutive bytes */
42};
1743
44static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
45{
46   //irem_state *state = Machine->driver_data;
1847
48   return (31-col)*32 + row;
49}
50
51
52static void get_tile_info(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
53{
54   SET_TILE_INFO(0, videoram[tile_index], colorram[tile_index] & 0x07, 0);
55}
56
57
1958WRITE8_HANDLER( skychut_colorram_w )
2059{
21   colorram[offset] = data;
60   if (colorram[offset] != data)
61   {
62      tilemap_mark_tile_dirty(tx_tilemap, offset);
63      colorram[offset] = data;
64   }
2265}
2366
24WRITE8_HANDLER( skychut_ctrl_w )
67
68WRITE8_HANDLER( iremm15_chargen_w )
2569{
26//popmessage("%02x",data);
70   irem_state *state = Machine->driver_data;
2771
28   /* I have NO IDEA if this is correct or not */
29   bottomline = ~data & 0x20;
72   if (state->chargen[offset] != data)
73   {
74      state->chargen[offset] = data;
75      /* not very effective ... dirty would be better */
76      decodechar(Machine->gfx[0],offset >> 3,state->chargen, &Machine->gfx[0]->layout);
77   }
3078}
3179
3280
33VIDEO_UPDATE( skychut )
81INLINE void plot_pixel_iremm10(mame_bitmap *bm, int x, int y, int col)
3482{
83   irem_state *state = Machine->driver_data;
84
85   if (!state->flip)
86      *BITMAP_ADDR16(bm, y, x) = col;
87   else
88      *BITMAP_ADDR16(bm, (IREMM10_VBSTART - 1)- (y - IREMM10_VBEND) + 6
89            , (IREMM10_HBSTART - 1)- (x- IREMM10_HBEND)) = col; // only when flip_screen(?)
90}
91
92VIDEO_START( iremm10 )
93{
94   //irem_state *state = machine->driver_data;
95   int i;
96
97   for (i=0;i<32*8;i++)
98      extyoffs[i] = i*8;
99
100   video_start_generic(machine);
101
102   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,32,32);
103   tilemap_set_transparent_pen(tx_tilemap, 0x07);
104   tilemap_set_scrolldx(tx_tilemap, 0, 62);
105   tilemap_set_scrolldy(tx_tilemap, 0, 0);
106
107   back_gfx = allocgfx(&backlayout);
108   back_gfx->total_colors = 8;
109
110   machine->gfx[1] = back_gfx;
111   return ;
112}
113
114VIDEO_START( iremm15 )
115{
116   irem_state *state = machine->driver_data;
117
118   machine->gfx[0] = allocgfx(&charlayout);
119   machine->gfx[0]->total_colors = 8;
120
121   decodegfx(machine->gfx[0], state->chargen,0,256);
122
123   video_start_generic(machine);
124
125   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,32,32);
126   tilemap_set_scrolldx(tx_tilemap, 0, 116);
127   tilemap_set_scrolldy(tx_tilemap, 0, 0);
128
129   return ;
130}
131
132/***************************************************************************
133
134  Draw the game screen in the given mame_bitmap.
135
136***************************************************************************/
137VIDEO_UPDATE( iremm10 )
138{
139   irem_state *state = machine->driver_data;
35140   int offs;
141   int color[4]= { 3, 3, 5, 5};
142   int xpos[4] = { 4*8, 26*8, 7*8, 6*8} ;
143   int i;
36144
37145   fillbitmap(bitmap,machine->pens[7],cliprect);
38146
39   for (offs = 0;offs < 0x400;offs++)
40   {
41      int mask=iremm15_chargen[offs];
42      int x = offs / 256;
43      int y = offs % 256;
44      int col = 0;
147   decodegfx(back_gfx, state->chargen,0,4);
148   for (i=0;i<4;i++)
149      if (state->flip)
150         drawgfx(bitmap, back_gfx, i, color[i], 1, 1, 31*8 - xpos[i], 6, cliprect, 0, 0);
151      else
152         drawgfx(bitmap, back_gfx, i, color[i], 0, 0, xpos[i], 0, cliprect, 0, 0);
45153
46      switch (x)
47      {
48         case 0: x = 4*8;  col = 3; break;
49         case 1: x = 26*8; col = 3; break;
50         case 2: x = 7*8;  col = 5; break;
51         case 3: x = 6*8;  col = 5; break;
52      }
53
54      if (x >= cliprect->min_x && x+7 <= cliprect->max_x
55            && y >= cliprect->min_y && y <= cliprect->max_y)
56      {
57         if (mask&0x80) *BITMAP_ADDR16(bitmap, y, x+0) = col;
58         if (mask&0x40) *BITMAP_ADDR16(bitmap, y, x+1) = col;
59         if (mask&0x20) *BITMAP_ADDR16(bitmap, y, x+2) = col;
60         if (mask&0x10) *BITMAP_ADDR16(bitmap, y, x+3) = col;
61         if (mask&0x08) *BITMAP_ADDR16(bitmap, y, x+4) = col;
62         if (mask&0x04) *BITMAP_ADDR16(bitmap, y, x+5) = col;
63         if (mask&0x02) *BITMAP_ADDR16(bitmap, y, x+6) = col;
64         if (mask&0x01) *BITMAP_ADDR16(bitmap, y, x+7) = col;
65      }
66   }
67
68   if (bottomline)
154   if (state->bottomline)
69155   {
70156      int y;
71157
72      for (y = cliprect->min_y;y <= cliprect->max_y;y++)
158      for (y = IREMM10_VBEND;y < IREMM10_VBSTART;y++)
73159      {
74         *BITMAP_ADDR16(bitmap, y, 16) = 0;
160         plot_pixel_iremm10(bitmap,16,y,0);
75161      }
76162   }
77163
78164   for (offs = videoram_size - 1;offs >= 0;offs--)
79   {
80      int sx,sy;
165      tilemap_mark_tile_dirty(tx_tilemap, offs);
81166
82      sx = 31 - offs / 32;
83      sy = offs % 32;
167   tilemap_set_flip(tx_tilemap, state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
168   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
84169
85      drawgfx(bitmap,machine->gfx[0],
86            videoram[offs],
87            colorram[offs],
88            0,0,
89            8*sx,8*sy,
90            cliprect,TRANSPARENCY_PEN,0);
91   }
92170   return 0;
93171}
94172
95173
96static void iremm15_drawgfx(mame_bitmap *bitmap, int ch,
97                     INT16 color, INT16 back, int x, int y)
98{
99   UINT8 mask;
100   int i;
174/***************************************************************************
101175
102   for (i=0; i<8; i++, y++) {
103      mask=iremm15_chargen[ch*8+i];
104      *BITMAP_ADDR16(bitmap, y, x+0) = mask&0x80?color:back;
105      *BITMAP_ADDR16(bitmap, y, x+1) = mask&0x40?color:back;
106      *BITMAP_ADDR16(bitmap, y, x+2) = mask&0x20?color:back;
107      *BITMAP_ADDR16(bitmap, y, x+3) = mask&0x10?color:back;
108      *BITMAP_ADDR16(bitmap, y, x+4) = mask&0x08?color:back;
109      *BITMAP_ADDR16(bitmap, y, x+5) = mask&0x04?color:back;
110      *BITMAP_ADDR16(bitmap, y, x+6) = mask&0x02?color:back;
111      *BITMAP_ADDR16(bitmap, y, x+7) = mask&0x01?color:back;
112   }
113}
176  Draw the game screen in the given mame_bitmap.
114177
115
178***************************************************************************/
116179VIDEO_UPDATE( iremm15 )
117180{
181   irem_state *state = machine->driver_data;
118182   int offs;
119183
120184   for (offs = videoram_size - 1;offs >= 0;offs--)
121   {
122      int sx,sy;
185      tilemap_mark_tile_dirty(tx_tilemap, offs);
123186
187   //tilemap_mark_all_tiles_dirty(tx_tilemap);
188   tilemap_set_flip(tx_tilemap, state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
189   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
124190
125      sx = 31 - offs / 32;
126      sy = offs % 32;
127
128      iremm15_drawgfx(tmpbitmap,
129                  videoram[offs],
130                  machine->pens[colorram[offs] & 7],
131                  machine->pens[7], // space beam not color 0
132                  8*sx,8*sy);
133   }
134
135   copybitmap(bitmap,tmpbitmap,0,0,0,0,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
136191   return 0;
137192}
138193
src/mame/video/atarigx2.c
r1490r1491
9393
9494VIDEO_START( atarigx2 )
9595{
96   static const struct atarirle_desc modesc =
96   static const atarirle_desc modesc =
9797   {
9898      REGION_GFX3,/* region where the GFX data lives */
9999      256,      /* number of entries in sprite RAM */
r1490r1491
113113      {{ 0,0x0e00,0,0,0,0,0,0 }},   /* mask for the priority */
114114      {{ 0 }}                  /* mask for the VRAM target */
115115   };
116   struct atarirle_desc adjusted_modesc = modesc;
116   atarirle_desc adjusted_modesc = modesc;
117117   int i;
118118
119119   /* blend the playfields and free the temporary one */
src/mame/video/zac2650.c
r1490r1491
55/*************************************************************/
66
77#include "driver.h"
8#include "video/s2636.h"
89
9UINT8 *zac_s2636ram;
1010static mame_bitmap *spritebitmap;
1111
12static UINT8 dirtychar[256>>3];
1312static int CollisionBackground;
1413static int CollisionSprite;
1514
r1490r1491
2827   tilemap_mark_tile_dirty(bg_tilemap, offset);
2928}
3029
31WRITE8_HANDLER( zac_s2636_w )
32{
33   if (zac_s2636ram[offset] != data)
34    {
35      zac_s2636ram[offset] = data;
36        dirtychar[offset>>3] = 1;
37    }
38}
39
4030READ8_HANDLER( zac_s2636_r )
4131{
42   if(offset!=0xCB) return zac_s2636ram[offset];
32   if(offset!=0xCB) return s2636_1_ram[offset];
4333    else return CollisionSprite;
4434}
4535
r1490r1491
5747   int Checksum=0;
5848   int x,y;
5949
60    if((zac_s2636ram[first * 0x10 + 10] < 0xf0) && (zac_s2636ram[second * 0x10 + 10] < 0xf0))
50    if((s2636_1_ram[first * 0x10 + 10] < 0xf0) && (s2636_1_ram[second * 0x10 + 10] < 0xf0))
6151    {
62       int fx     = (zac_s2636ram[first * 0x10 + 10] * 4)-22;
63        int fy     = (zac_s2636ram[first * 0x10 + 12] * 3)+3;
52       int fx     = (s2636_1_ram[first * 0x10 + 10] * 4)-22;
53        int fy     = (s2636_1_ram[first * 0x10 + 12] * 3)+3;
6454      int expand = (first==1) ? 2 : 1;
6555
6656        /* Draw first sprite */
r1490r1491
9686             second * 2,
9787             1,
9888             0,0,
99             (zac_s2636ram[second * 0x10 + 10] * 4)-22,(zac_s2636ram[second * 0x10 + 12] * 3) + 3,
89             (s2636_1_ram[second * 0x10 + 10] * 4)-22,(s2636_1_ram[second * 0x10 + 12] * 3) + 3,
10090             0, TRANSPARENCY_PEN, 0);
10191
10292        /* Remove fingerprint */
r1490r1491
168158
169159    for(offs=0;offs<0x50;offs+=0x10)
170160    {
171       if((zac_s2636ram[offs+10]<0xF0) && (offs!=0x30))
161       if((s2636_1_ram[offs+10]<0xF0) && (offs!=0x30))
172162      {
173163            int spriteno = (offs / 8);
174         int expand   = ((zac_s2636ram[0xc0] & (spriteno*2))!=0) ? 2 : 1;
175            int bx       = (zac_s2636ram[offs+10] * 4) - 22;
176            int by       = (zac_s2636ram[offs+12] * 3) + 3;
164         int expand   = ((s2636_1_ram[0xc0] & (spriteno*2))!=0) ? 2 : 1;
165            int bx       = (s2636_1_ram[offs+10] * 4) - 22;
166            int by       = (s2636_1_ram[offs+12] * 3) + 3;
177167            int x,y;
178168
179            if(dirtychar[spriteno])
180            {
181               /* 16x8 version */
182               decodechar(machine->gfx[1],spriteno,zac_s2636ram,machine->drv->gfxdecodeinfo[1].gfxlayout);
169         /* 16x8 version */
170         decodechar(machine->gfx[1],spriteno,s2636_1_ram,machine->drv->gfxdecodeinfo[1].gfxlayout);
183171
184                /* 16x16 version */
185               decodechar(machine->gfx[2],spriteno,zac_s2636ram,machine->drv->gfxdecodeinfo[2].gfxlayout);
172         /* 16x16 version */
173         decodechar(machine->gfx[2],spriteno,s2636_1_ram,machine->drv->gfxdecodeinfo[2].gfxlayout);
186174
187                dirtychar[spriteno] = 0;
188            }
189
190175            /* Sprite->Background collision detection */
191176         drawgfx(bitmap,machine->gfx[expand],
192177                spriteno,
src/mame/video/ninjaw.c
r1490r1491
3030
3131   assert_always(chips > 0, "we have an erroneous TC0100SCN configuration");
3232
33   TC0100SCN_vh_start(machine,chips,TC0100SCN_GFX_NUM,taito_hide_pixels,0,0,0,0,0,0);
33   TC0100SCN_vh_start(machine,chips,TC0100SCN_GFX_NUM,taito_hide_pixels,0,0,0,0,0,2);
3434
3535   if (has_TC0110PCR())
3636      TC0110PCR_vh_start();
r1490r1491
5858static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int primask,int x_offs,int y_offs)
5959{
6060   int offs, data, tilenum, color, flipx, flipy;
61   int x, y, priority, invis, curx, cury;
61   int x, y, priority, curx, cury;
6262   int code;
6363
6464#ifdef MAME_DEBUG
r1490r1491
7777      if (!tilenum) continue;
7878
7979      data = spriteram16[offs+0];
80//      x = (data - 8) & 0x3ff;
8180      x = (data - 32) & 0x3ff;   /* aligns sprites on rock outcrops and sewer hole */
8281
8382      data = spriteram16[offs+1];
8483      y = (data - 0) & 0x1ff;
8584
86      /* don't know meaning of "invis" bit (Darius: explosions of your bomb shots) */
85      /*
86            The purpose of the bit at data&0x8 (below) is unknown, but it is set
87            on Darius explosions, some enemy missiles and at least 1 boss.
88            It is most likely another priority bit but as there are no obvious
89            visual problems it will need checked against the original pcb.
90
91            There is a report this bit is set when the player intersects
92            the tank sprite in Ninja Warriors however I was unable to repro
93            this or find any use of this bit in that game.
94
95            Bit&0x8000 is set on some sprites in later levels of Darius
96            but is again unknown, and there is no obvious visual problem.
97        */
8798      data = spriteram16[offs+3];
8899      flipx    = (data & 0x1);
89100      flipy    = (data & 0x2) >> 1;
90101      priority = (data & 0x4) >> 2; // 1 = low
102      /* data&0x8 - unknown */
91103      if (priority != primask) continue;
92      invis    = (data & 0x8) >> 3;
93104      color    = (data & 0x7f00) >> 8;
105      /* data&0x8000 - unknown */
94106
95      /* Ninjaw: this stops your player flickering black and cutting into tank sprites */
96      if (invis) continue;
97
98107#ifdef MAME_DEBUG
99108      if (data & 0x80f0)   unknown |= (data &0x80f0);
100109#endif
src/mame/video/matmania.c
r1490r1491
219219
220220
221221      scrolly = -*matmania_scroll;
222      if (*matmania_pageselect)
222      if (matmania_pageselect[0]&0x01) // maniach sets 0x20 sometimes, which must have a different meaning
223223         copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
224224      else
225225         copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
r1490r1491
316316
317317
318318      scrolly = -*matmania_scroll;
319      if (*matmania_pageselect)
319
320      if (matmania_pageselect[0]&0x01) // this sets 0x20 sometimes, which must have a different meaning
320321         copyscrollbitmap(bitmap,tmpbitmap2,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
321322      else
322323         copyscrollbitmap(bitmap,tmpbitmap,0,0,1,&scrolly,&machine->screen[0].visarea,TRANSPARENCY_NONE,0);
src/mame/video/arkanoid.c
r1490r1491
3636   }
3737
3838   /* bit 2 selects the input paddle */
39    arkanoid_paddle_select = data & 0x04;
39   arkanoid_paddle_select = data & 0x04;
4040
4141   /* bit 3 is coin lockout (but not the service coin) */
4242   coin_lockout_w(0, !(data & 0x08));
r1490r1491
6060      tilemap_mark_all_tiles_dirty(bg_tilemap);
6161   }
6262
63   /* bit 7 is unknown */
63   /* BM:  bit 7 is suspected to be MCU reset, the evidence for this is that
64     the games tilt mode reset sequence shows the main CPU must be able to
65     directly control the reset line of the MCU, else the game will crash
66     leaving the tilt screen (as the MCU is now out of sync with main CPU
67     which resets itself).  This bit is the likely candidate as it is flipped
68     early in bootup just prior to accessing the MCU for the first time. */
69   if (cpu_gettotalcpu()>1) // Bootlegs don't have the MCU but still set this bit
70      cpunum_set_input_line(1, INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
6471}
6572
6673static TILE_GET_INFO( get_bg_tile_info )
src/mame/video/atarigt.c
r1490r1491
113113
114114VIDEO_START( atarigt )
115115{
116   static const struct atarirle_desc modesc =
116   static const atarirle_desc modesc =
117117   {
118118      REGION_GFX3,/* region where the GFX data lives */
119119      256,      /* number of entries in sprite RAM */
r1490r1491
133133      {{ 0,0x0e00,0,0,0,0,0,0 }},   /* mask for the priority */
134134      {{ 0,0x8000,0,0,0,0,0,0 }}   /* mask for the VRAM target */
135135   };
136   struct atarirle_desc adjusted_modesc = modesc;
136   atarirle_desc adjusted_modesc = modesc;
137137   int i;
138138
139139   /* blend the playfields and free the temporary one */
src/mame/tiny.mak
r1490r1491
55#   Small driver-specific example makefile
66#   Use make SUBTARGET=tiny to build
77#
8#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8#   Copyright Nicola Salmoria and the MAME Team.
99#   Visit  http://mamedev.org for licensing and usage restrictions.
1010#
1111###########################################################################
src/mame/etc/jrcrypt.c
r1490r1491
456456
457457// CreateJrDecodeTable.c
458458//
459// Copyright (C) 1997 David Caldwell
459// Copyright David Caldwell
460460// This program is published under the GNU Public License.
461461//
462462// Comments, questions to: david@indigita.com
src/mame/layout/neogeo.lay
r0r1491
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="blank">
4      <rect>
5         <color red="0" green="0" blue="0" />
6      </rect>
7   </element>
8
9   <view name="Screen 0 Standard (4:3)">
10      <screen index="0">
11         <bounds left="0" top="0" right="4" bottom="3" />
12      </screen>
13   </view>
14
15   <view name="Screen 0 Cropped (304x224)">
16      <bezel name="blank" element="blank">
17         <bounds left="0" top="0" right="0.1" bottom="3" />
18      </bezel>
19      <bezel name="blank" element="blank">
20         <bounds left="3.9" top="0" right="4" bottom="3" />
21      </bezel>
22      <screen index="0">
23         <bounds left="0" top="0" right="4" bottom="3" />
24      </screen>
25   </view>
26
27   <view name="Screen 0 Stretched (304x224)">
28      <bounds left="0" top="0" right="4" bottom="3" />
29      <screen index="0">
30         <bounds left="-0.105263" top="0" right="4.105263" bottom="3" />
31      </screen>
32   </view>
33</mamelayout>
src/mame/drivers/eprom.c
r1490r1491
730730static DRIVER_INIT( eprom )
731731{
732732   atarigen_eeprom_default = NULL;
733   atarijsa_init(2, 6, 1, 0x0002);
733   atarijsa_init(machine, 1, 0x0002);
734734
735735   /* install CPU synchronization handlers */
736736   sync_data = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x16cc00, 0x16cc01, 0, 0, sync_r);
r1490r1491
743743static DRIVER_INIT( klaxp )
744744{
745745   atarigen_eeprom_default = NULL;
746   atarijsa_init(1, 2, 1, 0x0002);
746   atarijsa_init(machine, 1, 0x0002);
747747}
748748
749749
750750static DRIVER_INIT( guts )
751751{
752752   atarigen_eeprom_default = NULL;
753   atarijsa_init(1, 6, 1, 0x0002);
753   atarijsa_init(machine, 1, 0x0002);
754754}
755755
756756
src/mame/drivers/midyunit.c
r1490r1491
118118#include "midyunit.h"
119119
120120
121#define SLOW_CPU_CLOCK         (40000000)   /* smashtv, trog */
122#define FAST_CPU_CLOCK         (48000000)   /* narc, strkforc, mk, totcarn */
121/* master clocks vary based on game */
122#define SLOW_MASTER_CLOCK      XTAL_40MHz      /* "slow" == smashtv, trog, hiimpact */
123#define FAST_MASTER_CLOCK      XTAL_48MHz      /* "fast" == narc, mk, totcarn, strkforc */
124#define FASTER_MASTER_CLOCK      XTAL_50MHz      /* "faster" == term2 */
123125
124#define STDRES_PIXEL_CLOCK      (24000000/6)
125#define MEDRES_PIXEL_CLOCK      (48000000/6)
126/* pixel clocks are 48MHz (narc) or 24MHz (all others) regardless */
127#define MEDRES_PIXEL_CLOCK      (XTAL_48MHz / 6)
128#define STDRES_PIXEL_CLOCK      (XTAL_24MHz / 6)
126129
127130
128131
r1490r1491
142145
143146/*************************************
144147 *
148 *  Sound board comms
149 *
150 *************************************/
151
152static UINT32 narc_talkback_strobe_r(void *param)
153{
154   return (williams_narc_talkback_r() >> 8) & 1;
155}
156
157
158static UINT32 narc_talkback_data_r(void *param)
159{
160   return williams_narc_talkback_r() & 0xff;
161}
162
163
164static UINT32 adpcm_irq_state_r(void *param)
165{
166   return williams_adpcm_sound_irq_r() & 1;
167}
168
169
170
171/*************************************
172 *
145173 *  CMOS read/write
146174 *
147175 *************************************/
r1490r1491
226254   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN4 )
227255   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
228256   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
229   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED ) /* T/B strobe */
257   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(narc_talkback_strobe_r, NULL)
230258   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) /* memory protect interlock */
231259   PORT_BIT( 0x3000, IP_ACTIVE_LOW, IPT_UNUSED )
232260   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Language ) ) /* Is this a REAL dip or toggle? or software enable? */
r1490r1491
236264//  PORT_DIPSETTING(      0x0000, DEF_STR( Unknown ) )
237265
238266   PORT_START
239   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
267   PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(narc_talkback_data_r, NULL)
268   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
269
240270   PORT_START
241271   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
242272   PORT_START
r1490r1491
567597   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
568598   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
569599   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
570   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
600   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(adpcm_irq_state_r, NULL)
571601   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
572602   //There should be an additional block button for player 2, but I coudn't find it.
573603
r1490r1491
659689   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
660690   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
661691   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
662   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
692   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(adpcm_irq_state_r, NULL)
663693   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
664694   //There should be an additional block button for player 2, but I coudn't find it.
665695
r1490r1491
744774   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN4 )
745775   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
746776   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
747   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
777   PORT_BIT( 0x3000, IP_ACTIVE_LOW, IPT_UNUSED )
778   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(adpcm_irq_state_r, NULL)
779   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
748780
749781   PORT_START
750782   PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(1)
r1490r1491
846878   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
847879   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) /* video freeze */
848880   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN3 )
849   PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNUSED )
881   PORT_BIT( 0x3c00, IP_ACTIVE_LOW, IPT_UNUSED )
882   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(adpcm_irq_state_r, NULL)
883   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
850884
851885   PORT_START
852886   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1490r1491
9691003static MACHINE_DRIVER_START( zunit )
9701004
9711005   /* basic machine hardware */
972   MDRV_CPU_ADD(TMS34010, FAST_CPU_CLOCK/TMS34010_CLOCK_DIVIDER)
1006   MDRV_CPU_ADD(TMS34010, FAST_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
9731007   MDRV_CPU_CONFIG(zunit_tms_config)
9741008   MDRV_CPU_PROGRAM_MAP(main_map,0)
9751009
r1490r1491
10021036static MACHINE_DRIVER_START( yunit_core )
10031037
10041038   /* basic machine hardware */
1005   MDRV_CPU_ADD_TAG("main", TMS34010, FAST_CPU_CLOCK/TMS34010_CLOCK_DIVIDER)
1039   MDRV_CPU_ADD_TAG("main", TMS34010, SLOW_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
10061040   MDRV_CPU_CONFIG(yunit_tms_config)
10071041   MDRV_CPU_PROGRAM_MAP(main_map,0)
10081042
r1490r1491
10251059
10261060   /* basic machine hardware */
10271061   MDRV_IMPORT_FROM(yunit_core)
1028   MDRV_CPU_REPLACE("main", TMS34010, SLOW_CPU_CLOCK/TMS34010_CLOCK_DIVIDER)
10291062   MDRV_IMPORT_FROM(williams_cvsd_sound)
10301063
10311064   /* video hardware */
r1490r1491
10381071
10391072   /* basic machine hardware */
10401073   MDRV_IMPORT_FROM(yunit_core)
1074   MDRV_CPU_REPLACE("main", TMS34010, FAST_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
10411075   MDRV_IMPORT_FROM(williams_cvsd_sound)
10421076
10431077   /* video hardware */
r1490r1491
10501084
10511085   /* basic machine hardware */
10521086   MDRV_IMPORT_FROM(yunit_core)
1053   MDRV_CPU_REPLACE("main", TMS34010, SLOW_CPU_CLOCK/TMS34010_CLOCK_DIVIDER)
10541087   MDRV_IMPORT_FROM(williams_cvsd_sound)
10551088
10561089   /* video hardware */
r1490r1491
10591092MACHINE_DRIVER_END
10601093
10611094
1062static MACHINE_DRIVER_START( yunit_cvsd_6bit_fast )
1095static MACHINE_DRIVER_START( yunit_adpcm_6bit_fast )
10631096
10641097   /* basic machine hardware */
10651098   MDRV_IMPORT_FROM(yunit_core)
1066   MDRV_IMPORT_FROM(williams_cvsd_sound)
1099   MDRV_CPU_REPLACE("main", TMS34010, FAST_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
1100   MDRV_IMPORT_FROM(williams_adpcm_sound)
10671101
10681102   /* video hardware */
10691103   MDRV_PALETTE_LENGTH(4096)
r1490r1491
10711105MACHINE_DRIVER_END
10721106
10731107
1074static MACHINE_DRIVER_START( yunit_adpcm_6bit_fast )
1108static MACHINE_DRIVER_START( yunit_adpcm_6bit_faster )
10751109
10761110   /* basic machine hardware */
10771111   MDRV_IMPORT_FROM(yunit_core)
1112   MDRV_CPU_REPLACE("main", TMS34010, FASTER_MASTER_CLOCK/TMS34010_CLOCK_DIVIDER)
10781113   MDRV_IMPORT_FROM(williams_adpcm_sound)
10791114
10801115   /* video hardware */
r1490r1491
21682203GAME( 1990, smashtv6, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 6.00)", GAME_SUPPORTS_SAVE )
21692204GAME( 1990, smashtv5, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 5.00)", GAME_SUPPORTS_SAVE )
21702205GAME( 1990, smashtv4, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 4.00)", GAME_SUPPORTS_SAVE )
2171GAME( 1990, hiimpact, 0,        yunit_cvsd_6bit_fast,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA4 02/04/91)", GAME_SUPPORTS_SAVE )
2172GAME( 1990, hiimpac3, hiimpact, yunit_cvsd_6bit_fast,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA3 12/27/90)", GAME_SUPPORTS_SAVE )
2173GAME( 1990, hiimpacp, hiimpact, yunit_cvsd_6bit_fast,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (prototype, rev 8.6 12/09/90)", GAME_SUPPORTS_SAVE )
2174GAME( 1991, shimpact, 0,        yunit_cvsd_6bit_fast,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (rev LA1 09/30/91)", GAME_SUPPORTS_SAVE )
2175GAME( 1991, shimpacp, shimpact, yunit_cvsd_6bit_fast,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (prototype, rev 5.0 09/15/91)", GAME_SUPPORTS_SAVE )
2176GAME( 1991, shimpap4, shimpact, yunit_cvsd_6bit_fast,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (prototype, rev 4.0 09/10/91)", GAME_SUPPORTS_SAVE ) /* See notes about factory restore above */
2206GAME( 1990, hiimpact, 0,        yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA4 02/04/91)", GAME_SUPPORTS_SAVE )
2207GAME( 1990, hiimpac3, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA3 12/27/90)", GAME_SUPPORTS_SAVE )
2208GAME( 1990, hiimpacp, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (prototype, rev 8.6 12/09/90)", GAME_SUPPORTS_SAVE )
2209GAME( 1991, shimpact, 0,        yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (rev LA1 09/30/91)", GAME_SUPPORTS_SAVE )
2210GAME( 1991, shimpacp, shimpact, yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (prototype, rev 5.0 09/15/91)", GAME_SUPPORTS_SAVE )
2211GAME( 1991, shimpap4, shimpact, yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (prototype, rev 4.0 09/10/91)", GAME_SUPPORTS_SAVE ) /* See notes about factory restore above */
21772212
2178GAME( 1991, term2,    0,        yunit_adpcm_6bit_fast, term2,    term2,    ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA3 03/27/92)", GAME_SUPPORTS_SAVE )
2179GAME( 1991, term2la2, term2,    yunit_adpcm_6bit_fast, term2,    term2la2, ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA2 12/09/91)", GAME_SUPPORTS_SAVE )
2180GAME( 1991, term2la1, term2,    yunit_adpcm_6bit_fast, term2,    term2la1, ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA1 11/01/91)", GAME_SUPPORTS_SAVE )
2181GAME( 1992, mkprot9,  mk,       yunit_adpcm_6bit_fast, mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (prototype, rev 9.0 07/28/92)", GAME_SUPPORTS_SAVE )
2182GAME( 1992, mkla1,    mk,       yunit_adpcm_6bit_fast, mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 1.0 08/09/92)", GAME_SUPPORTS_SAVE )
2183GAME( 1992, mkla2,    mk,       yunit_adpcm_6bit_fast, mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 2.0 08/18/92)", GAME_SUPPORTS_SAVE )
2184GAME( 1992, mkla3,    mk,       yunit_adpcm_6bit_fast, mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 3.0 08/31/92)", GAME_SUPPORTS_SAVE )
2185GAME( 1992, mkla4,    mk,       yunit_adpcm_6bit_fast, mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 4.0 09/28/92)", GAME_SUPPORTS_SAVE )
2186GAME( 1992, mkyawdim, mk,       mkyawdim,              mkla4,    mkyawdim, ROT0, "Midway",   "Mortal Kombat (Yawdim bootleg)", GAME_SUPPORTS_SAVE )
2187GAME( 1992, totcarn,  0,        yunit_adpcm_6bit_fast, totcarn,  totcarn,  ROT0, "Midway",   "Total Carnage (rev LA1 03/10/92)", GAME_SUPPORTS_SAVE )
2188GAME( 1992, totcarnp, totcarn,  yunit_adpcm_6bit_fast, totcarn,  totcarn,  ROT0, "Midway",   "Total Carnage (prototype, rev 1.0 01/25/92)", GAME_SUPPORTS_SAVE )
2213GAME( 1991, term2,    0,        yunit_adpcm_6bit_faster, term2,    term2,    ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA3 03/27/92)", GAME_SUPPORTS_SAVE )
2214GAME( 1991, term2la2, term2,    yunit_adpcm_6bit_faster, term2,    term2la2, ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA2 12/09/91)", GAME_SUPPORTS_SAVE )
2215GAME( 1991, term2la1, term2,    yunit_adpcm_6bit_faster, term2,    term2la1, ORIENTATION_FLIP_X, "Midway",   "Terminator 2 - Judgment Day (rev LA1 11/01/91)", GAME_SUPPORTS_SAVE )
2216GAME( 1992, mkprot9,  mk,       yunit_adpcm_6bit_faster, mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (prototype, rev 9.0 07/28/92)", GAME_SUPPORTS_SAVE )
2217GAME( 1992, mkla1,    mk,       yunit_adpcm_6bit_fast,   mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 1.0 08/09/92)", GAME_SUPPORTS_SAVE )
2218GAME( 1992, mkla2,    mk,       yunit_adpcm_6bit_fast,   mkla2,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 2.0 08/18/92)", GAME_SUPPORTS_SAVE )
2219GAME( 1992, mkla3,    mk,       yunit_adpcm_6bit_fast,   mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 3.0 08/31/92)", GAME_SUPPORTS_SAVE )
2220GAME( 1992, mkla4,    mk,       yunit_adpcm_6bit_fast,   mkla4,    mkyunit,  ROT0, "Midway",   "Mortal Kombat (rev 4.0 09/28/92)", GAME_SUPPORTS_SAVE )
2221GAME( 1992, mkyawdim, mk,       mkyawdim,                mkla4,    mkyawdim, ROT0, "Midway",   "Mortal Kombat (Yawdim bootleg)", GAME_SUPPORTS_SAVE )
2222GAME( 1992, totcarn,  0,        yunit_adpcm_6bit_fast,   totcarn,  totcarn,  ROT0, "Midway",   "Total Carnage (rev LA1 03/10/92)", GAME_SUPPORTS_SAVE )
2223GAME( 1992, totcarnp, totcarn,  yunit_adpcm_6bit_fast,   totcarn,  totcarn,  ROT0, "Midway",   "Total Carnage (prototype, rev 1.0 01/25/92)", GAME_SUPPORTS_SAVE )
src/mame/drivers/rampart.c
r1490r1491
1313    Note:
1414        P3 buttons 1 and 2 are mapped twice. THIS IS NOT A BUG!
1515
16    bp 548,a0==6c0007 && (d0&ffff)!=0,{print d0&ffff; g}
17
1618****************************************************************************
1719
1820    Memory map (TBA)
r1490r1491
2729#include "sound/2413intf.h"
2830
2931
32#define MASTER_CLOCK      XTAL_14_31818MHz
33
34
3035/*************************************
3136 *
3237 *  Interrupt handling
r1490r1491
126131        0x1000 == CBANK (color bank -- is it ever set to non-zero?)
127132        0x0800 == LETAMODE0 (controls center and left trackballs)
128133        0x0400 == LETARES (reset LETA analog control reader)
134        0x0200 == COINCTRL
135        0x0100 == COINCTRR
129136
130137        0x0020 == PMIX0 (ADPCM mixer level)
131138        0x0010 == /PCMRES (ADPCM reset)
r1490r1491
138145   {
139146      if (data & 0x1000)
140147         logerror("Color bank set to 1!\n");
148      coin_counter_w(0, (data >> 9) & 1);
149      coin_counter_w(1, (data >> 8) & 1);
141150   }
142151
143152   /* lower byte being modified? */
144153   if (ACCESSING_LSB)
145154   {
155      atarigen_set_oki6295_vol(Machine, (data & 0x0020) ? 100 : 0);
156      if (!(data & 0x0010))
157         sndti_reset(SOUND_OKIM6295, 0);
146158      atarigen_set_ym2413_vol(Machine, ((data >> 1) & 7) * 100 / 7);
147      atarigen_set_oki6295_vol(Machine, (data & 0x0020) ? 100 : 0);
159      if (!(data & 0x0001))
160         sndti_reset(SOUND_YM2413, 0);
148161   }
149162}
150163
r1490r1491
156169 *
157170 *************************************/
158171
159static ADDRESS_MAP_START( main_readmem, ADDRESS_SPACE_PROGRAM, 16 )
160   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM)
161   AM_RANGE(0x140000, 0x147fff) AM_READ(MRA16_ROM)
162   AM_RANGE(0x200000, 0x21ffff) AM_READ(MRA16_RAM)
163   AM_RANGE(0x3c0000, 0x3c07ff) AM_READ(MRA16_RAM)
164   AM_RANGE(0x3e0000, 0x3effff) AM_READ(MRA16_RAM)
165   AM_RANGE(0x460000, 0x460001) AM_READ(adpcm_r)
166   AM_RANGE(0x500000, 0x500fff) AM_READ(atarigen_eeprom_r)
167   AM_RANGE(0x640000, 0x640001) AM_READ(input_port_0_word_r)
168   AM_RANGE(0x640002, 0x640003) AM_READ(input_port_1_word_r)
169   AM_RANGE(0x6c0000, 0x6c0001) AM_READ(input_port_2_word_r)
170   AM_RANGE(0x6c0002, 0x6c0003) AM_READ(input_port_3_word_r)
171   AM_RANGE(0x6c0004, 0x6c0005) AM_READ(input_port_4_word_r)
172   AM_RANGE(0x6c0006, 0x6c0007) AM_READ(input_port_5_word_r)
172/* full memory map deduced from schematics and GALs */
173static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
174   ADDRESS_MAP_FLAGS( AMEF_ABITS(23) )
175   AM_RANGE(0x000000, 0x0fffff) AM_ROM
176   AM_RANGE(0x140000, 0x147fff) AM_MIRROR(0x438000) AM_ROM
177   AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_BASE(&rampart_bitmap)
178   AM_RANGE(0x220000, 0x3bffff) AM_WRITENOP   /* the code blasts right through this when initializing */
179   AM_RANGE(0x3c0000, 0x3c07ff) AM_MIRROR(0x019800) AM_READWRITE(MRA16_RAM, atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16)
180   AM_RANGE(0x3e0000, 0x3e07ff) AM_MIRROR(0x010000) AM_READWRITE(MRA16_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)
181   AM_RANGE(0x3e0800, 0x3e3f3f) AM_MIRROR(0x010000) AM_RAM
182   AM_RANGE(0x3e3f40, 0x3e3f7f) AM_MIRROR(0x010000) AM_READWRITE(MRA16_RAM, atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram)
183   AM_RANGE(0x3e3f80, 0x3effff) AM_MIRROR(0x010000) AM_RAM
184   AM_RANGE(0x460000, 0x460001) AM_MIRROR(0x019ffe) AM_READWRITE(adpcm_r, adpcm_w)
185   AM_RANGE(0x480000, 0x480003) AM_MIRROR(0x019ffc) AM_WRITE(ym2413_w)
186   AM_RANGE(0x500000, 0x500fff) AM_MIRROR(0x019000) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
187   AM_RANGE(0x5a6000, 0x5a6001) AM_MIRROR(0x019ffe) AM_WRITE(atarigen_eeprom_enable_w)
188   AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffe) AM_WRITE(latch_w)
189   AM_RANGE(0x640000, 0x640001) AM_MIRROR(0x019ffc) AM_READ(input_port_0_word_r)
190   AM_RANGE(0x640002, 0x640003) AM_MIRROR(0x019ffc) AM_READ(input_port_1_word_r)
191   AM_RANGE(0x6c0000, 0x6c0001) AM_MIRROR(0x019ff8) AM_READ(input_port_2_word_r)
192   AM_RANGE(0x6c0002, 0x6c0003) AM_MIRROR(0x019ff8) AM_READ(input_port_3_word_r)
193   AM_RANGE(0x6c0004, 0x6c0005) AM_MIRROR(0x019ff8) AM_READ(input_port_4_word_r)
194   AM_RANGE(0x6c0006, 0x6c0007) AM_MIRROR(0x019ff8) AM_READ(input_port_5_word_r)
195   AM_RANGE(0x726000, 0x726001) AM_MIRROR(0x019ffe) AM_WRITE(watchdog_reset16_w)
196   AM_RANGE(0x7e6000, 0x7e6001) AM_MIRROR(0x019ffe) AM_WRITE(atarigen_scanline_int_ack_w)
173197ADDRESS_MAP_END
174198
175199
176static ADDRESS_MAP_START( main_writemem, ADDRESS_SPACE_PROGRAM, 16 )
177   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(MWA16_ROM)
178   AM_RANGE(0x140000, 0x147fff) AM_WRITE(MWA16_ROM)
179   AM_RANGE(0x200000, 0x21ffff) AM_WRITE(rampart_bitmap_w) AM_BASE(&rampart_bitmap)
180   AM_RANGE(0x220000, 0x3bffff) AM_WRITE(MWA16_NOP)   /* the code blasts right through this when initializing */
181   AM_RANGE(0x3c0000, 0x3c07ff) AM_WRITE(atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16)
182   AM_RANGE(0x3c0800, 0x3dffff) AM_WRITE(MWA16_NOP)   /* the code blasts right through this when initializing */
183   AM_RANGE(0x3e0000, 0x3e07ff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)
184   AM_RANGE(0x3e0800, 0x3e3f3f) AM_WRITE(MWA16_RAM)
185   AM_RANGE(0x3e3f40, 0x3e3f7f) AM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram)
186   AM_RANGE(0x3e3f80, 0x3effff) AM_WRITE(MWA16_RAM)
187   AM_RANGE(0x460000, 0x460001) AM_WRITE(adpcm_w)
188   AM_RANGE(0x480000, 0x480003) AM_WRITE(ym2413_w)
189   AM_RANGE(0x500000, 0x500fff) AM_WRITE(atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
190   AM_RANGE(0x5a0000, 0x5affff) AM_WRITE(atarigen_eeprom_enable_w)
191   AM_RANGE(0x640000, 0x640001) AM_WRITE(latch_w)
192   AM_RANGE(0x720000, 0x72ffff) AM_WRITE(watchdog_reset16_w)
193   AM_RANGE(0x7e0000, 0x7effff) AM_WRITE(atarigen_scanline_int_ack_w)
194ADDRESS_MAP_END
195200
196
197
198201/*************************************
199202 *
200203 *  Port definitions
r1490r1491
203206
204207static INPUT_PORTS_START( rampart )
205208   PORT_START
206   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) // alternate button1
209   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) // alternate button1
207210   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
208211   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
209212   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
r1490r1491
221224   PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNUSED )
222225   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
223226   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
224   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) // alternate button2
227   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3) // alternate button2
225228   PORT_SERVICE( 0x0800, IP_ACTIVE_LOW )
226229   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
227230
r1490r1491
245248
246249static INPUT_PORTS_START( ramprt2p )
247250   PORT_START
248   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) // alternate button1
251   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) // alternate button1
249252   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
250253   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Players ) )
251254   PORT_DIPSETTING(    0x0000, "2")
r1490r1491
265268   PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNUSED )
266269   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
267270   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
268   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) // alternate button2
271   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3) // alternate button2
269272   PORT_SERVICE( 0x0800, IP_ACTIVE_LOW )
270273   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
271274
r1490r1491
379382static MACHINE_DRIVER_START( rampart )
380383
381384   /* basic machine hardware */
382   MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz/2)
383   MDRV_CPU_PROGRAM_MAP(main_readmem,main_writemem)
385   MDRV_CPU_ADD(M68000, MASTER_CLOCK/2)
386   MDRV_CPU_PROGRAM_MAP(main_map, 0)
384387   MDRV_CPU_VBLANK_INT(atarigen_video_int_gen,1)
385388
386389   MDRV_MACHINE_RESET(rampart)
387390   MDRV_NVRAM_HANDLER(atarigen)
391   MDRV_WATCHDOG_VBLANK_INIT(8)
388392
389393   /* video hardware */
390394   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
r1490r1491
395399   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
396400   /* note: these parameters are from published specs, not derived */
397401   /* the board uses an SOS-2 chip to generate video signals */
398   MDRV_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0+4, 336+4, 262, 0, 240)
402   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 456, 0+12, 336+12, 262, 0, 240)
399403
400404   MDRV_VIDEO_START(rampart)
401405   MDRV_VIDEO_UPDATE(rampart)
r1490r1491
403407   /* sound hardware */
404408   MDRV_SPEAKER_STANDARD_MONO("mono")
405409
406   MDRV_SOUND_ADD(OKIM6295, ATARI_CLOCK_14MHz/4/3)
410   MDRV_SOUND_ADD(OKIM6295, MASTER_CLOCK/4/3)
407411   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low)
408412   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
409413
410   MDRV_SOUND_ADD(YM2413, ATARI_CLOCK_14MHz/4)
414   MDRV_SOUND_ADD(YM2413, MASTER_CLOCK/4)
411415   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
412416MACHINE_DRIVER_END
413417
r1490r1491
531535
532536   atarigen_eeprom_default = compressed_default_eeprom;
533537   memcpy(&memory_region(REGION_CPU1)[0x140000], &memory_region(REGION_CPU1)[0x40000], 0x8000);
534   atarigen_slapstic_init(0, 0x140000, 118);
538   atarigen_slapstic_init(0, 0x140000, 0x438000, 118);
535539}
536540
537541
r1490r1491
542546 *
543547 *************************************/
544548
545GAME( 1990, rampart,  0,       rampart, rampart,  rampart, ROT0, "Atari Games", "Rampart (Trackball)", 0 )
546GAME( 1990, ramprt2p, rampart, rampart, ramprt2p, rampart, ROT0, "Atari Games", "Rampart (Joystick)", 0 )
547GAME( 1990, rampartj, rampart, rampart, rampartj, rampart, ROT0, "Atari Games", "Rampart (Japan, Joystick)", 0 )
549GAME( 1990, rampart,  0,       rampart, rampart,  rampart, ROT0, "Atari Games", "Rampart (Trackball)", GAME_SUPPORTS_SAVE )
550GAME( 1990, ramprt2p, rampart, rampart, ramprt2p, rampart, ROT0, "Atari Games", "Rampart (Joystick)", GAME_SUPPORTS_SAVE )
551GAME( 1990, rampartj, rampart, rampart, rampartj, rampart, ROT0, "Atari Games", "Rampart (Japan, Joystick)", GAME_SUPPORTS_SAVE )
src/mame/drivers/mediagx.c
r1490r1491
767767    { 0,1,2,3,4,5,6,7 },
768768    /* y offsets */
769769   { 0*8,1*8,2*8,3*8,
770     4*8,5*8,6*8,7*8,
771     0*8,1*8,2*8,3*8,
772770     4*8,5*8,6*8,7*8 },
773771    8*8                     /* every char takes 8 bytes */
774772};
src/mame/drivers/bfm_sc2.c
r1490r1491
173173#define UART_LOG(x) do { if (VERBOSE) logerror x; } while (0)
174174#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
175175
176#define MASTER_CLOCK      (XTAL_8MHz)
177
176178// local prototypes ///////////////////////////////////////////////////////
177179
178180static int  get_scorpion2_uart_status(void);   // retrieve status of uart on scorpion2 board
r1490r1491
516518      irq_timer_stat = 0x01;
517519      irq_status     = 0x02;
518520
519      cpunum_set_input_line(0, M6809_IRQ_LINE, HOLD_LINE );
521      cpunum_set_input_line(0, M6809_IRQ_LINE, PULSE_LINE );
520522   }
521523}
522524
r1490r1491
678680      }
679681   }
680682
681   if ( data & 0x1F ) cpunum_set_input_line(0, M6809_FIRQ_LINE, PULSE_LINE );
683   if ( data & 0x1F ) cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE );
682684}
683685
684686///////////////////////////////////////////////////////////////////////////
r1490r1491
790792
791793   upd7759_port_w(0, data&0x3F);   // setup sample
792794   upd7759_start_w(0, 0);
793   upd7759_start_w(0, 1);         // start
795   upd7759_start_w(0, 1);
794796}
795797
796798///////////////////////////////////////////////////////////////////////////
r1490r1491
14801482   return e2data_pin;
14811483}
14821484
1483
14841485static const UINT16 AddressDecode[]=
14851486{
14861487   0x0800,0x1000,0x0001,0x0004,0x0008,0x0020,0x0080,0x0200,
r1490r1491
30323033
30333034INPUT_PORTS_END
30343035
3035 static const struct upd7759_interface upd7759_interface =
3036 {
3036static const struct upd7759_interface upd7759_interface =
3037{
30373038   REGION_SOUND1,      /* memory region */
30383039   0
3039 };
3040};
30403041
30413042///////////////////////////////////////////////////////////////////////////
30423043// machine driver for scorpion2 board + adder2 expansion //////////////////
r1490r1491
30453046static MACHINE_DRIVER_START( scorpion2_vid )
30463047   MDRV_MACHINE_RESET( init )                     // main scorpion2 board initialisation
30473048   MDRV_INTERLEAVE(16)                           // needed for serial communication !!
3048   MDRV_CPU_ADD_TAG("main", M6809, 2000000 )         // 6809 CPU at 2 Mhz
3049   MDRV_CPU_ADD_TAG("main", M6809, MASTER_CLOCK/4 )   // 6809 CPU at 2 Mhz
30493050   MDRV_CPU_PROGRAM_MAP(memmap_vid,0)               // setup scorpion2 board memorymap
30503051   MDRV_CPU_PERIODIC_INT(timer_irq, 1000)            // generate 1000 IRQ's per second
30513052
r1490r1491
30683069   MDRV_PALETTE_INIT(adder2)
30693070   MDRV_GFXDECODE(adder2)
30703071
3071   MDRV_CPU_ADD_TAG("adder2", M6809, 2000000 )         // adder2 board 6809 CPU at 2 Mhz
3072   MDRV_CPU_ADD_TAG("adder2", M6809, MASTER_CLOCK/4 )   // adder2 board 6809 CPU at 2 Mhz
30723073   MDRV_CPU_PROGRAM_MAP(adder2_memmap,0)            // setup adder2 board memorymap
30733074   MDRV_CPU_VBLANK_INT(adder2_vbl, 1)               // board has a VBL IRQ
30743075
r1490r1491
30773078   MDRV_SOUND_CONFIG(upd7759_interface)
30783079   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
30793080
3080   MDRV_SOUND_ADD(YM2413, 3579545)
3081   MDRV_SOUND_ADD(YM2413, XTAL_3_579545MHz)
30813082   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
30823083MACHINE_DRIVER_END
30833084
src/mame/drivers/seta2.c
r1490r1491
2828P0-136A ; KL (Namco)    1997    Kosodate Quiz My Angel 2                Namco
2929P0-142A                 1999    Puzzle De Bowling                       Nihon System / Moss
3030P0-142A + extra parts   2000    Penguin Brothers                        Subsino
31B0-003B                 2000    Deer Hunting USA                        Sammy
32B0-003B                 2001    Turkey Hunting USA                      Sammy
31B0-003A (or B0-003B)    2000    Deer Hunting USA                        Sammy
32B0-003A (or B0-003B)    2001    Turkey Hunting USA                      Sammy
3333B0-010A                 2001    Wing Shooting Championship              Sammy
3434B0-010A                 2002    Trophy Hunting - Bear & Moose           Sammy
3535-------------------------------------------------------------------------------------------
r1490r1491
181181
182182Sammy USA Outdoor Shooting Series PCB
183183
184PCB B0-003B:
184PCB B0-003A (or B0-003B):
185185   Deer Hunting USA (c) 2000 Sammy USA
186186   Turkey Hunting USA (c) 2001 Sammy USA
187187
r1490r1491
197197EEPROM: 93LC46BX (1K Low-power 64 x 16-bit organization serial EEPROM)
198198   OSC: 50MHz & 28MHz
199199 Other: 8 Position Dipswitch x 2
200        Lattice ispLSI2032
201        Lattice isp1016E (2 for PCB B0-010A, used for light gun input)
200        Lattice ispLSI2032 - stamped "KW001"
201        Lattice isp1016E - stamped "GUN" (2 for PCB B0-010A, used for light gun input)
202202        BAT1 - CR2032 3Volt
203203
204PCB Number: B0-003B
204PCB Number: B0-003A (or B0-003B)
205205+-----------------------------------------------------------+
206206|             VOL                          +------+         |
207207|                                          |X1-010|     M1  |
r1490r1491
20822082   ROM_LOAD16_BYTE( "asx907e01.u07", 0x000001, 0x100000, CRC(7c67b502) SHA1(6a0e8883a115dac4095d86897e7eca2a007a1c71) )
20832083
20842084   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2085   ROM_LOAD( "asx901m01.u38", 0x0000000, 0x800000, BAD_DUMP CRC(23125c93) SHA1(c8735ac43bc67c52cb78ad5bca74fa2082dda040) )
2086   ROM_LOAD( "asx902m01.u39", 0x0800000, 0x800000, BAD_DUMP CRC(6e7330dd) SHA1(4a8590e9b8fe4767f7a25760bfe499792948a7ae) )
2087   ROM_LOAD( "asx903m01.u40", 0x1000000, 0x800000, BAD_DUMP CRC(5f86c322) SHA1(5a72adb99eea176199f172384cb051e2b045ab94) )
2088   ROM_LOAD( "asx904m01.u41", 0x1800000, 0x800000, BAD_DUMP CRC(6177f644) SHA1(120fe32518d133f03176db68f18c8175c1a81b27) )
2085   ROM_LOAD( "asx901m01.u38", 0x0000000, 0x800000, CRC(eabd3f44) SHA1(5a1ac986d11a8b019e18761cf4ea0a6f49fbdbfc) )
2086   ROM_LOAD( "asx902m01.u39", 0x0800000, 0x800000, CRC(c32130c8) SHA1(70d56ebed1f51657aaee02f95ac51589733e6eb7) )
2087   ROM_LOAD( "asx903m01.u40", 0x1000000, 0x800000, CRC(5f86c322) SHA1(5a72adb99eea176199f172384cb051e2b045ab94) )
2088   ROM_LOAD( "asx904m01.u41", 0x1800000, 0x800000, CRC(c77e0b66) SHA1(0eba30e62e4bd38c198fa6cb69fb94d002ded77a) )
20892089
20902090   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
20912091   /* Leave 1MB empty (addressable by the chip) */
src/mame/drivers/zn.c
r1490r1491
46794679GAME( 1997, psarc95,  0,        coh1002e, zn, coh1002e, ROT0, "Sony/Eighting/Raizing", "PS Arcade 95", GAME_IS_BIOS_ROOT )
46804680
46814681GAME( 1997, beastrzr, psarc95,  coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4682GAME( 1997, beastrzb, psarc95,  coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA Bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4682GAME( 1997, beastrzb, psarc95,  coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA Bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
46834683GAME( 1998, bldyror2, psarc95,  coh1002e, zn, coh1002e, ROT0, "Eighting/Raizing", "Bloody Roar 2 (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
46844684GAME( 2000, brvblade, tps,      coh1002e, zn, coh1002e, ROT270, "Eighting/Raizing", "Brave Blade (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
46854685
src/mame/drivers/itech32.c
r1490r1491
2424
2525    Known issues:
2626        * volume controls don't work in the Golden Tee games
27        * Driver's Edge accesses many uninitialized RAM locations;
28            requires hack to make steering in attract mode work
2729
2830****************************************************************************
2931
r1490r1491
218220#include "machine/timekpr.h"
219221
220222
221#define FULL_LOGGING   0
223#define FULL_LOGGING            0
224#define LOG_DRIVEDGE_UNINIT_RAM      0
222225
223#define CLOCK_8MHz      (8000000)
224#define CLOCK_12MHz      (12000000)
225#define CLOCK_25MHz      (25000000)
226226
227227
228
229228/*************************************
230229 *
231230 *  Static data
r1490r1491
709708   if (offset == 0) COMBINE_DATA(tms1_boot);
710709   if (offset == 0x382 && tms_spinning[0]) STOP_TMS_SPINNING(0);
711710   if (!tms_spinning[0])
712      cpu_boost_interleave(ATTOTIME_IN_HZ(CLOCK_25MHz/256), ATTOTIME_IN_USEC(20));
711      cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
713712}
714713
715714
r1490r1491
718717   COMBINE_DATA(&tms2_ram[offset]);
719718   if (offset == 0x382 && tms_spinning[1]) STOP_TMS_SPINNING(1);
720719   if (!tms_spinning[1])
721      cpu_boost_interleave(ATTOTIME_IN_HZ(CLOCK_25MHz/256), ATTOTIME_IN_USEC(20));
720      cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
722721}
723722
724723
725724static WRITE32_HANDLER( tms1_trigger_w )
726725{
727726   COMBINE_DATA(&tms1_ram[offset]);
728   cpu_boost_interleave(ATTOTIME_IN_HZ(CLOCK_25MHz/256), ATTOTIME_IN_USEC(20));
727   cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
729728}
730729
731730
732731static WRITE32_HANDLER( tms2_trigger_w )
733732{
734733   COMBINE_DATA(&tms2_ram[offset]);
735   cpu_boost_interleave(ATTOTIME_IN_HZ(CLOCK_25MHz/256), ATTOTIME_IN_USEC(20));
734   cpu_boost_interleave(ATTOTIME_IN_HZ(CPU020_CLOCK/256), ATTOTIME_IN_USEC(20));
736735}
737736
738737
r1490r1491
804803   else if (file)
805804      mame_fread(file, main_ram, main_ram_size);
806805   else
806   {
807807      for (i = 0x80; i < main_ram_size; i++)
808808         ((UINT8 *)main_ram)[i] = mame_rand(Machine);
809
810      /* due to accessing uninitialized RAM, we need this hack */
811      if (is_drivedge)
812         ((UINT32 *)main_ram)[0x2ce4/4] = 0x0000001e;
813   }
809814}
810815
811816
r1490r1491
818823   else if (file)
819824      mame_fread(file, nvram, nvram_size);
820825   else
826   {
821827      for (i = 0; i < nvram_size; i++)
822828         ((UINT8 *)nvram)[i] = mame_rand(Machine);
829   }
823830}
824831
832
825833static NVRAM_HANDLER( tournament )
826834{
827835   nvram_handler_itech020( machine, file, read_or_write );
828836   nvram_handler_timekeeper_0( machine, file, read_or_write );
829837}
830838
839
840
831841/*************************************
832842 *
833843 *  Main CPU memory handlers
r1490r1491
873883
874884
875885/*------ Driver's Edge memory layouts ------*/
886
887#if LOG_DRIVEDGE_UNINIT_RAM
888static UINT8 written[0x8000];
889
890static READ32_HANDLER( test1_r )
891{
892   if (!(mem_mask & 0xff000000) && !written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+0);
893   if (!(mem_mask & 0x00ff0000) && !written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+1);
894   if (!(mem_mask & 0x0000ff00) && !written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+2);
895   if (!(mem_mask & 0x000000ff) && !written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+3);
896   return ((UINT32 *)main_ram)[0x100/4 + offset];
897}
898
899static WRITE32_HANDLER( test1_w )
900{
901   if (!(mem_mask & 0xff000000)) written[0x100 + offset*4+0] = 1;
902   if (!(mem_mask & 0x00ff0000)) written[0x100 + offset*4+1] = 1;
903   if (!(mem_mask & 0x0000ff00)) written[0x100 + offset*4+2] = 1;
904   if (!(mem_mask & 0x000000ff)) written[0x100 + offset*4+3] = 1;
905   COMBINE_DATA(&((UINT32 *)main_ram)[0x100/4 + offset]);
906}
907
908static READ32_HANDLER( test2_r )
909{
910   if (!(mem_mask & 0xff000000) && !written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+0);
911   if (!(mem_mask & 0x00ff0000) && !written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+1);
912   if (!(mem_mask & 0x0000ff00) && !written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+2);
913   if (!(mem_mask & 0x000000ff) && !written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+3);
914   return ((UINT32 *)main_ram)[0xc00/4 + offset];
915}
916
917static WRITE32_HANDLER( test2_w )
918{
919   if (!(mem_mask & 0xff000000)) written[0xc00 + offset*4+0] = 1;
920   if (!(mem_mask & 0x00ff0000)) written[0xc00 + offset*4+1] = 1;
921   if (!(mem_mask & 0x0000ff00)) written[0xc00 + offset*4+2] = 1;
922   if (!(mem_mask & 0x000000ff)) written[0xc00 + offset*4+3] = 1;
923   COMBINE_DATA(&((UINT32 *)main_ram)[0xc00/4 + offset]);
924}
925#endif
926
876927static ADDRESS_MAP_START( drivedge_map, ADDRESS_SPACE_PROGRAM, 32 )
928#if LOG_DRIVEDGE_UNINIT_RAM
929AM_RANGE(0x000100, 0x0003ff) AM_MIRROR(0x40000) AM_READWRITE(test1_r, test1_w)
930AM_RANGE(0x000c00, 0x007fff) AM_MIRROR(0x40000) AM_READWRITE(test2_r, test2_w)
931#endif
877932   AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x40000) AM_RAM AM_BASE((UINT32 **)&main_ram) AM_SIZE(&main_ram_size)
878933   AM_RANGE(0x080000, 0x080003) AM_READ(input_port_3_msw_r)
879934   AM_RANGE(0x082000, 0x082003) AM_READ(input_port_4_msw_r)
r1490r1491
11471202
11481203static INPUT_PORTS_START( drivedge )
11491204   PORT_START   /* 8C000 */
1150   PORT_BIT ( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1151   PORT_BIT ( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1205   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1206   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
11521207   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Gear 1") PORT_CODE(KEYCODE_Z) PORT_PLAYER(1)
11531208   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Gear 2") PORT_CODE(KEYCODE_X) PORT_PLAYER(1)
11541209   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Gear 3") PORT_CODE(KEYCODE_C) PORT_PLAYER(1)
11551210   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Gear 4") PORT_CODE(KEYCODE_V) PORT_PLAYER(1)
11561211   PORT_SERVICE_NO_TOGGLE( 0x0040, IP_ACTIVE_LOW )
1157   PORT_BIT ( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
1212   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
11581213
11591214   PORT_START   /* 8E000 */
11601215   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Fan") PORT_CODE(KEYCODE_F) PORT_PLAYER(1)
r1490r1491
11631218   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Turbo Boost") PORT_CODE(KEYCODE_B) PORT_PLAYER(1)
11641219   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Network On") PORT_CODE(KEYCODE_N) PORT_PLAYER(1)
11651220   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Key")
1166   PORT_BIT ( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
1167   PORT_BIT ( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
1221   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
1222   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
11681223
11691224   PORT_START   /* 200000 */
11701225   PORT_SERVICE_NO_TOGGLE( 0x0100, IP_ACTIVE_LOW )
r1490r1491
15031558static MACHINE_DRIVER_START( timekill )
15041559
15051560   /* basic machine hardware */
1506   MDRV_CPU_ADD_TAG("main", M68000, CLOCK_12MHz)
1561   MDRV_CPU_ADD_TAG("main", M68000, CPU_CLOCK)
15071562   MDRV_CPU_PROGRAM_MAP(timekill_map,0)
15081563   MDRV_CPU_VBLANK_INT(generate_int1,1)
15091564
1510   MDRV_CPU_ADD_TAG("sound", M6809, CLOCK_8MHz/4)
1565   MDRV_CPU_ADD_TAG("sound", M6809, SOUND_CLOCK/8)
15111566   MDRV_CPU_PROGRAM_MAP(sound_map,0)
15121567
1513   MDRV_SCREEN_REFRESH_RATE(60)
1514
15151568   MDRV_MACHINE_RESET(itech32)
15161569   MDRV_NVRAM_HANDLER(itech32)
15171570
15181571   /* video hardware */
15191572   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
1520   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1521   MDRV_SCREEN_SIZE(384,256)
1522   MDRV_SCREEN_VISIBLE_AREA(0, 199, 0, 199)  /* bogus size, game will set it later */
15231573   MDRV_PALETTE_LENGTH(8192)
15241574
1575   MDRV_SCREEN_ADD("main", 0)
1576   MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 508, 0, 384, 262, 0, 256)
1577   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1578
15251579   MDRV_VIDEO_START(itech32)
15261580   MDRV_VIDEO_UPDATE(itech32)
15271581
15281582   /* sound hardware */
15291583   MDRV_SPEAKER_STANDARD_MONO("mono")
15301584
1531   MDRV_SOUND_ADD(ES5506, 16000000)
1585   MDRV_SOUND_ADD(ES5506, SOUND_CLOCK)
15321586   MDRV_SOUND_CONFIG(es5506_interface)
15331587   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
15341588MACHINE_DRIVER_END
r1490r1491
15521606   /* basic machine hardware */
15531607   MDRV_IMPORT_FROM(bloodstm)
15541608
1555   MDRV_CPU_REPLACE("main", M68EC020, CLOCK_25MHz)
1609   MDRV_CPU_REPLACE("main", M68EC020, CPU020_CLOCK)
15561610   MDRV_CPU_PROGRAM_MAP(drivedge_map,0)
15571611   MDRV_CPU_VBLANK_INT(NULL,0)
15581612
1559   MDRV_CPU_ADD(TMS32031, 40000000)
1613   MDRV_CPU_ADD(TMS32031, TMS_CLOCK)
15601614   MDRV_CPU_PROGRAM_MAP(drivedge_tms1_map,0)
15611615
1562   MDRV_CPU_ADD(TMS32031, 40000000)
1616   MDRV_CPU_ADD(TMS32031, TMS_CLOCK)
15631617   MDRV_CPU_PROGRAM_MAP(drivedge_tms2_map,0)
15641618
15651619//  MDRV_CPU_ADD(M6803, 8000000/4) -- network CPU
r1490r1491
15741628   /* basic machine hardware */
15751629   MDRV_IMPORT_FROM(bloodstm)
15761630
1577   MDRV_CPU_REPLACE("main", M68EC020, CLOCK_25MHz)
1631   MDRV_CPU_REPLACE("main", M68EC020, CPU020_CLOCK)
15781632   MDRV_CPU_PROGRAM_MAP(itech020_map,0)
15791633
15801634   MDRV_CPU_MODIFY("sound")
r1490r1491
36283682{
36293683   init_program_rom(machine);
36303684   via_config(0, &via_interface);
3631   via_set_clock(0, CLOCK_8MHz/4);
3685   via_set_clock(0, SOUND_CLOCK/8);
36323686   itech32_vram_height = 512;
36333687   itech32_planes = 2;
36343688   is_drivedge = 0;
r1490r1491
36393693{
36403694   init_program_rom(machine);
36413695   via_config(0, &via_interface);
3642   via_set_clock(0, CLOCK_8MHz/4);
3696   via_set_clock(0, SOUND_CLOCK/8);
36433697   itech32_vram_height = 1024;
36443698   itech32_planes = 1;
36453699   is_drivedge = 0;
r1490r1491
36503704{
36513705   init_program_rom(machine);
36523706   via_config(0, &via_interface);
3653   via_set_clock(0, CLOCK_8MHz/4);
3707   via_set_clock(0, SOUND_CLOCK/8);
36543708   itech32_vram_height = 1024;
36553709   itech32_planes = 1;
36563710   is_drivedge = 0;
r1490r1491
36613715{
36623716   init_program_rom(machine);
36633717   via_config(0, &drivedge_via_interface);
3664   via_set_clock(0, CLOCK_8MHz/4);
3718   via_set_clock(0, SOUND_CLOCK/8);
36653719   itech32_vram_height = 1024;
36663720   itech32_planes = 1;
36673721   is_drivedge = 1;
r1490r1491
36813735    */
36823736   init_program_rom(machine);
36833737   via_config(0, &via_interface);
3684   via_set_clock(0, CLOCK_8MHz/4);
3738   via_set_clock(0, SOUND_CLOCK/8);
36853739   itech32_vram_height = 1024;
36863740   itech32_planes = 1;
36873741
src/mame/drivers/malzak.c
r1490r1491
5555VIDEO_UPDATE( malzak );
5656WRITE8_HANDLER( playfield_w );
5757
58static READ8_HANDLER( malzak_s2636_1_r )
59{
60   return s2636_1_ram[offset];
61}
6258
63static READ8_HANDLER( malzak_s2636_2_r )
64{
65   return s2636_2_ram[offset];
66}
67
68static WRITE8_HANDLER( malzak_s2636_1_w )
69{
70   s2636_w(s2636_1_ram,offset,data,s2636_1_dirty);
71}
72
73static WRITE8_HANDLER( malzak_s2636_2_w )
74{
75   s2636_w(s2636_2_ram,offset,data,s2636_2_dirty);
76}
77
78
7959static READ8_HANDLER( saa5050_r )
8060{
8161   return saa5050_vidram[offset];
r1490r1491
144124   AM_RANGE(0x1200, 0x12ff) AM_READ(MRA8_RAM)
145125   AM_RANGE(0x1300, 0x13ff) AM_READ(MRA8_RAM)
146126   AM_RANGE(0x14cb, 0x14cb) AM_READ(fake_VRLE_r)
147   AM_RANGE(0x1400, 0x14ff) AM_READ(malzak_s2636_1_r)
148   AM_RANGE(0x1500, 0x15ff) AM_READ(malzak_s2636_2_r)
127   AM_RANGE(0x1400, 0x14ff) AM_READ(MRA8_RAM)
128   AM_RANGE(0x1500, 0x15ff) AM_READ(MRA8_RAM)
149129   AM_RANGE(0x1600, 0x16ff) AM_READ(MRA8_RAM)
150130   AM_RANGE(0x1700, 0x17ff) AM_READ(MRA8_RAM)
151131   AM_RANGE(0x1800, 0x1fff) AM_READ(saa5050_r)  // SAA 5050 video RAM
r1490r1491
164144   AM_RANGE(0x1100, 0x11ff) AM_WRITE(MWA8_RAM)
165145   AM_RANGE(0x1200, 0x12ff) AM_WRITE(MWA8_RAM)
166146   AM_RANGE(0x1300, 0x13ff) AM_WRITE(MWA8_RAM)
167   AM_RANGE(0x1400, 0x14ff) AM_WRITE(malzak_s2636_1_w)
168   AM_RANGE(0x1500, 0x15ff) AM_WRITE(malzak_s2636_2_w)
147   AM_RANGE(0x1400, 0x14ff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_1_ram)
148   AM_RANGE(0x1500, 0x15ff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_2_ram)
169149   AM_RANGE(0x1600, 0x16ff) AM_WRITE(playfield_w)
170150   AM_RANGE(0x1600, 0x16ff) AM_WRITE(MWA8_RAM)
171151   AM_RANGE(0x1700, 0x17ff) AM_WRITE(MWA8_RAM)
r1490r1491
187167   AM_RANGE(0x1300, 0x13ff) AM_READ(MRA8_RAM)
188168   AM_RANGE(0x14cb, 0x14cb) AM_READ(fake_VRLE_r)
189169   AM_RANGE(0x14cc, 0x14cc) AM_READ(s2636_portA_r)
190   AM_RANGE(0x1400, 0x14ff) AM_READ(malzak_s2636_1_r)
191   AM_RANGE(0x1500, 0x15ff) AM_READ(malzak_s2636_2_r)
170   AM_RANGE(0x1400, 0x14ff) AM_READ(MRA8_RAM)
171   AM_RANGE(0x1500, 0x15ff) AM_READ(MRA8_RAM)
192172   AM_RANGE(0x1600, 0x16ff) AM_READ(MRA8_RAM)
193173   AM_RANGE(0x1700, 0x17ff) AM_READ(MRA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
194174   AM_RANGE(0x1800, 0x1fff) AM_READ(saa5050_r)  // SAA 5050 video RAM
r1490r1491
207187   AM_RANGE(0x1100, 0x11ff) AM_WRITE(MWA8_RAM)
208188   AM_RANGE(0x1200, 0x12ff) AM_WRITE(MWA8_RAM)
209189   AM_RANGE(0x1300, 0x13ff) AM_WRITE(MWA8_RAM)
210   AM_RANGE(0x1400, 0x14ff) AM_WRITE(malzak_s2636_1_w)
211   AM_RANGE(0x1500, 0x15ff) AM_WRITE(malzak_s2636_2_w)
190   AM_RANGE(0x1400, 0x14ff) AM_WRITE(MWA8_RAM)
191   AM_RANGE(0x1500, 0x15ff) AM_WRITE(MWA8_RAM)
212192   AM_RANGE(0x1600, 0x16ff) AM_WRITE(playfield_w)
213193   AM_RANGE(0x1600, 0x16ff) AM_WRITE(MWA8_RAM)
214194   AM_RANGE(0x1700, 0x17ff) AM_WRITE(MWA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
r1490r1491
344324//  8*8
345325};
346326
347static const gfx_layout s2636_character10 =
348{
349   8,10,
350   5,
351   1,
352   { 0 },
353   { 0,1,2,3,4,5,6,7 },
354      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
355   8*16
356};
357
358327static const gfx_layout saa5050_charlayout =
359328{
360329   6, 10,
r1490r1491
393362
394363//add s2636 decodes here (i.e. from zac2650) and maybe re-arrange them
395364static GFXDECODE_START( malzak )
396   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,  0, 16 )
397     GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_character10, 0, 8 )   /* s2636 #1  */
398   GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_character10, 0, 8 )   /* s2636 #2  */
399   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_charlayout, 0, 128)
400   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_hilayout, 0, 128)
401   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_lolayout, 0, 128)
365   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,         0,  16 )
366     GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_gfx_layout,   0,   8 )   /* s2636 #1  */
367   GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_gfx_layout,   0,   8 )   /* s2636 #2  */
368   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_charlayout, 0, 128 )
369   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_hilayout,   0, 128 )
370   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_lolayout,   0, 128 )
402371GFXDECODE_END
403372
404373
src/mame/drivers/midzeus.c
r1490r1491
55    driver by Aaron Giles
66
77    Games supported:
8        * Invasion
8        * Invasion - The Abductors
99        * Mortal Kombat 4
1010        * Cruis'n Exotica
1111        * The Grid
r1490r1491
1313    Known bugs:
1414        * not done yet
1515
16According to a Midway service bulletin
17As of 2/12/2001 the lastest software levels:
18
19Game Title       Level  Released
20----------------------------------
21Cruis'n Exotica  v2.4   08/13/2000
22Invasion         v5.0   12/14/1999
23The Grid         v1.2   10/18/2000
24
1625**************************************************************************/
1726
1827#include "driver.h"
r1490r1491
11981207   ROM_LOAD32_WORD( "mk4_l3.u17", 0x0c00002, 0x200000, CRC(3a1a082c) SHA1(5f8e8ce760d8ebadd1240ef08f1382a37cf11d0b) )
11991208ROM_END
12001209
1210ROM_START( invasnab )
1211   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
1212   ROM_LOAD16_BYTE( "invasion2.u2", 0x000000, 0x200000, CRC(59d2e1d6) SHA1(994a4311ac4841d4341449c0c7480952b6f3855d) ) /* These four sound roms were labeled as v2.0 */
1213   ROM_LOAD16_BYTE( "invasion2.u3", 0x400000, 0x200000, CRC(86b956ae) SHA1(f7fd4601a2ce3e7e9b67e7d77908bfa206ee7e62) )
1214   ROM_LOAD16_BYTE( "invasion2.u4", 0x800000, 0x200000, CRC(5ef1fab5) SHA1(987afa0672fa89b18cf20d28644848a9e5ee9b17) )
1215   ROM_LOAD16_BYTE( "invasion2.u5", 0xc00000, 0x200000, CRC(e42805c9) SHA1(e5b71eb1852809a649ac43a82168b3bdaf4b1526) )
12011216
1202ROM_START( invasn )
1217   ROM_REGION32_LE( 0x1800000, REGION_USER1, 0 )
1218   ROM_LOAD32_WORD( "invasion5.u10", 0x0000000, 0x200000, CRC(8c7785d9) SHA1(701602314cd4eba4215c47ea0ae75fd4eddad43b) ) /* Roms U10 & U11 were labeled as v5.0 */
1219   ROM_LOAD32_WORD( "invasion5.u11", 0x0000002, 0x200000, CRC(8ceb1f32) SHA1(82d01f25cba25d77b11c347632e8b72776e12984) )
1220   ROM_LOAD32_WORD( "invasion4.u12", 0x0400000, 0x200000, CRC(ce1eb06a) SHA1(ff17690a0cbca6dcccccde70e2c5812ae03db5bb) ) /* Roms U12 through U19 were all labeled as v4.0 */
1221   ROM_LOAD32_WORD( "invasion4.u13", 0x0400002, 0x200000, CRC(33fc6707) SHA1(11a39ad980ec320547319eca6ffa5aef3ab8b010) )
1222   ROM_LOAD32_WORD( "invasion4.u14", 0x0800000, 0x200000, CRC(760682a1) SHA1(ff91210225d4aa750115c6219d4c35c9521a3f0b) )
1223   ROM_LOAD32_WORD( "invasion4.u15", 0x0800002, 0x200000, CRC(90467d7a) SHA1(a143a3d3605e5626852e75937160ba6bcd891608) )
1224   ROM_LOAD32_WORD( "invasion4.u16", 0x0c00000, 0x200000, CRC(3ef1b28d) SHA1(6f9a071b8830194fea84daa62aadabae86977c5f) )
1225   ROM_LOAD32_WORD( "invasion4.u17", 0x0c00002, 0x200000, CRC(97aa677a) SHA1(4d21cc59e0ffd4985f89c97c71d605c3b404a8a3) )
1226   ROM_LOAD32_WORD( "invasion4.u18", 0x1000000, 0x200000, CRC(6930c656) SHA1(28054ff9a6c6f5764a371f8defe4c1f5730618f3) )
1227   ROM_LOAD32_WORD( "invasion4.u19", 0x1000002, 0x200000, CRC(89fa6ee5) SHA1(572565e1308142b0b062aa72315c68e928f2419c) )
1228ROM_END
1229
1230ROM_START( invasnv4 )
12031231   ROM_REGION16_LE( 0x1000000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
1204   ROM_LOAD16_BYTE( "invasion.u2", 0x000000, 0x200000, CRC(59d2e1d6) SHA1(994a4311ac4841d4341449c0c7480952b6f3855d) )
1205   ROM_LOAD16_BYTE( "invasion.u3", 0x400000, 0x200000, CRC(86b956ae) SHA1(f7fd4601a2ce3e7e9b67e7d77908bfa206ee7e62) )
1206   ROM_LOAD16_BYTE( "invasion.u4", 0x800000, 0x200000, CRC(5ef1fab5) SHA1(987afa0672fa89b18cf20d28644848a9e5ee9b17) )
1207   ROM_LOAD16_BYTE( "invasion.u5", 0xc00000, 0x200000, CRC(e42805c9) SHA1(e5b71eb1852809a649ac43a82168b3bdaf4b1526) )
1232   ROM_LOAD16_BYTE( "invasion2.u2", 0x000000, 0x200000, CRC(59d2e1d6) SHA1(994a4311ac4841d4341449c0c7480952b6f3855d) ) /* These four sound roms were labeled as v2.0 */
1233   ROM_LOAD16_BYTE( "invasion2.u3", 0x400000, 0x200000, CRC(86b956ae) SHA1(f7fd4601a2ce3e7e9b67e7d77908bfa206ee7e62) )
1234   ROM_LOAD16_BYTE( "invasion2.u4", 0x800000, 0x200000, CRC(5ef1fab5) SHA1(987afa0672fa89b18cf20d28644848a9e5ee9b17) )
1235   ROM_LOAD16_BYTE( "invasion2.u5", 0xc00000, 0x200000, CRC(e42805c9) SHA1(e5b71eb1852809a649ac43a82168b3bdaf4b1526) )
12081236
12091237   ROM_REGION32_LE( 0x1800000, REGION_USER1, 0 )
1210   ROM_LOAD32_WORD( "invasion.u10", 0x0000000, 0x200000, CRC(b3ce958b) SHA1(ed51c167d85bc5f6155b8046ec056a4f4ad5cf9d) )
1211   ROM_LOAD32_WORD( "invasion.u11", 0x0000002, 0x200000, CRC(0bd09359) SHA1(f40886bd2e5f5fbf506580e5baa2f733be200852) )
1212   ROM_LOAD32_WORD( "invasion.u12", 0x0400000, 0x200000, CRC(ce1eb06a) SHA1(ff17690a0cbca6dcccccde70e2c5812ae03db5bb) )
1213   ROM_LOAD32_WORD( "invasion.u13", 0x0400002, 0x200000, CRC(33fc6707) SHA1(11a39ad980ec320547319eca6ffa5aef3ab8b010) )
1214   ROM_LOAD32_WORD( "invasion.u14", 0x0800000, 0x200000, CRC(760682a1) SHA1(ff91210225d4aa750115c6219d4c35c9521a3f0b) )
1215   ROM_LOAD32_WORD( "invasion.u15", 0x0800002, 0x200000, CRC(90467d7a) SHA1(a143a3d3605e5626852e75937160ba6bcd891608) )
1216   ROM_LOAD32_WORD( "invasion.u16", 0x0c00000, 0x200000, CRC(3ef1b28d) SHA1(6f9a071b8830194fea84daa62aadabae86977c5f) )
1217   ROM_LOAD32_WORD( "invasion.u17", 0x0c00002, 0x200000, CRC(97aa677a) SHA1(4d21cc59e0ffd4985f89c97c71d605c3b404a8a3) )
1218   ROM_LOAD32_WORD( "invasion.u18", 0x1000000, 0x200000, CRC(6930c656) SHA1(28054ff9a6c6f5764a371f8defe4c1f5730618f3) )
1219   ROM_LOAD32_WORD( "invasion.u19", 0x1000002, 0x200000, CRC(89fa6ee5) SHA1(572565e1308142b0b062aa72315c68e928f2419c) )
1238   ROM_LOAD32_WORD( "invasion4.u10", 0x0000000, 0x200000, CRC(b3ce958b) SHA1(ed51c167d85bc5f6155b8046ec056a4f4ad5cf9d) ) /* These rom were all labeled as v4.0 */
1239   ROM_LOAD32_WORD( "invasion4.u11", 0x0000002, 0x200000, CRC(0bd09359) SHA1(f40886bd2e5f5fbf506580e5baa2f733be200852) )
1240   ROM_LOAD32_WORD( "invasion4.u12", 0x0400000, 0x200000, CRC(ce1eb06a) SHA1(ff17690a0cbca6dcccccde70e2c5812ae03db5bb) )
1241   ROM_LOAD32_WORD( "invasion4.u13", 0x0400002, 0x200000, CRC(33fc6707) SHA1(11a39ad980ec320547319eca6ffa5aef3ab8b010) )
1242   ROM_LOAD32_WORD( "invasion4.u14", 0x0800000, 0x200000, CRC(760682a1) SHA1(ff91210225d4aa750115c6219d4c35c9521a3f0b) )
1243   ROM_LOAD32_WORD( "invasion4.u15", 0x0800002, 0x200000, CRC(90467d7a) SHA1(a143a3d3605e5626852e75937160ba6bcd891608) )
1244   ROM_LOAD32_WORD( "invasion4.u16", 0x0c00000, 0x200000, CRC(3ef1b28d) SHA1(6f9a071b8830194fea84daa62aadabae86977c5f) )
1245   ROM_LOAD32_WORD( "invasion4.u17", 0x0c00002, 0x200000, CRC(97aa677a) SHA1(4d21cc59e0ffd4985f89c97c71d605c3b404a8a3) )
1246   ROM_LOAD32_WORD( "invasion4.u18", 0x1000000, 0x200000, CRC(6930c656) SHA1(28054ff9a6c6f5764a371f8defe4c1f5730618f3) )
1247   ROM_LOAD32_WORD( "invasion4.u19", 0x1000002, 0x200000, CRC(89fa6ee5) SHA1(572565e1308142b0b062aa72315c68e928f2419c) )
12201248ROM_END
12211249
1222
12231250ROM_START( crusnexo )
12241251   ROM_REGION16_LE( 0xc00000, REGION_SOUND1, ROMREGION_ERASEFF )   /* sound data */
12251252   ROM_LOAD( "exotica.u2", 0x000000, 0x200000, CRC(d2d54acf) SHA1(2b4d6fda30af807228bb281335939dfb6df9b530) )
r1490r1491
13201347 *
13211348 *************************************/
13221349
1323GAME( 1997, mk4,      0,     midzeus,  mk4,      mk4,      ROT0, "Midway", "Mortal Kombat 4 (3.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1324GAME( 1997, mk4a,     mk4,   midzeus,  mk4,      mk4,      ROT0, "Midway", "Mortal Kombat 4 (2.1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1325GAME( 1999, invasn,   0,     midzeus,  invasn,   invasn,   ROT0, "Midway", "Invasion (Midway)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1326GAMEL( 1999, crusnexo, 0,     midzeus2, crusnexo, crusnexo, ROT0, "Midway", "Cruis'n Exotica", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_crusnexo )
1327GAME( 2001, thegrid,  0,     midzeus2, thegrid,  thegrid,  ROT0, "Midway", "The Grid (version 1.1)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1350GAME(  1997, mk4,      0,        midzeus,  mk4,      mk4,      ROT0, "Midway", "Mortal Kombat 4 (version 3.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1351GAME(  1997, mk4a,     mk4,      midzeus,  mk4,      mk4,      ROT0, "Midway", "Mortal Kombat 4 (version 2.1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1352GAME(  1999, invasnab, 0,        midzeus,  invasn,   invasn,   ROT0, "Midway", "Invasion - The Abductors (version 5.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1353GAME(  1999, invasnv4, invasnab, midzeus,  invasn,   invasn,   ROT0, "Midway", "Invasion - The Abductors (version 4.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1354GAMEL( 1999, crusnexo, 0,        midzeus2, crusnexo, crusnexo, ROT0, "Midway", "Cruis'n Exotica (version 1.6)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_crusnexo )
1355GAME(  2001, thegrid,  0,        midzeus2, thegrid,  thegrid,  ROT0, "Midway", "The Grid (version 1.1)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
src/mame/drivers/dkong.c
r1490r1491
77- Shooting Gallery: Shootgal.txt mentions speech pcb,
88  mikesarcade.com dk conversion - Clarify
99- 8ballact: read 1507 no mapped
10- dkong3 dma (Z80 dma)
1110- implement 74LS259 (8bit addressable latches),
1211  74LS175 (QUAD D FlipFlop), 74LS373 (Octal transparent latch)
1312
1413Done:
14- dkong3 dma (Z80 dma)
1515- dkongjr discrete interface
1616- when i am retired: implement 8257 DMA controller
1717- drakton - add dkongjr conversion
r1490r1491
252252#include "cpu/m6502/m6502.h"
253253#include "includes/dkong.h"
254254#include "machine/8257dma.h"
255#include "machine/z80dma.h"
255256#include <math.h>
256257
257258/*************************************
r1490r1491
273274static void hb_dma_write_byte(int channel, offs_t offset, UINT8 data);
274275static UINT8 dk_dma_read_byte(int channel, offs_t offset);
275276static void dk_dma_write_byte(int channel, offs_t offset, UINT8 data);
277static UINT8 dk3_dma_read_byte(offs_t offset);
278static void dk3_dma_write_byte(offs_t offset, UINT8 data);
276279static UINT8 p8257_ctl_r(void);
277280static void p8257_ctl_w(UINT8 data);
278281
r1490r1491
282285 *
283286 *************************************/
284287
288static const struct z80dma_interface dk3_dma =
289{
290   0,
291   CLOCK_1H,
292
293   dk3_dma_read_byte,
294   dk3_dma_write_byte,
295   0, 0, 0, 0
296};
297
285298static const struct dma8257_interface dk_dma =
286299{
287300   0,
r1490r1491
339352
340353}
341354
342
343355static MACHINE_START( hunchbkd )
344356{
345357   UINT8   *p = memory_region(REGION_USER1);
r1490r1491
361373
362374}
363375
364
365376static MACHINE_START( radarscp )
366377{
367378   dkong_state *state = Machine->driver_data;
r1490r1491
378389   state->hardware_type = HARDWARE_TRS01;
379390}
380391
392static MACHINE_START( dkong3 )
393{
394   machine_start_dkong2b(machine);
395   z80dma_init(1);
396   z80dma_config(0, &dk3_dma);
397}
381398
382399static MACHINE_RESET( dkong )
383400{
r1490r1491
386403
387404}
388405
406static MACHINE_RESET( dkong3 )
407{
408
409   z80dma_reset();
410
411}
412
389413static MACHINE_RESET( strtheat )
390414{
391415   dkong_state *state = machine->driver_data;
r1490r1491
436460   cpuintrf_pop_context();
437461}
438462
463static UINT8 dk3_dma_read_byte(offs_t offset)
464{
465   UINT8 result;
466
467   cpuintrf_push_context(0);
468   result = program_read_byte(offset);
469   cpuintrf_pop_context();
470
471   return result;
472}
473
474static void dk3_dma_write_byte(offs_t offset, UINT8 data)
475{
476   cpuintrf_push_context(0);
477   program_write_byte(offset, data);
478   cpuintrf_pop_context();
479}
480
439481static UINT8 hb_dma_read_byte(int channel, offs_t offset)
440482{
441483   dkong_state *state = Machine->driver_data;
r1490r1491
717759
718760static ADDRESS_MAP_START( dkong3_map, ADDRESS_SPACE_PROGRAM, 8 )
719761   AM_RANGE(0x0000, 0x5fff) AM_ROM
720   AM_RANGE(0x6000, 0x68ff) AM_RAM
721   AM_RANGE(0x6900, 0x6a7f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
722   AM_RANGE(0x6a80, 0x6cff) AM_RAM /* 0x6b00: sprite set 2 */
723   AM_RANGE(0x6d00, 0x6fff) AM_RAM /* ???? */
724   AM_RANGE(0x7000, 0x73ff) AM_RAM /* Actual sprite ram location ... waiting for missing z80 dma */
762   AM_RANGE(0x6000, 0x67ff) AM_RAM
763   AM_RANGE(0x6800, 0x6fff) AM_RAM
764   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprite set 1 */
725765   AM_RANGE(0x7400, 0x77ff) AM_READWRITE(MRA8_RAM, dkong_videoram_w) AM_BASE(&videoram)
726766   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0")  AM_WRITE(soundlatch_w)
727767   AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1")  AM_WRITE(soundlatch2_w)
r1490r1491
732772   AM_RANGE(0x7e82, 0x7e82) AM_WRITE(dkong_flipscreen_w)
733773   AM_RANGE(0x7e83, 0x7e83) AM_WRITE(dkong_spritebank_w)                  /* 2 PSL Signal */
734774   AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
735   AM_RANGE(0x7e85, 0x7e85) AM_NOP                     /* ==> DMA Chip */
775   AM_RANGE(0x7e85, 0x7e85) AM_WRITE(z80dma_0_rdy_w)                  /* ==> DMA Chip */
736776   AM_RANGE(0x7e86, 0x7e87) AM_WRITE(dkong_palettebank_w)
737777   AM_RANGE(0x8000, 0x9fff) AM_ROM                           /* DK3 and bootleg DKjr only */
738778ADDRESS_MAP_END
739779
740780static ADDRESS_MAP_START( dkong3_io_map, ADDRESS_SPACE_IO, 8 )
741781   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
742   AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP)   /* dma controller */
782   AM_RANGE(0x00, 0x00) AM_READWRITE(z80dma_0_r, z80dma_0_w)   /* dma controller */
783   //AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP)   /* dma controller */
743784ADDRESS_MAP_END
744785
745786/* Epos conversions */
r1490r1491
10431084   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )         PORT_DIPLOCATION("SW1:!4")
10441085   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
10451086   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1046   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW2:!5" )
1047   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW2:!6" )
1048   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW2:!7" )
1049   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW2:!8" )
1087   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:!5" )
1088   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x00, "SW1:!6" )
1089   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x00, "SW1:!7" )
1090   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x00, "SW1:!8" )
10501091INPUT_PORTS_END
10511092
10521093static INPUT_PORTS_START( dkongjr )
r1490r1491
11401181
11411182static INPUT_PORTS_START( sbdk )
11421183   PORT_INCLUDE( dkong_in0_8 )
1184   PORT_MODIFY("IN0")
1185   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not used by clone */
1186
11431187   PORT_INCLUDE( dkong_in1_8 )
1188   PORT_MODIFY("IN1")
1189   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not used by clone */
1190   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not used by clone */
1191   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not used by clone */
1192   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not used by clone */
1193   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) /* not used by clone */
11441194
11451195   PORT_INCLUDE( dkong_in2 )
11461196   PORT_MODIFY("IN2")
r1490r1491
11491199
11501200   PORT_INCLUDE( dkong_dsw0 )
11511201   PORT_MODIFY("DSW0")
1152   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW2:!1" )
1202   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:!1" )
11531203   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )      PORT_DIPLOCATION( "SW1:!2" )
11541204   PORT_DIPSETTING(    0x00, "3" )
11551205   PORT_DIPSETTING(    0x02, "5" )
1156   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW2:!3" )
1157   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:!4" )
1206   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!3" )
1207   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" )
11581208
11591209   PORT_START_TAG("SENSE") /* Sense */
11601210   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
r1490r1491
11711221
11721222   PORT_INCLUDE( dkong_dsw0 )
11731223   PORT_MODIFY("DSW0")
1174   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW2:!1" )
1175   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW2:!2" )
1176   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW2:!3" )
1177   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW2:!4" )
1224   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x00, "SW1:!1" )
1225   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:!2" )
1226   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:!3" )
1227   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:!4" )
11781228
11791229   PORT_START_TAG("SENSE") /* Sense */
11801230   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
r1490r1491
15741624   MDRV_DRIVER_DATA(dkong_state)
15751625
15761626   /* basic machine hardware */
1577   MDRV_CPU_ADD_TAG("main", Z80, 8000000/2)   /* 4 MHz */
1627   MDRV_CPU_ADD_TAG("main", Z80, XTAL_8MHz / 2)   /* verified in schematics */
15781628   MDRV_CPU_PROGRAM_MAP(dkong3_map, 0)
15791629   MDRV_CPU_IO_MAP(0, dkong3_io_map)
15801630   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
15811631
1582   MDRV_MACHINE_START(dkong2b)
1583   MDRV_MACHINE_RESET(dkong)
1632   MDRV_MACHINE_START(dkong3)
1633   MDRV_MACHINE_RESET(dkong3)
15841634
15851635   /* video hardware */
15861636   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
src/mame/drivers/gauntlet.c
r1490r1491
16361636static void gauntlet_common_init(int slapstic, int vindctr2)
16371637{
16381638   atarigen_eeprom_default = NULL;
1639   atarigen_slapstic_init(0, 0x038000, slapstic);
1639   atarigen_slapstic_init(0, 0x038000, 0, slapstic);
16401640
16411641   /* swap the top and bottom halves of the main CPU ROM images */
16421642   atarigen_swap_mem(memory_region(REGION_CPU1) + 0x000000, memory_region(REGION_CPU1) + 0x008000, 0x8000);
src/mame/drivers/ms32.c
r1490r1491
12161216/********** GFX DECODE **********/
12171217
12181218/* sprites are contained in 256x256 "tiles" */
1219static const gfx_layout spritelayout =
1220{
1221   256,256,
1222   RGN_FRAC(1,1),
1223   8,
1224   { GFX_RAW },
1225   { 0 },      /* org displacement */
1226   { 256*8 },   /* line modulo */
1227   256*256*8   /* char modulo */
1228};
1219static GFXLAYOUT_RAW( spritelayout, 8, 256, 256, 256*8, 256*256*8 )
1220static GFXLAYOUT_RAW( bglayout, 8, 16, 16, 16*8, 16*16*8 )
1221static GFXLAYOUT_RAW( txlayout, 8, 8, 8, 8*8, 8*8*8 )
12291222
1230static const gfx_layout bglayout =
1231{
1232   16,16,
1233   RGN_FRAC(1,1),
1234   8,
1235   { GFX_RAW },
1236   { 0 },      /* org displacement */
1237   { 16*8 },   /* line modulo */
1238   16*16*8      /* char modulo */
1239};
1240
1241
1242static const gfx_layout txlayout =
1243{
1244   8,8,
1245   RGN_FRAC(1,1),
1246   8,
1247   { GFX_RAW },
1248   { 0 },      /* org displacement */
1249   { 8*8 },   /* line modulo */
1250   8*8*8      /* char modulo */
1251};
1252
12531223static GFXDECODE_START( ms32 )
12541224   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0x0000, 0x10 )
12551225   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,     0x2000, 0x10 )
src/mame/drivers/viper.c
r1490r1491
3939
4040static UINT8 backup_ram[0x2000];
4141
42static void viper_exit(running_machine *machine)
43{
44   voodoo_exit(0);
45}
4246
4347static VIDEO_START(viper)
4448{
49   add_exit_callback(machine, viper_exit);
50
4551   voodoo_start(0, 0, VOODOO_3, 16, 16, 16);
4652}
4753
src/mame/drivers/cps1.c
r1490r1491
34273427   64*8
34283428};
34293429
3430static const gfx_layout cps1_layout16x16 =
3431{
3432   16,16,
3433   RGN_FRAC(1,1),
3434   4,
3435   { GFX_RAW },
3436   { 0 },      /* org displacement */
3437   { 8*8 },   /* line modulo */
3438   128*8      /* char modulo */
3439};
3430static GFXLAYOUT_RAW( cps1_layout16x16, 4, 16, 16, 8*8, 128*8 )
3431static GFXLAYOUT_RAW( cps1_layout32x32, 4, 32, 32, 16*8, 512*8 )
34403432
3441static const gfx_layout cps1_layout32x32 =
3442{
3443   32,32,
3444   RGN_FRAC(1,1),
3445   4,
3446   { GFX_RAW },
3447   { 0 },      /* org displacement */
3448   { 16*8 },   /* line modulo */
3449   512*8      /* char modulo */
3450};
3451
34523433GFXDECODE_START( cps1 )
34533434   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8,   0, 0x100 )
34543435   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8_2, 0, 0x100 )
src/mame/drivers/stactics.c
r1490r1491
9595    AM_RANGE(0x9000, 0x9fff) AM_READ(stactics_vert_pos_r)
9696    AM_RANGE(0xa000, 0xafff) AM_READ(stactics_horiz_pos_r)
9797
98    AM_RANGE(0xb000, 0xb3ff) AM_READ(MRA8_RAM)
99    AM_RANGE(0xb800, 0xbfff) AM_READ(MRA8_RAM)
100
101    AM_RANGE(0xd000, 0xd3ff) AM_READ(MRA8_RAM)
102    AM_RANGE(0xd600, 0xd7ff) AM_READ(MRA8_RAM)   /* Used as scratch RAM, high scores, etc. */
103    AM_RANGE(0xd800, 0xdfff) AM_READ(MRA8_RAM)
104
105    AM_RANGE(0xe000, 0xe3ff) AM_READ(MRA8_RAM)
106    AM_RANGE(0xe600, 0xe7ff) AM_READ(MRA8_RAM)   /* Used as scratch RAM, high scores, etc. */
107    AM_RANGE(0xe800, 0xefff) AM_READ(MRA8_RAM)
108
109    AM_RANGE(0xf000, 0xf3ff) AM_READ(MRA8_RAM)
110    AM_RANGE(0xf600, 0xf7ff) AM_READ(MRA8_RAM)   /* Used as scratch RAM, high scores, etc. */
111    AM_RANGE(0xf800, 0xffff) AM_READ(MRA8_RAM)
112
98    AM_RANGE(0xb000, 0xbfff) AM_READ(MRA8_RAM)   /* B RAM page */
99    AM_RANGE(0xd000, 0xdfff) AM_READ(MRA8_RAM)   /* D RAM page */
100    AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM)   /* E RAM page */
101    AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_RAM)   /* F RAM page */
113102ADDRESS_MAP_END
114103
115104static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/hyprduel.c
r1490r1491
676676***************************************************************************/
677677
678678/* 8x8x4 tiles */
679static const gfx_layout layout_8x8x4 =
680{
681   8,8,
682   RGN_FRAC(1,1),
683   4,
684   { GFX_RAW },
685   { 0 },      /* org displacement */
686   { 4*8 },   /* line modulo */
687   32*8      /* char modulo */
688};
679static GFXLAYOUT_RAW( layout_8x8x4, 4, 8, 8, 4*8, 32*8 )
689680
690681/* 8x8x8 tiles for later games */
691static const gfx_layout layout_8x8x8h =
692{
693   8,8,
694   RGN_FRAC(1,1),
695   8,
696   { GFX_RAW },
697   { 0 },      /* org displacement */
698   { 8*8 },   /* line modulo */
699   32*8      /* char modulo (half char step) */
700};
682static GFXLAYOUT_RAW( layout_8x8x8h, 8, 8, 8, 8*8, 32*8 )
701683
702684static GFXDECODE_START( 14220 )
703685   GFXDECODE_ENTRY( REGION_GFX1, 0, layout_8x8x4,    0x0, 0x200 ) // [0] 4 Bit Tiles
src/mame/drivers/arcadecl.c
r1490r1491
7272#include "sound/okim6295.h"
7373
7474
75#define MASTER_CLOCK      XTAL_14_31818MHz
76
77
7578/*************************************
7679 *
7780 *  Interrupt handling
r1490r1491
168171
169172static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
170173   AM_RANGE(0x000000, 0x0fffff) AM_ROM
171   AM_RANGE(0x200000, 0x21ffff) AM_READWRITE(MRA16_RAM, rampart_bitmap_w) AM_BASE(&rampart_bitmap)
174   AM_RANGE(0x200000, 0x21ffff) AM_RAM AM_BASE(&rampart_bitmap)
172175   AM_RANGE(0x3c0000, 0x3c07ff) AM_READWRITE(MRA16_RAM, atarigen_expanded_666_paletteram_w) AM_BASE(&paletteram16)
173176   AM_RANGE(0x3e0000, 0x3e07ff) AM_READWRITE(MRA16_RAM, atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)
174177   AM_RANGE(0x3e0800, 0x3effbf) AM_RAM
r1490r1491
341344static MACHINE_DRIVER_START( arcadecl )
342345
343346   /* basic machine hardware */
344   MDRV_CPU_ADD(M68000, ATARI_CLOCK_14MHz)
347   MDRV_CPU_ADD(M68000, MASTER_CLOCK)
345348   MDRV_CPU_PROGRAM_MAP(main_map,0)
346349   MDRV_CPU_VBLANK_INT(atarigen_video_int_gen,1)
347350
r1490r1491
357360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
358361   /* note: these parameters are from published specs, not derived */
359362   /* the board uses an SOS-2 chip to generate video signals */
360   MDRV_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0+4, 336+4, 262, 0, 240)
363   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 456, 0+12, 336+12, 262, 0, 240)
361364
362365   MDRV_VIDEO_START(arcadecl)
363366   MDRV_VIDEO_UPDATE(arcadecl)
r1490r1491
365368   /* sound hardware */
366369   MDRV_SPEAKER_STANDARD_MONO("mono")
367370
368   MDRV_SOUND_ADD(OKIM6295, ATARI_CLOCK_14MHz/4/3)
371   MDRV_SOUND_ADD(OKIM6295, MASTER_CLOCK/4/3)
369372   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low)
370373   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
371374MACHINE_DRIVER_END
src/mame/drivers/cps2.c
r1490r1491
13111311   64*8
13121312};
13131313
1314static const gfx_layout layout16x16 =
1315{
1316   16,16,
1317   RGN_FRAC(1,1),
1318   4,
1319   { GFX_RAW },
1320   { 0 },      /* org displacement */
1321   { 8*8 },   /* line modulo */
1322   128*8      /* char modulo */
1323};
1314static GFXLAYOUT_RAW( layout16x16, 4, 16, 16, 8*8, 128*8 )
1315static GFXLAYOUT_RAW( layout32x32, 4, 32, 32, 16*8, 512*8 )
13241316
1325static const gfx_layout layout32x32 =
1326{
1327   32,32,
1328   RGN_FRAC(1,1),
1329   4,
1330   { GFX_RAW },
1331   { 0 },      /* org displacement */
1332   { 16*8 },   /* line modulo */
1333   512*8      /* char modulo */
1334};
1335
13361317static GFXDECODE_START( cps2 )
13371318   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8,   0, 0x100 )
13381319   GFXDECODE_ENTRY( REGION_GFX1, 0, cps1_layout8x8_2, 0, 0x100 )
src/mame/drivers/jpmimpct.c
r1490r1491
1919        * DUART emulation is very simplistic, in progress.
2020        * Digital volume control is not emulated.
2121
22        * During the attract mode of Cluedo, just after the camera flash,
23        the camera colours go screwy and proceeding text is printed behind
24        the camera. Is it a TMS34010 emulation flaw or original game code bug?
25        For now, the GAME_IMPERFECT_GRAPHICS flag remains.
26
2227****************************************************************************
2328
2429    Memory map (preliminary)
r1490r1491
10241029GAME( 1995, cluedo,   0,      jpmimpct, cluedo,   0, ROT0, "JPM", "Cluedo (prod. 2D)",          GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
10251030GAME( 1995, cluedo2c, cluedo, jpmimpct, cluedo,   0, ROT0, "JPM", "Cluedo (prod. 2C)",          GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
10261031GAME( 1995, cluedo2,  cluedo, jpmimpct, cluedo,   0, ROT0, "JPM", "Cluedo (prod. 2)",            GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1027GAME( 1996, trivialp, 0,      jpmimpct, trivialp, 0, ROT0, "JPM", "Trivial Pursuit (prod. 1D)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1028GAME( 1997, scrabble, 0,      jpmimpct, scrabble, 0, ROT0, "JPM", "Scrabble (rev. F)",          GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1029GAME( 1998, hngmnjpm, 0,      jpmimpct, hngmnjpm, 0, ROT0, "JPM", "Hangman (JPM)",              GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
1032GAME( 1996, trivialp, 0,      jpmimpct, trivialp, 0, ROT0, "JPM", "Trivial Pursuit (prod. 1D)", GAME_SUPPORTS_SAVE )
1033GAME( 1997, scrabble, 0,      jpmimpct, scrabble, 0, ROT0, "JPM", "Scrabble (rev. F)",          GAME_SUPPORTS_SAVE )
1034GAME( 1998, hngmnjpm, 0,      jpmimpct, hngmnjpm, 0, ROT0, "JPM", "Hangman (JPM)",              GAME_SUPPORTS_SAVE )
src/mame/drivers/scramble.c
r1490r1491
2727#include "machine/8255ppi.h"
2828#include "sound/ay8910.h"
2929#include "sound/dac.h"
30#include "sound/5110intf.h"
31#include "sound/tms5110.h"
3230#include "galaxian.h"
3331
3432
35/***************************************************************************
36    AD2083 TMS5110 implementation (still wrong!)
37***************************************************************************/
38
39static INT32 speech_rom_address = 0;
40static INT32 speech_rom_address_hi = 0;
41static INT32 speech_rom_bit = 0;
42
43static void start_talking (void)
44{
45   tms5110_CTL_w(0,TMS5110_CMD_SPEAK);
46   tms5110_PDC_w(0,0);
47   tms5110_PDC_w(0,1);
48   tms5110_PDC_w(0,0);
49}
50
51static void reset_talking (void)
52{
53   tms5110_CTL_w(0,TMS5110_CMD_RESET);
54   tms5110_PDC_w(0,0);
55   tms5110_PDC_w(0,1);
56   tms5110_PDC_w(0,0);
57
58   tms5110_PDC_w(0,0);
59   tms5110_PDC_w(0,1);
60   tms5110_PDC_w(0,0);
61
62   tms5110_PDC_w(0,0);
63   tms5110_PDC_w(0,1);
64   tms5110_PDC_w(0,0);
65
66   speech_rom_address    = 0;
67   speech_rom_address_hi = 0;
68    speech_rom_bit        = 0;
69}
70
71static int ad2083_speech_rom_read_bit(void)
72{
73   UINT8 *ROM = memory_region(REGION_SOUND1);
74   int bit;
75
76   speech_rom_address %= memory_region_length(REGION_SOUND1);
77
78   bit = (ROM[speech_rom_address] >> speech_rom_bit) & 1;
79//  bit = (ROM[speech_rom_address] >> (speech_rom_bit ^ 7)) & 1;
80
81   speech_rom_bit++;
82   if(speech_rom_bit == 8)
83   {
84      speech_rom_address++;
85      speech_rom_bit = 0;
86   }
87
88   return bit;
89}
90
91
92static WRITE8_HANDLER( ad2083_soundlatch_w )
93{
94   soundlatch_w(0,data);
95
96   if(data & 0x80)
97   {
98      reset_talking();
99   }
100   else if(data & 0x30)
101   {
102      start_talking();
103
104      if((data & 0x30) == 0x30)
105         speech_rom_address_hi = 0x1000;
106      else
107         speech_rom_address_hi = 0;
108
109   }
110}
111
112static WRITE8_HANDLER( ad2083_tms5110_ctrl_w )
113{
114   speech_rom_address = speech_rom_address_hi | (data * 0x40);
115}
116
117static MACHINE_START( ad2083 )
118{
119   state_save_register_global(speech_rom_address);
120   state_save_register_global(speech_rom_address_hi);
121   state_save_register_global(speech_rom_bit);
122}
123
12433//cpu #0 (PC=00003F6C): warning - op-code execute on mapped I/O
12534extern int monsterz_count;
12635static READ8_HANDLER( monsterz_prot_r )
r1490r1491
643552   AM_RANGE(0x6805, 0x6805) AM_WRITE(galaxian_coin_counter_1_w)
644553   AM_RANGE(0x6806, 0x6806) AM_WRITE(scramble_background_red_w)
645554   AM_RANGE(0x6807, 0x6807) AM_WRITE(scramble_background_green_w)
646   AM_RANGE(0x8000, 0x8000) AM_WRITE(ad2083_soundlatch_w)
555   AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_w)
647556   AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w)
648557   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
649558   AM_RANGE(0x8000, 0x8000) AM_READ(input_port_0_r)
r1490r1491
654563   AM_RANGE(0xe800, 0xebff) AM_RAM
655564ADDRESS_MAP_END
656565
657static ADDRESS_MAP_START( ad2083_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
658   AM_RANGE(0x0000, 0x2fff) AM_ROM
659   AM_RANGE(0x8000, 0x83ff) AM_RAM
660ADDRESS_MAP_END
661
662static ADDRESS_MAP_START( ad2083_sound_io_map, ADDRESS_SPACE_IO, 8 )
663   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
664   AM_RANGE(0x01, 0x01) AM_WRITE(ad2083_tms5110_ctrl_w)
665   AM_RANGE(0x10, 0x10) AM_WRITE(AY8910_control_port_0_w)
666   AM_RANGE(0x20, 0x20) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
667   AM_RANGE(0x40, 0x40) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
668   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_control_port_1_w)
669ADDRESS_MAP_END
670
671566static ADDRESS_MAP_START( triplep_readport, ADDRESS_SPACE_IO, 8 )
672567   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
673568   AM_RANGE(0x01, 0x01) AM_READ(AY8910_read_port_0_r)
r1490r1491
17761671   PORT_DIPSETTING(    0x04, "150000" )
17771672   PORT_DIPSETTING(    0x08, "100000" )
17781673   PORT_DIPSETTING(    0x00, "200000" )
1779   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1780   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1781   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1674   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) )
1675   PORT_DIPSETTING(    0x10, DEF_STR( Upright ) )
1676   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
17821677   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )
17831678   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
17841679   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
r1490r1491
19731868   0
19741869};
19751870
1976static const struct TMS5110interface tms5110_interface =
1977{
1978   TMS5110_IS_5110A,
1979   -1,                     /* rom_region */
1980   ad2083_speech_rom_read_bit   /* M0 callback function. Called whenever chip requests a single bit of data */
1981};
19821871
19831872static const gfx_layout scramble_charlayout =
19841873{
r1490r1491
21322021   MDRV_SOUND_MODIFY("8910.2")
21332022   MDRV_SOUND_CONFIG(explorer_ay8910_interface_2)
21342023   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
2135MACHINE_DRIVER_END
21362024
2025   MACHINE_DRIVER_END
2026
21372027static MACHINE_DRIVER_START( theend )
21382028
21392029   /* basic machine hardware */
r1490r1491
25142404   MDRV_CPU_ADD(Z80, 18432000/6)   /* 3.072 MHz */
25152405   MDRV_CPU_PROGRAM_MAP(ad2083_map,0)
25162406
2517   MDRV_CPU_ADD(Z80, 14318000/8)   /* 1.78975 MHz */
2518   MDRV_CPU_PROGRAM_MAP(ad2083_sound_map,0)
2519   MDRV_CPU_IO_MAP(ad2083_sound_io_map,0)
2520
2521   MDRV_MACHINE_START(ad2083)
25222407   MDRV_MACHINE_RESET(galaxian)
25232408
25242409   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
r1490r1491
25372422   MDRV_VIDEO_UPDATE(galaxian)
25382423
25392424   /* sound hardware */
2540   MDRV_SPEAKER_STANDARD_MONO("mono")
2541   MDRV_SOUND_ADD(AY8910, 14318000/8)
2542   MDRV_SOUND_CONFIG(explorer_ay8910_interface_1)
2543   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
25442425
2545   MDRV_SOUND_ADD(AY8910, 14318000/8)
2546   MDRV_SOUND_CONFIG(explorer_ay8910_interface_2)
2547   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
2426   MDRV_IMPORT_FROM(ad2083_audio)
25482427
2549   MDRV_SOUND_ADD(TMS5110, 640000)
2550   MDRV_SOUND_CONFIG(tms5110_interface)
2551   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
25522428MACHINE_DRIVER_END
25532429
25542430static MACHINE_DRIVER_START( turpins )
r1490r1491
33703246   ROM_LOAD( "ad5.3k",       0x2000, 0x2000, CRC(f53f3449) SHA1(0711f2e47504f256d46eea1e225e35f9bde8b9fb) )
33713247
33723248   ROM_REGION( 0x2000, REGION_SOUND1, 0 ) /* data for the TMS5110 speech chip */
3373   ROM_LOAD( "ad1v.9a",      0x0000, 0x1000, CRC(4cb93fff) SHA1(2cc686a9a58a85f2bb04fb6ced4626e9952635bb) )
3374   ROM_LOAD( "ad2v.10a",     0x1000, 0x1000, CRC(4b530ea7) SHA1(8793b3497b598f33b34bf9524e360c6c62e8001d) )
3249   ROM_LOAD( "ad1v.9a",      0x0000, 0x1000, BAD_DUMP CRC(4cb93fff) SHA1(2cc686a9a58a85f2bb04fb6ced4626e9952635bb) )
3250   ROM_LOAD( "ad2v.10a",     0x1000, 0x1000, BAD_DUMP CRC(4b530ea7) SHA1(8793b3497b598f33b34bf9524e360c6c62e8001d) )
33753251
33763252   ROM_REGION( 0x0020, REGION_PROMS, 0 )
33773253   ROM_LOAD( "prom-am27s19dc.1m", 0x0000, 0x0020, CRC(2759aebd) SHA1(644fd2c95ca49cbbc0ee1b88ca2563451ddd4fe0) )
33783254
33793255   ROM_REGION( 0x0020, REGION_USER1, 0 ) /* sample related? near TMS5110 and sample roms */
3380   ROM_LOAD( "prom-sn74s188.8a",  0x0000, 0x0020, CRC(5e395112) SHA1(427d6a5b5d0837db4bf804f392d77ba5a86ffd72) )
3256   ROM_LOAD( "prom-sn74s188.8a",  0x0000, 0x0020, BAD_DUMP CRC(5e395112) SHA1(427d6a5b5d0837db4bf804f392d77ba5a86ffd72) )
33813257ROM_END
33823258
33833259
src/mame/drivers/taitojc.c
r1490r1491
342342        - dendeg2 hangs on init step 10.
343343        - The analog controls don't seem to work in landgear. They work in test mode though.
344344        - landgear has some weird crashes (after playing one round, after a couple of loops in attract mode)
345        - dendeg2x usually crashes when starting the game (lots of read and writes to invalid addresses)
346        - All dendeg games have random wrong textures/palettes
347        - Train board (external sound board with OKI6295) is not emulated
345        - dendeg2x usually crashes when starting the game (lots of read and writes to invalid addresses).
346        - All dendeg games have random wrong textures/palettes.
347        - Train board (external sound board with OKI6295) is not emulated.
348        - dangcurv hangs on its DSP test. DSP execution may be jumping into internal ROM space?
349        - dangcurv needs correct controls hooking up.
348350*/
349351
350352#include "driver.h"
r1490r1491
12071209
12081210INPUT_PORTS_END
12091211
1212// TODO
1213static INPUT_PORTS_START( dangcurv )
1214   PORT_START
1215      PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1216      PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN1)
1217      PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
12101218
1219   PORT_START
1220      PORT_BIT(0xe0, IP_ACTIVE_LOW, IPT_UNUSED)
1221      PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1)
1222      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE3)
1223      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE2)
1224      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
1225      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_TILT)
12111226
1227   PORT_START
1228      PORT_BIT(0xfe, IP_ACTIVE_LOW, IPT_UNUSED)
1229      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1)      // View button
1230
1231   PORT_START
1232      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2)      // Shift down
1233      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON3)      // Shift up
1234      PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNUSED)
1235
1236   PORT_START_TAG("ANALOG1")      // Steering
1237      PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5)
1238
1239   PORT_START_TAG("ANALOG2")      // Acceleration
1240      PORT_BIT( 0xff, 0x00, IPT_PEDAL )  PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5)
1241
1242   PORT_START_TAG("ANALOG3")      // Brake
1243      PORT_BIT( 0xff, 0x00, IPT_PEDAL2 )  PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5)
1244
1245INPUT_PORTS_END
1246
1247
1248
1249
12121250static MACHINE_RESET( taitojc )
12131251{
12141252   taito_f3_soundsystem_reset();
r1490r1491
12911329   ROM_FILL( 0x0000, 0x0080, 0 )
12921330
12931331   ROM_REGION( 0x1800000, REGION_GFX1, 0 )
1294   ROM_LOAD32_WORD( "e23-05.009",  0x0800002, 0x200000, CRC(9aa0d956) SHA1(bd146e3db7c2a53701eca6b43f903899ed15623a) )
1295   ROM_LOAD32_WORD( "e23-12.022",  0x0800000, 0x200000, CRC(c93fab09) SHA1(1ed292b11bf6bf09d1783d247f3de0c899e4df28) )
1296   ROM_LOAD32_WORD( "e23-06.010",  0x0c00002, 0x200000, CRC(2077ac3a) SHA1(894e1bbfef8a693bda50aa8681e8f283c0d6b6cf) )
1297   ROM_LOAD32_WORD( "e23-13.023",  0x0c00000, 0x200000, CRC(985f6785) SHA1(81cd33957b943f4bb33323fbf491ace344f8245b) )
1298   ROM_LOAD32_WORD( "e23-07.012",  0x1400002, 0x200000, CRC(bf1cd99d) SHA1(f98e1dacb485c7e40b0b2277a690d74ae020c9d9) )
1299   ROM_LOAD32_WORD( "e23-14.025",  0x1400000, 0x200000, CRC(9d54eac7) SHA1(4f97b388a0fd0529d26e1cc31491a0e2ce6c381d) )
1332   ROM_LOAD32_WORD( "e23-05.009",  0x0800002, 0x200000, BAD_DUMP CRC(9aa0d956) SHA1(bd146e3db7c2a53701eca6b43f903899ed15623a) )
1333   ROM_LOAD32_WORD( "e23-12.022",  0x0800000, 0x200000, BAD_DUMP CRC(c93fab09) SHA1(1ed292b11bf6bf09d1783d247f3de0c899e4df28) )
1334   ROM_LOAD32_WORD( "e23-06.010",  0x0c00002, 0x200000, BAD_DUMP CRC(2077ac3a) SHA1(894e1bbfef8a693bda50aa8681e8f283c0d6b6cf) )
1335   ROM_LOAD32_WORD( "e23-13.023",  0x0c00000, 0x200000, BAD_DUMP CRC(985f6785) SHA1(81cd33957b943f4bb33323fbf491ace344f8245b) )
1336   ROM_LOAD32_WORD( "e23-07.012",  0x1400002, 0x200000, BAD_DUMP CRC(bf1cd99d) SHA1(f98e1dacb485c7e40b0b2277a690d74ae020c9d9) )
1337   ROM_LOAD32_WORD( "e23-14.025",  0x1400000, 0x200000, BAD_DUMP CRC(9d54eac7) SHA1(4f97b388a0fd0529d26e1cc31491a0e2ce6c381d) )
13001338
13011339   ROM_REGION( 0x1000000, REGION_GFX2, 0 )      /* only accessible to the TMS */
1302   ROM_LOAD( "e23-01.005",  0x0000000, 0x200000, CRC(c5018242) SHA1(d1a45aa6899d9a95b32aeba0f9a4520714d5f5a3) )
1303   ROM_LOAD( "e23-02.006",  0x0200000, 0x200000, CRC(dbf24766) SHA1(2ee0bdb9f912f31bdf962a1af53ad1a6e3121a05) )
1304   ROM_LOAD( "e23-03.007",  0x0400000, 0x200000, CRC(3ab59dd0) SHA1(39e93d306a59017bef0f2fdadc69f96aecbffca6) )
1305   ROM_LOAD( "e23-04.008",  0x0600000, 0x200000, CRC(5060119c) SHA1(c8c5c33bd37121d222961ecfcdb79bbe6cbdf821) )
1306   ROM_LOAD( "e23-08.018",  0x0800000, 0x200000, CRC(04738f5b) SHA1(0ebc8c61d87f10822148f3b272612dc10ac4652c) )
1307   ROM_LOAD( "e23-09.019",  0x0a00000, 0x200000, CRC(089fac53) SHA1(3af008c65f4b60ae221b90fdb52d4e6fe552e5a8) )
1308   ROM_LOAD( "e23-10.020",  0x0c00000, 0x200000, CRC(dccb19ed) SHA1(35749c823ad9a30f471367750c087435b678b42f) )
1309   ROM_LOAD( "e23-11.021",  0x0e00000, 0x200000, CRC(6981a46f) SHA1(262bf821275413c70a1a8374185df64c697d8b04) )
1340   ROM_LOAD( "e23-01.005",  0x0000000, 0x200000, BAD_DUMP CRC(c5018242) SHA1(d1a45aa6899d9a95b32aeba0f9a4520714d5f5a3) )
1341   ROM_LOAD( "e23-02.006",  0x0200000, 0x200000, BAD_DUMP CRC(dbf24766) SHA1(2ee0bdb9f912f31bdf962a1af53ad1a6e3121a05) )
1342   ROM_LOAD( "e23-03.007",  0x0400000, 0x200000, BAD_DUMP CRC(3ab59dd0) SHA1(39e93d306a59017bef0f2fdadc69f96aecbffca6) )
1343   ROM_LOAD( "e23-04.008",  0x0600000, 0x200000, BAD_DUMP CRC(5060119c) SHA1(c8c5c33bd37121d222961ecfcdb79bbe6cbdf821) )
1344   ROM_LOAD( "e23-08.018",  0x0800000, 0x200000, BAD_DUMP CRC(04738f5b) SHA1(0ebc8c61d87f10822148f3b272612dc10ac4652c) )
1345   ROM_LOAD( "e23-09.019",  0x0a00000, 0x200000, BAD_DUMP CRC(089fac53) SHA1(3af008c65f4b60ae221b90fdb52d4e6fe552e5a8) )
1346   ROM_LOAD( "e23-10.020",  0x0c00000, 0x200000, BAD_DUMP CRC(dccb19ed) SHA1(35749c823ad9a30f471367750c087435b678b42f) )
1347   ROM_LOAD( "e23-11.021",  0x0e00000, 0x200000, BAD_DUMP CRC(6981a46f) SHA1(262bf821275413c70a1a8374185df64c697d8b04) )
13101348
13111349   ROM_REGION16_BE( 0x1000000, REGION_SOUND1, ROMREGION_ERASE00  )
13121350   ROM_LOAD16_BYTE( "e23-15.32",  0x000000, 0x200000, CRC(8955b7c7) SHA1(767626bd5cf6810b0368ee85e487c12ef7e8a23d))
r1490r1491
16321670    */
16331671ROM_END
16341672
1673ROM_START( dangcurv )
1674   ROM_REGION(0x200000, REGION_CPU1, 0)      /* 68040 code */
1675    ROM_LOAD32_BYTE("e09-23.036", 0x000000, 0x80000, CRC(b4cdadd6) SHA1(84bd1d055ff15afb5438cd5151abf78b0000cebc) )
1676   ROM_LOAD32_BYTE("e09-24.037", 0x000001, 0x80000, CRC(fb2fc795) SHA1(2f58d043ab9fc0269a5b6827009777cd7ab832fc) )
1677   ROM_LOAD32_BYTE("e09-25.038", 0x000002, 0x80000, CRC(aa233404) SHA1(a2b14e54eb1b5f6d4ed9f289b30ecfa654f21c87) )
1678   ROM_LOAD32_BYTE("e09-26.039", 0x000003, 0x80000, CRC(78337271) SHA1(bd29de6a5b6db3baddecf82c3b6c8b366c64289e) )
16351679
1680   ROM_REGION( 0x180000, REGION_CPU2, 0 )      /* 68000 Code */
1681   ROM_LOAD16_BYTE( "e09-27.030",  0x100001, 0x040000, CRC(6d54839c) SHA1(a28c9b0727128b82bb0fa71dc951e3f03ee45e1b) )
1682   ROM_LOAD16_BYTE( "e09-28.031",  0x100000, 0x040000, CRC(566d7d83) SHA1(92661ccb631f843bf704c50d54fae28f6b5b272b) )
1683
1684   ROM_REGION( 0x010000, REGION_USER1, 0 )      /* MC68HC11M0 code */
1685   ROM_LOAD( "e09-29.065",  0x000000, 0x010000, CRC(80ac1428) SHA1(5a2a1e60a11ecdb8743c20ddacfb61f9fd00f01c) )
1686
1687   ROM_REGION( 0x00080, REGION_USER2, 0 )      /* eeprom */
1688   ROM_FILL( 0x0000, 0x0080, 0 )
1689
1690   ROM_REGION( 0x1800000, REGION_GFX1, 0 )
1691   ROM_LOAD32_WORD( "e09-05.009",  0x0800002, 0x200000, CRC(a948782f) SHA1(2a2b0d2955e036ddf424c54131435a20dbba3dd4) )
1692   ROM_LOAD32_WORD( "e09-13.022",  0x0800000, 0x200000, CRC(985859e2) SHA1(8af9a73eba2151a5ef60799682fe667663a42743) )
1693   ROM_LOAD32_WORD( "e09-06.010",  0x0c00002, 0x200000, CRC(218dcb5b) SHA1(72aedd2890e076540195d738c76ba446769c8e89) )
1694   ROM_LOAD32_WORD( "e09-14.023",  0x0c00000, 0x200000, CRC(6d123616) SHA1(01ac1e920f7c4a03adf365c8a7831b8385f0b78b) )
1695   ROM_LOAD32_WORD( "e09-07.011",  0x1000002, 0x200000, CRC(37fd7efc) SHA1(24a275d302ec8940479d15f1aeb96a288868bd41) )
1696   ROM_LOAD32_WORD( "e09-15.024",  0x1000000, 0x200000, CRC(0d773f3b) SHA1(f867a4d5956c2ebfa9858499d9716b4dc723d76b) )
1697   ROM_LOAD32_WORD( "e09-08.012",  0x1400002, 0x200000, CRC(5c080485) SHA1(c950cd00df5b6d2d0a119ba318fa8b0a3f471b29) )
1698   ROM_LOAD32_WORD( "e09-16.025",  0x1400000, 0x200000, CRC(35cb8346) SHA1(c2ecedd3c2a28213ef83e776f3007c974128189b) )
1699
1700   ROM_REGION( 0x1000000, REGION_GFX2, 0 )      /* only accessible to the TMS */
1701   ROM_LOAD( "e09-01.005",  0x0000000, 0x200000, CRC(22a6a53d) SHA1(6efa89151cd5ec43ab9bfa9b92694eb0018dd227) )
1702   ROM_LOAD( "e09-02.006",  0x0200000, 0x200000, CRC(405e2969) SHA1(376b9dd548d876af6798553a6da5deed4de00b76) )
1703   ROM_LOAD( "e09-03.007",  0x0400000, 0x200000, CRC(15327754) SHA1(bf08ab80875b400700241a66715e229dae6752d1) )
1704   ROM_LOAD( "e09-04.008",  0x0600000, 0x200000, CRC(fd598d6e) SHA1(679d9d64a0cd031a6c8cb5e170b77fc5811b6d73) )
1705   ROM_LOAD( "e09-09.018",  0x0800000, 0x200000, CRC(a527b387) SHA1(790240b4dfcdf2bf70edb943ec7aeb2f0d8cdfa9) )
1706   ROM_LOAD( "e09-10.019",  0x0a00000, 0x200000, CRC(4de6253c) SHA1(33517c0895b7ee04f4a84074d0b7bf42b53d5816) )
1707   ROM_LOAD( "e09-11.020",  0x0c00000, 0x200000, CRC(18cc0ba7) SHA1(626929a501def6f1b8bd6a468786efb0b0dda9fa) )
1708   ROM_LOAD( "e09-12.021",  0x0e00000, 0x200000, CRC(3273e438) SHA1(e9581d52f5db1c1924a860464579332a2f23e713) )
1709
1710   ROM_REGION16_BE( 0x1000000, REGION_SOUND1, ROMREGION_ERASE00  )
1711   ROM_LOAD16_BYTE( "e09-17.032",  0x000000, 0x200000, CRC(a8a6512e) SHA1(71bd3ccd65b731270b92da334b9fb99c28e267fe) )
1712   ROM_LOAD16_BYTE( "e09-18.033",  0x400000, 0x200000, CRC(bdf1f5eb) SHA1(a568a99a90e0afbcd26ddd320f515ed62cf0db1a) )
1713   ROM_LOAD16_BYTE( "e09-19.034",  0x800000, 0x200000, CRC(3626c7ed) SHA1(7535f0457b3d9fe1d54712a26322d6144b9e7de6) )
1714   ROM_LOAD16_BYTE( "e09-20.035",  0xc00000, 0x200000, CRC(9652a5c4) SHA1(2933e4e8e57ff618ce21721036d96347471c5539) )
1715ROM_END
1716
1717
16361718GAME( 1996, dendeg,   0,       taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go", GAME_NOT_WORKING )
16371719GAME( 1996, dendegx,  dendeg,  taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go Ex", GAME_NOT_WORKING )
16381720GAME( 1998, dendeg2,  0,       taitojc, dendeg,   taitojc,  ROT0, "Taito", "Densya De Go 2", GAME_NOT_WORKING )
r1490r1491
16401722GAME( 1996, sidebs,   0,       taitojc, sidebs,   taitojc,  ROT0, "Taito", "Side By Side", GAME_NOT_WORKING )
16411723GAME( 1997, sidebs2,  0,       taitojc, sidebs,   taitojc,  ROT0, "Taito", "Side By Side 2", GAME_IMPERFECT_GRAPHICS )
16421724GAME( 1995, landgear, 0,       taitojc, landgear, taitojc,  ROT0, "Taito", "Landing Gear", GAME_NOT_WORKING )
1725GAME( 1995, dangcurv, 0,       taitojc, dangcurv, taitojc,  ROT0, "Taito", "Dangerous Curves", GAME_NOT_WORKING )
src/mame/drivers/tehkanwc.c
r1490r1491
1/* Notes: DJH 04 Jan 2008
2
3  fixed gridiron079gre (shared access to spriteram was broken)
4
5  This driver is antiquated.. the LED drawing in the video file is one giant
6  hack, we should change it to use the artwork system, not hack it to draw
7  characters from the gfx roms onscreen..
8
9  The inputs also seem to be a hacky mess (although there was reportedly a
10  hardware joystick hack for tehkanwc via plugin logic subboard, is this
11  attempting to simulate it?
12
13  Also there is a hack to reset the sound CPU...
14
15*/
16
117/***************************************************************************
218
319Tehkan World Cup - (c) Tehkan 1985
r1490r1491
100116extern VIDEO_UPDATE( tehkanwc );
101117
102118
103static UINT8 *shared_ram;
104
105static READ8_HANDLER( shared_r )
106{
107   return shared_ram[offset];
108}
109
110static WRITE8_HANDLER( shared_w )
111{
112   shared_ram[offset] = data;
113}
114
115119static WRITE8_HANDLER( sub_cpu_halt_w )
116120{
117121   if (data)
r1490r1491
230234
231235
232236
233static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
234   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
235   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
236   AM_RANGE(0xc800, 0xcfff) AM_READ(shared_r)
237   AM_RANGE(0xd000, 0xd3ff) AM_READ(MRA8_RAM)
238   AM_RANGE(0xd400, 0xd7ff) AM_READ(MRA8_RAM)
239   AM_RANGE(0xd800, 0xddff) AM_READ(MRA8_RAM)
240   AM_RANGE(0xde00, 0xdfff) AM_READ(MRA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
241   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM)
242   AM_RANGE(0xe800, 0xebff) AM_READ(MRA8_RAM) /* sprites */
243   AM_RANGE(0xec00, 0xec01) AM_READ(MRA8_RAM)
244   AM_RANGE(0xec02, 0xec02) AM_READ(MRA8_RAM)
245   AM_RANGE(0xf800, 0xf801) AM_READ(tehkanwc_track_0_r) /* track 0 x/y */
246   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_9_r) /* Coin & Start */
237static ADDRESS_MAP_START( main_mem, ADDRESS_SPACE_PROGRAM, 8 )
238   AM_RANGE(0x0000, 0xbfff) AM_ROM
239   AM_RANGE(0xc000, 0xc7ff) AM_RAM
240   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE(1)
241   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE(2) AM_WRITE(tehkanwc_videoram_w) AM_BASE(&videoram)
242   AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_SHARE(3) AM_WRITE(tehkanwc_colorram_w) AM_BASE(&colorram)
243   AM_RANGE(0xd800, 0xddff) AM_RAM AM_SHARE(4) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_BASE(&paletteram)
244   AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE(5) /* unused part of the palette RAM, I think? Gridiron uses it */
245   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(6) AM_WRITE(tehkanwc_videoram2_w) AM_BASE(&tehkanwc_videoram2)
246   AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE(7) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprites */
247   AM_RANGE(0xec00, 0xec01) AM_RAM AM_WRITE(tehkanwc_scroll_x_w)
248   AM_RANGE(0xec02, 0xec02) AM_RAM AM_WRITE(tehkanwc_scroll_y_w)
249   AM_RANGE(0xf800, 0xf801) AM_READWRITE(tehkanwc_track_0_r, tehkanwc_track_0_reset_w) /* track 0 x/y */
250   AM_RANGE(0xf802, 0xf802) AM_READWRITE(input_port_9_r, gridiron_led0_w) /* Coin & Start */
247251   AM_RANGE(0xf803, 0xf803) AM_READ(input_port_5_r) /* joy0 - button */
248   AM_RANGE(0xf810, 0xf811) AM_READ(tehkanwc_track_1_r) /* track 1 x/y */
249   AM_RANGE(0xf813, 0xf813) AM_READ(input_port_8_r) /* joy1 - button */
250   AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_r)   /* answer from the sound CPU */
251   AM_RANGE(0xf840, 0xf840) AM_READ(input_port_0_r) /* DSW1 */
252   AM_RANGE(0xf850, 0xf850) AM_READ(input_port_1_r)   /* DSW2 */
253   AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r)
254   AM_RANGE(0xf870, 0xf870) AM_READ(input_port_2_r) /* DSW3 */
255ADDRESS_MAP_END
256
257static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
258   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
259   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
260   AM_RANGE(0xc800, 0xcfff) AM_WRITE(shared_w) AM_BASE(&shared_ram)
261   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(tehkanwc_videoram_w) AM_BASE(&videoram)
262   AM_RANGE(0xd400, 0xd7ff) AM_WRITE(tehkanwc_colorram_w) AM_BASE(&colorram)
263   AM_RANGE(0xd800, 0xddff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_BASE(&paletteram)
264   AM_RANGE(0xde00, 0xdfff) AM_WRITE(MWA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
265   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(tehkanwc_videoram2_w) AM_BASE(&tehkanwc_videoram2)
266   AM_RANGE(0xe800, 0xebff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprites */
267   AM_RANGE(0xec00, 0xec01) AM_WRITE(tehkanwc_scroll_x_w)
268   AM_RANGE(0xec02, 0xec02) AM_WRITE(tehkanwc_scroll_y_w)
269   AM_RANGE(0xf800, 0xf801) AM_WRITE(tehkanwc_track_0_reset_w)
270   AM_RANGE(0xf802, 0xf802) AM_WRITE(gridiron_led0_w)
271   AM_RANGE(0xf810, 0xf811) AM_WRITE(tehkanwc_track_1_reset_w)
252   AM_RANGE(0xf806, 0xf806) AM_READ(input_port_9_r) /* Start */
253   AM_RANGE(0xf810, 0xf811) AM_READWRITE(tehkanwc_track_1_r, tehkanwc_track_1_reset_w) /* track 1 x/y */
272254   AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w)
273   AM_RANGE(0xf820, 0xf820) AM_WRITE(sound_command_w)
274   AM_RANGE(0xf840, 0xf840) AM_WRITE(sub_cpu_halt_w)
275   AM_RANGE(0xf850, 0xf850) AM_WRITE(MWA8_NOP)            /* ?? writes 0x00 or 0xff */
276   AM_RANGE(0xf860, 0xf860) AM_WRITE(tehkanwc_flipscreen_x_w)      /* Check if it's really X */
277   AM_RANGE(0xf870, 0xf870) AM_WRITE(tehkanwc_flipscreen_y_w)      /* Check if it's really Y */
278ADDRESS_MAP_END
279
280static ADDRESS_MAP_START( gridiron_readmem, ADDRESS_SPACE_PROGRAM, 8 )
281   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
282   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
283   AM_RANGE(0xc800, 0xcfff) AM_READ(shared_r)
284   AM_RANGE(0xd000, 0xd3ff) AM_READ(MRA8_RAM)
285   AM_RANGE(0xd400, 0xd7ff) AM_READ(MRA8_RAM)
286   AM_RANGE(0xd800, 0xddff) AM_READ(MRA8_RAM)
287   AM_RANGE(0xde00, 0xdfff) AM_READ(MRA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
288   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM)
289   AM_RANGE(0xe800, 0xebff) AM_READ(MRA8_RAM) /* sprites */
290   AM_RANGE(0xec00, 0xec01) AM_READ(MRA8_RAM)
291   AM_RANGE(0xec02, 0xec02) AM_READ(MRA8_RAM)
292   AM_RANGE(0xf800, 0xf801) AM_READ(tehkanwc_track_0_r) /* track 0 x/y */
293   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_9_r) /* Coin & Start */
294   AM_RANGE(0xf803, 0xf803) AM_READ(input_port_5_r) /* joy0 - button */
295   AM_RANGE(0xf810, 0xf811) AM_READ(tehkanwc_track_1_r) /* track 1 x/y */
296255   AM_RANGE(0xf813, 0xf813) AM_READ(input_port_8_r) /* joy1 - button */
297   AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_r)   /* answer from the sound CPU */
298   AM_RANGE(0xf840, 0xf840) AM_READ(input_port_0_r) /* DSW1 */
299   AM_RANGE(0xf850, 0xf850) AM_READ(input_port_1_r)   /* DSW2 */
300   AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r)
301   AM_RANGE(0xf870, 0xf870) AM_READ(MRA8_NOP)   /* ?? read in the IRQ handler */
256   AM_RANGE(0xf820, 0xf820) AM_READWRITE(soundlatch2_r, sound_command_w)   /* answer from the sound CPU */
257   AM_RANGE(0xf840, 0xf840) AM_READWRITE(input_port_0_r, sub_cpu_halt_w) /* DSW1 */
258   AM_RANGE(0xf850, 0xf850) AM_READWRITE(input_port_1_r, MWA8_NOP)   /* DSW2, ?? writes 0x00 or 0xff */
259   AM_RANGE(0xf860, 0xf860) AM_READWRITE(watchdog_reset_r, tehkanwc_flipscreen_x_w)
260   AM_RANGE(0xf870, 0xf870) AM_READWRITE(input_port_2_r, tehkanwc_flipscreen_y_w) /* DSW3 */
302261ADDRESS_MAP_END
303262
304static ADDRESS_MAP_START( gridiron_writemem, ADDRESS_SPACE_PROGRAM, 8 )
305   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
306   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
307   AM_RANGE(0xc800, 0xcfff) AM_WRITE(shared_w) AM_BASE(&shared_ram)
308   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(tehkanwc_videoram_w) AM_BASE(&videoram)
309   AM_RANGE(0xd400, 0xd7ff) AM_WRITE(tehkanwc_colorram_w) AM_BASE(&colorram)
310   AM_RANGE(0xd800, 0xddff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_BASE(&paletteram)
311   AM_RANGE(0xde00, 0xdfff) AM_WRITE(MWA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
312   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(tehkanwc_videoram2_w) AM_BASE(&tehkanwc_videoram2)
313   AM_RANGE(0xe800, 0xebff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprites */
314   AM_RANGE(0xec00, 0xec01) AM_WRITE(tehkanwc_scroll_x_w)
315   AM_RANGE(0xec02, 0xec02) AM_WRITE(tehkanwc_scroll_y_w)
316   AM_RANGE(0xf800, 0xf801) AM_WRITE(tehkanwc_track_0_reset_w)
317   AM_RANGE(0xf802, 0xf802) AM_WRITE(gridiron_led0_w)
318   AM_RANGE(0xf810, 0xf811) AM_WRITE(tehkanwc_track_1_reset_w)
319   AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w)
320   AM_RANGE(0xf820, 0xf820) AM_WRITE(sound_command_w)
321   AM_RANGE(0xf840, 0xf840) AM_WRITE(sub_cpu_halt_w)
322   AM_RANGE(0xf850, 0xf850) AM_WRITE(MWA8_NOP)            /* ?? writes 0x00 or 0xff */
323   AM_RANGE(0xf860, 0xf860) AM_WRITE(tehkanwc_flipscreen_x_w)      /* Check if it's really X */
324   AM_RANGE(0xf870, 0xf870) AM_WRITE(tehkanwc_flipscreen_y_w)      /* Check if it's really Y */
325ADDRESS_MAP_END
326
327static ADDRESS_MAP_START( teedoff_readmem, ADDRESS_SPACE_PROGRAM, 8 )
328   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
329   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
330   AM_RANGE(0xc800, 0xcfff) AM_READ(shared_r)
331   AM_RANGE(0xd000, 0xd3ff) AM_READ(MRA8_RAM)
332   AM_RANGE(0xd400, 0xd7ff) AM_READ(MRA8_RAM)
333   AM_RANGE(0xd800, 0xddff) AM_READ(MRA8_RAM)
334   AM_RANGE(0xde00, 0xdfff) AM_READ(MRA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
335   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM)
336   AM_RANGE(0xe800, 0xebff) AM_READ(MRA8_RAM) /* sprites */
337   AM_RANGE(0xec00, 0xec01) AM_READ(MRA8_RAM)
338   AM_RANGE(0xec02, 0xec02) AM_READ(MRA8_RAM)
339   AM_RANGE(0xf800, 0xf801) AM_READ(tehkanwc_track_0_r) /* track 0 x/y */
340   AM_RANGE(0xf802, 0xf802) AM_READ(input_port_9_r) /* Coin */
341   AM_RANGE(0xf803, 0xf803) AM_READ(input_port_5_r) /* joy0 - button */
342   AM_RANGE(0xf806, 0xf806) AM_READ(input_port_9_r) /* Start */
343   AM_RANGE(0xf810, 0xf811) AM_READ(tehkanwc_track_1_r) /* track 1 x/y */
344   AM_RANGE(0xf813, 0xf813) AM_READ(input_port_8_r) /* joy1 - button */
345   AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_r)   /* answer from the sound CPU */
346   AM_RANGE(0xf840, 0xf840) AM_READ(input_port_0_r) /* DSW1 */
347   AM_RANGE(0xf850, 0xf850) AM_READ(input_port_1_r)   /* DSW2 */
263static ADDRESS_MAP_START( sub_mem, ADDRESS_SPACE_PROGRAM, 8 )
264   AM_RANGE(0x0000, 0x7fff) AM_ROM
265   AM_RANGE(0x8000, 0xc7ff) AM_RAM
266   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE(1)
267   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE(2) AM_WRITE(tehkanwc_videoram_w)
268   AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_SHARE(3) AM_WRITE(tehkanwc_colorram_w)
269   AM_RANGE(0xd800, 0xddff) AM_RAM AM_SHARE(4) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_BASE(&paletteram)
270   AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE(5) /* unused part of the palette RAM, I think? Gridiron uses it */
271   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(6) AM_WRITE(tehkanwc_videoram2_w)
272   AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE(7) /* sprites */
273   AM_RANGE(0xec00, 0xec01) AM_READ(MRA8_RAM) AM_WRITE(tehkanwc_scroll_x_w)
274   AM_RANGE(0xec02, 0xec02) AM_READ(MRA8_RAM) AM_WRITE(tehkanwc_scroll_y_w)
348275   AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r)
349276ADDRESS_MAP_END
350277
351static ADDRESS_MAP_START( teedoff_writemem, ADDRESS_SPACE_PROGRAM, 8 )
352   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
353   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
354   AM_RANGE(0xc800, 0xcfff) AM_WRITE(shared_w) AM_BASE(&shared_ram)
355   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(tehkanwc_videoram_w) AM_BASE(&videoram)
356   AM_RANGE(0xd400, 0xd7ff) AM_WRITE(tehkanwc_colorram_w) AM_BASE(&colorram)
357   AM_RANGE(0xd800, 0xddff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_BASE(&paletteram)
358   AM_RANGE(0xde00, 0xdfff) AM_WRITE(MWA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
359   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(tehkanwc_videoram2_w) AM_BASE(&tehkanwc_videoram2)
360   AM_RANGE(0xe800, 0xebff) AM_WRITE(spriteram_w) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* sprites */
361   AM_RANGE(0xec00, 0xec01) AM_WRITE(tehkanwc_scroll_x_w)
362   AM_RANGE(0xec02, 0xec02) AM_WRITE(tehkanwc_scroll_y_w)
363   AM_RANGE(0xf800, 0xf801) AM_WRITE(tehkanwc_track_0_reset_w)
364   AM_RANGE(0xf802, 0xf802) AM_WRITE(gridiron_led0_w)
365   AM_RANGE(0xf810, 0xf811) AM_WRITE(tehkanwc_track_1_reset_w)
366   AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w)
367   AM_RANGE(0xf820, 0xf820) AM_WRITE(sound_command_w)
368   AM_RANGE(0xf840, 0xf840) AM_WRITE(sub_cpu_halt_w)
369   AM_RANGE(0xf850, 0xf850) AM_WRITE(MWA8_NOP)            /* ?? Same value as in 0xf840 */
370   AM_RANGE(0xf860, 0xf860) AM_WRITE(tehkanwc_flipscreen_x_w)      /* Check if it's really X */
371   AM_RANGE(0xf870, 0xf870) AM_WRITE(tehkanwc_flipscreen_y_w)      /* Check if it's really Y */
372ADDRESS_MAP_END
373
374static ADDRESS_MAP_START( readmem_sub, ADDRESS_SPACE_PROGRAM, 8 )
375   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
376   AM_RANGE(0x8000, 0xc7ff) AM_READ(MRA8_RAM)
377   AM_RANGE(0xc800, 0xcfff) AM_READ(shared_r)
378   AM_RANGE(0xd000, 0xd3ff) AM_READ(MRA8_RAM)
379   AM_RANGE(0xd400, 0xd7ff) AM_READ(MRA8_RAM)
380   AM_RANGE(0xd800, 0xddff) AM_READ(MRA8_RAM)
381   AM_RANGE(0xde00, 0xdfff) AM_READ(MRA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
382   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM)
383   AM_RANGE(0xe800, 0xebff) AM_READ(MRA8_RAM) /* sprites */
384   AM_RANGE(0xec00, 0xec01) AM_READ(MRA8_RAM)
385   AM_RANGE(0xec02, 0xec02) AM_READ(MRA8_RAM)
386   AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r)
387ADDRESS_MAP_END
388
389static ADDRESS_MAP_START( writemem_sub, ADDRESS_SPACE_PROGRAM, 8 )
390   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
391   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
392   AM_RANGE(0xc800, 0xcfff) AM_WRITE(shared_w)
393   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(tehkanwc_videoram_w)
394   AM_RANGE(0xd400, 0xd7ff) AM_WRITE(tehkanwc_colorram_w)
395   AM_RANGE(0xd800, 0xddff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_BASE(&paletteram)
396   AM_RANGE(0xde00, 0xdfff) AM_WRITE(MWA8_RAM)   /* unused part of the palette RAM, I think? Gridiron uses it */
397   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(tehkanwc_videoram2_w)
398   AM_RANGE(0xe800, 0xebff) AM_WRITE(spriteram_w) /* sprites */
399   AM_RANGE(0xec00, 0xec01) AM_WRITE(tehkanwc_scroll_x_w)
400   AM_RANGE(0xec02, 0xec02) AM_WRITE(tehkanwc_scroll_y_w)
401ADDRESS_MAP_END
402
403static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
404   AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
405   AM_RANGE(0x4000, 0x47ff) AM_READ(MRA8_RAM)
406   AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_r)
407ADDRESS_MAP_END
408
409static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
410   AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM)
411   AM_RANGE(0x4000, 0x47ff) AM_WRITE(MWA8_RAM)
278static ADDRESS_MAP_START( sound_mem, ADDRESS_SPACE_PROGRAM, 8 )
279   AM_RANGE(0x0000, 0x3fff) AM_ROM
280   AM_RANGE(0x4000, 0x47ff) AM_RAM
412281   AM_RANGE(0x8001, 0x8001) AM_WRITE(msm_reset_w)/* MSM51xx reset */
413282   AM_RANGE(0x8002, 0x8002) AM_WRITE(MWA8_NOP)   /* ?? written in the IRQ handler */
414283   AM_RANGE(0x8003, 0x8003) AM_WRITE(MWA8_NOP)   /* ?? written in the NMI handler */
415   AM_RANGE(0xc000, 0xc000) AM_WRITE(sound_answer_w)   /* answer for main CPU */
284   AM_RANGE(0xc000, 0xc000) AM_READWRITE(soundlatch_r, sound_answer_w)
416285ADDRESS_MAP_END
417286
418static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
287static ADDRESS_MAP_START( sound_port, ADDRESS_SPACE_IO, 8 )
419288   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
420   AM_RANGE(0x00, 0x00) AM_READ(AY8910_read_port_0_r)
421   AM_RANGE(0x02, 0x02) AM_READ(AY8910_read_port_1_r)
422ADDRESS_MAP_END
423
424static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
425   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
426   AM_RANGE(0x00, 0x00) AM_WRITE(AY8910_write_port_0_w)
289   AM_RANGE(0x00, 0x00) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
427290   AM_RANGE(0x01, 0x01) AM_WRITE(AY8910_control_port_0_w)
428   AM_RANGE(0x02, 0x02) AM_WRITE(AY8910_write_port_1_w)
291   AM_RANGE(0x02, 0x02) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
429292   AM_RANGE(0x03, 0x03) AM_WRITE(AY8910_control_port_1_w)
430293ADDRESS_MAP_END
431294
r1490r1491
795658static MACHINE_DRIVER_START( tehkanwc )
796659
797660   /* basic machine hardware */
798   MDRV_CPU_ADD_TAG("main", Z80, 4608000)   /* 18.432000 / 4 */
799   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
661   MDRV_CPU_ADD_TAG("main", Z80, 18432000/4)   /* 18.432000 / 4 */
662   MDRV_CPU_PROGRAM_MAP(main_mem,0)
800663   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
801664
802   MDRV_CPU_ADD(Z80, 4608000)   /* 18.432000 / 4 */
803   MDRV_CPU_PROGRAM_MAP(readmem_sub,writemem_sub)
665   MDRV_CPU_ADD(Z80, 18432000/4)
666   MDRV_CPU_PROGRAM_MAP(sub_mem,0)
804667   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
805668
806   MDRV_CPU_ADD(Z80, 4608000)   /* 18.432000 / 4; communication is bidirectional, can't mark it as AUDIO_CPU */
807   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
808   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
669   MDRV_CPU_ADD(Z80, 18432000/4)
670   MDRV_CPU_PROGRAM_MAP(sound_mem,0)
671   MDRV_CPU_IO_MAP(sound_port,0)
809672   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
810673
811674   MDRV_SCREEN_REFRESH_RATE(60)
r1490r1491
839702   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
840703MACHINE_DRIVER_END
841704
842static MACHINE_DRIVER_START( gridiron )
843705
844   /* basic machine hardware */
845   MDRV_IMPORT_FROM(tehkanwc)
846   MDRV_CPU_MODIFY("main")
847   MDRV_CPU_PROGRAM_MAP(gridiron_readmem,gridiron_writemem)
848MACHINE_DRIVER_END
849
850static MACHINE_DRIVER_START( teedoff )
851
852   /* basic machine hardware */
853   MDRV_IMPORT_FROM(tehkanwc)
854   MDRV_CPU_MODIFY("main")
855   MDRV_CPU_PROGRAM_MAP(teedoff_readmem,teedoff_writemem)
856MACHINE_DRIVER_END
857
858
859
860706static DRIVER_INIT( teedoff )
861707{
862708   /* Patch to avoid the game jumping in shared memory */
r1490r1491
1047893
1048894GAME( 1985, tehkanwc, 0,        tehkanwc, tehkanwc, 0,        ROT0,  "Tehkan", "Tehkan World Cup (set 1)", 0 )
1049895GAME( 1985, tehkanwb, tehkanwc, tehkanwc, tehkanwc, 0,        ROT0,  "Tehkan", "Tehkan World Cup (set 2, bootleg?)", 0 )
1050GAME( 1985, gridiron, 0,        gridiron, gridiron, 0,        ROT0,  "Tehkan", "Gridiron Fight", 0 )
1051GAME( 1986, teedoff,  0,        teedoff,  teedoff,  teedoff,  ROT90, "Tecmo", "Tee'd Off (Japan)", 0 )
896GAME( 1985, gridiron, 0,        tehkanwc, gridiron, 0,        ROT0,  "Tehkan", "Gridiron Fight", 0 )
897GAME( 1986, teedoff,  0,        tehkanwc, teedoff,  teedoff,  ROT90, "Tecmo", "Tee'd Off (Japan)", 0 )
src/mame/drivers/suprridr.c
r1490r1491
215215
216216/*************************************
217217 *
218 *  Port definitions
218 *  Port definitions and helpers
219219 *
220220 *************************************/
221221
222#define SUPRRIDR_P1_CONTROL_PORT_TAG   ("CONTP1")
223#define SUPRRIDR_P2_CONTROL_PORT_TAG   ("CONTP2")
224
225static UINT32 suprridr_control_r(void *param)
226{
227   UINT32 ret;
228
229   /* screen flip multiplexes controls */
230   if (suprridr_is_screen_flipped())
231      ret = readinputportbytag(SUPRRIDR_P2_CONTROL_PORT_TAG);
232   else
233      ret = readinputportbytag(SUPRRIDR_P1_CONTROL_PORT_TAG);
234
235   return ret;
236}
237
238
222239static INPUT_PORTS_START( suprridr )
223240   PORT_START      /* IN0 */
224   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
225   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
226   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNKNOWN )
227   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
228   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
229   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
241   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(suprridr_control_r, 0)
230242
231243   PORT_START      /* IN1 */
232244   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r1490r1491
259271   PORT_DIPNAME( 0x80, 0x00, "Invulnerability?" )
260272   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
261273   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
274
275   PORT_START_TAG(SUPRRIDR_P1_CONTROL_PORT_TAG)
276   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
277   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
278   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNKNOWN )
279   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
280   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
281   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
282
283   PORT_START_TAG(SUPRRIDR_P2_CONTROL_PORT_TAG)
284   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
285   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
286   PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNKNOWN )
287   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
288   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
289   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
262290INPUT_PORTS_END
263291
264292
src/mame/drivers/model3.c
r1490r1491
983983   &scsi_fetch,
984984};
985985
986static void model3_exit(running_machine *machine)
987{
988   lsi53c810_exit(&scsi_intf);
989}
990
991static MACHINE_START(model3_10)
992{
993   lsi53c810_init(&scsi_intf);
994   add_exit_callback(machine, model3_exit);
995}
996static MACHINE_START(model3_15)
997{
998   lsi53c810_init(&scsi_intf);
999   add_exit_callback(machine, model3_exit);
1000}
1001
9861002static void model3_init(running_machine *machine, int step)
9871003{
9881004   model3_step = step;
r1490r1491
10061022      } else {
10071023         mpc105_init();
10081024      }
1009      lsi53c810_init(&scsi_intf);
10101025      real3d_device_id = 0x16c311db;   /* PCI Vendor ID (11db = SEGA), Device ID (16c3 = 315-5827) */
10111026   }
10121027   else {
r1490r1491
40744089
40754090    MDRV_INTERLEAVE(10)
40764091
4092   MDRV_MACHINE_START(model3_10)
40774093   MDRV_MACHINE_RESET(model3_10)
40784094   MDRV_NVRAM_HANDLER(model3)
40794095
r1490r1491
41084124   MDRV_CPU_ADD(M68000, 12000000)
41094125   MDRV_CPU_PROGRAM_MAP(model3_snd, 0)
41104126
4127   MDRV_MACHINE_START(model3_15)
41114128   MDRV_MACHINE_RESET(model3_15)
41124129   MDRV_NVRAM_HANDLER(model3)
41134130
src/mame/drivers/beathead.c
r1490r1491
530530{
531531   /* initialize the common systems */
532532   atarigen_eeprom_default = NULL;
533   atarijsa_init(1, 4, 2, 0x0040);
533   atarijsa_init(machine, 2, 0x0040);
534534   atarijsa3_init_adpcm(REGION_SOUND1);
535535
536536   /* prepare the speedups */
src/mame/drivers/skullxbo.c
r1490r1491
611611static DRIVER_INIT( skullxbo )
612612{
613613   atarigen_eeprom_default = NULL;
614   atarijsa_init(1, 2, 1, 0x0080);
614   atarijsa_init(machine, 1, 0x0080);
615615   memset(memory_region(REGION_GFX1) + 0x170000, 0, 0x20000);
616616}
617617
src/mame/drivers/cps3.c
r1490r1491
25092509   NULL         /* command completion IRQ */
25102510};
25112511
2512static MACHINE_RESET( cps3 )
2512static void cps3_exit(running_machine *machine)
25132513{
2514   wd33c93_exit(&scsi_intf);
2515}
2516
2517static MACHINE_START( cps3 )
2518{
25142519   wd33c93_init(&scsi_intf);
2520   add_exit_callback(machine, cps3_exit);
2521}
25152522
2523static MACHINE_RESET( cps3 )
2524{
25162525   if (cps3_use_fastboot)
25172526   {
25182527      fastboot_timer = timer_alloc(fastboot_timer_callback, NULL);
r1490r1491
27342743   MDRV_SCREEN_SIZE(512*2, 224*2)
27352744   MDRV_SCREEN_VISIBLE_AREA(0, (384*1)-1, 0, 223/*511*/)
27362745
2746   MDRV_MACHINE_START(cps3)
27372747   MDRV_MACHINE_RESET(cps3)
27382748   MDRV_NVRAM_HANDLER( cps3 )
27392749   MDRV_PALETTE_LENGTH(0x10000) // actually 0x20000 ...
src/mame/drivers/cinemat.c
r1490r1491
11311131
11321132static MACHINE_DRIVER_START( wotw )
11331133   MDRV_IMPORT_FROM(cinemat_jmi_16k)
1134   MDRV_SCREEN_VISIBLE_AREA(0, 1120, 0, 767)
11341135   MDRV_IMPORT_FROM(wotw_sound)
11351136MACHINE_DRIVER_END
11361137
r1490r1491
11781179
11791180
11801181ROM_START( spacewar )
1181   ROM_REGION( 0x1000, REGION_CPU1, 0 )   /* 4k for code */
1182   ROM_REGION( 0x1000, REGION_CPU1, 0 )
11821183   ROM_LOAD16_BYTE( "spacewar.1l", 0x0000, 0x0800, CRC(edf0fd53) SHA1(a543d8b95bc77ec061c6b10161a6f3e07401e251) )
11831184   ROM_LOAD16_BYTE( "spacewar.2r", 0x0001, 0x0800, CRC(4f21328b) SHA1(8889f1a9353d6bb1e1078829c1ba77557853739b) )
11841185
r1490r1491
11871188
11881189
11891190ROM_START( barrier )
1190   ROM_REGION( 0x1000, REGION_CPU1, 0 )   /* 4k for code */
1191   ROM_REGION( 0x1000, REGION_CPU1, 0 )
11911192   ROM_LOAD16_BYTE( "barrier.t7", 0x0000, 0x0800, CRC(7c3d68c8) SHA1(1138029552b73e94522b3b48096befc057d603c7) )
11921193   ROM_LOAD16_BYTE( "barrier.p7", 0x0001, 0x0800, CRC(aec142b5) SHA1(b268936b82e072f38f1f1dd54e0bc88bcdf19925) )
11931194
r1490r1491
11961197
11971198
11981199ROM_START( speedfrk )
1199   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1200   ROM_REGION( 0x2000, REGION_CPU1, 0 )
12001201   ROM_LOAD16_BYTE( "speedfrk.t7", 0x0000, 0x0800, CRC(3552c03f) SHA1(c233dd064195b336556d7405b51065389b228c78) )
12011202   ROM_LOAD16_BYTE( "speedfrk.p7", 0x0001, 0x0800, CRC(4b90cdec) SHA1(69e2312acdc22ef52236b1c4dfee9f51fcdcaa52) )
12021203   ROM_LOAD16_BYTE( "speedfrk.u7", 0x1000, 0x0800, CRC(616c7cf9) SHA1(3c5bf59a09d85261f69e4b9d499cb7a93d79fb57) )
r1490r1491
12071208
12081209
12091210ROM_START( starhawk )
1210   ROM_REGION( 0x1000, REGION_CPU1, 0 )   /* 4k for code */
1211   ROM_REGION( 0x1000, REGION_CPU1, 0 )
12111212   ROM_LOAD16_BYTE( "u7", 0x0000, 0x0800, CRC(376e6c5c) SHA1(7d9530ed2e75464578b541f61408ba64ee9d2a95) )
12121213   ROM_LOAD16_BYTE( "r7", 0x0001, 0x0800, CRC(bb71144f) SHA1(79591cd3ef8df78ec26e158f7e82ca0dcd72260d) )
12131214
r1490r1491
12161217
12171218
12181219ROM_START( sundance )
1219   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1220   ROM_REGION( 0x2000, REGION_CPU1, 0 )
12201221   ROM_LOAD16_BYTE( "sundance.t7", 0x0000, 0x0800, CRC(d5b9cb19) SHA1(72dca386b48a582186898c32123d61b4fd58632e) )
12211222   ROM_LOAD16_BYTE( "sundance.p7", 0x0001, 0x0800, CRC(445c4f20) SHA1(972d0b0613f154ee3347206cae05ee8c36796f84) )
12221223   ROM_LOAD16_BYTE( "sundance.u7", 0x1000, 0x0800, CRC(67887d48) SHA1(be225dbd3508fad2711286834880065a4fc0a2fc) )
r1490r1491
12271228
12281229
12291230ROM_START( tailg )
1230   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1231   ROM_REGION( 0x2000, REGION_CPU1, 0 )
12311232   ROM_LOAD16_BYTE( "tgunner.t70", 0x0000, 0x0800, CRC(21ec9a04) SHA1(b442f34360d1d4769e7bca73a2d79ce97d335460) )
12321233   ROM_LOAD16_BYTE( "tgunner.p70", 0x0001, 0x0800, CRC(8d7410b3) SHA1(59ead49bd229a873f15334d0999c872d3d6581d4) )
12331234   ROM_LOAD16_BYTE( "tgunner.t71", 0x1000, 0x0800, CRC(2c954ab6) SHA1(9edf189a19b50a9abf458d4ef8ba25b53934385e) )
r1490r1491
12381239
12391240
12401241ROM_START( warrior )
1241   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1242   ROM_REGION( 0x2000, REGION_CPU1, 0 )
12421243   ROM_LOAD16_BYTE( "warrior.t7", 0x0000, 0x0800, CRC(ac3646f9) SHA1(515c3acb638fad27fa57f6b438c8ec0b5b76f319) )
12431244   ROM_LOAD16_BYTE( "warrior.p7", 0x0001, 0x0800, CRC(517d3021) SHA1(0483dcaf92c336a07d2c535823348ee886567e85) )
12441245   ROM_LOAD16_BYTE( "warrior.u7", 0x1000, 0x0800, CRC(2e39340f) SHA1(4b3cfb3674dd2a668d4d65e28cb37d7ad20f118d) )
r1490r1491
12841285
12851286
12861287ROM_START( ripoff )
1287   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1288   ROM_REGION( 0x2000, REGION_CPU1, 0 )
12881289   ROM_LOAD16_BYTE( "ripoff.t7", 0x0000, 0x0800, CRC(40c2c5b8) SHA1(bc1f3b540475c9868443a72790a959b1f36b93c6) )
12891290   ROM_LOAD16_BYTE( "ripoff.p7", 0x0001, 0x0800, CRC(a9208afb) SHA1(ea362494855be27a07014832b01e65c1645385d0) )
12901291   ROM_LOAD16_BYTE( "ripoff.u7", 0x1000, 0x0800, CRC(29c13701) SHA1(5e7672deffac1fa8f289686a5527adf7e51eb0bb) )
r1490r1491
12951296
12961297
12971298ROM_START( starcas )
1298   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1299   ROM_REGION( 0x2000, REGION_CPU1, 0 )
12991300   ROM_LOAD16_BYTE( "starcas3.t7", 0x0000, 0x0800, CRC(b5838b5d) SHA1(6ac30be55514cba55180c85af69072b5056d1d4c) )
13001301   ROM_LOAD16_BYTE( "starcas3.p7", 0x0001, 0x0800, CRC(f6bc2f4d) SHA1(ef6f01556b154cfb3e37b2a99d6ea6292e5ec844) )
13011302   ROM_LOAD16_BYTE( "starcas3.u7", 0x1000, 0x0800, CRC(188cd97c) SHA1(c021e93a01e9c65013073de551a8c24fd1a68bde) )
r1490r1491
13051306ROM_END
13061307
13071308ROM_START( starcasp )
1308   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1309   ROM_REGION( 0x2000, REGION_CPU1, 0 )
13091310   ROM_LOAD16_BYTE( "starcasp.t7", 0x0000, 0x0800, CRC(d2c551a2) SHA1(90b5e1c6988839b812028f1baaea16420c011c08) )
13101311   ROM_LOAD16_BYTE( "starcasp.p7", 0x0001, 0x0800, CRC(baa4e422) SHA1(9035ac675fcbbb93ae3f658339fdfaef47796dab) )
13111312   ROM_LOAD16_BYTE( "starcasp.u7", 0x1000, 0x0800, CRC(26941991) SHA1(4417f2f3e437c1f39ff389362467928f57045d74) )
r1490r1491
13151316ROM_END
13161317
13171318ROM_START( starcas1 )
1318   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1319   ROM_REGION( 0x2000, REGION_CPU1, 0 )
13191320   ROM_LOAD16_BYTE( "starcast.t7", 0x0000, 0x0800, CRC(65d0a225) SHA1(e1fbee5ff42dd040ab2e90bbe2189fcb76d6167e) )
13201321   ROM_LOAD16_BYTE( "starcast.p7", 0x0001, 0x0800, CRC(d8f58d9a) SHA1(abba459431dcacc75099b0d340b957be71b89cfd) )
13211322   ROM_LOAD16_BYTE( "starcast.u7", 0x1000, 0x0800, CRC(d4f35b82) SHA1(cd4561ce8e1d0554ac1a8925bbf46d2c676a3b80) )
r1490r1491
13251326ROM_END
13261327
13271328ROM_START( starcase )
1328   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1329   ROM_REGION( 0x2000, REGION_CPU1, 0 )
13291330   ROM_LOAD16_BYTE( "starcast.t7", 0x0000, 0x0800, CRC(65d0a225) SHA1(e1fbee5ff42dd040ab2e90bbe2189fcb76d6167e) )
13301331   ROM_LOAD16_BYTE( "starcast.p7", 0x0001, 0x0800, CRC(d8f58d9a) SHA1(abba459431dcacc75099b0d340b957be71b89cfd) )
13311332   ROM_LOAD16_BYTE( "starcast.u7", 0x1000, 0x0800, CRC(d4f35b82) SHA1(cd4561ce8e1d0554ac1a8925bbf46d2c676a3b80) )
r1490r1491
13351336ROM_END
13361337
13371338ROM_START( stellcas )
1338   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1339   ROM_REGION( 0x2000, REGION_CPU1, 0 )
13391340   ROM_LOAD16_BYTE( "starcast.t7", 0x0000, 0x0800, CRC(65d0a225) SHA1(e1fbee5ff42dd040ab2e90bbe2189fcb76d6167e) )
13401341   ROM_LOAD16_BYTE( "starcast.p7", 0x0001, 0x0800, CRC(d8f58d9a) SHA1(abba459431dcacc75099b0d340b957be71b89cfd) )
13411342   ROM_LOAD16_BYTE( "elttron.u7",  0x1000, 0x0800, CRC(d5b44050) SHA1(a5dd6050ab1a3b0275a229845bc5e9524e2da69c) )
r1490r1491
13451346ROM_END
13461347
13471348ROM_START( spaceftr )
1348   ROM_REGION( 0x2000, REGION_CPU1, 0 )   /* 8k for code */
1349   ROM_LOAD16_BYTE( "fortrest7.7t",      0x0000, 0x0800, CRC(65d0a225) SHA1(e1fbee5ff42dd040ab2e90bbe2189fcb76d6167e) )
1350   ROM_LOAD16_BYTE( "fortresp7.7p",      0x0001, 0x0800, CRC(1a32aed6) SHA1(89c16a33288265e06e6fbd8426ba4ee9d81c221f) )
1351   ROM_LOAD16_BYTE( "fortresu7.7u",      0x1000, 0x0800, CRC(13b0287c) SHA1(366a23fd10684975bd5ee190e5227e47a0298ad5) )
1352   ROM_LOAD16_BYTE( "fortresr7.7r",      0x1001, 0x0800, CRC(a2c1ed52) SHA1(ed9743f44ee98c9e7c2a6819ec681af7c7a97fc9) )
1349   ROM_REGION( 0x2000, REGION_CPU1, 0 )
1350   ROM_LOAD16_BYTE( "fortrest7.7t", 0x0000, 0x0800, CRC(65d0a225) SHA1(e1fbee5ff42dd040ab2e90bbe2189fcb76d6167e) )
1351   ROM_LOAD16_BYTE( "fortresp7.7p", 0x0001, 0x0800, BAD_DUMP CRC(1a32aed6) SHA1(89c16a33288265e06e6fbd8426ba4ee9d81c221f) )
1352   ROM_LOAD16_BYTE( "fortresu7.7u", 0x1000, 0x0800, CRC(13b0287c) SHA1(366a23fd10684975bd5ee190e5227e47a0298ad5) )
1353   ROM_LOAD16_BYTE( "fortresr7.7r", 0x1001, 0x0800, CRC(a2c1ed52) SHA1(ed9743f44ee98c9e7c2a6819ec681af7c7a97fc9) )
13531354
13541355   CCPU_PROMS
13551356ROM_END
r1490r1491
14961497GAMEL(1980, starcasp, starcas, starcas,  starcas,  0,        ORIENTATION_FLIP_Y,   "Cinematronics", "Star Castle (prototype)", GAME_SUPPORTS_SAVE, layout_starcas )
14971498GAMEL(1980, starcase, starcas, starcas,  starcas,  0,        ORIENTATION_FLIP_Y,   "Cinematronics (Mottoeis license)", "Star Castle (Mottoeis)", GAME_SUPPORTS_SAVE, layout_starcas )
14981499GAMEL(1980, stellcas, starcas, starcas,  starcas,  0,        ORIENTATION_FLIP_Y,   "bootleg", "Stellar Castle (Elettronolo)", GAME_SUPPORTS_SAVE, layout_starcas )
1499GAMEL(1981, spaceftr, starcas, starcas,  starcas,  0,        ORIENTATION_FLIP_Y,   "Zaccaria", "Space Fortress (Zaccaria)", GAME_SUPPORTS_SAVE, layout_starcas )
1500GAMEL(1981, spaceftr, starcas, starcas,  starcas,  0,        ORIENTATION_FLIP_Y,   "Zaccaria", "Space Fortress (Zaccaria)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING, layout_starcas )
15001501GAMEL(1981, solarq,   0,       solarq,   solarq,   0,        ORIENTATION_FLIP_Y ^ ORIENTATION_FLIP_X, "Cinematronics", "Solar Quest", GAME_SUPPORTS_SAVE, layout_solarq )
15011502GAME( 1981, boxingb,  0,       boxingb,  boxingb,  boxingb,  ORIENTATION_FLIP_Y,   "Cinematronics", "Boxing Bugs", GAME_SUPPORTS_SAVE )
15021503GAME( 1981, wotw,     0,       wotw,     wotw,     0,        ORIENTATION_FLIP_Y,   "Cinematronics", "War of the Worlds", GAME_SUPPORTS_SAVE )
src/mame/drivers/toaplan2.c
r1490r1491
384384  Initialisation handlers
385385***************************************************************************/
386386
387static void toaplan2_reset(void)
388{
389   if ( cpu_gettotalcpu() > 1 )
390      cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
391}
387392
388393static MACHINE_RESET( toaplan2 )      /* machine_reset_toaplan2(); */
389394{
390395   mcu_data = 0x00;
396
397   /*
398      All games execute a RESET instruction on init, presumably to reset the sound CPU.
399      This is important for games with common RAM; the RAM test will fail
400      when leaving service mode if the sound CPU is not reset.
401    */
402   cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)toaplan2_reset);
391403}
392404
393405static MACHINE_RESET( ghox )
394406{
407   machine_reset_toaplan2(machine);
395408   old_p1_paddle_h = 0;
396409   old_p2_paddle_h = 0;
397
398   machine_reset_toaplan2(machine);
399410}
400411
401412static MACHINE_RESET( dogyuun )
402413{
414   machine_reset_toaplan2(machine);
403415   mcu_data = 0xffaa;
404416}
405417
406418static MACHINE_RESET( vfive )
407419{
420   machine_reset_toaplan2(machine);
408421   mcu_data = 0xffaa;
409422}
410423
src/mame/drivers/btoads.c
r1490r1491
1313#include "sound/bsmt2000.h"
1414
1515
16#define CPU_CLOCK         XTAL_64MHz
17#define VIDEO_CLOCK         XTAL_20MHz
18#define SOUND_CLOCK         XTAL_24MHz
1619
20
21
1722/*************************************
1823 *
1924 *  Global variables
r1490r1491
316321{
317322   FALSE,                     /* halt on reset */
318323   0,                        /* the screen operated on */
319   40000000/4,                  /* pixel clock */
324   VIDEO_CLOCK/2,               /* pixel clock */
320325   1,                        /* pixels per clock */
321326   btoads_scanline_update,         /* scanline callback */
322327   NULL,                     /* generate interrupt */
r1490r1491
334339
335340static MACHINE_DRIVER_START( btoads )
336341
337   MDRV_CPU_ADD(TMS34020, 40000000/TMS34020_CLOCK_DIVIDER)
342   MDRV_CPU_ADD(TMS34020, CPU_CLOCK/2/TMS34020_CLOCK_DIVIDER)
338343   MDRV_CPU_CONFIG(tms_config)
339344   MDRV_CPU_PROGRAM_MAP(main_map,0)
340345
341   MDRV_CPU_ADD(Z80, 4000000)
346   MDRV_CPU_ADD(Z80, SOUND_CLOCK/4)
342347   MDRV_CPU_PROGRAM_MAP(sound_map,0)
343348   MDRV_CPU_IO_MAP(sound_io_map,0)
344349   MDRV_CPU_PERIODIC_INT(irq0_line_assert, 183)
r1490r1491
353358
354359   MDRV_SCREEN_ADD("main", 0)
355360   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
356   MDRV_SCREEN_RAW_PARAMS(40000000/4, 640, 0, 512, 257, 0, 224)
361   MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK/2, 640, 0, 512, 257, 0, 224)
357362
358363   MDRV_VIDEO_START(btoads)
359364   MDRV_VIDEO_UPDATE(tms340x0)
r1490r1491
361366   /* sound hardware */
362367   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
363368
364   MDRV_SOUND_ADD(BSMT2000, 24000000)
369   MDRV_SOUND_ADD(BSMT2000, SOUND_CLOCK)
365370   MDRV_SOUND_CONFIG(bsmt2000_interface_region_1)
366371   MDRV_SOUND_ROUTE(0, "left", 1.0)
367372   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/vicdual.c
r1490r1491
19031903
19041904   /* audio hardware */
19051905   MDRV_SPEAKER_STANDARD_MONO("mono")
1906   MDRV_IMPORT_FROM(invinco_audio)
19061907   MDRV_IMPORT_FROM(headon_audio)
19071908
19081909MACHINE_DRIVER_END
src/mame/drivers/xybots.c
r1490r1491
386386static DRIVER_INIT( xybots )
387387{
388388   atarigen_eeprom_default = NULL;
389   atarigen_slapstic_init(0, 0x008000, 107);
390   atarijsa_init(1, 2, 1, 0x0100);
389   atarigen_slapstic_init(0, 0x008000, 0, 107);
390   atarijsa_init(machine, 1, 0x0100);
391391}
392392
393393
src/mame/drivers/atarisy1.c
r1490r1491
21392139   via_config(0, &via_interface);
21402140
21412141   atarigen_eeprom_default = NULL;
2142   atarigen_slapstic_init(0, 0x080000, 103);
2142   atarigen_slapstic_init(0, 0x080000, 0, 103);
21432143
21442144   joystick_type = 0;   /* none */
21452145   trackball_type = 1;   /* rotated */
r1490r1491
21512151   via_config(0, &via_interface);
21522152
21532153   atarigen_eeprom_default = NULL;
2154   atarigen_slapstic_init(0, 0x080000, 107);
2154   atarigen_slapstic_init(0, 0x080000, 0, 107);
21552155
21562156   joystick_type = 1;   /* digital */
21572157   trackball_type = 0;   /* none */
r1490r1491
21632163   via_config(0, &via_interface);
21642164
21652165   atarigen_eeprom_default = NULL;
2166   atarigen_slapstic_init(0, 0x080000, 105);
2166   atarigen_slapstic_init(0, 0x080000, 0, 105);
21672167
21682168   /* special case for the Indiana Jones slapstic */
21692169   memory_set_opbase_handler(0,indytemp_setopbase);
r1490r1491
21782178   via_config(0, &via_interface);
21792179
21802180   atarigen_eeprom_default = NULL;
2181   atarigen_slapstic_init(0, 0x080000, 108);
2181   atarigen_slapstic_init(0, 0x080000, 0, 108);
21822182
21832183   joystick_type = 2;   /* analog */
21842184   trackball_type = 0;   /* none */
r1490r1491
21902190   via_config(0, &via_interface);
21912191
21922192   atarigen_eeprom_default = NULL;
2193   atarigen_slapstic_init(0, 0x080000, 109);
2193   atarigen_slapstic_init(0, 0x080000, 0, 109);
21942194
21952195   joystick_type = 3;   /* pedal */
21962196   trackball_type = 2;   /* steering wheel */
r1490r1491
22022202   via_config(0, &via_interface);
22032203
22042204   atarigen_eeprom_default = NULL;
2205   atarigen_slapstic_init(0, 0x080000, 110);
2205   atarigen_slapstic_init(0, 0x080000, 0, 110);
22062206
22072207   joystick_type = 3;   /* pedal */
22082208   trackball_type = 2;   /* steering wheel */
src/mame/drivers/atarig42.c
r1490r1491
687687      0x0118,0x0100,0x01C8,0x01D0,0x0000
688688   };
689689   atarigen_eeprom_default = default_eeprom;
690   atarijsa_init(2, 3, 2, 0x0040);
690   atarijsa_init(machine, 2, 0x0040);
691691   atarijsa3_init_adpcm(REGION_SOUND1);
692692
693693   atarig42_playfield_base = 0x400;
r1490r1491
738738      0x0109,0x0100,0x0108,0x0134,0x0105,0x0148,0x1400,0x0000
739739   };
740740   atarigen_eeprom_default = default_eeprom;
741   atarijsa_init(2, 3, 2, 0x0040);
741   atarijsa_init(machine, 2, 0x0040);
742742   atarijsa3_init_adpcm(REGION_SOUND1);
743743
744744   atarig42_playfield_base = 0x000;
src/mame/drivers/vindictr.c
r1490r1491
540540static DRIVER_INIT( vindictr )
541541{
542542   atarigen_eeprom_default = NULL;
543   atarijsa_init(1, 3, 1, 0x0002);
543   atarijsa_init(machine, 1, 0x0002);
544544}
545545
546546
src/mame/drivers/metro.c
r1490r1491
35683568
35693569
35703570/* 8x8x4 tiles */
3571static const gfx_layout layout_8x8x4 =
3572{
3573   8,8,
3574   RGN_FRAC(1,1),
3575   4,
3576   { GFX_RAW },
3577   { 0 },      /* org displacement */
3578   { 4*8 },   /* line modulo */
3579   32*8      /* char modulo */
3580};
3571static GFXLAYOUT_RAW( layout_8x8x4, 4, 8, 8, 4*8, 32*8 )
35813572
35823573/* 8x8x8 tiles for later games */
3583static const gfx_layout layout_8x8x8h =
3584{
3585   8,8,
3586   RGN_FRAC(1,1),
3587   8,
3588   { GFX_RAW },
3589   { 0 },      /* org displacement */
3590   { 8*8 },   /* line modulo */
3591   32*8      /* char modulo (half char step) */
3592};
3574static GFXLAYOUT_RAW( layout_8x8x8h, 8, 8, 8, 8*8, 32*8 )
35933575
35943576/* 16x16x4 tiles for later games */
3595static const gfx_layout layout_16x16x4q =
3596{
3597   16,16,
3598   RGN_FRAC(1,1),
3599   4,
3600   { GFX_RAW },
3601   { 0 },      /* org displacement */
3602   { 8*8 },   /* line modulo */
3603   32*8      /* char modulo (quarter char step) */
3604};
3577static GFXLAYOUT_RAW( layout_16x16x4q, 4, 16, 16, 8*8, 32*8 )
36053578
36063579/* 16x16x8 tiles for later games */
3607static const gfx_layout layout_16x16x8o =
3608{
3609   16,16,
3610   RGN_FRAC(1,1),
3611   8,
3612   { GFX_RAW },
3613   { 0 },      /* org displacement */
3614   { 16*8 },   /* line modulo */
3615   32*8      /* char modulo (1/8th char step) */
3616};
3580static GFXLAYOUT_RAW( layout_16x16x8o, 8, 16, 16, 16*8, 32*8 )
36173581
36183582static const gfx_layout layout_053936 =
36193583{
src/mame/drivers/midvunit.c
r1490r1491
5656 *
5757 *************************************/
5858
59static MACHINE_START( midvunit )
60{
61   state_save_register_global(cmos_protected);
62   state_save_register_global(control_data);
63   state_save_register_global(adc_data);
64   state_save_register_global(adc_shift);
65   state_save_register_global(last_port0);
66   state_save_register_global(shifter_state);
67   state_save_register_global(timer_rate);
68}
69
70
5971static MACHINE_RESET( midvunit )
6072{
6173   dcs_reset_w(1);
r1490r1491
9971009   MDRV_CPU_ADD_TAG("main", TMS32031, CPU_CLOCK)
9981010   MDRV_CPU_PROGRAM_MAP(midvunit_map,0)
9991011
1012   MDRV_MACHINE_START(midvunit)
10001013   MDRV_MACHINE_RESET(midvunit)
10011014   MDRV_NVRAM_HANDLER(generic_1fill)
10021015
r1490r1491
14291442 *
14301443 *************************************/
14311444
1432GAME( 1994, crusnusa, 0,        midvunit, crusnusa, crusnusa, ROT0, "Midway", "Cruis'n USA (rev L4.1)", 0 )
1433GAME( 1994, crusnu40, crusnusa, midvunit, crusnusa, crusnu40, ROT0, "Midway", "Cruis'n USA (rev L4.0)", 0 )
1434GAME( 1994, crusnu21, crusnusa, midvunit, crusnusa, crusnu21, ROT0, "Midway", "Cruis'n USA (rev L2.1)", 0 )
1435GAME( 1996, crusnwld, 0,        midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.4)", 0 )
1436GAME( 1996, crusnw23, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.3)", 0 )
1437GAME( 1996, crusnw20, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.0)", 0 )
1438GAME( 1996, crusnw13, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.3)", 0 )
1439GAME( 1997, offroadc, 0,        midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge", GAME_NOT_WORKING )
1445GAME( 1994, crusnusa, 0,        midvunit, crusnusa, crusnusa, ROT0, "Midway", "Cruis'n USA (rev L4.1)", GAME_SUPPORTS_SAVE )
1446GAME( 1994, crusnu40, crusnusa, midvunit, crusnusa, crusnu40, ROT0, "Midway", "Cruis'n USA (rev L4.0)", GAME_SUPPORTS_SAVE )
1447GAME( 1994, crusnu21, crusnusa, midvunit, crusnusa, crusnu21, ROT0, "Midway", "Cruis'n USA (rev L2.1)", GAME_SUPPORTS_SAVE )
1448GAME( 1996, crusnwld, 0,        midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.4)", GAME_SUPPORTS_SAVE )
1449GAME( 1996, crusnw23, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.3)", GAME_SUPPORTS_SAVE )
1450GAME( 1996, crusnw20, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L2.0)", GAME_SUPPORTS_SAVE )
1451GAME( 1996, crusnw13, crusnwld, midvunit, crusnwld, crusnwld, ROT0, "Midway", "Cruis'n World (rev L1.3)", GAME_SUPPORTS_SAVE )
1452GAME( 1997, offroadc, 0,        midvunit, offroadc, offroadc, ROT0, "Midway", "Off Road Challenge", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
14401453
1441GAME( 1995, wargods,  0,        midvplus, wargods,  wargods,  ROT0, "Midway", "War Gods", 0 )
1454GAME( 1995, wargods,  0,        midvplus, wargods,  wargods,  ROT0, "Midway", "War Gods", GAME_SUPPORTS_SAVE )
src/mame/drivers/surpratk.c
r1490r1491
203203   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
204204
205205   PORT_START   /* DSW #3 */
206   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
206   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
207207   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE )
208208   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
209209   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
src/mame/drivers/cubocd32.c
r1490r1491
384384   memory_configure_bank(1, 1, 1, memory_region(REGION_USER1), 0);
385385
386386   /* intialize akiko */
387   amiga_akiko_init();
387   amiga_akiko_init(machine);
388388}
389389
390390/***************************************************************************************************/
src/mame/drivers/liberate.c
r1490r1491
433433   16,16,
434434   16,
435435   2,
436   { 0, 4, 1024*8, 1024*8+4 },
436   { 0, 4 },
437437   {
438438       24,25,26,27, 16,17,18,19, 8,9,10,11, 0,1,2,3
439439   },
src/mame/drivers/cvs.c
r1490r1491
8383***************************************************************************/
8484
8585#include "driver.h"
86#include "cvs.h"
8687#include "cpu/s2650/s2650.h"
8788#include "sound/dac.h"
8889#include "sound/5110intf.h"
8990#include "sound/tms5110.h"
9091#include "video/s2636.h"
9192
92INTERRUPT_GEN( cvs_interrupt );
93PALETTE_INIT( cvs );
94VIDEO_UPDATE( cvs );
95VIDEO_START( cvs );
9693
97extern UINT8 *cvs_bullet_ram;
98
99WRITE8_HANDLER( cvs_videoram_w );
100WRITE8_HANDLER( cvs_bullet_w );
101WRITE8_HANDLER( cvs_2636_1_w );
102WRITE8_HANDLER( cvs_2636_2_w );
103WRITE8_HANDLER( cvs_2636_3_w );
104WRITE8_HANDLER( cvs_scroll_w );
105WRITE8_HANDLER( cvs_video_fx_w );
106
107READ8_HANDLER( cvs_collision_r );
108READ8_HANDLER( cvs_collision_clear );
109READ8_HANDLER( cvs_videoram_r );
110READ8_HANDLER( cvs_bullet_r );
111READ8_HANDLER( cvs_2636_1_r );
112READ8_HANDLER( cvs_2636_2_r );
113READ8_HANDLER( cvs_2636_3_r );
114READ8_HANDLER( cvs_character_mode_r );
115
116
11794/***************************************************************************
11895    Speech Calls
11996***************************************************************************/
r1490r1491
229206
230207static ADDRESS_MAP_START( cvs_cpu1_program, ADDRESS_SPACE_PROGRAM, 8 )
231208   AM_RANGE(0x0000, 0x13ff) AM_ROM
232    AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_bullet_r, cvs_bullet_w) AM_BASE(&cvs_bullet_ram)
233    AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_2636_3_r, cvs_2636_3_w) AM_BASE(&s2636_3_ram)
234    AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_2636_2_r, cvs_2636_2_w) AM_BASE(&s2636_2_ram)
235    AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_2636_1_r, cvs_2636_1_w) AM_BASE(&s2636_1_ram)
236   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(cvs_videoram_r, cvs_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
209    AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_bullet_ram_or_palette_r, cvs_bullet_ram_or_palette_w) AM_BASE(&cvs_bullet_ram)
210    AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_3_or_character_ram_r, cvs_s2636_3_or_character_ram_w) AM_BASE(&s2636_3_ram)
211    AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w) AM_BASE(&s2636_2_ram)
212    AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w) AM_BASE(&s2636_1_ram)
213   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(cvs_video_or_color_ram_r, cvs_video_or_color_ram_w) AM_BASE(&cvs_video_ram)
237214    AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
238215   AM_RANGE(0x2000, 0x33ff) AM_ROM
239216   AM_RANGE(0x4000, 0x53ff) AM_ROM
r1490r1491
241218ADDRESS_MAP_END
242219
243220static ADDRESS_MAP_START( cvs_cpu1_io, ADDRESS_SPACE_IO, 8 )
244   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
245    AM_RANGE(0x02, 0x02) AM_READ(input_port_1_r)
246   AM_RANGE(0x03, 0x03) AM_READ(input_port_2_r)
247    AM_RANGE(0x04, 0x04) AM_READ(input_port_3_r)
248   AM_RANGE(0x06, 0x06) AM_READ(input_port_4_r)      // Dip 1
249   AM_RANGE(0x07, 0x07) AM_READ(input_port_5_r)      // Dip 2
250    AM_RANGE(0x10, 0xff) AM_READ(cvs_character_mode_r)   // Programmable Character Settings
251   AM_RANGE(0x00, 0xff) AM_WRITE(cvs_scroll_w)
221   AM_RANGE(0x00, 0xff) AM_READWRITE(cvs_input_r, cvs_scroll_w)
252222   AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE(cvs_collision_clear, cvs_video_fx_w)
253223   AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_READWRITE(cvs_collision_r, control_port_w)
254224    AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_6_r)
r1490r1491
337307
338308INPUT_PORTS_END
339309
340static const gfx_layout charlayout8colour =
310static const gfx_layout charlayout =
341311{
342312   8,8,   /* 8*8 characters */
343313   256,   /* 256 characters */
r1490r1491
348318   8*8   /* every char takes 8 consecutive bytes */
349319};
350320
351/* S2636 Mappings */
352
353static const gfx_layout s2636_character10 =
354{
355   8,10,
356   5,
357   1,
358   { 0 },
359   { 0,1,2,3,4,5,6,7 },
360      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
361   8*16
362};
363
364321static GFXDECODE_START( cvs )
365   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout8colour, 0, 259 )   /* Rom chars */
366   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout8colour, 0, 259 )   /* Ram chars */
367     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #1  */
368     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #2  */
369     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #3  */
322   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,          0, 259 )   /* chars */
323     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, 2072,   8 )   /* s2636 #1  */
324     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, 2072,   8 )   /* s2636 #2  */
325     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, 2072,   8 )   /* s2636 #3  */
370326GFXDECODE_END
371327
372328static MACHINE_DRIVER_START( cvs )
r1490r1491
429385    ROM_LOAD( "82s185.10h",        0x0000, 0x0800, CRC(c205bca6) SHA1(ec9bd220e75f7b067ede6139763ef8aca0fb7a29) )
430386   ROM_LOAD( "82s123.10k",        0x0800, 0x0020, CRC(b5221cec) SHA1(71d9830b33b1a8140b0fe1a2ba8024ba8e6e48e0) )
431387
432   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
388   ROM_REGION( 0x1800, REGION_GFX1, 0 )
433389   ROM_FILL(0x000000, 0x1800, 0 )
434390ROM_END
435391
r1490r1491
467423   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
468424   ROM_LOAD( "ho-sp1.bin", 0x0000, 0x1000, CRC(3fd39b1e) SHA1(f5d0b2cfaeda994762403f039a6f7933c5525234) )
469425
470   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
426   ROM_REGION( 0x1800, REGION_GFX1, 0 )
471427   ROM_LOAD( "ho-cp1.bin", 0x0000, 0x0800, CRC(c6c73d46) SHA1(63aba92f77105fedf46337b591b074020bec05d0) )
472428   ROM_LOAD( "ho-cp2.bin", 0x0800, 0x0800, CRC(e596371c) SHA1(93a0d0ccdf830ae72d070b03b7e2222f4a737ead) )
473429   ROM_LOAD( "ho-cp3.bin", 0x1000, 0x0800, CRC(11fae1cf) SHA1(5ceabfb1ff1a6f76d1649512f57d7151f5258ecb) )
r1490r1491
510466   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
511467   ROM_LOAD( "dw-sp1.bin", 0x0000, 0x1000, CRC(ce815074) SHA1(105f24fb776131b30e35488cca29954298559518) )
512468
513   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
469   ROM_REGION( 0x1800, REGION_GFX1, 0 )
514470   ROM_LOAD( "dw-cp1.bin", 0x0000, 0x0800, CRC(7a0f9f3e) SHA1(0aa787923fbb614f15016d99c03093a59a0bfb88) )
515471   ROM_LOAD( "dw-cp2.bin", 0x0800, 0x0800, CRC(232e5120) SHA1(76e4d6d17e8108306761604bd56d6269bfc431e1) )
516472   ROM_LOAD( "dw-cp3.bin", 0x1000, 0x0800, CRC(573e0a17) SHA1(9c7991eac625b287bafb6cf722ffb405a9627e09) )
r1490r1491
553509   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
554510   ROM_LOAD( "8b-sp1.bin", 0x0000, 0x0800, CRC(1ee167f3) SHA1(40c876a60832456a27108252ba0b9963f9fe70b0) )
555511
556   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
512   ROM_REGION( 0x1800, REGION_GFX1, 0 )
557513   ROM_LOAD( "8b-cp1.bin", 0x0000, 0x0800, CRC(c1f68754) SHA1(481c8e3dc35300f779b7925fa8a54320688dac54) )
558514   ROM_LOAD( "8b-cp2.bin", 0x0800, 0x0800, CRC(6ec1d711) SHA1(768df8e621a7b110a963c93402ee01b1c9009286) )
559515   ROM_LOAD( "8b-cp3.bin", 0x1000, 0x0800, CRC(4a9afce4) SHA1(187e5106aa2d0bdebf6ec9f2b7c2c2f67d47d221) )
r1490r1491
596552   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
597553   ROM_LOAD( "8b-sp1.bin", 0x0000, 0x0800, CRC(1ee167f3) SHA1(40c876a60832456a27108252ba0b9963f9fe70b0) )
598554
599   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
555   ROM_REGION( 0x1800, REGION_GFX1, 0 )
600556   ROM_LOAD( "8a-cp1.bin", 0x0000, 0x0800, CRC(d9b36c16) SHA1(dbb496102fa2344f19b5d9a3eecdb29c433e4c08) )
601557   ROM_LOAD( "8a-cp2.bin", 0x0800, 0x0800, CRC(6f66f0ff) SHA1(1e91474973356e97f89b4d9093565747a8331f50) )
602558   ROM_LOAD( "8a-cp3.bin", 0x1000, 0x0800, CRC(baee8b17) SHA1(9f86f1d5903aeead17cc75dac8a2b892bb375dad) )
r1490r1491
639595   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
640596   ROM_LOAD( "hb-sp1.bin", 0x0000, 0x0800, CRC(ed1cd201) SHA1(6cc3842dda1bfddc06ffb436c55d14276286bd67) )
641597
642   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
598   ROM_REGION( 0x1800, REGION_GFX1, 0 )
643599   ROM_LOAD( "hb-cp1.bin", 0x0000, 0x0800, CRC(f256b047) SHA1(02d79882bad37ffdd58ef478e2658a1369c32ebc) )
644600   ROM_LOAD( "hb-cp2.bin", 0x0800, 0x0800, CRC(b870c64f) SHA1(ce4f8de87568782ce02bba754edff85df7f5c393) )
645601   ROM_LOAD( "hb-cp3.bin", 0x1000, 0x0800, CRC(9a7dab88) SHA1(cd39a9d4f982a7f49c478db1408d7e07335f2ddc) )
r1490r1491
682638   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
683639   ROM_LOAD( "hb-sp1.bin", 0x0000, 0x0800, CRC(ed1cd201) SHA1(6cc3842dda1bfddc06ffb436c55d14276286bd67) )
684640
685   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
641   ROM_REGION( 0x1800, REGION_GFX1, 0 )
686642   ROM_LOAD( "hb-cp1.bin", 0x0000, 0x0800, CRC(f256b047) SHA1(02d79882bad37ffdd58ef478e2658a1369c32ebc) )
687643   ROM_LOAD( "hb-cp2.bin", 0x0800, 0x0800, CRC(b870c64f) SHA1(ce4f8de87568782ce02bba754edff85df7f5c393) )
688644   ROM_LOAD( "hb-cp3.bin", 0x1000, 0x0800, CRC(9a7dab88) SHA1(cd39a9d4f982a7f49c478db1408d7e07335f2ddc) )
r1490r1491
725681   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
726682   ROM_LOAD( "ws-sp1.bin", 0x0000, 0x0800, CRC(84b72637) SHA1(9c5834320f39545403839fb7088c37177a6c8861) )
727683
728   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
684   ROM_REGION( 0x1800, REGION_GFX1, 0 )
729685   ROM_LOAD( "ws-cp1.bin", 0x0000, 0x0800, CRC(5aca11df) SHA1(5ef815b5b09445515ff8b958c4ea29f1a221cee1) )
730686   ROM_LOAD( "ws-cp2.bin", 0x0800, 0x0800, CRC(ca530d85) SHA1(e5a78667c3583d06d8387848323b11e4a91091ec) )
731687   ROM_LOAD( "ws-cp3.bin", 0x1000, 0x0800, CRC(1e0225d6) SHA1(410795046c64c24de6711b167315308808b54291) )
r1490r1491
768724   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
769725   ROM_LOAD( "dz-sp1.bin", 0x0000, 0x0800, CRC(25da1fc1) SHA1(c14717ec3399ce7dc47a9d42c8ac8f585db770e9) )
770726
771   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
727   ROM_REGION( 0x1800, REGION_GFX1, 0 )
772728   ROM_LOAD( "dz-cp1.bin", 0x0000, 0x0800, CRC(0a8a9034) SHA1(9df3d4f387bd5ce3d3580ba678aeda1b65634ac2) )
773729   ROM_LOAD( "dz-cp2.bin", 0x0800, 0x0800, CRC(3868dd82) SHA1(844584c5a80fb8f1797b4aa4e22024e75726293d) )
774730   ROM_LOAD( "dz-cp3.bin", 0x1000, 0x0800, CRC(755d9ed2) SHA1(a7165a1d12a5a81d8bb941d8ad073e2097c90beb) )
r1490r1491
811767   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
812768   ROM_LOAD( "rd-sp1.bin", 0x0000, 0x0800, CRC(43b17734) SHA1(59960f0c48ed24cedb4b4655f97f6f1fdac4445e) )
813769
814   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
770   ROM_REGION( 0x1800, REGION_GFX1, 0 )
815771   ROM_LOAD( "rd-cp1.bin", 0x0000, 0x0800, CRC(ed601677) SHA1(efe2b6033f319603ee80ed4ba66d3b3607537b13) )
816772   ROM_LOAD( "rd-cp2.bin", 0x0800, 0x0800, CRC(35e317ff) SHA1(458550b431ec66006e2966d86a2286905c0495ed) )
817773   ROM_LOAD( "rd-cp3.bin", 0x1000, 0x0800, CRC(90f2c43f) SHA1(406215217f6f20c1a78f31b2ae3c0a97391e3371) )
r1490r1491
854810   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
855811   ROM_LOAD( "rd-sp1.bin", 0x0000, 0x0800, CRC(43b17734) SHA1(59960f0c48ed24cedb4b4655f97f6f1fdac4445e) )
856812
857   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
813   ROM_REGION( 0x1800, REGION_GFX1, 0 )
858814   ROM_LOAD( "rd-cp1.bin", 0x0000, 0x0800, CRC(ed601677) SHA1(efe2b6033f319603ee80ed4ba66d3b3607537b13) )
859815   ROM_LOAD( "rd-cp2.bin", 0x0800, 0x0800, CRC(35e317ff) SHA1(458550b431ec66006e2966d86a2286905c0495ed) )
860816   ROM_LOAD( "rd-cp3.bin", 0x1000, 0x0800, CRC(90f2c43f) SHA1(406215217f6f20c1a78f31b2ae3c0a97391e3371) )
r1490r1491
897853   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
898854   ROM_LOAD( "rd-sp1.bin", 0x0000, 0x0800, CRC(43b17734) SHA1(59960f0c48ed24cedb4b4655f97f6f1fdac4445e) )
899855
900   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
856   ROM_REGION( 0x1800, REGION_GFX1, 0 )
901857   ROM_LOAD( "rd-cp1.bin", 0x0000, 0x0800, CRC(ed601677) SHA1(efe2b6033f319603ee80ed4ba66d3b3607537b13) )
902858   ROM_LOAD( "rd-cp2.bin", 0x0800, 0x0800, CRC(35e317ff) SHA1(458550b431ec66006e2966d86a2286905c0495ed) )
903859   ROM_LOAD( "rd-cp3.bin", 0x1000, 0x0800, CRC(90f2c43f) SHA1(406215217f6f20c1a78f31b2ae3c0a97391e3371) )
r1490r1491
940896   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
941897   ROM_LOAD( "ot-sp1.bin", 0x0000, 0x1000, CRC(fa21422a) SHA1(a75d13455c65e5a77db02fc87f0c112e329d0d6d) )
942898
943   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
899   ROM_REGION( 0x1800, REGION_GFX1, 0 )
944900   ROM_LOAD( "rd-cp1.bin", 0x0000, 0x0800, CRC(ed601677) SHA1(efe2b6033f319603ee80ed4ba66d3b3607537b13) )
945901   ROM_LOAD( "rd-cp2.bin", 0x0800, 0x0800, CRC(35e317ff) SHA1(458550b431ec66006e2966d86a2286905c0495ed) )
946902   ROM_LOAD( "rd-cp3.bin", 0x1000, 0x0800, CRC(90f2c43f) SHA1(406215217f6f20c1a78f31b2ae3c0a97391e3371) )
r1490r1491
983939   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
984940   ROM_LOAD( "gb-sp1.bin", 0x0000, 0x0800, CRC(5d0205c3) SHA1(578937058d56e5c9fba8a2204ddbb59a6d23dec7) )
985941
986   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
942   ROM_REGION( 0x1800, REGION_GFX1, 0 )
987943   ROM_LOAD( "gb-cp1.bin", 0x0000, 0x0800, CRC(80e1ad5a) SHA1(0a577b0faffd9d6807c39175ce213f017a5cc7f8) )
988944   ROM_LOAD( "gb-cp2.bin", 0x0800, 0x0800, CRC(0a288b29) SHA1(0c6471a3517805a5c873857ff21ca94dfe91c24e) )
989945   ROM_LOAD( "gb-cp3.bin", 0x1000, 0x0800, CRC(e5bcf8cf) SHA1(7f53b8ee6f87e6c8761d2200e8194a7d16d8c7ac) )
r1490r1491
1026982   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
1027983   ROM_LOAD( "dig-sp1.bin", 0x0000, 0x0800, CRC(db526ee1) SHA1(afe319e64350b0c54b72394294a6369c885fdb7f) )
1028984
1029   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
985   ROM_REGION( 0x1800, REGION_GFX1, 0 )
1030986   ROM_LOAD( "dig-cp1.bin", 0x0000, 0x0800, CRC(ca30fb97) SHA1(148f3a6f20b1f256a73e7a1992262116d77cc0a8) )
1031987   ROM_LOAD( "dig-cp2.bin", 0x0800, 0x0800, CRC(bed2334c) SHA1(c93902d01174e13fb9265194e5e44f67b38c5970) )
1032988   ROM_LOAD( "dig-cp3.bin", 0x1000, 0x0800, CRC(46db9b65) SHA1(1c655b4611ab182b6e4a3cdd3ef930e0d4dad0d9) )
r1490r1491
10691025   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
10701026   ROM_LOAD( "sb-sp1.bin", 0x0000, 0x0800, CRC(0aeb9ccd) SHA1(e7123eed21e4e758bbe1cebfd5aad44a5de45c27) )
10711027
1072   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
1028   ROM_REGION( 0x1800, REGION_GFX1, 0 )
10731029   ROM_LOAD( "sb-cp1.bin", 0x0000, 0x0800, CRC(03ba7760) SHA1(4ed252e2c4ec7cea2199524f7c35a1dc7c44f8d8) )
10741030   ROM_LOAD( "sb-cp2.bin", 0x0800, 0x0800, CRC(04de69f2) SHA1(3ef3b3c159d47230622b6cc45baad8737bd93a90) )
10751031   ROM_LOAD( "sb-cp3.bin", 0x1000, 0x0800, CRC(bb7d0b9a) SHA1(94c72d6961204be9cab351ac854ac9c69b51e79a) )
r1490r1491
11121068   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
11131069   ROM_LOAD( "hr-sp1.bin", 0x0000, 0x0800, CRC(a5c33cb1) SHA1(447ffb193b0dc4985bae5d8c214a893afd08664b) )
11141070
1115   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
1071   ROM_REGION( 0x1800, REGION_GFX1, 0 )
11161072   ROM_LOAD( "hr-cp1.bin", 0x0000, 0x0800, CRC(2d201496) SHA1(f195aa1b231a0e1752c7da824a10321f0527f8c9) )
11171073   ROM_LOAD( "hr-cp2.bin", 0x0800, 0x0800, CRC(21b61fe3) SHA1(31882003f0557ffc4ec38ae6ee07b5d294b4162c) )
11181074   ROM_LOAD( "hr-cp3.bin", 0x1000, 0x0800, CRC(9c8e3f9e) SHA1(9d949a4d12b45da12b434677670b2b109568564a) )
r1490r1491
11551111   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
11561112   ROM_LOAD( "lg-sp1.bin", 0x0000, 0x0800, CRC(74f67815) SHA1(6a26a16c27a7e4d58b611e5127115005a60cff91) )
11571113
1158   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
1114   ROM_REGION( 0x1800, REGION_GFX1, 0 )
11591115   ROM_LOAD( "lg-cp1.bin", 0x0000, 0x0800, CRC(e4ede80e) SHA1(62f2bc78106a057b6a8420d40421908df609bf29) )
11601116   ROM_LOAD( "lg-cp2.bin", 0x0800, 0x0800, CRC(d3de8e5b) SHA1(f95320e001869c42e51195d9cc11e4f2555e153f) )
11611117   ROM_LOAD( "lg-cp3.bin", 0x1000, 0x0800, CRC(9b8d1031) SHA1(87ef12aeae80cc0f240dead651c6222848f8dccc) )
r1490r1491
11981154   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
11991155   ROM_LOAD( "cs-sp1.bin", 0x0000, 0x1000, CRC(3c7fe86d) SHA1(9ae0b63b231a7092820650a196cde60588bc6b58) )
12001156
1201   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
1157   ROM_REGION( 0x1800, REGION_GFX1, 0 )
12021158   ROM_LOAD( "cs-cp1.bin", 0x0000, 0x0800, CRC(6a48c898) SHA1(c27f7bcdb2fe042ec52d1b9b4b9a4e47c288862d) )
12031159   ROM_LOAD( "cs-cp2.bin", 0x0800, 0x0800, CRC(db0dfd8c) SHA1(f2b0dd43f0e514fdae54e4066606187f45b98e38) )
12041160   ROM_LOAD( "cs-cp3.bin", 0x1000, 0x0800, CRC(01eee875) SHA1(6c41d716b5795f085229d855518862fb85f395a4) )
r1490r1491
12411197   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
12421198   ROM_LOAD( "ha-sp1.bin", 0x0000, 0x1000, CRC(fa21422a) SHA1(a75d13455c65e5a77db02fc87f0c112e329d0d6d) )
12431199
1244   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
1200   ROM_REGION( 0x1800, REGION_GFX1, 0 )
12451201   ROM_LOAD( "ha-cp1.bin", 0x0000, 0x0800, CRC(2d0f6d13) SHA1(55e45eaf1bf24a7a78a2f34ffc0d99a4c191d138) )
12461202   ROM_LOAD( "ha-cp2.bin", 0x0800, 0x0800, CRC(7f5671bd) SHA1(7f4ae92a96c5a847c113f6f7e8d67d3e5ee0bcb0) )
12471203   ROM_LOAD( "ha-cp3.bin", 0x1000, 0x0800, CRC(35b05ab4) SHA1(f336eb0c674c3d52e84be0f37b70953cce6112dc) )
r1490r1491
12841240   ROM_REGION( 0x1000, REGION_SOUND1, 0 )
12851241   ROM_LOAD( "sf-sp1.bin", 0x0000, 0x1000, CRC(c5628d30) SHA1(d29a5852a1762cbd5f3eba29ae2bf49b3a26f894) )
12861242
1287   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
1243   ROM_REGION( 0x1800, REGION_GFX1, 0 )
12881244   ROM_LOAD( "sf-cp1.bin", 0x0000, 0x0800, CRC(da194a68) SHA1(4215267e91644cf1e1f32f898bc9562bfba711f3) )
12891245   ROM_LOAD( "sf-cp2.bin", 0x0800, 0x0800, CRC(b96977c7) SHA1(8f0fab044f16787bce83562e2b22d962d0a2c209) )
12901246   ROM_LOAD( "sf-cp3.bin", 0x1000, 0x0800, CRC(f5d67b9a) SHA1(a492b41c53b1f28ac5f70969e5f06afa948c1a7d) )
r1490r1491
13271283   ROM_REGION( 0x0800, REGION_SOUND1, 0 )
13281284   ROM_LOAD( "raidr1-8.bin", 0x0000, 0x0800, CRC(b6b90d2e) SHA1(a966fa208b72aec358b7fb277e603e47b6984aa7) )
13291285
1330   ROM_REGION( 0x1800, REGION_GFX1, ROMREGION_DISPOSE )
1286   ROM_REGION( 0x1800, REGION_GFX1, 0 )
13311287   ROM_LOAD( "raid4-11.bin", 0x0000, 0x0800, CRC(5eb7143b) SHA1(a19e803c15593b37ae2e61789f6e16f319620a37) )
13321288   ROM_LOAD( "raid4-10.bin", 0x0800, 0x0800, CRC(391948a4) SHA1(7e20ad4f7e5bf7ad5dcb08ba6475313e2b8b1f03) )
13331289   ROM_LOAD( "raid4-9b.bin", 0x1000, 0x0800, CRC(fecfde80) SHA1(23ea63080b8292fb00a743743cdff1a7ad0a8c6d) )
src/mame/drivers/seta.c
r1490r1491
21612161***************************************************************************/
21622162
21632163static ADDRESS_MAP_START( drgnunit_readmem, ADDRESS_SPACE_PROGRAM, 16 )
2164   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM            )   // ROM
2165   AM_RANGE(0x080000, 0x0bffff) AM_READ(MRA16_RAM            )   // ROM (qzkklgy2)
2164   AM_RANGE(0x000000, 0x0bffff) AM_READ(MRA16_ROM            )   // ROM
21662165   AM_RANGE(0xf00000, 0xf0ffff) AM_READ(MRA16_RAM            )   // RAM (qzkklogy)
21672166   AM_RANGE(0xffc000, 0xffffff) AM_READ(MRA16_RAM            )   // RAM (drgnunit,stg)
21682167   AM_RANGE(0x100000, 0x103fff) AM_READ(seta_sound_word_r      )   // Sound
r1490r1491
21802179ADDRESS_MAP_END
21812180
21822181static ADDRESS_MAP_START( drgnunit_writemem, ADDRESS_SPACE_PROGRAM, 16 )
2183   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM                  )   // ROM
2184   AM_RANGE(0x080000, 0x0bffff) AM_WRITE(MWA16_RAM                  )   // ROM (qzkklgy2)
2182   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(MWA16_ROM                  )   // ROM
21852183   AM_RANGE(0xf00000, 0xf0ffff) AM_WRITE(MWA16_RAM                  )   // RAM (qzkklogy)
21862184   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(MWA16_RAM                  )   // RAM (drgnunit,stg)
21872185   AM_RANGE(0x100000, 0x103fff) AM_WRITE(seta_sound_word_w            )   // Sound
r1490r1491
49234921   PORT_DIPNAME( 0x0004, 0x0004, "Highlight Right Answer (Cheat)")
49244922   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
49254923   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
4926   PORT_DIPNAME( 0x0008, 0x0008, "Unknown 1-3" )
4924   PORT_DIPNAME( 0x0008, 0x0008, "Skip Real DAT Rom Check?" ) // 'ON' it will pass DAT rom even if it isn't mapped(!)
49274925   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
49284926   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
49294927   PORT_DIPNAME( 0x0010, 0x0010, "Unknown 1-4" )
r1490r1491
82408238
82418239
82428240ROM_START( drgnunit )
8243   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
8241   ROM_REGION( 0x0c0000, REGION_CPU1, 0 )      /* 68000 Code */
82448242   ROM_LOAD16_BYTE( "prg-e.bin", 0x000000, 0x020000, CRC(728447df) SHA1(8bdc52a4cc5f36794a47f963545bdaa26c9acd6b) )
82458243   ROM_LOAD16_BYTE( "prg-o.bin", 0x000001, 0x020000, CRC(b2f58ecf) SHA1(5198e75b22bab630b458797988f2e443c601351f) )
82468244
r1490r1491
83768374ROM_END
83778375
83788376ROM_START( stg )
8379   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
8377   ROM_REGION( 0x0c0000, REGION_CPU1, 0 )      /* 68000 Code */
83808378   ROM_LOAD16_BYTE( "att01003.u27", 0x000000, 0x020000, CRC(7a640a93) SHA1(28c54eca9502d06ca55c2db91bfe7d149af006ed) )
83818379   ROM_LOAD16_BYTE( "att01001.u9",  0x000001, 0x020000, CRC(4fa88ad3) SHA1(55e0e689758511cdf514a633ffe3d7729e281b52) )
83828380   ROM_LOAD16_BYTE( "att01004.u33", 0x040000, 0x020000, CRC(bbd45ca1) SHA1(badb11faf5779e8444dd95eb08a94fbf9f73cc2c) ) // 1xxxxxxxxxxxxxxxx = 0xFF
r1490r1491
84918489ROM_END
84928490
84938491ROM_START( qzkklogy )
8494   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
8492   ROM_REGION( 0x0c0000, REGION_CPU1, 0 )      /* 68000 Code */
84958493   ROM_LOAD16_BYTE( "3.u27", 0x000000, 0x020000, CRC(b8c27cde) SHA1(4c36076801b6c915888b925c1e37d772bab1bb02) )
84968494   ROM_LOAD16_BYTE( "1.u9",  0x000001, 0x020000, CRC(ce01cd54) SHA1(ef91aecdf7b5586a6870ff237372d65f85cd4cd3) )
84978495   ROM_LOAD16_BYTE( "4.u33", 0x040000, 0x020000, CRC(4f5c554c) SHA1(0a10cefdf2dd876e6cb78023c3c15af24ba3c39a) )
src/mame/drivers/laserbat.c
r1490r1491
5757   }
5858}
5959
60static WRITE8_HANDLER( laserbat_s2636_1_w )
61{
62   s2636_w(s2636_1_ram,offset,data,s2636_1_dirty);
63}
64
65static WRITE8_HANDLER( laserbat_s2636_2_w )
66{
67   s2636_w(s2636_2_ram,offset,data,s2636_2_dirty);
68}
69
70static WRITE8_HANDLER( laserbat_s2636_3_w )
71{
72   s2636_w(s2636_3_ram,offset,data,s2636_3_dirty);
73}
74
7560static WRITE8_HANDLER( video_extra_w )
7661{
7762   laserbat_video_page = (data & 0x10) >> 4;
r1490r1491
196181   AM_RANGE(0x7800, 0x7bff) AM_ROM
197182
198183   AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_WRITENOP // always 0 (bullet ram in Quasar)
199   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_WRITE(laserbat_s2636_1_w) AM_BASE(&s2636_1_ram)
200   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM AM_WRITE(laserbat_s2636_2_w) AM_BASE(&s2636_2_ram)
201   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_WRITE(laserbat_s2636_3_w) AM_BASE(&s2636_3_ram)
184   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_1_ram)
185   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_2_ram)
186   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_3_ram)
202187   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(laserbat_videoram_w)
203188   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
204189ADDRESS_MAP_END
r1490r1491
484469   8*8
485470};
486471
487static const gfx_layout s2636_character10 =
488{
489   8,10,
490   5,
491   1,
492   { 0 },
493   { 0,1,2,3,4,5,6,7 },
494      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
495   8*16
496};
497
498472static const gfx_layout sprites_layout =
499473{
500474   32,32,
r1490r1491
513487};
514488
515489static GFXDECODE_START( laserbat )
516   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,        0, 256 )   /* Rom chars */
517   GFXDECODE_ENTRY( REGION_CPU1, 0x1500, s2636_character10, 0,   8 )   /* s2636 #1  */
518   GFXDECODE_ENTRY( REGION_CPU1, 0x1600, s2636_character10, 0,   8 )   /* s2636 #2  */
519   GFXDECODE_ENTRY( REGION_CPU1, 0x1700, s2636_character10, 0,   8 )   /* s2636 #3  */
520   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, sprites_layout,    0,   8 )   /* Sprites   */
490   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,       0, 256 )   /* Rom chars */
491   GFXDECODE_ENTRY( REGION_CPU1, 0x1500, s2636_gfx_layout, 0,   8 )   /* s2636 #1  */
492   GFXDECODE_ENTRY( REGION_CPU1, 0x1600, s2636_gfx_layout, 0,   8 )   /* s2636 #2  */
493   GFXDECODE_ENTRY( REGION_CPU1, 0x1700, s2636_gfx_layout, 0,   8 )   /* s2636 #3  */
494   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, sprites_layout,   0,   8 )   /* Sprites   */
521495GFXDECODE_END
522496
523497static TILE_GET_INFO( get_tile_info )
r1490r1491
542516{
543517   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
544518
545   s2636_update_bitmap(machine,bitmap,s2636_1_ram,s2636_1_dirty,1,collision_bitmap);
546   s2636_update_bitmap(machine,bitmap,s2636_2_ram,s2636_2_dirty,2,collision_bitmap);
547   s2636_update_bitmap(machine,bitmap,s2636_3_ram,s2636_3_dirty,3,collision_bitmap);
519   s2636_update_bitmap(machine,bitmap,s2636_1_ram,1,collision_bitmap);
520   s2636_update_bitmap(machine,bitmap,s2636_2_ram,2,collision_bitmap);
521   s2636_update_bitmap(machine,bitmap,s2636_3_ram,3,collision_bitmap);
548522
549523   if(sprite_info.enable)
550524      drawgfx(bitmap,machine->gfx[4],
src/mame/drivers/vball.c
r1490r1491
251251   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) \
252252   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) \
253253   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
254   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_VBLANK ) \
254   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK ) \
255255   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) \
256256   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) \
257257   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) \
src/mame/drivers/batman.c
r1490r1491
334334      0x01D0,0x02C8,0x0000
335335   };
336336   atarigen_eeprom_default = default_eeprom;
337   atarijsa_init(1, 3, 2, 0x0040);
337   atarijsa_init(machine, 2, 0x0040);
338338   atarijsa3_init_adpcm(REGION_SOUND1);
339339}
340340
src/mame/drivers/naomi.c
r1490r1491
33  Sega Naomi
44 + Related Systems (possibly to be split at a later date)
55
6 Skeleton Driver
6  Driver by Samuele Zannoli, R. Belmont, and ElSemi.
77
88Sega Naomi is Dreamcast based Arcade hardware.
99
r1490r1491
445445                                 /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */
446446static const struct sh4_config sh4cpu_config = {  1,  0,  1,  0,  0,  0,  1,  1,  0, CPU_CLOCK };
447447
448static UINT64 *dc_sound_ram;
448static UINT32 *dc_sound_ram;
449extern UINT64 *dc_texture_ram;
450static UINT32 rom_offset, dma_offset;
449451
452static INTERRUPT_GEN( naomi_vblank )
453{
454   dc_vblank();
455}
456
457READ64_HANDLER( naomi_arm_r )
458{
459   return *((UINT64 *)dc_sound_ram+offset);
460}
461
462WRITE64_HANDLER( naomi_arm_w )
463{
464   COMBINE_DATA((UINT64 *)dc_sound_ram + offset);
465}
466
467READ64_HANDLER( naomi_unknown1_r )
468{
469   if ((offset * 8) == 0xc0) // trick so that it does not "wait for multiboard sync"
470      return -1;
471   return 0;
472}
473
474WRITE64_HANDLER( naomi_unknown1_w )
475{
476}
477
478READ32_HANDLER( dc_aica_arm_r )
479{
480   return 0;
481}
482
483WRITE32_HANDLER( dc_aica_arm_w )
484{
485}
486
487/*
488    Naomi ROM board info from ElSemi:
489
490    NAOMI_ROM_OFFSETH = 0x5f7000,
491    NAOMI_ROM_OFFSETL = 0x5f7004,
492    NAOMI_ROM_DATA = 0x5f7008,
493    NAOMI_DMA_OFFSETH = 0x5f700C,
494    NAOMI_DMA_OFFSETL = 0x5f7010,
495    NAOMI_DMA_COUNT = 0x5f7014,
496    NAOMI_COMM_OFFSET = 0x5F7050,
497    NAOMI_COMM_DATA = 0x5F7054,
498    NAOMI_BOARDID_WRITE = 0x5F7078,
499    NAOMI_BOARDID_READ = 0x5F707C,
500    each port is 16 bit wide, to access the rom in PIO mode, just set an offset in ROM_OFFSETH/L and read from ROM_DATA, each access reads 2 bytes and increases the offset by 2.
501
502    the BOARDID regs access the password protected eeprom in the game board. the main board eeprom is read through port 0x1F800030
503
504    To access the board using DMA, use the DMA_OFFSETL/H. DMA_COUNT is in units of 0x20 bytes. Then trigger a GDROM DMA request.
505*/
506
507// NOTE: all accesses are 16 or 32 bits wide but only 16 bits are valid
508
509READ64_HANDLER( naomi_rom_board_r )
510{
511   UINT8 *ROM = (UINT8 *)memory_region(REGION_USER1);
512
513   // ROM_DATA
514   if ((offset == 1) && ((mem_mask & 0xffff) == 0))
515   {
516      UINT64 ret;
517
518      ret = (UINT64)(ROM[rom_offset] | (ROM[rom_offset+1]<<8));
519
520      rom_offset += 2;
521
522      return ret;
523   }
524   else
525   {
526      mame_printf_verbose("ROM: read mask %llx @ %x (PC=%x)\n", mem_mask, offset, activecpu_get_pc());
527   }
528
529   return U64(0xffffffffffffffff);
530}
531
532WRITE64_HANDLER( naomi_rom_board_w )
533{
534   if ((offset == 1) && ((mem_mask & U64(0xffff)) == 0))
535   {
536      // DMA_OFFSETH
537      dma_offset &= 0xffff;
538      dma_offset |= (data & 0x1fff)<<16;
539   }
540   else if ((offset == 1) && ((mem_mask & U64(0xffff00000000)) == 0))
541   {
542      // DMA_OFFSETL
543      dma_offset &= 0xffff0000;
544      dma_offset |= (data & 0xffff);
545   }
546   else if ((offset == 0) && ((mem_mask & U64(0xffff)) == 0))
547   {
548      // ROM_OFFSETH
549      rom_offset &= 0xffff;
550      rom_offset |= (data & 0x1fff)<<16;
551   }
552   else if ((offset == 0) && ((mem_mask & U64(0xffff00000000)) == 0))
553   {
554      // ROM_OFFSETL
555      rom_offset &= 0xffff0000;
556      rom_offset |= (data & 0xffff);
557   }
558   else
559   {
560      mame_printf_verbose("ROM: write %llx to %x, mask %llx (PC=%x)\n", data, offset, mem_mask, activecpu_get_pc());
561   }
562}
563
450564static ADDRESS_MAP_START( naomi_map, ADDRESS_SPACE_PROGRAM, 64 )
451   AM_RANGE(0x00000000, 0x001fffff) AM_ROM                  // BIOS
565   AM_RANGE(0x00000000, 0x001fffff) AM_ROM                           // BIOS
566   AM_RANGE(0x00200000, 0x00207fff) AM_RAM                           // bios uses it (battery backed ram ?)
452567   AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w )
453568   AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( dc_maple_r, dc_maple_w )
454   AM_RANGE(0x005f7000, 0x005f70ff) AM_READWRITE( dc_gdrom_r, dc_gdrom_w )
569   AM_RANGE(0x005f7000, 0x005f70ff) AM_READWRITE( naomi_rom_board_r, naomi_rom_board_w )
455570   AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE( dc_g1_ctrl_r, dc_g1_ctrl_w )
456571   AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w )
457572   AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE( pvr_ctrl_r, pvr_ctrl_w )
r1490r1491
459574   AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( dc_modem_r, dc_modem_w )
460575   AM_RANGE(0x00700000, 0x00707fff) AM_READWRITE( dc_aica_reg_r, dc_aica_reg_w )
461576   AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE( dc_rtc_r, dc_rtc_w )
462   AM_RANGE(0x00800000, 0x009fffff) AM_RAM   AM_BASE( &dc_sound_ram )      // sound RAM
463   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2)   // texture memory
464   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)   // mirror of texture RAM
577   AM_RANGE(0x00800000, 0x009fffff) AM_READWRITE( naomi_arm_r, naomi_arm_w ) // sound RAM
578   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w )    // bios uses it, actual start and end addresses not known
579   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )          // texture memory
580   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                     // mirror of texture RAM
465581   AM_RANGE(0x0c000000, 0x0cffffff) AM_RAM AM_SHARE(1)
466   AM_RANGE(0x0d000000, 0x0dffffff) AM_RAM AM_SHARE(1)   // mirror of main RAM
582   AM_RANGE(0x0d000000, 0x0dffffff) AM_RAM AM_SHARE(1)                     // mirror of main RAM
467583   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
468584   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
469   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)   // another mirror of texture memory
585   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)                     // another mirror of texture memory
470586   AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_REGION(REGION_CPU1, 0)
471587ADDRESS_MAP_END
472588
589READ32_HANDLER( test1 )
590{
591   return -1;
592}
593
473594static ADDRESS_MAP_START( dc_audio_map, ADDRESS_SPACE_PROGRAM, 32 )
474   AM_RANGE(0x00000000, 0x001fffff) AM_RAM      /* shared with SH-4 */
595   AM_RANGE(0x00000000, 0x001fffff) AM_RAM   AM_BASE( &dc_sound_ram )   /* shared with SH-4 */
596   AM_RANGE(0x00200000, 0x002000ff) AM_READ( test1 )   // for bug (?) in sound bios
597   AM_RANGE(0x00800000, 0x00807fff) AM_READWRITE( dc_aica_arm_r, dc_aica_arm_w )   /* shared with SH-4 */
475598ADDRESS_MAP_END
476599
477600static INPUT_PORTS_START( naomi )
601   PORT_START
602   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service")
603   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
478604INPUT_PORTS_END
479605
480606static MACHINE_DRIVER_START( naomi )
r1490r1491
482608   MDRV_CPU_ADD_TAG("main", SH4, CPU_CLOCK) // SH4!!!
483609   MDRV_CPU_CONFIG(sh4cpu_config)
484610   MDRV_CPU_PROGRAM_MAP(naomi_map,0)
611   MDRV_CPU_VBLANK_INT(naomi_vblank,479)
485612
486613   MDRV_CPU_ADD_TAG("sound", ARM7, 45000000)
487614   MDRV_CPU_PROGRAM_MAP(dc_audio_map, 0)
r1490r1491
494621   /* video hardware */
495622   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
496623   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
497   MDRV_SCREEN_SIZE(16*8, 16*8)
498   MDRV_SCREEN_VISIBLE_AREA(0, 16*8-1, 0, 16*8-1)
624   MDRV_SCREEN_SIZE(640, 480)
625   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
499626   MDRV_PALETTE_LENGTH(0x1000)
500627
501628   MDRV_VIDEO_START(dc)
r1490r1491
539666ROM_START( naomi )
540667   ROM_REGION( 0x200000, REGION_CPU1, 0)
541668   NAOMI_BIOS
669
670   ROM_REGION( 0x8400000, REGION_USER1, ROMREGION_ERASE)
542671ROM_END
543672
544673ROM_START( naomi2 )
545674   ROM_REGION( 0x200000, REGION_CPU1, 0)
546675   NAOMI2_BIOS
676
677   ROM_REGION( 0x8400000, REGION_USER1, ROMREGION_ERASE)
547678ROM_END
548679
549680ROM_START( awbios )
550681   ROM_REGION( 0x200000, REGION_CPU1, 0)
551682   AW_BIOS
683
684   ROM_REGION( 0x8400000, REGION_USER1, ROMREGION_ERASE)
552685ROM_END
553686
554687/* Info above each set is automatically generated from the IC22 rom and may not be accurate */
r1490r1491
661794IC5     64M     BB81    7E26     MPR23424.5
662795IC6     64M     B3A8    F2EA     MPR23425.6
663796IC7     64M     05C5    A084     MPR23426.7
664IC8     64M     9E13    7535     MPR23427.8
797?IC8     64M     9E13    7535     MPR23427.8
665798
666799Serial: BCHE-01A0803
667800
r1490r1491
671804   ROM_REGION( 0x200000, REGION_CPU1, 0)
672805   NAOMI_BIOS
673806
674   ROM_REGION( 0x400000, REGION_USER1, 0)
807   ROM_REGION( 0x4800000, REGION_USER1, ROMREGION_ERASE00)
675808   ROM_LOAD("epr23428a.22", 0x0000000, 0x400000, CRC(d628dbce) SHA1(91ec1296ead572a64c37f8ac2c1a96742f19d50b) )
676
677   ROM_REGION( 0x8000000, REGION_USER2, 0)
678   ROM_LOAD("mpr23420.1", 0x0000000, 0x0800000, CRC(9d5991f2) SHA1(c75871db314b01935d1daaacf1a762e73e5fd411) )
679   ROM_LOAD("mpr23421.2", 0x0800000, 0x0800000, CRC(6c351db3) SHA1(cdd601321a38fc34152517abdc473b73a4c6f630) )
680   ROM_LOAD("mpr23422.3", 0x1000000, 0x0800000, CRC(a1d4bd29) SHA1(6c446fd1819f55412351f15cf57b769c0c56c1db) )
681   ROM_LOAD("mpr23423.4", 0x1800000, 0x0800000, CRC(08cbf373) SHA1(0d9a593f5cc5d632d85d7253c135eef2e8e01598) )
682   ROM_LOAD("mpr23424.5", 0x2000000, 0x0800000, CRC(f4404000) SHA1(e49d941e47e63bb7f3fddc3c3d2c1653611914ee) )
683   ROM_LOAD("mpr23425.6", 0x2800000, 0x0800000, CRC(47f51da2) SHA1(af5ecd460114caed3a00157ffd3a2df0fbf348c0) )
684   ROM_LOAD("mpr23426.7", 0x3000000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) )
685   ROM_LOAD("mpr23427.8", 0x3800000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) )
809   ROM_RELOAD( 0x400000, 0x400000)
810   ROM_LOAD("mpr23420.1", 0x0800000, 0x0800000, CRC(9d5991f2) SHA1(c75871db314b01935d1daaacf1a762e73e5fd411) )
811   ROM_LOAD("mpr23421.2", 0x1000000, 0x0800000, CRC(6c351db3) SHA1(cdd601321a38fc34152517abdc473b73a4c6f630) )
812   ROM_LOAD("mpr23422.3", 0x1800000, 0x0800000, CRC(a1d4bd29) SHA1(6c446fd1819f55412351f15cf57b769c0c56c1db) )
813   ROM_LOAD("mpr23423.4", 0x2000000, 0x0800000, CRC(08cbf373) SHA1(0d9a593f5cc5d632d85d7253c135eef2e8e01598) )
814   ROM_LOAD("mpr23424.5", 0x2800000, 0x0800000, CRC(f4404000) SHA1(e49d941e47e63bb7f3fddc3c3d2c1653611914ee) )
815   ROM_LOAD("mpr23425.6", 0x3000000, 0x0800000, CRC(47f51da2) SHA1(af5ecd460114caed3a00157ffd3a2df0fbf348c0) )
816   ROM_LOAD("mpr23426.7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) )
817   ROM_LOAD("mpr23427.8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) )
686818ROM_END
687819
688820/*
r1490r1491
14821614   ROM_REGION( 0x200000, REGION_CPU1, 0)
14831615   NAOMI_BIOS
14841616
1485   ROM_REGION( 0x400000, REGION_USER1, 0)
1617   ROM_REGION( 0x8000000, REGION_USER1, 0)
14861618   ROM_LOAD("epr21929c.22", 0x0000000, 0x0400000,  CRC(b5e609f4) SHA1(92b98bad94268a80f6e4506b812d01c0a7850161) )
1487
1488   ROM_REGION( 0x7400000, REGION_USER2, 0)
1489   ROM_LOAD("mpr21914.u1", 0x0000000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
1490   ROM_LOAD("mpr21915.u2", 0x0800000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
1491   ROM_LOAD("mpr21916.u3", 0x1000000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
1492   ROM_LOAD("mpr21917.u4", 0x1800000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
1493   ROM_LOAD("mpr21918.u5", 0x2000000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
1494   ROM_LOAD("mpr21919.u6", 0x2800000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
1495   ROM_LOAD("mpr21920.u7", 0x3000000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
1496   ROM_LOAD("mpr21921.u8", 0x3800000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
1497   ROM_LOAD("mpr21922.u9", 0x4000000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
1498   ROM_LOAD("mpr21923.u10",0x4800000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
1499   ROM_LOAD("mpr21924.u11",0x5000000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
1500   ROM_LOAD("mpr21925.u12",0x5800000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
1501   ROM_LOAD("mpr21926.u13",0x6000000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
1502   ROM_LOAD("mpr21927.u14",0x6800000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
1503   ROM_LOAD("mpr21928.u15",0x7000000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
1619   ROM_LOAD("mpr21914.u1", 0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
1620   ROM_LOAD("mpr21915.u2", 0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
1621   ROM_LOAD("mpr21916.u3", 0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
1622   ROM_LOAD("mpr21917.u4", 0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
1623   ROM_LOAD("mpr21918.u5", 0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
1624   ROM_LOAD("mpr21919.u6", 0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
1625   ROM_LOAD("mpr21920.u7", 0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
1626   ROM_LOAD("mpr21921.u8", 0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
1627   ROM_LOAD("mpr21922.u9", 0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
1628   ROM_LOAD("mpr21923.u10",0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
1629   ROM_LOAD("mpr21924.u11",0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
1630   ROM_LOAD("mpr21925.u12",0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
1631   ROM_LOAD("mpr21926.u13",0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
1632   ROM_LOAD("mpr21927.u14",0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
1633   ROM_LOAD("mpr21928.u15",0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
15041634ROM_END
15051635
15061636ROM_START( vs2_2ka )
15071637   ROM_REGION( 0x200000, REGION_CPU1, 0)
15081638   NAOMI_BIOS
15091639
1510   ROM_REGION( 0x400000, REGION_USER1, 0)
1640   ROM_REGION( 0x8000000, REGION_USER1, 0)
15111641   ROM_LOAD("u22", 0x0000000, 0x0400000, CRC(831af08a) SHA1(af4c74623be823fd061765cede354c6a9722fd10) )
1512
1513   ROM_REGION( 0x7400000, REGION_USER2, 0)
1514   ROM_LOAD("mpr21914.u1", 0x0000000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
1515   ROM_LOAD("mpr21915.u2", 0x0800000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
1516   ROM_LOAD("mpr21916.u3", 0x1000000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
1517   ROM_LOAD("mpr21917.u4", 0x1800000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
1518   ROM_LOAD("mpr21918.u5", 0x2000000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
1519   ROM_LOAD("mpr21919.u6", 0x2800000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
1520   ROM_LOAD("mpr21920.u7", 0x3000000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
1521   ROM_LOAD("mpr21921.u8", 0x3800000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
1522   ROM_LOAD("mpr21922.u9", 0x4000000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
1523   ROM_LOAD("mpr21923.u10",0x4800000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
1524   ROM_LOAD("mpr21924.u11",0x5000000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
1525   ROM_LOAD("mpr21925.u12",0x5800000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
1526   ROM_LOAD("mpr21926.u13",0x6000000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
1527   ROM_LOAD("mpr21927.u14",0x6800000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
1528   ROM_LOAD("mpr21928.u15",0x7000000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
1642   ROM_LOAD("mpr21914.u1", 0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
1643   ROM_LOAD("mpr21915.u2", 0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
1644   ROM_LOAD("mpr21916.u3", 0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
1645   ROM_LOAD("mpr21917.u4", 0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
1646   ROM_LOAD("mpr21918.u5", 0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
1647   ROM_LOAD("mpr21919.u6", 0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
1648   ROM_LOAD("mpr21920.u7", 0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
1649   ROM_LOAD("mpr21921.u8", 0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
1650   ROM_LOAD("mpr21922.u9", 0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
1651   ROM_LOAD("mpr21923.u10",0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
1652   ROM_LOAD("mpr21924.u11",0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
1653   ROM_LOAD("mpr21925.u12",0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
1654   ROM_LOAD("mpr21926.u13",0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
1655   ROM_LOAD("mpr21927.u14",0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
1656   ROM_LOAD("mpr21928.u15",0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
15291657ROM_END
15301658
15311659/*
src/mame/drivers/bnstars.c
r1490r1491
11751175
11761176
11771177/* sprites are contained in 256x256 "tiles" */
1178static const gfx_layout spritelayout =
1179{
1180   256,256,
1181   RGN_FRAC(1,1),
1182   8,
1183   { GFX_RAW },
1184   { 0 },      /* org displacement */
1185   { 256*8 },   /* line modulo */
1186   256*256*8   /* char modulo */
1187};
1178static GFXLAYOUT_RAW( spritelayout, 8, 256, 256, 256*8, 256*256*8 )
1179static GFXLAYOUT_RAW( bglayout, 8, 16, 16, 16*8, 16*16*8 )
1180static GFXLAYOUT_RAW( txlayout, 8, 8, 8, 8*8, 8*8*8 )
11881181
1189static const gfx_layout bglayout =
1190{
1191   16,16,
1192   RGN_FRAC(1,1),
1193   8,
1194   { GFX_RAW },
1195   { 0 },      /* org displacement */
1196   { 16*8 },   /* line modulo */
1197   16*16*8      /* char modulo */
1198};
1199
1200
1201static const gfx_layout txlayout =
1202{
1203   8,8,
1204   RGN_FRAC(1,1),
1205   8,
1206   { GFX_RAW },
1207   { 0 },      /* org displacement */
1208   { 8*8 },   /* line modulo */
1209   8*8*8      /* char modulo */
1210};
1211
12121182static GFXDECODE_START( bnstars )
12131183   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout, 0x0000, 0x10 )
12141184   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,     0x5000, 0x10 ) /* Roz scr1 */
src/mame/drivers/bking2.c
r1490r1491
10109000-97ff Playfield RAM
1111a000-bfff Unused?
1212
13
14NOTE:
15ROM DM03 is missing from all known ROM sets.  This is a color palette.
16* is this note out of date?, DM_03.d1 in bking.zip = 82s141.2d in bking2.zip
17
1813***************************************************************************/
1914
2015#include "driver.h"
16#include "cpu/m6805/m6805.h"
2117#include "sound/ay8910.h"
2218#include "sound/dac.h"
2319
24PALETTE_INIT( bking2 );
2520
26VIDEO_START( bking2 );
27VIDEO_UPDATE( bking2 );
28VIDEO_EOF( bking2 );
21/* bking3 mcu communication */
22extern MACHINE_RESET( buggychl );
23extern READ8_HANDLER( buggychl_68705_portA_r );
24extern WRITE8_HANDLER( buggychl_68705_portA_w );
25extern WRITE8_HANDLER( buggychl_68705_ddrA_w );
26extern READ8_HANDLER( buggychl_68705_portB_r );
27extern WRITE8_HANDLER( buggychl_68705_portB_w );
28extern WRITE8_HANDLER( buggychl_68705_ddrB_w );
29extern READ8_HANDLER( buggychl_68705_portC_r );
30extern WRITE8_HANDLER( buggychl_68705_portC_w );
31extern WRITE8_HANDLER( buggychl_68705_ddrC_w );
32extern WRITE8_HANDLER( buggychl_mcu_w );
33extern READ8_HANDLER( buggychl_mcu_r );
34extern READ8_HANDLER( buggychl_mcu_status_r );
2935
30WRITE8_HANDLER( bking2_xld1_w );
31WRITE8_HANDLER( bking2_yld1_w );
32WRITE8_HANDLER( bking2_xld2_w );
33WRITE8_HANDLER( bking2_yld2_w );
34WRITE8_HANDLER( bking2_xld3_w );
35WRITE8_HANDLER( bking2_yld3_w );
36WRITE8_HANDLER( bking2_msk_w );
37WRITE8_HANDLER( bking2_cont1_w );
38WRITE8_HANDLER( bking2_cont2_w );
39WRITE8_HANDLER( bking2_cont3_w );
40WRITE8_HANDLER( bking2_hitclr_w );
41WRITE8_HANDLER( bking2_playfield_w );
36extern PALETTE_INIT( bking2 );
4237
43READ8_HANDLER( bking2_input_port_5_r );
44READ8_HANDLER( bking2_input_port_6_r );
45READ8_HANDLER( bking2_pos_r );
38extern VIDEO_START( bking2 );
39extern VIDEO_UPDATE( bking2 );
40extern VIDEO_EOF( bking2 );
4641
47UINT8* bking2_playfield_ram;
42extern WRITE8_HANDLER( bking2_xld1_w );
43extern WRITE8_HANDLER( bking2_yld1_w );
44extern WRITE8_HANDLER( bking2_xld2_w );
45extern WRITE8_HANDLER( bking2_yld2_w );
46extern WRITE8_HANDLER( bking2_xld3_w );
47extern WRITE8_HANDLER( bking2_yld3_w );
48extern WRITE8_HANDLER( bking2_msk_w );
49extern WRITE8_HANDLER( bking2_cont1_w );
50extern WRITE8_HANDLER( bking2_cont2_w );
51extern WRITE8_HANDLER( bking2_cont3_w );
52extern WRITE8_HANDLER( bking2_hitclr_w );
53extern WRITE8_HANDLER( bking2_playfield_w );
4854
55extern READ8_HANDLER( bking2_input_port_5_r );
56extern READ8_HANDLER( bking2_input_port_6_r );
57extern READ8_HANDLER( bking2_pos_r );
4958
59UINT8 *bking2_playfield_ram;
60
61static int bking3_addr_h, bking3_addr_l;
5062static int sndnmi_enable = 1;
5163
5264static READ8_HANDLER( bking2_sndnmi_disable_r )
r1490r1491
7284   if (sndnmi_enable) cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
7385}
7486
75
76static int bk3_l, bk3_h;
77
78static WRITE8_HANDLER( bk3_l_w)
87static WRITE8_HANDLER( bking3_addr_l_w )
7988{
80   bk3_l = data;
89   bking3_addr_l = data;
8190}
8291
83static WRITE8_HANDLER( bk3_h_w)
92static WRITE8_HANDLER( bking3_addr_h_w )
8493{
85   bk3_h = data;
94   bking3_addr_h = data;
8695}
8796
88static READ8_HANDLER( bk3_r )
97static READ8_HANDLER( bking3_extrarom_r )
8998{
9099   UINT8 *rom = memory_region(REGION_USER2);
91   return rom[bk3_h*256+bk3_l];
100   return rom[bking3_addr_h * 256 + bking3_addr_l];
92101}
93102
94103static WRITE8_HANDLER( unk_w )
r1490r1491
99108*/
100109}
101110
102static READ8_HANDLER( mcu_status_r )
111static READ8_HANDLER( bking3_ext_check_r )
103112{
104   static int res = 3;
105
106   return res;//cpu data / MCU ready
107}
108
109
110/*
111Birdie King 3 MCU simulation
112Nothing really special to report,just the typical protection HW test and another
113protection routine with 0x30 command when the player have to shot on the green.
114
115Todo:
116\-How to handle the reads at port($6f)?
117\-In-depth game untested.
118*/
119static UINT8 mcu_val;
120
121static WRITE8_HANDLER( mcu_data_w )
122{
123#ifdef MAME_DEBUG
124   logerror("mcu_data_w = %x\n",data);
125#endif
126   mcu_val = data;
127   /* HW test */
128   /* all bits of port ($02) except the MSB are connected to the command,
129       in all cases it should return 0x5e.This one is here to avoid to get a big
130       switch-case statement in the mcu_data_r function... */
131   if(mcu_val >= 0x80)
132      mcu_val = 0x5e;
133}
134
135static READ8_HANDLER( mcu_data_r )
136{
137//  popmessage("MCU-r1 PC = %04x %02x",activecpu_get_pc(),mcu_val);
138   switch(mcu_val)
139   {
140      /* Shot counter control at the green (check $bdf and afterwards in that condition)*/
141      case 0x30: return (mcu_val-0x1e);
142      default:   return (mcu_val);
143   }
144}
145
146static READ8_HANDLER( mcu_data_r2 )
147{
148//  popmessage("MCU-r2 PC = %04x %02x",activecpu_get_pc(),mcu_val);
149113   return 0x31; //no "bad rom.", no "bad ext."
150114}
151115
152static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
153   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
154   AM_RANGE(0x8000, 0x83ff) AM_READ(MRA8_RAM)
155   AM_RANGE(0x9000, 0x97ff) AM_READ(MRA8_RAM)
116static ADDRESS_MAP_START( bking2_map, ADDRESS_SPACE_PROGRAM, 8 )
117   AM_RANGE(0x0000, 0x7fff) AM_ROM
118   AM_RANGE(0x8000, 0x83ff) AM_RAM
119   AM_RANGE(0x9000, 0x97ff) AM_RAM AM_WRITE(bking2_playfield_w) AM_BASE(&bking2_playfield_ram)
156120ADDRESS_MAP_END
157121
158static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
159   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
160   AM_RANGE(0x8000, 0x83ff) AM_WRITE(MWA8_RAM)
161   AM_RANGE(0x9000, 0x97ff) AM_WRITE(bking2_playfield_w) AM_BASE(&bking2_playfield_ram)
162ADDRESS_MAP_END
163
164static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
122static ADDRESS_MAP_START( bking2_io_map, ADDRESS_SPACE_IO, 8 )
165123   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
166   AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r)
167   AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r)
168   AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r)
169   AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r)
170   AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r)
171   AM_RANGE(0x05, 0x05) AM_READ(bking2_input_port_5_r)
172   AM_RANGE(0x06, 0x06) AM_READ(bking2_input_port_6_r)
124   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, bking2_xld1_w)
125   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, bking2_yld1_w)
126   AM_RANGE(0x02, 0x02) AM_READWRITE(input_port_2_r, bking2_xld2_w)
127   AM_RANGE(0x03, 0x03) AM_READWRITE(input_port_3_r, bking2_yld2_w)
128   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_4_r, bking2_xld3_w)
129   AM_RANGE(0x05, 0x05) AM_READWRITE(bking2_input_port_5_r, bking2_yld3_w)
130   AM_RANGE(0x06, 0x06) AM_READWRITE(bking2_input_port_6_r, bking2_msk_w)
131   AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
132   AM_RANGE(0x08, 0x08) AM_WRITE(bking2_cont1_w)
133   AM_RANGE(0x09, 0x09) AM_WRITE(bking2_cont2_w)
134   AM_RANGE(0x0a, 0x0a) AM_WRITE(bking2_cont3_w)
135   AM_RANGE(0x0b, 0x0b) AM_WRITE(bking2_soundlatch_w)
136//  AM_RANGE(0x0c, 0x0c) AM_WRITE(bking2_eport2_w)   this is not shown to be connected anywhere
137   AM_RANGE(0x0d, 0x0d) AM_WRITE(bking2_hitclr_w)
173138   AM_RANGE(0x07, 0x1f) AM_READ(bking2_pos_r)
174
175   AM_RANGE(0x2f, 0x2f) AM_READ(mcu_data_r)
176   AM_RANGE(0x4f, 0x4f) AM_READ(mcu_status_r)
177   AM_RANGE(0x60, 0x60) AM_READ(bk3_r)
178   AM_RANGE(0x6f, 0x6f) AM_READ(mcu_data_r2)
179139ADDRESS_MAP_END
180140
181static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
141static ADDRESS_MAP_START( bking3_io_map, ADDRESS_SPACE_IO, 8 )
182142   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
183   AM_RANGE(0x00, 0x00) AM_WRITE(bking2_xld1_w)
184   AM_RANGE(0x01, 0x01) AM_WRITE(bking2_yld1_w)
185   AM_RANGE(0x02, 0x02) AM_WRITE(bking2_xld2_w)
186   AM_RANGE(0x03, 0x03) AM_WRITE(bking2_yld2_w)
187   AM_RANGE(0x04, 0x04) AM_WRITE(bking2_xld3_w)
188   AM_RANGE(0x05, 0x05) AM_WRITE(bking2_yld3_w)
189   AM_RANGE(0x06, 0x06) AM_WRITE(bking2_msk_w)
143   AM_RANGE(0x00, 0x00) AM_READWRITE(input_port_0_r, bking2_xld1_w)
144   AM_RANGE(0x01, 0x01) AM_READWRITE(input_port_1_r, bking2_yld1_w)
145   AM_RANGE(0x02, 0x02) AM_READWRITE(input_port_2_r, bking2_xld2_w)
146   AM_RANGE(0x03, 0x03) AM_READWRITE(input_port_3_r, bking2_yld2_w)
147   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_4_r, bking2_xld3_w)
148   AM_RANGE(0x05, 0x05) AM_READWRITE(bking2_input_port_5_r, bking2_yld3_w)
149   AM_RANGE(0x06, 0x06) AM_READWRITE(bking2_input_port_6_r, bking2_msk_w)
190150   AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
191151   AM_RANGE(0x08, 0x08) AM_WRITE(bking2_cont1_w)
192152   AM_RANGE(0x09, 0x09) AM_WRITE(bking2_cont2_w)
r1490r1491
194154   AM_RANGE(0x0b, 0x0b) AM_WRITE(bking2_soundlatch_w)
195155//  AM_RANGE(0x0c, 0x0c) AM_WRITE(bking2_eport2_w)   this is not shown to be connected anywhere
196156   AM_RANGE(0x0d, 0x0d) AM_WRITE(bking2_hitclr_w)
197
198   AM_RANGE(0x2f, 0x2f) AM_WRITE(mcu_data_w)
199   AM_RANGE(0x4f, 0x4f) AM_WRITE(unk_w)
200   AM_RANGE(0x6f, 0x6f) AM_WRITE(bk3_h_w)
201   AM_RANGE(0x8f, 0x8f) AM_WRITE(bk3_l_w)
157   AM_RANGE(0x07, 0x1f) AM_READ(bking2_pos_r)
158   AM_RANGE(0x2f, 0x2f) AM_READWRITE(buggychl_mcu_r, buggychl_mcu_w)
159   AM_RANGE(0x4f, 0x4f) AM_READWRITE(buggychl_mcu_status_r, unk_w)
160   AM_RANGE(0x60, 0x60) AM_READ(bking3_extrarom_r)
161   AM_RANGE(0x6f, 0x6f) AM_READWRITE(bking3_ext_check_r, bking3_addr_h_w)
162   AM_RANGE(0x8f, 0x8f) AM_WRITE(bking3_addr_l_w)
202163ADDRESS_MAP_END
203164
204static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
205   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM)
206   AM_RANGE(0x2000, 0x2fff) AM_READ(MRA8_ROM) //only bking3
207   AM_RANGE(0x4000, 0x43ff) AM_READ(MRA8_RAM)
208   AM_RANGE(0x4401, 0x4401) AM_READ(AY8910_read_port_0_r)
209   AM_RANGE(0x4403, 0x4403) AM_READ(AY8910_read_port_1_r)
165static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
166   AM_RANGE(0x0000, 0x1fff) AM_ROM
167   AM_RANGE(0x2000, 0x2fff) AM_ROM //only bking3
168   AM_RANGE(0x4000, 0x43ff) AM_RAM
169   AM_RANGE(0x4400, 0x4400) AM_WRITE(AY8910_control_port_0_w)
170   AM_RANGE(0x4401, 0x4401) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
171   AM_RANGE(0x4402, 0x4402) AM_WRITE(AY8910_control_port_1_w)
172   AM_RANGE(0x4403, 0x4403) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
210173   AM_RANGE(0x4800, 0x4800) AM_READ(soundlatch_r)
211   AM_RANGE(0x4802, 0x4802) AM_READ(bking2_sndnmi_disable_r)
212   AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_ROM)   /* space for some other ROM???
213                                      It's checked if there is valid code there
214                                      [Probably diagnostic ROM like other early Taito games -AS]*/
174   AM_RANGE(0x4802, 0x4802) AM_READWRITE(bking2_sndnmi_disable_r, bking2_sndnmi_enable_w)
175   AM_RANGE(0xe000, 0xefff) AM_ROM   /* Space for diagnostic ROM */
215176ADDRESS_MAP_END
216177
217static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
218   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM)
219   AM_RANGE(0x2000, 0x2fff) AM_WRITE(MWA8_ROM) //only bking3
220   AM_RANGE(0x4000, 0x43ff) AM_WRITE(MWA8_RAM)
221   AM_RANGE(0x4400, 0x4400) AM_WRITE(AY8910_control_port_0_w)
222   AM_RANGE(0x4401, 0x4401) AM_WRITE(AY8910_write_port_0_w)
223   AM_RANGE(0x4402, 0x4402) AM_WRITE(AY8910_control_port_1_w)
224   AM_RANGE(0x4403, 0x4403) AM_WRITE(AY8910_write_port_1_w)
225   AM_RANGE(0x4802, 0x4802) AM_WRITE(bking2_sndnmi_enable_w)
178#if 0
179static UINT8 portA_in,portA_out,ddrA;
180
181static READ8_HANDLER( bking3_68705_portA_r )
182{
183   //printf("portA_r = %02X\n",(portA_out & ddrA) | (portA_in & ~ddrA));
184   return (portA_out & ddrA) | (portA_in & ~ddrA);
185}
186
187static WRITE8_HANDLER( bking3_68705_portA_w )
188{
189   portA_out = data;
190//  printf("portA_out = %02X\n",data);
191}
192
193static WRITE8_HANDLER( bking3_68705_ddrA_w )
194{
195   ddrA = data;
196}
197
198static UINT8 portB_in,portB_out,ddrB;
199
200static READ8_HANDLER( bking3_68705_portB_r )
201{
202   return (portB_out & ddrB) | (portB_in & ~ddrB);
203}
204
205static WRITE8_HANDLER( bking3_68705_portB_w )
206{
207//  if(data != 0xff)
208//      printf("portB_out = %02X\n",data);
209
210   if (~data & 0x02)
211   {
212      portA_in = from_main;
213      if (main_sent) cpunum_set_input_line(2,0,CLEAR_LINE);
214      main_sent = 0;
215   }
216
217   if (~data & 0x04)
218   {
219      /* 68705 is writing data for the Z80 */
220      from_mcu = portA_out;
221      mcu_sent = 1;
222   }
223
224   if(data != 0xff && data != 0xfb && data != 0xfd)
225      printf("portB_w = %X\n",data);
226
227   portB_out = data;
228}
229
230static WRITE8_HANDLER( bking3_68705_ddrB_w )
231{
232   ddrB = data;
233}
234
235static READ8_HANDLER( bking3_68705_portC_r )
236{
237   int portC_in = 0;
238   if (main_sent) portC_in |= 0x01;
239   if (!mcu_sent) portC_in |= 0x02;
240//logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in);
241   return portC_in;
242}
243#endif
244static ADDRESS_MAP_START( m68705_map, ADDRESS_SPACE_PROGRAM, 8 )
245   ADDRESS_MAP_FLAGS( AMEF_ABITS(11) )
246   AM_RANGE(0x0000, 0x0000) AM_READWRITE(buggychl_68705_portA_r, buggychl_68705_portA_w)
247   AM_RANGE(0x0001, 0x0001) AM_READWRITE(buggychl_68705_portB_r, buggychl_68705_portB_w)
248   AM_RANGE(0x0002, 0x0002) AM_READWRITE(buggychl_68705_portC_r, buggychl_68705_portC_w)
249   AM_RANGE(0x0004, 0x0004) AM_WRITE(buggychl_68705_ddrA_w)
250   AM_RANGE(0x0005, 0x0005) AM_WRITE(buggychl_68705_ddrB_w)
251   AM_RANGE(0x0006, 0x0006) AM_WRITE(buggychl_68705_ddrC_w)
252   AM_RANGE(0x0010, 0x007f) AM_RAM
253   AM_RANGE(0x0080, 0x07ff) AM_ROM
226254ADDRESS_MAP_END
227255
228256static INPUT_PORTS_START( bking )
r1490r1491
519547static MACHINE_DRIVER_START( bking2 )
520548
521549   /* basic machine hardware */
522   MDRV_CPU_ADD(Z80, 4000000)   /* 4 MHz */
523   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
524   MDRV_CPU_IO_MAP(readport,writeport)
550   MDRV_CPU_ADD_TAG("main_cpu", Z80, XTAL_12MHz/4)   /* 3 MHz */
551   MDRV_CPU_PROGRAM_MAP(bking2_map,0)
552   MDRV_CPU_IO_MAP(bking2_io_map,0)
525553   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
526554
527   MDRV_CPU_ADD(Z80, 3000000)   /* 3 MHz */
555   MDRV_CPU_ADD(Z80, XTAL_6MHz/2)   /* 3 MHz */
528556   /* audio CPU */
529   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
557   MDRV_CPU_PROGRAM_MAP(sound_map,0)
530558         /* interrupts (from Jungle King hardware, might be wrong): */
531559         /* - no interrupts synced with vblank */
532560         /* - NMI triggered by the main CPU */
r1490r1491
553581   /* sound hardware */
554582   MDRV_SPEAKER_STANDARD_MONO("mono")
555583
556   MDRV_SOUND_ADD(AY8910, 2000000)
584   MDRV_SOUND_ADD(AY8910, XTAL_6MHz/4)
557585   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
558586
559   MDRV_SOUND_ADD(AY8910, 2000000)
587   MDRV_SOUND_ADD(AY8910, XTAL_6MHz/4)
560588   MDRV_SOUND_CONFIG(ay8910_interface)
561589   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
562590
r1490r1491
564592   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
565593MACHINE_DRIVER_END
566594
595static MACHINE_DRIVER_START( bking3 )
596   MDRV_IMPORT_FROM(bking2)
597
598   MDRV_CPU_MODIFY("main_cpu")
599   MDRV_CPU_IO_MAP(bking3_io_map,0)
600
601   MDRV_CPU_ADD(M68705, XTAL_3MHz/M68705_CLOCK_DIVIDER)      /* xtal is 3MHz, divided by 4 internally */
602   MDRV_CPU_PROGRAM_MAP(m68705_map,0)
603
604   MDRV_MACHINE_RESET(buggychl)
605
606   MDRV_INTERLEAVE(100)
607MACHINE_DRIVER_END
608
567609/***************************************************************************
568610
569611  Game driver(s)
r1490r1491
651693   ROM_LOAD( "pal16l8.3",  0x0400, 0x0104, CRC(a609d0cf) SHA1(7a18040720646c2dff4c1dc6f272c6a69e538c47) )
652694ROM_END
653695
696/*
697Birdie King 3
698Taito, 1984
699
700A golf game using a trackball. Uses same harness/pinout as
701Elevator Action, Victorious Nine, Jolly Jogger (etc)
702
703PCB Layouts
704(Note! There are no PALs on ANY of the PCBs)
705
706Top PCB
707-------
708DMO70003A
709K1000173B (sticker)
710 |------------------------|
711 |                        |
712|-|                       |
713| |  Z80        2114      |
714| |             2114      |
715| |N                      |
716| |  A24_18.4F            |
717| |      A24_19.4D        |
718|-|           A24_20.4B   |
719 |                        |
720 |  AY3-8910              |
721 |                        |
722 |      AY3-8910          |
723 |                        |
724 |                        |
725 |                   6MHz |
726 |                        |
727 |                        |
728 |                        |
729 | LM3900  LM3900  LM3900 |
730 |------------------------|
731Notes:
732      Z80      - Clock 3.000MHz [6/2]
733      AY3-8910 - Clock 1.500MHz [6/4]
734      2114     - 1kx4 SRAM (DIP18)
735      N        - Flat cable connector, joins to main board
736      LM3900   - National LM3900 Quad, dual-input amplifier IC (DIP14)
737      plus many resistors/capacitors below the AY3-8910's
738
739
740Sub PCB (below Top PCB)
741-----------------------
742SUB PCB J910 0010 A
743        K910 0018 A
744|------------------------|
745|           *            |
746|                        |
747|                        |
748|                        |
749|                        |
750|                        |
751|                        |
752|                        |
753|                        |
754|                        |
755|                        |
756|                        |
757|                        |
758|A24_21.IC25             |
759|                        |
760|                   S2   |
761|                        |
762|         3MHz         S1|
763|T    A24_22.IC17        |
764|------------------------|
765Notes:
766      A24_22.IC17 - Motorola 68705P5 Microcontroller, clock 3.000MHz
767      A24_21.IC25 - 2732 EPROM
768      *           - DIP24 socket with flat cable below PCB, joins to main board
769      T           - 4-pin power connector (5 volts) coming from main board
770      S1          - Flat cable connector, joins to main PCB to connector S
771      S2          - Flat cable connector, joins to bottom PCB to connector S
772
773
774
775Main PCB
776--------
777J1100001A
778K1100001A
779M4300001D (sticker)
780K1100032A (sticker)
781|--------------------------------------------------------------|
782|      M3712    VOL             A24_03.2D             M53354   |
783|H                                        DM-04.2C            |-|
784|                     N                                  *    | |
785|           MC14584                                          R| |
786|                                                             | |
787|                                                             | |
788|                                                             | |
789|                                                             |-|
790|                                                              |
791|G          LM3900                                             |
792|    MC14093                                                   |
793|                   A24_01.7E                                 |-|
794|                                                             | |
795|                   A24_01.9E                                 | |
796|    MC14584                                                 S| |
797|                   A24_02.10E                                | |
798|    MC14584                    MC1455                        | |
799|                                                             |-|
800|    DSWC   DSWB   DSWA                                        |
801|--------------------------------------------------------------|
802Notes:
803      M53354    - ?, maybe 74LS154? (DIP24)
804      MC1455    - Motorola MC1455 Monolithic Timing Circuit (NE555 compatible)
805      A24_01/02 - 2716 EPROMs
806      A24_03    - Signetics 82S141 PROM (DIP24)
807      DM-04     - Signetics 82S123 PROM (DIP8)
808      *         - DIP24 socket with flat cable, joins to SUB PCB DIP24 socket
809      R/S       - Flat cable connector, R joins to main board, S joins to SUB PCB
810      G         - 22-way Edge Connector
811      N         - Flat cable connector, joins to TOP PCB
812      H         - 12-pin power connector
813      VSync     - 60Hz
814      HSync     - 15.67kHz
815
816
817Bottom PCB
818----------
819DMO70002A
820DMN00002A
821K1000172B (sticker)
822|--------------------------------------------------------------|
823|   A24_17.13A         2114    Z80             A24_04.13F      |
824|                                                             |-|
825|   A24_16.11A         2114                    A24_05.11F     | |
826|                                                            S| |
827|   A24_15.10A                                 A24_06.10F     | |
828|                                                             | |
829|   A24_14.8A                                  A24_07.8F      | |
830|                                                             |-|
831|T  A24_13.7A                                  A24_08.7F       |
832|                                                              |
833|   A24_12.5A                                  A24_09.5F       |
834|                                                             |-|
835|                                              A24_10.4F      | |
836|            2114                                             | |
837|                                              A24_11.2F     R| |
838|            2114                                             | |
839|                                                             | |
840|            2114                                             |-|
841|                                                    12MHz     |
842|--------------------------------------------------------------|
843Notes:
844      R/S   - Flat cable connector, R joins to main board, S joins to SUB PCB
845      T     - 18-Way Edge Connector (for +5V/GND only)
846      A24_* - 2732 EPROMs
847      Z80   - Clock 3.000MHz [12/4]
848      2114  - 1kx4 SRAM (DIP18)
849*/
850
654851ROM_START( bking3 )
655852   ROM_REGION( 0x10000, REGION_CPU1, 0 )
656853   ROM_LOAD( "a24-04.13f",   0x0000, 0x1000, CRC(a0c319a6) SHA1(6b79667288113fde43975fcfd05e93d8e45bf92d) )
r1490r1491
668865   ROM_LOAD( "a24-20.4b",    0x2000, 0x1000, CRC(0e9e16d6) SHA1(43c69602a8d9c34c527ce54472db84168acc4ef4) )
669866
670867   ROM_REGION( 0x0800, REGION_CPU3, 0 )   /* 2k for the microcontroller */
671   ROM_LOAD( "a24_22",    0x0000, 0x0800, NO_DUMP ) //M68705P5S uC 3MHz xtal
868   ROM_LOAD( "a24_22.ic17",  0x000000, 0x000800, CRC(27c497d5) SHA1(c6c72bbf0537da53148fa0a56d412ab46129d29c) ) //M68705P5S uC 3MHz xtal
672869
673870   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE ) /* Tiles */
674871   ROM_LOAD( "a24-12.5a",    0x0000, 0x1000, CRC(c5fe4817) SHA1(fbf82d9d85e18b76c7e939932df074a545e73f42) )
r1490r1491
691888   ROM_LOAD( "82s123.2c",    0x0000, 0x0020, CRC(4cb5bd32) SHA1(8851bae033ba67516d5ff6888e5daef10c2116ee) ) /* collision detection */
692889
693890   ROM_REGION( 0x0200, REGION_PROMS, 0 )
694   ROM_LOAD( "82s141.2d",    0x0000, 0x0200, CRC(61b7a9ff) SHA1(4302de0c0dad2b871ad4719ad934beaee05a0c40) )   /* palette */
891   ROM_LOAD( "a24_03.2d",    0x0000, 0x0200, CRC(61b7a9ff) SHA1(4302de0c0dad2b871ad4719ad934beaee05a0c40) )   /* palette */
695892
696893   ROM_REGION( 0x1000, REGION_USER2, 0 )
697894   ROM_LOAD( "a24-21.25",    0x0000, 0x1000, CRC(3106fcac) SHA1(08454adfb58e5df84140d86ed52fa4ef684df9f1) ) /* extra rom on the same SUB PCB where is the mcu */
698
699//missing?
700//"a24_03"  A24_03 - TI TBP28S46N - Not read
701//"a24_04"  A24_04 - Bipolar PROM - Not read
702
703895ROM_END
704896
705897GAME( 1982, bking,  0, bking2, bking,  0, ROT270, "Taito Corporation", "Birdie King", 0 )
706898GAME( 1983, bking2, 0, bking2, bking2, 0, ROT90,  "Taito Corporation", "Birdie King 2", 0 )
707GAME( 1984, bking3, 0, bking2, bking2, 0, ROT90,  "Taito Corporation", "Birdie King 3", 0 )
899GAME( 1984, bking3, 0, bking3, bking2, 0, ROT90,  "Taito Corporation", "Birdie King 3", GAME_WRONG_COLORS )
src/mame/drivers/namcos1.c
r1490r1491
12971297   ROM_LOAD_HS( "ds1_o4.bin",      0x80000, 0x10000, CRC(a6246fcb) SHA1(39de4fdb175ab16b791cdc5d757ff7bfee8e3d2b) )
12981298ROM_END
12991299
1300/* Dragon Spirit (Atari license) */
1301ROM_START( dspirita )
1302   ROM_REGION( 0x2c000, REGION_CPU3, 0 )       /* 176k for the sound cpu */
1303   ROM_LOAD( "ds1_s0.bin",         0x0c000, 0x10000, CRC(27100065) SHA1(e8fbacaa43a5b858fce2ca3b579b90c1e016396b) )
1304   ROM_LOAD( "ds1_s1.bin",         0x1c000, 0x10000, CRC(b398645f) SHA1(e83208e2aea7b57b4a26f123a43c112e30495aca) )
1305
1306   ROM_REGION( 0x400000, REGION_USER1, 0 ) /* 4M for ROMs */
1307   ROM_LOAD_512( "ds1_p0.bin",      0x000000, CRC(b22a2856) SHA1(8dea168e341460757c924bb510df4d4e9cdd908d) )
1308   ROM_LOAD_512( "ds1_p1.bin",      0x080000, CRC(f7e3298a) SHA1(76c924ed1311e7e292bd67f57c1e831054625bb6) )
1309   ROM_LOAD_512( "ds1_p2.bin",      0x100000, CRC(3c9b0100) SHA1(1def48a28b68e1e36cd1a165eb7127b05982c54d) )
1310   ROM_LOAD_512( "ds1_p3.bin",      0x180000, CRC(c6e5954b) SHA1(586fc108f264e91a4bbbb05153dd1aa19be81b5b) )
1311   ROM_LOAD_512( "ds1_p4.bin",      0x200000, CRC(f3307870) SHA1(a85d28c5dc55cbfa6c384d71e724db44c547d976) )
1312   ROM_LOAD_512( "ds1_p5.bin",      0x280000, CRC(9a3a1028) SHA1(505808834677c433e0a4cfbf387b2874e2d0fc47) )
1313   ROM_LOAD_512( "8722-1107.bin",   0x300000, CRC(5382447d) SHA1(3034d3a57b493c86673ee0aa7172bae778edd76a) )
1314   ROM_LOAD_512( "8722-1108.bin",   0x380000, CRC(80ff492a) SHA1(716ff7444edc0dfcce0fda2d213feb183435471f) )
1315
1316   ROM_REGION( 0xd0000, REGION_CPU4, 0 )       /* the MCU & voice */
1317   ROM_LOAD( "cus64-64a1.mcu",     0x0f000, 0x01000, CRC(ffb5c0bd) SHA1(7a38c0cc2553c627f4ec507fb6e807cf7d537c02) ) /* internal 63701 MCU code */
1318   ROM_LOAD_HS( "ds1_v0.bin",      0x10000, 0x10000, CRC(313b3508) SHA1(4770fb28b45abc4967534face0bf6794d30df71a) )
1319   ROM_LOAD( "ds_voi-1.bin",       0x30000, 0x20000, CRC(54790d4e) SHA1(d327b1c65c487dd691389920789c59f0eb1ecee1) )
1320   ROM_LOAD( "ds_voi-2.bin",       0x50000, 0x20000, CRC(05298534) SHA1(5ffd9018a5c1d5ce992dd3c7575b5e25945f14fa) )
1321   ROM_LOAD( "ds_voi-3.bin",       0x70000, 0x20000, CRC(13e84c7e) SHA1(6ad0eb50eb3312f614a891ae8d66faca6b48d204) )
1322   ROM_LOAD( "ds_voi-4.bin",       0x90000, 0x20000, CRC(34fbb8cd) SHA1(3f56f136e9d54d45924802f7149bfbc319e0933a) )
1323
1324   ROM_REGION( 0x20000, REGION_GFX1, 0 )  /* character mask */
1325   ROM_LOAD( "ds_chr-8.bin",       0x00000, 0x20000, CRC(946eb242) SHA1(6964fff430fe306c575ff07e4c054c70aa7d96ca) )
1326
1327   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE ) /* characters */
1328   ROM_LOAD( "ds_chr-0.bin",       0x00000, 0x20000, CRC(7bf28ac3) SHA1(af42b568be0c3919dbbc0e0c7a9d5ea39f84481a) )
1329   ROM_LOAD( "ds_chr-1.bin",       0x20000, 0x20000, CRC(03582fea) SHA1(c6705702bdb55ec6f993fc2582f116a8729c14d0) )
1330   ROM_LOAD( "ds_chr-2.bin",       0x40000, 0x20000, CRC(5e05f4f9) SHA1(ededa62c261ca75fc5e79c80840fc15b27cb3989) )
1331   ROM_LOAD( "ds_chr-3.bin",       0x60000, 0x20000, CRC(dc540791) SHA1(02c5c44bae878b22608cc6f9b09b0dd97c03e51a) )
1332   ROM_LOAD( "ds_chr-4.bin",       0x80000, 0x20000, CRC(ffd1f35c) SHA1(39f19676edc01059dfcee6b5c04527da3ef78ffa) )
1333   ROM_LOAD( "ds_chr-5.bin",       0xa0000, 0x20000, CRC(8472e0a3) SHA1(cece9fec70421fb09107890f108fb47ea770890d) )
1334   ROM_LOAD( "ds_chr-6.bin",       0xc0000, 0x20000, CRC(a799665a) SHA1(70cd630e63714b544f3f61a6663a41e3439639d5) )
1335   ROM_LOAD( "ds_chr-7.bin",       0xe0000, 0x20000, CRC(a51724af) SHA1(85728add3f773c4d814202208bee3d9a053e50de) )
1336
1337   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE ) /* sprites */
1338   ROM_LOAD( "ds_obj-0.bin",       0x00000, 0x20000, CRC(03ec3076) SHA1(9926ec974ba3472d765531f6add4a8d6e398c46e) )
1339   ROM_LOAD( "ds_obj-1.bin",       0x20000, 0x20000, CRC(e67a8fa4) SHA1(c45070b929f3e4df0e3809cf33cb4538b0067464) )
1340   ROM_LOAD( "ds_obj-2.bin",       0x40000, 0x20000, CRC(061cd763) SHA1(df079052fddb60ea5618ed5a6c41fb4db0e313af) )
1341   ROM_LOAD( "ds_obj-3.bin",       0x60000, 0x20000, CRC(63225a09) SHA1(8fffcd5b6baaa9ced16fbac58f6a3eeb11183c8b) )
1342   ROM_LOAD_HS( "ds1_o4.bin",      0x80000, 0x10000, CRC(a6246fcb) SHA1(39de4fdb175ab16b791cdc5d757ff7bfee8e3d2b) )
1343ROM_END
1344
13001345/* Blazer */
13011346ROM_START( blazer )
13021347   ROM_REGION( 0x1c000, REGION_CPU3, 0 )       /* 176k for the sound cpu */
r1490r1491
23462391GAME( 1987, yokaidko, shadowld, ns1,     shadowld, shadowld, ROT180, "Namco", "Yokai Douchuuki (Japan old version)", 0 )
23472392GAME( 1987, dspirit,  0,        ns1,     dspirit,  dspirit,  ROT90,  "Namco", "Dragon Spirit (new version)", 0 )
23482393GAME( 1987, dspirito, dspirit,  ns1,     dspirit,  dspirit,  ROT90,  "Namco", "Dragon Spirit (old version)", 0 )
2394GAME( 1987, dspirita, dspirit,  ns1,     dspirit,  dspirit,  ROT90,  "Namco", "Dragon Spirit (Atari license)", 0 )
23492395GAME( 1987, blazer,   0,        ns1,     ns1,      blazer,   ROT90,  "Namco", "Blazer (Japan)", 0 )
23502396GAME( 1987, quester,  0,        ns1,     quester,  quester,  ROT90,  "Namco", "Quester (Japan)", 0 )
23512397GAME( 1987, pacmania, 0,        ns1,     pacmania, pacmania, ROT270, "Namco", "Pac-Mania", 0 )
src/mame/drivers/othunder.c
r1490r1491
231231  causing this. So I'm mystified. (Maybe it's related to game being
232232  ORIENTATION_FLIP_X ??)
233233
234BM, 060108 - The original flyer for this game has screenshots which clearly
235show the background is 4 pixels to the left on several game stages (you can
236see the edge of sprites overlapping past the right edge).  Therefore I
237do not believe the TC0100SCN problem mentioned above actually exists.  The
238current emulation appears to be accurate.
239
234240***************************************************************************/
235241
236242#include "driver.h"
src/mame/drivers/quasar.c
r1490r1491
5858************************************************************************/
5959
6060#include "driver.h"
61#include "cvs.h"
6162#include "cpu/s2650/s2650.h"
6263#include "cpu/i8039/i8039.h"
6364#include "sound/dac.h"
6465#include "video/s2636.h"
6566
67
6668PALETTE_INIT( quasar );
6769VIDEO_UPDATE( quasar );
6870VIDEO_START( quasar );
6971
70extern UINT8 *cvs_bullet_ram;
7172
7273extern UINT8 *quasar_effectram;
7374extern int quasar_effectcontrol;
r1490r1491
7677static int IOpage = 8;
7778
7879
79WRITE8_HANDLER( cvs_videoram_w );
80WRITE8_HANDLER( cvs_bullet_w );
81WRITE8_HANDLER( cvs_2636_1_w );
82WRITE8_HANDLER( cvs_2636_2_w );
83WRITE8_HANDLER( cvs_2636_3_w );
84WRITE8_HANDLER( cvs_scroll_w );
85WRITE8_HANDLER( cvs_video_fx_w );
86
87READ8_HANDLER( cvs_collision_r );
88READ8_HANDLER( cvs_collision_clear );
89READ8_HANDLER( cvs_videoram_r );
90READ8_HANDLER( cvs_bullet_r );
91READ8_HANDLER( cvs_2636_1_r );
92READ8_HANDLER( cvs_2636_2_r );
93READ8_HANDLER( cvs_2636_3_r );
94READ8_HANDLER( cvs_character_mode_r );
95
9680/************************************************************************
9781
9882  Quasar memory layout
r1490r1491
145129
146130static WRITE8_HANDLER( quasar_video_w )
147131{
148   if (page == 0) videoram_w(offset,data);
149   if (page == 1) colorram_w(offset,(data & 7));   // 3 bits of ram only - 3 x 2102
150   if (page == 2)
132   switch (page)
151133   {
152      quasar_effectram[offset]   = data;
134   case 0:  cvs_video_ram[offset] = data; break;
135   case 1:  cvs_color_ram[offset] = data & 7; break;   // 3 bits of ram only - 3 x 2102
136   case 2:  quasar_effectram[offset] = data; break;
137   case 3:  quasar_effectcontrol = data; break;
153138   }
154   if (page == 3)
155   {
156      quasar_effectcontrol = data;
157   }
158139}
159140
160141static READ8_HANDLER( quasar_IO_r )
r1490r1491
216197
217198static ADDRESS_MAP_START( quasar, ADDRESS_SPACE_PROGRAM, 8 )
218199   AM_RANGE(0x0000, 0x13ff) AM_ROM
219   AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_bullet_r, quasar_bullet_w) AM_BASE(&cvs_bullet_ram)
220   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_2636_1_r, cvs_2636_1_w) AM_BASE(&s2636_1_ram)
221   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_2636_2_r, cvs_2636_2_w) AM_BASE(&s2636_2_ram)
222   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_2636_3_r, cvs_2636_3_w) AM_BASE(&s2636_3_ram)
223   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(MRA8_RAM /*quasar_video_r*/, quasar_video_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) //0 = background, 1 = colour, 2 = effect, 3 = port blank
200    AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_bullet_ram_or_palette_r, quasar_bullet_w) AM_BASE(&cvs_bullet_ram)
201    AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w) AM_BASE(&s2636_1_ram)
202    AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w) AM_BASE(&s2636_2_ram)
203    AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_3_or_character_ram_r, cvs_s2636_3_or_character_ram_w) AM_BASE(&s2636_3_ram)
204   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(cvs_video_or_color_ram_r, quasar_video_w) AM_BASE(&cvs_video_ram)
224205   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
225206   AM_RANGE(0x2000, 0x33ff) AM_ROM
226207   AM_RANGE(0x4000, 0x53ff) AM_ROM
r1490r1491
382363
383364/* S2636 Mappings */
384365
385static const gfx_layout s2636_character10 =
386{
387   8,10,
388   5,
389   1,
390   { 0 },
391   { 0,1,2,3,4,5,6,7 },
392      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
393   8*16
394};
395
396static const gfx_layout charlayout8colour =
397{
398   8,8,   /* 8*8 characters */
399   256,   /* 256 characters */
400   3,      /* 3 bits per pixel */
401   { 0, 0x800*8, 0x1000*8 },   /* the bitplanes are separated */
402   { 0, 1, 2, 3, 4, 5, 6, 7 },
403   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
404   8*8   /* every char takes 8 consecutive bytes */
405};
406
407366static GFXDECODE_START( quasar )
408   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,     0, 256)      /* Rom chars */
409   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout8colour, 0, 259 )   /* Ram chars (NOT USED) */
410     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #1  */
411     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #2  */
412     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_character10, 2072, 8 )   /* s2636 #3  */
367   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,           0, 256 )   /* Rom chars */
368     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout,  2072,   8 )   /* s2636 #1  */
369     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout,  2072,   8 )   /* s2636 #2  */
370     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout,  2072,   8 )   /* s2636 #3  */
413371GFXDECODE_END
414372
415373static INTERRUPT_GEN( quasar_interrupt )
src/mame/drivers/cninja.c
r1490r1491
3131
3232  Emulation by Bryan McPhail, mish@tendril.co.uk
3333
34Note about verision levels using Mutant Fighter as the example:
34Note about version levels using Mutant Fighter as the example:
3535  Version 1  HD-00
3636  Version 2  HD-00-1
3737  Version 3  HD-00-2
r1490r1491
132132   logerror("%08x:  Unmapped IRQ write %d %04x\n",activecpu_get_pc(),offset,data);
133133}
134134
135static READ16_HANDLER( robo2_dip3_r ) { return readinputport(3); }
135static READ16_HANDLER( robocop2_dip3_r ) { return readinputport(3); }
136136
137137static READ16_HANDLER( robocop2_prot_r )
138138{
r1490r1491
253253   AM_RANGE(0x156000, 0x156fff) AM_READ(MRA16_RAM)
254254   AM_RANGE(0x15c000, 0x15c7ff) AM_READ(MRA16_RAM)
255255   AM_RANGE(0x15e000, 0x15e7ff) AM_READ(MRA16_RAM)
256   AM_RANGE(0x1f8000, 0x1f8001) AM_READ(robo2_dip3_r) /* Dipswitch #3 */
256   AM_RANGE(0x1f8000, 0x1f8001) AM_READ(robocop2_dip3_r ) /* Dipswitch #3 */
257257ADDRESS_MAP_END
258258
259259static ADDRESS_MAP_START( robocop2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/igs_m027.c
r1490r1491
338338    8*8*4
339339};
340340
341#if 0
341342static const gfx_layout gfxlayout_16x16x16 =
342343{
343344    16,16,
344345    RGN_FRAC(1,1),
345346    16,
346    { 0 },
347    { STEP16(0,0) },   // >8planes not supported
347348    { STEP16(15,-1) },
348349    { STEP16(0,16*1) },
349350    16*16*16
350351};
352#endif
351353
352354static GFXDECODE_START( igs_m027 )
353355    GFXDECODE_ENTRY( REGION_GFX1, 0, gfxlayout_8x8x4,   0, 16  )
src/mame/drivers/lvcards.c
r1490r1491
11/***************************************************************************
2Lovely Poker/Pontoon driver, updated by El Condor from work by Uki and Zsolt Vasvari respectively.
2Lovely Cards/Poker/Pontoon driver, updated by El Condor from work by Uki and
3Zsolt Vasvari respectively.
34Later cleaned up by Curt Coder and Scott Yellig.
4
5Lovely Cards also runs on this hardware, but is not a gambling game.
6
7Any fixes for this driver should be forwarded to the AGEMAME forum at (http://www.mameworld.info),
8or to MAME, if they affect Lovely Cards.
9
105---
116
127Lovely Poker by Uki/El Condor
r1490r1491
10297
10398static MACHINE_RESET( lvpoker )
10499{
105payout = 0;
106pulse = 0;
107result = 0;
100   payout = 0;
101   pulse = 0;
102   result = 0;
108103}
109104
110105static WRITE8_HANDLER(control_port_2_w)
111106{
112107   switch (data)
113108   {
114   case 0x60:
115   payout = 1;
116   break;
117   case 0xc0:
118   payout = 1;
119   break;
120   default:
121   payout = 0;
122   break;
109      case 0x60:
110      payout = 1;
111      break;
112      case 0xc0:
113      payout = 1;
114      break;
115      default:
116      payout = 0;
117      break;
123118   }
124119}
125120
r1490r1491
127122{
128123   switch (data)
129124   {
130   case 0x60:
131   payout = 1;
132   break;
133   case 0x80:
134   payout = 1;
135   break;
136   default:
137   payout = 0;
138   break;
125      case 0x60:
126      payout = 1;
127      break;
128      case 0x80:
129      payout = 1;
130      break;
131      default:
132      payout = 0;
133      break;
139134   }
140135}
141136
r1490r1491
147142   {
148143       if ( pulse < 3 )
149144      {
150      result = result | 0x40;
151        pulse++;
145         result = result | 0x40;
146           pulse++;
152147        }
153148       else
154149       {
155        pulse = 0;
150           pulse = 0;
156151        }
157152   }
158153   return result;
src/mame/drivers/blstroid.c
r1490r1491
422422static DRIVER_INIT( blstroid )
423423{
424424   atarigen_eeprom_default = NULL;
425   atarijsa_init(1, 4, 2, 0x80);
425   atarijsa_init(machine, 2, 0x80);
426426}
427427
428428
src/mame/drivers/tatsumi.c
r1490r1491
33    Apache 3                                            ATF-011
44    Round Up 5                                          ATC-011
55    Cycle Warriors                                      ABA-011
6    Big Fight                                           ABA-011
67
78    Incredibly complex hardware!  These are all different boards, but share
89    a similar sprite chip (TZB215 on Apache 3, TZB315 on others).  Other
r1490r1491
1819        Round Up 5 doesn't survive a reset
1920        Dip switches
2021        Various other things..
22    Combine Big Fight & CycleWarriors video routines - currently each
23    game uses different sized tilemaps - these are probably software
24    controlled rather than hardwired, but I don't think either game
25    changes the size at runtime.
26    Big Fight/Cyclewarriors - misc graphics problems.
27    Cyclewarriors - test mode text does not appear as it needs a -256 Y scroll offset from somewhere.
2128
2229    Emulation by Bryan McPhail, mish@tendril.co.uk
2330
r1490r1491
6673
6774    CW27
6875
76    Big Fight
77    Tatsumi, 1992
78
79    PCB Layout
80    ----------
81
82    ABA-011
83    A-8
84    |-----------------------------------------------------------------|
85    |     LM324   M6295    ROM15                TC5563                |
86    |LM324  VOL   KA51             50MHz        TC5563   PAL       |-||
87    |    TC51832 TC51832          |--------|                       | ||
88    |    TC51832 TC51832          |TATSUMI |                       | ||
89    |    TC51832 TC51832          |TZB315  |           ROM20       | ||
90    |    TC51832 TC51832          |        |           TMM2063     | ||
91    |     ROM0    ROM8            |--------|           Z80B        | ||
92    |                                                              | ||
93    |J                     PAL                  16MHz              |-||
94    |A    ROM2    ROM10     |--------------|                 PAL      |
95    |M                      |     68000    |            TMM2088       |
96    |M                      |--------------|                          |
97    |A    ROM4    ROM12                                 TMM2088       |
98    |                                ROM16    ROM17                |-||
99    |                            PAL      PAL           TC51832    | ||
100    |     ROM6    ROM14                       ROM18                | ||
101    |                            EPL204   PAL           TC51832    | ||
102    |                       |--------------|                       | ||
103    |   CXD10950  CXD10950  |    68000     |  ROM19     TC51832    | ||
104    |                       |--------------|                       | ||
105    |                                                   TC51832    |-||
106    |      DSW3(4) DSW2(8) DSW1(8)                                    |
107    |-----------------------------------------------------------------|
108    Z80 clock - 4.000MHz [16/4]
109    68k clocks - 12.500MHz [50/4]
110    M6295 clock - 2.000MHz [16/8]. Sample rate = 2000000/132
111    YM2151 clock - 4.000MHz [16/4]
112
113    |-------------------------|
114    |       D65005(x16)       |
115    |ROM21                 |-||
116    |                      | ||
117    |                      | ||
118    |                      | ||
119    |                      | ||
120    |                      | ||
121    |                      | ||
122    |PAL                   |-||
123    |     ROM24       PAL  PAL|
124    |        ROM23     HD6445 |
125    |           ROM22         |
126    |          TC51832(x4)    |
127    |      PAL             |-||
128    |      PAL             | ||
129    |                      | ||
130    |                      | ||
131    |                      | ||
132    |                      | ||
133    |                      | ||
134    |                      |-||
135    |PAL                      |
136    |-------------------------|
137
69138***************************************************************************/
70139
71140#include "driver.h"
r1490r1491
79148UINT8 *tatsumi_rom_sprite_lookup1, *tatsumi_rom_sprite_lookup2;
80149UINT8 *tatsumi_rom_clut0, *tatsumi_rom_clut1;
81150UINT16 *roundup5_unknown0, *roundup5_unknown1, *roundup5_unknown2;
151UINT16 bigfight_a20000[8], bigfight_a40000[2], bigfight_a60000[2];
152extern UINT16 bigfight_bank;
82153static UINT8 *apache3_bg_ram;
83154
84155/***************************************************************************/
85156
86//static READ16_HANDLER(cyclwarr_cpu_b_r) { return cyclwarr_cpub_ram[offset+0x800]; }
87//static WRITE16_HANDLER(cyclwarr_cpu_b_w){ COMBINE_DATA(&cyclwarr_cpub_ram[offset+0x800]); }
88157static READ16_HANDLER(cyclwarr_cpu_bb_r){ return cyclwarr_cpub_ram[offset]; }
89158static WRITE16_HANDLER(cyclwarr_cpu_bb_w) { COMBINE_DATA(&cyclwarr_cpub_ram[offset]); }
90159static READ16_HANDLER(cyclwarr_palette_r) { return paletteram16[offset]; }
91160static READ16_HANDLER(cyclwarr_sprite_r) { return spriteram16[offset]; }
92161static WRITE16_HANDLER(cyclwarr_sprite_w) { COMBINE_DATA(&spriteram16[offset]); }
93162static READ16_HANDLER(cyclwarr_input_r) { return readinputport(offset); }
94static READ16_HANDLER(cyclwarr_input2_r) { return readinputport(offset+3); }
163static READ16_HANDLER(cyclwarr_input2_r) { return readinputport(offset+4); }
164static WRITE16_HANDLER(bigfight_a20000_w) { COMBINE_DATA(&bigfight_a20000[offset]); }
165static WRITE16_HANDLER(bigfight_a40000_w) { COMBINE_DATA(&bigfight_a40000[offset]); }
166static WRITE16_HANDLER(bigfight_a60000_w) { COMBINE_DATA(&bigfight_a60000[offset]); }
95167
168static WRITE16_HANDLER(cyclwarr_sound_w)
169{
170   soundlatch_w(0, data >> 8);
171   cpunum_set_input_line(2, INPUT_LINE_NMI, PULSE_LINE);
172}
173
96174/***************************************************************************/
97175
98176static ADDRESS_MAP_START( apache3_v30_map, ADDRESS_SPACE_PROGRAM, 16 )
r1490r1491
182260/******************************************************************************/
183261
184262static ADDRESS_MAP_START( cyclwarr_68000a_map, ADDRESS_SPACE_PROGRAM, 16 )
185   AM_RANGE(0x000000, 0x00dfff) AM_RAM AM_BASE(&cyclwarr_cpua_ram)
186   AM_RANGE(0x00e000, 0x00ffff) AM_RAM AM_BASE(&videoram16)
263   AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_BASE(&cyclwarr_cpua_ram)
187264   AM_RANGE(0x03e000, 0x03efff) AM_RAM
188265   AM_RANGE(0x040000, 0x043fff) AM_READWRITE(cyclwarr_cpu_bb_r, cyclwarr_cpu_bb_w)
189   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram2_r, cyclwarr_videoram2_w) AM_BASE(&cyclwarr_videoram2)
190   AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram_r, cyclwarr_videoram_w) AM_BASE(&cyclwarr_videoram)
191   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) //b9008 - dips
192   // ba000 + ba002 - dips
193   AM_RANGE(0x0ba000, 0x0ba003) AM_READ(cyclwarr_input2_r) //temp
194   AM_RANGE(0x0ba004, 0x0ba007) AM_READ(cyclwarr_input2_r)
266   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram1_r, cyclwarr_videoram1_w) AM_BASE(&cyclwarr_videoram1)
267   AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram0_r, cyclwarr_videoram0_w) AM_BASE(&cyclwarr_videoram0)
268
269   AM_RANGE(0x0a2000, 0x0a2007) AM_WRITE(bigfight_a20000_w)
270   AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
271   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
272
273   AM_RANGE(0x0b8000, 0x0b8001) AM_WRITE(cyclwarr_sound_w)
274   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
275   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
195276   AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w)
196277   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_BASE(&spriteram16)
197278   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_BASE(&tatsumi_sprite_control_ram)
r1490r1491
201282ADDRESS_MAP_END
202283
203284static ADDRESS_MAP_START( cyclwarr_68000b_map, ADDRESS_SPACE_PROGRAM, 16 )
204   AM_RANGE(0x000000, 0x00dfff) AM_RAM AM_BASE(&cyclwarr_cpub_ram)
205   AM_RANGE(0x00e000, 0x00ffff) AM_RAM
206   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram2_r, cyclwarr_videoram2_w)
207   AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram_r, cyclwarr_videoram_w)
285   AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_BASE(&cyclwarr_cpub_ram)
286
287   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram1_r, cyclwarr_videoram1_w)
288   AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram0_r, cyclwarr_videoram0_w)
289
290   AM_RANGE(0x0a2000, 0x0a2007) AM_WRITE(bigfight_a20000_w)
291   AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
292   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
293
294   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
295   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
296   AM_RANGE(0x0ba008, 0x0ba009) AM_READ(cyclwarr_control_r)
297
208298   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w)
209299   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w)
210300   AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram16_xRRRRRGGGGGBBBBB_word_w)
r1490r1491
218308   AM_RANGE(0xfff0, 0xfff0) AM_WRITE(YM2151_register_port_0_w)
219309   AM_RANGE(0xfff1, 0xfff1) AM_READWRITE(tatsumi_hack_ym2151_r, YM2151_data_port_0_w)
220310   AM_RANGE(0xfff4, 0xfff4) AM_READWRITE(tatsumi_hack_oki_r, OKIM6295_data_0_w)
221   AM_RANGE(0xfff8, 0xfff8) AM_READ(input_port_0_r)
222   AM_RANGE(0xfff9, 0xfff9) AM_READ(input_port_1_r)
223//  AM_RANGE(0xfffa, 0xfffa) AM_READ(input_port_0_r)// MRA_NOP) //irq ack???
224   AM_RANGE(0xfffc, 0xfffc) AM_READ(input_port_2_r)// MRA_NOP)
225   AM_RANGE(0xfff9, 0xfff9) AM_WRITE(MWA8_NOP) //irq ack?
226   AM_RANGE(0xfffa, 0xfffa) AM_WRITE(MWA8_NOP) //irq ack?
311   AM_RANGE(0xfffc, 0xfffc) AM_READ(soundlatch_r)
312   AM_RANGE(0xfffe, 0xfffe) AM_WRITE(MWA8_NOP)
227313ADDRESS_MAP_END
228314
229315/******************************************************************************/
230316
317static ADDRESS_MAP_START( bigfight_68000a_map, ADDRESS_SPACE_PROGRAM, 16 )
318   AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_BASE(&cyclwarr_cpua_ram)
319
320   AM_RANGE(0x03e000, 0x03efff) AM_RAM
321   AM_RANGE(0x040000, 0x04ffff) AM_READWRITE(cyclwarr_cpu_bb_r, cyclwarr_cpu_bb_w)
322
323   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram1_r, cyclwarr_videoram1_w) AM_BASE(&cyclwarr_videoram1)
324   AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram0_r, cyclwarr_videoram0_w) AM_BASE(&cyclwarr_videoram0)
325
326   AM_RANGE(0x0a2000, 0x0a2007) AM_WRITE(bigfight_a20000_w)
327   AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
328   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
329
330   AM_RANGE(0x0b8000, 0x0b8001) AM_WRITE(cyclwarr_sound_w)
331   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
332   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
333   AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w)
334   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_BASE(&spriteram16)
335   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_BASE(&tatsumi_sprite_control_ram)
336   AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
337   AM_RANGE(0x100000, 0x17ffff) AM_ROMBANK(2) /* CPU A ROM */
338   AM_RANGE(0x200000, 0x27ffff) AM_ROMBANK(1) /* CPU B ROM */
339ADDRESS_MAP_END
340
341static ADDRESS_MAP_START( bigfight_68000b_map, ADDRESS_SPACE_PROGRAM, 16 )
342   AM_RANGE(0x000000, 0x00ffff) AM_RAM AM_BASE(&cyclwarr_cpub_ram)
343   AM_RANGE(0x080000, 0x08ffff) AM_READWRITE(cyclwarr_videoram1_r, cyclwarr_videoram1_w)
344   AM_RANGE(0x090000, 0x09ffff) AM_READWRITE(cyclwarr_videoram0_r, cyclwarr_videoram0_w)
345   AM_RANGE(0x0a2000, 0x0a2007) AM_WRITE(bigfight_a20000_w)
346   AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
347   AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
348
349   AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
350   AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
351   AM_RANGE(0x0ba008, 0x0ba009) AM_READ(cyclwarr_control_r)
352
353   AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w)
354   AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w)
355   AM_RANGE(0x0d0000, 0x0d3fff) AM_READWRITE(cyclwarr_palette_r, paletteram16_xRRRRRGGGGGBBBBB_word_w)
356   AM_RANGE(0x100000, 0x17ffff) AM_ROMBANK(2) /* CPU A ROM */
357   AM_RANGE(0x200000, 0x27ffff) AM_ROMBANK(1) /* CPU B ROM */
358ADDRESS_MAP_END
359
360/******************************************************************************/
361
231362static INPUT_PORTS_START( apache3 )
232363   PORT_START
233364   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
r1490r1491
401532   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
402533
403534   PORT_START
535   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1")
536   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
537   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
538   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:2")
539   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
540   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
541   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:3")
542   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
543   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
544   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Test ) ) PORT_DIPLOCATION("SW3:4")
545   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
546   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
547
548   PORT_START
549   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1")
550   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
551   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
552   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2")
553   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
554   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
555   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
556   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
557   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
558   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
559   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
560   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
561   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5")
562   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
563   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
564   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
565   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
566   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
567   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7")
568   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
569   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
570   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8")
571   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
572   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
573
574   PORT_START
575   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1")
576   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
577   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
578   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2")
579   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
580   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
581   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3")
582   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
583   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
584   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4")
585   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
586   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
587   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5")
588   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
589   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
590   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6")
591   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
592   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
593   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7")
594   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
595   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
596   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8")
597   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
598   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
599
600   PORT_START
404601   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3 )
405602   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
406603   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
r1490r1491
419616   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(4)
420617   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(4)
421618   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(4)
619INPUT_PORTS_END
422620
621static INPUT_PORTS_START( bigfight )
423622   PORT_START
424   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON4  )
623   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
624   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
625   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
626   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )
627   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
628   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 )
629   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 )
630   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
425631
426632   PORT_START
427   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON4  )
633   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
634   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
635   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
636   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
637   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
638   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(1)
639   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(1)
640   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(1)
428641
429642   PORT_START
430   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_BUTTON4  )
643   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START2 )
644   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
645   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
646   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
647   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
648   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(2)
649   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(2)
650   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
651
652   PORT_START
653   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1")
654   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
655   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
656   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:2")
657   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
658   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
659   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:3")
660   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
661   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
662   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Test ) ) PORT_DIPLOCATION("SW3:4")
663   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
664   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
665
666   PORT_START
667   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1")
668   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
669   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
670   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2")
671   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
672   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
673   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
674   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
675   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
676   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
677   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
678   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
679   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5")
680   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
681   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
682   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
683   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
684   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
685   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7")
686   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
687   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
688   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8")
689   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
690   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
691
692   PORT_START
693   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1")
694   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
695   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
696   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2")
697   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
698   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
699   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3")
700   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
701   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
702   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4")
703   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
704   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
705   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5")
706   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
707   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
708   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6")
709   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
710   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
711   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7")
712   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
713   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
714   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8")
715   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
716   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
717
718   PORT_START
719   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START3 )
720   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
721   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
722   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
723   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
724   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(3)
725   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(3)
726   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(3)
727
728   PORT_START
729   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START4 )
730   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
731   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
732   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
733   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
734   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(4)
735   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(4)
736   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(4)
431737INPUT_PORTS_END
432738
433739/******************************************************************************/
r1490r1491
448754   8,8,
449755   RGN_FRAC(1,3),
450756   3,
451   { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3)},
452   { 0, 1, 2, 3, 4, 5, 6, 7},
453   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
454   8*8
455};
456static const gfx_layout cyclwarr_charlayout2 =
457{
458   8,8,
459   RGN_FRAC(1,3),
460   3,
461757   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3)},
462758   { 0, 1, 2, 3, 4, 5, 6, 7},
463759   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
464760   8*8
465761};
762
466763static const gfx_layout roundup5_vramlayout =
467764{
468765   8,8,
r1490r1491
475772};
476773
477774static GFXDECODE_START( apache3 )
478   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout,    1024, 128)
479   GFXDECODE_ENTRY( REGION_GFX4, 0, cyclwarr_charlayout,     768, 16)
775   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout, 1024, 128)
776   GFXDECODE_ENTRY( REGION_GFX4, 0, cyclwarr_charlayout, 768, 16)
480777GFXDECODE_END
481778
482779static GFXDECODE_START( roundup5 )
483   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout,     1024, 256)
484   GFXDECODE_ENTRY( 0, 0, roundup5_vramlayout,               0, 16)
780   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout, 1024, 256)
781   GFXDECODE_ENTRY( 0, 0, roundup5_vramlayout, 0, 16)
485782GFXDECODE_END
486783
487784static GFXDECODE_START( cyclwarr )
488   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout,    8192, 512)
489   GFXDECODE_ENTRY( REGION_GFX5, 0, cyclwarr_charlayout,    0, 512)
490   GFXDECODE_ENTRY( REGION_GFX5, 0, cyclwarr_charlayout2,   0, 512)
785   GFXDECODE_ENTRY( REGION_GFX1, 0, roundup5_charlayout, 8192, 512)
786   GFXDECODE_ENTRY( REGION_GFX5, 0, cyclwarr_charlayout, 0, 512)
491787GFXDECODE_END
492788
493789/******************************************************************************/
r1490r1491
546842   MDRV_SOUND_ROUTE(0, "left", 0.45)
547843   MDRV_SOUND_ROUTE(1, "right", 0.45)
548844
549   MDRV_SOUND_ADD(OKIM6295, 20000000/8)
845   MDRV_SOUND_ADD(OKIM6295, 16000000/4/2)
550846   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
551847   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.75)
552848   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.75)
r1490r1491
588884   MDRV_SOUND_ROUTE(0, "left", 0.45)
589885   MDRV_SOUND_ROUTE(1, "right", 0.45)
590886
591   MDRV_SOUND_ADD(OKIM6295, 20000000/8)
887   MDRV_SOUND_ADD(OKIM6295, 16000000/4/2)
592888   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
593889   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.75)
594890   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.75)
r1490r1491
597893static MACHINE_DRIVER_START( cyclwarr )
598894
599895   /* basic machine hardware */
600   MDRV_CPU_ADD(M68000,20000000 / 2) /* NEC V30 CPU, 20MHz / 2 */
896   MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */
601897   MDRV_CPU_PROGRAM_MAP(cyclwarr_68000a_map,0)
602898   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
603899
604   MDRV_CPU_ADD(M68000,20000000 / 2) /* 68000 CPU, 20MHz / 2 */
900   MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */
605901   MDRV_CPU_PROGRAM_MAP(cyclwarr_68000b_map,0)
606902   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
607903
608   MDRV_CPU_ADD(Z80, 4000000) //???
904   MDRV_CPU_ADD(Z80, 16000000 / 4) /* Confirmed */
609905   MDRV_CPU_PROGRAM_MAP(cyclwarr_z80_map,0)
610906
611907   MDRV_SCREEN_REFRESH_RATE(60)
r1490r1491
616912   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
617913   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
618914   MDRV_SCREEN_SIZE(40*8, 32*8)
619   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 2*8, 30*8-1)
915   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
620916   MDRV_GFXDECODE(cyclwarr)
621   MDRV_PALETTE_LENGTH(8192 + 8192) //todo
917   MDRV_PALETTE_LENGTH(8192 + 8192)
622918
623919   MDRV_VIDEO_START(cyclwarr)
624920   MDRV_VIDEO_UPDATE(cyclwarr)
r1490r1491
631927   MDRV_SOUND_ROUTE(0, "left", 0.45)
632928   MDRV_SOUND_ROUTE(1, "right", 0.45)
633929
634   MDRV_SOUND_ADD(OKIM6295, 20000000/8)
930   MDRV_SOUND_ADD(OKIM6295, 16000000/8)
635931   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
636932   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.75)
637933   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.75)
638934MACHINE_DRIVER_END
639935
936static MACHINE_DRIVER_START( bigfight )
937
938   /* basic machine hardware */
939   MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */
940   MDRV_CPU_PROGRAM_MAP(bigfight_68000a_map,0)
941   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
942
943   MDRV_CPU_ADD(M68000, 50000000 / 4) /* Confirmed */
944   MDRV_CPU_PROGRAM_MAP(bigfight_68000b_map,0)
945   MDRV_CPU_VBLANK_INT(irq5_line_hold,1)
946
947   MDRV_CPU_ADD(Z80, 16000000 / 4) /* Confirmed */
948   MDRV_CPU_PROGRAM_MAP(cyclwarr_z80_map,0)
949
950   MDRV_SCREEN_REFRESH_RATE(60)
951   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
952   MDRV_INTERLEAVE(200)
953
954   /* video hardware */
955   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
956   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
957   MDRV_SCREEN_SIZE(40*8, 32*8)
958   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1)
959   MDRV_GFXDECODE(cyclwarr)
960   MDRV_PALETTE_LENGTH(8192 + 8192)
961
962   MDRV_VIDEO_START(bigfight)
963   MDRV_VIDEO_UPDATE(bigfight)
964
965   /* sound hardware */
966   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
967
968   MDRV_SOUND_ADD(YM2151, 16000000/4)
969   MDRV_SOUND_CONFIG(ym2151_interface)
970   MDRV_SOUND_ROUTE(0, "left", 0.45)
971   MDRV_SOUND_ROUTE(1, "right", 0.45)
972
973   MDRV_SOUND_ADD(OKIM6295, 16000000/8/2)    // Measured value of 2MHz seems too fast
974   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high)
975   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.75)
976   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.75)
977MACHINE_DRIVER_END
978
640979/***************************************************************************/
641980
642981ROM_START( apache3 )
r1490r1491
7331072ROM_END
7341073
7351074ROM_START( cyclwarr )
736   ROM_REGION( 0x180000, REGION_CPU1, 0 ) /* 68000 main cpu */
737   ROM_LOAD16_BYTE( "cw16b",   0x100000, 0x20000, CRC(cb1a737a) SHA1(a603ee1256be5641d00a72f64efaaacb65ed9d7d) )
738   ROM_LOAD16_BYTE( "cw18b",   0x100001, 0x20000, CRC(0633ddcb) SHA1(1196ab17065352ec5b37f2f6b383a43a2d0fa3a6) )
739   ROM_LOAD16_BYTE( "cw17a",   0x140000, 0x20000, CRC(2ad6f836) SHA1(5fa4275b433013943ba1d1b64a3c725097f946f9) )
740   ROM_LOAD16_BYTE( "cw19a",   0x140001, 0x20000, CRC(d3853658) SHA1(c9338083a04f55bd22285176831f4b0bdb78564f) )
1075   ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 68000 main cpu */
1076   ROM_LOAD16_BYTE( "cw16b",   0x000000, 0x20000, CRC(cb1a737a) SHA1(a603ee1256be5641d00a72f64efaaacb65ed9d7d) )
1077   ROM_LOAD16_BYTE( "cw18b",   0x000001, 0x20000, CRC(0633ddcb) SHA1(1196ab17065352ec5b37f2f6b383a43a2d0fa3a6) )
1078   ROM_LOAD16_BYTE( "cw17a",   0x040000, 0x20000, CRC(2ad6f836) SHA1(5fa4275b433013943ba1d1b64a3c725097f946f9) )
1079   ROM_LOAD16_BYTE( "cw19a",   0x040001, 0x20000, CRC(d3853658) SHA1(c9338083a04f55bd22285176831f4b0bdb78564f) )
7411080
742   ROM_REGION( 0x180000, REGION_CPU2, 0 ) /* 68000 sub cpu */
743   ROM_LOAD16_BYTE( "cw20a",   0x100000, 0x20000, CRC(c3578ac1) SHA1(21d369da874f01922d0f0b757a42b4321df891d4) )
744   ROM_LOAD16_BYTE( "cw22a",   0x100001, 0x20000, CRC(5339ed24) SHA1(5b0a54c2442dcf7373ff8b55b91af9772473ff77) )
745   ROM_LOAD16_BYTE( "cw21",    0x140000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) )
746   ROM_LOAD16_BYTE( "cw23",    0x140001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) )
1081   ROM_REGION( 0x80000, REGION_CPU2, 0 ) /* 68000 sub cpu */
1082   ROM_LOAD16_BYTE( "cw20a",   0x000000, 0x20000, CRC(c3578ac1) SHA1(21d369da874f01922d0f0b757a42b4321df891d4) )
1083   ROM_LOAD16_BYTE( "cw22a",   0x000001, 0x20000, CRC(5339ed24) SHA1(5b0a54c2442dcf7373ff8b55b91af9772473ff77) )
1084   ROM_LOAD16_BYTE( "cw21",    0x040000, 0x20000, CRC(ed90d956) SHA1(f533f93da31ac6eb631fb506357717e7cac8e186) )
1085   ROM_LOAD16_BYTE( "cw23",    0x040001, 0x20000, CRC(009cdc78) SHA1(a77933a7736546397e8c69226703d6f9be7b55e5) )
7471086
7481087   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* 64k code for sound Z80 */
7491088   ROM_LOAD( "cw26a",   0x000000, 0x10000, CRC(f7a70e3a) SHA1(5581633bf1f15d7f5c1e03de897d65d60f9f1e33) )
r1490r1491
7751114   ROM_LOAD( "cw27",   0x000000, 0x20000, CRC(2db48a9e) SHA1(16c307340d17cd3b5455ebcee681fbe0335dec58) )
7761115
7771116   ROM_REGION( 0x60000, REGION_GFX5, ROMREGION_DISPOSE )
778   ROM_LOAD( "cw28",   0x000000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) )
1117   ROM_LOAD( "cw30",   0x000000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) )
7791118   ROM_LOAD( "cw29",   0x020000, 0x20000, CRC(64dd519c) SHA1(e23611fc2be896861997063546c3eb03527eaf8e) )
780   ROM_LOAD( "cw30",   0x040000, 0x20000, CRC(331d0711) SHA1(82251fe1f1d36f079080943ab1fd04a60077c353) )
1119   ROM_LOAD( "cw28",   0x040000, 0x20000, CRC(3fc568ed) SHA1(91125c9deddc659449ca6791a847fe908c2818b2) )
7811120
7821121   ROM_REGION( 0x40000, REGION_SOUND1, 0 )    /* ADPCM samples */
7831122   ROM_LOAD( "cw24a",   0x000000, 0x20000, CRC(22600cba) SHA1(a1514fbe037942f1493a17eb0b7986949470cb22) )
7841123   ROM_LOAD( "cw25a",   0x020000, 0x20000, CRC(372c6bc8) SHA1(d4875bf3bffecf338bebba3b8d6a791585556a06) )
7851124ROM_END
7861125
1126ROM_START( bigfight )
1127   ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 68000 main cpu */
1128   ROM_LOAD16_BYTE( "rom16.ic77",   0x000000, 0x40000, CRC(e7304ec8) SHA1(31a37e96bf963b349d36534bc5ebbf45e19ad00e) )
1129   ROM_LOAD16_BYTE( "rom17.ic98",   0x000001, 0x40000, CRC(4cf090f6) SHA1(9ae0274c890e829a90108ce316aff9665128c982) )
1130
1131   ROM_REGION( 0x80000, REGION_CPU2, 0 ) /* 68000 sub cpu */
1132   ROM_LOAD16_BYTE( "rom18.ic100",   0x000000, 0x40000, CRC(49df6207) SHA1(c4126f4542add11a3a3d236311c8787c24c98440) )
1133   ROM_LOAD16_BYTE( "rom19.ic102",   0x000001, 0x40000, CRC(c12aa9e9) SHA1(19cc7feaa97c6f5148ae8c0077174f96be684f05) )
1134
1135   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* 64k code for sound Z80 */
1136   ROM_LOAD( "rom20.ic91",   0x000000, 0x10000, CRC(b3add091) SHA1(8a67bfff75c13fe4d9b89d30449199200d11cea7) )
1137
1138   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
1139   /* Filled in by both regions below */
1140
1141   ROM_REGION( 0x200000, REGION_GFX2, 0 )
1142   ROM_LOAD32_BYTE( "rom0.ic26",   0x000000, 0x80000, CRC(a4a3c8d6) SHA1(b5365d9bc6068260c23ba9d5971c7c7d7cc07a97) )
1143   ROM_LOAD32_BYTE( "rom8.ic45",   0x000001, 0x80000, CRC(220956ed) SHA1(68e0ba1e850101b4cc2778819dfa76f04d88d2d6) )
1144   ROM_LOAD32_BYTE( "rom2.ic28",   0x000002, 0x80000, CRC(c4f6d243) SHA1(e23b241b5a40b332165a34e2f1bc4366973b2070) )
1145   ROM_LOAD32_BYTE( "rom10.ic47",  0x000003, 0x80000, CRC(0212d472) SHA1(5549461195fd7b6b43c0174462d7fe1a1bac24e9) )
1146
1147   ROM_REGION( 0x200000, REGION_GFX3, 0 )
1148   ROM_LOAD32_BYTE( "rom4.ic30",   0x000000, 0x80000, CRC(999ff7e9) SHA1(a53b06ad084722d7a52fcf01c52967f68620e609) )
1149   ROM_LOAD32_BYTE( "rom12.ic49",  0x000001, 0x80000, CRC(cb4c1f0b) SHA1(32d64b78ed3d5971eb5d25be2c38e6f2c9048f74) )
1150   ROM_LOAD32_BYTE( "rom6.ic32",   0x000002, 0x80000, CRC(f70e2d47) SHA1(00517b5f3b2deb6f3f3bd12df421e63884c22b2e) )
1151   ROM_LOAD32_BYTE( "rom14.ic51",  0x000003, 0x80000, CRC(77430bc9) SHA1(0b1fd54ace84a9fb5b44d5600de8089a20bcbd47) )
1152
1153   ROM_REGION( 0x20000, REGION_GFX4, 0 )
1154   ROM_LOAD( "rom21.ic128",   0x000000, 0x20000, CRC(da027dcf) SHA1(47d18a8a273fea72cb3ad3d58166fe38ca28a860) )
1155
1156   ROM_REGION( 0x60000, REGION_GFX5, ROMREGION_DISPOSE )
1157   ROM_LOAD( "rom24.ic73",   0x000000, 0x20000, CRC(c564185d) SHA1(e9b5fc10a5a5014735852c22db2a054d5787d8cb) )
1158   ROM_LOAD( "rom23.ic72",   0x020000, 0x20000, CRC(f8bb340b) SHA1(905a1ec778d6ed5c6f53d9d08cd105eed7e307ca) )
1159   ROM_LOAD( "rom22.ic71",   0x040000, 0x20000, CRC(fb505074) SHA1(b6d9b20be7c3e971e5a4392736f087e807b9c850) )
1160
1161   ROM_REGION( 0x40000, REGION_SOUND1, 0 )    /* ADPCM samples */
1162   ROM_LOAD( "rom15.ic39",   0x000000, 0x40000, CRC(58d136e8) SHA1(4aa063c4b9b057cba4655ecbe44a87c8c411e3aa) )
1163ROM_END
1164
7871165/***************************************************************************/
7881166
7891167static DRIVER_INIT( apache3 )
r1490r1491
8441222   UINT8 *src1 = memory_region(REGION_GFX2);
8451223   UINT8 *src2 = memory_region(REGION_GFX3);
8461224   int i;
847   for (i=0; i<0x100000; i+=32) {
1225   for (i=0; i<memory_region_length(REGION_GFX2); i+=32) {
8481226      memcpy(dst,src1,32);
8491227      src1+=32;
8501228      dst+=32;
r1490r1491
8541232   }
8551233
8561234   dst = memory_region(REGION_CPU1);
857   memcpy(cyclwarr_cpua_ram,dst+0x100000,8);
858   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x100000);
1235   memcpy(cyclwarr_cpua_ram,dst,8);
1236   memory_set_bankptr(1, memory_region(REGION_CPU1));
8591237
8601238   dst = memory_region(REGION_CPU2);
861   memcpy(cyclwarr_cpub_ram,dst+0x100000,8);
862   memory_set_bankptr(2, memory_region(REGION_CPU2) + 0x100000);
1239   memcpy(cyclwarr_cpub_ram,dst,8);
1240   memory_set_bankptr(2, memory_region(REGION_CPU2));
8631241
8641242   // Copy sprite & palette data out of GFX rom area
8651243   tatsumi_rom_sprite_lookup1 = memory_region(REGION_GFX2);
8661244   tatsumi_rom_sprite_lookup2 = memory_region(REGION_GFX3);
867   tatsumi_rom_clut0 = memory_region(REGION_GFX2)+ 0x100000 - 0x1000;
868   tatsumi_rom_clut1 = memory_region(REGION_GFX3)+ 0x100000 - 0x1000;
1245   tatsumi_rom_clut0 = memory_region(REGION_GFX2)+ memory_region_length(REGION_GFX2) - 0x1000;
1246   tatsumi_rom_clut1 = memory_region(REGION_GFX3)+ memory_region_length(REGION_GFX3) - 0x1000;
8691247
8701248   tatsumi_reset();
8711249}
8721250
8731251/***************************************************************************/
8741252
875/* http://www.tatsu-mi.co.jp/game/HTML/history.html */
1253/* http://www.tatsu-mi.co.jp/game/trace/index.html */
8761254
877/* 1986 Lock On */
8781255/* 1987 Gray Out */
8791256GAME( 1988, apache3,  0, apache3,   apache3,  apache3,  ROT0, "Tatsumi", "Apache 3", GAME_IMPERFECT_GRAPHICS )
8801257GAME( 1989, roundup5, 0, roundup5,  roundup5, roundup5, ROT0, "Tatsumi", "Round Up 5 - Super Delta Force", GAME_IMPERFECT_GRAPHICS )
881GAME( 1991, cyclwarr, 0, cyclwarr,  cyclwarr, cyclwarr, ROT0, "Tatsumi", "Cycle Warriors", GAME_IMPERFECT_GRAPHICS )
882/* 1992 Big Fight */
1258GAME( 1991, cyclwarr, 0, cyclwarr,  cyclwarr, cyclwarr, ROT0, "Tatsumi", "Cycle Warriors", GAME_IMPERFECT_GRAPHICS)
1259GAME( 1992, bigfight, 0, bigfight,  bigfight, cyclwarr, ROT0, "Tatsumi", "Big Fight - Big Trouble In The Atlantic Ocean", GAME_IMPERFECT_GRAPHICS)
src/mame/drivers/bogeyman.c
r1490r1491
162162   8, 8,
163163   512,
164164   3,
165   { 0x8000*8, 0+0x1000*8, 4+0x1000*8, 0 },
165   { 0x8000*8, 0+0x1000*8, 4+0x1000*8 },
166166   { 0x2000*8+3, 0x2000*8+2, 0x2000*8+1, 0x2000*8+0, 3, 2, 1, 0 },
167167   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
168168   8*8
src/mame/drivers/harddriv.c
r1490r1491
36523652   /* initialize the boards */
36533653   init_multisync(machine, 0);
36543654   init_adsp();
3655   atarijsa_init(hdcpu_jsa, 14, 0, 0x0020);
3655   atarijsa_init(machine, 0, 0x0020);
36563656
36573657   /* set up gsp speedup handler */
36583658   hdgsp_speedup_addr[0] = memory_install_write16_handler(hdcpu_gsp, ADDRESS_SPACE_PROGRAM, 0xfff9fc00, 0xfff9fc0f, 0, 0, hdgsp_speedup1_w);
r1490r1491
37653765   init_ds3(machine);
37663766   init_dspcom();
37673767   atarijsa3_init_adpcm(REGION_SOUND1);
3768   atarijsa_init(hdcpu_jsa, 14, 0, 0x0020);
3768   atarijsa_init(machine, 0, 0x0020);
37693769
37703770   memory_install_read16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x908000, 0x908001, 0, 0, steeltal_dummy_r);
37713771
src/mame/drivers/atarig1.c
r1490r1491
6464}
6565
6666
67static MACHINE_START( atarig1 )
68{
69   state_save_register_global(which_input);
70}
71
72
6773static MACHINE_RESET( atarig1 )
6874{
6975   atarigen_eeprom_reset();
r1490r1491
155161}
156162
157163
164static void pitfighb_state_postload(void)
165{
166   int bank = bslapstic_bank;
167   bslapstic_bank = -1;
168   update_bank(bank);
169}
170
171
158172static READ16_HANDLER( pitfighb_cheap_slapstic_r )
159173{
160174   int result = bslapstic_base[offset & 0xfff];
r1490r1491
412426   MDRV_CPU_PROGRAM_MAP(main_map,0)
413427   MDRV_CPU_VBLANK_INT(atarigen_video_int_gen,1)
414428
429   MDRV_MACHINE_START(atarig1)
415430   MDRV_MACHINE_RESET(atarig1)
416431   MDRV_NVRAM_HANDLER(atarigen)
417432
r1490r1491
938953 *
939954 *************************************/
940955
941static void init_g1_common(offs_t slapstic_base, int slapstic, int is_pitfight)
956static void init_g1_common(running_machine *machine, offs_t slapstic_base, int slapstic, int is_pitfight)
942957{
943958   atarigen_eeprom_default = NULL;
944959   if (slapstic == -1)
960   {
945961      pitfighb_cheap_slapstic_init();
962      state_save_register_global(bslapstic_bank);
963      state_save_register_global(bslapstic_primed);
964      state_save_register_func_postload(pitfighb_state_postload);
965   }
946966   else if (slapstic != 0)
947      atarigen_slapstic_init(0, slapstic_base, slapstic);
948   atarijsa_init(1, 4, 0, 0x8000);
967      atarigen_slapstic_init(0, slapstic_base, 0, slapstic);
968   atarijsa_init(machine, 0, 0x4000);
949969
950970   atarig1_pitfight = is_pitfight;
951971}
952972
953static DRIVER_INIT( hydra )    { init_g1_common(0x078000, 116, 0); }
954static DRIVER_INIT( hydrap )   { init_g1_common(0x000000,   0, 0); }
973static DRIVER_INIT( hydra )    { init_g1_common(machine, 0x078000, 116, 0); }
974static DRIVER_INIT( hydrap )   { init_g1_common(machine, 0x000000,   0, 0); }
955975
956static DRIVER_INIT( pitfight ) { init_g1_common(0x038000, 111, 1); }
957static DRIVER_INIT( pitfighj ) { init_g1_common(0x038000, 113, 1); }
958static DRIVER_INIT( pitfighb ) { init_g1_common(0x038000,  -1, 1); }
976static DRIVER_INIT( pitfight ) { init_g1_common(machine, 0x038000, 111, 1); }
977static DRIVER_INIT( pitfighj ) { init_g1_common(machine, 0x038000, 113, 1); }
978static DRIVER_INIT( pitfighb ) { init_g1_common(machine, 0x038000,  -1, 1); }
959979
960980
961981
r1490r1491
965985 *
966986 *************************************/
967987
968GAME( 1990, hydra,    0,        atarig1, hydra,    hydra,    ROT0, "Atari Games", "Hydra", 0 )
969GAME( 1990, hydrap,   hydra,    atarig1, hydra,    hydrap,   ROT0, "Atari Games", "Hydra (prototype 5/14/90)", 0 )
970GAME( 1990, hydrap2,  hydra,    atarig1, hydra,    hydrap,   ROT0, "Atari Games", "Hydra (prototype 5/25/90)", 0 )
988GAME( 1990, hydra,    0,        atarig1, hydra,    hydra,    ROT0, "Atari Games", "Hydra", GAME_SUPPORTS_SAVE )
989GAME( 1990, hydrap,   hydra,    atarig1, hydra,    hydrap,   ROT0, "Atari Games", "Hydra (prototype 5/14/90)", GAME_SUPPORTS_SAVE )
990GAME( 1990, hydrap2,  hydra,    atarig1, hydra,    hydrap,   ROT0, "Atari Games", "Hydra (prototype 5/25/90)", GAME_SUPPORTS_SAVE )
971991
972GAME( 1990, pitfight, 0,        atarig1, pitfight, pitfighj, ROT0, "Atari Games", "Pit Fighter (rev 5)", 0 )
973GAME( 1990, pitfigh4, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 4)", 0 )
974GAME( 1990, pitfigh3, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 3)", 0 )
975GAME( 1990, pitfighj, pitfight, atarig1, pitfighj, pitfighj, ROT0, "Atari Games", "Pit Fighter (Japan, 2 players)", 0 )
976GAME( 1990, pitfighb, pitfight, atarig1, pitfight, pitfighb, ROT0, "Atari Games", "Pit Fighter (bootleg)", 0 )
992GAME( 1990, pitfight, 0,        atarig1, pitfight, pitfighj, ROT0, "Atari Games", "Pit Fighter (rev 5)", GAME_SUPPORTS_SAVE )
993GAME( 1990, pitfigh4, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 4)", GAME_SUPPORTS_SAVE )
994GAME( 1990, pitfigh3, pitfight, atarig1, pitfight, pitfight, ROT0, "Atari Games", "Pit Fighter (rev 3)", GAME_SUPPORTS_SAVE )
995GAME( 1990, pitfighj, pitfight, atarig1, pitfighj, pitfighj, ROT0, "Atari Games", "Pit Fighter (Japan, 2 players)", GAME_SUPPORTS_SAVE )
996GAME( 1990, pitfighb, pitfight, atarig1, pitfight, pitfighb, ROT0, "Atari Games", "Pit Fighter (bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/toobin.c
r1490r1491
617617static DRIVER_INIT( toobin )
618618{
619619   atarigen_eeprom_default = NULL;
620   atarijsa_init(1, 2, 1, 0x1000);
620   atarijsa_init(machine, 1, 0x1000);
621621}
622622
623623
src/mame/drivers/funworld.c
r1490r1491
13181318
13191319static const gfx_layout charlayout =
13201320{
1321   4,
1322   8,
1321   4,8,
13231322   0x1000,
13241323//  RGN_FRAC(1,2),
13251324   4,
r1490r1491
13321331
13331332static const gfx_layout sn10_charlayout =
13341333{
1335   4,
1336   8,
1334   4,8,
13371335   RGN_FRAC(1,2),
13381336   4,
13391337   { RGN_FRAC(0,2), RGN_FRAC(0,2) + 4, RGN_FRAC(1,2), RGN_FRAC(1,2) + 4 },
src/mame/drivers/mario.c
r1490r1491
66    - combine sh_* writes into one routine
77
88Done:
9    - Hooked up flipscreen
10    - Changed monitor orientation to ROT0
911    - fixed mario0110u1gre
1012    - rewrote driver, separate MACHINE_DRIVER(mario_audio)
1113    - palette from schematics
r1490r1491
114116   AM_RANGE(0x7c80, 0x7c80) AM_WRITE(mario_sh2_w) /* Luigi run sample */
115117   AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
116118   AM_RANGE(0x7e80, 0x7e80) AM_WRITE(mario_gfxbank_w)
119   AM_RANGE(0x7e82, 0x7e82) AM_WRITE(mario_flip_w)
117120   AM_RANGE(0x7e83, 0x7e83) AM_WRITE(mario_palettebank_w)
118121   AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
119122   AM_RANGE(0x7f00, 0x7f00) AM_WRITE(mario_sh_w)   /* death */
r1490r1491
459462 *
460463 *************************************/
461464
462GAME( 1983, mario,    0,       mario,   mario,   0, ROT180, "Nintendo of America", "Mario Bros. (US, set 1)", GAME_SUPPORTS_SAVE )
463GAME( 1983, marioo,   mario,   mario,   marioo,  0, ROT180, "Nintendo of America", "Mario Bros. (US, set 2)", GAME_SUPPORTS_SAVE )
464GAME( 1983, marioj,   mario,   mario,   marioj,  0, ROT180, "Nintendo", "Mario Bros. (Japan)", GAME_SUPPORTS_SAVE )
465GAME( 1983, masao,    mario,   masao,   masao,   0, ROT180, "bootleg", "Masao", GAME_SUPPORTS_SAVE )
465GAME( 1983, mario,    0,       mario,   mario,   0, ROT0, "Nintendo of America", "Mario Bros. (US, set 1)", GAME_SUPPORTS_SAVE )
466GAME( 1983, marioo,   mario,   mario,   marioo,  0, ROT0, "Nintendo of America", "Mario Bros. (US, set 2)", GAME_SUPPORTS_SAVE )
467GAME( 1983, marioj,   mario,   mario,   marioj,  0, ROT0, "Nintendo", "Mario Bros. (Japan)", GAME_SUPPORTS_SAVE )
468GAME( 1983, masao,    mario,   masao,   masao,   0, ROT0, "bootleg", "Masao", GAME_SUPPORTS_SAVE )
src/mame/drivers/atarifb.c
r1490r1491
153153static ADDRESS_MAP_START( atarifb_map, ADDRESS_SPACE_PROGRAM, 8 )
154154   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )
155155   AM_RANGE(0x0000, 0x01ff) AM_RAM
156   AM_RANGE(0x0200, 0x025f) AM_WRITE(atarifb_alphap1_vram_w) AM_BASE(&atarifb_alphap1_vram) AM_SIZE(&atarifb_alphap1_vram_size)
156   AM_RANGE(0x0200, 0x025f) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap1_vram) AM_SIZE(&atarifb_alphap1_vram_size)
157157   AM_RANGE(0x0260, 0x039f) AM_RAM
158   AM_RANGE(0x03a0, 0x03ff) AM_WRITE(atarifb_alphap2_vram_w) AM_BASE(&atarifb_alphap2_vram) AM_SIZE(&atarifb_alphap2_vram_size)
159   AM_RANGE(0x1000, 0x13bf) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
158   AM_RANGE(0x03a0, 0x03ff) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap2_vram) AM_SIZE(&atarifb_alphap2_vram_size)
159   AM_RANGE(0x1000, 0x13bf) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
160160   AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
161   AM_RANGE(0x2000, 0x2000) AM_WRITE(atarifb_scroll_w) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
161   AM_RANGE(0x2000, 0x2000) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
162162   AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb_out1_w) /* OUT 1 */
163163   AM_RANGE(0x2002, 0x2002) AM_WRITE(atarifb_out2_w) /* OUT 2 */
164164   AM_RANGE(0x2003, 0x2003) AM_WRITE(atarifb_out3_w) /* OUT 3 */
r1490r1491
174174static ADDRESS_MAP_START( soccer_map, ADDRESS_SPACE_PROGRAM, 8 )
175175   ADDRESS_MAP_FLAGS( AMEF_ABITS(14) )
176176   AM_RANGE(0x0000, 0x01ff) AM_RAM
177   AM_RANGE(0x0200, 0x025f) AM_WRITE(atarifb_alphap1_vram_w) AM_BASE(&atarifb_alphap1_vram) AM_SIZE(&atarifb_alphap1_vram_size)
177   AM_RANGE(0x0200, 0x025f) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap1_vram) AM_SIZE(&atarifb_alphap1_vram_size)
178178   AM_RANGE(0x0260, 0x039f) AM_RAM
179   AM_RANGE(0x03a0, 0x03ff) AM_WRITE(atarifb_alphap2_vram_w) AM_BASE(&atarifb_alphap2_vram) AM_SIZE(&atarifb_alphap2_vram_size)
180   AM_RANGE(0x0800, 0x0bbf) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
179   AM_RANGE(0x03a0, 0x03ff) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_alphap2_vram) AM_SIZE(&atarifb_alphap2_vram_size)
180   AM_RANGE(0x0800, 0x0bbf) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
181181   AM_RANGE(0x0bc0, 0x0bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
182   AM_RANGE(0x1000, 0x1000) AM_WRITE(atarifb_scroll_w) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
182   AM_RANGE(0x1000, 0x1000) AM_WRITE(MWA8_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
183183   AM_RANGE(0x1001, 0x1001) AM_WRITE(atarifb_out1_w) /* OUT 1 */
184184   AM_RANGE(0x1002, 0x1002) AM_WRITE(atarifb_out2_w) /* OUT 2 */
185185   AM_RANGE(0x1004, 0x1004) AM_WRITE(MWA8_NOP) /* Interrupt Acknowledge */
r1490r1491
774774 *
775775 *************************************/
776776
777/*    YEAR  NAME      PARENT   MACHINE   INPUT     INIT      MONITOR  */
777/*    YEAR  NAME      PARENT   MACHINE   INPUT     INIT      MONITOR  */
778778GAMEL( 1978, atarifb,  0,       atarifb,  atarifb,  atarifb,  ROT0, "Atari", "Atari Football (revision 2)", 0, layout_atarifb )
779779GAMEL( 1978, atarifb1, atarifb, atarifb,  atarifb,  atarifb,  ROT0, "Atari", "Atari Football (revision 1)", 0, layout_atarifb )
780780GAMEL( 1979, atarifb4, atarifb, atarifb,  atarifb4, atarifb4, ROT0, "Atari", "Atari Football (4 players)", 0, layout_atarifb4 )
src/mame/drivers/taitowlf.c
r1490r1491
345345    { 0,1,2,3,4,5,6,7 },
346346    /* y offsets */
347347   { 0*8,1*8,2*8,3*8,
348     4*8,5*8,6*8,7*8,
349     0*8,1*8,2*8,3*8,
350348     4*8,5*8,6*8,7*8 },
351349    8*8                     /* every char takes 8 bytes */
352350};
src/mame/drivers/cyberbal.c
r1490r1491
10061006static DRIVER_INIT( cyberbal )
10071007{
10081008   atarigen_eeprom_default = default_eeprom;
1009   atarigen_slapstic_init(0, 0x018000, 0);
1009   atarigen_slapstic_init(0, 0x018000, 0, 0);
10101010}
10111011
10121012
10131013static DRIVER_INIT( cyberbt )
10141014{
10151015   atarigen_eeprom_default = default_eeprom;
1016   atarigen_slapstic_init(0, 0x018000, 116);
1016   atarigen_slapstic_init(0, 0x018000, 0, 116);
10171017}
10181018
10191019
10201020static DRIVER_INIT( cyberb2p )
10211021{
10221022   atarigen_eeprom_default = default_eeprom;
1023   atarijsa_init(1, 3, 2, 0x8000);
1023   atarijsa_init(machine, 2, 0x8000);
10241024}
10251025
10261026
src/mame/drivers/offtwall.c
r1490r1491
484484static DRIVER_INIT( offtwall )
485485{
486486   atarigen_eeprom_default = default_eeprom;
487   atarijsa_init(1, 2, 3, 0x0040);
487   atarijsa_init(machine, 3, 0x0040);
488488
489489   /* install son-of-slapstic workarounds */
490490   spritecache_count = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r);
r1490r1491
496496static DRIVER_INIT( offtwalc )
497497{
498498   atarigen_eeprom_default = default_eeprom;
499   atarijsa_init(1, 2, 3, 0x0040);
499   atarijsa_init(machine, 3, 0x0040);
500500
501501   /* install son-of-slapstic workarounds */
502502   spritecache_count = memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x3fde42, 0x3fde43, 0, 0, spritecache_count_r);
src/mame/drivers/equites.c
r1490r1491
627627   3,
628628   { 0, 0x4000*8, 0x4000*8+4 },
629629   { STEP4(128*0+3,-1), STEP4(128*1+3,-1), STEP4(128*2+3,-1), STEP4(128*3+3,-1) },
630   { STEP16(1*8,8) },
630   { STEP8(1*8,8), STEP4(1*8+8*8,8), STEP2(1*8+12*8,8) },
631631   64*8
632632};
633633
src/mame/drivers/neodrvr.c
r1490r1491
66
77****************************************************************************/
88
9
109static INPUT_PORTS_START( svcpcb )
1110   STANDARD_IN0
1211
r1490r1491
7069   PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8")
7170   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
7271   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
73   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mahjong_controller_r, 0)
72   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mahjong_controller_r, 0 )
7473
7574   STANDARD_IN1
7675
r1490r1491
144143   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED )
145144   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )
146145   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
147   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0)
146   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0 )
148147   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
149148
150149   STANDARD_IN3
r1490r1491
232231   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
233232   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
234233   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */
235   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0)
234   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0 )
236235   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
237236
238237   PORT_START_TAG("IN3")
239238   PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
240   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, 0)
241   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, 0)
239   PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, 0 )
240   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, 0 )
242241
243242   STANDARD_IN4
244243
r1490r1491
271270   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7)
272271   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */
273272   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8)
274   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0)
273   PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, 0 )
275274   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
276275
277276   STANDARD_IN3
r1490r1491
67796778static DRIVER_INIT( kof2002 )
67806779{
67816780   kof2002_decrypt_68k();
6782   neo_pcm2_swap(0);
6781   neo_pcm2_swap(0 );
67836782   kof2000_neogeo_gfx_decrypt(0xec);
67846783   driver_init_neogeo(machine);
67856784}
r1490r1491
67876786static DRIVER_INIT( kf2k2pls )
67886787{
67896788   kof2002_decrypt_68k();
6790   neo_pcm2_swap(0);
6789   neo_pcm2_swap(0 );
67916790   cmc50_neogeo_gfx_decrypt(0xec);
67926791   driver_init_neogeo(machine);
67936792}
r1490r1491
67956794static DRIVER_INIT( kf2k2mp )
67966795{
67976796   kf2k2mp_decrypt();
6798   neo_pcm2_swap(0);
6797   neo_pcm2_swap(0 );
67996798   neogeo_bootleg_sx_decrypt(2);
68006799   cmc50_neogeo_gfx_decrypt(0xec);
68016800   driver_init_neogeo(machine);
r1490r1491
68046803static DRIVER_INIT( kof2km2 )
68056804{
68066805   kof2km2_px_decrypt();
6807   neo_pcm2_swap(0);
6806   neo_pcm2_swap(0 );
68086807   neogeo_bootleg_sx_decrypt(1);
68096808   cmc50_neogeo_gfx_decrypt(0xec);
68106809   driver_init_neogeo(machine);
r1490r1491
68716870{
68726871   /* start a timer that will check the BIOS select DIP every second */
68736872   timer_pulse(ATTOTIME_IN_MSEC(1000), NULL, 0, svcpcb_bios_timer_callback);
6874   svcpcb_bios_timer_callback(machine, NULL, 0);
6873   svcpcb_bios_timer_callback(machine, NULL, 0 );
68756874
68766875   svcchaos_px_decrypt();
68776876   svcpcb_gfx_decrypt();
r1490r1491
71327131GAME( 1990, neogeo, 0, neogeo, neogeo, neogeo, ROT0, "SNK", "Neo-Geo", GAME_IS_BIOS_ROOT )
71337132
71347133/* SNK */
7135GAME( 1990, nam1975,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "NAM-1975", 0 )
7134GAME( 1990, nam1975,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "NAM-1975", 0 )
71367135GAME( 1990, bstars,   neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Baseball Stars Professional", 0 )
7137GAME( 1990, tpgolf,   neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Top Player's Golf", 0 )
7138GAME( 1990, mahretsu, neogeo, neogeo_s, mjneogeo,neogeo,   ROT0, "SNK", "Mahjong Kyoretsuden", 0 )
7139GAME( 1990, ridhero,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Riding Hero (set 1)", 0 )
7140GAME( 1990, ridheroh, ridhero, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Riding Hero (set 2)", 0 )
7141GAME( 1991, alpham2,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Alpha Mission II / ASO II - Last Guardian", 0 )
7142GAME( 1990, cyberlip, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Cyber-Lip", 0 )
7143GAME( 1990, superspy, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The Super Spy", 0 )
7144GAME( 1992, mutnat,   neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Mutation Nation", 0 )
7145GAME( 1991, kotm,     neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters (set 1)", 0 )
7146GAME( 1991, kotmh,    kotm, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters (set 2)", 0 )
7136GAME( 1990, tpgolf,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Top Player's Golf", 0 )
7137GAME( 1990, mahretsu, neogeo, neogeo, mjneogeo,neogeo,   ROT0, "SNK", "Mahjong Kyoretsuden", 0 )
7138GAME( 1990, ridhero,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Riding Hero (set 1)", 0 )
7139GAME( 1990, ridheroh, ridhero, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Riding Hero (set 2)", 0 )
7140GAME( 1991, alpham2,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Alpha Mission II / ASO II - Last Guardian", 0 )
7141GAME( 1990, cyberlip, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Cyber-Lip", 0 )
7142GAME( 1990, superspy, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The Super Spy", 0 )
7143GAME( 1992, mutnat,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Mutation Nation", 0 )
7144GAME( 1991, kotm,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters (set 1)", 0 )
7145GAME( 1991, kotmh,    kotm, neogeo, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters (set 2)", 0 )
71477146GAME( 1991, sengoku,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Sengoku / Sengoku Denshou (set 1)", 0 )
71487147GAME( 1991, sengokh,  sengoku, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Sengoku / Sengoku Denshou (set 2)", 0 )
7149GAME( 1991, burningf, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Burning Fight (set 1)", 0 )
7150GAME( 1991, burningh, burningf, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Burning Fight (set 2)", 0 )
7151GAME( 1990, lbowling, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "League Bowling", 0 )
7152GAME( 1991, gpilots,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Ghost Pilots", 0 )
7153GAME( 1990, joyjoy,   neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Puzzled / Joy Joy Kid", 0 )
7154GAME( 1991, quizdais, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Quiz Daisousa Sen - The Last Count Down", 0 )
7155GAME( 1992, lresort,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Last Resort", 0 )
7148GAME( 1991, burningf, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Burning Fight (set 1)", 0 )
7149GAME( 1991, burningh, burningf, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Burning Fight (set 2)", 0 )
7150GAME( 1990, lbowling, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "League Bowling", 0 )
7151GAME( 1991, gpilots,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Ghost Pilots", 0 )
7152GAME( 1990, joyjoy,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Puzzled / Joy Joy Kid", 0 )
7153GAME( 1991, quizdais, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Quiz Daisousa Sen - The Last Count Down", 0 )
7154GAME( 1992, lresort,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Last Resort", 0 )
71567155GAME( 1991, eightman, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK / Pallas", "Eight Man", 0 )
7157GAME( 1991, legendos, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Legend of Success Joe / Ashitano Joe Densetsu", 0 )
7158GAME( 1991, 2020bb,   neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 1)", 0 )
7159GAME( 1991, 2020bba,  2020bb, neogeo_s, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 2)", 0 )
7160GAME( 1991, 2020bbh,  2020bb, neogeo_s, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 3)", 0 )
7161GAME( 1991, socbrawl, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Soccer Brawl (set 1)", 0 )
7162GAME( 1991, socbrala, socbrawl, neogeo_s, neogeo,  neogeo, ROT0, "SNK", "Soccer Brawl (set 2)", 0 )
7156GAME( 1991, legendos, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Legend of Success Joe / Ashitano Joe Densetsu", 0 )
7157GAME( 1991, 2020bb,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 1)", 0 )
7158GAME( 1991, 2020bba,  2020bb, neogeo, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 2)", 0 )
7159GAME( 1991, 2020bbh,  2020bb, neogeo, neogeo,  neogeo,   ROT0, "SNK / Pallas", "2020 Super Baseball (set 3)", 0 )
7160GAME( 1991, socbrawl, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Soccer Brawl (set 1)", 0 )
7161GAME( 1991, socbrala, socbrawl, neogeo, neogeo,  neogeo, ROT0, "SNK", "Soccer Brawl (set 2)", 0 )
71637162GAME( 1991, fatfury1, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury - King of Fighters / Garou Densetsu - shukumei no tatakai", 0 )
7164GAME( 1991, roboarmy, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Robo Army (set 1)", 0 )
7165GAME( 1991, roboarma, roboarmy, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Robo Army (set 2)", 0 )
7166GAME( 1992, fbfrenzy, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Football Frenzy", 0 )
7167GAME( 1992, kotm2,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters 2 - The Next Thing", 0 )
7168GAME( 1993, sengoku2, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Sengoku 2 / Sengoku Denshou 2", 0)
7169GAME( 1992, bstars2,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Baseball Stars 2", 0 )
7163GAME( 1991, roboarmy, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Robo Army (set 1)", 0 )
7164GAME( 1991, roboarma, roboarmy, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Robo Army (set 2)", 0 )
7165GAME( 1992, fbfrenzy, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Football Frenzy", 0 )
7166GAME( 1992, kotm2,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "King of the Monsters 2 - The Next Thing", 0 )
7167GAME( 1993, sengoku2, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Sengoku 2 / Sengoku Denshou 2", 0 )
7168GAME( 1992, bstars2,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Baseball Stars 2", 0 )
71707169GAME( 1992, quizdai2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Quiz Meitantei Neo & Geo - Quiz Daisousa Sen part 2", 0 )
71717170GAME( 1993, 3countb,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "3 Count Bout / Fire Suplex", 0 )
7172GAME( 1992, aof,      neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting / Ryuuko no Ken", 0 )
7171GAME( 1992, aof,      neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting / Ryuuko no Ken", 0 )
71737172GAME( 1993, samsho,   neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown / Samurai Spirits", 0 )
71747173GAME( 1994, tophuntr, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 1)", 0 )
71757174GAME( 1994, tophunta, tophuntr, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Top Hunter - Roddy & Cathy (set 2)", 0 )
71767175GAME( 1992, fatfury2, neogeo, neogeo,   neogeo,  fatfury2, ROT0, "SNK", "Fatal Fury 2 / Garou Densetsu 2 - arata-naru tatakai", 0 )
7177GAME( 1992, ssideki,  neogeo, neogeo_s, neogeo,  fatfury2, ROT0, "SNK", "Super Sidekicks / Tokuten Ou", 0 )
7178GAME( 1994, kof94,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '94", 0 )
7179GAME( 1994, aof2,     neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 1)", 0 )
7180GAME( 1994, aof2a,    aof2, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 2)", 0 )
7176GAME( 1992, ssideki,  neogeo, neogeo, neogeo,  fatfury2, ROT0, "SNK", "Super Sidekicks / Tokuten Ou", 0 )
7177GAME( 1994, kof94,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '94", 0 )
7178GAME( 1994, aof2,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 1)", 0 )
7179GAME( 1994, aof2a,    aof2, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 2 / Ryuuko no Ken 2 (set 2)", 0 )
71817180GAME( 1993, fatfursp, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 1)", 0 )
71827181GAME( 1993, fatfursa, fatfursp, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury Special / Garou Densetsu Special (set 2)", 0 )
7183GAME( 1995, savagere, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Savage Reign / Fu'un Mokushiroku - kakutou sousei", 0 )
7182GAME( 1995, savagere, neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Savage Reign / Fu'un Mokushiroku - kakutou sousei", 0 )
71847183GAME( 1994, ssideki2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Super Sidekicks 2 - The World Championship / Tokuten Ou 2 - real fight football", 0 )
71857184GAME( 1994, samsho2,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown II / Shin Samurai Spirits - Haohmaru jigokuhen", 0 )
71867185/* Jin Saulabi Tu Hon (Samurai shodown 2) - Korean censored version - http://www.kmrb.or.kr/Game_Image/1999/%EC%A0%9C1273%ED%98%B8.jpg */
71877186GAME( 1995, fatfury3, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Fatal Fury 3 - Road to the Final Victory / Garou Densetsu 3 - haruka-naru tatakai", 0 )
71887187GAME( 1995, ssideki3, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Super Sidekicks 3 - The Next Glory / Tokuten Ou 3 - eikoue no michi", 0 )
7189GAME( 1995, kof95,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 1)", 0 )
7190GAME( 1995, kof95a,   kof95, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 2)", 0 )
7191GAME( 1995, samsho3,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 1)", 0 )
7192GAME( 1995, samsho3a, samsho3, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 )
7193GAME( 1995, fswords,  samsho3, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", 0 )
7188GAME( 1995, kof95,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 1)", 0 )
7189GAME( 1995, kof95a,   kof95, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '95 (set 2)", 0 )
7190GAME( 1995, samsho3,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 1)", 0 )
7191GAME( 1995, samsho3a, samsho3, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown III / Samurai Spirits - Zankurou Musouken (set 2)", 0 )
7192GAME( 1995, fswords,  samsho3, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Fighters Swords (Korean release of Samurai Shodown III)", 0 )
71947193GAME( 1995, rbff1,    neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury / Real Bout Garou Densetsu", 0 )
7195GAME( 1996, aof3,     neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden", 0 )
7196GAME( 1996, aof3k,    aof3, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", 0 ) // no Japanese title / mode
7197GAME( 1996, kof96,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 1)", 0 )
7198GAME( 1996, kof96h,   kof96, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 2)", 0 )
7194GAME( 1996, aof3,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior / Art of Fighting - Ryuuko no Ken Gaiden", 0 )
7195GAME( 1996, aof3k,    aof3, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Art of Fighting 3 - The Path of the Warrior (Korean release)", 0 ) // no Japanese title / mode
7196GAME( 1996, kof96,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 1)", 0 )
7197GAME( 1996, kof96h,   kof96, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '96 (set 2)", 0 )
71997198GAME( 1996, ssideki4, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Ultimate 11 - The SNK Football Championship / Tokuten Ou - Honoo no Libero, The", 0 )
7200GAME( 1996, kizuna,   neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", 0 )
7199GAME( 1996, kizuna,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Kizuna Encounter - Super Tag Battle / Fu'un Super Tag Battle", 0 )
72017200GAME( 1996, samsho4,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Samurai Shodown IV - Amakusa's Revenge / Samurai Spirits - Amakusa Kourin", 0 )
72027201/* Pae Wang Jeon Seol / Legend of Warrior - Korean / Chinese censored version of SamSho4, see http://www.kmrb.or.kr/Game_Image/1999/%EC%A0%9C2064%ED%98%B8.jpg */
72037202GAME( 1996, rbffspec, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury Special / Real Bout Garou Densetsu Special", 0 )
7204GAME( 1997, kof97,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 1)", 0 )
7205GAME( 1997, kof97a,   kof97, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 2)", 0 )
7206GAME( 1997, kof97pls, kof97, neogeo_s, neogeo,  neogeo,   ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", 0 )
7207GAME( 1997, kog,      kof97, neogeo_s, kog,     kog,      ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING ) // protected bootleg
7203GAME( 1997, kof97,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 1)", 0 )
7204GAME( 1997, kof97a,   kof97, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '97 (set 2)", 0 )
7205GAME( 1997, kof97pls, kof97, neogeo, neogeo,  neogeo,   ROT0, "bootleg", "The King of Fighters '97 Plus (bootleg)", 0 )
7206GAME( 1997, kog,      kof97, neogeo, kog,     kog,      ROT0, "bootleg", "King of Gladiator (The King of Fighters '97 bootleg)", GAME_NOT_WORKING) // protected bootleg
72087207GAME( 1997, lastblad, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 1)", 0 )
72097208GAME( 1997, lastbldh, lastblad, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Last Blade / Bakumatsu Roman - Gekka no Kenshi, The (set 2)", 0 )
72107209GAME( 1997, lastsold, lastblad, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "The Last Soldier (Korean release of The Last Blade)", 0 )
7211GAME( 1997, irrmaze,  neogeo, neogeo_s, irrmaze, neogeo,   ROT0, "SNK / Saurus", "The Irritating Maze / Ultra Denryu Iraira Bou", 0 )
7210GAME( 1997, irrmaze,  neogeo, neogeo, irrmaze, neogeo,   ROT0, "SNK / Saurus", "The Irritating Maze / Ultra Denryu Iraira Bou", 0 )
72127211GAME( 1998, rbff2,    neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 1)", 0 )
72137212GAME( 1998, rbff2h,   rbff2, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers / Real Bout Garou Densetsu 2 - the newcomers (set 2)", 0 )
72147213GAME( 1998, rbff2k,   rbff2, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Real Bout Fatal Fury 2 - The Newcomers (Korean release)", 0 ) // no Japanese title / mode
7215GAME( 1998, mslug2,   neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "Metal Slug 2 - Super Vehicle-001/II", 0 )
7216GAME( 1998, kof98,    neogeo, neogeo_s, neogeo,  kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends", 0 )
7217GAME( 1998, kof98k,   kof98, neogeo_s, neogeo,  kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board)", 0 )
7218GAME( 1998, kof98n,   kof98, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (not encrypted)", 0 )
7214GAME( 1998, mslug2,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "SNK", "Metal Slug 2 - Super Vehicle-001/II", 0 )
7215GAME( 1998, kof98,    neogeo, neogeo, neogeo,  kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends", 0 )
7216GAME( 1998, kof98k,   kof98, neogeo, neogeo,  kof98,    ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (Korean board)", 0 )
7217GAME( 1998, kof98n,   kof98, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '98 - The Slugfest / King of Fighters '98 - dream match never ends (not encrypted)", 0 )
72197218GAME( 1998, lastbld2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Last Blade 2 / Bakumatsu Roman - Dai Ni Maku Gekka no Kenshi, The", 0 )
72207219GAME( 1998, neocup98, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Neo-Geo Cup '98 - The Road to the Victory", 0 )
7221GAME( 1999, mslugx,   neogeo, neogeo_s, neogeo,  mslugx,   ROT0, "SNK", "Metal Slug X - Super Vehicle-001", 0 )
7222GAME( 1999, kof99,    neogeo, neogeo_s, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , 0) /* Encrypted Code & GFX */
7223GAME( 1999, kof99a,   kof99, neogeo_s, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 2)" , 0) /* Encrypted Code & GFX, crashes going into attract demo */
7224GAME( 1999, kof99e,   kof99, neogeo_s, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (earlier)" , 0) /* Encrypted Code & GFX */
7225GAME( 1999, kof99n,   kof99, neogeo_s, neogeo,  kof99n,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (not encrypted)" , 0)   /* Encrypted GFX */
7226GAME( 1999, kof99p,   kof99, neogeo_s, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (prototype)", 0 )
7227GAME( 1999, garou,    neogeo, neogeo,   neogeo,  garou,    ROT0, "SNK", "Garou - Mark of the Wolves (set 1)" , 0) /* Encrypted Code & GFX */
7228GAME( 1999, garouo,   garou, neogeo,   neogeo,  garouo,   ROT0, "SNK", "Garou - Mark of the Wolves (set 2)" , 0) /* Encrypted Code & GFX */
7220GAME( 1999, mslugx,   neogeo, neogeo, neogeo,  mslugx,   ROT0, "SNK", "Metal Slug X - Super Vehicle-001", 0 )
7221GAME( 1999, kof99,    neogeo, neogeo, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 1)" , 0 ) /* Encrypted Code & GFX */
7222GAME( 1999, kof99a,   kof99, neogeo, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (set 2)" , 0 ) /* Encrypted Code & GFX, crashes going into attract demo */
7223GAME( 1999, kof99e,   kof99, neogeo, neogeo,  kof99,    ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (earlier)" , 0 ) /* Encrypted Code & GFX */
7224GAME( 1999, kof99n,   kof99, neogeo, neogeo,  kof99n,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (not encrypted)" , 0 )   /* Encrypted GFX */
7225GAME( 1999, kof99p,   kof99, neogeo, neogeo,  neogeo,   ROT0, "SNK", "The King of Fighters '99 - Millennium Battle (prototype)", 0 )
7226GAME( 1999, garou,    neogeo, neogeo,   neogeo,  garou,    ROT0, "SNK", "Garou - Mark of the Wolves (set 1)" , 0 ) /* Encrypted Code & GFX */
7227GAME( 1999, garouo,   garou, neogeo,   neogeo,  garouo,   ROT0, "SNK", "Garou - Mark of the Wolves (set 2)" , 0 ) /* Encrypted Code & GFX */
72297228GAME( 1999, garoup,   garou, neogeo,   neogeo,  neogeo,   ROT0, "SNK", "Garou - Mark of the Wolves (prototype)", 0 )
72307229GAME( 1999, garoubl,  garou, neogeo,   neogeo,  garoubl,  ROT0, "bootleg", "Garou - Mark of the Wolves (bootleg)", 0 ) /* Bootleg of garoup */
7231GAME( 2000, mslug3,   neogeo, neogeo_s, neogeo,  mslug3,   ROT0, "SNK", "Metal Slug 3" , 0) /* Encrypted Code & GFX */
7232GAME( 2000, mslug3n,  mslug3, neogeo_s, neogeo,  mslug3n,  ROT0, "SNK", "Metal Slug 3 (not encrypted)" , 0) /* Encrypted GFX */
7230GAME( 2000, mslug3,   neogeo, neogeo, neogeo,  mslug3,   ROT0, "SNK", "Metal Slug 3" , 0 ) /* Encrypted Code & GFX */
7231GAME( 2000, mslug3n,  mslug3, neogeo, neogeo,  mslug3n,  ROT0, "SNK", "Metal Slug 3 (not encrypted)" , 0 ) /* Encrypted GFX */
72337232GAME( 2000, mslug3b6, mslug3, neogeo,   neogeo,  mslug3b6, ROT0, "bootleg", "Metal Slug 6 (Metal Slug 3 bootleg)", 0 ) /* real Metal Slug 6 is an Atomiswave HW game, see atomswav.c ;-) */
7234GAME( 2000, kof2000,  neogeo, neogeo_s, neogeo,  kof2000,  ROT0, "SNK", "The King of Fighters 2000" , 0) /* Encrypted Code & GFX */
7235GAME( 2000, kof2000n, kof2000, neogeo_s, neogeo,  kof2000n, ROT0, "SNK", "The King of Fighters 2000 (not encrypted)" , 0) /* Encrypted GFX */
7236GAME( 2001, zupapa,   neogeo, neogeo_s, neogeo,  zupapa,   ROT0, "SNK", "Zupapa!" , 0)   /* Encrypted GFX */
7237GAME( 2001, sengoku3, neogeo, neogeo,   neogeo,  sengoku3, ROT0, "SNK", "Sengoku 3" , 0)   /* Encrypted GFX */
7238GAME( 2001, kof2001,  neogeo, neogeo_s, neogeo,  kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 1)" , 0) /* Encrypted GFX */
7239GAME( 2001, kof2001h, kof2001, neogeo_s, neogeo,  kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 2)" , 0) /* Encrypted GFX */
7240GAME( 2003, cthd2003, kof2001, neogeo_s, neogeo,  cthd2003, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7241GAME( 2003, ct2k3sp,  kof2001, neogeo_s, neogeo,  ct2k3sp,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7242GAME( 2003, ct2k3sa,  kof2001, neogeo_s, neogeo,  ct2k3sa,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus alternate (The King of Fighters 2001 bootleg)", 0 ) /* Hack / Bootleg of kof2001 */
7243GAME( 2002, kof2002,  neogeo, neogeo_s, neogeo,  kof2002,  ROT0, "Eolith / Playmore", "The King of Fighters 2002" , 0) /* Encrypted GFX */
7244GAME( 2002, kf2k2pls, kof2002, neogeo_s, neogeo,  kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (set 1, bootleg)" , 0) /* Encrypted GFX */
7245GAME( 2002, kf2k2pla, kof2002, neogeo_s, neogeo,  kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (set 2, bootleg)" , 0) /* Encrypted GFX */
7246GAME( 2002, kf2k2mp,  kof2002, neogeo_s, neogeo,  kf2k2mp,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus (bootleg)" , 0) /* Encrypted GFX */
7247GAME( 2002, kf2k2mp2, kof2002, neogeo_s, neogeo,  kof2km2,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus II (bootleg)" , 0) /* Encrypted GFX */
7248GAME( 2002, kof10th,  kof2002, neogeo_s, neogeo,  kof10th,  ROT0, "bootleg", "The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7249GAME( 2004, kf2k5uni, kof2002, neogeo_s, neogeo,  kf2k5uni, ROT0, "bootleg", "The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7250GAME( 2005, kf10thep, kof2002, neogeo_s, neogeo,  kf10thep, ROT0, "bootleg", "The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7251GAME( 2004, kof2k4se, kof2002, neogeo_s, neogeo,  kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", 0 ) /* Hack / Bootleg of kof2002 */
7252GAME( 2003, mslug5,   neogeo, neogeo_s, neogeo,  mslug5,   ROT0, "SNK Playmore", "Metal Slug 5", 0 )
7253GAME ( 2003, ms5pcb,   0,                neogeo_s, neogeo,  ms5pcb,   ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 )
7254GAME( 2003, ms5plus,  mslug5, neogeo_s, neogeo,  ms5plus,  ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)",0 )
7255GAME ( 2003, svcpcb,   0,                neogeo_s, svcpcb,  svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7256GAME ( 2003, svcpcba,  svcpcb,           neogeo_s, svcpcb,  svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 2)" , 0 ) /* Encrypted Code */
7257GAME( 2003, svc,      neogeo, neogeo_s, neogeo,  svc,      ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS", 0 )
7258GAME( 2003, svcboot,  svc, neogeo_s, neogeo,  svcboot,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS (bootleg)",0 )
7259GAME( 2003, svcplus,  svc, neogeo_s, neogeo,  svcplus,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (set 1, bootleg)",0 )
7260GAME( 2003, svcplusa, svc, neogeo_s, neogeo,  svcplusa, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (set 2, bootleg)",0 )
7261GAME( 2003, svcsplus, svc, neogeo_s, neogeo,  svcsplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg)",0 )
7262GAME( 2003, samsho5,  neogeo, neogeo_s, neogeo,  samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 1)", 0 )
7263GAME( 2003, samsho5h, samsho5, neogeo_s, neogeo,  samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 2)", 0 )
7264GAME( 2003, samsho5b, samsho5, neogeo_s, neogeo,  samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", 0 ) // different program scrambling
7265GAME ( 2003, kf2k3pcb, 0,                neogeo_s, neogeo,  kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7266GAME( 2003, kof2003,  neogeo, neogeo_s, neogeo,  kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003 (World / US, MVS)", 0 )
7267GAME( 2003, kf2k3bl,  kof2003, neogeo_s, neogeo,  kof2003b, ROT0, "bootleg", "The King of Fighters 2003 (bootleg, set 1)",0 ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?)
7268GAME( 2003, kf2k3bla, kof2003, neogeo_s, neogeo,  kof2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg, set 2)",0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7269GAME( 2003, kf2k3pl,  kof2003, neogeo_s, neogeo,  kof2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)",0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7270GAME( 2003, kf2k3upl, kof2003, neogeo_s, neogeo,  kof2k3up, ROT0, "bootleg", "The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg)",0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7271GAME( 2003, samsh5sp, neogeo, neogeo_s, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 1, uncensored)", 0 )
7272GAME( 2003, samsh5sh, samsh5sp, neogeo_s, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 2, censored)", 0 )
7273GAME( 2003, samsh5sn, samsh5sp, neogeo_s, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 3, less censored)", 0 )
7233GAME( 2000, kof2000,  neogeo, neogeo, neogeo,  kof2000,  ROT0, "SNK", "The King of Fighters 2000" , 0 ) /* Encrypted Code & GFX */
7234GAME( 2000, kof2000n, kof2000, neogeo, neogeo,  kof2000n, ROT0, "SNK", "The King of Fighters 2000 (not encrypted)" , 0 ) /* Encrypted GFX */
7235GAME( 2001, zupapa,   neogeo, neogeo, neogeo,  zupapa,   ROT0, "SNK", "Zupapa!" , 0 )   /* Encrypted GFX */
7236GAME( 2001, sengoku3, neogeo, neogeo,   neogeo,  sengoku3, ROT0, "SNK", "Sengoku 3" , 0 )   /* Encrypted GFX */
7237GAME( 2001, kof2001,  neogeo, neogeo, neogeo,  kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 1)" , 0 ) /* Encrypted GFX */
7238GAME( 2001, kof2001h, kof2001, neogeo, neogeo,  kof2001,  ROT0, "Eolith / SNK", "The King of Fighters 2001 (set 2)" , 0 ) /* Encrypted GFX */
7239GAME( 2003, cthd2003, kof2001, neogeo, neogeo,  cthd2003, ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7240GAME( 2003, ct2k3sp,  kof2001, neogeo, neogeo,  ct2k3sp,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus (The King of Fighters 2001 bootleg)", 0 ) /* Protected Hack / Bootleg of kof2001 */
7241GAME( 2003, ct2k3sa,  kof2001, neogeo, neogeo,  ct2k3sa,  ROT0, "bootleg", "Crouching Tiger Hidden Dragon 2003 Super Plus alternate (The King of Fighters 2001 bootleg)", 0 ) /* Hack / Bootleg of kof2001 */
7242GAME( 2002, kof2002,  neogeo, neogeo, neogeo,  kof2002,  ROT0, "Eolith / Playmore", "The King of Fighters 2002" , 0 ) /* Encrypted GFX */
7243GAME( 2002, kf2k2pls, kof2002, neogeo, neogeo,  kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (set 1, bootleg)" , 0 ) /* Encrypted GFX */
7244GAME( 2002, kf2k2pla, kof2002, neogeo, neogeo,  kf2k2pls, ROT0, "bootleg", "The King of Fighters 2002 Plus (set 2, bootleg)" , 0 ) /* Encrypted GFX */
7245GAME( 2002, kf2k2mp,  kof2002, neogeo, neogeo,  kf2k2mp,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus (bootleg)" , 0 ) /* Encrypted GFX */
7246GAME( 2002, kf2k2mp2, kof2002, neogeo, neogeo,  kof2km2,  ROT0, "bootleg", "The King of Fighters 2002 Magic Plus II (bootleg)" , 0 ) /* Encrypted GFX */
7247GAME( 2002, kof10th,  kof2002, neogeo, neogeo,  kof10th,  ROT0, "bootleg", "The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7248GAME( 2004, kf2k5uni, kof2002, neogeo, neogeo,  kf2k5uni, ROT0, "bootleg", "The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7249GAME( 2005, kf10thep, kof2002, neogeo, neogeo,  kf10thep, ROT0, "bootleg", "The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg)", 0 ) // fake SNK copyright
7250GAME( 2004, kof2k4se, kof2002, neogeo, neogeo,  kof2k4se, ROT0, "bootleg", "The King of Fighters Special Edition 2004 (The King of Fighters 2002 bootleg)", 0 ) /* Hack / Bootleg of kof2002 */
7251GAME( 2003, mslug5,   neogeo, neogeo, neogeo,  mslug5,   ROT0, "SNK Playmore", "Metal Slug 5", 0 )
7252GAME( 2003, ms5pcb,   0,                neogeo, neogeo,  ms5pcb,   ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", 0 )
7253GAME( 2003, ms5plus,  mslug5, neogeo, neogeo,  ms5plus,  ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)",0 )
7254GAME( 2003, svcpcb,   0,                neogeo, svcpcb,  svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7255GAME( 2003, svcpcba,  svcpcb,           neogeo, svcpcb,  svcpcb,   ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS (JAMMA PCB, set 2)" , 0 ) /* Encrypted Code */
7256GAME( 2003, svc,      neogeo, neogeo, neogeo,  svc,      ROT0, "SNK Playmore", "SNK vs. CAPCOM SVC CHAOS", 0 )
7257GAME( 2003, svcboot,  svc, neogeo, neogeo,  svcboot,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS (bootleg)", 0 )
7258GAME( 2003, svcplus,  svc, neogeo, neogeo,  svcplus,  ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (set 1, bootleg)", 0 )
7259GAME( 2003, svcplusa, svc, neogeo, neogeo,  svcplusa, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Plus (set 2, bootleg)", 0 )
7260GAME( 2003, svcsplus, svc, neogeo, neogeo,  svcsplus, ROT0, "bootleg", "SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg)", 0 )
7261GAME( 2003, samsho5,  neogeo, neogeo, neogeo,  samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 1)", 0 )
7262GAME( 2003, samsho5h, samsho5, neogeo, neogeo,  samsho5,  ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (set 2)", 0 )
7263GAME( 2003, samsho5b, samsho5, neogeo, neogeo,  samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", 0 ) // different program scrambling
7264GAME( 2003, kf2k3pcb, 0,                neogeo, neogeo,  kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", 0 ) // not a clone of neogeo because it's NOT a neogeo cart.
7265GAME( 2003, kof2003,  neogeo, neogeo, neogeo,  kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003 (World / US, MVS)", 0 )
7266GAME( 2003, kf2k3bl,  kof2003, neogeo, neogeo,  kof2003b, ROT0, "bootleg", "The King of Fighters 2003 (bootleg, set 1)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?)
7267GAME( 2003, kf2k3bla, kof2003, neogeo, neogeo,  kof2k3pl, ROT0, "bootleg", "The King of Fighters 2003 (bootleg, set 2)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7268GAME( 2003, kf2k3pl,  kof2003, neogeo, neogeo,  kof2k3pl, ROT0, "bootleg", "The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7269GAME( 2003, kf2k3upl, kof2003, neogeo, neogeo,  kof2k3up, ROT0, "bootleg", "The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg)", 0 ) // zooming is wrong because its a bootleg of the pcb version on a cart
7270GAME( 2003, samsh5sp, neogeo, neogeo, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 1, uncensored)", 0 )
7271GAME( 2003, samsh5sh, samsh5sp, neogeo, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 2, censored)", 0 )
7272GAME( 2003, samsh5sn, samsh5sp, neogeo, neogeo,  samsh5sp, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V Special / Samurai Spirits Zero Special (set 3, less censored)", 0 )
72747273
72757274/* there are other bootlegs kof2002b etc. kof96ep, matrimbl?, kf2k1pls -- work out which should be supported */
72767275
72777276/* Alpha Denshi Co. / ADK (changed name in 1993) */
72787277GAME( 1990, maglord,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Magician Lord (set 1)", 0 )
72797278GAME( 1990, maglordh, maglord, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Magician Lord (set 2)", 0 )
7280GAME( 1990, ncombat,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 1)", 0 )
7281GAME( 1990, ncombath, ncombat, neogeo_s, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 2)", 0 )
7279GAME( 1990, ncombat,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 1)", 0 )
7280GAME( 1990, ncombath, ncombat, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Combat (set 2)", 0 )
72827281GAME( 1990, bjourney, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Blue's Journey / Raguy", 0 )
7283GAME( 1991, crsword,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Crossed Swords", 0 )
7282GAME( 1991, crsword,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Crossed Swords", 0 )
72847283GAME( 1991, trally,   neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Thrash Rally", 0 )
7285GAME( 1992, ncommand, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Commando", 0 )
7284GAME( 1992, ncommand, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "Ninja Commando", 0 )
72867285GAME( 1992, wh1,      neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 1)", 0 )
72877286GAME( 1992, wh1h,     wh1, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 2)", 0 )
72887287GAME( 1992, wh1ha,    wh1, neogeo,   neogeo,  neogeo,   ROT0, "Alpha Denshi Co.", "World Heroes (set 3)", 0 )
7289GAME( 1993, wh2,      neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "ADK",              "World Heroes 2", 0 )
7290GAME( 1994, wh2j,     neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 1)", 0 )
7291GAME( 1994, wh2jh,    wh2j, neogeo_s, neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 2)", 0 )
7292GAME( 1994, aodk,     neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "ADK / SNK",        "Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku", 0 )
7288GAME( 1993, wh2,      neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK",              "World Heroes 2", 0 )
7289GAME( 1994, wh2j,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 1)", 0 )
7290GAME( 1994, wh2jh,    wh2j, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes 2 Jet (set 2)", 0 )
7291GAME( 1994, aodk,     neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "Aggressors of Dark Kombat / Tsuukai GANGAN Koushinkyoku", 0 )
72937292GAME( 1995, whp,      neogeo, neogeo,   neogeo,  neogeo,   ROT0, "ADK / SNK",        "World Heroes Perfect", 0 )
7294GAME( 1995, mosyougi, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "ADK / SNK",        "Syougi No Tatsujin - Master of Syougi", 0 )
7295GAME( 1996, overtop,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "ADK",              "Over Top", 0 )
7293GAME( 1995, mosyougi, neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK / SNK",        "Syougi No Tatsujin - Master of Syougi", 0 )
7294GAME( 1996, overtop,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK",              "Over Top", 0 )
72967295GAME( 1996, ninjamas, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "ADK / SNK",        "Ninja Master's - haoh-ninpo-cho", 0 )
7297GAME( 1996, twinspri, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "ADK",              "Twinkle Star Sprites", 0 )
7298GAME( 1996, zintrckb, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "hack / bootleg",   "Zintrick / Oshidashi Zentrix (hack / bootleg)", 0 )
7296GAME( 1996, twinspri, neogeo, neogeo, neogeo,  neogeo,   ROT0, "ADK",              "Twinkle Star Sprites", 0 )
7297GAME( 1996, zintrckb, neogeo, neogeo, neogeo,  neogeo,   ROT0, "hack / bootleg",   "Zintrick / Oshidashi Zentrix (hack / bootleg)", 0 )
72997298
73007299/* Aicom */
73017300GAME( 1994, janshin,  neogeo, neogeo,   mjneogeo,neogeo,   ROT0, "Aicom", "Jyanshin Densetsu - Quest of Jongmaster", 0 )
73027301GAME( 1995, pulstar,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Aicom", "Pulstar", 0 )
73037302
73047303/* Data East Corporation */
7305GAME( 1993, spinmast, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Data East Corporation", "Spin Master / Miracle Adventure", 0 )
7306GAME( 1994, wjammers, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Data East Corporation", "Windjammers / Flying Power Disc", 0 )
7307GAME( 1994, karnovr,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Data East Corporation", "Karnov's Revenge / Fighter's History Dynamite", 0 )
7308GAME( 1994, strhoop,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Data East Corporation", "Street Hoop / Street Slam / Dunk Dream", 0 )
7309GAME( 1996, ghostlop, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Data East Corporation", "Ghostlop (prototype)", 0 )
7310GAME( 1996, magdrop2, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Data East Corporation", "Magical Drop II", 0 )
7311GAME( 1997, magdrop3, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Data East Corporation", "Magical Drop III", 0 )
7304GAME( 1993, spinmast, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Spin Master / Miracle Adventure", 0 )
7305GAME( 1994, wjammers, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Windjammers / Flying Power Disc", 0 )
7306GAME( 1994, karnovr,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Karnov's Revenge / Fighter's History Dynamite", 0 )
7307GAME( 1994, strhoop,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Street Hoop / Street Slam / Dunk Dream", 0 )
7308GAME( 1996, ghostlop, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Ghostlop (prototype)", 0 )
7309GAME( 1996, magdrop2, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Magical Drop II", 0 )
7310GAME( 1997, magdrop3, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Data East Corporation", "Magical Drop III", 0 )
73127311
73137312/* Eleven */
7314GAME( 2000, nitd,     neogeo, neogeo,   neogeo,  nitd,     ROT0, "Eleven / Gavaking", "Nightmare in the Dark" , 0) /* Encrypted GFX */
7315GAME( 2001, nitdbl,   nitd,   neogeo,   neogeo,  neogeo,   ROT0, "bootleg", "Nightmare in the Dark (bootleg)" , 0)
7313GAME( 2000, nitd,     neogeo, neogeo,   neogeo,  nitd,     ROT0, "Eleven / Gavaking", "Nightmare in the Dark" , 0 ) /* Encrypted GFX */
7314GAME( 2001, nitdbl,   nitd,   neogeo,   neogeo,  neogeo,   ROT0, "bootleg", "Nightmare in the Dark (bootleg)" , 0 )
73167315
73177316/* Face */
7318GAME( 1994, gururin,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Face", "Gururin", 0 )
7319GAME( 1997, miexchng, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Face", "Money Puzzle Exchanger / Money Idol Exchanger", 0 )
7317GAME( 1994, gururin,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Face", "Gururin", 0 )
7318GAME( 1997, miexchng, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Face", "Money Puzzle Exchanger / Money Idol Exchanger", 0 )
73207319
73217320/* Hudson Soft */
7322GAME( 1994, panicbom, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Eighting / Hudson", "Panic Bomber", 0 )
7321GAME( 1994, panicbom, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Eighting / Hudson", "Panic Bomber", 0 )
73237322GAME( 1995, kabukikl, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Hudson", "Far East of Eden - Kabuki Klash / Tengai Makyou - Shin Den", 0 )
7324GAME( 1997, neobombe, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Hudson", "Neo Bomberman", 0 )
7323GAME( 1997, neobombe, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Hudson", "Neo Bomberman", 0 )
73257324
73267325/* Monolith Corp. */
7327GAME( 1990, minasan,  neogeo, neogeo_s, mjneogeo,neogeo,   ROT0, "Monolith Corp.", "Minnasanno Okagesamadesu", 0 )
7328GAME( 1991, bakatono, neogeo, neogeo_s, mjneogeo,neogeo,   ROT0, "Monolith Corp.", "Bakatonosama Mahjong Manyuki", 0 )
7326GAME( 1990, minasan,  neogeo, neogeo, mjneogeo,neogeo,   ROT0, "Monolith Corp.", "Minnasanno Okagesamadesu", 0 )
7327GAME( 1991, bakatono, neogeo, neogeo, mjneogeo,neogeo,   ROT0, "Monolith Corp.", "Bakatonosama Mahjong Manyuki", 0 )
73297328
73307329/* Nazca */
7331GAME( 1996, turfmast, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Nazca", "Neo Turf Masters / Big Tournament Golf", 0 )
7332GAME( 1996, mslug,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Nazca", "Metal Slug - Super Vehicle-001", 0 )
7330GAME( 1996, turfmast, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Nazca", "Neo Turf Masters / Big Tournament Golf", 0 )
7331GAME( 1996, mslug,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "Nazca", "Metal Slug - Super Vehicle-001", 0 )
73337332
73347333/* NMK */
7335GAME( 1994, zedblade, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "NMK", "Zed Blade / Operation Ragnarok", 0 )
7334GAME( 1994, zedblade, neogeo, neogeo, neogeo,  neogeo,   ROT0, "NMK", "Zed Blade / Operation Ragnarok", 0 )
73367335
73377336/* Psikyo */
7338GAME( 1999, s1945p,   neogeo, neogeo,   neogeo,  s1945p,   ROT0, "Psikyo", "Strikers 1945 Plus" , 0)   /* Encrypted GFX */
7337GAME( 1999, s1945p,   neogeo, neogeo,   neogeo,  s1945p,   ROT0, "Psikyo", "Strikers 1945 Plus" , 0 )   /* Encrypted GFX */
73397338
73407339/* Sammy */
7341GAME( 1992, viewpoin, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Sammy", "Viewpoint", 0 )
7340GAME( 1992, viewpoin, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Sammy", "Viewpoint", 0 )
73427341
73437342/* Saurus */
7344GAME( 1995, quizkof,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Saurus", "Quiz King of Fighters", 0 )
7343GAME( 1995, quizkof,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Quiz King of Fighters", 0 )
73457344GAME( 1995, stakwin,  neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Saurus", "Stakes Winner / Stakes Winner - GI kinzen seihae no michi", 0 )
73467345GAME( 1996, ragnagrd, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Saurus", "Ragnagard / Shin-Oh-Ken", 0 )
7347GAME( 1996, pgoal,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Saurus", "Pleasure Goal / Futsal - 5 on 5 Mini Soccer", 0 )
7346GAME( 1996, pgoal,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Pleasure Goal / Futsal - 5 on 5 Mini Soccer", 0 )
73487347GAME( 1996, stakwin2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Saurus", "Stakes Winner 2", 0 )
7349GAME( 1997, shocktro, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers (set 1)", 0 )
7350GAME( 1997, shocktra, shocktro, neogeo_s, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers (set 2)", 0 )
7351GAME( 1998, shocktr2, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers - 2nd Squad", 0 )
7352GAME( 1998, lans2004, shocktr2, neogeo_s, neogeo,  lans2004, ROT0, "bootleg", "Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg)", 0 )
7348GAME( 1997, shocktro, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers (set 1)", 0 )
7349GAME( 1997, shocktra, shocktro, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers (set 2)", 0 )
7350GAME( 1998, shocktr2, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Saurus", "Shock Troopers - 2nd Squad", 0 )
7351GAME( 1998, lans2004, shocktr2, neogeo, neogeo,  lans2004, ROT0, "bootleg", "Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg)", 0 )
73537352
73547353/* Sunsoft */
7355GAME( 1995, galaxyfg, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Sunsoft", "Galaxy Fight - Universal Warriors", 0 )
7356GAME( 1996, wakuwak7, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Sunsoft", "Waku Waku 7", 0 )
7354GAME( 1995, galaxyfg, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Sunsoft", "Galaxy Fight - Universal Warriors", 0 )
7355GAME( 1996, wakuwak7, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Sunsoft", "Waku Waku 7", 0 )
73577356
73587357/* Taito */
73597358GAME( 1994, pbobblen, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 1)", 0 )
73607359GAME( 1994, pbobblna, pbobblen, neogeo,   neogeo,  neogeo,   ROT0, "Taito", "Puzzle Bobble / Bust-A-Move (Neo-Geo) (set 2)", 0 )
7361GAME( 1999, pbobbl2n, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Taito (SNK license)", "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)", 0 )
7362GAME( 2003, pnyaa,    neogeo, neogeo_s, neogeo,  pnyaa,    ROT0, "Aiky / Taito", "Pochi and Nyaa", 0 )
7360GAME( 1999, pbobbl2n, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Taito (SNK license)", "Puzzle Bobble 2 / Bust-A-Move Again (Neo-Geo)", 0 )
7361GAME( 2003, pnyaa,    neogeo, neogeo, neogeo,  pnyaa,    ROT0, "Aiky / Taito", "Pochi and Nyaa", 0 )
73637362
73647363/* Takara */
7365GAME( 1995, marukodq, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Takara", "Chibi Marukochan Deluxe Quiz", 0 )
7364GAME( 1995, marukodq, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Takara", "Chibi Marukochan Deluxe Quiz", 0 )
73667365
73677366/* Technos */
73687367GAME( 1995, doubledr, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Technos", "Double Dragon (Neo-Geo)", 0 )
7369GAME( 1995, gowcaizr, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Technos", "Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer", 0)
7370GAME( 1996, sdodgeb,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Technos", "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu", 0 )
7368GAME( 1995, gowcaizr, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Technos", "Voltage Fighter - Gowcaizer / Choujin Gakuen Gowcaizer", 0 )
7369GAME( 1996, sdodgeb,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Technos", "Super Dodge Ball / Kunio no Nekketsu Toukyuu Densetsu", 0 )
73717370
73727371/* Tecmo */
7373GAME( 1996, tws96,    neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Tecmo", "Tecmo World Soccer '96", 0 )
7372GAME( 1996, tws96,    neogeo, neogeo, neogeo,  neogeo,   ROT0, "Tecmo", "Tecmo World Soccer '96", 0 )
73747373
73757374/* Yumekobo */
73767375GAME( 1998, blazstar, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Yumekobo", "Blazing Star", 0 )
7377GAME( 1999, preisle2, neogeo, neogeo_s, neogeo,  preisle2, ROT0, "Yumekobo", "Prehistoric Isle 2" , 0) /* Encrypted GFX */
7376GAME( 1999, preisle2, neogeo, neogeo, neogeo,  preisle2, ROT0, "Yumekobo", "Prehistoric Isle 2" , 0 ) /* Encrypted GFX */
73787377
73797378/* Viccom */
7380GAME( 1994, fightfev, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Viccom", "Fight Fever (set 1)", 0 )
7381GAME( 1994, fightfva, fightfev, neogeo_s, neogeo,  neogeo,   ROT0, "Viccom", "Fight Fever (set 2)", 0 )
7379GAME( 1994, fightfev, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Viccom", "Fight Fever (set 1)", 0 )
7380GAME( 1994, fightfva, fightfev, neogeo, neogeo,  neogeo,   ROT0, "Viccom", "Fight Fever (set 2)", 0 )
73827381
73837382/* Video System Co. */
73847383GAME( 1994, pspikes2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Video System Co.", "Power Spikes II", 0 )
73857384GAME( 1994, sonicwi2, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Video System Co.", "Aero Fighters 2 / Sonic Wings 2", 0 )
73867385GAME( 1995, sonicwi3, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Video System Co.", "Aero Fighters 3 / Sonic Wings 3", 0 )
7387GAME( 1997, popbounc, neogeo, neogeo_s, popbounc,neogeo,   ROT0, "Video System Co.", "Pop 'n Bounce / Gapporin", 0 )
7386GAME( 1997, popbounc, neogeo, neogeo, popbounc,neogeo,   ROT0, "Video System Co.", "Pop 'n Bounce / Gapporin", 0 )
73887387
73897388/* Visco */
7390GAME( 1992, androdun, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Visco", "Andro Dunos", 0 )
7391GAME( 1995, puzzledp, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon!", 0 )
7392GAME( 1996, neomrdo,  neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Visco", "Neo Mr. Do!", 0 )
7393GAME( 1995, goalx3,   neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Visco", "Goal! Goal! Goal!", 0 )
7394GAME( 1996, neodrift, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Visco", "Neo Drift Out - New Technology", 0 )
7389GAME( 1992, androdun, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Andro Dunos", 0 )
7390GAME( 1995, puzzledp, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon!", 0 )
7391GAME( 1996, neomrdo,  neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Neo Mr. Do!", 0 )
7392GAME( 1995, goalx3,   neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Goal! Goal! Goal!", 0 )
7393GAME( 1996, neodrift, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Neo Drift Out - New Technology", 0 )
73957394GAME( 1996, breakers, neogeo, neogeo,   neogeo,  neogeo,   ROT0, "Visco", "Breakers", 0 )
7396GAME( 1997, puzzldpr, puzzledp, neogeo_s, neogeo,  neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon! R!", 0 )
7397GAME( 1998, breakrev, breakers, neogeo,   neogeo,  neogeo,   ROT0, "Visco", "Breakers Revenge", 0)
7398GAME( 1998, flipshot, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Visco", "Battle Flip Shot", 0 )
7399GAME( 1999, ctomaday, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Visco", "Captain Tomaday", 0 )
7400GAME( 1999, ganryu,   neogeo, neogeo_s, neogeo,  ganryu,   ROT0, "Visco", "Ganryu / Musashi Ganryuki" , 0)   /* Encrypted GFX */
7401GAME( 2000, bangbead, neogeo, neogeo_s, neogeo,  bangbead, ROT0, "Visco", "Bang Bead", 0 )
7395GAME( 1997, puzzldpr, puzzledp, neogeo, neogeo,  neogeo,   ROT0, "Taito (Visco license)", "Puzzle De Pon! R!", 0 )
7396GAME( 1998, breakrev, breakers, neogeo,   neogeo,  neogeo,   ROT0, "Visco", "Breakers Revenge", 0 )
7397GAME( 1998, flipshot, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Battle Flip Shot", 0 )
7398GAME( 1999, ctomaday, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Visco", "Captain Tomaday", 0 )
7399GAME( 1999, ganryu,   neogeo, neogeo, neogeo,  ganryu,   ROT0, "Visco", "Ganryu / Musashi Ganryuki" , 0 )   /* Encrypted GFX */
7400GAME( 2000, bangbead, neogeo, neogeo, neogeo,  bangbead, ROT0, "Visco", "Bang Bead", 0 )
74027401//GAME( 2000, bangbedp, bangbead, neogeo,   neogeo,  neogeo,   ROT0, "Visco", "Bang Bead (prototype)", 0 )
74037402
74047403/* Mega Enterprise */
7405GAME( 2002, mslug4,   neogeo, neogeo_s, neogeo,  mslug4,   ROT0, "Mega", "Metal Slug 4", 0 )
7406GAME( 2002, ms4plus,  mslug4, neogeo_s, neogeo,  neogeo,   ROT0, "bootleg", "Metal Slug 4 Plus (bootleg)", 0 )
7404GAME( 2002, mslug4,   neogeo, neogeo, neogeo,  mslug4,   ROT0, "Mega", "Metal Slug 4", 0 )
7405GAME( 2002, ms4plus,  mslug4, neogeo, neogeo,  neogeo,   ROT0, "bootleg", "Metal Slug 4 Plus (bootleg)", 0 )
74077406
74087407/* Evoga */
74097408GAME( 2002, rotd,     neogeo, neogeo,   neogeo,  rotd,     ROT0, "Evoga / Playmore", "Rage of the Dragons", 0 )
r1490r1491
74127411GAME( 2002, matrim,   neogeo, neogeo,   neogeo,  matrim,   ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon", 0 )
74137412
74147413/* Breezasoft */
7415GAME( 2001, jockeygp, neogeo, neogeo_s, jockeygp,jockeygp, ROT0, "Sun Amusement / BrezzaSoft", "Jockey Grand Prix", 0 )
7416GAME( 2001, vliner,   neogeo, neogeo_s, vliner,  vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 1)", 0 )
7417GAME( 2001, vlinero,  vliner, neogeo_s, vliner,  vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 2)", 0 )
7414GAME( 2001, jockeygp, neogeo, neogeo, jockeygp,jockeygp, ROT0, "Sun Amusement / BrezzaSoft", "Jockey Grand Prix", 0 )
7415GAME( 2001, vliner,   neogeo, neogeo, vliner,  vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 1)", 0 )
7416GAME( 2001, vlinero,  vliner, neogeo, vliner,  vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 2)", 0 )
74187417
74197418/* Kyle Hodgetts */
7420GAME( 2000, diggerma, neogeo, neogeo_s, neogeo,  neogeo,   ROT0, "Kyle Hodgetts", "Digger Man (prototype)", 0 )
7419GAME( 2000, diggerma, neogeo, neogeo, neogeo,  neogeo,   ROT0, "Kyle Hodgetts", "Digger Man (prototype)", 0 )
74217420
src/mame/drivers/peplus.c
r1490r1491
166166/* Pointers to External RAM */
167167static UINT8 *program_ram;
168168static UINT8 *cmos_ram;
169static UINT8 *s1000_ram;
170169static UINT8 *s3000_ram;
171170static UINT8 *s5000_ram;
172171static UINT8 *s7000_ram;
r1490r1491
195194static int sda_dir = 0;
196195
197196/* Static Variables */
198#define CMOS_NVRAM_SIZE     0x1000
197#define CMOS_NVRAM_SIZE     0x2000
199198#define EEPROM_NVRAM_SIZE   0x200 // 4k Bit
200199
201200
r1490r1491
316315   cmos_ram[offset] = data;
317316}
318317
319static WRITE8_HANDLER( peplus_s1000_w )
320{
321   s1000_ram[offset] = data;
322}
323
324318static WRITE8_HANDLER( peplus_s3000_w )
325319{
326320   s3000_ram[offset] = data;
r1490r1491
466460   return cmos_ram[offset];
467461}
468462
469static READ8_HANDLER( peplus_s1000_r )
470{
471   return s1000_ram[offset];
472}
473
474463static READ8_HANDLER( peplus_s3000_r )
475464{
476465   return s3000_ram[offset];
r1490r1491
726715ADDRESS_MAP_END
727716
728717static ADDRESS_MAP_START( peplus_datamap, ADDRESS_SPACE_DATA, 8 )
729   // Battery-backed RAM
730   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_READWRITE(peplus_cmos_r, peplus_cmos_w) AM_BASE(&cmos_ram)
718   // Battery-backed RAM (0x1000-0x01fff Extended RAM for Superboards Only)
719   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_READWRITE(peplus_cmos_r, peplus_cmos_w) AM_BASE(&cmos_ram)
731720
732   // Superboard Data
733   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_READWRITE(peplus_s1000_r, peplus_s1000_w) AM_BASE(&s1000_ram)
734
735721   // CRT Controller
736722   AM_RANGE(0x2008, 0x2008) AM_WRITE(peplus_crtc_mode_w)
737723   AM_RANGE(0x2080, 0x2080) AM_READ(peplus_crtc_lpen1_r) AM_WRITE(peplus_crtc_register_w)
r1490r1491
10331019    UINT8 *super_data = memory_region(REGION_USER1);
10341020
10351021    /* Distribute Superboard Data */
1036    memcpy(s1000_ram, &super_data[0], 0x1000);
10371022    memcpy(s3000_ram, &super_data[0x3000], 0x1000);
10381023    memcpy(s5000_ram, &super_data[0x5000], 0x1000);
10391024    memcpy(s7000_ram, &super_data[0x7000], 0x1000);
src/mame/drivers/segas24.c
r1490r1491
722722{
723723   if (memory_region(REGION_USER1))
724724   {
725      memory_set_bankptr(1, memory_region(REGION_USER1) + curbank * 0x40000);
726      memory_set_bankptr(2, memory_region(REGION_USER1) + curbank * 0x40000);
725      memory_set_bank(1, curbank & 15);
726      memory_set_bank(2, curbank & 15);
727727   }
728728}
729729
r1490r1491
12541254      mame_fread(file, memory_region(REGION_USER2), 2*track_size);
12551255}
12561256
1257static MACHINE_START( system24 )
1258{
1259   if (memory_region(REGION_USER1))
1260   {
1261      memory_configure_bank(1, 0, 16, memory_region(REGION_USER1), 0x40000);
1262      memory_configure_bank(2, 0, 16, memory_region(REGION_USER1), 0x40000);
1263   }
1264}
1265
12571266static MACHINE_RESET(system24)
12581267{
12591268   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
r1490r1491
19071916   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(100))
19081917   MDRV_INTERLEAVE(4)
19091918
1919   MDRV_MACHINE_START(system24)
19101920   MDRV_MACHINE_RESET(system24)
19111921   MDRV_NVRAM_HANDLER(system24)
19121922
r1490r1491
19851995   ROM_LOAD16_BYTE( "14485", 0x000000, 0x20000, CRC(fc0085f9) SHA1(0250d1e17e19b541b85198ec4207e55bfbd5c32e) )
19861996   ROM_LOAD16_BYTE( "14484", 0x000001, 0x20000, CRC(f51c641c) SHA1(3f2fd0be7d58c75e88565393da5e810655413b53) )
19871997
1988   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
1998   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
19891999   ROM_LOAD16_BYTE( "14482", 0x000000, 0x80000, CRC(7a13dd97) SHA1(bfe9950d2cd41f3f866520923c1ed7b8da1990ec) )
19902000   ROM_LOAD16_BYTE( "14483", 0x100000, 0x80000, CRC(f3eb51a0) SHA1(6904830ff5e7aa5f016e115572fb6da678896ede) )
19912001ROM_END
r1490r1491
20272037   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
20282038   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
20292039
2030   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2040   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
20312041   ROM_LOAD16_BYTE( "mpr-13188-h.2",  0x000000, 0x80000, CRC(d3802294) SHA1(7608e71e8ef398ac24dbf851994253bca5ace625) )
20322042   ROM_LOAD16_BYTE( "mpr-13187-h.1",  0x000001, 0x80000, CRC(e3d8c5f7) SHA1(5b1e8646debee2f2ef272ddd3320b0a17192fbbe) )
20332043   ROM_LOAD16_BYTE( "mpr-13190.4",    0x100000, 0x40000, CRC(0b4df388) SHA1(340478bba82069ab745d6d8703e6801411fd2fc4) )
r1490r1491
20442054   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
20452055   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
20462056
2047   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2057   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
20482058   ROM_LOAD16_BYTE( "mpr-13188-h.2",  0x000000, 0x80000, CRC(d3802294) SHA1(7608e71e8ef398ac24dbf851994253bca5ace625) )
20492059   ROM_LOAD16_BYTE( "mpr-13187-h.1",  0x000001, 0x80000, CRC(e3d8c5f7) SHA1(5b1e8646debee2f2ef272ddd3320b0a17192fbbe) )
20502060   ROM_LOAD16_BYTE( "mpr-13190.4",    0x100000, 0x40000, CRC(0b4df388) SHA1(340478bba82069ab745d6d8703e6801411fd2fc4) )
r1490r1491
22172227   ROM_LOAD16_BYTE( "epr13948.bin", 0x000000, 0x20000, CRC(d6a031c8) SHA1(45b7e3cd2c7412e24f547cd4185166199d3938d5) )
22182228   ROM_LOAD16_BYTE( "epr13947.bin", 0x000001, 0x20000, CRC(7e3cff5e) SHA1(ff8cb776d2491796feeb8892c7e644e590438945) )
22192229
2220   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2230   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
22212231   ROM_LOAD16_BYTE( "epr-15345.2",  0x000000, 0x80000, CRC(d9e120c2) SHA1(b18b76733078d8534c6f0d8950632ab51e6a10ab) )
22222232   ROM_LOAD16_BYTE( "epr-15344.1",  0x000001, 0x80000, CRC(8f8b9f74) SHA1(de6b923118bea60197547ad016cb5d5e1a8f372b) )
22232233   ROM_LOAD16_BYTE( "mpr-14097-t.4",0x100000, 0x80000, CRC(4bd74cae) SHA1(5aa90bd5d2b8e2338ef0fe41d1f794e8d51321e1) )
r1490r1491
22292239   ROM_LOAD16_BYTE( "epr13948.bin", 0x000000, 0x20000, CRC(d6a031c8) SHA1(45b7e3cd2c7412e24f547cd4185166199d3938d5) )
22302240   ROM_LOAD16_BYTE( "epr13947.bin", 0x000001, 0x20000, CRC(7e3cff5e) SHA1(ff8cb776d2491796feeb8892c7e644e590438945) )
22312241
2232   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2242   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
22332243   ROM_LOAD16_BYTE( "epr-14095a.2", 0x000000, 0x80000, CRC(88d184e9) SHA1(519F3A22E1619DE9D5F13A45B85EBD249EBFA979) )
22342244   ROM_LOAD16_BYTE( "epr-14094a.1", 0x000001, 0x80000, CRC(7dd2b7d4) SHA1(C7EAF9E2700E0C55F7E867F5CD3FFAA5AAE97956) )
22352245   ROM_LOAD16_BYTE( "mpr-14097-t.4",0x100000, 0x80000, CRC(4bd74cae) SHA1(5aa90bd5d2b8e2338ef0fe41d1f794e8d51321e1) )
src/mame/drivers/namcoic.c
r1490r1491
15221522
15231523static const gfx_layout RoadTileLayout =
15241524{
1525   ROAD_TILE_SIZE,
1526   ROAD_TILE_SIZE,
1525   ROAD_TILE_SIZE,   ROAD_TILE_SIZE,
15271526   ROAD_TILE_COUNT_MAX,
15281527   2,
1529   {
15301528#ifndef LSB_FIRST
1531      0,8
1529   { 0,8 },
15321530#else
1533      8,0
1531   { 8,0 },
15341532#endif
1535   },
15361533   {/* x offset */
15371534      0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
15381535      0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17
src/mame/drivers/segas16a.c
r1490r1491
31073107
31083108static DRIVER_INIT( aliensy5 )
31093109{
3110//  void fd1089_decrypt_0037(void);
3110   void fd1089_decrypt_0037(void);
31113111   system16a_generic_init(machine);
3112//  fd1089_decrypt_0037();
3112   fd1089_decrypt_0037();
31133113}
31143114
31153115static DRIVER_INIT( bodyslam )
r1490r1491
31823182GAME( 1986, quart2,   quartet,  system16a,        quart2,   generic_16a, ROT0,   "Sega",           "Quartet 2 (unprotected)", 0 )
31833183
31843184/* System 16A */
3185GAME( 1987, aliensy5, aliensyn, system16a,        aliensyn, aliensy5,    ROT0,   "Sega",           "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", GAME_NOT_WORKING )
3185GAME( 1987, aliensy5, aliensyn, system16a,        aliensyn, aliensy5,    ROT0,   "Sega",           "Alien Syndrome (set 5, System 16A, FD1089B 317-0037)", 0 )
31863186GAME( 1987, aliensy2, aliensyn, system16a,        aliensyn, aliensy1,    ROT0,   "Sega",           "Alien Syndrome (set 2, System 16A, FD1089A 317-0033)", 0 )
31873187GAME( 1987, aliensy1, aliensyn, system16a,        aliensy1, aliensy1,    ROT0,   "Sega",           "Alien Syndrome (set 1, System 16A, FD1089A 317-0033)", 0 )
31883188GAME( 1988, aceattaa, aceattac, system16a       , aceattaa, aceattaa,    ROT270, "Sega",           "Ace Attacker (Japan, System 16A, FD1094 317-0060)", 0 )
src/mame/drivers/neogeo.c
r1490r1491
8585#include "cpu/z80/z80.h"
8686#include "sound/2610intf.h"
8787
88#include "neogeo.lh"
8889
90
8991#define LOG_VIDEO_SYSTEM      (0)
9092#define LOG_CPU_COMM         (0)
9193#define LOG_MAIN_CPU_BANKING   (0)
r1490r1491
99101 *
100102 *************************************/
101103
102static UINT8 display_poisition_interrupt_control;
104static UINT8 display_position_interrupt_control;
103105static UINT32 display_counter;
104106static UINT32 vblank_interrupt_pending;
105107static UINT32 display_position_interrupt_pending;
r1490r1491
167169}
168170
169171
170void neogeo_set_display_poisition_interrupt_control(UINT16 data)
172void neogeo_set_display_position_interrupt_control(UINT16 data)
171173{
172   display_poisition_interrupt_control = data;
174   display_position_interrupt_control = data;
173175}
174176
175177
r1490r1491
187189
188190   if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", activecpu_get_pc(), display_counter);
189191
190   if (display_poisition_interrupt_control & IRQ2CTRL_LOAD_RELATIVE)
192   if (display_position_interrupt_control & IRQ2CTRL_LOAD_RELATIVE)
191193   {
192194      if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_RELATIVE ");
193195       adjust_display_position_interrupt_timer();
r1490r1491
225227static TIMER_CALLBACK( display_position_interrupt_callback )
226228{
227229   if (LOG_VIDEO_SYSTEM) logerror("--- Scanline @ %d,%d\n", video_screen_get_vpos(0), video_screen_get_hpos(0));
228   if (display_poisition_interrupt_control & IRQ2CTRL_ENABLE)
230   if (display_position_interrupt_control & IRQ2CTRL_ENABLE)
229231   {
230232      if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) ***  y: %02x  x: %02x\n", video_screen_get_vpos(0), video_screen_get_hpos(0));
231233      display_position_interrupt_pending = 1;
r1490r1491
233235      update_interrupts();
234236   }
235237
236   if (display_poisition_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT)
238   if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT)
237239   {
238240      if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_REPEAT ");
239241      adjust_display_position_interrupt_timer();
r1490r1491
243245
244246static TIMER_CALLBACK( display_position_vblank_callback )
245247{
246   if (display_poisition_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK)
248   if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK)
247249   {
248250      if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_VBLANK ");
249251      adjust_display_position_interrupt_timer();
r1490r1491
964966   irq3_pending = 1;
965967
966968   /* register state save */
967   state_save_register_global(display_poisition_interrupt_control);
969   state_save_register_global(display_position_interrupt_control);
968970   state_save_register_global(display_counter);
969971   state_save_register_global(vblank_interrupt_pending);
970972   state_save_register_global(display_position_interrupt_pending);
r1490r1491
12421244   MDRV_VIDEO_START(neogeo)
12431245   MDRV_VIDEO_RESET(neogeo)
12441246   MDRV_VIDEO_UPDATE(neogeo)
1247   MDRV_DEFAULT_LAYOUT(layout_neogeo)
12451248
12461249   MDRV_SCREEN_ADD("main", 0)
12471250   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
r1490r1491
12581261   MDRV_SOUND_ROUTE(2, "right", 1.0)
12591262MACHINE_DRIVER_END
12601263
1261
1262/*
1263 *  A large number of the software produced for the
1264 *  system expects the visible display width to be 304 pixels
1265 *  and displays garbage in the left and right most 8 pixel
1266 *  columns.  This machine driver sets a smaller visible area
1267 *  to hide the garbage.
1268 *
1269 *  I don't like to do this, but I don't like the idea of the
1270 *  bug reports we'd get if we didn't
1271 */
1272
1273static MACHINE_DRIVER_START( neogeo_s )
1274
1275   MDRV_IMPORT_FROM(neogeo)
1276
1277   MDRV_SCREEN_MODIFY("main")
1278   MDRV_SCREEN_DEFAULT_POSITION((float)NEOGEO_HTOTAL / (NEOGEO_HTOTAL - 20), 0.0, 1.0, 0.0)
1279
1280MACHINE_DRIVER_END
1281
1282
1283
12841264/*************************************
12851265 *
12861266 *  Driver initalization
src/mame/drivers/thunderj.c
r1490r1491
452452static DRIVER_INIT( thunderj )
453453{
454454   atarigen_eeprom_default = NULL;
455   atarijsa_init(2, 3, 2, 0x0002);
455   atarijsa_init(machine, 2, 0x0002);
456456}
457457
458458
src/mame/drivers/ladybug.c
r1490r1491
5151#include "sound/sn76496.h"
5252
5353
54extern READ8_HANDLER( ladybug_IN0_r );
55extern READ8_HANDLER( ladybug_IN1_r );
56extern INTERRUPT_GEN( ladybug_interrupt );
54WRITE8_HANDLER( ladybug_videoram_w );
55WRITE8_HANDLER( ladybug_colorram_w );
56WRITE8_HANDLER( ladybug_flipscreen_w );
5757
58extern WRITE8_HANDLER( ladybug_videoram_w );
59extern WRITE8_HANDLER( ladybug_colorram_w );
60extern WRITE8_HANDLER( ladybug_flipscreen_w );
58PALETTE_INIT( ladybug );
59VIDEO_START( ladybug );
60VIDEO_UPDATE( ladybug );
6161
62extern PALETTE_INIT( ladybug );
63extern VIDEO_START( ladybug );
64extern VIDEO_UPDATE( ladybug );
62PALETTE_INIT( sraider );
63VIDEO_START( sraider );
64VIDEO_UPDATE( sraider );
65VIDEO_EOF( sraider );
66WRITE8_HANDLER( sraider_grid_color_w );
67WRITE8_HANDLER( sraider_grid_data_w );
6568
66extern PALETTE_INIT( sraider );
67extern VIDEO_START( sraider );
68extern VIDEO_UPDATE( sraider );
69extern VIDEO_EOF( sraider );
70extern WRITE8_HANDLER( sraider_grid_color_w );
71extern WRITE8_HANDLER( sraider_grid_data_w );
69READ8_HANDLER( sraider_8005_r );
70WRITE8_HANDLER( sraider_sound_low_w );
71WRITE8_HANDLER( sraider_sound_high_w );
72READ8_HANDLER( sraider_sound_low_r );
73READ8_HANDLER( sraider_sound_high_r );
74WRITE8_HANDLER( sraider_io_w );
75WRITE8_HANDLER( sraider_misc_w );
7276
73extern READ8_HANDLER( sraider_8005_r );
74extern WRITE8_HANDLER( sraider_sound_low_w );
75extern WRITE8_HANDLER( sraider_sound_high_w );
76extern READ8_HANDLER( sraider_sound_low_r );
77extern READ8_HANDLER( sraider_sound_high_r );
78extern WRITE8_HANDLER( sraider_io_w );
79extern WRITE8_HANDLER( sraider_misc_w );
80
8177//extern UINT8 sraider_grid_status;
8278//extern UINT8 sraider_0x30, sraider_0x38;
8379
r1490r1491
111107  slots. Left slot generates a NMI, Right slot an IRQ.
112108
113109***************************************************************************/
114INTERRUPT_GEN( ladybug_interrupt )
110static INTERRUPT_GEN( ladybug_interrupt )
115111{
116112   if (readinputport(5) & 1)   /* Left Coin */
117113      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
r1490r1491
119115      cpunum_set_input_line(0, 0, HOLD_LINE);
120116}
121117
118
119#define LADYBUG_P1_CONTROL_PORT_TAG   ("CONTP1")
120#define LADYBUG_P2_CONTROL_PORT_TAG   ("CONTP2")
121
122static UINT32 ladybug_p1_control_r(void *param)
123{
124   return readinputportbytag(LADYBUG_P1_CONTROL_PORT_TAG);
125}
126
127static UINT32 ladybug_p2_control_r(void *param)
128{
129   UINT32 ret;
130
131   /* upright cabinet only uses a single set of controls */
132   if (readinputportbytag("DSW0") & 0x20)
133      ret = readinputportbytag(LADYBUG_P2_CONTROL_PORT_TAG);
134   else
135      ret = readinputportbytag(LADYBUG_P1_CONTROL_PORT_TAG);
136
137   return ret;
138}
139
140
122141static INPUT_PORTS_START( ladybug )
123142   PORT_START_TAG("IN0")
124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
127   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
128   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_UNUSED
143   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ladybug_p1_control_r, 0)
129144   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
130145   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
131146   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )
132147
133148   PORT_START_TAG("IN1")
134   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
135   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
136   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
137   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
138   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
149   PORT_BIT( 0x1f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ladybug_p2_control_r, 0)
139150   /* This should be connected to the 4V clock. I don't think the game uses it. */
140151   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
141152   /* Note that there are TWO VBlank inputs, one is active low, the other active */
r1490r1491
208219   /* user releases the key. */
209220   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
210221   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
222
223   PORT_START_TAG(LADYBUG_P1_CONTROL_PORT_TAG)
224   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
225   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
226   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
227   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
228   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_UNUSED
229
230   PORT_START_TAG(LADYBUG_P2_CONTROL_PORT_TAG)
231   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
232   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
233   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
234   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
235   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_UNUSED PORT_COCKTAIL
211236INPUT_PORTS_END
212237
213238static INPUT_PORTS_START( snapjack )
src/mame/drivers/buggychl.c
r1490r1491
8585
8686
8787/* in machine */
88MACHINE_RESET( buggychl );
8889READ8_HANDLER( buggychl_68705_portA_r );
8990WRITE8_HANDLER( buggychl_68705_portA_w );
9091WRITE8_HANDLER( buggychl_68705_ddrA_w );
r1490r1491
452453   MDRV_GFXDECODE(buggychl)
453454   MDRV_PALETTE_LENGTH(128+128)
454455
456   MDRV_MACHINE_RESET(buggychl)
457
455458   MDRV_PALETTE_INIT(buggychl)
456459   MDRV_VIDEO_START(buggychl)
457460   MDRV_VIDEO_UPDATE(buggychl)
src/mame/drivers/exidy.c
r1490r1491
189189
190190static ADDRESS_MAP_START( common_map, ADDRESS_SPACE_PROGRAM, 8 )
191191   AM_RANGE(0x0000, 0x03ff) AM_RAM
192   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_READWRITE(videoram_r, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
192   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
193193   AM_RANGE(0x5000, 0x503f) AM_WRITE(exidy_sprite1_xpos_w)
194194   AM_RANGE(0x5040, 0x507f) AM_WRITE(exidy_sprite1_ypos_w)
195195   AM_RANGE(0x5080, 0x50bf) AM_WRITE(exidy_sprite2_xpos_w)
r1490r1491
199199   AM_RANGE(0x5100, 0x5100) AM_MIRROR(0xfc) AM_WRITE(exidy_spriteno_w)
200200   AM_RANGE(0x5101, 0x5101) AM_MIRROR(0xfc) AM_WRITE(exidy_sprite_enable_w)
201201   AM_RANGE(0x5103, 0x5103) AM_MIRROR(0xfc) AM_READ(exidy_interrupt_r)
202   AM_RANGE(0x5210, 0x5212) AM_WRITE(exidy_color_w)
202   AM_RANGE(0x5210, 0x5212) AM_WRITE(MWA8_RAM) AM_BASE(&exidy_color_latch)
203203   AM_RANGE(0x5213, 0x5213) AM_READ_PORT("IN2")
204204ADDRESS_MAP_END
205205
206206
207static ADDRESS_MAP_START( sidetrac_map, ADDRESS_SPACE_PROGRAM, 8 )
208   AM_RANGE(0x0800, 0x3fff) AM_ROM
209   AM_RANGE(0x4800, 0x4fff) AM_ROM AM_BASE(&exidy_characterram)
210   AM_RANGE(0x5200, 0x5201) AM_WRITE(targ_sh_w)
211   AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x3f00)
212ADDRESS_MAP_END
213
214
207215static ADDRESS_MAP_START( targ_map, ADDRESS_SPACE_PROGRAM, 8 )
208216   AM_RANGE(0x0800, 0x3fff) AM_ROM
209   AM_RANGE(0x4800, 0x4fff) AM_READWRITE(MRA8_RAM, exidy_characterram_w) AM_BASE(&exidy_characterram)
217   AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram)
210218   AM_RANGE(0x5200, 0x5201) AM_WRITE(targ_sh_w)
211219   AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION(REGION_CPU1, 0x3f00)
212220ADDRESS_MAP_END
213221
214222
215223static ADDRESS_MAP_START( venture_map, ADDRESS_SPACE_PROGRAM, 8 )
216   AM_RANGE(0x4800, 0x4fff) AM_READWRITE(MRA8_RAM, exidy_characterram_w) AM_BASE(&exidy_characterram)
224   AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram)
217225   AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w)
218226   AM_RANGE(0x8000, 0xffff) AM_ROM
219227ADDRESS_MAP_END
r1490r1491
221229
222230static ADDRESS_MAP_START( pepper2_map, ADDRESS_SPACE_PROGRAM, 8 )
223231   AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w)
224   AM_RANGE(0x6000, 0x6fff) AM_READWRITE(MRA8_RAM, exidy_characterram_w) AM_BASE(&exidy_characterram)
232   AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram)
225233   AM_RANGE(0x8000, 0xffff) AM_ROM
226234ADDRESS_MAP_END
227235
r1490r1491
234242   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)
235243   AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w)
236244   AM_RANGE(0x5213, 0x5217) AM_WRITE(MWA8_NOP)            /* empty control lines on color/sound board */
237   AM_RANGE(0x6000, 0x6fff) AM_READWRITE(MRA8_RAM, exidy_characterram_w) AM_BASE(&exidy_characterram)
245   AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram)
238246   AM_RANGE(0x8000, 0xffff) AM_ROM
239247ADDRESS_MAP_END
240248
r1490r1491
824832 *
825833 *************************************/
826834
827static MACHINE_DRIVER_START( targ )
835static MACHINE_DRIVER_START( sidetrac )
828836
829837   /* basic machine hardware */
830838   MDRV_CPU_ADD_TAG("main", M6502, EXIDY_CPU_CLOCK)
831   MDRV_CPU_PROGRAM_MAP(common_map,targ_map)
839   MDRV_CPU_PROGRAM_MAP(common_map,sidetrac_map)
832840   MDRV_CPU_VBLANK_INT(exidy_vblank_interrupt,1)
833841
834842   /* video hardware */
r1490r1491
854862MACHINE_DRIVER_END
855863
856864
865static MACHINE_DRIVER_START( targ )
866
867   /* basic machine hardware */
868   MDRV_IMPORT_FROM(sidetrac)
869   MDRV_CPU_MODIFY("main")
870   MDRV_CPU_PROGRAM_MAP(common_map,targ_map)
871MACHINE_DRIVER_END
872
873
857874static MACHINE_DRIVER_START( venture )
858875
859876   /* basic machine hardware */
r1490r1491
936953   ROM_LOAD( "stl8a-1", 0x2800, 0x0800, CRC(e41750ff) SHA1(3868a0d7e34a5118b39b31cff9e4fc839df541ff) )
937954   ROM_LOAD( "stl7a-2", 0x3000, 0x0800, CRC(57fb28dc) SHA1(6addd633d655d6a56b3e509d18e5f7c0ab2d0fbb) )
938955   ROM_LOAD( "stl6a-2", 0x3800, 0x0800, CRC(4226d469) SHA1(fd18b732b66082988b01e04adc2b1e5dae410c98) )
939   ROM_LOAD( "stl9c-1", 0x4800, 0x0400, CRC(08710a84) SHA1(4bff254a14af7c968656ccc85277d31ab5a8f0c4) ) /* prom instead of ram chr gen*/
956   ROM_LOAD( "stl9c-1", 0x4800, 0x0400, CRC(08710a84) SHA1(4bff254a14af7c968656ccc85277d31ab5a8f0c4) ) /* PROM instead of RAM char generator */
940957
941958   ROM_REGION( 0x0200, REGION_GFX1, ROMREGION_DISPOSE )
942959   ROM_LOAD( "stl11d",  0x0000, 0x0200, CRC(3bd1acc1) SHA1(06f900cb8f56cd4215c5fbf58a852426d390e0c1) )
r1490r1491
13561373   exidy_color_latch[2] = 0xf8;
13571374   exidy_color_latch[1] = 0xdc;
13581375   exidy_color_latch[0] = 0xb8;
1359
1360   /* ROM in place of character RAM */
1361   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4bff, 0, 0, MWA8_ROM);
13621376}
13631377
13641378
r1490r1491
14491463
14501464   /* two 6116 character RAMs */
14511465   exidy_characterram = memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_RAM);
1452   exidy_characterram = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, exidy_characterram_w);
1466   exidy_characterram = memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MWA8_RAM);
14531467   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, MRA8_NOP);
14541468   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4fff, 0, 0, MWA8_NOP);
14551469}
r1490r1491
14711485 *
14721486 *************************************/
14731487
1474GAME( 1979, sidetrac, 0,       targ,    sidetrac, sidetrac, ROT0, "Exidy", "Side Trak", 0 )
1475GAME( 1980, targ,     0,       targ,    targ,     targ,     ROT0, "Exidy", "Targ", 0 )
1476GAME( 1980, targc,    targ,    targ,    targ,     targ,     ROT0, "Exidy", "Targ (cocktail?)", 0 )
1477GAME( 1980, spectar,  0,       targ,    spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 3)", 0 )
1478GAME( 1980, spectar1, spectar, targ,    spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 1?)", 0 )
1479GAME( 1980, rallys,   spectar, targ,    rallys,   rallys,   ROT0, "Novar", "Rallys (bootleg?)", 0 )
1480GAME( 1980, phantoma, spectar, targ,    phantoma, phantoma, ROT0, "Jeutel","Phantomas", 0 )
1488GAME( 1979, sidetrac, 0,       sidetrac, sidetrac, sidetrac, ROT0, "Exidy", "Side Trak", 0 )
1489GAME( 1980, targ,     0,       targ,     targ,     targ,     ROT0, "Exidy", "Targ", 0 )
1490GAME( 1980, targc,    targ,    targ,     targ,     targ,     ROT0, "Exidy", "Targ (cocktail?)", 0 )
1491GAME( 1980, spectar,  0,       targ,     spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 3)", 0 )
1492GAME( 1980, spectar1, spectar, targ,     spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 1?)", 0 )
1493GAME( 1980, rallys,   spectar, targ,     rallys,   rallys,   ROT0, "Novar", "Rallys (bootleg?)", 0 )
1494GAME( 1980, phantoma, spectar, targ,     phantoma, phantoma, ROT0, "Jeutel","Phantomas", 0 )
14811495
1482GAME( 1981, mtrap,    0,       mtrap,   mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 5)", 0 )
1483GAME( 1981, mtrap3,   mtrap,   mtrap,   mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 3)", 0 )
1484GAME( 1981, mtrap4,   mtrap,   mtrap,   mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 4)", 0 )
1485GAME( 1981, venture,  0,       venture, venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 1)", 0 )
1486GAME( 1981, venture2, venture, venture, venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 2)", 0 )
1487GAME( 1981, venture4, venture, venture, venture,  venture,  ROT0, "Exidy", "Venture (version 4)", 0 )
1488GAME( 1982, teetert,  0,       teetert, teetert,  teetert,  ROT0, "Exidy", "Teeter Torture (prototype)", 0 )
1489GAME( 1982, pepper2,  0,       pepper2, pepper2,  pepper2,  ROT0, "Exidy", "Pepper II", 0 )
1490GAME( 1982, hardhat,  0,       pepper2, pepper2,  pepper2,  ROT0, "Exidy", "Hard Hat", 0 )
1491GAME( 1983, fax,      0,       fax,     fax,      fax,      ROT0, "Exidy", "FAX", 0 )
1492GAME( 1983, fax2,     fax,     fax,     fax,      fax,      ROT0, "Exidy", "FAX 2", 0 )
1496GAME( 1981, mtrap,    0,       mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 5)", 0 )
1497GAME( 1981, mtrap3,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 3)", 0 )
1498GAME( 1981, mtrap4,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 4)", 0 )
1499GAME( 1981, venture,  0,       venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 1)", 0 )
1500GAME( 1981, venture2, venture, venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 2)", 0 )
1501GAME( 1981, venture4, venture, venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 4)", 0 )
1502GAME( 1982, teetert,  0,       teetert,  teetert,  teetert,  ROT0, "Exidy", "Teeter Torture (prototype)", 0 )
1503GAME( 1982, pepper2,  0,       pepper2,  pepper2,  pepper2,  ROT0, "Exidy", "Pepper II", 0 )
1504GAME( 1982, hardhat,  0,       pepper2,  pepper2,  pepper2,  ROT0, "Exidy", "Hard Hat", 0 )
1505GAME( 1983, fax,      0,       fax,      fax,      fax,      ROT0, "Exidy", "FAX", 0 )
1506GAME( 1983, fax2,     fax,     fax,      fax,      fax,      ROT0, "Exidy", "FAX 2", 0 )
src/mame/drivers/skychut.c
r1490r1491
8686
8787***************************************************************************/
8888
89/***************************************************************************
90Notes (couriersud)
91
92    From http://www.crazykong.com/tech/IremBoardList.txt
93
94    skychut:        M-11
95    andromed:       N/A
96    ipminvad:       N/A
97    spacbeam:       not listed
98    headon:         not listed
99    greenber:       N/A
100
101    M10-Board: Has SN76477
102
103***************************************************************************/
89104#include "driver.h"
105#include "sound/samples.h"
90106
91extern UINT8* iremm15_chargen;
107#include "skychut.h"
92108
93VIDEO_UPDATE( skychut );
94VIDEO_UPDATE( iremm15 );
95WRITE8_HANDLER( skychut_colorram_w );
96WRITE8_HANDLER( skychut_ctrl_w );
109/*************************************
110 *
111 *  Defines
112 *
113 *************************************/
97114
98static UINT8 *memory;
115#define DEBUG      (0)
99116
117/*************************************
118 *
119 *  Initialization
120 *
121 *************************************/
100122
101123static PALETTE_INIT( skychut )
102124{
r1490r1491
118140   }
119141}
120142
143static MACHINE_RESET( irem )
144{
145   irem_state *state = Machine->driver_data;
121146
122static ADDRESS_MAP_START( skychut_readmem, ADDRESS_SPACE_PROGRAM, 8 )
123   AM_RANGE(0x0000, 0x02ff) AM_READ(MRA8_RAM) /* scratch ram */
124   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_ROM)
125   AM_RANGE(0x4000, 0x43ff) AM_READ(MRA8_RAM)
126   AM_RANGE(0x4800, 0x4bff) AM_READ(MRA8_RAM) /* Foreground colour  */
127   AM_RANGE(0x5000, 0x53ff) AM_READ(MRA8_RAM) /* BKgrnd colour ??? */
147   state_save_register_global(state->bottomline);
148   state_save_register_global(state->flip);
149}
150
151/*************************************
152 *
153 *  I/O handling
154 *
155 *************************************/
156
157/*
158 * M10 Ctrl Port
159 *
160 * 76543210
161 * ========
162 * e-------     ACTIVE LOW  Demo mode
163 * -?------     ????
164 * --b-----     ACTIVE LOW  Bottom line
165 * ---f----     ACTIVE LOW  Flip screen
166 * ----u---     ACTIVE LOW  Ufo sound enable (SN76477)
167 * -----sss     Sound #sss start
168 *              0x01: MISSILE
169 *              0x02: EXPLOSION
170 *              0x03: INVADER HIT
171 *              0x04: BONUS BASE
172 *              0x05: FLEET MOVE
173 *              0x06: SAUCER HIT
174 */
175
176WRITE8_HANDLER( iremm10_ctrl_w )
177{
178   irem_state *state = Machine->driver_data;
179
180#if DEBUG
181   if (data & 0x40)
182      popmessage("ctrl: %02x",data);
183#endif
184
185   /* I have NO IDEA if this is correct or not */
186   state->bottomline = ~data & 0x20;
187
188   if (readinputportbytag("CAB") & 0x01)
189      state->flip = ~data & 0x10;
190
191   if (!(readinputportbytag("CAB") & 0x02))
192      sound_global_enable(~data & 0x80);
193
194   /* sound command in lower 4 bytes */
195   switch (data & 0x07)
196   {
197      case 0x00:
198         /* no sound mapped */
199         break;
200      case 0x01:
201         /* MISSILE sound */
202         sample_start_n(0, 0, 0, 0);
203         break;
204      case 0x02:
205         /* EXPLOSION sound */
206         sample_start_n(0, 1, 1, 0);
207         break;
208      case 0x03:
209         /* INVADER HIT sound */
210         sample_start_n(0, 2, 2, 0);
211         break;
212      case 0x04:
213         /* BONUS BASE sound */
214         sample_start_n(0, 3, 8, 0);
215         break;
216      case 0x05:
217         /* FLEET MOVE sound */
218         sample_start_n(0, 3, 3, 0);
219         break;
220      case 0x06:
221         /* SAUCER HIT SOUND */
222         sample_start_n(0, 2, 7, 0);
223         break;
224      default:
225         popmessage("Unknown sound M10: %02x\n", data & 0x07);
226         break;
227   }
228   /* UFO SOUND */
229   if (data & 0x08)
230      sample_stop_n(0, 4);
231   else
232      sample_start_n(0, 4, 9, 1);
233
234}
235
236/*
237 * M11 Ctrl Port
238 *
239 * 76543210
240 * ========
241 * e-------     ACTIVE LOW  Demo mode
242 * -?------     ????
243 * --b-----     ACTIVE LOW  Bottom line
244 * ---f----     ACTIVE LOW  Flip screen
245 * ----??--     ????
246 * ------cc     Credits indicator ?
247 *              0x03: 0 Credits
248 *              0x02: 1 Credit
249 *              0x00: 2 or more credits
250 *              Will be updated only in attract mode
251 */
252
253WRITE8_HANDLER( iremm11_ctrl_w )
254{
255   irem_state *state = Machine->driver_data;
256
257#if DEBUG
258   if (data & 0x4C)
259      popmessage("M11 ctrl: %02x",data);
260#endif
261
262   state->bottomline = ~data & 0x20;
263
264   if (readinputportbytag("CAB") & 0x01)
265      state->flip = ~data & 0x10;
266
267   if (!(readinputportbytag("CAB") & 0x02))
268      sound_global_enable(~data & 0x80);
269}
270
271/*
272 * M15 Ctrl Port
273 *
274 * 76543210
275 * ========
276 * ????----     ????
277 * ----e---     ACTIVE LOW  Demo mode
278 * -----f--     ACTIVE LOW  Flip screen
279 * ------cc     Credits indicator ?
280 *              0x03: 0 Credits
281 *              0x02: 1 Credit
282 *              0x00: 2 or more credits
283 *              Will be updated only in attract mode
284 */
285
286WRITE8_HANDLER( iremm15_ctrl_w )
287{
288   irem_state *state = Machine->driver_data;
289
290#if DEBUG
291   if (data & 0xF0)
292      popmessage("M15 ctrl: %02x",data);
293#endif
294   if (readinputportbytag("CAB") & 0x01)
295      state->flip = ~data & 0x04;
296   if (!(readinputportbytag("CAB") & 0x02))
297      sound_global_enable(~data & 0x08);
298}
299
300
301/*
302 * M10 A500
303 *
304 * 76543210
305 * ========
306 * ??????--     Always 111111
307 * ------cc     Credits indicator ?
308 *              0x03: 0 Credits
309 *              0x02: 1 Credit
310 *              0x00: 2 or more credits
311 *              Will be updated only in attract mode
312 */
313
314WRITE8_HANDLER( iremm10_a500_w )
315{
316#if DEBUG
317   if (data & 0xFC)
318      popmessage("a500: %02x",data);
319#endif
320}
321
322WRITE8_HANDLER( iremm11_a100_w )
323{
324   static int last = 0x00;
325   int raising_bits = data & ~last;
326   //int falling_bits = ~data & last;
327
328   // should a falling bit stop a sample?
329   // This port is written to about 20x per vblank
330#if DEBUG
331   if ((last & 0xE8) != (data & 0xE8))
332      popmessage("A100: %02x\n", data);
333#endif
334   last = data;
335   // audio control!
336   /* MISSILE sound */
337   if (raising_bits & 0x01)
338      sample_start_n(0, 0, 0, 0);
339
340   /* EXPLOSION sound */
341   if (raising_bits & 0x02)
342      sample_start_n(0, 1, 1, 0);
343
344   /* Rapidly falling parachute */
345   if (raising_bits & 0x04)
346      sample_start_n(0, 3, 8, 0);
347
348   /* Background sound ? */
349   if (data & 0x10)
350      sample_start_n(0, 4, 9, 1);
351   else
352      sample_stop_n(0, 4);
353
354}
355
356WRITE8_HANDLER( iremm15_a100_w )
357{
358   static int last = 0x00;
359   //int raising_bits = data & ~last;
360   int falling_bits = ~data & last;
361
362   // should a falling bit stop a sample?
363   // Bit 4 is used
364   // Bit 5 is used 0xef
365   // Bit 7 is used
366
367   // headoni
368   // 0x01: Acceleration
369   // 0x04: background (motor) ?
370   // 0x08: explosion
371   // 0x10: player changes lane
372   // 0x20: computer car changes lane
373   // 0x40: dot
374
375#if DEBUG
376   if ((last & 0x82) != (data & 0x82))
377      popmessage("A100: %02x\n", data);
378#endif
379   /* DOT sound */
380   if (falling_bits & 0x40)
381      sample_start_n(0, 0, 0, 0);
382#if 0
383   if (raising_bits & 0x40)
384      sample_stop_n(0, 0);
385#endif
386
387   /* EXPLOSION sound */
388   if (falling_bits & 0x08)
389      sample_start_n(0, 1, 1, 0);
390#if 0
391   if (raising_bits & 0x08)
392      sample_stop_n(0, 1);
393#endif
394
395   /* player changes lane */
396   if (falling_bits & 0x10)
397      sample_start_n(0, 3, 3, 0);
398#if 0
399   if (raising_bits & 0x10)
400      sample_stop_n(0, 3);
401#endif
402
403   /* computer car changes lane */
404   if (falling_bits & 0x20)
405      sample_start_n(0, 4, 4, 0);
406#if 0
407   if (raising_bits & 0x20)
408      sample_stop_n(0, 4);
409#endif
410
411   last = data;
412}
413
414READ8_HANDLER( iremm10_a700_r )
415{
416      //printf("rd:%d\n",video_screen_get_vpos(0));
417   cpunum_set_input_line(0, 0, CLEAR_LINE);
418   return 0x00;
419}
420
421READ8_HANDLER( iremm11_a700_r )
422{
423      //printf("rd:%d\n",video_screen_get_vpos(0));
424   return 0x00;
425}
426
427/*************************************
428 *
429 *  Interrupt handling
430 *
431 *************************************/
432
433TIMER_CALLBACK( skychut_callback )
434{
435    if (param==0)
436    {
437       cpunum_set_input_line(0, 0, ASSERT_LINE);
438       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+16, 0), NULL, 1,skychut_callback);
439    }
440    if (param==1)
441    {
442       cpunum_set_input_line(0, 0, ASSERT_LINE);
443       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+24, 0), NULL, 2,skychut_callback);
444    }
445    if (param==-1)
446       cpunum_set_input_line(0, 0, CLEAR_LINE);
447
448}
449
450INTERRUPT_GEN( iremm11_interrupt )
451{
452   if (readinputport(2) & 1)   /* Left Coin */
453        cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
454    else
455    {
456       cpunum_set_input_line(0, 0, ASSERT_LINE);
457       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBEND, 0), NULL, -1,skychut_callback);
458    }
459}
460
461INTERRUPT_GEN( iremm10_interrupt )
462{
463   if (readinputport(2) & 1)   /* Left Coin */
464        cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
465    else
466      cpunum_set_input_line(0, 0, ASSERT_LINE);
467}
468
469INTERRUPT_GEN( iremm15_interrupt )
470{
471   if (readinputport(2) & 1)   /* Left Coin */
472        cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
473    else
474    {
475      cpunum_set_input_line(0, 0, ASSERT_LINE);
476       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+1, 80), NULL, -1,skychut_callback);
477    }
478}
479
480/*************************************
481 *
482 *  Main CPU memory handlers
483 *
484 *************************************/
485
486static ADDRESS_MAP_START( iremm10_main, ADDRESS_SPACE_PROGRAM, 8 )
487   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(irem_state, memory) /* scratch ram */
488   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(irem_state, rom)
489   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
490   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
491   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(irem_state, chargen) /* background ????? */
128492   AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r)
129493   AM_RANGE(0xa300, 0xa300) AM_READ(input_port_0_r)
130/*  AM_RANGE(0xa700, 0xa700) AM_READ(input_port_3_r)*/
494   AM_RANGE(0xa400, 0xa400) AM_WRITE(iremm10_ctrl_w)   /* line at bottom of screen?, sound, flip screen */
495   AM_RANGE(0xa500, 0xa500) AM_WRITE(iremm10_a500_w)   /* ??? */
496   AM_RANGE(0xa700, 0xa700) AM_READ(iremm10_a700_r)
131497   AM_RANGE(0xfc00, 0xffff) AM_READ(MRA8_ROM)   /* for the reset / interrupt vectors */
132498ADDRESS_MAP_END
133499
134
135static ADDRESS_MAP_START( skychut_writemem, ADDRESS_SPACE_PROGRAM, 8 )
136   AM_RANGE(0x0000, 0x02ff) AM_WRITE(MWA8_RAM) AM_BASE(&memory)
137   AM_RANGE(0x1000, 0x2fff) AM_WRITE(MWA8_ROM)
138   AM_RANGE(0x4000, 0x43ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
139   AM_RANGE(0x4800, 0x4bff) AM_WRITE(skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
140   AM_RANGE(0x5000, 0x53ff) AM_WRITE(MWA8_RAM) AM_BASE(&iremm15_chargen) /* background ????? */
141//  AM_RANGE(0xa100, 0xa1ff) AM_WRITE(MWA8_RAM) /* Sound writes????? */
142   AM_RANGE(0xa400, 0xa400) AM_WRITE(skychut_ctrl_w)   /* line at bottom of screen?, sound, flip screen */
143   AM_RANGE(0xfc00, 0xffff) AM_WRITE(MWA8_ROM)   /* for the reset / interrupt vectors */
500static ADDRESS_MAP_START( iremm11_main, ADDRESS_SPACE_PROGRAM, 8 )
501   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(irem_state, memory) /* scratch ram */
502   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(irem_state, rom)
503   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
504   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
505   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(irem_state, chargen) /* background ????? */
506   AM_RANGE(0xa100, 0xa100) AM_WRITE(iremm11_a100_w) /* sound writes ???? */
507   AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r)
508   AM_RANGE(0xa300, 0xa300) AM_READ(input_port_0_r)
509   AM_RANGE(0xa400, 0xa400) AM_WRITE(iremm11_ctrl_w)   /* line at bottom of screen?, sound, flip screen */
510   AM_RANGE(0xa700, 0xa700) AM_READ(iremm11_a700_r)
511   AM_RANGE(0xfc00, 0xffff) AM_READ(MRA8_ROM)   /* for the reset / interrupt vectors */
144512ADDRESS_MAP_END
145513
146static ADDRESS_MAP_START( greenberet_readmem, ADDRESS_SPACE_PROGRAM, 8 )
147   AM_RANGE(0x0000, 0x02ff) AM_READ(MRA8_RAM) /* scratch ram */
148   AM_RANGE(0x1000, 0x33ff) AM_READ(MRA8_ROM)
149   AM_RANGE(0x4000, 0x43ff) AM_READ(MRA8_RAM)
150   AM_RANGE(0x4800, 0x4bff) AM_READ(MRA8_RAM) /* Foreground colour  */
151   AM_RANGE(0x5000, 0x57ff) AM_READ(MRA8_RAM)
514static ADDRESS_MAP_START( iremm15_main, ADDRESS_SPACE_PROGRAM, 8 )
515   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(irem_state, memory) /* scratch ram */
516   AM_RANGE(0x1000, 0x33ff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(irem_state, rom)
517   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(MRA8_RAM, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
518   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
519   AM_RANGE(0x5000, 0x57ff) AM_READWRITE(MRA8_RAM, iremm15_chargen_w) AM_BASE_MEMBER(irem_state, chargen) /* background ????? */
152520   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_3_r)
521   AM_RANGE(0xa100, 0xa100) AM_WRITE(iremm15_a100_w) /* sound writes ???? */
153522   AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r)
154523   AM_RANGE(0xa300, 0xa300) AM_READ(input_port_0_r)
524   AM_RANGE(0xa400, 0xa400) AM_WRITE(iremm15_ctrl_w)   /* sound, flip screen */
155525   AM_RANGE(0xfc00, 0xffff) AM_READ(MRA8_ROM)   /* for the reset / interrupt vectors */
156526ADDRESS_MAP_END
157527
158static ADDRESS_MAP_START( greenberet_writemem, ADDRESS_SPACE_PROGRAM, 8 )
159   AM_RANGE(0x0000, 0x02ff) AM_WRITE(MWA8_RAM) AM_BASE(&memory)
160   AM_RANGE(0x1000, 0x33ff) AM_WRITE(MWA8_ROM)
161   AM_RANGE(0x4000, 0x43ff) AM_WRITE(videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
162   AM_RANGE(0x4800, 0x4bff) AM_WRITE(skychut_colorram_w) AM_BASE(&colorram) /* foreground colour  */
163   AM_RANGE(0x5000, 0x57ff) AM_WRITE(MWA8_RAM) AM_BASE(&iremm15_chargen)
164   AM_RANGE(0xa100, 0xa1ff) AM_WRITE(MWA8_RAM) /* Sound writes????? */
165   AM_RANGE(0xa400, 0xa400) AM_WRITE(MWA8_NOP)   /* sound, flip screen */
166   AM_RANGE(0xfc00, 0xffff) AM_WRITE(MWA8_ROM)   /* for the reset / interrupt vectors */
167ADDRESS_MAP_END
528/*************************************
529 *
530 *  Port definitions
531 *
532 *************************************/
168533
534#define CAB_PORTENV \
535   /* fake port for cabinet type */               \
536   PORT_START_TAG("CAB")                        \
537   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      \
538   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )      \
539   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )   \
540   PORT_CONFNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )      \
541   PORT_CONFSETTING(    0x00, DEF_STR( Off ) )      \
542   PORT_CONFSETTING(    0x02, DEF_STR( On ) )   \
543   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
169544
170static INTERRUPT_GEN( skychut_interrupt )
171{
172   if (readinputport(2) & 1)   /* Left Coin */
173        cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
174    else
175       cpunum_set_input_line(0, 0, HOLD_LINE);
176}
177545
178static INPUT_PORTS_START( skychut )
546INPUT_PORTS_START( skychut )
179547   PORT_START
180548   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
181549   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
r1490r1491
191559   PORT_DIPSETTING (  0x00, "3" )
192560   PORT_DIPSETTING (  0x01, "4" )
193561   PORT_DIPSETTING (  0x02, "5" )
562   PORT_DIPNAME( 0x04, 0x00, "Unknown 1" )
563   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
564   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
565   PORT_DIPNAME( 0x08, 0x00, "Unknown 2" )
566   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
567   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
568   PORT_DIPNAME( 0x10, 0x00, "Unknown 3" )
569   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
570   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
571   PORT_DIPNAME( 0x20, 0x00, "Unknown 4" )
572   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
573   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
574   PORT_DIPNAME( 0x40, 0x00, "Unknown 5" )
575   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
576   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
577   PORT_DIPNAME( 0x80, 0x00, "Unknown 6" )
578   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
579   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
194580
195581   PORT_START   /* FAKE */
196582   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
583
584   CAB_PORTENV
197585INPUT_PORTS_END
198586
199static INPUT_PORTS_START( spacebeam )
587INPUT_PORTS_START( ipminvad )
200588   PORT_START
201589   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
202590   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
203591   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
592   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_COCKTAIL
593   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
204594   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
595   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
596   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
597
598   PORT_START   /* IN1 */
599   PORT_DIPNAME(0x03, 0x00, DEF_STR( Lives ) )
600   PORT_DIPSETTING (  0x00, "3" )
601   PORT_DIPSETTING (  0x01, "4" )
602   PORT_DIPSETTING (  0x02, "5" )
603   PORT_DIPNAME( 0x04, 0x00, "Capsules" )
604   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
605   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
606   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
607   PORT_DIPSETTING(    0x00, "1500" )
608   PORT_DIPSETTING(    0x08, "1000" )
609   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coin_A ) )
610   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
611   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
612   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )  // Verified with debugger
613   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
614   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
615   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
616   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
617   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
618   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
619   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
620   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
621
622   PORT_START   /* FAKE */
623   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
624
625   CAB_PORTENV
626INPUT_PORTS_END
627
628INPUT_PORTS_START( spacebeam )
629   PORT_START
630   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
631   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
632   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
633   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
205634   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
206635
207636   PORT_START   /* IN1 */
r1490r1491
226655   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
227656   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
228657   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
658
659   CAB_PORTENV
229660INPUT_PORTS_END
230661
231static INPUT_PORTS_START( headoni )
662INPUT_PORTS_START( headoni )
232663   PORT_START
233664   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
234665   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
r1490r1491
261692   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
262693   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
263694   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
695   CAB_PORTENV
264696INPUT_PORTS_END
265697
266698
267699
700/*************************************
701 *
702 *  Graphics definitions
703 *
704 *************************************/
705
706
268707static const gfx_layout charlayout =
269708{
270709   8,8,   /* 8*8 characters */
r1490r1491
281720   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 8 )
282721GFXDECODE_END
283722
723/*************************************
724 *
725 *  Sound definitions
726 *
727 *************************************/
284728
285static MACHINE_DRIVER_START( skychut )
729static const char *iremm10_sample_names[] =
730{
731   "*ipminvad",
732   "1.wav",      /* shot/missle */
733   "2.wav",      /* base hit/explosion */
734   "3.wav",      /* invader hit */
735   "4.wav",      /* fleet move 1 */
736   "5.wav",      /* fleet move 2 */
737   "6.wav",      /* fleet move 3 */
738   "7.wav",      /* fleet move 4 */
739   "8.wav",      /* UFO/saucer hit */
740   "9.wav",      /* bonus base */
741   "0.wav",      /* UFO sound */
742   0
743};
286744
745
746static struct Samplesinterface iremm10_samples_interface =
747{
748   6,   /* 6 channels */
749   iremm10_sample_names
750};
751
752/*************************************
753 *
754 *  Machine driver
755 *
756 *************************************/
757
758static MACHINE_DRIVER_START( iremm10 )
759
760   MDRV_DRIVER_DATA(irem_state)
761
287762   /* basic machine hardware */
288   MDRV_CPU_ADD(M6502,20000000/8)
289   MDRV_CPU_PROGRAM_MAP(skychut_readmem,skychut_writemem)
290   MDRV_CPU_VBLANK_INT(skychut_interrupt,1)
763   MDRV_CPU_ADD_TAG("Main", M6502,IREMM10_CPU_CLOCK)
764   MDRV_CPU_PROGRAM_MAP(iremm10_main,0)
291765
292   MDRV_SCREEN_REFRESH_RATE(60)
293   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
766   MDRV_MACHINE_RESET(irem)
294767
768   MDRV_CPU_VBLANK_INT(iremm10_interrupt,1)
769
770   MDRV_SCREEN_RAW_PARAMS(IREMM10_PIXEL_CLOCK, IREMM10_HTOTAL, IREMM10_HBEND, IREMM10_HBSTART, IREMM10_VTOTAL, IREMM10_VBEND, IREMM10_VBSTART)
771
295772   /* video hardware */
296773   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
297774   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
298   MDRV_SCREEN_SIZE(32*8, 32*8)
299   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
300775   MDRV_GFXDECODE(skychut)
301776   MDRV_PALETTE_LENGTH(8)
302777   MDRV_COLORTABLE_LENGTH(2*8)
303778
304779   MDRV_PALETTE_INIT(skychut)
305   MDRV_VIDEO_START(generic)
306   MDRV_VIDEO_UPDATE(skychut)
780   //MDRV_VIDEO_START(generic)
781   MDRV_VIDEO_START(iremm10)
782   MDRV_VIDEO_UPDATE(iremm10)
307783
308784   /* sound hardware */
785   MDRV_SPEAKER_STANDARD_MONO("mono")
786
787   MDRV_SOUND_ADD(SAMPLES, 0)
788   MDRV_SOUND_CONFIG(iremm10_samples_interface)
789   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
790
309791MACHINE_DRIVER_END
310792
793static MACHINE_DRIVER_START( iremm11 )
311794
795   MDRV_DRIVER_DATA(irem_state)
796
797   /* basic machine hardware */
798   MDRV_IMPORT_FROM(iremm10)
799   MDRV_CPU_REPLACE("Main", M6502,IREMM10_CPU_CLOCK / 2)
800   //MDRV_CPU_MODIFY("Main")
801   MDRV_CPU_PROGRAM_MAP(iremm11_main,0)
802   MDRV_CPU_VBLANK_INT(iremm11_interrupt,1)
803
804   /* sound hardware */
805MACHINE_DRIVER_END
806
312807static MACHINE_DRIVER_START( greenberet )
313808
809   MDRV_DRIVER_DATA(irem_state)
810
314811   /* basic machine hardware */
315   MDRV_CPU_ADD_TAG("main", M6502,11730000/10)
316   MDRV_CPU_PROGRAM_MAP(greenberet_readmem,greenberet_writemem)
317   MDRV_CPU_VBLANK_INT(skychut_interrupt,1)
812   MDRV_CPU_ADD_TAG("main", M6502,IREMM15_CPU_CLOCK)
813   MDRV_CPU_PROGRAM_MAP(iremm15_main,0)
318814
319   MDRV_SCREEN_REFRESH_RATE(60)
320   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
815   MDRV_MACHINE_RESET(irem)
321816
817   MDRV_CPU_VBLANK_INT(iremm15_interrupt,1)
818
819   MDRV_SCREEN_RAW_PARAMS(IREMM15_PIXEL_CLOCK, IREMM15_HTOTAL, IREMM15_HBEND, IREMM15_HBSTART, IREMM15_VTOTAL, IREMM15_VBEND, IREMM15_VBSTART)
820
322821   /* video hardware */
323822   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
324823   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
325   MDRV_SCREEN_SIZE(32*8, 32*8)
326   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
327824   MDRV_PALETTE_LENGTH(8)
328825   MDRV_COLORTABLE_LENGTH(2*8)
329826
330827   MDRV_PALETTE_INIT(skychut)
331   MDRV_VIDEO_START(generic)
828   MDRV_VIDEO_START( iremm15 )
332829   MDRV_VIDEO_UPDATE(iremm15)
333830
334831   /* sound hardware */
832   MDRV_SPEAKER_STANDARD_MONO("mono")
833
834   MDRV_SOUND_ADD(SAMPLES, 0)
835   MDRV_SOUND_CONFIG(iremm10_samples_interface)
836   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
837
335838MACHINE_DRIVER_END
336839
337840
r1490r1491
340843   MDRV_CPU_REPLACE("main", M6502,11730000/16)
341844MACHINE_DRIVER_END
342845
846static DRIVER_INIT( andromed )
847{
848   int i;
849   irem_state *state = machine->driver_data;
343850
851   for (i=0x1c00;i<0x2000;i++)
852      state->rom[i]=0x60;
853}
344854
855static DRIVER_INIT( iremm15 )
856{
857}
345858
859
346860/***************************************************************************
347861
348862  Game driver(s)
r1490r1491
359873   ROM_LOAD( "am5",  0x2000, 0x0400, CRC(518a3b88) SHA1(5e20c905c2190b381a105327e112fcc0a127bb2f) )
360874   ROM_LOAD( "am6",  0x2400, 0x0400, CRC(ce3d5fff) SHA1(c34178aca9ffb8b2dd468d9e3369a985f52daf9a) )
361875   ROM_LOAD( "am7",  0x2800, 0x0400, CRC(30d3366f) SHA1(aa73bba194fa6d1f3909f8df517a0bff07583ea9) )
876   ROM_LOAD( "am8",  0x2c00, 0x0400, NO_DUMP ) // $60 entries
362877
363878   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
364879   ROM_LOAD( "am9",  0x0000, 0x0400, CRC(a1c8f4db) SHA1(bedf5d7126c7e9b91ad595188c69aa2c043c71e8) )
r1490r1491
434949   ROM_LOAD( "gb9", 0x3000, 0x0400, CRC(c27b9ba3) SHA1(a2f4f0c4b61eb03bba13ae5d25dc01009a4f86ee) ) // ok ?
435950ROM_END
436951
437GAME( 1979, andromed, 0, skychut,    skychut,   0, ROT270, "Irem", "Andromeda (Japan?)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NOT_WORKING )
438GAME( 1979?,ipminvad, 0, skychut,    skychut,   0, ROT270, "Irem", "IPM Invader", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
439GAME( 1980, skychut,  0, skychut,    skychut,   0, ROT270, "Irem", "Sky Chuter", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
440GAME( 1979, spacbeam, 0, greenberet, spacebeam, 0, ROT270, "Irem", "Space Beam", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
441GAME( 1979?,headoni,  0, headoni,    headoni,   0, ROT270, "Irem", "Head On (Irem, M-15 Hardware)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
442GAME( 1980, greenber, 0, greenberet, spacebeam, 0, ROT270, "Irem", "Green Beret (Irem)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NOT_WORKING )
952GAME( 1979, andromed, 0, iremm11,   skychut,  andromed, ROT270, "Irem", "Andromeda (Japan?)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NOT_WORKING )
953GAME( 1979?,ipminvad, 0, iremm10,   ipminvad,   0, ROT270, "Irem", "IPM Invader", GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
954GAME( 1980, skychut,  0, iremm11,    skychut,   0, ROT270, "Irem", "Sky Chuter", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
955GAME( 1979, spacbeam, 0, greenberet, spacebeam, iremm15, ROT270, "Irem", "Space Beam", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
956GAME( 1979?,headoni,  0, headoni,    headoni,   iremm15, ROT270, "Irem", "Head On (Irem, M-15 Hardware)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
957GAME( 1980, greenber, 0, greenberet, spacebeam, iremm15, ROT270, "Irem", "Green Beret (Irem)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NOT_WORKING )
src/mame/drivers/gamecstl.c
r1490r1491
380380    { 0,1,2,3,4,5,6,7 },
381381    /* y offsets */
382382   { 0*8,1*8,2*8,3*8,
383     4*8,5*8,6*8,7*8,
384     0*8,1*8,2*8,3*8,
385383     4*8,5*8,6*8,7*8 },
386384    8*8                     /* every char takes 8 bytes */
387385};
src/mame/drivers/atarigx2.c
r1490r1491
20362036static DRIVER_INIT( spclords )
20372037{
20382038   atarigen_eeprom_default = NULL;
2039   atarijsa_init(1, 4, 2, 0x0040);
2039   atarijsa_init(machine, 2, 0x0040);
20402040   atarijsa3_init_adpcm(REGION_SOUND1);
20412041
20422042   atarigx2_playfield_base = 0x000;
r1490r1491
20482048static DRIVER_INIT( motofren )
20492049{
20502050   atarigen_eeprom_default = NULL;
2051   atarijsa_init(1, 4, 2, 0x0040);
2051   atarijsa_init(machine, 2, 0x0040);
20522052   atarijsa3_init_adpcm(REGION_SOUND1);
20532053
20542054   atarigx2_playfield_base = 0x400;
r1490r1491
20862086static DRIVER_INIT( rrreveng )
20872087{
20882088   atarigen_eeprom_default = NULL;
2089   atarijsa_init(1, 4, 2, 0x0040);
2089   atarijsa_init(machine, 2, 0x0040);
20902090   atarijsa3_init_adpcm(REGION_SOUND1);
20912091
20922092   atarigx2_playfield_base = 0x000;
src/mame/drivers/zac2650.c
r1490r1491
1010
1111#include "driver.h"
1212#include "cpu/s2650/s2650.h"
13#include "video/s2636.h"
1314
1415#include "tinv2650.lh"
1516
16extern UINT8 *zac_s2636ram;
17WRITE8_HANDLER( tinvader_videoram_w );
18WRITE8_HANDLER( tinvader_sound_w );
19READ8_HANDLER( zac_s2636_r );
20READ8_HANDLER( tinvader_port_0_r );
1721
18extern WRITE8_HANDLER( tinvader_videoram_w );
19extern WRITE8_HANDLER( zac_s2636_w );
20extern WRITE8_HANDLER( tinvader_sound_w );
21extern READ8_HANDLER( zac_s2636_r );
22extern READ8_HANDLER( tinvader_port_0_r );
22VIDEO_START( tinvader );
23VIDEO_UPDATE( tinvader );
2324
24extern VIDEO_START( tinvader );
25extern VIDEO_UPDATE( tinvader );
26
2725static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
2826   AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_ROM)
2927    AM_RANGE(0x1800, 0x1bff) AM_READ(MRA8_RAM)
r1490r1491
4543    AM_RANGE(0x1d00, 0x1dff) AM_WRITE(MWA8_RAM)
4644    AM_RANGE(0x1e80, 0x1e80) AM_WRITE(tinvader_sound_w)
4745   AM_RANGE(0x1e86, 0x1e86) AM_WRITE(MWA8_NOP)            /* Dodgem Only */
48   AM_RANGE(0x1f00, 0x1fff) AM_WRITE(zac_s2636_w) AM_BASE(&zac_s2636ram)
46   AM_RANGE(0x1f00, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_1_ram)
4947ADDRESS_MAP_END
5048
5149static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
src/mame/drivers/arkanoid.c
r1490r1491
11/***************************************************************************
22
3    Arkanoid driver (Preliminary)
3    Arkanoid driver
44
55
66    Japanese version support cocktail mode (DSW #7), the others don't.
src/mame/drivers/cherrym2.c
r1490r1491
296296     3+6*64*8, 2+6*64*8, 1+6*64*8, 0+6*64*8,
297297     3+7*64*8, 2+7*64*8, 1+7*64*8, 0+7*64*8,
298298     3+8*64*8, 2+8*64*8, 1+8*64*8, 0+8*64*8,
299     3+9*64*8, 2+9*64*8, 1+9*64*8, 0+9*64*8
299     3+9*64*8, 2+9*64*8, 1+9*64*8, 0+9*64*8,
300     STEP32(0,0), STEP8(0,0)
300301};
301302
302303static const UINT32 spritelayout2_yoffset[128] =
src/mame/drivers/starwars.c
r1490r1491
44
55    driver by Steve Baines (sulaco@ntlworld.com) and Frank Palazzolo
66
7    This file is Copyright 1997, Steve Baines.
7    This file is Copyright Steve Baines.
88    Modified by Frank Palazzolo for sound support
99
1010    Games supported:
src/mame/drivers/cherrym.c
r1490r1491
348348   12,
349349   4,
350350   { 0, 0x2000*8, 0x4000*8, 0x6000*8 },
351   { 0 },
351   EXTENDED_XOFFS,
352352   {
353353         0*8,  1*8,  2*8,  3*8,  4*8,  5*8,  6*8,  7*8,  8*8,  9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8,
354354        16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, 24*8, 25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8
src/tools/src2html.c
r1490r1491
22
33    MAME source code to HTML converter
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/tools/jedutil.c
r1490r1491
44
55    JEDEC file utilities.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/tools/makemeta.c
r1490r1491
44
55    Laserdisc metadata generator.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/tools/regrep.c
r1490r1491
22
33    Regression test report generator
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/tools/chdcd.c
r1490r1491
22
33    CDRDAO TOC parser for CHD compression frontend
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/tools/tools.mak
r1490r1491
44#
55#   MAME tools makefile
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
src/tools/chdcd.h
r1490r1491
22
33    CDRDAO TOC parser for CHD compression frontend
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/tools/chdman.c
r1490r1491
22
33    CHD compression frontend
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
r1490r1491
145145    progress - generic progress callback
146146-------------------------------------------------*/
147147
148static void progress(int forceit, const char *fmt, ...)
148static void ATTR_PRINTF(2,3) progress(int forceit, const char *fmt, ...)
149149{
150150   clock_t curtime = clock();
151151   va_list arg;
src/tools/srcclean.c
r1490r1491
44
55    Basic source code cleanear.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/tools/romcmp.c
r1490r1491
44
55    ROM comparison utility program.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/osd/osdmini/miniwork.c
r1490r1491
22//
33//  miniwork.c - Minimal core work item functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/osdmini/osd_cpu.h
r1490r1491
22//
33//  osd_cpu.h - Minimal core CPU-specific data types
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/osdmini/minimisc.c
r1490r1491
22//
33//  minimisc.c - Minimal core miscellaneous functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/osdmini/osdmini.mak
r1490r1491
44#
55#   Minimal OSD makefile
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
src/osd/osdmini/minisync.c
r1490r1491
22//
33//  minisync.c - Minimal core synchronization functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/osdmini/minidir.c
r1490r1491
22
33    minidir.c - Minimal core directory access functions
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/osd/osdmini/minitime.c
r1490r1491
22//
33//  minitime.c - Minimal core timing functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/osdmini/minifile.c
r1490r1491
22//
33//  minifile.c - Minimal core file access functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/osdcore.h
r1490r1491
44
55    Core OS-dependent code interface.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/osd/osdcomm.h
r1490r1491
55    Common definitions shared by the OSD layer. This includes the most
66    fundamental integral types as well as compiler-specific tweaks.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/osd/osdepend.h
r1490r1491
44
55    OS-dependent code interface.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/osd/windows/strconv.c
r1490r1491
22//
33//  strconv.h - Win32 string conversion
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/output.c
r1490r1491
22//
33//  output.c - Win32 implementation of MAME output routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/d3dintf.h
r1490r1491
22//
33//  drawd3di.h - Direct3D 8/9 interface abstractions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winutil.h
r1490r1491
22//
33//  winutil.h - Win32 OSD core utility functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/osd_cpu.h
r1490r1491
22//
33//  osd_cpu.h - Win32 CPU-specific data types
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/strconv.h
r1490r1491
22//
33//  strconv.h - Win32 string conversion
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/output.h
r1490r1491
22//
33//  output.h - Win32 implementation of MAME output routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/verinfo.c
r1490r1491
22//
33//  verinfo.c - Version resource emitter code
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
r1490r1491
129129//  parse_version
130130//============================================================
131131
132static int parse_version(char *str, int *version_major, int *version_minor, int *version_micro, int *year, const char **version_string)
132static int parse_version(char *str, int *version_major, int *version_minor, int *version_micro, const char **version_string)
133133{
134   char *copyright;
135134   char *version;
136135   int position = 0;
137136
r1490r1491
151150   *version_major = parse_version_digit(version, &position);
152151   *version_minor = parse_version_digit(version, &position);
153152   *version_micro = parse_version_digit(version, &position);
154
155   // find the copyright string
156   copyright = strstr(str, "(c)");
157   if (copyright != NULL)
158      copyright = strchr(copyright, '-');
159   if (copyright == NULL)
160   {
161      fprintf(stderr, "Unable to find copyright string\n");
162      return 1;
163   }
164   copyright++;
165
166   *year = 0;
167   sscanf(copyright, "%d", year);
168153   return 0;
169154}
170155
r1490r1491
177162int main(int argc, char *argv[])
178163{
179164   version_info v;
180   int begin_year, current_year;
181165   char legal_copyright[512];
182166   char *buffer;
183167   size_t size;
r1490r1491
220204   buffer[size] = 0;
221205
222206   // parse out version string
223   if (parse_version(buffer, &v.version_major, &v.version_minor, &v.version_build, &current_year, &v.version_string))
207   if (parse_version(buffer, &v.version_major, &v.version_minor, &v.version_build, &v.version_string))
224208      return 1;
225209
226210#ifdef MESS
r1490r1491
232216   v.internal_name = "MESS";
233217   v.original_filename = "MESS";
234218   v.product_name = "MESS";
235   begin_year = 1998;
236219#elif defined(WINUI)
237220   // MAMEUI
238221   v.author = "Christopher Kirmse and the MAMEUI team";
r1490r1491
242225   v.internal_name = "MAMEUI";
243226   v.original_filename = "MAMEUI";
244227   v.product_name = "MAMEUI";
245   begin_year = 1997;
246228#else
247229   // MAME
248230   v.author = "Nicola Salmoria and the MAME Team";
r1490r1491
252234   v.internal_name = "MAME";
253235   v.original_filename = "MAME";
254236   v.product_name = "MAME";
255   begin_year = 1996;
256237#endif
257238
258239   // build legal_copyright string
259240   v.legal_copyright = legal_copyright;
260   snprintf(legal_copyright, ARRAY_LENGTH(legal_copyright), "Copyright %d-%d Nicola Salmoria and the MAME team", begin_year, current_year);
241   snprintf(legal_copyright, ARRAY_LENGTH(legal_copyright), "Copyright Nicola Salmoria and the MAME team");
261242
262243   // emit the info
263244   emit_version_info(&v);
src/osd/windows/wintime.c
r1490r1491
22//
33//  wintime.c - Win32 OSD core timing functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/drawnone.c
r1490r1491
22//
33//  drawnone.c - stub "nothing" drawer
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/windows.mak
r1490r1491
44#
55#   Windows-specific makefile
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
src/osd/windows/winprefix.h
r1490r1491
22//
33//  winprefix.h - Win32 prefix file, included by ALL files
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/drawgdi.c
r1490r1491
22//
33//  drawgdi.c - Win32 GDI drawing
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/d3d8intf.c
r1490r1491
22//
33//  d3d9intf.c - Direct3D 8.1 abstraction layer
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/d3d9intf.c
r1490r1491
22//
33//  d3d9intf.c - Direct3D 9 abstraction layer
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/sound.c
r1490r1491
22//
33//  sound.c - Win32 implementation of MAME sound routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winsync.c
r1490r1491
22//
33//  winsync.c - Win32 OSD core synchronization functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/vconv.c
r1490r1491
22//
33//  vconv.c - VC++ parameter conversion code
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/eivc.h
r1490r1491
44//
55//  Inline implementations for MSVC compiler.
66//
7//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7//  Copyright Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
99//
1010//============================================================
src/osd/windows/windir.c
r1490r1491
22
33    windir.c - Win32 OSD core directory access functions
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/osd/windows/sound.h
r1490r1491
22//
33//  sound.h - Win32 implementation of MAME sound routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winfile.c
r1490r1491
22//
33//  winfile.c - Win32 OSD core file access functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/input.c
r1490r1491
22//
33//  input.c - Win32 implementation of MAME input routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
r1490r1491
10951095   // release all our devices
10961096   while (joystick_list != NULL && joystick_list->dinput.device != NULL)
10971097      dinput_device_release(joystick_list);
1098   while (lightgun_list != NULL && lightgun_list->dinput.device != NULL)
1099      dinput_device_release(lightgun_list);
1098   while (lightgun_list != NULL)
1099      generic_device_free(lightgun_list);
11001100   while (mouse_list != NULL && mouse_list->dinput.device != NULL)
11011101      dinput_device_release(mouse_list);
11021102   while (keyboard_list != NULL && keyboard_list->dinput.device != NULL)
src/osd/windows/winwork.c
r1490r1491
22//
33//  winwork.c - Win32 OSD core work item functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/mame.rc
r1490r1491
11//
22//   mame.rc - Minimal resource file for Win32 MAME
33//
4//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
4//  Copyright Nicola Salmoria and the MAME Team.
55//  Visit http://mamedev.org for licensing and usage restrictions.
66//
77
src/osd/windows/eivcx86.h
r1490r1491
44//
55//  x86 inline implementations for MSVC compiler.
66//
7//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7//  Copyright Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
99//
1010//============================================================
src/osd/windows/ledutil.c
r1490r1491
33//  ledutil.c - Win32 example code that tracks changing
44//  outputs and updates the keyboard LEDs in response
55//
6//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
6//  Copyright Nicola Salmoria and the MAME Team.
77//  Visit http://mamedev.org for licensing and usage restrictions.
88//
99//============================================================
src/osd/windows/winmain.c
r1490r1491
22//
33//  winmain.c - Win32 main program
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/debugwin.c
r1490r1491
22//
33//  debugwin.c - Win32 debug window handling
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
r1490r1491
279279      // check for F10 -- we need to capture that ourselves
280280      case WM_SYSKEYDOWN:
281281      case WM_SYSKEYUP:
282         if (message.wParam == VK_F4 && message.message == WM_SYSKEYDOWN)
283            SendMessage(GetAncestor(GetFocus(), GA_ROOT), WM_CLOSE, 0, 0);
282284         if (message.wParam == VK_F10)
283            SendMessage(GetFocus(), (message.message == WM_SYSKEYDOWN) ? WM_KEYDOWN : WM_KEYUP, message.wParam, message.lParam);
285            SendMessage(GetAncestor(GetFocus(), GA_ROOT), (message.message == WM_SYSKEYDOWN) ? WM_KEYDOWN : WM_KEYUP, message.wParam, message.lParam);
284286         break;
285287
286288      // process everything else
src/osd/windows/input.h
r1490r1491
22//
33//  input.h - Win32 implementation of MAME input routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winutf8.c
r1490r1491
22//
33//  winutf8.c - Win32 OSD core utility functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/drawdd.c
r1490r1491
22//
33//  drawdd.c - Win32 DirectDraw implementation
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/video.c
r1490r1491
22//
33//  video.c - Win32 video handling
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/window.c
r1490r1491
22//
33//  window.c - Win32 window handling
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winmain.h
r1490r1491
22//
33//  winmain.h - Win32 main program and core headers
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winalloc.c
r1490r1491
22//
33//  winalloc.c - Win32 memory allocation routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/debugwin.h
r1490r1491
22//
33//  debugwin.h - Win32 debug window handling
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winmisc.c
r1490r1491
22//
33//  winmisc.c - Win32 OSD core miscellaneous functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/winutf8.h
r1490r1491
22//
33//  winutf8.h - Win32 UTF-8 wrappers
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/video.h
r1490r1491
22//
33//  video.h - Win32 implementation of MAME video routines
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/window.h
r1490r1491
22//
33//  window.h - Win32 window handling
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/main.c
r1490r1491
22//
33//  main.c - Win32 main program
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/osd/windows/osinline.h
r1490r1491
44//
55//  Inline implementations for non-GCC Win32 compilers
66//
7//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7//  Copyright Nicola Salmoria and the MAME Team.
88//  Visit http://mamedev.org for licensing and usage restrictions.
99//
1010//============================================================
src/osd/windows/drawd3d.c
r1490r1491
22//
33//  drawd3d.c - Win32 Direct3D implementation
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
r1490r1491
129129   int                  adapter;               // ordinal adapter number
130130   int                  width, height;            // current width, height
131131   int                  refresh;               // current refresh rate
132   int                  create_error_count;         // number of consecutive create errors
132133
133134   d3d_device *         device;                  // pointer to the Direct3DDevice object
134135   int                  gamma_supported;         // is full screen gamma supported?
r1490r1491
745746               D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_FPU_PRESERVE, &d3d->presentation, &d3d->device);
746747   if (result != D3D_OK)
747748   {
749      // if we got a "DEVICELOST" error, it may be transitory; count it and only fail if
750      // we exceed a threshold
751      if (result == D3DERR_DEVICELOST)
752      {
753         d3d->create_error_count++;
754         if (d3d->create_error_count < 10)
755            return 0;
756      }
757
758      //  fatal error if we just can't do it
748759      mame_printf_error("Unable to create the Direct3D device (%08X)\n", (UINT32)result);
749760      return 1;
750761   }
762   d3d->create_error_count = 0;
751763   mame_printf_verbose("Direct3D: Device created at %dx%d\n", d3d->width, d3d->height);
752764
753765   // set the max texture size
src/osd/windows/winutil.c
r1490r1491
22//
33//  winutil.c - Win32 OSD core utility functions
44//
5//  Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5//  Copyright Nicola Salmoria and the MAME Team.
66//  Visit http://mamedev.org for licensing and usage restrictions.
77//
88//============================================================
src/emu/romload.h
r1490r1491
44
55    ROM loading functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/config.c
r1490r1491
44
55    Configuration file I/O.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/debug/express.h
r1490r1491
33    express.h
44    Generic expressions engine.
55    Written by Aaron Giles
6    Copyright (c) 2006, Aaron Giles
6    Copyright Aaron Giles
77
88***************************************************************************/
99
src/emu/debug/debugcpu.c
r1490r1491
44
55    Debugger CPU/memory interface engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/debughlp.h
r1490r1491
44
55    Debugger help engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/debugcmt.h
r1490r1491
44
55    Debugger code-comment management functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/debug/debugvw.c
r1490r1491
44
55    Debugger view engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/debugcpu.h
r1490r1491
44
55    Debugger CPU/memory interface engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/debugvw.h
r1490r1491
44
55    Debugger view engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/debugcmd.c
r1490r1491
44
55    Debugger command interface engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/debugcmd.h
r1490r1491
44
55    Debugger command interface engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/textbuf.c
r1490r1491
44
55    Debugger text buffering engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/debug/textbuf.h
r1490r1491
44
55    Debugger text buffering engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/debug/debugcon.c
r1490r1491
44
55    Debugger console engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/debug/express.c
r1490r1491
33    express.c
44    Generic expressions engine.
55    Written by Aaron Giles
6    Copyright (c) 2005, Aaron Giles
6    Copyright Aaron Giles
77
88***************************************************************************/
99
src/emu/debug/debughlp.c
r1490r1491
44
55    Debugger help engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
r1490r1491
7979      "  help [<topic>] -- get help on a particular topic\n"
8080      "  do <expression> -- evaluates the given expression\n"
8181      "  symlist [<cpunum>] -- lists registered symbols\n"
82      "  softreset -- executes a soft reset\n"
83      "  hardreset -- executes a hard reset\n"
8284      "  print <item>[,...] -- prints one or more <item>s to the console\n"
8385      "  printf <format>[,<item>[,...]] -- prints one or more <item>s to the console using <format>\n"
8486      "  logerror <format>[,<item>[,...]] -- outputs one or more <item>s to the error.log\n"
8587      "  tracelog <format>[,<item>[,...]] -- outputs one or more <item>s to the trace file using <format>\n"
8688      "  snap [<filename>] -- save a screen snapshot\n"
89      "  source <filename> -- reads commands from <filename> and executes them one by one\n"
8790      "  quit -- exits MAME and the debugger\n"
8891   },
8992   {
r1490r1491
118121      "  out -- single steps until the current subroutine/exception handler is exited (Shift-F11)\n"
119122      "  g[o] [<address>] -- resumes execution, sets temp breakpoint at <address> (F5)\n"
120123      "  gi[nt] [<irqline>] -- resumes execution, setting temp breakpoint if <irqline> is taken (F7)\n"
124      "  gt[ime] <milliseconds> -- resumes execution until the given delay has elapsed\n"
121125      "  gv[blank] -- resumes execution, setting temp breakpoint on the next VBLANK (F8)\n"
122126      "  n[ext] -- executes until the next CPU switch (F6)\n"
123127      "  focus <cpunum> -- focuses debugger only on <cpunum>\n"
124128      "  ignore [<cpunum>[,<cpunum>[,...]]] -- stops debugging on <cpunum>\n"
125129      "  observe [<cpunum>[,<cpunum>[,...]]] -- resumes debugging on <cpunum>\n"
126130      "  trace {<filename>|OFF}[,<cpunum>[,<action>]] -- trace the given CPU to a file (defaults to active CPU)\n"
131      "  traceover {<filename>|OFF}[,<cpunum>[,<action>]] -- trace the given CPU to a file, but skip subroutines (defaults to active CPU)\n"
132      "  traceflush -- flushes all open trace files\n"
127133   },
128134   {
129135      "breakpoints",
src/emu/debug/debugcmt.c
r1490r1491
44
55    Debugger code-comment management functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/debug/debugcon.h
r1490r1491
44
55    Debugger console engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/cpu/lh5801/lh5801.c
r1490r1491
11/*****************************************************************************
22 *
3 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
3 *   Copyright Peter Trauner, all rights reserved.
44 *
55 *   - This source code is released as freeware for non-commercial purposes.
66 *   - You are free to use and redistribute this code in modified or
r1490r1491
246246      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s = cpuintrf_temp_str(), "LH5801"); break;
247247      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s = cpuintrf_temp_str(), "1.0alpha"); break;
248248      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s = cpuintrf_temp_str(), __FILE__); break;
249      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s = cpuintrf_temp_str(), "Copyright (c) 2000 Peter Trauner, all rights reserved."); break;
249      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s = cpuintrf_temp_str(), "Copyright Peter Trauner, all rights reserved."); break;
250250
251251      case CPUINFO_STR_FLAGS:
252252         sprintf(info->s = cpuintrf_temp_str(), "%s%s%s%s%s%s%s%s",
src/emu/cpu/lh5801/5801dasm.c
r1490r1491
33 *   disasm.c
44 *   portable lh5801 emulator interface
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/lh5801/lh5801.h
r1490r1491
33 *   lh5801.h
44 *   portable lh5801 emulator interface
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6809/m6809.c
r1490r1491
11/*** m6809: Portable 6809 emulator ******************************************
22
3    Copyright (C) John Butler 1997
3    Copyright John Butler
44
55    References:
66
r1490r1491
11821182      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Motorola 6809");      break;
11831183      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.11");            break;
11841184      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1185      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) John Butler 1997"); break;
1185      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright John Butler"); break;
11861186
11871187      case CPUINFO_STR_FLAGS:
11881188         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/m6809/6809dasm.c
r1490r1491
22
33    6809dasm.c - a 6809 opcode disassembler
44    Version 1.4 1-MAR-95
5    Copyright 1995 Sean Riddle
5    Copyright Sean Riddle
66
77    Thanks to Franklin Bowen for bug fixes, ideas
88
src/emu/cpu/m68000/m68kconf.h
r1490r1491
66 *                                Version 3.32
77 *
88 * A portable Motorola M680x0 processor emulation engine.
9 * Copyright 1998-2007 Karl Stenerud.  All rights reserved.
9 * Copyright Karl Stenerud.  All rights reserved.
1010 *
1111 * This code may be freely used for non-commercial purposes as long as this
1212 * copyright notice remains unaltered in the source code and any binary files
src/emu/cpu/m68000/m68kcpu.h
r1490r1491
77 *                                Version 3.32
88 *
99 * A portable Motorola M680x0 processor emulation engine.
10 * Copyright 1998-2007 Karl Stenerud.  All rights reserved.
10 * Copyright Karl Stenerud.  All rights reserved.
1111 *
1212 * This code may be freely used for non-commercial purposes as long as this
1313 * copyright notice remains unaltered in the source code and any binary files
src/emu/cpu/m68000/m68kmake.c
r1490r1491
66 *                                Version 3.32
77 *
88 * A portable Motorola M680x0 processor emulation engine.
9 * Copyright 1998-2007 Karl Stenerud.  All rights reserved.
9 * Copyright Karl Stenerud.  All rights reserved.
1010 *
1111 * This code may be freely used for non-commercial purposes as long as this
1212 * copyright notice remains unaltered in the source code and any binary files
r1490r1491
12331233   int ophandler_body_read = 0;
12341234
12351235   printf("\n\tMusashi v%s 68000, 68008, 68010, 68EC020, 68020, 68040 emulator\n", g_version);
1236   printf("\tCopyright 1998-2007 Karl Stenerud (karl@mame.net)\n\n");
1236   printf("\tCopyright Karl Stenerud (karl@mame.net)\n\n");
12371237
12381238   /* Check if output path and source for the input file are given */
12391239    if(argc > 1)
src/emu/cpu/m68000/m68kmame.c
r1490r1491
582582      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Motorola 68K");      break;
583583      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "3.32");               break;
584584      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
585      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 1998-2007 Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
585      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
586586
587587      case CPUINFO_STR_FLAGS:
588588         sr = m68k_get_reg(NULL, M68K_REG_SR);
r1490r1491
761761      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Motorola 68K");      break;
762762      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "3.32");               break;
763763      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
764      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 1998-2007 Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
764      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
765765
766766      case CPUINFO_STR_FLAGS:
767767         sr = m68k_get_reg(NULL, M68K_REG_SR);
r1490r1491
10011001      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Motorola 68K");      break;
10021002      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "3.32");               break;
10031003      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1004      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 1998-2007 Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
1004      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
10051005
10061006      case CPUINFO_STR_FLAGS:
10071007         sr = m68k_get_reg(NULL, M68K_REG_SR);
r1490r1491
12421242      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Motorola 68K");      break;
12431243      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "3.32");               break;
12441244      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1245      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 1998-2007 Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
1245      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
12461246
12471247      case CPUINFO_STR_FLAGS:
12481248         sr = m68k_get_reg(NULL, M68K_REG_SR);
src/emu/cpu/m68000/m68k.h
r1490r1491
99 *                                Version 3.32
1010 *
1111 * A portable Motorola M680x0 processor emulation engine.
12 * Copyright 1998-2007 Karl Stenerud.  All rights reserved.
12 * Copyright Karl Stenerud.  All rights reserved.
1313 *
1414 * This code may be freely used for non-commercial purposes as long as this
1515 * copyright notice remains unaltered in the source code and any binary files
src/emu/cpu/m68000/m68kdasm.c
r1490r1491
66 *                                Version 3.32
77 *
88 * A portable Motorola M680x0 processor emulation engine.
9 * Copyright 1998-2007 Karl Stenerud.  All rights reserved.
9 * Copyright Karl Stenerud.  All rights reserved.
1010 *
1111 * This code may be freely used for non-commercial purposes as long as this
1212 * copyright notice remains unaltered in the source code and any binary files
src/emu/cpu/m68000/m68k_in.c
r1490r1491
1111 *                                Version 3.32
1212 *
1313 * A portable Motorola M680x0 processor emulation engine.
14 * Copyright 1998-2007 Karl Stenerud.  All rights reserved.
14 * Copyright Karl Stenerud.  All rights reserved.
1515 *
1616 * This code may be freely used for non-commercial purposes as long as this
1717 * copyright notice remains unaltered in the source code and any binary files
src/emu/cpu/m68000/m68kcpu.c
r1490r1491
77"MUSASHI\n"
88"Version 3.32 (2007-12-15)\n"
99"A portable Motorola M680x0 processor emulation engine.\n"
10"Copyright 1998-2007 Karl Stenerud.  All rights reserved.\n"
10"Copyright Karl Stenerud.  All rights reserved.\n"
1111"\n"
1212"This code may be freely used for non-commercial purpooses as long as this\n"
1313"copyright notice remains unaltered in the source code and any binary files\n"
src/emu/cpu/ccpu/ccpu.c
r1490r1491
774774      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Cinematronics CPU");   break;
775775      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
776776      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
777      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 2004 Aaron Giles & Zonn Moore"); break;
777      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles & Zonn Moore"); break;
778778
779779      case CPUINFO_STR_FLAGS:
780780          sprintf(info->s, "%c%c%c%c%c%c",
src/emu/cpu/z80gb/z80gbd.c
r1490r1491
33 *   z80gbd.c
44 *   Portable Z80 Gameboy disassembler
55 *
6 *   Copyright (C) 2000 by The MESS Team.
6 *   Copyright The MESS Team.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/z80gb/z80gb.c
r1490r1491
458458   case CPUINFO_STR_CORE_FAMILY:                strcpy(info->s, "Nintendo Z80"); break;
459459   case CPUINFO_STR_CORE_VERSION:                strcpy(info->s, "1.3"); break;
460460   case CPUINFO_STR_CORE_FILE:                strcpy(info->s, __FILE__); break;
461   case CPUINFO_STR_CORE_CREDITS:                strcpy(info->s, "Copyright (C) 2000 by The MESS Team."); break;
461   case CPUINFO_STR_CORE_CREDITS:                strcpy(info->s, "Copyright The MESS Team."); break;
462462
463463   case CPUINFO_STR_FLAGS:
464464      sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/tms34010/34010ops.h
r1490r1491
22
33    TMS34010: Portable Texas Instruments TMS34010 emulator
44
5    Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998
5    Copyright Alex Pasadyn/Zsolt Vasvari
66    Parts based on code by Aaron Giles
77
88***************************************************************************/
src/emu/cpu/tms34010/tms34010.h
r1490r1491
22
33    TMS34010: Portable Texas Instruments TMS34010 emulator
44
5    Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998
5    Copyright Alex Pasadyn/Zsolt Vasvari
66    Parts based on code by Aaron Giles
77
88***************************************************************************/
src/emu/cpu/tms34010/dis34010.c
r1490r1491
3232   FILE *f;
3333        UINT32 begin=0,end=(UINT32)-1,filelen,len,pc;
3434   printf ("DIS34010\n"
35                        "Copyright (C) Zsolt Vasvari/Aaron Giles 1998-1999\n");
35                        "Copyright Zsolt Vasvari/Aaron Giles\n");
3636
3737   for (i=1,n=0;i<argc;++i)
3838   {
src/emu/cpu/tms34010/34010ops.c
r1490r1491
22
33    TMS34010: Portable Texas Instruments TMS34010 emulator
44
5    Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998
5    Copyright Alex Pasadyn/Zsolt Vasvari
66    Parts based on code by Aaron Giles
77
88***************************************************************************/
r1490r1491
23572357   UINT32 v = R##REG(DSTREG);               \
23582358   switch (state.pixelshift)               \
23592359   {                                 \
2360      case 1:                           \
2360      case 0:                           \
23612361         v = (v & 1) ? 0xffffffff : 0x00000000;\
23622362           COUNT_CYCLES(8);               \
23632363           break;                        \
2364      case 2:                           \
2364      case 1:                           \
23652365         v &= 3;                        \
23662366         v |= v << 2;                  \
23672367         v |= v << 4;                  \
r1490r1491
23692369         v |= v << 16;                  \
23702370         COUNT_CYCLES(7);               \
23712371         break;                        \
2372      case 4:                           \
2372      case 2:                           \
23732373         v &= 0x0f;                     \
23742374         v |= v << 4;                  \
23752375         v |= v << 8;                  \
23762376         v |= v << 16;                  \
23772377         COUNT_CYCLES(6);               \
23782378         break;                        \
2379      case 8:                           \
2379      case 3:                           \
23802380         v &= 0xff;                     \
23812381         v |= v << 8;                  \
23822382         v |= v << 16;                  \
23832383         COUNT_CYCLES(5);               \
23842384         break;                        \
2385      case 16:                        \
2385      case 4:                           \
23862386         v &= 0xffff;                  \
23872387         v |= v << 16;                  \
23882388         COUNT_CYCLES(4);               \
23892389         break;                        \
2390      case 32:                        \
2390      case 5:                           \
23912391         COUNT_CYCLES(2);               \
23922392         break;                        \
23932393   }                                 \
src/emu/cpu/tms34010/34010tbl.c
r1490r1491
11/*** TMS34010: Portable TMS34010 emulator ***********************************
22
3    Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998
3    Copyright Alex Pasadyn/Zsolt Vasvari
44
55    Opcode Table
66
src/emu/cpu/tms34010/tms34010.c
r1490r1491
22
33    TMS34010: Portable Texas Instruments TMS34010 emulator
44
5    Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998
5    Copyright Alex Pasadyn/Zsolt Vasvari
66    Parts based on code by Aaron Giles
77
88***************************************************************************/
r1490r1491
2626
2727#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
2828
29
30
2931/***************************************************************************
3032    CORE STATE
3133***************************************************************************/
r1490r1491
4749   UINT16 op;
4850   UINT32 pc;
4951   UINT32 st;
50   void (*pixel_write)(offs_t offset,UINT32 data);
52   void (*pixel_write)(offs_t offset, UINT32 data);
5153   UINT32 (*pixel_read)(offs_t offset);
52    INT32 (*raster_op)(INT32 newpix, INT32 oldpix);
54   UINT32 (*raster_op)(UINT32 newpix, UINT32 oldpix);
5355   UINT32 convsp;
5456   UINT32 convdp;
5557   UINT32 convmp;
r1490r1491
5860   UINT8 pixelshift;
5961   UINT8 is_34020;
6062   UINT8 reset_deferred;
63   UINT8 hblank_stable;
6164   int (*irq_callback)(int irqline);
6265   const tms34010_config *config;
6366   emu_timer *scantimer;
r1490r1491
107110    FUNCTION TABLES
108111***************************************************************************/
109112
110extern void (*tms34010_wfield_functions[32])(offs_t offset,UINT32 data);
113extern void (*tms34010_wfield_functions[32])(offs_t offset, UINT32 data);
111114extern UINT32 (*tms34010_rfield_functions[64])(offs_t offset);
112115
113116
r1490r1491
268271}
269272
270273/* write memory byte */
271INLINE void WBYTE(offs_t offset,UINT32 data)
274INLINE void WBYTE(offs_t offset, UINT32 data)
272275{
273276   WFIELDMAC_8;
274277}
r1490r1491
280283}
281284
282285/* write memory long */
283INLINE void WLONG(offs_t offset,UINT32 data)
286INLINE void WLONG(offs_t offset, UINT32 data)
284287{
285288   WFIELDMAC_32;
286289}
r1490r1491
318321   /* TODO: Plane masking */
319322   return TMS34010_RDMEM_WORD(TOBYTE(offset & 0xfffffff0));
320323}
324static UINT32 read_pixel_32(offs_t offset)
325{
326   /* TODO: Plane masking */
327   return TMS34010_RDMEM_DWORD(TOBYTE(offset & 0xffffffe0));
328}
321329
322330/* Shift register read */
323331static UINT32 read_pixel_shiftreg(offs_t offset)
r1490r1491
388396
389397
390398/* No Raster Op + No Transparency */
391static void write_pixel_1(offs_t offset,UINT32 data) { WP(0x0f, 0x01); }
392static void write_pixel_2(offs_t offset,UINT32 data) { WP(0x0e, 0x03); }
393static void write_pixel_4(offs_t offset,UINT32 data) { WP(0x0c, 0x0f); }
394static void write_pixel_8(offs_t offset,UINT32 data) { WP(0x08, 0xff); }
395static void write_pixel_16(offs_t offset,UINT32 data)
399static void write_pixel_1(offs_t offset, UINT32 data) { WP(0x0f, 0x01); }
400static void write_pixel_2(offs_t offset, UINT32 data) { WP(0x0e, 0x03); }
401static void write_pixel_4(offs_t offset, UINT32 data) { WP(0x0c, 0x0f); }
402static void write_pixel_8(offs_t offset, UINT32 data) { WP(0x08, 0xff); }
403static void write_pixel_16(offs_t offset, UINT32 data)
396404{
397405   /* TODO: plane masking */
398406   TMS34010_WRMEM_WORD(TOBYTE(offset & 0xfffffff0), data);
399407}
408static void write_pixel_32(offs_t offset, UINT32 data)
409{
410   /* TODO: plane masking */
411   TMS34010_WRMEM_WORD(TOBYTE(offset & 0xffffffe0), data);
412}
400413
401414/* No Raster Op + Transparency */
402static void write_pixel_t_1(offs_t offset,UINT32 data) { WP_T(0x0f, 0x01); }
403static void write_pixel_t_2(offs_t offset,UINT32 data) { WP_T(0x0e, 0x03); }
404static void write_pixel_t_4(offs_t offset,UINT32 data) { WP_T(0x0c, 0x0f); }
405static void write_pixel_t_8(offs_t offset,UINT32 data) { WP_T(0x08, 0xff); }
406static void write_pixel_t_16(offs_t offset,UINT32 data)
415static void write_pixel_t_1(offs_t offset, UINT32 data) { WP_T(0x0f, 0x01); }
416static void write_pixel_t_2(offs_t offset, UINT32 data) { WP_T(0x0e, 0x03); }
417static void write_pixel_t_4(offs_t offset, UINT32 data) { WP_T(0x0c, 0x0f); }
418static void write_pixel_t_8(offs_t offset, UINT32 data) { WP_T(0x08, 0xff); }
419static void write_pixel_t_16(offs_t offset, UINT32 data)
407420{
408421   /* TODO: plane masking */
409422   if (data)
410423      TMS34010_WRMEM_WORD(TOBYTE(offset & 0xfffffff0), data);
411424}
425static void write_pixel_t_32(offs_t offset, UINT32 data)
426{
427   /* TODO: plane masking */
428   if (data)
429      TMS34010_WRMEM_DWORD(TOBYTE(offset & 0xffffffe0), data);
430}
412431
413432/* Raster Op + No Transparency */
414static void write_pixel_r_1(offs_t offset,UINT32 data) { WP_R(0x0f, 0x01); }
415static void write_pixel_r_2(offs_t offset,UINT32 data) { WP_R(0x0e, 0x03); }
416static void write_pixel_r_4(offs_t offset,UINT32 data) { WP_R(0x0c, 0x0f); }
417static void write_pixel_r_8(offs_t offset,UINT32 data) { WP_R(0x08, 0xff); }
418static void write_pixel_r_16(offs_t offset,UINT32 data)
433static void write_pixel_r_1(offs_t offset, UINT32 data) { WP_R(0x0f, 0x01); }
434static void write_pixel_r_2(offs_t offset, UINT32 data) { WP_R(0x0e, 0x03); }
435static void write_pixel_r_4(offs_t offset, UINT32 data) { WP_R(0x0c, 0x0f); }
436static void write_pixel_r_8(offs_t offset, UINT32 data) { WP_R(0x08, 0xff); }
437static void write_pixel_r_16(offs_t offset, UINT32 data)
419438{
420439   /* TODO: plane masking */
421440   UINT32 a = TOBYTE(offset & 0xfffffff0);
422441   TMS34010_WRMEM_WORD(a, state.raster_op(data, TMS34010_RDMEM_WORD(a)));
423442}
443static void write_pixel_r_32(offs_t offset, UINT32 data)
444{
445   /* TODO: plane masking */
446   UINT32 a = TOBYTE(offset & 0xffffffe0);
447   TMS34010_WRMEM_DWORD(a, state.raster_op(data, TMS34010_RDMEM_DWORD(a)));
448}
424449
425450/* Raster Op + Transparency */
426static void write_pixel_r_t_1(offs_t offset,UINT32 data) { WP_R_T(0x0f,0x01); }
427static void write_pixel_r_t_2(offs_t offset,UINT32 data) { WP_R_T(0x0e,0x03); }
428static void write_pixel_r_t_4(offs_t offset,UINT32 data) { WP_R_T(0x0c,0x0f); }
429static void write_pixel_r_t_8(offs_t offset,UINT32 data) { WP_R_T(0x08,0xff); }
430static void write_pixel_r_t_16(offs_t offset,UINT32 data)
451static void write_pixel_r_t_1(offs_t offset, UINT32 data) { WP_R_T(0x0f,0x01); }
452static void write_pixel_r_t_2(offs_t offset, UINT32 data) { WP_R_T(0x0e,0x03); }
453static void write_pixel_r_t_4(offs_t offset, UINT32 data) { WP_R_T(0x0c,0x0f); }
454static void write_pixel_r_t_8(offs_t offset, UINT32 data) { WP_R_T(0x08,0xff); }
455static void write_pixel_r_t_16(offs_t offset, UINT32 data)
431456{
432457   /* TODO: plane masking */
433458   UINT32 a = TOBYTE(offset & 0xfffffff0);
r1490r1491
436461   if (data)
437462      TMS34010_WRMEM_WORD(a, data);
438463}
464static void write_pixel_r_t_32(offs_t offset, UINT32 data)
465{
466   /* TODO: plane masking */
467   UINT32 a = TOBYTE(offset & 0xffffffe0);
468   data = state.raster_op(data, TMS34010_RDMEM_DWORD(a));
439469
470   if (data)
471      TMS34010_WRMEM_DWORD(a, data);
472}
473
440474/* Shift register write */
441static void write_pixel_shiftreg(offs_t offset,UINT32 data)
475static void write_pixel_shiftreg(offs_t offset, UINT32 data)
442476{
443477   if (state.config->from_shiftreg)
444478      state.config->from_shiftreg(offset, &state.shiftreg[0]);
r1490r1491
453487***************************************************************************/
454488
455489/* Raster operations */
456static INT32 raster_op_1(INT32 newpix, INT32 oldpix)  { return newpix & oldpix; }
457static INT32 raster_op_2(INT32 newpix, INT32 oldpix)  { return newpix & ~oldpix; }
458static INT32 raster_op_3(INT32 newpix, INT32 oldpix)  { return 0; }
459static INT32 raster_op_4(INT32 newpix, INT32 oldpix)  { return newpix | ~oldpix; }
460static INT32 raster_op_5(INT32 newpix, INT32 oldpix)  { return ~(newpix ^ oldpix); }
461static INT32 raster_op_6(INT32 newpix, INT32 oldpix)  { return ~oldpix; }
462static INT32 raster_op_7(INT32 newpix, INT32 oldpix)  { return ~(newpix | oldpix); }
463static INT32 raster_op_8(INT32 newpix, INT32 oldpix)  { return newpix | oldpix; }
464static INT32 raster_op_9(INT32 newpix, INT32 oldpix)  { return oldpix; }
465static INT32 raster_op_10(INT32 newpix, INT32 oldpix) { return newpix ^ oldpix; }
466static INT32 raster_op_11(INT32 newpix, INT32 oldpix) { return ~newpix & oldpix; }
467static INT32 raster_op_12(INT32 newpix, INT32 oldpix) { return 0xffff; }
468static INT32 raster_op_13(INT32 newpix, INT32 oldpix) { return ~newpix | oldpix; }
469static INT32 raster_op_14(INT32 newpix, INT32 oldpix) { return ~(newpix & oldpix); }
470static INT32 raster_op_15(INT32 newpix, INT32 oldpix) { return ~newpix; }
471static INT32 raster_op_16(INT32 newpix, INT32 oldpix) { return newpix + oldpix; }
472static INT32 raster_op_17(INT32 newpix, INT32 oldpix)
490static UINT32 raster_op_1(UINT32 newpix, UINT32 oldpix)  { return newpix & oldpix; }
491static UINT32 raster_op_2(UINT32 newpix, UINT32 oldpix)  { return newpix & ~oldpix; }
492static UINT32 raster_op_3(UINT32 newpix, UINT32 oldpix)  { return 0; }
493static UINT32 raster_op_4(UINT32 newpix, UINT32 oldpix)  { return newpix | ~oldpix; }
494static UINT32 raster_op_5(UINT32 newpix, UINT32 oldpix)  { return ~(newpix ^ oldpix); }
495static UINT32 raster_op_6(UINT32 newpix, UINT32 oldpix)  { return ~oldpix; }
496static UINT32 raster_op_7(UINT32 newpix, UINT32 oldpix)  { return ~(newpix | oldpix); }
497static UINT32 raster_op_8(UINT32 newpix, UINT32 oldpix)  { return newpix | oldpix; }
498static UINT32 raster_op_9(UINT32 newpix, UINT32 oldpix)  { return oldpix; }
499static UINT32 raster_op_10(UINT32 newpix, UINT32 oldpix) { return newpix ^ oldpix; }
500static UINT32 raster_op_11(UINT32 newpix, UINT32 oldpix) { return ~newpix & oldpix; }
501static UINT32 raster_op_12(UINT32 newpix, UINT32 oldpix) { return 0xffff; }
502static UINT32 raster_op_13(UINT32 newpix, UINT32 oldpix) { return ~newpix | oldpix; }
503static UINT32 raster_op_14(UINT32 newpix, UINT32 oldpix) { return ~(newpix & oldpix); }
504static UINT32 raster_op_15(UINT32 newpix, UINT32 oldpix) { return ~newpix; }
505static UINT32 raster_op_16(UINT32 newpix, UINT32 oldpix) { return newpix + oldpix; }
506static UINT32 raster_op_17(UINT32 newpix, UINT32 oldpix)
473507{
474   INT32 max = (UINT32)0xffffffff >> (32 - IOREG(REG_PSIZE));
475   INT32 res = newpix + oldpix;
508   UINT32 max = (UINT32)0xffffffff >> (32 - IOREG(REG_PSIZE));
509   UINT32 res = newpix + oldpix;
476510   return (res > max) ? max : res;
477511}
478static INT32 raster_op_18(INT32 newpix, INT32 oldpix) { return oldpix - newpix; }
479static INT32 raster_op_19(INT32 newpix, INT32 oldpix) { return (oldpix > newpix) ? oldpix - newpix : 0; }
480static INT32 raster_op_20(INT32 newpix, INT32 oldpix) { return (oldpix > newpix) ? oldpix : newpix; }
481static INT32 raster_op_21(INT32 newpix, INT32 oldpix) { return (oldpix > newpix) ? newpix : oldpix; }
512static UINT32 raster_op_18(UINT32 newpix, UINT32 oldpix) { return oldpix - newpix; }
513static UINT32 raster_op_19(UINT32 newpix, UINT32 oldpix) { return (oldpix > newpix) ? oldpix - newpix : 0; }
514static UINT32 raster_op_20(UINT32 newpix, UINT32 oldpix) { return (oldpix > newpix) ? oldpix : newpix; }
515static UINT32 raster_op_21(UINT32 newpix, UINT32 oldpix) { return (oldpix > newpix) ? newpix : oldpix; }
482516
483517
484518
r1490r1491
820854    PIXEL OPS
821855***************************************************************************/
822856
823static void (*const pixel_write_ops[4][5])(offs_t offset,UINT32 data) =
857static void (*const pixel_write_ops[4][6])(offs_t offset, UINT32 data) =
824858{
825   { write_pixel_1,     write_pixel_2,     write_pixel_4,     write_pixel_8,     write_pixel_16     },
826   { write_pixel_r_1,   write_pixel_r_2,   write_pixel_r_4,   write_pixel_r_8,   write_pixel_r_16   },
827   { write_pixel_t_1,   write_pixel_t_2,   write_pixel_t_4,   write_pixel_t_8,   write_pixel_t_16   },
828   { 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 }
859   { write_pixel_1,     write_pixel_2,     write_pixel_4,     write_pixel_8,     write_pixel_16,     write_pixel_32     },
860   { write_pixel_r_1,   write_pixel_r_2,   write_pixel_r_4,   write_pixel_r_8,   write_pixel_r_16,   write_pixel_r_32   },
861   { write_pixel_t_1,   write_pixel_t_2,   write_pixel_t_4,   write_pixel_t_8,   write_pixel_t_16,     write_pixel_t_32   },
862   { 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, write_pixel_r_t_32 }
829863};
830864
831static UINT32 (*const pixel_read_ops[5])(offs_t offset) =
865static UINT32 (*const pixel_read_ops[6])(offs_t offset) =
832866{
833   read_pixel_1,        read_pixel_2,      read_pixel_4,      read_pixel_8,      read_pixel_16
867   read_pixel_1,        read_pixel_2,      read_pixel_4,      read_pixel_8,      read_pixel_16,      read_pixel_32
834868};
835869
836870
r1490r1491
854888      case 0x04: i2 = 2; break;
855889      case 0x08: i2 = 3; break;
856890      case 0x10: i2 = 4; break;
891      case 0x20: i2 = 5; break;
857892   }
858893
859894   if (IOREG(REG_CONTROL) & 0x20)
r1490r1491
871906    RASTER OPS
872907***************************************************************************/
873908
874static INT32 (*const raster_ops[32]) (INT32 newpix, INT32 oldpix) =
909static UINT32 (*const raster_ops[32]) (UINT32 newpix, UINT32 oldpix) =
875910{
876911              0, raster_op_1 , raster_op_2 , raster_op_3,
877912   raster_op_4 , raster_op_5 , raster_op_6 , raster_op_7,
r1490r1491
9731008            if (visarea.min_x < visarea.max_x && visarea.max_x <= width && visarea.min_y < visarea.max_y && visarea.max_y <= height)
9741009            {
9751010               /* because many games play with the HEBLNK/HSBLNK for effects, we don't change
976                       if they are the only thing that has changed */
977               if (width != screen->width || height != screen->height || visarea.min_y != screen->visarea.min_y || visarea.max_y != screen->visarea.max_y)
1011                       if they are the only thing that has changed, unless they are stable for a couple
1012                       of frames */
1013               if (width != screen->width || height != screen->height || visarea.min_y != screen->visarea.min_y || visarea.max_y != screen->visarea.max_y ||
1014                  (state.hblank_stable > 2 && (visarea.min_x != screen->visarea.min_x || visarea.max_x != screen->visarea.max_x)))
1015               {
9781016                  video_screen_configure(state.config->scrnum, width, height, &visarea, refresh);
1017               }
1018               state.hblank_stable++;
9791019            }
9801020
9811021            LOG(("Configuring screen: HTOTAL=%3d BLANK=%3d-%3d VTOTAL=%3d BLANK=%3d-%3d refresh=%f\n",
r1490r1491
12351275         if (!(data & TMS34010_DI))
12361276            IOREG(REG_INTPEND) &= ~TMS34010_DI;
12371277         break;
1278
1279      case REG_HEBLNK:
1280      case REG_HSBLNK:
1281         if (oldreg != data)
1282            state.hblank_stable = 0;
1283         break;
12381284   }
12391285
12401286   if (LOG_CONTROL_REGS)
r1490r1491
12981344            case 0x04: state.pixelshift = 2; break;
12991345            case 0x08: state.pixelshift = 3; break;
13001346            case 0x10: state.pixelshift = 4; break;
1347            case 0x20: state.pixelshift = 5; break;
13011348         }
13021349         break;
13031350
r1490r1491
14121459      case REG020_DPYADR:
14131460      case REG020_DPYTAP:
14141461         break;
1462
1463      case REG020_HEBLNK:
1464      case REG020_HSBLNK:
1465         if (oldreg != data)
1466            state.hblank_stable = 0;
1467         break;
14151468   }
14161469}
14171470
r1490r1491
18211874      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Texas Instruments 340x0"); break;
18221875      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
18231876      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1824      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998\nParts based on code by Aaron Giles"); break;
1877      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Alex Pasadyn/Zsolt Vasvari\nParts based on code by Aaron Giles"); break;
18251878
18261879      case CPUINFO_STR_FLAGS:
18271880         sprintf(info->s, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
src/emu/cpu/tms34010/34010gfx.c
r1490r1491
22
33    TMS34010: Portable Texas Instruments TMS34010 emulator
44
5    Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998
5    Copyright Alex Pasadyn/Zsolt Vasvari
66    Parts based on code by Aaron Giles
77
88***************************************************************************/
src/emu/cpu/tms34010/34010fld.c
r1490r1491
22
33    TMS34010: Portable Texas Instruments TMS34010 emulator
44
5    Copyright (C) Alex Pasadyn/Zsolt Vasvari 1998
5    Copyright Alex Pasadyn/Zsolt Vasvari
66    Parts based on code by Aaron Giles
77
88***************************************************************************/
src/emu/cpu/tms32031/tms32031.c
r1490r1491
825825      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Texas Instruments TMS32031"); break;
826826      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
827827      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
828      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles 2002"); break;
828      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles"); break;
829829
830830      case CPUINFO_STR_FLAGS:
831831      {
src/emu/cpu/cpu.mak
r1490r1491
44#
55#   Rules for building CPU cores
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
src/emu/cpu/m37710/m37710.c
r1490r1491
12371237      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "M7700");            break;
12381238      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.2");               break;
12391239      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1240      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2004-2006 R. Belmont, based on G65816 by Karl Stenerud"); break;
1240      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright R. Belmont, based on G65816 by Karl Stenerud"); break;
12411241
12421242      case CPUINFO_STR_FLAGS:
12431243         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/m37710/m7700ds.h
r1490r1491
99Based on:
1010G65C816 CPU Emulator V0.92
1111
12Copyright (c) 2000 Karl Stenerud
12Copyright Karl Stenerud
1313All rights reserved.
1414
1515*/
src/emu/cpu/sharc/sharc.c
r1490r1491
11061106      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "SHARC");            break;
11071107      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "2.01");            break;
11081108      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1109      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2004-2006 Ville Linde"); break;
1109      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Ville Linde"); break;
11101110
11111111      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
11121112
src/emu/cpu/z180/z180.c
r1490r1491
33 *   z180.c
44 *   Portable Z180 emulator V0.3
55 *
6 *   Copyright (C) 2000 Juergen Buchmueller, all rights reserved.
7 *
8 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
97 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
108 *
119 *   - This source code is released as freeware for non-commercial purposes
r1490r1491
25972595      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Zilog Z8x180");      break;
25982596      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.3");               break;
25992597      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
2600      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2000 Juergen Buchmueller, all rights reserved."); break;
2598      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
26012599
26022600      case CPUINFO_STR_FLAGS:
26032601         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/z180/z180dasm.c
r1490r1491
33 *   z180dasm.c
44 *   Portable Z8x180 disassembler
55 *
6 *   Copyright (C) 2000 Juergen Buchmueller, all rights reserved.
7 *
8 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
97 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
108 *
119 *   - This source code is released as freeware for non-commercial purposes
src/emu/cpu/drcfe.c
r1490r1491
44
55    Generic dynamic recompiler frontend structures and utilities.
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
src/emu/cpu/upd7810/7810ops.c
r1490r1491
11/*****************************************************************************
22 *
33 *   Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 emulator V0.2
4 *   Copyright (c) 2001 Juergen Buchmueller, all rights reserved.
4 *   Copyright Juergen Buchmueller, all rights reserved.
55 *
66 *   7810ops.c  - opcode functions
77 *
src/emu/cpu/upd7810/7810tbl.c
r1490r1491
11/*****************************************************************************
22 *
33 *   Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 emulator V0.2
4 *   Copyright (c) 2001 Juergen Buchmueller, all rights reserved.
4 *   Copyright Juergen Buchmueller, all rights reserved.
55 *
66 *   7810tbl.c  - function pointer tables
77 *
src/emu/cpu/upd7810/7810dasm.c
r1490r1491
11/*****************************************************************************
22 *
33 *   Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 disassembler
4 *   Copyright (c) 2001 Juergen Buchmueller, all rights reserved.
4 *   Copyright Juergen Buchmueller, all rights reserved.
55 *
66 *   NS20030112: added 7807.
77 *
src/emu/cpu/upd7810/upd7810.c
r1490r1491
33 *   upd7810.c
44 *   Portable uPD7810/11, 7810H/11H, 78C10/C11/C14 emulator V0.3
55 *
6 *   Copyright (c) 2001 Juergen Buchmueller, all rights reserved.
7 *
8 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
97 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
108 *
119 *   - This source code is released as freeware for non-commercial purposes
r1490r1491
19291927      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "NEC uPD7810");         break;
19301928      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.3");               break;
19311929      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1932      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2001 Juergen Buchmueller, all rights reserved."); break;
1930      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
19331931
19341932      case CPUINFO_STR_FLAGS:
19351933         sprintf(info->s, "%s:%s:%s:%s:%s:%s",
src/emu/cpu/x86log.c
r1490r1491
44
55    x86/x64 code logging helpers.
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
src/emu/cpu/drcfe.h
r1490r1491
44
55    Generic dynamic recompiler frontend structures and utilities.
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
src/emu/cpu/sc61860/sc61860.h
r1490r1491
44 *   portable sharp 61860 emulator interface
55 *   (sharp pocket computers)
66 *
7 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
7 *   Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/sc61860/scops.c
r1490r1491
44 *   portable sharp 61860 emulator interface
55 *   (sharp pocket computers)
66 *
7 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
7 *   Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/sc61860/sc61860.c
r1490r1491
44 *   portable sharp 61860 emulator interface
55 *   (sharp pocket computers)
66 *
7 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
7 *   Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
r1490r1491
223223      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s = cpuintrf_temp_str(), "SC61860"); break;
224224      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s = cpuintrf_temp_str(), "1.0beta"); break;
225225      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s = cpuintrf_temp_str(), __FILE__); break;
226      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s = cpuintrf_temp_str(), "Copyright (c) 2000,2001 Peter Trauner, all rights reserved."); break;
226      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s = cpuintrf_temp_str(), "Copyright Peter Trauner, all rights reserved."); break;
227227
228228      case CPUINFO_STR_FLAGS:
229229         sprintf(info->s = cpuintrf_temp_str(), "%c%c", sc61860.zero?'Z':'.', sc61860.carry ? 'C':'.');
src/emu/cpu/sc61860/scdasm.c
r1490r1491
44 *   portable sharp 61860 emulator interface
55 *   (sharp pocket computers)
66 *
7 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
7 *   Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/minx/minx.c
r1490r1491
286286   case CPUINFO_STR_CORE_FAMILY:            strcpy( info->s = cpuintrf_temp_str(), "Nintendo Minx" ); break;
287287   case CPUINFO_STR_CORE_VERSION:            strcpy( info->s = cpuintrf_temp_str(), "0.1" ); break;
288288   case CPUINFO_STR_CORE_FILE:            strcpy( info->s = cpuintrf_temp_str(), __FILE__ ); break;
289   case CPUINFO_STR_CORE_CREDITS:            strcpy( info->s = cpuintrf_temp_str(), "Copyright (C) 2006 by The MESS Team." ); break;
289   case CPUINFO_STR_CORE_CREDITS:            strcpy( info->s = cpuintrf_temp_str(), "Copyright The MESS Team." ); break;
290290   case CPUINFO_STR_FLAGS:
291291      sprintf( info->s = cpuintrf_temp_str(), "%c%c%c%c%c%c%c%c-%c%c%c%c%c",
292292         regs.F & FLAG_I ? 'I' : '.',
src/emu/cpu/spc700/spc700ds.c
r1490r1491
55
66SPC700 CPU Emulator V0.90
77
8Copyright (c) 2000 Karl Stenerud
8Copyright Karl Stenerud
99All rights reserved.
1010
1111Permission is granted to use this source code for non-commercial purposes.
src/emu/cpu/spc700/spc700ds.h
r1490r1491
77
88Sony SPC700 CPU Emulator V1.0
99
10Copyright (c) 2000 Karl Stenerud
10Copyright Karl Stenerud
1111All rights reserved.
1212
1313Permission is granted to use this source code for non-commercial purposes.
src/emu/cpu/spc700/spc700.c
r1490r1491
17991799      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Sony SPC700");         break;
18001800      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
18011801      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1802      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) , all rights reserved."); break;
1802      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright , all rights reserved."); break;
18031803
18041804      case CPUINFO_STR_FLAGS:
18051805         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/i8039/i8039.h
r1490r1491
11/**************************************************************************
22 *                      Intel 8039 Portable Emulator                      *
33 *                                                                        *
4 *                   Copyright (C) 1997 by Mirko Buffoni                  *
5 *  Based on the original work (C) 1997 by Dan Boris, an 8048 emulator    *
4 *                   Copyright Mirko Buffoni                              *
5 *  Based on the original work Copyright Dan Boris, an 8048 emulator      *
66 *     You are not allowed to distribute this software commercially       *
77 *        Please, notify me, if you make any changes to this file         *
88 **************************************************************************/
src/emu/cpu/i8039/8039dasm.c
r1490r1491
22 *
33 *      mcs48 disassembler
44 *
5 * This file is Copyright 1996 Michael Cuddy, Fen's Ende Sofware.
5 * This file is Copyright Michael Cuddy, Fen's Ende Sofware.
66 * Redistribution is allowed in source and binary form as long as both
77 * forms are distributed together with the file 'README'.  This copyright
88 * notice must also accompany the files.
src/emu/cpu/i8039/i8039.c
r1490r1491
11/****************************************************************************
22 *                      Intel 8039 Portable Emulator                        *
33 *                                                                          *
4 *                   Copyright (C) 1997 by Mirko Buffoni                    *
5 *  Based on the original work (C) 1997 by Dan Boris, an 8048 emulator      *
4 *                   Copyright Mirko Buffoni                             *
5 *  Based on the original work Copyright Dan Boris, an 8048 emulator     *
66 *      You are not allowed to distribute this software commercially        *
77 *        Please, notify me, if you make any changes to this file           *
88 *                                                                          *
r1490r1491
865865      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Intel 8039");         break;
866866      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.2");               break;
867867      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
868      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 1997 by Mirko Buffoni\nBased on the original work (C) 1997 by Dan Boris"); break;
868      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Mirko Buffoni\nBased on the original work Copyright Dan Boris"); break;
869869
870870      case CPUINFO_STR_FLAGS:
871871         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/hd6309/6309dasm.c
r1490r1491
22
33    6309dasm.c - a 6309 opcode disassembler
44    Version 1.0 5-AUG-2000
5    Copyright 2000 Tim Lindner
5    Copyright Tim Lindner
66
77    Based on:
88    6809dasm.c - a 6809 opcode disassembler
99    Version 1.4 1-MAR-95
10    Copyright 1995 Sean Riddle
10    Copyright Sean Riddle
1111
1212    Thanks to Franklin Bowen for bug fixes, ideas
1313
src/emu/cpu/hd6309/hd6309.c
r1490r1491
11/*** hd6309: Portable 6309 emulator ******************************************
22
3    Copyright (C) John Butler 1997
4    Copyright (C) Tim Lindner 2000
3    Copyright John Butler
4    Copyright Tim Lindner
55
66    References:
77
r1490r1491
13001300      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Hitachi 6309");      break;
13011301      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.01");            break;
13021302      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1303      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) John Butler 1997 and Tim Lindner 2000"); break;
1303      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright John Butler and Tim Lindner"); break;
13041304
13051305      case CPUINFO_STR_FLAGS:
13061306         sprintf(info->s, "%c%c%c%c%c%c%c%c (MD:%c%c%c%c)",
src/emu/cpu/x86log.h
r1490r1491
44
55    x86/x64 code logging helpers.
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
src/emu/cpu/s2650/s2650.c
r1490r1491
16051605      case CPUINFO_STR_REGISTER + S2650_R1:         sprintf(info->s, "R1:%02X", S.reg[1]);   break;
16061606      case CPUINFO_STR_REGISTER + S2650_R2:         sprintf(info->s, "R2:%02X", S.reg[2]);   break;
16071607      case CPUINFO_STR_REGISTER + S2650_R3:         sprintf(info->s, "R3:%02X", S.reg[3]);   break;
1608      case CPUINFO_STR_REGISTER + S2650_R1A:         sprintf(info->s, "R1'%02X", S.reg[4]);   break;
1609      case CPUINFO_STR_REGISTER + S2650_R2A:         sprintf(info->s, "R2'%02X", S.reg[5]);   break;
1610      case CPUINFO_STR_REGISTER + S2650_R3A:         sprintf(info->s, "R3'%02X", S.reg[6]);   break;
1608      case CPUINFO_STR_REGISTER + S2650_R1A:         sprintf(info->s, "R1':%02X", S.reg[4]);   break;
1609      case CPUINFO_STR_REGISTER + S2650_R2A:         sprintf(info->s, "R2':%02X", S.reg[5]);   break;
1610      case CPUINFO_STR_REGISTER + S2650_R3A:         sprintf(info->s, "R3':%02X", S.reg[6]);   break;
16111611      case CPUINFO_STR_REGISTER + S2650_HALT:         sprintf(info->s, "HALT:%X", S.halt);   break;
16121612      case CPUINFO_STR_REGISTER + S2650_SI:         sprintf(info->s, "SI:%X", (S.psu & SI) ? 1 : 0); break;
16131613      case CPUINFO_STR_REGISTER + S2650_FO:         sprintf(info->s, "FO:%X", (S.psu & FO) ? 1 : 0); break;
src/emu/cpu/cdp1802/1802dasm.c
r1490r1491
33 *   disasm.c
44 *   portable cosmac cdp1802 emulator interface
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/cdp1802/cdp1802.c
r1490r1491
10111011      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "CDP1800");            break;
10121012      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
10131013      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1014      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2007 The MAME team"); break;
1014      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
10151015
10161016      case CPUINFO_STR_REGISTER + CDP1802_PC:   sprintf(info->s, "PC:%.4x", cdp1802.r[cdp1802.p]);   break;
10171017      case CPUINFO_STR_REGISTER + CDP1802_R0:   sprintf(info->s, "R0:%.4x", cdp1802.r[0]);       break;
src/emu/cpu/se3208/se3208.c
r1490r1491
19151915      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Advanced Digital Chips Inc."); break;
19161916      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.00");            break;
19171917      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1918      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2005 ElSemi, all rights reserved."); break;
1918      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Miguel Angel Horna, all rights reserved."); break;
19191919
19201920      case CPUINFO_STR_FLAGS:
19211921         sprintf(info->s, "%c%c%c%c %c%c%c%c%c",
src/emu/cpu/i386/i386.c
r1490r1491
977977      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Intel 386");         break;
978978      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
979979      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
980      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2003-2004 Ville Linde"); break;
980      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Ville Linde"); break;
981981
982982      case CPUINFO_STR_FLAGS:                        sprintf(info->s, "%08X", get_flags());   break;
983983
src/emu/cpu/mc68hc11/mc68hc11.c
r1490r1491
470470      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Motorola MC68HC11");   break;
471471      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
472472      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
473      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2004 Ville Linde"); break;
473      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Ville Linde"); break;
474474
475475      case CPUINFO_STR_FLAGS:
476476         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/adsp2100/adsp2100.c
r1490r1491
19561956      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "ADSP21xx");         break;
19571957      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "2.0");               break;
19581958      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1959      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles, 1999-2004"); break;
1959      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles"); break;
19601960
19611961      case CPUINFO_STR_FLAGS:
19621962         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/x86drc.c
r1490r1491
44
55    x86 Dynamic recompiler support routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cpu/rsp/rsp.c
r1490r1491
25532553
25542554   if( rsp.sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
25552555   {
2556      rsp_icount = 0;
2556      rsp_icount = MIN(rsp_icount, 0);
25572557   }
25582558
25592559   while (rsp_icount > 0)
r1490r1491
25892589               case 0x0d:   /* BREAK */
25902590               {
25912591                  (config->sp_set_status)(0x3);
2592                  rsp_icount = 1;
2592                  rsp_icount = MIN(rsp_icount, 1);
25932593
25942594#if LOG_INSTRUCTION_EXECUTION
25952595                  fprintf(exec_output, "\n---------- break ----------\n\n");
r1490r1491
27882788
27892789      if( rsp.sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
27902790      {
2791         rsp_icount = 0;
2791         rsp_icount = MIN(rsp_icount, 0);
27922792      }
27932793
27942794   }
r1490r1491
29612961      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "RSP");               break;
29622962      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
29632963      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
2964      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2005");   break;
2964      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team");   break;
29652965
29662966      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
29672967
src/emu/cpu/x86drc.h
r1490r1491
44
55    x86 Dynamic recompiler support routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cpu/cop400/cop420ds.c
r1490r1491
1/**************************************************************************
2 *               National Semiconductor COP420 Emulator                   *
3 *                                                                        *
4 *                   Copyright (C) 2006 MAME Team                         *
5 **************************************************************************/
1/***************************************************************************
62
3    cop420ds.c
4
5    National Semiconductor COP420 Emulator.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
712#include "cpuintrf.h"
813
914offs_t cop420_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
src/emu/cpu/cop400/410ops.c
r1490r1491
1/**************************************************************************
2 *               National Semiconductor COP410 Emulator                   *
3 *                                                                        *
4 *                   Copyright (C) 2006 MAME Team                         *
5 **************************************************************************/
1/***************************************************************************
62
3    410ops.c
4
5    National Semiconductor COP410 Emulator.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
712#define ROM(A)         cpu_readop(A)
813#define RAM_W(A,V)      (data_write_byte_8(A,V))
914#define RAM_R(A)      (data_read_byte_8(A))
src/emu/cpu/cop400/cop410.c
r1490r1491
1/**************************************************************************
2 *               National Semiconductor COP410 Emulator                   *
3 *                                                                        *
4 *                   Copyright (C) 2005 by Dan Boris                      *
5 **************************************************************************/
1/***************************************************************************
62
3    version.c
4
5    National Semiconductor COP410 Emulator.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
712/*
813
914    TODO:
r1490r1491
356361      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COP410"); break;
357362      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
358363      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
359      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2006 MAME Team"); break;
364      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright MAME Team"); break;
360365
361366      case CPUINFO_STR_FLAGS:
362367         sprintf(info->s, " ");
src/emu/cpu/cop400/420ops.c
r1490r1491
1/**************************************************************************
2 *               National Semiconductor COP420 Emulator                   *
3 *                                                                        *
4 *                   Copyright (C) 2006 MAME Team                         *
5 **************************************************************************/
1/***************************************************************************
62
3    420ops.c
4
5    National Semiconductor COP420 Emulator.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
712#define SC            R.SC
813
914#define PUSH(addr)       { SC = SB; SB = SA; SA = addr; }
src/emu/cpu/cop400/cop420.c
r1490r1491
1/**************************************************************************
2 *               National Semiconductor COP420 Emulator                   *
3 *                                                                        *
4 *                   Copyright (C) 2006 MAME Team                         *
5 **************************************************************************/
1/***************************************************************************
62
3    cop420.c
4
5    National Semiconductor COP420 Emulator.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
712/*
813
914    TODO:
r1490r1491
385390      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "National Semiconductor COP420"); break;
386391      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
387392      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
388      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2006 MAME Team"); break;
393      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright MAME Team"); break;
389394
390395      case CPUINFO_STR_FLAGS:
391396         sprintf(info->s, " ");
src/emu/cpu/cop400/cop400.h
r1490r1491
1/**************************************************************************
2 *               National Semiconductor COP400 Emulator                   *
3 *                                                                        *
4 *                   Copyright (C) 2006 MAME Team                         *
5 **************************************************************************/
1/***************************************************************************
62
3    cop400.h
4
5    National Semiconductor COP400 Emulator.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
712#ifndef _COP400_H
813#define _COP400_H
914
src/emu/cpu/cop400/cop410ds.c
r1490r1491
1/**************************************************************************
2 *               National Semiconductor COP410 Emulator                   *
3 *                                                                        *
4 *                   Copyright (C) 2006 MAME Team                         *
5 **************************************************************************/
1/***************************************************************************
62
3    cop410ds.c
4
5    National Semiconductor COP410 Emulator.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
712#include "cpuintrf.h"
813
914offs_t cop410_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
src/emu/cpu/m6502/6502dasm.c
r1490r1491
33 *  6502dasm.c
44 *  6502/65c02/6510 disassembler
55 *
6 *  Copyright (c) 1998 Juergen Buchmueller, all rights reserved.
6 *  Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *  - This source code is released as freeware for non-commercial purposes.
99 *  - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/m4510.c
r1490r1491
33 *   m4510.c
44 *   Portable 4510 emulator V1.0beta1
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved
6 *   Copyright Peter Trauner, all rights reserved
77 *   documentation preliminary databook
88 *   documentation by michael steil mist@c64.org
99 *   available at ftp://ftp.funet.fi/pub/cbm/c65
r1490r1491
505505      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "CBM Semiconductor Group CSG 65CE02"); break;
506506      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0beta");            break;
507507      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
508      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1998 Juergen Buchmueller\nCopyright (c) 2000 Peter Trauner\nall rights reserved."); break;
508      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller\nCopyright Peter Trauner\nall rights reserved."); break;
509509
510510      case CPUINFO_STR_FLAGS:
511511         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/m6502/t65sc02.c
r1490r1491
33 *   tbl65sc02.c
44 *   65sc02 opcode functions and function pointer table
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/tn2a03.c
r1490r1491
77 *   of the ADC and SBC instructions, so all opcodes except ADC/SBC
88 *   are simply mapped to the m6502 ones.
99 *
10 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
10 *   Copyright Juergen Buchmueller, all rights reserved.
1111 *
1212 *   - This source code is released as freeware for non-commercial purposes.
1313 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/ops02.h
r1490r1491
33 *   ops02.h
44 *   Addressing mode and opcode macros for 6502,65c02,65sc02,6510,n2a03 CPUs
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/m6502.c
r1490r1491
33 *   m6502.c
44 *   Portable 6502/65c02/65sc02/6510/n2a03 emulator V1.2
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright (c) 2000 Peter Trauner.
8 *   Deco16 portions Copyright (c) 2001-2003 Bryan McPhail.
6 *   Copyright Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright Peter Trauner.
8 *   Deco16 portions Copyright Bryan McPhail.
99 *
1010 *   - This source code is released as freeware for non-commercial purposes.
1111 *   - You are free to use and redistribute this code in modified or
r1490r1491
754754      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Mostek 6502");         break;
755755      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.2");               break;
756756      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
757      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1998 Juergen Buchmueller, all rights reserved."); break;
757      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
758758
759759      case CPUINFO_STR_FLAGS:
760760         sprintf(info->s, "%c%c%c%c%c%c%c%c",
r1490r1491
957957      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Metal Oxid Semiconductor MOS 6502"); break;
958958      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0beta");            break;
959959      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
960      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1998 Juergen Buchmueller\nCopyright (c) 2000 Peter Trauner\nall rights reserved."); break;
960      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller\nCopyright Peter Trauner\nall rights reserved."); break;
961961
962962      default:                              m65c02_get_info(state, info);         break;
963963   }
r1490r1491
10051005      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "DECO");            break;
10061006      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.1");               break;
10071007      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1008      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1998 Juergen Buchmueller\nCopyright (c) 2001-2003 Bryan McPhail\nall rights reserved."); break;
1008      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller\nCopyright Bryan McPhail\nall rights reserved."); break;
10091009
10101010      default:                              m6502_get_info(state, info);         break;
10111011   }
src/emu/cpu/m6502/m4510.h
r1490r1491
33 *   m4510.c
44 *   Portable 4510 emulator V1.0beta
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/opsc02.h
r1490r1491
33 *   m6502ops.h
44 *   Addressing mode and opcode macros for 6502,65c02,65sc02,6510,n2a03 CPUs
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/m6502.h
r1490r1491
33 *   m6502.h
44 *   Portable 6502/65c02/65sc02/6510/n2a03 emulator interface
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright (c) 2000 Peter Trauner.
8 *   Deco16 portions Copyright (c) 2001 Bryan McPhail.
6 *   Copyright Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright Peter Trauner.
8 *   Deco16 portions Copyright Bryan McPhail.
99 *
1010 *   - This source code is released as freeware for non-commercial purposes.
1111 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/ops09.h
r1490r1491
22 *
33 *   ops09.h
44 *
5 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
5 *   Copyright Peter Trauner, all rights reserved.
66 *   documentation by michael steil mist@c64.org
77 *   available at ftp://ftp.funet.fi/pub/cbm/c65
88 *
src/emu/cpu/m6502/t6510.c
r1490r1491
33 *   tbl6510.c
44 *   6510 opcode functions and function pointer table
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/ops4510.h
r1490r1491
33 *   ops4510.h
44 *   Addressing mode and opcode macros for 4510 CPU
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *   documentation preliminary databook
88 *   documentation by michael steil mist@c64.org
99 *   available at ftp://ftp.funet.fi/pub/cbm/c65
src/emu/cpu/m6502/m6509.c
r1490r1491
33 *   m6509.c
44 *   Portable 6509 emulator V1.0beta1
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *   documentation by vice emulator team
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
r1490r1491
380380      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "MOS Technology 6509"); break;
381381      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0beta");            break;
382382      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
383      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1998 Juergen Buchmueller\nCopyright (c) 2000 Peter Trauner\nall rights reserved."); break;
383      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller\nCopyright Peter Trauner\nall rights reserved."); break;
384384
385385      case CPUINFO_STR_FLAGS:
386386         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/m6502/opsce02.h
r1490r1491
33 *   opsce02.h
44 *   Addressing mode and opcode macros for 65ce02 CPU
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *   documentation preliminary databook
88 *   documentation by michael steil mist@c64.org
99 *   available at ftp://ftp.funet.fi/pub/cbm/c65
src/emu/cpu/m6502/t6502.c
r1490r1491
33 *   tbl6502.c
44 *   6502 opcode functions and function pointer table
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/m65ce02.c
r1490r1491
33 *   m65ce02.c
44 *   Portable 65ce02 emulator V1.0beta3
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved
6 *   Copyright Peter Trauner, all rights reserved
77 *   documentation preliminary databook
88 *   documentation by michael steil mist@c64.org
99 *   available at ftp://ftp.funet.fi/pub/cbm/c65
r1490r1491
361361      case CPU_INFO_FAMILY: return "CBM Semiconductor Group CSG 65CE02";
362362      case CPU_INFO_VERSION: return "1.0beta";
363363      case CPU_INFO_CREDITS:
364         return "Copyright (c) 1998 Juergen Buchmueller\n"
365            "Copyright (c) 2000 Peter Trauner\n"
364         return "Copyright Juergen Buchmueller\n"
365            "Copyright Peter Trauner\n"
366366            "all rights reserved.";
367367      case CPU_INFO_FILE: return __FILE__;
368368      case CPU_INFO_REG_LAYOUT: return (const char*)m65ce02_reg_layout;
src/emu/cpu/m6502/t65c02.c
r1490r1491
33 *   tbl65c02.c
44 *   65c02 opcode functions and function pointer table
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/m6509.h
r1490r1491
33 *   m6509.h
44 *   Portable 6509 emulator V1.0beta
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/m65ce02.h
r1490r1491
33 *   m65ce02.c
44 *   Portable 65ce02 emulator V1.0beta
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/ill02.h
r1490r1491
33 *   ill02.h
44 *   Addressing mode and opcode macros for the NMOS 6502 illegal opcodes
55 *
6 *   Copyright (c) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
7 *   65sc02 core Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/t6509.c
r1490r1491
33 *   tbl6509.c
44 *   6509 opcode functions and function pointer table
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/m6502/t65ce02.c
r1490r1491
33 *   t65ce02.c
44 *   65ce02 opcode functions and function pointer table
55 *
6 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
6 *   Copyright Peter Trauner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/jaguar/jaguar.c
r1490r1491
16621662      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Atari Jaguar");      break;
16631663      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
16641664      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1665      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles 2000-2004"); break;
1665      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles"); break;
16661666
16671667      case CPUINFO_STR_FLAGS:                     sprintf(info->s, "%c%c%c%c%c%c%c%c%c%c%c",
16681668                                             jaguar.FLAGS & 0x8000 ? 'D':'.',
src/emu/cpu/i8085/8085dasm.c
r1490r1491
33 *   8085dasm.c
44 *   Portable I8085A disassembler
55 *
6 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
88 *
99 *   - This source code is released as freeware for non-commercial purposes
src/emu/cpu/i8085/i8085.c
r1490r1491
33 *   i8085.c
44 *   Portable I8085A emulator V1.2
55 *
6 *   Copyright (c) 1999 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *   Partially based on information out of Z80Em by Marcel De Kogel
88 *
99 * changes in V1.3
r1490r1491
3737 *     OUT (#),A      10      11     /
3838 *     EX (SP),HL     18      19    /
3939 *
40 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
40 *   Copyright Juergen Buchmueller, all rights reserved.
4141 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
4242 *
4343 *   - This source code is released as freeware for non-commercial purposes
r1490r1491
16871687      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Intel 8080");         break;
16881688      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.1");               break;
16891689      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1690      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1999 Juergen Buchmueller, all rights reserved."); break;
1690      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
16911691
16921692      case CPUINFO_STR_FLAGS:
16931693         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/powerpc/ppc.c
r1490r1491
18191819      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "PowerPC");            break;
18201820      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
18211821      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1822      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2004");   break;
1822      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team");   break;
18231823
18241824      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
18251825
src/emu/cpu/powerpc/drc_ops.c
r1490r1491
110110   }
111111}
112112
113static void ppcdrc_exit(void)
114{
115   drc_exit(ppc.drc);
116}
117
113118static UINT32 *ppcdrc_getopptr(UINT32 address)
114119{
115120   UINT32 *result;
src/emu/cpu/powerpc/ppcdrc.c
r1490r1491
11011101#if LOG_CODE
11021102   //if (symfile) fclose(symfile);
11031103#endif
1104   drc_exit(ppc.drc);
1104   ppcdrc_exit();
11051105}
11061106
11071107static void ppcdrc403_reset(void)
r1490r1491
13431343#if LOG_CODE
13441344   //if (symfile) fclose(symfile);
13451345#endif
1346   drc_exit(ppc.drc);
1346   ppcdrc_exit();
13471347}
13481348#endif
13491349
r1490r1491
15341534#if LOG_CODE
15351535   //if (symfile) fclose(symfile);
15361536#endif
1537   drc_exit(ppc.drc);
1537   ppcdrc_exit();
15381538}
15391539
15401540static void ppcdrc602_reset(void)
r1490r1491
17181718
17191719static void mpc8240drc_exit(void)
17201720{
1721
1721   ppcdrc_exit();
17221722}
17231723#endif
17241724
r1490r1491
18651865#if LOG_CODE
18661866   //if (symfile) fclose(symfile);
18671867#endif
1868   drc_exit(ppc.drc);
1868   ppcdrc_exit();
18691869}
18701870#endif
18711871
r1490r1491
19981998#if LOG_CODE
19991999   //if (symfile) fclose(symfile);
20002000#endif
2001   drc_exit(ppc.drc);
2001   ppcdrc_exit();
20022002}
20032003#endif
20042004
r1490r1491
21622162      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "PowerPC");            break;
21632163      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
21642164      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
2165      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2004");   break;
2165      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team");   break;
21662166
21672167      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
21682168
src/emu/cpu/arm/arm.c
r1490r1491
15401540      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Acorn Risc Machine");   break;
15411541      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.3");               break;
15421542      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1543      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 2002-2006 Bryan McPhail, bmcphail@tendril.co.uk"); break;
1543      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Bryan McPhail, bmcphail@tendril.co.uk"); break;
15441544
15451545      case CPUINFO_STR_FLAGS:
15461546         sprintf(info->s, "%c%c%c%c%c%c",
src/emu/cpu/z8000/z8000cpu.h
r1490r1491
44 *   Portable Z8000(2) emulator
55 *   Macros and types used in z8000.c / z8000ops.c / z8000tbl.c
66 *
7 *   Copyright (c) 1998,1999 Juergen Buchmueller, all rights reserved.
7 *   Copyright Juergen Buchmueller, all rights reserved.
88 *   Bug fixes and MSB_FIRST compliance Ernesto Corvi.
99 *
1010 *   - This source code is released as freeware for non-commercial purposes.
src/emu/cpu/z8000/z8000.c
r1490r1491
44 *   Portable Z8000(2) emulator
55 *   Z8000 MAME interface
66 *
7 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
7 *   Copyright Juergen Buchmueller, all rights reserved.
88 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
99 *
1010 *   - This source code is released as freeware for non-commercial purposes
r1490r1491
697697      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Zilog Z8000");         break;
698698      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.1");               break;
699699      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
700      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 1998,1999 Juergen Buchmueller, all rights reserved."); break;
700      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
701701
702702      case CPUINFO_STR_FLAGS:
703703         sprintf(info->s, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
src/emu/cpu/z8000/z8000ops.c
r1490r1491
44 *   Portable Z8000(2) emulator
55 *   Opcode functions
66 *
7 *   Copyright (c) 1998 Juergen Buchmueller, all rights reserved.
7 *   Copyright Juergen Buchmueller, all rights reserved.
88 *   Bug fixes and MSB_FIRST compliance Ernesto Corvi.
99 *
1010 *   - This source code is released as freeware for non-commercial purposes.
src/emu/cpu/z8000/z8000tbl.c
r1490r1491
44 *   Portable Z8000(2) emulator
55 *   Opcode table (including mnemonics) and initialization
66 *
7 *   Copyright (c) 1998 Juergen Buchmueller, all rights reserved.
7 *   Copyright Juergen Buchmueller, all rights reserved.
88 *   Bug fixes and MSB_FIRST compliance Ernesto Corvi.
99 *
1010 *   - This source code is released as freeware for non-commercial purposes.
src/emu/cpu/z8000/8000dasm.c
r1490r1491
44 *   Portable Z8000(2) emulator
55 *   Z8000 disassembler; requires the z8000_exec table to be initialized
66 *
7 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
7 *   Copyright Juergen Buchmueller, all rights reserved.
88 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
99 *
1010 *   - This source code is released as freeware for non-commercial purposes
src/emu/cpu/tms32010/tms32010.h
r1490r1491
11 /**************************************************************************\
22 *                 Texas Instruments TMS32010 DSP Emulator                  *
33 *                                                                          *
4 *                  Copyright (C) 1999-2002+ Tony La Porta                  *
4 *                  Copyright Tony La Porta                                 *
55 *      You are not allowed to distribute this software commercially.       *
66 *                      Written for the MAME project.                       *
77 *                                                                          *
src/emu/cpu/tms32010/dis32010.c
r1490r1491
11 /**************************************************************************\
22 *               Texas Instruments TMS32010 DSP Disassembler                *
33 *                                                                          *
4 *                 Copyright (C) 1999-2002+ Tony La Porta                   *
4 *                 Copyright Tony La Porta                                  *
55 *      You are not allowed to distribute this software commercially.       *
66 *                      Written for the MAME project.                       *
77 *                                                                          *
src/emu/cpu/tms32010/32010dsm.c
r1490r1491
11 /**************************************************************************\
22 *                Texas Instruments TMS32010 DSP Disassembler               *
33 *                                                                          *
4 *                  Copyright (C) 1999-2002+ Tony La Porta                  *
4 *                  Copyright Tony La Porta                                 *
55 *               To be used with TMS32010 DSP Emulator engine.              *
66 *      You are not allowed to distribute this software commercially.       *
77 *                      Written for the MAME project.                       *
src/emu/cpu/tms32010/tms32010.c
r1490r1491
11 /**************************************************************************\
22 *                 Texas Instruments TMS32010 DSP Emulator                  *
33 *                                                                          *
4 *                  Copyright (C) 1999-2004+ Tony La Porta                  *
4 *                  Copyright Tony La Porta                                 *
55 *      You are not allowed to distribute this software commercially.       *
66 *                      Written for the MAME project.                       *
77 *                                                                          *
r1490r1491
944944      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Texas Instruments TMS32010"); break;
945945      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.22");            break;
946946      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
947      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C)1999-2004+ by Tony La Porta"); break;
947      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Tony La Porta"); break;
948948
949949      case CPUINFO_STR_FLAGS:
950950         sprintf(info->s, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
src/emu/cpu/sm8500/sm8500.c
r1490r1491
504504   case CPUINFO_STR_CORE_FAMILY:            strcpy( info->s = cpuintrf_temp_str(), "Sharp SM8500" ); break;
505505   case CPUINFO_STR_CORE_VERSION:            strcpy( info->s = cpuintrf_temp_str(), "0.1" ); break;
506506   case CPUINFO_STR_CORE_FILE:            strcpy( info->s = cpuintrf_temp_str(), __FILE__ ); break;
507   case CPUINFO_STR_CORE_CREDITS:            strcpy( info->s = cpuintrf_temp_str(), "Copyright (C) 2005 by The MESS Team." ); break;
507   case CPUINFO_STR_CORE_CREDITS:            strcpy( info->s = cpuintrf_temp_str(), "Copyright The MESS Team." ); break;
508508   case CPUINFO_STR_FLAGS:
509509      sprintf( info->s = cpuintrf_temp_str(), "%c%c%c%c%c%c%c%c",
510510         regs.PS1 & FLAG_C ? 'C' : '.',
src/emu/cpu/sh2/sh2.h
r1490r1491
33 *   sh2.h
44 *   Portable Hitachi SH-2 (SH7600 family) emulator interface
55 *
6 *   Copyright (c) 2000 Juergen Buchmueller <pullmoll@t-online.de>,
6 *   Copyright Juergen Buchmueller <pullmoll@t-online.de>,
77 *   all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
src/emu/cpu/sh2/sh2.c
r1490r1491
33 *   sh2.c
44 *   Portable Hitachi SH-2 (SH7600 family) emulator
55 *
6 *   Copyright (c) 2000 Juergen Buchmueller <pullmoll@t-online.de>,
6 *   Copyright Juergen Buchmueller <pullmoll@t-online.de>,
77 *   all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
r1490r1491
31373137      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Hitachi SH7600");      break;
31383138      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.01");            break;
31393139      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
3140      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2000 Juergen Buchmueller, all rights reserved."); break;
3140      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
31413141
31423142      case CPUINFO_STR_FLAGS:
31433143         sprintf(info->s, "%c%c%d%c%c",
src/emu/cpu/tms32051/tms32051.c
r1490r1491
638638      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "TMS3205x");         break;
639639      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
640640      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
641      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2005-2006 Ville Linde"); break;
641      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Ville Linde"); break;
642642
643643      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
644644
src/emu/cpu/sh4/sh4.c
r1490r1491
49904990      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Hitachi SH7750");      break;
49914991      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");            break;
49924992      case CPUINFO_STR_CORE_FILE:               strcpy(info->s, __FILE__);            break;
4993      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2007 R. Belmont"); break;
4993      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright R. Belmont"); break;
49944994
49954995      case CPUINFO_STR_FLAGS:
49964996         sprintf(info->s, "%s%s%s%s%c%c%d%c%c",
src/emu/cpu/mb88xx/mb88xx.c
r1490r1491
859859      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Fujitsu MB88xx");   break;
860860      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
861861      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
862      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 2007 Ernesto Corvi"); break;
862      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Ernesto Corvi"); break;
863863
864864      case CPUINFO_STR_FLAGS:
865865          sprintf(info->s, "%c%c%c%c%c%c",
src/emu/cpu/alph8201/8201dasm.c
r1490r1491
11/****************************************************************************
22                         Alpha 8201/8301 Disassembler
33
4                      Copyright (C) 2006 Tatsuyuki Satoh
4                      Copyright Tatsuyuki Satoh
55                   Originally written for the MAME project.
66
77****************************************************************************/
src/emu/cpu/alph8201/alph8201.c
r1490r1491
11/****************************************************************************
22                         Alpha8201 Emulator
33
4                      Copyright (C) 2006 Tatsuyuki Satoh
4                      Copyright Tatsuyuki Satoh
55                   Originally written for the MAME project.
66
77    Notes :
r1490r1491
956956      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "AlphaDenshi MCU");      break;
957957      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.1");               break;
958958      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
959      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2006 by Tatsuyuki Satoh"); break;
959      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Tatsuyuki Satoh"); break;
960960      case CPUINFO_STR_FLAGS:                     sprintf(info->s, "%c%c", CF?'C':'.',ZF?'Z':'.'); break;
961961      case CPUINFO_STR_REGISTER + ALPHA8201_PC:      sprintf(info->s, "PC:%03X", PC);      break;
962962      case CPUINFO_STR_REGISTER + ALPHA8201_SP:      sprintf(info->s, "SP:%02X", M_RDMEM(0x001) ); break;
src/emu/cpu/alph8201/alph8201.h
r1490r1491
11 /**************************************************************************\
22 *                      Alpha8201 Emulator                                  *
33 *                                                                          *
4 *                    Copyright (C) 2006 Tatsuyuki Satoh                    *
4 *                    Copyright Tatsuyuki Satoh                             *
55 *                 Originally written for the MAME project.                 *
66 *                                                                          *
77 *                                                                          *
src/emu/cpu/g65816/g65816.c
r1490r1491
55
66G65C816 CPU Emulator V0.93
77
8Copyright (c) 2000 Karl Stenerud
8Copyright Karl Stenerud
99All rights reserved.
1010
1111Permission is granted to use this source code for non-commercial purposes.
r1490r1491
442442      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "6500");            break;
443443      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.94");            break;
444444      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
445      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2000 Karl Stenerud, all rights reserved."); break;
445      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Karl Stenerud, all rights reserved."); break;
446446
447447      case CPUINFO_STR_FLAGS:
448448         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/g65816/g65816.h
r1490r1491
88
99G65C816 CPU Emulator V0.92
1010
11Copyright (c) 2000 Karl Stenerud
11Copyright Karl Stenerud
1212All rights reserved.
1313
1414Permission is granted to use this source code for non-commercial purposes.
src/emu/cpu/g65816/g65816ds.c
r1490r1491
55
66G65C816 CPU Emulator V0.90
77
8Copyright (c) 2000 Karl Stenerud
8Copyright Karl Stenerud
99All rights reserved.
1010
1111Permission is granted to use this source code for non-commercial purposes.
src/emu/cpu/g65816/g65816ds.h
r1490r1491
77
88G65C816 CPU Emulator V0.92
99
10Copyright (c) 2000 Karl Stenerud
10Copyright Karl Stenerud
1111All rights reserved.
1212
1313Permission is granted to use this source code for non-commercial purposes.
src/emu/cpu/i8051/8051dasm.c
r1490r1491
99 *   8054 Product Line (8054)
1010 *   8058 Product Line (8058)
1111 *
12 *   Copyright (c) 2003 Steve Ellenoff, all rights reserved.
12 *   Copyright Steve Ellenoff, all rights reserved.
1313 *
1414 *   - This source code is released as freeware for non-commercial purposes.
1515 *   - You are free to use and redistribute this code in modified or
r1490r1491
3030 *
3131 *****************************************************************************
3232 * Symbol Memory Name Tables borrowed from:
33 * D52 8052 Disassembler - Copyright (C) 1995-2002 by
34 * Jeffery L. Post
33 * D52 8052 Disassembler - Copyright Jeffery L. Post
3534 *****************************************************************************/
3635
3736#include "debugger.h"
src/emu/cpu/i8051/i8051.c
r1490r1491
99 *   8054 Product Line (8054)
1010 *   8058 Product Line (8058)
1111 *
12 *   Copyright (c) 2003 Steve Ellenoff, all rights reserved.
12 *   Copyright Steve Ellenoff, all rights reserved.
1313 *
1414 *   - This source code is released as freeware for non-commercial purposes.
1515 *   - You are free to use and redistribute this code in modified or
r1490r1491
24922492      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "MCS-51");            break;
24932493      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
24942494      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
2495      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 2003-2004 Steve Ellenoff"); break;
2495      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Steve Ellenoff"); break;
24962496
24972497      case CPUINFO_STR_FLAGS:
24982498         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/i8051/i8051.h
r1490r1491
99 *   8054 Product Line (8054)
1010 *   8058 Product Line (8058)
1111 *
12 *   Copyright (c) 2003 Steve Ellenoff, all rights reserved.
12 *   Copyright Steve Ellenoff, all rights reserved.
1313 *
1414 *   - This source code is released as freeware for non-commercial purposes.
1515 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/mips/mdrc64.c
r1490r1491
44
55    x64 MIPS III recompiler.
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
r1490r1491
482482      }
483483   }
484484#endif
485   drc_exit(mips3.drc);
485486}
486487
487488
r1490r1491
18521853
18531854static void append_check_interrupts(drc_core *drc, compiler_state *compiler, const opcode_desc *desc)
18541855{
1855   emit_link link1, link2;
1856   emit_link link1, link2, link3 = { 0 };
18561857
18571858   emit_mov_r32_m32(DRCTOP, REG_EAX, CPR0ADDR(COP0_Cause));                        // mov  eax,[Cause]
18581859   emit_and_r32_m32(DRCTOP, REG_EAX, CPR0ADDR(COP0_Status));                        // and  eax,[Status]
r1490r1491
18641865   if (desc == NULL)
18651866   {
18661867      emit_mov_r32_m32(DRCTOP, REG_P1, MDRC(drc->pcptr));                           // mov  p1,[pc]
1867      emit_jcc(DRCTOP, COND_Z, mips3.drcdata->generate_interrupt_exception);            // jz   generate_interrupt_exception
1868      emit_jcc_short_link(DRCTOP, COND_NZ, &link3);                              // jnz  skip
1869      emit_jmp_m64(DRCTOP, MDRC(&mips3.drcdata->generate_interrupt_exception));         // jmp  generate_interrupt_exception
18681870   }
18691871   else
18701872      oob_request_callback(drc, COND_Z, oob_interrupt_cleanup, compiler, desc, mips3.drcdata->generate_interrupt_exception);
18711873   resolve_link(DRCTOP, &link1);                                          // skip:
18721874   resolve_link(DRCTOP, &link2);
1875   if (desc == NULL)
1876      resolve_link(DRCTOP, &link3);
18731877}
18741878
18751879
r1490r1491
30333037         emit_mov_r32_m32(DRCTOP, REG_EDX, CPR0ADDR(COP0_Status));                  // mov  edx,[Status]
30343038         emit_mov_m32_r32(DRCTOP, CPR0ADDR(COP0_Status), REG_EAX);                  // mov  [Status],eax
30353039         emit_xor_r32_r32(DRCTOP, REG_EDX, REG_EAX);                              // xor  edx,eax
3036         emit_test_r32_imm(DRCTOP, REG_EDX, 0x8000);                              // test edx,0x8000
3040         emit_test_r32_imm(DRCTOP, REG_EDX, SR_IMEX5);                              // test edx,0x8000
30373041         emit_jcc_short_link(DRCTOP, COND_Z, &link1);                           // jz   skip
30383042         emit_lea_r64_m64(DRCTOP, REG_P1, COREADDR);                              // lea  p1,[mips3.core]
30393043         emit_call_m64(DRCTOP, MDRC(&mips3.drcdata->mips3com_update_cycle_counting));   // call mips3com_update_cycle_counting
src/emu/cpu/mips/r3000.c
r1490r1491
12961296      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "MIPS II");            break;
12971297      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
12981298      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1299      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles 2000-2002"); break;
1299      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles"); break;
13001300
13011301      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
13021302
src/emu/cpu/mips/mips3fe.c
r1490r1491
44
55    Front-end for MIPS3 recompiler
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
src/emu/cpu/mips/psx.c
r1490r1491
34843484      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "mipscpu");            break;
34853485      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.5");               break;
34863486      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
3487      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 2005 smf");   break;
3487      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright smf");      break;
34883488
34893489      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
34903490
src/emu/cpu/mips/mips3fe.h
r1490r1491
44
55    Front-end for MIPS3 recompiler
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
src/emu/cpu/mips/mips3drc.c
r1490r1491
252252      x86log_free_context(mips3.log);
253253
254254   /* clean up the DRC */
255   mips3drc_exit();
256255   drcfe_exit(mips3.drcfe);
257   drc_exit(mips3.drc);
256   mips3drc_exit();
258257
259258   /* free the cache */
260259   osd_free_executable(mips3.core, CACHE_SIZE + sizeof(*mips3.core));
src/emu/cpu/mips/mdrcold.c
r1490r1491
268268
269269static void mips3drc_exit(void)
270270{
271   drc_exit(mips3.drc);
271272}
272273
273274
src/emu/cpu/mips/mips3com.c
r1490r1491
174174void mips3com_update_cycle_counting(mips3_state *mips)
175175{
176176   /* modify the timer to go off */
177   if ((mips->cpr[0][COP0_Status] & 0x8000) && mips->cpr[0][COP0_Compare] != 0xffffffff)
177   if ((mips->cpr[0][COP0_Status] & SR_IMEX5) && mips->cpr[0][COP0_Compare] != 0xffffffff)
178178   {
179179      UINT32 count = (activecpu_gettotalcycles64() - mips->count_zero_time) / 2;
180180      UINT32 compare = mips->cpr[0][COP0_Compare];
181181      UINT32 cyclesleft = compare - count;
182182      attotime newtime = ATTOTIME_IN_CYCLES(((INT64)cyclesleft * 2), cpu_getactivecpu());
183
184      /* due to accuracy issues, don't bother setting timers unless they're for less than 100msec */
185      if (attotime_compare(newtime, ATTOTIME_IN_MSEC(100)) < 0)
186         timer_adjust(mips->compare_int_timer, newtime, cpu_getactivecpu(), attotime_zero);
183      timer_adjust(mips->compare_int_timer, newtime, cpu_getactivecpu(), attotime_zero);
187184   }
188185   else
189186      timer_adjust(mips->compare_int_timer, attotime_never, cpu_getactivecpu(), attotime_zero);
r1490r1491
620617      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "MIPS III");         break;
621618      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "3.0");               break;
622619      case CPUINFO_STR_CORE_FILE:                  /* provided by core */               break;
623      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles 2000-2007"); break;
620      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles"); break;
624621
625622      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
626623
src/emu/cpu/tms7000/tms7000.h
r1490r1491
33 *   tms7000.h (c header file)
44 *   Portable TMS7000 emulator (Texas Instruments 7000)
55 *
6 *   Copyright (c) 2001 tim lindner, all rights reserved.
6 *   Copyright tim lindner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/tms7000/tms70tb.c
r1490r1491
33 *   tms70tb.c (function table)
44 *   Portable TMS7000 emulator (Texas Instruments 7000)
55 *
6 *   Copyright (c) 2001 tim lindner, all rights reserved.
6 *   Copyright tim lindner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/tms7000/tms70op.c
r1490r1491
33 *   tms70op.c (Op code functions)
44 *   Portable TMS7000 emulator (Texas Instruments 7000)
55 *
6 *   Copyright (c) 2001 tim lindner, all rights reserved.
6 *   Copyright tim lindner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/tms7000/tms7000.c
r1490r1491
33 *   tms7000.c
44 *   Portable TMS7000 emulator (Texas Instruments 7000)
55 *
6 *   Copyright (c) 2001 tim lindner, all rights reserved.
6 *   Copyright tim lindner, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
r1490r1491
340340        case CPUINFO_STR_CORE_FAMILY:   strcpy(info->s = cpuintrf_temp_str(), "Texas Instriuments TMS7000"); break;
341341        case CPUINFO_STR_CORE_VERSION:   strcpy(info->s = cpuintrf_temp_str(), "1.0"); break;
342342        case CPUINFO_STR_CORE_FILE:   strcpy(info->s = cpuintrf_temp_str(), __FILE__); break;
343        case CPUINFO_STR_CORE_CREDITS:   strcpy(info->s = cpuintrf_temp_str(), "Copyright (C) tim lindner 2003"); break;
343        case CPUINFO_STR_CORE_CREDITS:   strcpy(info->s = cpuintrf_temp_str(), "Copyright tim lindner"); break;
344344
345345        case CPUINFO_STR_FLAGS:
346346                sprintf(info->s = cpuintrf_temp_str(),  "%c%c%c%c%c%c%c%c",
src/emu/cpu/f8/f8.h
r1490r1491
33 *   f8.h
44 *   Portable Fairchild F8 emulator interface
55 *
6 *   Copyright (c) 2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/f8/f8.c
r1490r1491
33 *   f8.c
44 *   Portable F8 emulator (Fairchild 3850)
55 *
6 *   Copyright (c) 2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
r1490r1491
21272127   case CPUINFO_STR_CORE_VERSION:   strcpy(info->s = cpuintrf_temp_str(), "1.0");         break;
21282128   case CPUINFO_STR_CORE_FILE:      strcpy(info->s = cpuintrf_temp_str(), __FILE__);      break;
21292129   case CPUINFO_STR_CORE_CREDITS:   strcpy(info->s = cpuintrf_temp_str(),
2130                           "Copyright (c) 2000 Juergen Buchmueller, all rights reserved.");
2130                           "Copyright Juergen Buchmueller, all rights reserved.");
21312131                           break;
21322132
21332133    case CPUINFO_STR_FLAGS:
src/emu/cpu/z80/z80.c
r1490r1491
33 *   z80.c
44 *   Portable Z80 emulator V3.5
55 *
6 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
r1490r1491
37703770      case CPUINFO_STR_CORE_FAMILY:            strcpy(info->s, "Zilog Z80");            break;
37713771      case CPUINFO_STR_CORE_VERSION:            strcpy(info->s, "3.7");                  break;
37723772      case CPUINFO_STR_CORE_FILE:               strcpy(info->s, __FILE__);               break;
3773      case CPUINFO_STR_CORE_CREDITS:            strcpy(info->s, "Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved."); break;
3773      case CPUINFO_STR_CORE_CREDITS:            strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
37743774
37753775      case CPUINFO_STR_FLAGS:
37763776         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/z80/z80dasm.c
r1490r1491
33 *   z80dasm.c
44 *   Portable Z80 disassembler
55 *
6 *   Copyright (C) 1998 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/asap/asap.c
r1490r1491
18151815      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Atari ASAP");         break;
18161816      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
18171817      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1818      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles 2000-2004"); break;
1818      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles"); break;
18191819
18201820      case CPUINFO_STR_FLAGS:                     strcpy(info->s, " ");               break;
18211821
src/emu/cpu/tms9900/9900dasm.c
r1490r1491
33 *   9900dasm.c
44 *   TMS 9900 family disassembler
55 *
6 *   Raphael Nabet 2003
7 *   Based on previous work Copyright (c) 1998 John Butler.
6 *   Copyright Raphael Nabet
7 *   Based on previous work Copyright John Butler.
88 *   Based on 6502dasm.c 6502/65c02/6510 disassembler by Juergen Buchmueller
99 *
1010 *   - This source code is released as freeware for non-commercial purposes.
src/emu/cpu/x86emit.h
r1490r1491
44
55    Generic x86/x64 code emitters.
66
7    Copyright (c) 2007, Aaron Giles
7    Copyright Aaron Giles
88    Released for general use under the MAME license
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
src/emu/cpu/x64drc.c
r1490r1491
44
55    x64 Dynamic recompiler support routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/cpu/tms32025/32025dsm.c
r1490r1491
11 /**************************************************************************\
22 *              Texas Instruments TMS320x25 DSP Disassembler                *
33 *                                                                          *
4 *                 Copyright (C) 2001-2002+ Tony La Porta                   *
4 *                 Copyright Tony La Porta                                  *
55 *              To be used with TMS320x25 DSP Emulator engine.              *
66 *                      Written for the MAME project.                       *
77 *                                                                          *
src/emu/cpu/tms32025/tms32025.c
r1490r1491
11 /**************************************************************************\
22 *                Texas Instruments TMS320x25 DSP Emulator                  *
33 *                                                                          *
4 *                 Copyright (C) 2001-2002+ Tony La Porta                   *
4 *                 Copyright Tony La Porta                                  *
55 *                      Written for the MAME project.                       *
66 *                                                                          *
77 *                                                                          *
r1490r1491
23962396      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Texas Instruments TMS320x25"); break;
23972397      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.10");            break;
23982398      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
2399      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2001 by Tony La Porta"); break;
2399      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Tony La Porta"); break;
24002400
24012401      case CPUINFO_STR_FLAGS:
24022402         sprintf(info->s, "arp%d%c%c%c%cdp%03x  arb%d%c%c%c%c%c%c%c%c%c%c%cpm%d",
src/emu/cpu/tms32025/tms32025.h
r1490r1491
11 /**************************************************************************\
22 *                Texas Instruments TMS320x25 DSP Emulator                  *
33 *                                                                          *
4 *                 Copyright (C) 2001-2002+ Tony La Porta                   *
4 *                 Copyright Tony La Porta                                  *
55 *                      Written for the MAME project.                       *
66 *                                                                          *
77 *      Note :  This is a word based microcontroller, with addressing       *
src/emu/cpu/tms32025/dis32025.c
r1490r1491
11 /**************************************************************************\
22 *              Texas Instruments TMS320x25 DSP Disassembler                *
33 *                                                                          *
4 *                 Copyright (C) 2001-2002+ Tony La Porta                   *
4 *                 Copyright Tony La Porta                                  *
55 *                      Written for the MAME project.                       *
66 *                                                                          *
77 *      Notes : Data is expected to be read from source file as MSB first.  *
src/emu/cpu/x64drc.h
r1490r1491
44
55    x64 Dynamic recompiler support routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cpu/pic16c5x/pic16c5x.c
r1490r1491
11 /**************************************************************************\
22 *                      Microchip PIC16C5x Emulator                         *
33 *                                                                          *
4 *                    Copyright (C) 2003+ Tony La Porta                     *
4 *                    Copyright Tony La Porta                               *
55 *                 Originally written for the MAME project.                 *
66 *                                                                          *
77 *                                                                          *
r1490r1491
10211021      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Microchip");         break;
10221022      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.12");            break;
10231023      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1024      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C)2003+ by Tony La Porta"); break;
1024      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Tony La Porta"); break;
10251025
10261026      case CPUINFO_STR_FLAGS:
10271027         sprintf(info->s, "%01x%c%c%c%c%c %c%c%c%03x",
src/emu/cpu/pic16c5x/dis16c5x.c
r1490r1491
11 /**************************************************************************\
22 *                      Microchip PIC16C5x Emulator                         *
33 *                                                                          *
4 *                    Copyright (C) 2003+ Tony La Porta                     *
4 *                    Copyright Tony La Porta                               *
55 *                 Originally written for the MAME project.                 *
66 *                                                                          *
77 *                                                                          *
src/emu/cpu/pic16c5x/pic16c5x.h
r1490r1491
11 /**************************************************************************\
22 *                      Microchip PIC16C5x Emulator                         *
33 *                                                                          *
4 *                    Copyright (C) 2003+ Tony La Porta                     *
4 *                    Copyright Tony La Porta                               *
55 *                 Originally written for the MAME project.                 *
66 *                                                                          *
77 *                                                                          *
src/emu/cpu/pic16c5x/16c5xdsm.c
r1490r1491
11 /**************************************************************************\
22 *                      Microchip PIC16C5x Emulator                         *
33 *                                                                          *
4 *                    Copyright (C) 2003+ Tony La Porta                     *
4 *                    Copyright Tony La Porta                               *
55 *                 Originally written for the MAME project.                 *
66 *                                                                          *
77 *                                                                          *
src/emu/cpu/mb86233/mb86233.c
r1490r1491
16511651      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Fujitsu MB86233");      break;
16521652      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
16531653      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1654      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright 2007 ElSemi and Ernesto Corvi"); break;
1654      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Miguel Angel Horna and Ernesto Corvi"); break;
16551655
16561656      case CPUINFO_STR_FLAGS:
16571657          sprintf(info->s, "%c%c", (GETSR()&SIGN_FLAG) ? 'N' : 'n', (GETSR()&ZERO_FLAG) ? 'Z' : 'z' );
src/emu/cpu/t11/t11.c
r1490r1491
11/*** t11: Portable DEC T-11 emulator ******************************************
22
3    Copyright (C) Aaron Giles 1998-2001
3    Copyright Aaron Giles
44
55    System dependencies:    long must be at least 32 bits
66                            word must be 16 bit unsigned int
r1490r1491
513513      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "DEC T-11");         break;
514514      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
515515      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
516      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) Aaron Giles 1998"); break;
516      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Aaron Giles"); break;
517517
518518      case CPUINFO_STR_FLAGS:
519519         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/t11/t11ops.c
r1490r1491
11/*** t11: Portable DEC T-11 emulator ******************************************
22
3    Copyright (C) Aaron Giles 1998
3    Copyright Aaron Giles
44
55    Actual opcode implementation.  Excuse the excessive use of macros, it
66    was the only way I could bear to type all this in!
src/emu/cpu/t11/t11table.c
r1490r1491
11/*** t11: Portable DEC T-11 emulator ******************************************
22
3    Copyright (C) Aaron Giles 1998
3    Copyright Aaron Giles
44
55    Opcode table plus function prototypes
66
src/emu/cpu/arm7/arm7core.c
r1490r1491
33 *   arm7core.c
44 *   Portable ARM7TDMI Core Emulator
55 *
6 *   Copyright (c) 2004 Steve Ellenoff, all rights reserved.
6 *   Copyright Steve Ellenoff, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/arm7/arm7core.h
r1490r1491
33 *   arm7core.h
44 *   Portable ARM7TDMI Core Emulator
55 *
6 *   Copyright (c) 2004 Steve Ellenoff, all rights reserved.
6 *   Copyright Steve Ellenoff, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/arm7/arm7.c
r1490r1491
33 *   arm7.c
44 *   Portable ARM7TDMI CPU Emulator
55 *
6 *   Copyright (c) 2004 Steve Ellenoff, all rights reserved.
6 *   Copyright Steve Ellenoff, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
r1490r1491
351351      case CPUINFO_STR_CORE_FAMILY:         strcpy(info->s, "Acorn Risc Machine");         break;
352352      case CPUINFO_STR_CORE_VERSION:         strcpy(info->s, "1.3");                     break;
353353      case CPUINFO_STR_CORE_FILE:            strcpy(info->s, __FILE__);                  break;
354      case CPUINFO_STR_CORE_CREDITS:         strcpy(info->s, "Copyright 2004-2006 Steve Ellenoff, sellenoff@hotmail.com"); break;
354      case CPUINFO_STR_CORE_CREDITS:         strcpy(info->s, "Copyright Steve Ellenoff, sellenoff@hotmail.com"); break;
355355
356356      case CPUINFO_STR_FLAGS:
357357         sprintf(info->s, "%c%c%c%c%c%c%c %s",
src/emu/cpu/arm7/arm7.h
r1490r1491
33 *   arm7.h
44 *   Portable ARM7TDMI CPU Emulator
55 *
6 *   Copyright (c) 2004 Steve Ellenoff, all rights reserved.
6 *   Copyright Steve Ellenoff, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/arm7/arm7dasm.c
r1490r1491
33 *   arm7dasm.c
44 *   Portable ARM7TDMI Core Emulator - Disassembler
55 *
6 *   Copyright (c) 2004 Steve Ellenoff, all rights reserved.
6 *   Copyright Steve Ellenoff, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/arm7/arm7exec.c
r1490r1491
33 *   arm7exec.c
44 *   Portable ARM7TDMI Core Emulator
55 *
6 *   Copyright (c) 2004 Steve Ellenoff, all rights reserved.
6 *   Copyright Steve Ellenoff, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/h6280/h6280ops.h
r1490r1491
22
33    h6280ops.h - Addressing modes and opcode macros for the Hu6820 cpu
44
5    Copyright (c) 1999 Bryan McPhail, mish@tendril.co.uk
5    Copyright Bryan McPhail, mish@tendril.co.uk
66
77    This source code is based (with permission!) on the 6502 emulator by
88    Juergen Buchmueller.  It is released as part of the Mame emulator project.
src/emu/cpu/h6280/6280dasm.c
r1490r1491
22
33    6280dasm.c Hudsonsoft Hu6280 (HuC6280/Hu6280a) disassembler
44
5    Copyright (c) 1999, 2000 Bryan McPhail, mish@tendril.co.uk
5    Copyright Bryan McPhail, mish@tendril.co.uk
66
77    This source code is based (with permission!) on the 6502 emulator by
88    Juergen Buchmueller.  It is released as part of the Mame emulator project.
src/emu/cpu/h6280/h6280.c
r1490r1491
22
33    h6280.c - Portable HuC6280 emulator
44
5    Copyright (c) 1999, 2000 Bryan McPhail, mish@tendril.co.uk
5    Copyright Bryan McPhail, mish@tendril.co.uk
66
77    This source code is based (with permission!) on the 6502 emulator by
88    Juergen Buchmueller.  It is released as part of the Mame emulator project.
r1490r1491
523523      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Hudsonsoft 6280");      break;
524524      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.11");            break;
525525      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
526      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1999, 2000 Bryan McPhail, mish@tendril.co.uk"); break;
526      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Bryan McPhail, mish@tendril.co.uk"); break;
527527
528528      case CPUINFO_STR_FLAGS:
529529         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/h6280/tblh6280.c
r1490r1491
22
33    tblh6280.c
44
5    Copyright (c) 1999 Bryan McPhail, mish@tendril.co.uk
5    Copyright Bryan McPhail, mish@tendril.co.uk
66
77    This source code is based (with permission!) on the 6502 emulator by
88    Juergen Buchmueller.  It is released as part of the Mame emulator project.
src/emu/cpu/h6280/h6280.h
r1490r1491
22
33    h6280.h Portable Hu6280 emulator interface
44
5    Copyright (c) 1999 Bryan McPhail, mish@tendril.co.uk
5    Copyright Bryan McPhail, mish@tendril.co.uk
66
77    This source code is based (with permission!) on the 6502 emulator by
88    Juergen Buchmueller.  It is released as part of the Mame emulator project.
src/emu/cpu/cp1610/cp1610.h
r1490r1491
33 *   cp1610.h
44 *   Portable General Instruments CP1610 emulator interface
55 *
6 *   Copyright (c) 2004 Frank Palazzolo, all rights reserved.
6 *   Copyright Frank Palazzolo, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/cp1610/cp1610.c
r1490r1491
33 *   cp1610.c
44 *   Portable CP1610 emulator (General Instrument CP1610)
55 *
6 *   Copyright (c) 2004 Frank Palazzolo, all rights reserved.
6 *   Copyright Frank Palazzolo, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
r1490r1491
35003500   case CPUINFO_STR_CORE_VERSION:   strcpy(info->s = cpuintrf_temp_str(), "1.0");         break;
35013501   case CPUINFO_STR_CORE_FILE:      strcpy(info->s = cpuintrf_temp_str(), __FILE__);      break;
35023502   case CPUINFO_STR_CORE_CREDITS:   strcpy(info->s = cpuintrf_temp_str(),
3503                           "Copyright (c) 2004 Frank Palazzolo, all rights reserved.");
3503                           "Copyright Frank Palazzolo, all rights reserved.");
35043504                           break;
35053505    case CPUINFO_STR_FLAGS:
35063506         sprintf(info->s = cpuintrf_temp_str(), "%c%c%c%c",
src/emu/cpu/saturn/saturn.h
r1490r1491
44 *   portable saturn emulator interface
55 *   (hp calculators)
66 *
7 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
7 *   Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/saturn/saturnds.c
r1490r1491
44 *   portable saturn emulator interface
55 *   (hp calculators)
66 *
7 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
7 *   Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/saturn/saturn.c
r1490r1491
44 *   portable saturn emulator interface
55 *   (hp calculators)
66 *
7 *   Copyright (c) 2000 Peter Trauner, all rights reserved.
7 *   Copyright Peter Trauner, all rights reserved.
88 *
99 *   - This source code is released as freeware for non-commercial purposes.
1010 *   - You are free to use and redistribute this code in modified or
r1490r1491
386386      case CPUINFO_STR_CORE_FAMILY:                strcpy(info->s = cpuintrf_temp_str(), "Saturn");   break;
387387      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s = cpuintrf_temp_str(), "1.0alpha");   break;
388388      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s = cpuintrf_temp_str(), __FILE__);   break;
389      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s = cpuintrf_temp_str(), "Copyright (c) 2000 Peter Trauner, all rights reserved.");   break;
389      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s = cpuintrf_temp_str(), "Copyright Peter Trauner, all rights reserved.");   break;
390390
391391      case CPUINFO_STR_REGISTER + SATURN_PC:      sprintf(info->s = cpuintrf_temp_str(), "PC:   %.5x", saturn.pc);break;
392392      case CPUINFO_STR_REGISTER + SATURN_D0:      sprintf(info->s = cpuintrf_temp_str(), "D0:   %.5x", saturn.d[0]);break;
src/emu/cpu/i8x41/i8x41.h
r1490r1491
33 *   i8x41.h
44 *   Portable UPI-41/8041/8741/8042/8742 emulator interface
55 *
6 *   Copyright (c) 1999 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
77 *
88 *   - This source code is released as freeware for non-commercial purposes.
99 *   - You are free to use and redistribute this code in modified or
src/emu/cpu/i8x41/i8x41.c
r1490r1491
33 *   i8x41.c
44 *   Portable UPI-41/8041/8741/8042/8742 emulator V0.2
55 *
6 *   Copyright (c) 1999 Juergen Buchmueller, all rights reserved.
7 *
8 *   Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved.
6 *   Copyright Juergen Buchmueller, all rights reserved.
97 *   You can contact me at juergen@mame.net or pullmoll@stop1984.com
108 *
119 *   - This source code is released as freeware for non-commercial purposes
r1490r1491
22802278      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Intel 8x41");         break;
22812279      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.3");               break;
22822280      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
2283      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (c) 1999 Juergen Buchmueller, all rights reserved."); break;
2281      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Juergen Buchmueller, all rights reserved."); break;
22842282
22852283      case CPUINFO_STR_FLAGS:
22862284         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/cpu/konami/konami.c
r1490r1491
11/*** konami: Portable Konami cpu emulator ******************************************
22
3    Copyright (C) The MAME Team 1999
3    Copyright Nicola Salmoria and the MAME Team
44
5    Based on M6809 cpu core copyright (C) John Butler 1997
5    Based on M6809 cpu core copyright John Butler
66
77    References:
88
r1490r1491
619619      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "KONAMI 5000x");      break;
620620      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
621621      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
622      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) The MAME Team 1999"); break;
622      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
623623
624624      case CPUINFO_STR_FLAGS:
625625         sprintf(info->s, "%c%c%c%c%c%c%c%c",
src/emu/memconv.h
r1490r1491
44
55    Functions which help convert between different handlers.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/config.h
r1490r1491
44
55    Wrappers for handling MAME configuration files
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/streams.c
r1490r1491
44
55    Handle general purpose audio streams
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/audio/generic.h
r1490r1491
44
55    Generic simple sound functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/audio/generic.c
r1490r1491
44
55    Generic simple sound functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/uigfx.c
r1490r1491
44
55    Internal graphics viewer.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/uitext.c
r1490r1491
55    Functions used to retrieve text used by MAME, to aid in
66    translation.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111*********************************************************************/
src/emu/hash.c
r1490r1491
44
55    Function to handle hash functions (checksums)
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010    Started by Farfetch'd
src/emu/streams.h
r1490r1491
44
55    Handle general purpose audio streams
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/eigccx86.h
r1490r1491
55    x86 (32 and 64-bit) inline implementations for GCC compilers. This
66    code is automatically included if appropriate by eminline.h.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/emu/video/resnet.c
r1490r1491
44
55    Compute weights for resistors networks.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010******************************************************************************
src/emu/video/vector.c
r1490r1491
33 * vector.c
44 *
55 *
6 * Copyright 1997,1998 by the M.A.M.E. Project
6 * Copyright Nicola Salmoria and the MAME Team
77 *
88 *        anti-alias code by Andrew Caldwell
99 *        (still more to add)
src/emu/video/resnet.h
r1490r1491
44
55    Compute weights for resistors networks.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*****************************************************************************/
src/emu/video/rgbgen.h
r1490r1491
44
55    General RGB utilities.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/video/rgbvmx.h
r1490r1491
44
55    VMX/Altivec optimised RGB utilities.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/video/generic.c
r1490r1491
44
55    Generic simple video functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/video/rgbutil.h
r1490r1491
55    Utility definitions for RGB manipulation. Allows RGB handling to be
66    performed in an abstracted fashion and optimized with SIMD.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/emu/video/generic.h
r1490r1491
44
55    Generic simple video functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/video/s2636.c
r1490r1491
7676#include "driver.h"
7777#include "s2636.h"
7878
79static const int SpriteOffset[4] = {0,0x10,0x20,0x40};
79static const int sprite_offsets[4] = { 0x00, 0x10, 0x20, 0x40};
8080
8181/* To adjust sprites against bitmap */
8282
r1490r1491
8888mame_bitmap *s2636_2_bitmap;
8989mame_bitmap *s2636_3_bitmap;
9090
91UINT8 s2636_1_dirty[4];
92UINT8 s2636_2_dirty[4];
93UINT8 s2636_3_dirty[4];
91int s2636_x_offset;
92int s2636_y_offset;
9493
95int s2636_x_offset=0;
96int s2636_y_offset=0;
97
98void s2636_w(UINT8 *workram,int offset,int data,UINT8 *dirty)
94const gfx_layout s2636_gfx_layout =
9995{
100   if (workram[offset] != data)
101    {
102        workram[offset] = data;
96   8,10,
97   5,
98   1,
99   { 0 },
100   { 0, 1, 2, 3, 4, 5, 6, 7 },
101      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
102   8*16
103};
103104
104        if(offset < 10)
105         dirty[0]=1;
106        else
107        {
108           if((offset > 15) && (offset < 26))
109            dirty[1]=1;
110            else
111            {
112              if((offset > 31) && (offset < 42))
113               dirty[2]=1;
114                else
115                {
116                 if((offset > 63) && (offset < 74))
117                  dirty[3]=1;
118                }
119            }
120        }
121    }
122}
123105
124106/*****************************************/
125107/* Check for Collision between 2 sprites */
r1490r1491
132114
133115    // Does not check shadow sprites yet
134116
135    if((workram[SpriteOffset[first] + 10] != 0xff) && (workram[SpriteOffset[second] + 10] != 0xff))
117    if((workram[sprite_offsets[first] + 10] != 0xff) && (workram[sprite_offsets[second] + 10] != 0xff))
136118    {
137       int fx1 = workram[SpriteOffset[first] + 10] + s2636_x_offset;
138        int fy1 = workram[SpriteOffset[first] + 12] + s2636_y_offset;
139      int fx2 = workram[SpriteOffset[second] + 10] + s2636_x_offset;
140      int fy2 = workram[SpriteOffset[second] + 12] + s2636_y_offset;
119       int fx1 = workram[sprite_offsets[first] + 10] + s2636_x_offset;
120        int fy1 = workram[sprite_offsets[first] + 12] + s2636_y_offset;
121      int fx2 = workram[sprite_offsets[second] + 10] + s2636_x_offset;
122      int fy2 = workram[sprite_offsets[second] + 12] + s2636_y_offset;
141123
142124        if((fx1>=0) && (fy1>=0) && (fx2>=0) && (fy2>=0))
143125      {
144126            int expand1 = 1 << (16+((workram[0xC0]>>(first<<1)) & 3));
145127            int expand2 = 1 << (16+((workram[0xC0]>>(second<<1)) & 3));
146128
147           int char1   = SpriteOffset[first]>>4;
148           int char2   = SpriteOffset[second]>>4;
129           int char1   = sprite_offsets[first]>>4;
130           int char2   = sprite_offsets[second]>>4;
149131
150132            /* Draw first sprite */
151133
r1490r1491
218200   return Checksum;
219201}
220202
221void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,UINT8 *dirty,int Graphics_Bank,mame_bitmap *collision_bitmap)
203void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,int Graphics_Bank,mame_bitmap *collision_bitmap)
222204{
223205   int CollisionSprite = 0;
224206    int spriteno;
r1490r1491
226208
227209    for(spriteno=0;spriteno<4;spriteno++)
228210    {
229       offs = SpriteOffset[spriteno];
211       offs = sprite_offsets[spriteno];
230212
231213       if(workram[offs+10]!=0xFF)
232214      {
r1490r1491
245227
246228                colour = (colour & 7) + 7;
247229
248                if(dirty[spriteno])
249                {
250                   decodechar(machine->gfx[Graphics_Bank],charno,workram,machine->drv->gfxdecodeinfo[Graphics_Bank].gfxlayout);
251                    dirty[spriteno] = 0;
252                }
230            decodechar(machine->gfx[Graphics_Bank],charno,workram,machine->drv->gfxdecodeinfo[Graphics_Bank].gfxlayout);
253231
254232              drawgfxzoom(bitmap,machine->gfx[Graphics_Bank],
255233                         charno,
src/emu/video/s2636.h
r1490r1491
66extern mame_bitmap *s2636_2_bitmap;
77extern mame_bitmap *s2636_3_bitmap;
88
9extern UINT8 s2636_1_dirty[4];
10extern UINT8 s2636_2_dirty[4];
11extern UINT8 s2636_3_dirty[4];
12
139extern int s2636_x_offset;
1410extern int s2636_y_offset;
1511
16void s2636_w(UINT8 *workram,int offset,int data,UINT8 *dirty);
17void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,UINT8 *dirty,int Graphics_Bank,mame_bitmap *collision_bitmap);
12extern const gfx_layout s2636_gfx_layout;
1813
14void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,int Graphics_Bank,mame_bitmap *collision_bitmap);
15
src/emu/video/rgbsse.h
r1490r1491
66
77    WARNING: This code assumes SSE2 or greater capability.
88
9    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
9    Copyright Nicola Salmoria and the MAME Team.
1010    Visit http://mamedev.org for licensing and usage restrictions.
1111
1212***************************************************************************/
src/emu/uigfx.h
r1490r1491
44
55    Internal graphics viewer.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/uitext.h
r1490r1491
55    Functions used to retrieve text used by MAME, to aid in
66    translation.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/emu/hash.h
r1490r1491
44
55    Function to handle hash functions (checksums)
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/info.c
r1490r1491
44
55    Dumps the MAME internal data as an XML file.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/tilemap.c
r1490r1491
44
55    Generic tilemap management system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/emuopts.c
r1490r1491
44
55    Options file and command line management.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/info.h
r1490r1491
44
55    Dumps the MAME internal data as an XML file.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/tilemap.h
r1490r1491
44
55    Generic tilemap management system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/emuopts.h
r1490r1491
44
55    Options file and command line management.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/uimenu.c
r1490r1491
44
55    Internal MAME menus for the user interface.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/eminline.h
r1490r1491
55    Definitions for inline functions that can be overriden by OSD-
66    specific code.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/emu/audit.c
r1490r1491
44
55    ROM set auditing functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/video.c
r1490r1491
44
55    Core MAME video routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
r1490r1491
499499      int region_length = 8 * memory_region_length(gfxdecodeinfo[i].memory_region);
500500      int xscale = (gfxdecodeinfo[i].xscale == 0) ? 1 : gfxdecodeinfo[i].xscale;
501501      int yscale = (gfxdecodeinfo[i].yscale == 0) ? 1 : gfxdecodeinfo[i].yscale;
502      UINT32 extxoffs[MAX_ABS_GFX_SIZE], extyoffs[MAX_ABS_GFX_SIZE];
502      UINT32 *extpoffs, extxoffs[MAX_ABS_GFX_SIZE], extyoffs[MAX_ABS_GFX_SIZE];
503503      gfx_layout glcopy;
504      const gfx_layout *gl = gfxdecodeinfo[i].gfxlayout;
505      int israw = (gl->planeoffset[0] == GFX_RAW);
506      int planes = gl->planes;
507      UINT16 width = gl->width;
508      UINT16 height = gl->height;
509      UINT32 total = gl->total;
510      UINT32 charincrement = gl->charincrement;
504511      int j;
505512
506513      /* make a copy of the layout */
r1490r1491
520527      glcopy.extxoffs = extxoffs;
521528      glcopy.extyoffs = extyoffs;
522529
530      extpoffs = glcopy.planeoffset;
531
523532      /* expand X and Y by the scale factors */
524533      if (xscale > 1)
525534      {
526         glcopy.width *= xscale;
527         for (j = glcopy.width - 1; j >= 0; j--)
535         width *= xscale;
536         for (j = width - 1; j >= 0; j--)
528537            extxoffs[j] = extxoffs[j / xscale];
529538      }
530539      if (yscale > 1)
531540      {
532         glcopy.height *= yscale;
533         for (j = glcopy.height - 1; j >= 0; j--)
541         height *= yscale;
542         for (j = height - 1; j >= 0; j--)
534543            extyoffs[j] = extyoffs[j / yscale];
535544      }
536545
537546      /* if the character count is a region fraction, compute the effective total */
538      if (IS_FRAC(glcopy.total))
547      if (IS_FRAC(total))
539548      {
540549         if (region_length == 0)
541550            continue;
542         glcopy.total = region_length / glcopy.charincrement * FRAC_NUM(glcopy.total) / FRAC_DEN(glcopy.total);
551         total = region_length / charincrement * FRAC_NUM(total) / FRAC_DEN(total);
543552      }
544553
545554      /* for non-raw graphics, decode the X and Y offsets */
546      if (glcopy.planeoffset[0] != GFX_RAW)
555      if (!israw)
547556      {
548557         /* loop over all the planes, converting fractions */
549         for (j = 0; j < glcopy.planes; j++)
558         for (j = 0; j < planes; j++)
550559         {
551            UINT32 value = glcopy.planeoffset[j];
560            UINT32 value = extpoffs[j];
552561            if (IS_FRAC(value))
553               glcopy.planeoffset[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value);
562               extpoffs[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value);
554563         }
555564
556565         /* loop over all the X/Y offsets, converting fractions */
557         for (j = 0; j < glcopy.width; j++)
566         for (j = 0; j < width; j++)
558567         {
559568            UINT32 value = extxoffs[j];
560569            if (IS_FRAC(value))
561570               extxoffs[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value);
562571         }
563572
564         for (j = 0; j < glcopy.height; j++)
573         for (j = 0; j < height; j++)
565574         {
566575            UINT32 value = extyoffs[j];
567576            if (IS_FRAC(value))
r1490r1491
569578         }
570579      }
571580
572      /* otherwise, just use yoffset[0] as the line modulo */
581      /* otherwise, just use the line modulo */
573582      else
574583      {
575584         int base = gfxdecodeinfo[i].start;
576585         int end = region_length/8;
586         int linemod = gl->yoffset[0];
577587         while (glcopy.total > 0)
578588         {
579            int elementbase = base + (glcopy.total - 1) * glcopy.charincrement / 8;
580            int lastpixelbase = elementbase + glcopy.height * glcopy.yoffset[0] / 8 - 1;
589            int elementbase = base + (total - 1) * charincrement / 8;
590            int lastpixelbase = elementbase + height * linemod / 8 - 1;
581591            if (lastpixelbase < end)
582592               break;
583            glcopy.total--;
593            total--;
584594         }
585595      }
586596
597      /* update glcopy */
598      glcopy.width = width;
599      glcopy.height = height;
600      glcopy.total = total;
601
587602      /* allocate the graphics */
588603      machine->gfx[i] = allocgfx(&glcopy);
589604
src/emu/uimenu.h
r1490r1491
44
55    Internal MAME menus for the user interface.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/memory.c
r1490r1491
44
55    Functions which handle the CPU memory access.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010    Caveats:
src/emu/audit.h
r1490r1491
44
55    ROM, disk, and sample auditing functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/video.h
r1490r1491
44
55    Core MAME video routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/emu.mak
r1490r1491
44#
55#   MAME emulation core makefile
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
r1490r1491
161161   $(EMUMACHINE)/x76f041.o \
162162   $(EMUMACHINE)/x76f100.o \
163163   $(EMUMACHINE)/z80ctc.o \
164   $(EMUMACHINE)/z80dma.o \
164165   $(EMUMACHINE)/z80pio.o \
165166   $(EMUMACHINE)/z80sio.o \
166167
src/emu/memory.h
r1490r1491
44
55    Functions which handle the CPU memory accesses.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/restrack.c
r1490r1491
44
55    Core MAME resource tracking.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/rendfont.c
r1490r1491
44
55    Rendering system font management.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/mame.c
r1490r1491
44
55    Controls execution of the core MAME system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
r1490r1491
11621162   /* otherwise, generate the buffer and call the UI to display the message */
11631163   else
11641164   {
1165      extern void CLIB_DECL ui_popup(const char *format, ...) ATTR_PRINTF(1,2);
11661165      va_list arg;
11671166
11681167      /* dump to the buffer */
src/emu/inptport.c
r1490r1491
44
55    Input port handling.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/eigccppc.h
r1490r1491
55    PowerPC (32 and 64-bit) inline implementations for GCC compilers. This
66    code is automatically included if appropriate by eminline.h.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/emu/machine/6522via.c
r1490r1491
224224}
225225
226226
227INLINE UINT16 v_get_counter1_value(struct via6522 *v) {
228   UINT16 val;
229
230   if (v->t1_active) {
231      val = v_time_to_cycles(v, timer_timeleft(v->t1)) - IFR_DELAY;
232   } else {
233      val = 0xFFFF - v_time_to_cycles(v, attotime_sub(timer_get_time(), v->time1));
234   }
235   return val;
236}
237
238
227239/************************ shift register ************************/
228240
229241static TIMER_CALLBACK( via_shift_callback );
r1490r1491
462474
463475    case VIA_T1CL:
464476      via_clear_int (which, INT_T1);
465      if (v->t1_active)
466         val = v_time_to_cycles(v, timer_timeleft(v->t1)) & 0xff;
467      else
468      {
469         if ( T1_CONTINUOUS(v->acr) )
470            val = (TIMER1_VALUE(v) - (v_time_to_cycles(v, attotime_sub(timer_get_time(), v->time1)) % TIMER1_VALUE(v)) - 1) & 0xff;
471         else
472            val = (0x10000 - (v_time_to_cycles(v, attotime_sub(timer_get_time(), v->time1)) & 0xffff) - 1) & 0xff;
473      }
477      val = v_get_counter1_value(v) & 0xFF;
474478      break;
475479
476480    case VIA_T1CH:
477      if (v->t1_active)
478         val = v_time_to_cycles(v, timer_timeleft(v->t1)) >> 8;
479      else
480      {
481         if ( T1_CONTINUOUS(v->acr) )
482            val = (TIMER1_VALUE(v)- (v_time_to_cycles(v, attotime_sub(timer_get_time(), v->time1)) % TIMER1_VALUE(v)) - 1) >> 8;
483         else
484            val = (0x10000- (v_time_to_cycles(v, attotime_sub(timer_get_time(), v->time1)) & 0xffff) - 1) >> 8;
485      }
481      val = v_get_counter1_value(v) >> 8;
486482      break;
487483
488484    case VIA_T1LL:
r1490r1491
784780      break;
785781
786782    case VIA_ACR:
787      v->acr = data;
788      if (T1_SET_PB7(v->acr))
789783      {
790         if (v->t1_active)
791            v->out_b &= ~0x80;
792         else
793            v->out_b |= 0x80;
794
795         //if (v->ddr_b)
784         UINT16 counter1 = v_get_counter1_value(v);
785         v->acr = data;
786         if (T1_SET_PB7(v->acr))
796787         {
797            UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff);
798
799            if (v->intf->out_b_func)
800               v->intf->out_b_func(0, write_data);
788            if (v->t1_active)
789               v->out_b &= ~0x80;
801790            else
802               logerror("6522VIA chip %d: Port B is being written to but has no handler.  PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data);
791               v->out_b |= 0x80;
792
793            //if (v->ddr_b)
794            {
795               UINT8 write_data = (v->out_b & v->ddr_b) | (v->ddr_b ^ 0xff);
796
797               if (v->intf->out_b_func)
798                  v->intf->out_b_func(0, write_data);
799               else
800                  logerror("6522VIA chip %d: Port B is being written to but has no handler.  PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data);
801            }
803802         }
803         if (T1_CONTINUOUS(data))
804         {
805            timer_adjust(v->t1, v_cycles_to_time(v, counter1 + IFR_DELAY), which, attotime_zero);
806            v->t1_active = 1;
807         }
804808      }
805      if (T1_CONTINUOUS(data))
806      {
807         timer_adjust(v->t1, v_cycles_to_time(v, TIMER1_VALUE(v) + IFR_DELAY), which, attotime_zero);
808         v->t1_active = 1;
809      }
810809      break;
811810
812811   case VIA_IER:
src/emu/machine/laserdsc.c
r1490r1491
44
55    Generic laserdisc support.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*************************************************************************/
src/emu/machine/laserdsc.h
r1490r1491
44
55    Generic laserdisc support.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*************************************************************************/
src/emu/machine/z80dma.c
r0r1491
1/**********************************************************************
2
3    Z80 DMA interface and emulation
4
5    For datasheet http://www.zilog.com/docs/z80/ps0179.pdf
6
7    2008/01     couriersud
8
9        - architecture copied from 8257 DMA
10        - significant changes to implementation
11        - This is only a minimum implementation to support dkong3 and mario drivers
12        - Only memory to memory is tested!
13
14    TODO:
15        - implement missing features
16        - implement interrupt support (not used in dkong3 and mario)
17        - implement more asserts
18        - implement a INPUT_LINE_BUSREQ for Z80. As a workaround,
19          HALT is used. This implies burst mode.
20
21**********************************************************************/
22
23#include "driver.h"
24#include "memconv.h"
25#include "z80dma.h"
26
27#define VERBOSE 0
28
29#define LOG(x)   do { if (VERBOSE) printf x; } while (0)
30
31
32#define REGNUM(_m, _s) (((_m)<<3) + (_s))
33#define GET_REGNUM(_c, _r) (&(_r) - &(WR0(_c)))
34#define REG(_c, _m, _s) (_c)->regs[REGNUM(_m,_s)]
35#define WR0(_c)      REG(_c, 0, 0)
36#define WR1(_c)      REG(_c, 1, 0)
37#define WR2(_c)      REG(_c, 2, 0)
38#define WR3(_c)      REG(_c, 3, 0)
39#define WR4(_c)      REG(_c, 4, 0)
40#define WR5(_c)      REG(_c, 5, 0)
41#define WR6(_c)      REG(_c, 6, 0)
42
43#define PORTA_ADDRESS_L(_c)   REG(_c,0,1)
44#define PORTA_ADDRESS_H(_c)   REG(_c,0,2)
45
46#define BLOCKLEN_L(_c)      REG(_c,0,3)
47#define BLOCKLEN_H(_c)      REG(_c,0,4)
48
49#define PORTA_TIMING(_c)   REG(_c,1,1)
50#define PORTB_TIMING(_c)   REG(_c,2,1)
51
52#define MASK_BYTE(_c)      REG(_c,3,1)
53#define MATCH_BYTE(_c)      REG(_c,3,2)
54
55#define PORTB_ADDRESS_L(_c)   REG(_c,4,1)
56#define PORTB_ADDRESS_H(_c)   REG(_c,4,2)
57#define INTERRUPT_CTRL(_c)   REG(_c,4,3)
58#define INTERRUPT_VECTOR(_c)   REG(_c,4,4)
59#define PULSE_CTRL(_c)      REG(_c,4,5)
60
61#define READ_MASK(_c)      REG(_c,6,1)
62
63
64#define PORTA_ADDRESS(_c)   ((PORTA_ADDRESS_H(_c)<<8) | PORTA_ADDRESS_L(_c))
65#define PORTB_ADDRESS(_c)   ((PORTB_ADDRESS_H(_c)<<8) | PORTB_ADDRESS_L(_c))
66#define BLOCKLEN(_c)      ((BLOCKLEN_H(_c)<<8) | BLOCKLEN_L(_c))
67
68#define PORTA_STEP(_c)      (((WR1(_c) >> 4) & 0x03)*2-1)
69#define PORTB_STEP(_c)      (((WR2(_c) >> 4) & 0x03)*2-1)
70#define PORTA_FIXED(_c)      (((WR1(_c) >> 4) & 0x02) == 0x02)
71#define PORTB_FIXED(_c)      (((WR2(_c) >> 4) & 0x02) == 0x02)
72#define PORTA_MEMORY(_c)   (((WR1(_c) >> 3) & 0x01) == 0x00)
73#define PORTB_MEMORY(_c)   (((WR2(_c) >> 3) & 0x01) == 0x00)
74
75#define PORTA_CYCLE_LEN(_c)   (4-(PORTA_TIMING(_c) & 0x03))
76#define PORTB_CYCLE_LEN(_c)   (4-(PORTB_TIMING(_c) & 0x03))
77
78#define PORTA_IS_SOURCE(_c)   ((WR0(_c) >> 2) & 0x01)
79#define PORTB_IS_SOURCE(_c)   (!PORTA_IS_SOURCE(_c))
80#define TRANSFER_MODE(_c)   (WR0(_c) & 0x03)
81
82#define TM_TRANSFER      (0x01)
83#define TM_SEARCH      (0x02)
84#define TM_SEARCH_TRANSFER   (0x03)
85
86#define READY_ACTIVE_HIGH(_c) ((WR5(_c)>>3) & 0x01)
87
88struct z80dma
89{
90   const struct z80dma_interface *intf;
91   emu_timer *timer;
92
93   UINT16    regs[REGNUM(6,1)+1];
94   UINT8    num_follow;
95   UINT8   cur_follow;
96   UINT8    regs_follow[4];
97   UINT8   status;
98   UINT8   dma_enabled;
99
100   UINT16 addressA;
101   UINT16 addressB;
102   UINT16 count;
103
104   UINT8 rdy;
105
106   UINT8 is_read;
107   UINT8 cur_cycle;
108   UINT8 latch;
109};
110
111static struct z80dma *dma;
112static int dma_count;
113
114static TIMER_CALLBACK( z80dma_timerproc );
115static void z80dma_update_status(int which);
116
117/* ----------------------------------------------------------------------- */
118
119int z80dma_init(int count)
120{
121   int which;
122
123   dma = auto_malloc(count * sizeof(struct z80dma));
124   memset(dma, 0, count * sizeof(struct z80dma));
125   dma_count = count;
126
127   for (which = 0; which < dma_count; which++)
128   {
129      dma[which].timer = timer_alloc(z80dma_timerproc, NULL);
130
131      state_save_register_item_array("Z80DMA", which, dma[which].regs);
132      state_save_register_item_array("Z80DMA", which, dma[which].regs_follow);
133
134      state_save_register_item("Z80DMA", which, dma[which].num_follow);
135      state_save_register_item("Z80DMA", which, dma[which].cur_follow);
136      state_save_register_item("Z80DMA", which, dma[which].status);
137      state_save_register_item("Z80DMA", which, dma[which].dma_enabled);
138
139      state_save_register_item("Z80DMA", which, dma[which].addressA);
140      state_save_register_item("Z80DMA", which, dma[which].addressB);
141      state_save_register_item("Z80DMA", which, dma[which].count);
142      state_save_register_item("Z80DMA", which, dma[which].rdy);
143      state_save_register_item("Z80DMA", which, dma[which].is_read);
144      state_save_register_item("Z80DMA", which, dma[which].cur_cycle);
145      state_save_register_item("Z80DMA", which, dma[which].latch);
146
147   }
148
149   return 0;
150}
151
152
153
154void z80dma_config(int which, const struct z80dma_interface *intf)
155{
156   dma[which].intf = intf;
157}
158
159
160
161void z80dma_reset(void)
162{
163   int which;
164
165   for (which = 0; which < dma_count; which++)
166   {
167      dma[which].status = 0;
168      dma[which].rdy = 0;
169      dma[which].num_follow = 0;
170      dma[which].dma_enabled = 0;
171      z80dma_update_status(which);
172   }
173}
174
175
176
177/* ----------------------------------------------------------------------- */
178
179static void z80dma_do_read(int which)
180{
181   struct z80dma   *cntx = &dma[which];
182   UINT8 mode;
183
184   mode = TRANSFER_MODE(cntx);
185   switch(mode) {
186      case TM_TRANSFER:
187         if (PORTA_IS_SOURCE(cntx))
188         {
189            if (PORTA_MEMORY(cntx))
190               cntx->latch = cntx->intf->memory_read_func(cntx->addressA);
191            else
192               cntx->latch = cntx->intf->portA_read_func(cntx->addressA);
193            cntx->addressA += PORTA_STEP(cntx);
194         }
195         else
196         {
197            if (PORTB_MEMORY(cntx))
198               cntx->latch = cntx->intf->memory_read_func(cntx->addressB);
199            else
200               cntx->latch = cntx->intf->portB_read_func(cntx->addressB);
201            cntx->addressB += PORTB_STEP(cntx);
202         }
203         break;
204
205      default:
206         fatalerror("z80dma_do_operation: invalid mode %d!\n", mode);
207         break;
208   }
209}
210
211static int z80dma_do_write(int which)
212{
213   struct z80dma   *cntx = &dma[which];
214   int done;
215   UINT8 mode;
216
217   mode = TRANSFER_MODE(cntx);
218   if (cntx->count == 0x0000)
219   {
220      //FIXME: Any signal here
221   }
222   switch(mode) {
223      case TM_TRANSFER:
224         if (PORTA_IS_SOURCE(cntx))
225         {
226            if (PORTB_MEMORY(cntx))
227               cntx->intf->memory_write_func(cntx->addressB, cntx->latch);
228            else
229               cntx->intf->portB_write_func(cntx->addressB, cntx->latch);
230            cntx->addressB += PORTB_STEP(cntx);
231         }
232         else
233         {
234            if (PORTA_MEMORY(cntx))
235               cntx->intf->memory_write_func(cntx->addressA, cntx->latch);
236            else
237               cntx->intf->portB_write_func(cntx->addressA, cntx->latch);
238            cntx->addressA += PORTA_STEP(cntx);
239         }
240         cntx->count--;
241         done = (cntx->count == 0xFFFF);
242         break;
243
244      default:
245         fatalerror("z80dma_do_operation: invalid mode %d!\n", mode);
246         break;
247   }
248   if (done)
249   {
250      //FIXME: interrupt ?
251   }
252   return done;
253}
254
255static TIMER_CALLBACK( z80dma_timerproc )
256{
257   int which = param;
258   struct z80dma   *cntx = &dma[which];
259   int done;
260
261   if (--cntx->cur_cycle)
262   {
263      return;
264   }
265   if (cntx->is_read)
266   {
267      z80dma_do_read(which);
268      done = 0;
269      cntx->is_read = 0;
270      cntx->cur_cycle = (PORTA_IS_SOURCE(cntx) ? PORTA_CYCLE_LEN(cntx) : PORTB_CYCLE_LEN(cntx));
271   }
272   else
273   {
274      done = z80dma_do_write(which);
275      cntx->is_read = 1;
276      cntx->cur_cycle = (PORTB_IS_SOURCE(cntx) ? PORTA_CYCLE_LEN(cntx) : PORTB_CYCLE_LEN(cntx));
277   }
278   if (done)
279   {
280      cntx->dma_enabled = 0; //FIXME: Correct?
281      z80dma_update_status(which);
282   }
283}
284
285static void z80dma_update_status(int which)
286{
287   struct z80dma   *cntx = &dma[which];
288   UINT16 pending_transfer;
289   attotime next;
290
291   /* no transfer is active right now; is there a transfer pending right now? */
292   pending_transfer = dma[which].rdy & dma[which].dma_enabled;
293
294   if (pending_transfer)
295   {
296      dma[which].is_read = 1;
297      dma[which].cur_cycle = (PORTA_IS_SOURCE(cntx) ? PORTA_CYCLE_LEN(cntx) : PORTB_CYCLE_LEN(cntx));
298      next = ATTOTIME_IN_HZ(dma[which].intf->clockhz);
299      timer_adjust(dma[which].timer,
300         attotime_zero,
301         which,
302         /* 1 byte transferred in 4 clock cycles */
303         next);
304   }
305   else
306   {
307      /* no transfers active right now */
308      timer_reset(dma[which].timer, attotime_never);
309   }
310
311   /* set the halt line */
312   if (dma[which].intf && dma[which].intf->cpunum >= 0)
313   {
314      //FIXME: Synchronization is done by BUSREQ!
315      cpunum_set_input_line(dma[which].intf->cpunum, INPUT_LINE_HALT,
316         pending_transfer ? ASSERT_LINE : CLEAR_LINE);
317   }
318}
319
320/* ----------------------------------------------------------------------- */
321
322static UINT8 z80dma_read(int which, offs_t offset)
323{
324   fatalerror("z80dma_read: not implemented");
325   return 0;
326}
327
328
329
330static void z80dma_write(int which, offs_t offset, UINT8 data)
331{
332   struct z80dma   *cntx = &dma[which];
333
334   if (cntx->num_follow == 0)
335   {
336      if ((data & 0x87) == 0) // WR2
337      {
338         WR2(cntx) = data;
339         if (data & 0x40)
340            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, PORTB_TIMING(cntx));
341      }
342      else if ((data & 0x87) == 0x04) // WR1
343      {
344         WR1(cntx) = data;
345         if (data & 0x40)
346            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, PORTA_TIMING(cntx));
347      }
348      else if ((data & 0x80) == 0) // WR0
349      {
350         WR0(cntx) = data;
351         if (data & 0x08)
352            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, PORTA_ADDRESS_L(cntx));
353         if (data & 0x10)
354            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, PORTA_ADDRESS_H(cntx));
355         if (data & 0x20)
356            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, BLOCKLEN_L(cntx));
357         if (data & 0x40)
358            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, BLOCKLEN_H(cntx));
359      }
360      else if ((data & 0x83) == 0x80) // WR3
361      {
362         WR3(cntx) = data;
363            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, MASK_BYTE(cntx));
364         if (data & 0x10)
365            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, MATCH_BYTE(cntx));
366      }
367      else if ((data & 0x83) == 0x81) // WR4
368      {
369         WR4(cntx) = data;
370         if (data & 0x04)
371            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, PORTB_ADDRESS_L(cntx));
372         if (data & 0x08)
373            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, PORTB_ADDRESS_H(cntx));
374         if (data & 0x10)
375            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, INTERRUPT_CTRL(cntx));
376      }
377      else if ((data & 0xC7) == 0x82) // WR5
378      {
379         WR5(cntx) = data;
380      }
381      else if ((data & 0x83) == 0x83) // WR6
382      {
383         WR6(cntx) = data;
384         switch (data)
385         {
386            case 0x88:   /* Reinitialize status byte */
387            case 0xA3:   /* Reset and disable interrupts */
388            case 0xA7:   /* Initiate read sequence */
389            case 0xAB:   /* Enable interrupts */
390            case 0xAF:   /* Disable interrupts */
391            case 0xB3:   /* Force ready */
392            case 0xB7:   /* Enable after rti */
393            case 0xBF:   /* Read status byte */
394            case 0xD3:   /* Continue */
395               fatalerror("Unimplemented WR6 command %02x", data);
396               break;
397            case 0xC3:   /* Reset */
398               LOG(("Reset\n"));
399               break;
400            case 0xCF:   /* Load */
401               cntx->addressA = PORTA_ADDRESS(cntx);
402               cntx->addressB = PORTB_ADDRESS(cntx);
403               cntx->count = BLOCKLEN(cntx);
404               LOG(("Load A: %x B: %x N: %x\n", cntx->addressA, cntx->addressB, cntx->count));
405               break;
406            case 0x83:   /* Disable dma */
407               cntx->dma_enabled = 0;
408               z80dma_rdy_write(which, cntx->rdy);
409               break;
410            case 0x87:   /* Enable dma */
411               cntx->dma_enabled = 1;
412               z80dma_rdy_write(which, cntx->rdy);
413               break;
414            case 0xBB:
415               cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, READ_MASK(cntx));
416               break;
417            default:
418               fatalerror("Unknown WR6 command %02x", data);
419         }
420      }
421      else
422         fatalerror("Unknown base register %02x", data);
423      cntx->cur_follow = 0;
424   }
425   else
426   {
427      int nreg = cntx->regs_follow[cntx->cur_follow];
428      cntx->regs[nreg] = data;
429      cntx->cur_follow++;
430      if (cntx->cur_follow>=cntx->num_follow)
431         cntx->num_follow = 0;
432      if (nreg == REGNUM(4,3))
433      {
434         cntx->num_follow=0;
435         if (data & 0x08)
436            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, PULSE_CTRL(cntx));
437         if (data & 0x10)
438            cntx->regs_follow[cntx->num_follow++] = GET_REGNUM(cntx, INTERRUPT_VECTOR(cntx));
439         cntx->cur_follow = 0;
440      }
441   }
442}
443
444
445
446static TIMER_CALLBACK( z80dma_rdy_write_callback )
447{
448   int which = param >> 1;
449   int state = param & 0x01;
450   struct z80dma   *cntx = &dma[which];
451
452   /* normalize state */
453   cntx->rdy = 1 ^ state ^ READY_ACTIVE_HIGH(cntx);
454   cntx->status = (cntx->status & 0xFD) | (cntx->rdy<<1);
455
456   z80dma_update_status(which);
457}
458
459
460
461void z80dma_rdy_write(int which, int state)
462{
463   int param;
464
465   param = (which << 1) | (state ? 1 : 0);
466   LOG(("RDY: %d Active High: %d\n", state, READY_ACTIVE_HIGH(&dma[which])));
467   timer_call_after_resynch(NULL, param, z80dma_rdy_write_callback);
468}
469
470
471/******************* Standard 8-bit/32-bit/64-bit CPU interfaces *******************/
472
473READ8_HANDLER( z80dma_0_r )   { return z80dma_read(0, offset); }
474READ8_HANDLER( z80dma_1_r )   { return z80dma_read(1, offset); }
475WRITE8_HANDLER( z80dma_0_w ) { z80dma_write(0, offset, data); }
476WRITE8_HANDLER( z80dma_1_w ) { z80dma_write(1, offset, data); }
477
478WRITE8_HANDLER( z80dma_0_rdy_w ) { z80dma_rdy_write(0, data); }
479WRITE8_HANDLER( z80dma_1_rdy_w ) { z80dma_rdy_write(1, data); }
480
481READ16_HANDLER( z80dma_16le_0_r ) { return read16le_with_read8_handler(z80dma_0_r, offset, mem_mask); }
482READ16_HANDLER( z80dma_16le_1_r ) { return read16le_with_read8_handler(z80dma_1_r, offset, mem_mask); }
483WRITE16_HANDLER( z80dma_16le_0_w ) { write16le_with_write8_handler(z80dma_0_w, offset, data, mem_mask); }
484WRITE16_HANDLER( z80dma_16le_1_w ) { write16le_with_write8_handler(z80dma_1_w, offset, data, mem_mask); }
485
486READ32_HANDLER( z80dma_32le_0_r ) { return read32le_with_read8_handler(z80dma_0_r, offset, mem_mask); }
487READ32_HANDLER( z80dma_32le_1_r ) { return read32le_with_read8_handler(z80dma_1_r, offset, mem_mask); }
488WRITE32_HANDLER( z80dma_32le_0_w ) { write32le_with_write8_handler(z80dma_0_w, offset, data, mem_mask); }
489WRITE32_HANDLER( z80dma_32le_1_w ) { write32le_with_write8_handler(z80dma_1_w, offset, data, mem_mask); }
490
491READ64_HANDLER( z80dma_64be_0_r ) { return read64be_with_read8_handler(z80dma_0_r, offset, mem_mask); }
492READ64_HANDLER( z80dma_64be_1_r ) { return read64be_with_read8_handler(z80dma_1_r, offset, mem_mask); }
493WRITE64_HANDLER( z80dma_64be_0_w ) { write64be_with_write8_handler(z80dma_0_w, offset, data, mem_mask); }
494WRITE64_HANDLER( z80dma_64be_1_w ) { write64be_with_write8_handler(z80dma_1_w, offset, data, mem_mask); }
src/emu/machine/z80dma.h
r0r1491
1/**********************************************************************
2
3 8257 DMA interface and emulation
4
5 **********************************************************************/
6
7#ifndef Z80DMA_H
8#define Z80DMA_H
9
10struct z80dma_interface
11{
12   /* CPU to halt when DMA is active */
13   int cpunum;
14
15   /* clock */
16   int clockhz;
17
18   /* accessors to main memory */
19   UINT8 (*memory_read_func)(offs_t offset);
20   void (*memory_write_func)(offs_t offset, UINT8 data);
21
22   /* port accesors */
23   UINT8 (*portA_read_func)(UINT16 addr);
24   void (*portA_write_func)(UINT16 addr, UINT8 data);
25   UINT8 (*portB_read_func)(UINT16 addr);
26   void (*portB_write_func)(UINT16 addr, UINT8 data);
27
28   /* interrupt callback - not implemented */
29   /* void (*irqcb)(int state); */
30};
31
32int z80dma_init(int count);
33void z80dma_config(int which, const struct z80dma_interface *intf);
34void z80dma_reset(void);
35
36void z80dma_rdy_write(int which, int state);
37
38READ8_HANDLER(z80dma_0_r);
39READ8_HANDLER(z80dma_1_r);
40WRITE8_HANDLER(z80dma_0_w);
41WRITE8_HANDLER(z80dma_1_w);
42
43WRITE8_HANDLER(z80dma_0_rdy_w);
44WRITE8_HANDLER(z80dma_1_rdy_w);
45
46READ16_HANDLER(z80dma_16le_0_r);
47READ16_HANDLER(z80dma_16le_1_r);
48WRITE16_HANDLER(z80dma_16le_0_w);
49WRITE16_HANDLER(z80dma_16le_1_w);
50
51READ32_HANDLER(z80dma_32le_0_r);
52READ32_HANDLER(z80dma_32le_1_r);
53WRITE32_HANDLER(z80dma_32le_0_w);
54WRITE32_HANDLER(z80dma_32le_1_w);
55
56READ64_HANDLER(z80dma_64be_0_r);
57READ64_HANDLER(z80dma_64be_1_r);
58WRITE64_HANDLER(z80dma_64be_0_w);
59WRITE64_HANDLER(z80dma_64be_1_w);
60
61#endif /* Z80_H */
src/emu/machine/generic.c
r1490r1491
44
55    Generic simple machine functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/machine/generic.h
r1490r1491
44
55    Generic simple machine functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/machine/z80pio.c
r1490r1491
44
55    based on original version (c) 1997, Tatsuyuki Satoh
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/machine/8257dma.h
r1490r1491
2121   /* CPU to halt when DMA is active */
2222   int cpunum;
2323
24   /* speed of DMA accesses (per byte) */
24   /* clock */
2525   int clockhz;
2626
2727   /* accessors to main memory */
src/emu/machine/z80sio.c
r1490r1491
22
33    Z80 SIO (Z8440) implementation
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/emu/machine/z80pio.h
r1490r1491
22
33    Z80 PIO implementation
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/emu/machine/z80sio.h
r1490r1491
22
33    Z80 SIO (Z8440) implementation
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/emu/machine/z80ctc.c
r1490r1491
44
55    based on original version (c) 1997, Tatsuyuki Satoh
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/machine/z80ctc.h
r1490r1491
22
33    Z80 CTC (Z8430) implementation
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/emu/restrack.h
r1490r1491
44
55    Core MAME resource tracking.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/rendfont.h
r1490r1491
44
55    Rendering system font management.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/mame.h
r1490r1491
44
55    Controls execution of the core MAME system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
r1490r1491
6565#define GAMENOUN            "game"
6666#define GAMESNOUN            "games"
6767#define HISTORYNAME            "History"
68#define COPYRIGHT            "Copyright 2007, Nicola Salmoria\nand the MAME team\nhttp://mamedev.org"
68#define COPYRIGHT            "Copyright Nicola Salmoria\nand the MAME team\nhttp://mamedev.org"
6969#else
7070#define APPNAME               "MESS"
7171#define APPNAME_LOWER         "mess"
r1490r1491
7676#define GAMENOUN            "system"
7777#define GAMESNOUN            "systems"
7878#define HISTORYNAME            "System Info"
79#define COPYRIGHT            "Copyright 2007, the MESS team\nhttp://mess.org"
79#define COPYRIGHT            "Copyright the MESS team\nhttp://mess.org"
8080#endif
8181
8282
src/emu/inptport.h
r1490r1491
44
55    Handle input ports and mappings.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/attotime.c
r1490r1491
44
55    Support functions for working with attotime data.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/rendutil.c
r1490r1491
44
55    Core rendering utilities.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/mamecore.c
r1490r1491
55    Simple core functions that are defined in mamecore.h and which may
66    need to be accessed by other MAME-related tools.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111****************************************************************************/
src/emu/rendersw.c
r1490r1491
44
55    Software-only rasterization system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/cpuintrf.c
r1490r1491
44
55    Core CPU interface functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/attotime.h
r1490r1491
44
55    Support functions for working with attotime data.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/rendutil.h
r1490r1491
44
55    Core rendering utilities.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cpuexec.c
r1490r1491
44
55    Core multi-CPU execution engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/mamecore.h
r1490r1491
44
55    General core utilities and macros used throughout MAME.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/rendlay.c
r1490r1491
44
55    Core rendering layout parser and manager.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/cpuintrf.h
r1490r1491
44
55    Core CPU interface functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/output.c
r1490r1491
44
55    General purpose output routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cpuexec.h
r1490r1491
44
55    Core multi-CPU execution engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/rendlay.h
r1490r1491
44
55    Core rendering layout parser and manager.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/output.h
r1490r1491
44
55    General purpose output routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/sound/cdp1869.c
r1490r1491
196196      case SNDINFO_STR_CORE_FAMILY:               info->s = "RCA CDP1869";            break;
197197      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
198198      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
199      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2007, The MAME Team"; break;
199      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
200200   }
201201}
src/emu/sound/sp0256.c
r1490r1491
99   - Support for non bit-flipped ROMs
1010   - SPB-640 perpherial/RAM bus
1111
12 Copyright (c) 1998-2000, Joseph Zbiciak, all rights reserved.
13 Copyright (c) 2006, tim lindner, all rights reserved.
12 Copyright Joseph Zbiciak, all rights reserved.
13 Copyright tim lindner, all rights reserved.
1414
1515 - This source code is released as freeware for non-commercial purposes.
1616 - You are free to use and redistribute this code in modified or
r1490r1491
13691369      case SNDINFO_STR_CORE_FAMILY:               info->s = "GI";                     break;
13701370      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
13711371      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
1372      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2006, Joseph Zbiciak, tim lindner"; break;
1372      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Joseph Zbiciak, tim lindner"; break;
13731373   }
13741374}
13751375
src/emu/sound/ym2413.c
r1490r1491
33** File: ym2413.c - software implementation of YM2413
44**                  FM sound generator type OPLL
55**
6** Copyright (C) 2002 Jarek Burczynski
6** Copyright Jarek Burczynski
77**
88** Version 1.0
99**
r1490r1491
252252   UINT8 address;               /* address register             */
253253   UINT8 status;               /* status flag                  */
254254
255   int index;                  /* index                        */
255256   int clock;                  /* master clock  (Hz)           */
256257   int rate;                  /* sampling rate (Hz)           */
257258   double freqbase;            /* frequency base               */
r1490r1491
12401241}
12411242
12421243
1244static void OPLL_init_save(YM2413 *chip)
1245{
1246   int chipitem = chip->index * 100;
1247   int chnum;
12431248
1249   state_save_register_item_array("ym2413", chipitem, chip->instvol_r);
1250   state_save_register_item("ym2413", chipitem, chip->eg_cnt);
1251   state_save_register_item("ym2413", chipitem, chip->eg_timer);
1252   state_save_register_item("ym2413", chipitem, chip->eg_timer_add);
1253   state_save_register_item("ym2413", chipitem, chip->eg_timer_overflow);
1254   state_save_register_item("ym2413", chipitem, chip->rhythm);
1255   state_save_register_item("ym2413", chipitem, chip->lfo_am_cnt);
1256   state_save_register_item("ym2413", chipitem, chip->lfo_am_inc);
1257   state_save_register_item("ym2413", chipitem, chip->lfo_pm_cnt);
1258   state_save_register_item("ym2413", chipitem, chip->lfo_pm_inc);
1259   state_save_register_item("ym2413", chipitem, chip->noise_rng);
1260   state_save_register_item("ym2413", chipitem, chip->noise_p);
1261   state_save_register_item("ym2413", chipitem, chip->noise_f);
1262   state_save_register_item_2d_array("ym2413", chipitem, chip->inst_tab);
1263   state_save_register_item("ym2413", chipitem, chip->address);
1264   state_save_register_item("ym2413", chipitem, chip->status);
1265
1266   for (chnum = 0; chnum < ARRAY_LENGTH(chip->P_CH); chnum++)
1267   {
1268      OPLL_CH *ch = &chip->P_CH[chnum];
1269      int chitem = chipitem + (chnum + 1) * 10;
1270      int slotnum;
1271
1272      state_save_register_item("ym2413", chitem, ch->block_fnum);
1273      state_save_register_item("ym2413", chitem, ch->fc);
1274      state_save_register_item("ym2413", chitem, ch->ksl_base);
1275      state_save_register_item("ym2413", chitem, ch->kcode);
1276      state_save_register_item("ym2413", chitem, ch->sus);
1277
1278      for (slotnum = 0; slotnum < ARRAY_LENGTH(ch->SLOT); slotnum++)
1279      {
1280         OPLL_SLOT *sl = &ch->SLOT[slotnum];
1281         int slitem = chitem + (slotnum + 1);
1282
1283         state_save_register_item("ym2413", slitem, sl->ar);
1284         state_save_register_item("ym2413", slitem, sl->dr);
1285         state_save_register_item("ym2413", slitem, sl->rr);
1286         state_save_register_item("ym2413", slitem, sl->KSR);
1287         state_save_register_item("ym2413", slitem, sl->ksl);
1288         state_save_register_item("ym2413", slitem, sl->ksr);
1289         state_save_register_item("ym2413", slitem, sl->mul);
1290         state_save_register_item("ym2413", slitem, sl->phase);
1291         state_save_register_item("ym2413", slitem, sl->freq);
1292         state_save_register_item("ym2413", slitem, sl->fb_shift);
1293         state_save_register_item_array("ym2413", slitem, sl->op1_out);
1294         state_save_register_item("ym2413", slitem, sl->eg_type);
1295         state_save_register_item("ym2413", slitem, sl->state);
1296         state_save_register_item("ym2413", slitem, sl->TL);
1297         state_save_register_item("ym2413", slitem, sl->TLL);
1298         state_save_register_item("ym2413", slitem, sl->volume);
1299         state_save_register_item("ym2413", slitem, sl->sl);
1300         state_save_register_item("ym2413", slitem, sl->eg_sh_dp);
1301         state_save_register_item("ym2413", slitem, sl->eg_sel_dp);
1302         state_save_register_item("ym2413", slitem, sl->eg_sh_ar);
1303         state_save_register_item("ym2413", slitem, sl->eg_sel_ar);
1304         state_save_register_item("ym2413", slitem, sl->eg_sh_dr);
1305         state_save_register_item("ym2413", slitem, sl->eg_sel_dr);
1306         state_save_register_item("ym2413", slitem, sl->eg_sh_rr);
1307         state_save_register_item("ym2413", slitem, sl->eg_sel_rr);
1308         state_save_register_item("ym2413", slitem, sl->eg_sh_rs);
1309         state_save_register_item("ym2413", slitem, sl->eg_sel_rs);
1310         state_save_register_item("ym2413", slitem, sl->key);
1311         state_save_register_item("ym2413", slitem, sl->AMmask);
1312         state_save_register_item("ym2413", slitem, sl->vib);
1313         state_save_register_item("ym2413", slitem, sl->wavetable);
1314      }
1315   }
1316}
1317
1318
12441319static void OPLL_initalize(YM2413 *chip)
12451320{
12461321   int i;
12471322
1323   OPLL_init_save(chip);
1324
12481325   /* frequency base */
12491326   chip->freqbase  = (chip->rate) ? ((double)chip->clock / 72.0) / chip->rate  : 0;
12501327#if 0
r1490r1491
13011378   chip->eg_timer_add  = (1<<EG_SH)  * chip->freqbase;
13021379   chip->eg_timer_overflow = ( 1 ) * (1<<EG_SH);
13031380   /*logerror("YM2413init eg_timer_add=%8x eg_timer_overflow=%8x\n", chip->eg_timer_add, chip->eg_timer_overflow);*/
1304
13051381}
13061382
13071383INLINE void KEY_ON(OPLL_SLOT *SLOT, UINT32 key_set)
r1490r1491
19252001/* Create one of virtual YM2413 */
19262002/* 'clock' is chip clock in Hz  */
19272003/* 'rate'  is sampling rate  */
1928static YM2413 *OPLLCreate(int clock, int rate)
2004static YM2413 *OPLLCreate(int clock, int rate, int index)
19292005{
19302006   char *ptr;
19312007   YM2413 *chip;
r1490r1491
19472023
19482024   chip  = (YM2413 *)ptr;
19492025
2026   chip->index = index;
19502027   chip->clock = clock;
19512028   chip->rate  = rate;
19522029
r1490r1491
20012078
20022079
20032080
2004void * YM2413Init(int clock, int rate)
2081void * YM2413Init(int clock, int rate, int index)
20052082{
20062083   /* emulator create */
2007   return OPLLCreate(clock, rate);
2084   return OPLLCreate(clock, rate, index);
20082085}
20092086
20102087void YM2413Shutdown(void *chip)
src/emu/sound/hc55516.c
r1490r1491
240240      case SNDINFO_STR_CORE_FAMILY:               info->s = "Gaelco custom";            break;
241241      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
242242      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
243      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
243      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
244244   }
245245}
246246
src/emu/sound/sp0256.h
r1490r1491
66
77   By Joe Zbiciak. Ported to MESS by tim lindner.
88
9 Copyright (c) 1998-2000, Joseph Zbiciak, all rights reserved.
10 Copyright (c) 2006, tim lindner, all rights reserved.
9 Copyright Joseph Zbiciak, all rights reserved.
10 Copyright tim lindner, all rights reserved.
1111
1212 - This source code is released as freeware for non-commercial purposes.
1313 - You are free to use and redistribute this code in modified or
src/emu/sound/ym2413.h
r1490r1491
2727
2828
2929
30void *YM2413Init(int clock, int rate);
30void *YM2413Init(int clock, int rate, int index);
3131void YM2413Shutdown(void *chip);
3232void YM2413ResetChip(void *chip);
3333void YM2413Write(void *chip, int a, int v);
src/emu/sound/iremga20.c
r1490r1491
298298      case SNDINFO_STR_CORE_FAMILY:               info->s = "Irem custom";            break;
299299      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
300300      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
301      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
301      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
302302   }
303303}
304304
src/emu/sound/custom.c
r1490r1491
8484      case SNDINFO_STR_CORE_FAMILY:               info->s = "None";                  break;
8585      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
8686      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
87      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
87      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
8888   }
8989}
9090
src/emu/sound/2612intf.c
r1490r1491
372372      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
373373      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
374374      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
375      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
375      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
376376   }
377377}
378378
r1490r1491
408408      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
409409      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
410410      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
411      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
411      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
412412   }
413413}
414414
src/emu/sound/c352.c
r1490r1491
618618      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco PCM";               break;
619619      case SNDINFO_STR_CORE_VERSION:               info->s = "1.1";                  break;
620620      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
621      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004-2007, The MAME Team"; break;
621      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
622622   }
623623}
624624
src/emu/sound/k051649.c
r1490r1491
249249      case SNDINFO_STR_CORE_FAMILY:               info->s = "Konami custom";            break;
250250      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
251251      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
252      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
252      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
253253   }
254254}
255255
src/emu/sound/k054539.c
r1490r1491
719719      case SNDINFO_STR_CORE_FAMILY:               info->s = "Konami custom";            break;
720720      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
721721      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
722      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
722      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
723723   }
724724}
725725
src/emu/sound/namco52.c
r1490r1491
222222      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco custom";            break;
223223      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
224224      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
225      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
225      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
226226   }
227227}
228228
src/emu/sound/c140.c
r1490r1491
527527      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco PCM";               break;
528528      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
529529      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
530      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
530      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
531531   }
532532}
533533
src/emu/sound/msm5205.c
r1490r1491
324324      case SNDINFO_STR_CORE_FAMILY:               info->s = "ADPCM";                  break;
325325      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
326326      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
327      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
327      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
328328   }
329329}
330330
src/emu/sound/qsound.c
r1490r1491
402402      case SNDINFO_STR_CORE_FAMILY:               info->s = "Capcom custom";            break;
403403      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
404404      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
405      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
405      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
406406   }
407407}
408408
src/emu/sound/3812intf.c
r1490r1491
184184      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
185185      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
186186      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
187      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
187      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
188188   }
189189}
190190
r1490r1491
352352      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
353353      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
354354      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
355      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
355      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
356356   }
357357}
358358
r1490r1491
558558      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
559559      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
560560      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
561      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
561      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
562562   }
563563}
564564
src/emu/sound/rf5c400.c
r1490r1491
576576      case SNDINFO_STR_CORE_FAMILY:               info->s = "Ricoh PCM";               break;
577577      case SNDINFO_STR_CORE_VERSION:               info->s = "1.1";                  break;
578578      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
579      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004-2007, The MAME Team & hoot development team"; break;
579      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team & hoot development team"; break;
580580   }
581581}
src/emu/sound/saa1099.c
r1490r1491
513513      case SNDINFO_STR_CORE_FAMILY:               info->s = "Philips";               break;
514514      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
515515      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
516      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
516      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
517517   }
518518}
519519
src/emu/sound/cem3394.c
r1490r1491
587587      case SNDINFO_STR_CORE_FAMILY:               info->s = "Analog Synth";            break;
588588      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
589589      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
590      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
590      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
591591   }
592592}
593593
src/emu/sound/ymz280b.c
r1490r1491
11211121      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha Wavetable";         break;
11221122      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
11231123      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
1124      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
1124      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
11251125   }
11261126}
11271127
src/emu/sound/rf5c68.c
r1490r1491
253253      case SNDINFO_STR_CORE_FAMILY:               info->s = "Ricoh PCM";               break;
254254      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
255255      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
256      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
256      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
257257   }
258258}
259259
src/emu/sound/k005289.c
r1490r1491
279279      case SNDINFO_STR_CORE_FAMILY:               info->s = "Konami custom";            break;
280280      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
281281      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
282      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
282      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
283283   }
284284}
285285
src/emu/sound/votrax.c
r1490r1491
184184      case SNDINFO_STR_CORE_FAMILY:               info->s = "Votrax speech";            break;
185185      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
186186      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
187      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
187      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
188188   }
189189}
190190
src/emu/sound/ymf262.c
r1490r1491
33** File: ymf262.c - software implementation of YMF262
44**                  FM sound generator type OPL3
55**
6** Copyright (C) 2003 Jarek Burczynski
6** Copyright Jarek Burczynski
77**
88** Version 0.2
99**
src/emu/sound/sn76496.c
r1490r1491
401401      case SNDINFO_STR_CORE_FAMILY:               info->s = "TI PSG";                  break;
402402      case SNDINFO_STR_CORE_VERSION:               info->s = "1.1";                  break;
403403      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
404      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, 2007 The MAME Team"; break;
404      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
405405   }
406406}
407407
src/emu/sound/wave.c
r1490r1491
9696      case SNDINFO_STR_CORE_FAMILY:               info->s = "Cassette";               break;
9797      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
9898      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
99      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2005, The MESS Team"; break;
99      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright The MESS Team"; break;
100100   }
101101}
src/emu/sound/astrocde.c
r1490r1491
350350      case SNDINFO_STR_CORE_FAMILY:               info->s = "Bally";                  break;
351351      case SNDINFO_STR_CORE_VERSION:               info->s = "2.0";                  break;
352352      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
353      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004-2007, The MAME Team"; break;
353      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
354354   }
355355}
src/emu/sound/x1_010.c
r1490r1491
315315      case SNDINFO_STR_CORE_FAMILY:               info->s = "Seta custom";            break;
316316      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
317317      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
318      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
318      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
319319   }
320320}
321321
src/emu/sound/sid.c
r1490r1491
11/*
2  copyright peter trauner 2000
2  copyright peter trauner
33
44  based on michael schwend's sid play
55
src/emu/sound/upd7759.c
r1490r1491
795795      case SNDINFO_STR_CORE_FAMILY:               info->s = "NEC ADPCM";               break;
796796      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
797797      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
798      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
798      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
799799   }
800800}
801801
src/emu/sound/ymf271.c
r1490r1491
33    By R. Belmont.
44    Based in part on YMF278B emulator by R. Belmont and O. Galibert.
55    12June04 update by Toshiaki Nijiura
6    Copyright (c) 2003 R. Belmont.
6    Copyright R. Belmont.
77
88    This software is dual-licensed: it may be used in MAME and properly licensed
99    MAME derivatives under the terms of the MAME license.  For use outside of
r1490r1491
18361836      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
18371837      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
18381838      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
1839      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
1839      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
18401840   }
18411841}
src/emu/sound/n63701x.c
r1490r1491
187187      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco custom";            break;
188188      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
189189      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
190      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
190      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
191191   }
192192}
193193
src/emu/sound/tiasound.c
r1490r1491
2121/*                 License Information and Copyright Notice                  */
2222/*                 ========================================                  */
2323/*                                                                           */
24/* TiaSound is Copyright(c) 1996 by Ron Fries                                */
24/* TiaSound is Copyright Ron Fries                                           */
2525/*                                                                           */
2626/* This library is free software; you can redistribute it and/or modify it   */
2727/* under the terms of version 2 of the GNU Library General Public License    */
src/emu/sound/pokey.c
r1490r1491
11/*****************************************************************************
22 *
33 *  POKEY chip emulator 4.51
4 *  Copyright (c) 2000-2007 by The MAME Team
4 *  Copyright Nicola Salmoria and the MAME Team
55 *
66 *  Based on original info found in Ron Fries' Pokey emulator,
77 *  with additions by Brad Oliver, Eric Smith and Juergen Buchmueller,
r1490r1491
15421542      case SNDINFO_STR_CORE_FAMILY:               info->s = "Atari custom";            break;
15431543      case SNDINFO_STR_CORE_VERSION:               info->s = "4.51";                  break;
15441544      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
1545      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2000-2007, The MAME Team"; break;
1545      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
15461546   }
15471547}
15481548
src/emu/sound/sp0250.c
r1490r1491
251251      case SNDINFO_STR_CORE_FAMILY:               info->s = "GI speech";               break;
252252      case SNDINFO_STR_CORE_VERSION:               info->s = "1.1";                  break;
253253      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
254      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, 2005 The MAME Team"; break;
254      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
255255   }
256256}
257257
src/emu/sound/speaker.c
r1490r1491
9999      case SNDINFO_STR_CORE_FAMILY:               info->s = "Speaker";               break;
100100      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
101101      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
102      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2005, The MESS Team"; break;
102      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright The MESS Team"; break;
103103   }
104104}
src/emu/sound/ay8910.c
r1490r1491
824824      case SNDINFO_STR_CORE_FAMILY:               info->s = "PSG";                  break;
825825      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
826826      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
827      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
827      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
828828   }
829829}
830830
src/emu/sound/cdda.c
r1490r1491
326326      case SNDINFO_STR_CORE_FAMILY:               info->s = "CD Audio";               break;
327327      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
328328      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
329      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
329      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
330330   }
331331}
332332
src/emu/sound/tiasound.h
r1490r1491
1515/*                 License Information and Copyright Notice                  */
1616/*                 ========================================                  */
1717/*                                                                           */
18/* TiaSound is Copyright(c) 1997 by Ron Fries                                */
18/* TiaSound is Copyright Ron Fries                                           */
1919/*                                                                           */
2020/* This library is free software; you can redistribute it and/or modify it   */
2121/* under the terms of version 2 of the GNU Library General Public License    */
src/emu/sound/pokey.h
r1490r1491
11/*****************************************************************************
22 *
33 *  POKEY chip emulator 4.3
4 *  Copyright (c) 2000 by The MAME Team
4 *  Copyright Nicola Salmoria and the MAME Team
55 *
66 *  Based on original info found in Ron Fries' Pokey emulator,
77 *  with additions by Brad Oliver, Eric Smith and Juergen Buchmueller.
src/emu/sound/tms36xx.c
r1490r1491
554554      case SNDINFO_STR_CORE_FAMILY:               info->s = "TI PSG";                  break;
555555      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
556556      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
557      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
557      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
558558   }
559559}
560560
src/emu/sound/st0016.c
r1490r1491
171171      case SNDINFO_STR_CORE_FAMILY:               info->s = "Seta custom";            break;
172172      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
173173      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
174      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
174      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
175175   }
176176}
177177
src/emu/sound/tiaintf.c
r1490r1491
7979      case SNDINFO_STR_CORE_FAMILY:               info->s = "Atari custom";            break;
8080      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
8181      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
82      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
82      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
8383   }
8484}
8585
src/emu/sound/sidw6581.h
r1490r1491
55 * MOS-6581 R1, R3, R4
66 *
77 * Read-out combined waveforms taken from reSID 0.5.
8 * Copyright (C) 1998  Dag Lem <resid@nimrod.no>
8 * Copyright Dag Lem <resid@nimrod.no>
99 */
1010
1111static const UINT8 waveform30_6581[4096] =
src/emu/sound/c6280.c
r1490r1491
3636
3737    Legal information:
3838
39    Copyright (C) 2002, 2003  Charles MacDonald
39    Copyright Charles MacDonald
4040
4141    This library is free software; you can redistribute it and/or
4242    modify it under the terms of the GNU Lesser General Public
r1490r1491
364364      case SNDINFO_STR_CORE_FAMILY:               info->s = "????";                  break;
365365      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
366366      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
367      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
367      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
368368   }
369369}
370370
src/emu/sound/discrete.c
r1490r1491
745745      case SNDINFO_STR_CORE_FAMILY:               info->s = "Analog";                  break;
746746      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
747747      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
748      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
748      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
749749   }
750750}
751751
src/emu/sound/samples.c
r1490r1491
606606        case SNDINFO_STR_CORE_FAMILY:                   info->s = "Big Hack";                   break;
607607        case SNDINFO_STR_CORE_VERSION:                  info->s = "1.1";                        break;
608608        case SNDINFO_STR_CORE_FILE:                     info->s = __FILE__;                     break;
609        case SNDINFO_STR_CORE_CREDITS:                  info->s = "Copyright (c) 2007, The MAME Team"; break;
609        case SNDINFO_STR_CORE_CREDITS:                  info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
610610   }
611611}
612612
src/emu/sound/scsp.c
r1490r1491
2222                             Enabled DSP again.
2323    * December 16, 2007 (kingshriek) Many EG bug fixes, implemented effects mixer,
2424                             implemented FM.
25    * January 5, 2007   (kingshriek+RB) Working, good-sounding FM, removed obsolete non-USEDSP code.
2526*/
2627
2728#include <math.h>
r1490r1491
3940
4041
4142#define EG_SHIFT   16
43#define FM_DELAY    4    // delay in number of slots processed before samples are written to the FM ring buffer
4244
4345// include the LFO handling code
4446#include "scsplfo.c"
r1490r1491
184186   struct _SLOT Slots[32];
185187   signed short RINGBUF[64];
186188   unsigned char BUFPTR;
189#if FM_DELAY
190   signed short DELAYBUF[FM_DELAY];
191   unsigned char DELAYPTR;
192#endif
187193   unsigned char *SCSPRAM;
188194   UINT32 SCSPRAM_LENGTH;
189195   char Master;
r1490r1491
216222
217223   int ARTABLE[64], DRTABLE[64];
218224
219#ifdef USEDSP
220225   struct _SCSPDSP DSP;
221#endif
222226};
223227
224228static void dma_scsp(struct _SCSP *SCSP);       /*SCSP DMA transfer function*/
r1490r1491
524528      {
525529         SCSP->SCSPRAM = memory_region(intf->region);
526530         SCSP->SCSPRAM_LENGTH = memory_region_length(intf->region);
527#ifdef USEDSP
528531         SCSP->DSP.SCSPRAM = (UINT16 *)SCSP->SCSPRAM;
529532         SCSP->DSP.SCSPRAM_LENGTH =  memory_region_length(intf->region)/2;
530#endif
531533         SCSP->SCSPRAM += intf->roffset;
532534      }
533535   }
r1490r1491
695697      case 0x2:
696698      case 0x3:
697699         {
698#ifdef USEDSP
699700            unsigned int v=RBL(SCSP);
700701            SCSP->DSP.RBP=RBP(SCSP);
701702            if(v==0)
r1490r1491
706707               SCSP->DSP.RBL=32*1024;
707708            if(v==3)
708709               SCSP->DSP.RBL=64*1024;
709#endif
710710         }
711711         break;
712712      case 0x6:
r1490r1491
887887      SCSP->RINGBUF[(addr-0x600)/2]=val;
888888   else
889889   {
890#ifdef USEDSP
891890      //DSP
892891      if(addr<0x780)   //COEF
893892         *((unsigned short *) (SCSP->DSP.COEF+(addr-0x700)/2))=val;
r1490r1491
900899      {
901900         SCSPDSP_Start(&SCSP->DSP);
902901      }
903#endif
904902   }
905903}
906904
r1490r1491
931929
932930#define REVSIGN(v) ((~v)+1)
933931
934
935#ifndef USEDSP
936static signed int *bufl1,*bufr1;
937#define SCSPNAME(_8bit,lfo,alfo,loop) \
938static void SCSP_Update##_8bit##lfo##alfo##loop(struct _SCSP *SCSP, struct _SLOT *slot,unsigned int Enc,unsigned int nsamples)
939
940#define SCSPTMPL(_8bit,lfo,alfo,loop) \
941SCSPNAME(_8bit,lfo,alfo,loop)\
942{\
943   signed int sample;\
944   UINT32 addr;\
945   unsigned int s;\
946   for(s=0;s<nsamples;++s)\
947   {\
948      int step=slot->step;\
949      if(!slot->active)\
950         return;\
951      if(lfo) \
952      {\
953         step=step*PLFO_Step(&(slot->PLFO));\
954         step>>=SHIFT; \
955      }\
956      if(_8bit)\
957      {\
958         signed char *p=(signed char *) (slot->base+BYTE_XOR_BE((slot->cur_addr>>SHIFT)));\
959         int s;\
960         signed int fpart=slot->cur_addr&((1<<SHIFT)-1);\
961         s=(int) (p[0]<<8)*((1<<SHIFT)-fpart)+(int) slot->Prev*fpart;\
962         sample=(s>>SHIFT);\
963         slot->Prev=p[0]<<8;\
964      }\
965      else\
966      {\
967         signed short *p=(signed short *) (slot->base+((slot->cur_addr>>(SHIFT-1))&(~1)));\
968         int s;\
969         signed int fpart=slot->cur_addr&((1<<SHIFT)-1);\
970         s=(int) (p[0])*((1<<SHIFT)-fpart)+(int) slot->Prev*fpart;\
971         sample=(s>>SHIFT);\
972         slot->Prev=p[0];\
973      }\
974      if(slot->Backwards)\
975         slot->cur_addr-=step;\
976      else\
977      slot->cur_addr+=step;\
978      addr=slot->cur_addr>>SHIFT;\
979      if(loop==0)\
980      {\
981         if(addr>LEA(slot))\
982         {\
983            SCSP_StopSlot(slot,0);\
984         }\
985      }\
986      if(loop==1)\
987      {\
988         if(addr>=LEA(slot))\
989            slot->cur_addr=LSA(slot)<<SHIFT;\
990      }\
991      if(loop==2)\
992      {\
993         if(addr>=LEA(slot))\
994         {\
995            slot->cur_addr=LEA(slot)<<SHIFT;\
996            slot->step=REVSIGN(slot->step);\
997         }\
998         if(addr<LSA(slot) || (addr&0x80000000))\
999            slot->cur_addr=LEA(slot)<<SHIFT;\
1000      }\
1001      if(loop==3)\
1002      {\
1003         if(addr>=LEA(slot)) /*reached end, reverse till start*/ \
1004         {\
1005            slot->cur_addr=LEA(slot)<<SHIFT;\
1006            slot->Backwards=1;\
1007         }\
1008         if((addr<=LSA(slot) || (addr&0x80000000)) && (slot->Backwards))/*reached start or negative*/\
1009         {\
1010            slot->cur_addr=LSA(slot)<<SHIFT;\
1011            slot->Backwards=0;\
1012         }\
1013      }\
1014      if(alfo)\
1015      {\
1016         sample=sample*ALFO_Step(&(slot->ALFO));\
1017         sample>>=SHIFT;\
1018      }\
1019      *RBUFDST=sample;\
1020      \
1021      sample=(sample*EG_Update(slot))>>SHIFT;\
1022   \
1023      *bufl1=*bufl1 + ((sample*SCSP->LPANTABLE[Enc])>>SHIFT);\
1024      *bufr1=*bufr1 + ((sample*SCSP->RPANTABLE[Enc])>>SHIFT);\
1025      ++bufl1;\
1026      ++bufr1;\
1027   }\
1028}
1029
1030SCSPTMPL(0,0,0,0)
1031SCSPTMPL(0,0,0,1)
1032SCSPTMPL(0,0,0,2)
1033SCSPTMPL(0,0,0,3)
1034SCSPTMPL(0,0,1,0)
1035SCSPTMPL(0,0,1,1)
1036SCSPTMPL(0,0,1,2)
1037SCSPTMPL(0,0,1,3)
1038SCSPTMPL(0,1,0,0)
1039SCSPTMPL(0,1,0,1)
1040SCSPTMPL(0,1,0,2)
1041SCSPTMPL(0,1,0,3)
1042SCSPTMPL(0,1,1,0)
1043SCSPTMPL(0,1,1,1)
1044SCSPTMPL(0,1,1,2)
1045SCSPTMPL(0,1,1,3)
1046SCSPTMPL(1,0,0,0)
1047SCSPTMPL(1,0,0,1)
1048SCSPTMPL(1,0,0,2)
1049SCSPTMPL(1,0,0,3)
1050SCSPTMPL(1,0,1,0)
1051SCSPTMPL(1,0,1,1)
1052SCSPTMPL(1,0,1,2)
1053SCSPTMPL(1,0,1,3)
1054SCSPTMPL(1,1,0,0)
1055SCSPTMPL(1,1,0,1)
1056SCSPTMPL(1,1,0,2)
1057SCSPTMPL(1,1,0,3)
1058SCSPTMPL(1,1,1,0)
1059SCSPTMPL(1,1,1,1)
1060SCSPTMPL(1,1,1,2)
1061SCSPTMPL(1,1,1,3)
1062
1063#undef SCSPTMPL
1064#define SCSPTMPL(_8bit,lfo,alfo,loop) \
1065 SCSP_Update##_8bit##lfo##alfo##loop ,
1066
1067
1068typedef void (*_SCSPUpdateModes)(struct _SCSP *,struct _SLOT *,unsigned int,unsigned int);
1069
1070static const _SCSPUpdateModes SCSPUpdateModes[]=
1071{
1072   SCSPTMPL(0,0,0,0)
1073   SCSPTMPL(0,0,0,1)
1074   SCSPTMPL(0,0,0,2)
1075   SCSPTMPL(0,0,0,3)
1076   SCSPTMPL(0,0,1,0)
1077   SCSPTMPL(0,0,1,1)
1078   SCSPTMPL(0,0,1,2)
1079   SCSPTMPL(0,0,1,3)
1080   SCSPTMPL(0,1,0,0)
1081   SCSPTMPL(0,1,0,1)
1082   SCSPTMPL(0,1,0,2)
1083   SCSPTMPL(0,1,0,3)
1084   SCSPTMPL(0,1,1,0)
1085   SCSPTMPL(0,1,1,1)
1086   SCSPTMPL(0,1,1,2)
1087   SCSPTMPL(0,1,1,3)
1088   SCSPTMPL(1,0,0,0)
1089   SCSPTMPL(1,0,0,1)
1090   SCSPTMPL(1,0,0,2)
1091   SCSPTMPL(1,0,0,3)
1092   SCSPTMPL(1,0,1,0)
1093   SCSPTMPL(1,0,1,1)
1094   SCSPTMPL(1,0,1,2)
1095   SCSPTMPL(1,0,1,3)
1096   SCSPTMPL(1,1,0,0)
1097   SCSPTMPL(1,1,0,1)
1098   SCSPTMPL(1,1,0,2)
1099   SCSPTMPL(1,1,0,3)
1100   SCSPTMPL(1,1,1,0)
1101   SCSPTMPL(1,1,1,1)
1102   SCSPTMPL(1,1,1,2)
1103   SCSPTMPL(1,1,1,3)
1104};
1105
1106
1107static void SCSP_DoMasterSamples(struct _SCSP *SCSP, int nsamples)
1108{
1109   stream_sample_t *bufr,*bufl;
1110   int sl, s;
1111
1112   for(sl=0;sl<32;++sl)
1113   {
1114      bufr1=SCSP->buffertmpr;
1115      bufl1=SCSP->buffertmpl;
1116
1117      if(SCSP->Slots[sl].active)
1118      {
1119         struct _SLOT *slot=SCSP->Slots+sl;
1120         unsigned short Enc=((TL(slot))<<0x0)|((DIPAN(slot))<<0x8)|((DISDL(slot))<<0xd);
1121         unsigned int mode=LPCTL(slot);
1122
1123         RBUFDST=SCSP->RINGBUF+SCSP->BUFPTR;
1124         if(PLFOS(slot))
1125            mode|=8;
1126         if(ALFOS(slot))
1127            mode|=4;
1128         if(PCM8B(slot))
1129            mode|=0x10;
1130
1131         SCSPUpdateModes[mode](SCSP,slot,Enc,nsamples);
1132
1133         ++SCSP->BUFPTR;
1134         SCSP->BUFPTR&=63;
1135      }
1136   }
1137
1138   bufr=bufferr;
1139   bufl=bufferl;
1140   bufr1=SCSP->buffertmpr;
1141   bufl1=SCSP->buffertmpl;
1142   for(s=0;s<nsamples;++s)
1143   {
1144      signed int smpl=*bufl1>>2;
1145      signed int smpr=*bufr1>>2;
1146
1147      *bufl=ICLIP16(smpl);
1148      *bufr=ICLIP16(smpr);
1149      *bufl1=0;
1150      *bufr1=0;
1151      ++bufl;
1152      ++bufr;
1153      ++bufl1;
1154      ++bufr1;
1155
1156   }
1157}
1158#else
1159932INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
1160933{
1161934   INT32 sample;
r1490r1491
1184957       addr2=(slot->nxt_addr>>(SHIFT-1))&0x7fffe;
1185958    }
1186959
1187   /*if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0)
1188    {
1189        INT32 smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
1190        INT32 cycle=LEA(slot)-LSA(slot); // cycle corresponds to 2 pi
960   if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0)
961   {
962      INT32 smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
963      INT32 cycle=LEA(slot)-LSA(slot); // cycle corresponds to 2 pi
1191964
1192        smp*=cycle; // associate cycle with full 16-bit sample range
1193        smp>>=0x1A-MDL(slot); // ex. for MDL=0xF, sample range corresponds to +/- 64 pi (32=2^5 cycles) so shift by 11 (16-5 == 0x1A-0xF)
1194        while(smp<0) smp+=cycle; smp%=cycle; // keep modulation sampler within a single cycle
1195        if(!PCM8B(slot)) smp<<=1;
965      smp<<=0xA; // associate cycle with 1024
966      smp>>=0x1A-MDL(slot); // ex. for MDL=0xF, sample range corresponds to +/- 64 pi (32=2^5 cycles) so shift by 11 (16-5 == 0x1A-0xF)
967      while(smp<0) smp+=cycle; smp%=cycle; // keep modulation sampler within a single cycle
968      if(!PCM8B(slot)) smp<<=1;
1196969
1197        addr1+=smp; addr2+=smp;
1198        if(!PCM8B(slot))
1199        {
1200            addr1&=0x7fffe; addr2&=0x7fffe;
1201        }
1202        else
1203        {
1204            addr1&=0x7ffff; addr2&=0x7ffff;
1205        }
1206    }*/
970      addr1+=smp; addr2+=smp;
971   }
1207972
1208     if(PCM8B(slot))   //8 bit signed
1209     {
1210       INT8 *p1=(signed char *) (SCSP->SCSPRAM+((SA(slot)+addr1)^1));
1211       INT8 *p2=(signed char *) (SCSP->SCSPRAM+((SA(slot)+addr2)^1));
1212        //sample=(p[0])<<8;
1213        INT32 s;
1214        INT32 fpart=slot->cur_addr&((1<<SHIFT)-1);
1215       s=(int) (p1[0]<<8)*((1<<SHIFT)-fpart)+(int) (p2[0]<<8)*fpart;
1216        sample=(s>>SHIFT);
1217     }
1218     else   //16 bit signed (endianness?)
1219     {
1220       INT16 *p1=(signed short *) (slot->base+addr1);
1221       INT16 *p2=(signed short *) (slot->base+addr2);
1222        //sample=LE16(p[0]);
1223        INT32 s;
1224        INT32 fpart=slot->cur_addr&((1<<SHIFT)-1);
1225       s=(int) (p1[0])*((1<<SHIFT)-fpart)+(int) (p2[0])*fpart;
1226        sample=(s>>SHIFT);
1227     }
973   if(PCM8B(slot))   //8 bit signed
974   {
975      INT8 *p1=(signed char *) (SCSP->SCSPRAM+BYTE_XOR_BE(((SA(slot)+addr1))&0x7FFFF));
976      INT8 *p2=(signed char *) (SCSP->SCSPRAM+BYTE_XOR_BE(((SA(slot)+addr2))&0x7FFFF));
977      //sample=(p[0])<<8;
978      INT32 s;
979      INT32 fpart=slot->cur_addr&((1<<SHIFT)-1);
980      s=(int) (p1[0]<<8)*((1<<SHIFT)-fpart)+(int) (p2[0]<<8)*fpart;
981      sample=(s>>SHIFT);
982   }
983   else   //16 bit signed (endianness?)
984   {
985      INT16 *p1=(signed short *) (SCSP->SCSPRAM+((SA(slot)+addr1)&0x7FFFE));
986      INT16 *p2=(signed short *) (SCSP->SCSPRAM+((SA(slot)+addr2)&0x7FFFE));
987      INT32 s;
988      INT32 fpart=slot->cur_addr&((1<<SHIFT)-1);
989      s=(int)(p1[0])*((1<<SHIFT)-fpart)+(int)(p2[0])*fpart;
990      sample=(s>>SHIFT);
991   }
1228992
1229993   if(SBCTL(slot)&0x1)
1230994      sample ^= 0x7FFF;
r1490r1491
13181082
13191083      for(sl=0;sl<32;++sl)
13201084      {
1085#if FM_DELAY
1086         RBUFDST=SCSP->DELAYBUF+SCSP->DELAYPTR;
1087#else
13211088         RBUFDST=SCSP->RINGBUF+SCSP->BUFPTR;
1089#endif
13221090         if(SCSP->Slots[sl].active)
13231091         {
13241092            struct _SLOT *slot=SCSP->Slots+sl;
r1490r1491
13371105               smpr+=(sample*SCSP->RPANTABLE[Enc])>>SHIFT;
13381106            }
13391107         }
1340         --SCSP->BUFPTR;
1108
1109#if FM_DELAY
1110         SCSP->RINGBUF[(SCSP->BUFPTR+64-(FM_DELAY-1))&63] = SCSP->DELAYBUF[(SCSP->DELAYPTR+FM_DELAY-(FM_DELAY-1))%FM_DELAY];
1111#endif
1112         ++SCSP->BUFPTR;
13411113         SCSP->BUFPTR&=63;
1114#if FM_DELAY
1115         ++SCSP->DELAYPTR;
1116         if(SCSP->DELAYPTR>FM_DELAY-1) SCSP->DELAYPTR=0;
1117#endif
13421118      }
13431119
13441120      SCSPDSP_Step(&SCSP->DSP);
r1490r1491
13581134       *bufr++ = ICLIP16(smpr>>2);
13591135   }
13601136}
1361#endif
13621137
13631138static void dma_scsp(struct _SCSP *SCSP)
13641139{
r1490r1491
14591234   if (SCSP)
14601235   {
14611236      SCSP->SCSPRAM = base;
1462#ifdef USEDSP
14631237      SCSP->DSP.SCSPRAM = base;
1464#endif
14651238   }
14661239}
14671240
r1490r1491
16041377      case SNDINFO_STR_CORE_FAMILY:               info->s = "Sega/Yamaha custom";         break;
16051378      case SNDINFO_STR_CORE_VERSION:               info->s = "2.1.1";                  break;
16061379      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
1607      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004-2007, The MAME Team"; break;
1380      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
16081381   }
16091382}
16101383
src/emu/sound/msm5232.c
r1490r1491
797797      case SNDINFO_STR_CORE_FAMILY:               info->s = "ADPCM";                  break;
798798      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
799799      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
800      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
800      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
801801   }
802802}
803803
src/emu/sound/2610intf.c
r1490r1491
476476      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
477477      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
478478      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
479      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
479      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
480480   }
481481}
482482#endif
r1490r1491
513513      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
514514      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
515515      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
516      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
516      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
517517   }
518518}
519519
src/emu/sound/flt_rc.c
r1490r1491
141141      case SNDINFO_STR_CORE_FAMILY:               info->s = "Filters";               break;
142142      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
143143      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
144      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
144      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
145145   }
146146}
147147
src/emu/sound/beep.c
r1490r1491
192192      case SNDINFO_STR_CORE_FAMILY:               info->s = "Beep";                  break;
193193      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
194194      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
195      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2005, The MESS Team"; break;
195      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright The MESS Team"; break;
196196   }
197197}
src/emu/sound/fmopl.c
r1490r1491
33** File: fmopl.c - software implementation of FM sound generator
44**                                            types OPL and OPL2
55**
6** Copyright (C) 2002,2003 Jarek Burczynski (bujar at mame dot net)
7** Copyright (C) 1999,2000 Tatsuyuki Satoh , MultiArcadeMachineEmulator development
6** Copyright Jarek Burczynski (bujar at mame dot net)
7** Copyright Tatsuyuki Satoh , MultiArcadeMachineEmulator development
88**
99** Version 0.72
1010**
src/emu/sound/tms3615.c
r1490r1491
120120      case SNDINFO_STR_CORE_FAMILY:               info->s = "TI PSG";                  break;
121121      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
122122      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
123      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2006, The MAME Team"; break;
123      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
124124   }
125125}
src/emu/sound/ics2115.c
r1490r1491
572572      case SNDINFO_STR_CORE_FAMILY:               info->s = "ICS";                  break;
573573      case SNDINFO_STR_CORE_VERSION:               info->s = "1.01";                  break;
574574      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
575      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004-2007, The MAME Team"; break;
575      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
576576   }
577577}
578578
src/emu/sound/dac.c
r1490r1491
181181      case SNDINFO_STR_CORE_FAMILY:               info->s = "TI Speech";               break;
182182      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
183183      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
184      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
184      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
185185   }
186186}
187187
src/emu/sound/s14001a.c
r1490r1491
44 By Jonathan Gevaryahu ("Lord Nightmare") with help from Kevin Horton ("kevtris")
55 MAME conversion and integration by R. Belmont
66
7 Copyright (c) 2007 Jonathan Gevaryahu.
7 Copyright Jonathan Gevaryahu.
88
99 Version history:
1010 0.8 initial version - LN
r1490r1491
542542      case SNDINFO_STR_CORE_FAMILY:               info->s = "TSI S14001A";      break;
543543      case SNDINFO_STR_CORE_VERSION:               info->s = "1.11";         break;
544544      case SNDINFO_STR_CORE_FILE:               info->s = __FILE__;         break;
545      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2007 Jonathan Gevaryahu"; break;
545      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Jonathan Gevaryahu"; break;
546546   }
547547}
548548
src/emu/sound/gaelco.c
r1490r1491
328328      case SNDINFO_STR_CORE_FAMILY:               info->s = "Gaelco custom";            break;
329329      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
330330      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
331      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
331      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
332332   }
333333}
334334
r1490r1491
364364      case SNDINFO_STR_CORE_FAMILY:               info->s = "Gaelco custom";            break;
365365      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
366366      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
367      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
367      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
368368   }
369369}
370370
src/emu/sound/fm.c
r1490r1491
44**
55** File: fm.c -- software implementation of Yamaha FM sound generator
66**
7** Copyright (C) 2001, 2002, 2003 Jarek Burczynski (bujar at mame dot net)
8** Copyright (C) 1998 Tatsuyuki Satoh , MultiArcadeMachineEmulator development
7** Copyright Jarek Burczynski (bujar at mame dot net)
8** Copyright Tatsuyuki Satoh , MultiArcadeMachineEmulator development
99**
1010** Version 1.4 (final beta)
1111**
src/emu/sound/bsmt2000.c
r1490r1491
44
55    BSMT2000 sound emulator.
66
7    Copyright (c) Aaron Giles
7    Copyright Aaron Giles
88
99    Chip is actually a TMS320C15 DSP with embedded mask rom
1010    Trivia: BSMT stands for "Brian Schmidt's Mouse Trap"
r1490r1491
524524      case SNDINFO_STR_CORE_FAMILY:               info->s = "Data East Wavetable";      break;
525525      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
526526      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
527      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
527      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
528528   }
529529}
src/emu/sound/dmadac.c
r1490r1491
261261      case SNDINFO_STR_CORE_FAMILY:               info->s = "DAC";                  break;
262262      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
263263      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
264      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
264      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
265265   }
266266}
267267
src/emu/sound/namcona.c
r1490r1491
13231323      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco custom";            break;
13241324      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
13251325      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
1326      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
1326      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
13271327   }
13281328}
13291329
src/emu/sound/2608intf.c
r1490r1491
309309      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
310310      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
311311      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
312      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
312      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
313313   }
314314}
src/emu/sound/okim6295.c
r1490r1491
670670      case SNDINFO_STR_CORE_FAMILY:               info->s = "OKI ADPCM";               break;
671671      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
672672      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
673      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
673      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
674674   }
675675}
676676
src/emu/sound/es5506.c
r1490r1491
21642164      case SNDINFO_STR_CORE_FAMILY:               info->s = "Ensoniq Wavetable";         break;
21652165      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
21662166      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
2167      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
2167      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
21682168   }
21692169}
21702170
r1490r1491
21992199      case SNDINFO_STR_CORE_FAMILY:               info->s = "Ensoniq Wavetable";         break;
22002200      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
22012201      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
2202      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
2202      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
22032203   }
22042204}
22052205
src/emu/sound/ymf278b.c
r1490r1491
3737
3838   By R. Belmont and O. Galibert.
3939
40   Copyright (c) 2002-2003 R. Belmont and O. Galibert.
40   Copyright R. Belmont and O. Galibert.
4141
4242   This software is dual-licensed: it may be used in MAME and properly licensed
4343   MAME derivatives under the terms of the MAME license.  For use outside of
r1490r1491
817817      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
818818      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
819819      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
820      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
820      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
821821   }
822822}
823823
src/emu/sound/sid6581.c
r1490r1491
124124      case SNDINFO_STR_CORE_FAMILY:               info->s = "SID";                  break;
125125      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
126126      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
127      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2005, The MESS Team"; break;
127      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright The MESS Team"; break;
128128   }
129129}
130130
src/emu/sound/flt_vol.c
r1490r1491
7474      case SNDINFO_STR_CORE_FAMILY:               info->s = "Filters";               break;
7575      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
7676      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
77      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
77      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
7878   }
7979}
8080
src/emu/sound/5220intf.c
r1490r1491
256256      case SNDINFO_STR_CORE_FAMILY:               info->s = "TI Speech";               break;
257257      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
258258      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
259      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
259      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
260260   }
261261}
262262
src/emu/sound/2151intf.c
r1490r1491
231231      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
232232      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
233233      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
234      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
234      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
235235   }
236236}
src/emu/sound/psx.c
r1490r1491
689689      case SNDINFO_STR_CORE_FAMILY:               info->s = "Sony custom";            break;
690690      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
691691      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
692      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
692      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
693693   }
694694}
695695
src/emu/sound/k053260.c
r1490r1491
481481      case SNDINFO_STR_CORE_FAMILY:               info->s = "Konami custom";            break;
482482      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
483483      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
484      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
484      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
485485   }
486486}
487487
src/emu/sound/2413intf.c
r1490r1491
5757   memset(info, 0, sizeof(*info));
5858
5959   /* emulator create */
60   info->chip = YM2413Init(clock, rate);
60   info->chip = YM2413Init(clock, rate, sndindex);
6161   if (!info->chip)
6262      return NULL;
6363
r1490r1491
181181      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
182182      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
183183      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
184      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
184      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
185185   }
186186}
src/emu/sound/sound.mak
r1490r1491
44#
55#   Rules for building sound cores
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
src/emu/sound/segapcm.c
r1490r1491
155155      case SNDINFO_STR_CORE_FAMILY:               info->s = "Sega custom";            break;
156156      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
157157      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
158      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
158      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
159159   }
160160}
src/emu/sound/vrender0.c
r1490r1491
268268      case SNDINFO_STR_CORE_FAMILY:               info->s = "???";                  break;
269269      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
270270      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
271      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
271      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
272272   }
273273}
274274
src/emu/sound/multipcm.c
r1490r1491
545545      case SNDINFO_STR_CORE_FAMILY:               info->s = "Sega custom";            break;
546546      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
547547      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
548      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
548      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
549549   }
550550}
551551
src/emu/sound/namco.c
r1490r1491
853853      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco custom";            break;
854854      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
855855      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
856      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
856      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
857857   }
858858}
859859
r1490r1491
887887      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco custom";            break;
888888      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
889889      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
890      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
890      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
891891   }
892892}
893893
r1490r1491
921921      case SNDINFO_STR_CORE_FAMILY:               info->s = "Namco custom";            break;
922922      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
923923      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
924      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
924      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
925925   }
926926}
927927
src/emu/sound/sn76477.c
r1490r1491
24942494   case SNDINFO_STR_CORE_FAMILY:   info->s = "Analog"; break;
24952495   case SNDINFO_STR_CORE_VERSION:   info->s = "2.1"; break;
24962496   case SNDINFO_STR_CORE_FILE:      info->s = __FILE__; break;
2497   case SNDINFO_STR_CORE_CREDITS:   info->s = "Copyright (c) 2007, The MAME Team"; break;
2497   case SNDINFO_STR_CORE_CREDITS:   info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
24982498   }
24992499}
25002500
src/emu/sound/vlm5030.c
r1490r1491
715715      case SNDINFO_STR_CORE_FAMILY:               info->s = "VLM speech";               break;
716716      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
717717      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
718      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
718      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
719719   }
720720}
721721
src/emu/sound/5110intf.c
r1490r1491
269269      case SNDINFO_STR_CORE_FAMILY:               info->s = "TI Speech";               break;
270270      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
271271      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
272      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
272      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
273273   }
274274}
275275
src/emu/sound/2203intf.c
r1490r1491
343343      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
344344      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
345345      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
346      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
346      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
347347   }
348348}
src/emu/sound/k007232.c
r1490r1491
503503      case SNDINFO_STR_CORE_FAMILY:               info->s = "Konami custom";            break;
504504      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
505505      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
506      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
506      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
507507   }
508508}
509509
src/emu/sound/es5503.c
r1490r1491
33  ES5503 - Ensoniq ES5503 "DOC" emulator v1.0
44  By R. Belmont.
55
6  Copyright (c) 2005-2007 R. Belmont.
6  Copyright R. Belmont.
77
88  This software is dual-licensed: it may be used in MAME and properly licensed
99  MAME derivatives under the terms of the MAME license.  For use outside of
r1490r1491
545545      case SNDINFO_STR_CORE_FAMILY:               info->s = "Ensoniq ES550x";               break;
546546      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
547547      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
548      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2005-2007 R. Belmont"; break;
548      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright R. Belmont"; break;
549549   }
550550}
551551
src/emu/sound/es8712.c
r1490r1491
473473      case SNDINFO_STR_CORE_FAMILY:               info->s = "Excellent Systems ADPCM";         break;
474474      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
475475      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
476      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2005, The MAME Team"; break;
476      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
477477   }
478478}
479479
src/emu/sound/nes_apu.c
r1490r1491
783783      case SNDINFO_STR_CORE_FAMILY:               info->s = "Nintendo custom";         break;
784784      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";            break;
785785      case SNDINFO_STR_CORE_FILE:               info->s = __FILE__;                  break;
786      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2005, The MAME Team";  break;
786      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team";  break;
787787   }
788788}
789789
src/emu/sound/262intf.c
r1490r1491
183183      case SNDINFO_STR_CORE_FAMILY:               info->s = "Yamaha FM";               break;
184184      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
185185      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
186      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
186      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
187187   }
188188}
189189
src/emu/inputseq.c
r1490r1491
44
55    Input sequence abstractions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/inputseq.h
r1490r1491
44
55    Input sequence abstractions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/ui.c
r1490r1491
44
55    Functions used to handle MAME's user interface.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/profiler.c
r1490r1491
44
55    Functions to manage profiling of MAME execution.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/ui.h
r1490r1491
44
55    Functions used to handle MAME's crude user interface.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/profiler.h
r1490r1491
44
55    Functions to manage profiling of MAME execution.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/sndintrf.c
r1490r1491
44
55    Core sound interface functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
r1490r1491
958958      case SNDINFO_STR_CORE_FAMILY:               info->s = "Dummy";                  break;
959959      case SNDINFO_STR_CORE_VERSION:               info->s = "1.0";                  break;
960960      case SNDINFO_STR_CORE_FILE:                  info->s = __FILE__;                  break;
961      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright (c) 2004, The MAME Team"; break;
961      case SNDINFO_STR_CORE_CREDITS:               info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
962962   }
963963}
src/emu/sound.c
r1490r1491
44
55    Core sound functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/debugger.h
r1490r1491
44
55    General debugging interfaces
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************/
src/emu/driver.c
r1490r1491
44
55    Driver construction helpers.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/sndintrf.h
r1490r1491
44
55    Core sound interface functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/sound.h
r1490r1491
44
55    Core sound interface functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/input.c
r1490r1491
44
55    Handle input from the user.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
r1490r1491
3939#define JOYSTICK_MAP_STICKY      0x0f
4040
4141/* the largest number of tracked pressed switches for memory */
42#define MAX_PRESSED_SWITCHES   16
42#define MAX_PRESSED_SWITCHES   64
4343
4444/* invalid memory value for axis polling */
4545#define INVALID_AXIS_VALUE      0x7fffffff
r1490r1491
956956
957957
958958/*-------------------------------------------------
959    input_code_poll_keyboard_switches - poll for
960    any keyboard-specific input
961-------------------------------------------------*/
962
963input_code input_code_poll_keyboard_switches(int reset)
964{
965   input_device_list *devlist = &device_list[DEVICE_CLASS_KEYBOARD];
966   int devnum;
967
968   /* if resetting memory, do it now */
969   if (reset)
970      code_pressed_memory_reset();
971
972   /* iterate over devices within each class */
973   for (devnum = 0; devnum < devlist->count; devnum++)
974   {
975      input_device *device = &devlist->list[devnum];
976      input_item_id itemid;
977
978      /* iterate over items within each device */
979      for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++)
980      {
981         input_device_item *item = device->item[itemid];
982         if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
983         {
984            input_code code = device_item_to_code(device, itemid);
985            if (input_code_pressed_once(code))
986               return code;
987         }
988      }
989   }
990
991   /* if nothing, return an invalid code */
992   return INPUT_CODE_INVALID;
993}
994
995
996/*-------------------------------------------------
959997    input_code_poll_axes - poll for any input
960998-------------------------------------------------*/
961999
src/emu/driver.h
r1490r1491
44
55    Include this with all MAME files. Includes all the core system pieces.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cpuint.c
r1490r1491
44
55    Core multi-CPU interrupt engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/drawgfx.c
r1490r1491
44
55    Generic graphic functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
r1490r1491
163163
164164void decodechar(gfx_element *gfx, int num, const UINT8 *src, const gfx_layout *gl)
165165{
166   int israw = (gl->planeoffset[0] == GFX_RAW);
167   int planes = gl->planes;
168   UINT32 charincrement = gl->charincrement;
169   const UINT32 *poffset = gl->planeoffset;
166170   const UINT32 *xoffset = gl->extxoffs ? gl->extxoffs : gl->xoffset;
167171   const UINT32 *yoffset = gl->extyoffs ? gl->extyoffs : gl->yoffset;
168172   UINT8 *dp = gfx->gfxdata + num * gfx->char_modulo;
169173   int plane, x, y;
170174
175   assert_always(!israw, "decodechar: raw layouts not supported");
176
171177   /* zap the data to 0 */
172178   memset(dp, 0, gfx->char_modulo);
173179
174180   /* packed case */
175181   if (gfx->flags & GFX_ELEMENT_PACKED)
176182   {
177      for (plane = 0; plane < gl->planes; plane++)
183      for (plane = 0; plane < planes; plane++)
178184      {
179         int planebit = 1 << (gl->planes - 1 - plane);
180         int planeoffs = num * gl->charincrement + gl->planeoffset[plane];
185         int planebit = 1 << (planes - 1 - plane);
186         int planeoffs = num * charincrement + poffset[plane];
181187
182188         for (y = 0; y < gfx->height; y++)
183189         {
r1490r1491
198204   /* unpacked case */
199205   else
200206   {
201      for (plane = 0; plane < gl->planes; plane++)
207      for (plane = 0; plane < planes; plane++)
202208      {
203         int planebit = 1 << (gl->planes - 1 - plane);
204         int planeoffs = num * gl->charincrement + gl->planeoffset[plane];
209         int planebit = 1 << (planes - 1 - plane);
210         int planeoffs = num * charincrement + poffset[plane];
205211
206212         for (y = 0; y < gfx->height; y++)
207213         {
r1490r1491
232238
233239gfx_element *allocgfx(const gfx_layout *gl)
234240{
241   int israw = (gl->planeoffset[0] == GFX_RAW);
242   int planes = gl->planes;
243   UINT16 width = gl->width;
244   UINT16 height = gl->height;
245   UINT32 total = gl->total;
235246   gfx_element *gfx;
236247
237248   /* allocate memory for the gfx_element structure */
r1490r1491
254265   }
255266
256267   /* fill in the rest */
257   gfx->width = gl->width;
258   gfx->height = gl->height;
259   gfx->total_elements = gl->total;
268   gfx->width = width;
269   gfx->height = height;
270   gfx->total_elements = total;
260271   gfx->color_base = 0;
261   gfx->color_depth = 1 << gl->planes;
262   gfx->color_granularity = 1 << gl->planes;
272   gfx->color_depth = 1 << planes;
273   gfx->color_granularity = 1 << planes;
263274   if (gfx->color_depth <= 32)
264275      gfx->pen_usage = malloc_or_die(gfx->total_elements * sizeof(*gfx->pen_usage));
265276
266277   /* raw graphics case */
267   if (gl->planeoffset[0] == GFX_RAW)
278   if (israw)
268279   {
269280      /* modulos are determined for us by the layout */
270281      gfx->line_modulo = (gl->extyoffs ? gl->extyoffs[0] : gl->yoffset[0]) / 8;
r1490r1491
272283
273284      /* don't free the data because we will get a pointer at decode time */
274285      gfx->flags |= GFX_ELEMENT_DONT_FREE;
275      if (gl->planes <= 4)
286      if (planes <= 4)
276287         gfx->flags |= GFX_ELEMENT_PACKED;
277288   }
278289
src/emu/input.h
r1490r1491
44
55    Handle input from the user.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
r1490r1491
535535/* poll for any switch input, optionally resetting internal memory */
536536input_code input_code_poll_switches(int reset);
537537
538/* poll for any keyboard switch input, optionally resetting internal memory */
539input_code input_code_poll_keyboard_switches(int reset);
540
538541/* poll for any axis input, optionally resetting internal memory */
539542input_code input_code_poll_axes(int reset);
540543
src/emu/fileio.c
r1490r1491
44
55    File access functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cpuint.h
r1490r1491
44
55    Core multi-CPU interrupt engine.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/drawgfx.h
r1490r1491
44
55    Generic graphic functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
r1490r1491
105105#define GFXDECODE_SCALE(region,offset,layout,start,colors,xscale,yscale) { region, offset, &layout, start, colors, xscale, yscale },
106106#define GFXDECODE_END { -1 } };
107107
108/* these macros are used for declaring gfx_layout structures. */
109#define GFXLAYOUT_RAW( name, planes, width, height, linemod, charmod ) \
110const gfx_layout name = { width, height, RGN_FRAC(1,1), planes, { GFX_RAW }, { 0 }, { linemod }, charmod };
108111
112
109113/***************************************************************************
110114    TYPE DEFINITIONS
111115***************************************************************************/
src/emu/fileio.h
r1490r1491
44
55    Core file I/O interface functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/render.c
r1490r1491
44
55    Core rendering system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/clifront.c
r1490r1491
44
55    Command-line interface frontend for MAME.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
r1490r1491
115115   core_options *options;
116116   astring *gamename = astring_alloc();
117117   astring *exename = astring_alloc();
118   const char *gamename_option;
118119   const game_driver *driver;
119120   int result;
120121
r1490r1491
136137      goto error;
137138
138139   /* find out what game we might be referring to */
139   core_filename_extract_base(gamename, options_get_string(options, OPTION_GAMENAME), TRUE);
140   gamename_option = options_get_string(options, OPTION_GAMENAME);
141   core_filename_extract_base(gamename, gamename_option, TRUE);
140142   driver = driver_get_name(astring_c(gamename));
141143
142144   /* execute any commands specified */
r1490r1491
145147      goto error;
146148
147149   /* if we don't have a valid driver selected, offer some suggestions */
148   if (astring_len(gamename) > 0 && driver == NULL)
150   if (strlen(gamename_option) > 0 && driver == NULL)
149151   {
150152      const game_driver *matches[10];
151153      int drvnum;
152154
153155      /* get the top 10 approximate matches */
154      driver_list_get_approx_matches(drivers, astring_c(gamename), ARRAY_LENGTH(matches), matches);
156      driver_list_get_approx_matches(drivers, gamename_option, ARRAY_LENGTH(matches), matches);
155157
156158      /* print them out */
157159      fprintf(stderr, "\n\"%s\" approximately matches the following\n"
158            "supported " GAMESNOUN " (best match first):\n\n", astring_c(gamename));
160            "supported " GAMESNOUN " (best match first):\n\n", gamename_option);
159161      for (drvnum = 0; drvnum < ARRAY_LENGTH(matches); drvnum++)
160162         if (matches[drvnum] != NULL)
161163            fprintf(stderr, "%-10s%s\n", matches[drvnum]->name, matches[drvnum]->description);
r1490r1491
308310{
309311#ifndef MESS
310312   mame_printf_info("M.A.M.E. v%s - Multiple Arcade Machine Emulator\n"
311         "Copyright (C) 1997-2007 by Nicola Salmoria and the MAME Team\n\n", build_version);
313         "Copyright Nicola Salmoria and the MAME Team\n\n", build_version);
312314   mame_printf_info("%s\n", mame_disclaimer);
313315   mame_printf_info("Usage:  MAME gamename [options]\n\n"
314316         "        MAME -showusage    for a brief list of options\n"
src/emu/state.c
r1490r1491
44
55    Save state management functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/emu/timer.c
r1490r1491
55    Functions needed to generate timing and synchronization between several
66    CPUs.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/emu/emupal.c
r1490r1491
44
55    Emulator palette handling functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010******************************************************************************/
src/emu/render.h
r1490r1491
44
55    Core rendering routines for MAME.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/cheat.c
r1490r1491
44
55    MAME cheat system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
r1490r1491
964964
965965   if(flush)      // check key input
966966   {
967      while(input_code_poll_switches(TRUE) != INPUT_CODE_INVALID) ;
967      while(input_code_poll_keyboard_switches(TRUE) != INPUT_CODE_INVALID) ;
968968
969969      return 0;
970970   }
971971
972972   while(1)      // check pressed key
973973   {
974      code = input_code_poll_switches(FALSE);
974      code = input_code_poll_keyboard_switches(FALSE);
975975
976976      if(code == INPUT_CODE_INVALID)
977977      {
r1490r1491
44704470            }
44714471            else
44724472            {
4473               int   code = input_code_poll_switches(FALSE);
4473               int   code = input_code_poll_keyboard_switches(FALSE);
44744474
44754475               if(code == KEYCODE_ESC)
44764476               {
src/emu/clifront.h
r1490r1491
44
55    Command-line interface frontend for MAME.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/emu/state.h
r1490r1491
44
55    Save state management functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
r1490r1491
5151#define state_save_register_item_2d_array(_mod, _inst, _val) \
5252   state_save_register_item_pointer(_mod, _inst, _val[0], sizeof(_val)/sizeof(_val[0][0]))
5353
54#define state_save_register_item_bitmap(_mod, _inst, _val)   \
55   state_save_register_bitmap(_mod, _inst, #_val, _val)
56
5457#define state_save_register_global(_val) \
5558   state_save_register_item("globals", 0, _val)
5659
src/emu/timer.h
r1490r1491
55    Functions needed to generate timing and synchronization between several
66    CPUs.
77
8    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Copyright Nicola Salmoria and the MAME Team.
99    Visit http://mamedev.org for licensing and usage restrictions.
1010
1111***************************************************************************/
src/emu/validity.c
r1490r1491
44
55    Validity checks on internal data structures.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
r1490r1491
866866   {
867867      const gfx_decode_entry *gfx = &drv->gfxdecodeinfo[gfxnum];
868868      int region = gfx->memory_region;
869      int xscale = (drv->gfxdecodeinfo[gfxnum].xscale == 0) ? 1 : drv->gfxdecodeinfo[gfxnum].xscale;
870      int yscale = (drv->gfxdecodeinfo[gfxnum].yscale == 0) ? 1 : drv->gfxdecodeinfo[gfxnum].yscale;
871      const gfx_layout *gl = gfx->gfxlayout;
872      int israw = (gl->planeoffset[0] == GFX_RAW);
873      int planes = gl->planes;
874      UINT16 width = gl->width;
875      UINT16 height = gl->height;
876      UINT32 total = gl->total;
869877
870878      /* if we have a valid region, and we're not using auto-sizing, check the decode against the region length */
871      if (region && !IS_FRAC(gfx->gfxlayout->total))
879      if (region && !IS_FRAC(total))
872880      {
873881         int len, avail, plane, start;
882         UINT32 charincrement = gl->charincrement;
883         const UINT32 *poffset = gl->planeoffset;
874884
875885         /* determine which plane is the largest */
876886         start = 0;
877         for (plane = 0; plane < MAX_GFX_PLANES; plane++)
878            if (gfx->gfxlayout->planeoffset[plane] > start)
879               start = gfx->gfxlayout->planeoffset[plane];
880         start &= ~(gfx->gfxlayout->charincrement - 1);
887         for (plane = 0; plane < planes; plane++)
888            if (poffset[plane] > start)
889               start = poffset[plane];
890         start &= ~(charincrement - 1);
881891
882892         /* determine the total length based on this info */
883         len = gfx->gfxlayout->total * gfx->gfxlayout->charincrement;
893         len = total * charincrement;
884894
885895         /* do we have enough space in the region to cover the whole decode? */
886         avail = region_length[region] - (gfx->start & ~(gfx->gfxlayout->charincrement/8-1));
896         avail = region_length[region] - (gfx->start & ~(charincrement/8-1));
887897
888898         /* if not, this is an error */
889899         if ((start + len) / 8 > avail)
r1490r1491
892902            error = TRUE;
893903         }
894904      }
905      if (israw)
906      {
907         if (total != RGN_FRAC(1,1))
908         {
909            mame_printf_error("%s: %s has gfx[%d] with unsupported layout total\n", driver->source_file, driver->name, gfxnum);
910            error = TRUE;
911         }
912
913         if (xscale != 1 || yscale != 1)
914         {
915            mame_printf_error("%s: %s has gfx[%d] with unsupported xscale/yscale\n", driver->source_file, driver->name, gfxnum);
916            error = TRUE;
917         }
918      }
919      else
920      {
921         if (planes > MAX_GFX_PLANES)
922         {
923            mame_printf_error("%s: %s has gfx[%d] with invalid planes\n", driver->source_file, driver->name, gfxnum);
924            error = TRUE;
925         }
926
927         if (xscale * width > MAX_ABS_GFX_SIZE || yscale * height > MAX_ABS_GFX_SIZE)
928         {
929            mame_printf_error("%s: %s has gfx[%d] with invalid xscale/yscale\n", driver->source_file, driver->name, gfxnum);
930            error = TRUE;
931         }
932      }
895933   }
896934
897935   return error;
src/emu/emupal.h
r1490r1491
44
55    Emulator palette handling functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010    There are several levels of abstraction in the way MAME handles the palette,
src/emu/cheat.h
r1490r1491
44
55    Cheat system.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/emu/drivers/empty.c
r1490r1491
44
55    Empty driver.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010**************************************************************************/
src/emu/drivers/xtal.h
r1490r1491
44
55    Documentation and consistent naming for known existing crystals.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************
r1490r1491
4949   XTAL_3_6864MHz     = 3686400,      /* CPS3 */
5050   XTAL_4MHz          = 4000000,
5151   XTAL_4_224MHz      = 4224000,      /* Used to drive OKI M6295 chips, usually with /4 divider */
52   XTAL_4_433619MHz   = 4433619,      /* PAL subcarrier */
5253   XTAL_4_9152MHz      = 4915200,
5354   XTAL_6MHz          = 6000000,
5455   XTAL_7_3728MHz      = 7372800,
r1490r1491
6970   XTAL_15_468MHz     = 15468000,      /* Bank Panic h/w, Sega G80 */
7071   XTAL_16MHz         = 16000000,
7172   XTAL_16_9344MHz     = 16934400,      /* Usually used to drive 90's Yamaha OPL/FM chips */
73   XTAL_17_73447MHz   = 17734470,      /* 4 times the PAL subcarrier */
7274   XTAL_18MHz         = 18000000,
7375   XTAL_18_432MHz     = 18432000,
7476   XTAL_19_968MHz     = 19968000,      /* Used mostly by Space Invaders games by Taito/Midway and clones */
r1490r1491
8587   XTAL_27MHz         = 27000000,      /* Some Banpresto games macrossp and Irem M92 */
8688   XTAL_27_164MHz     = 27164000,      /* Typically used on 90's Taito PCBs to drive the custom chips */
8789   XTAL_28MHz         = 28000000,
88   XTAL_28_63636MHz     = 28636360,      /* later Leland games and Atari GT */
90   XTAL_28_37516MHz   = 28375160,      /* Amiga PAL systems */
91   XTAL_28_63636MHz     = 28636360,      /* later Leland games and Atari GT, Amiga NTSC */
8992   XTAL_30_4761MHz     = 30476100,      /* Taito JC */
9093   XTAL_32MHz         = 32000000,
9194   XTAL_32_22MHz        = 32220000,      /* Typically used on 90's Data East PCBs */
src/emu/romload.c
r1490r1491
44
55    ROM loading functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/lib/lib.mak
r1490r1491
44#
55#   MAME dependent library makefile
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
src/lib/util/palette.c
r1490r1491
44
55    Palette handling functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010******************************************************************************/
src/lib/util/harddisk.h
r1490r1491
44
55    Generic MAME hard disk implementation, with differencing files
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/chd.c
r1490r1491
22
33    MAME Compressed Hunks of Data file format
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/lib/util/options.h
r1490r1491
44
55    Core options code code
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/sha1.h
r1490r1491
55
66/* nettle, low-level cryptographics library
77 *
8 * Copyright (C) 2001 Niels Moeller
8 * Copyright 2001 Niels Moeller
99 *
1010 * The nettle library is free software; you can redistribute it and/or modify
1111 * it under the terms of the GNU Lesser General Public License as published by
src/lib/util/palette.h
r1490r1491
44
55    Core palette routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/chd.h
r1490r1491
22
33    MAME Compressed Hunks of Data file format
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/lib/util/cdrom.c
r1490r1491
22
33    Generic MAME CD-ROM utilties - build IDE and SCSI CD-ROMs on top of this
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88****************************************************************************
src/lib/util/aviio.c
r1490r1491
44
55    AVI movie format parsing helpers.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/cdrom.h
r1490r1491
44
55    Generic MAME cd-rom implementation
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/aviio.h
r1490r1491
44
55    AVI movie format parsing helpers.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/corestr.c
r1490r1491
44
55    Core string functions used throughout MAME.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************/
src/lib/util/png.c
r1490r1491
44
55    PNG reading functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010
src/lib/util/corestr.h
r1490r1491
44
55    Core string functions used throughout MAME.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/unicode.c
r1490r1491
44
55    Unicode related functions
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010*********************************************************************/
src/lib/util/coreutil.c
r1490r1491
44
55    Miscellaneous utility code
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************/
src/lib/util/png.h
r1490r1491
44
55    PNG file management.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/coreutil.h
r1490r1491
44
55    Miscellaneous utility code
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/unicode.h
r1490r1491
1111    functions that convert UTF-8 and UTF-16 char clusters to and from
1212    singular 32-bit Unicode chars.
1313
14    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
14    Copyright Nicola Salmoria and the MAME Team.
1515    Visit http://mamedev.org for licensing and usage restrictions.
1616
1717*********************************************************************/
src/lib/util/jedparse.c
r1490r1491
44
55    Parser for .JED files into raw fusemaps.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/lib/util/xmlfile.c
r1490r1491
44
55    XML file parsing code.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/jedparse.h
r1490r1491
44
55    Parser for .JED files into raw fusemaps.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/unzip.c
r1490r1491
44
55    Functions to manipulate data within ZIP files.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/xmlfile.h
r1490r1491
44
55    XML file parsing code.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/astring.c
r1490r1491
44
55    Allocated string manipulation functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************/
src/lib/util/pool.c
r1490r1491
44
55    Resource pool code
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/unzip.h
r1490r1491
44
55    ZIP file management.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/astring.h
r1490r1491
44
55    Allocated string manipulation functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/bitmap.c
r1490r1491
44
55    Core bitmap routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/pool.h
r1490r1491
44
55    Abstract object pool management
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/bitmap.h
r1490r1491
44
55    Core bitmap routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/huffman.c
r1490r1491
44
55    Video compression and decompression helpers.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/lib/util/avcomp.c
r1490r1491
1010
1111    Audio/video compression and decompression helpers.
1212
13    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
13    Copyright Nicola Salmoria and the MAME Team.
1414    Visit http://mamedev.org for licensing and usage restrictions.
1515
1616****************************************************************************
src/lib/util/corefile.c
r1490r1491
44
55    File access functions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/huffman.h
r1490r1491
44
55    Huffman compression routines.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/harddisk.c
r1490r1491
22
33    Generic MAME hard disk implementation, with differencing files
44
5    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
5    Copyright Nicola Salmoria and the MAME Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88***************************************************************************/
src/lib/util/avcomp.h
r1490r1491
44
55    Audio/video compression and decompression helpers.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/options.c
r1490r1491
44
55    Core options code code
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/sha1.c
r1490r1491
55
66/* nettle, low-level cryptographics library
77 *
8 * Copyright (C) 2001 Peter Gutmann, Andrew Kuchling, Niels Moeller
8 * Copyright 2001 Peter Gutmann, Andrew Kuchling, Niels Moeller
99 *
1010 * The nettle library is free software; you can redistribute it and/or modify
1111 * it under the terms of the GNU Lesser General Public License as published by
src/lib/util/corefile.h
r1490r1491
44
55    Core file I/O interface functions and definitions.
66
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
docs/messnew.txt
r1490r1491
3434
3535Source Changes:
3636----------------
37- The core is based on MAME 0.122u3.  This incorporates all features of the
37- The core is based on MAME 0.122u4.  This incorporates all features of the
3838  update to this core.  [MAME team]
3939
4040- Conditional logging and core callback cleanups.  [Atari Ace]
makefile
r1490r1491
44#
55#   Core makefile for building MAME and derivatives
66#
7#   Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
7#   Copyright (c) Nicola Salmoria and the MAME Team.
88#   Visit http://mamedev.org for licensing and usage restrictions.
99#
1010###########################################################################
r1490r1491
314314# and make all errors into warnings
315315ifneq ($(OPTIMIZE),0)
316316CFLAGS += -Werror $(ARCHOPTS) -fno-strict-aliasing
317#CFLAGS += $(ARCHOPTS) -fno-strict-aliasing
318317endif
319318
320319# if symbols are on, make sure we have frame pointers

Previous 15994 Revisions Next


© 1998-2018 The MESS Team