Previous 15994 Revisions Next

r4426 Friday 20th March, 2009 at 00:31:53 UTC by Nathan Woods
Updated to MAME 0.130u1 core
[ROOT]makefile
[docs]messnew.txt
[src/build]file2str.c png2bdc.c verinfo.c
[src/emu]audit.c cheat.c clifront.c config.c cpuexec.c debugger.c debugger.h devcb.c devintrf.c drawgfx.c driver.c eigccppc.h eigccx86.h emupal.c fileio.c hash.c info.c inptport.c inptport.h input.c input.h inputseq.c mame.c mamecore.h mconfig.c memory.c memory.h output.c render.c rendfont.c rendlay.c rendutil.c restrack.c romload.c sound.c state.c state.h streams.c tilemap.c timer.c uigfx.c uiinput.c uimenu.c validity.c video.c
[src/emu/cpu]cpu.mak drcbec.c drcbeut.c drcbex64.c drcbex86.c drccache.c drcfe.c drcuml.c drcuml.h vtlb.c x86log.c
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/alph8201]alph8201.c
[src/emu/cpu/apexc]apexc.c
[src/emu/cpu/arm]arm.c
[src/emu/cpu/arm7]arm7.c arm7core.c arm7exec.c
[src/emu/cpu/asap]asap.c
[src/emu/cpu/ccpu]ccpu.c
[src/emu/cpu/cdp1802]cdp1802.c cdp1802.h
[src/emu/cpu/cop400]cop400.c cop400.h
[src/emu/cpu/cp1610]cp1610.c
[src/emu/cpu/cubeqcpu]cubeqcpu.c
[src/emu/cpu/dsp32]dsp32.c
[src/emu/cpu/dsp56k]dsp56def.h dsp56k.c dsp56mem.c dsp56ops.c
[src/emu/cpu/e132xs]32xsdasm.c e132xs.c
[src/emu/cpu/esrip]esrip.c
[src/emu/cpu/f8]f8.c
[src/emu/cpu/g65816]g65816.c
[src/emu/cpu/h6280]h6280.c h6280ops.h
[src/emu/cpu/h83002]h8_16.c h8_8.c h8ops.h h8priv.h
[src/emu/cpu/hd6309]hd6309.c
[src/emu/cpu/i386]i386.c i386priv.h
[src/emu/cpu/i8085]i8085.c
[src/emu/cpu/i86]i286.c i86.c
[src/emu/cpu/i860]i860.c i860.h i860dec.c
[src/emu/cpu/i960]i960.c
[src/emu/cpu/jaguar]jaguar.c
[src/emu/cpu/konami]konami.c
[src/emu/cpu/lh5801]lh5801.c
[src/emu/cpu/lr35902]lr35902.c
[src/emu/cpu/m37710]m37710.c m37710cm.h
[src/emu/cpu/m6502]6502dasm.c m4510.c m6502.c m6509.c m65ce02.c
[src/emu/cpu/m6800]6800dasm.c m6800.c
[src/emu/cpu/m68000]m68kcpu.c m68kcpu.h m68kmake.c
[src/emu/cpu/m6805]m6805.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/mcs48]mcs48.c
[src/emu/cpu/mcs51]mcs51.c
[src/emu/cpu/mips]mips3.h mips3com.c mips3com.h mips3drc.c mips3fe.c psx.c r3000.c
[src/emu/cpu/nec]nec.c
[src/emu/cpu/pdp1]pdp1.c tx0.c
[src/emu/cpu/pic16c5x]pic16c5x.c
[src/emu/cpu/powerpc]ppccom.c ppcdrc.c ppcfe.c
[src/emu/cpu/rsp]rsp.c
[src/emu/cpu/s2650]s2650.c
[src/emu/cpu/saturn]saturn.c
[src/emu/cpu/sc61860]sc61860.c
[src/emu/cpu/se3208]se3208.c
[src/emu/cpu/sh2]sh2comn.c sh2drc.c
[src/emu/cpu/sh4]sh4.c sh4comn.c
[src/emu/cpu/sharc]sharc.c
[src/emu/cpu/sm8500]sm8500.c
[src/emu/cpu/spc700]spc700.c
[src/emu/cpu/ssp1601]ssp1601.c
[src/emu/cpu/t11]t11.c
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms32010]tms32010.c
[src/emu/cpu/tms32025]tms32025.c
[src/emu/cpu/tms32031]32031ops.c tms32031.c
[src/emu/cpu/tms32051]tms32051.c
[src/emu/cpu/tms34010]34010gfx.c tms34010.c
[src/emu/cpu/tms57002]tms57002.c tmsmake.c
[src/emu/cpu/tms7000]tms7000.c
[src/emu/cpu/tms9900]99xxcore.h
[src/emu/cpu/upd7810]7810dasm.c upd7810.c
[src/emu/cpu/v30mz]v30mz.c
[src/emu/cpu/v60]v60.c
[src/emu/cpu/v810]v810.c
[src/emu/cpu/z180]z180.c z180ops.h
[src/emu/cpu/z80]z80.c z80daisy.c
[src/emu/cpu/z8000]z8000.c
[src/emu/debug]debugcmd.c debugcon.c debugcpu.c debugvw.c express.c textbuf.c
[src/emu/machine]6522via.c 6526cia.c 6532riot.c 6840ptm.c 6850acia.c 6850acia.h 68681.c 74123.c 8237dma.c 8255ppi.c 8257dma.c at28c16.c cdp1852.c cdp1852.h cr589.c f3853.c generic.c generic.h i2cmem.c idectrl.c idectrl.h intelfsh.c intelfsh.h latch8.c latch8.h ldcore.c ldcore.h ldpr8210.c ldv1000.c ldvp931.c mc146818.c pci.c pic8259.c pit8253.c scsicd.c scsidev.c scsihd.c smc91c9x.c timekpr.c wd33c93.c x2212.c x76f041.c x76f100.c z80ctc.c z80dma.c z80pio.c z80sio.c
[src/emu/sound]2151intf.c 2203intf.c 2413intf.c 2608intf.c 2610intf.c 2612intf.c 262intf.c 3526intf.c 3812intf.c 5110intf.c 5220intf.c 8950intf.c aica.c astrocde.c ay8910.c bsmt2000.c c140.c c352.c c6280.c cdda.c cdp1869.c cdp1869.h cem3394.c dac.c dac.h digitalk.c disc_dev.c disc_flt.c disc_inp.c disc_mth.c disc_wav.c discrete.c dmadac.c es5503.c es5506.c es8712.c filter.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 nes_apu.c nile.c okim6258.c okim6295.c okim6376.c pokey.c psx.c qsound.c rf5c400.c rf5c68.c s14001a.c saa1099.c samples.c scsp.c segapcm.c sid6581.c sn76477.c sn76496.c snkwave.c sp0250.c sp0256.c st0016.c tiaintf.c tiasound.c tms3615.c tms36xx.c tms5110.c tms5220.c upd7759.c vlm5030.c vrender0.c wavwrite.c x1_010.c ym2151.c ym2413.c ymf262.c ymf271.c ymf278b.c ymz280b.c
[src/emu/video]mc6845.c poly.c resnet.c s2636.c tms34061.c v9938.c vector.c voodoo.c
[src/ldplayer]ldplayer.mak
[src/lib/util]cdrom.c cdrom.h chd.c chd.h corefile.c corefile.h
[src/mame]mame.mak mamedriv.c
[src/mame/audio]namco54.c qix.c
[src/mame/drivers]aleck64.c ampoker2.c btime.c calchase.c* caswin.c chsuper.c* cischeat.c cntsteer.c cojag.c comebaby.c cps3.c cubeqst.c cubocd32.c cultures.c deco_mlc.c djmain.c firebeat.c firefox.c galaxia.c galaxian.c gamecstl.c gottlieb.c gyruss.c hng64.c hvyunit.c igspoker.c jpmimpct.c kinst.c konamigq.c konamigv.c konamim2.c ksys573.c mediagx.c meritm.c midvunit.c mil4000.c mlanding.c multfish.c namconb1.c namcos10.c namcos11.c namcos12.c namcos2.c namcos21.c namcos22.c naomi.c neodrvr.c neogeo.c pcat_nit.c* pgm.c psattack.c pzletime.c qdrmfgp.c queen.c seattle.c segas16a.c segas16b.c sfbonus.c stv.c suprgolf.c taitogn.c* taitotz.c tokyocop.c* tx1.c vamphalf.c vegas.c viper.c zn.c
[src/mame/includes]cidelsa.h pgm.h tx1.h
[src/mame/layout]pirpok2.lay*
[src/mame/machine]decocass.c gdcrypt.c naomibd.c neocrypt.c pgmcrypt.c qix.c tx1.c
[src/mame/video]equites.c m57.c pgm.c psx.c retofinv.c toaplan2.c tx1.c wc90b.c
[src/mess]mess.mak
[src/mess/machine]68901mfp.h bebox.c
[src/osd]osdcomm.h
[src/osd/windows]windows.mak
[src/tools]chdman.c regrep.c src2html.c

src/build/png2bdc.c
r4425r4426
128128         numchars++;
129129
130130   /* allocate an array to hold the character data */
131   chartable = malloc(numchars * CACHED_CHAR_SIZE);
131   chartable = (UINT8 *)malloc(numchars * CACHED_CHAR_SIZE);
132132
133133   /* allocate a temp buffer to compress into */
134   tempbuffer = malloc(65536);
134   tempbuffer = (UINT8 *)malloc(65536);
135135   if (chartable == NULL || tempbuffer == NULL)
136136      goto error;
137137
r4425r4426
405405    bdcname = argv[argc - 1];
406406
407407   /* allocate a font */
408   font = malloc(sizeof(*font));
408   font = (render_font *)malloc(sizeof(*font));
409409   if (font == NULL)
410410      return 1;
411411   memset(font, 0, sizeof(*font));
src/build/verinfo.c
r4425r4426
233233   fseek(f, 0, SEEK_SET);
234234
235235   // allocate a buffer
236   buffer = malloc(size + 1);
236   buffer = (char *)malloc(size + 1);
237237   if (buffer == NULL)
238238   {
239239      fclose(f);
src/build/file2str.c
r4425r4426
5959   fseek(src, 0, SEEK_SET);
6060
6161   /* allocate memory */
62   buffer = malloc(bytes + 1);
62   buffer = (unsigned char *)malloc(bytes + 1);
6363   if (buffer == NULL)
6464   {
6565      fprintf(stderr, "Out of memory allocating %d byte buffer\n", bytes);
src/mame/audio/qix.c
r4425r4426
101101
102102static TIMER_CALLBACK( deferred_sndpia1_porta_w )
103103{
104   const device_config *device = ptr;
104   const device_config *device = (const device_config *)ptr;
105105   pia6821_porta_w(device, 0, param);
106106}
107107
src/mame/audio/namco54.c
r4425r4426
109109
110110static TIMER_CALLBACK( namco_54xx_irq_clear )
111111{
112   const device_config *device = ptr;
112   const device_config *device = (const device_config *)ptr;
113113   cpu_set_input_line(device, 0, CLEAR_LINE);
114114}
115115
src/mame/machine/pgmcrypt.c
r4425r4426
552552   }
553553}
554554
555static const UINT8 kov2p_tab[256] = {
556 0x44, 0x47, 0xb8, 0x28, 0x03, 0xa2, 0x21, 0xbc, 0x17, 0x32, 0x4e, 0xe2, 0xdf, 0x69, 0x35, 0xc7,
557 0xa2, 0x06, 0xec, 0x36, 0xd2, 0x44, 0x12, 0x6a, 0x8d, 0x51, 0x6b, 0x20, 0x69, 0x01, 0xca, 0xf0,
558 0x71, 0xc4, 0x34, 0xdc, 0x6b, 0xd6, 0x42, 0x2a, 0x5d, 0xb5, 0xc7, 0x6f, 0x4f, 0xd8, 0xb3, 0xed,
559 0x51, 0x9e, 0x37, 0x1e, 0xc0, 0x85, 0x2a, 0x91, 0xc6, 0x9c, 0xac, 0xf5, 0x20, 0x3b, 0x09, 0x74,
560 0x24, 0xf1, 0xe0, 0x42, 0x02, 0xbe, 0x84, 0x75, 0x4a, 0x82, 0xa2, 0x17, 0xae, 0xb6, 0x24, 0x79,
561 0x0a, 0x5a, 0x56, 0xcb, 0xa1, 0x2e, 0x47, 0xea, 0xa9, 0x25, 0x73, 0x79, 0x0b, 0x17, 0x9e, 0x33,
562 0x64, 0xb6, 0x03, 0x7f, 0x4f, 0xc3, 0xae, 0x45, 0xe6, 0x82, 0x27, 0x01, 0x86, 0x6b, 0x50, 0x16,
563 0xd3, 0x22, 0x90, 0x64, 0xfc, 0xa9, 0x31, 0x1c, 0x41, 0xd5, 0x07, 0xd3, 0xb2, 0xfe, 0x53, 0xd6,
564 0x39, 0xfb, 0xe6, 0xbe, 0xda, 0x4d, 0x8a, 0x44, 0x3a, 0x9b, 0x9d, 0x56, 0x5e, 0x5f, 0xff, 0x6a,
565 0xb6, 0xde, 0x2f, 0x12, 0x5a, 0x5d, 0xb0, 0xd0, 0x93, 0x92, 0xb2, 0x2c, 0x9d, 0x59, 0xee, 0x05,
566 0xab, 0xa8, 0xd2, 0x25, 0x2c, 0xc5, 0xde, 0x18, 0x4d, 0xb6, 0x4e, 0x3d, 0xbf, 0xfa, 0xf9, 0x1d,
567 0xba, 0x76, 0x79, 0xfc, 0x42, 0xb2, 0x8c, 0xae, 0xa9, 0x45, 0xba, 0xac, 0x55, 0x8e, 0x38, 0x67,
568 0xc3, 0xa5, 0x0d, 0xdc, 0xcc, 0x91, 0x73, 0x69, 0x27, 0xbc, 0x80, 0xdf, 0x30, 0xa4, 0x05, 0xd8,
569 0xe7, 0xd2, 0xb7, 0x4b, 0x3c, 0x10, 0x8c, 0x5d, 0x8a, 0xd7, 0x68, 0x7a, 0x61, 0x07, 0xf9, 0xa5,
570 0x88, 0xda, 0xdf, 0x0c, 0x42, 0x1b, 0x11, 0xe0, 0xd1, 0x93, 0x7c, 0x63, 0x39, 0xc5, 0xed, 0x43,
571 0x46, 0xdb, 0x30, 0x26, 0xd0, 0xdf, 0x7a, 0x86, 0x3e, 0x2e, 0x04, 0xbf, 0x49, 0x2a, 0xf9, 0x66,
572};
573
574void pgm_kov2p_decrypt(running_machine *machine)
575{
576   int i;
577   UINT16 *src = (UINT16 *)(memory_region(machine, "user1"));
578
579   int rom_size = 0x200000;
580
581   for(i=0; i<rom_size/2; i++) {
582       UINT16 x = src[i];
583
584       if((i & 0x40080) != 0x00080)
585         x ^= 0x0001;
586
587       if((i & 0x04008) == 0x04008)
588         x ^= 0x0002;
589
590       if((i & 0x80030) == 0x80010)
591         x ^= 0x0004;
592
593       if((i & 0x00242) != 0x00042)
594         x ^= 0x0008;
595
596       if((i & 0x08100) == 0x08000)
597         x ^= 0x0010;
598
599       if((i & 0x02004) != 0x00004)
600         x ^= 0x0020;
601
602       if((i & 0x11800) != 0x10000)
603         x ^= 0x0040;
604
605       if((i & 0x00820) == 0x00820)
606         x ^= 0x0080;
607
608       x ^= kov2p_tab[(i >> 1) & 0xff] << 8;
609
610       src[i] = x;
611   }
612}
613
555614static const UINT8 puzzli2_tab[256] = {
556615  0xb7, 0x66, 0xa3, 0xc0, 0x51, 0x55, 0x6d, 0x63, 0x86, 0x60, 0x64, 0x6c, 0x67, 0x18, 0x0b, 0x05,
557616  0x62, 0xff, 0xe0, 0x1e, 0x30, 0x21, 0x2e, 0x40, 0x41, 0xb9, 0x60, 0x38, 0xd1, 0x24, 0x7e, 0x36,
src/mame/machine/decocass.c
r4425r4426
19611961
19621962static TIMER_CALLBACK( tape_clock_callback )
19631963{
1964   const device_config *device = ptr;
1964   const device_config *device = (const device_config *)ptr;
19651965   tape_state *tape = get_safe_token(device);
19661966
19671967   /* advance by one clock in the desired direction */
src/mame/machine/qix.c
r4425r4426
471471
472472static TIMER_CALLBACK( pia_w_callback )
473473{
474   const device_config *device = ptr;
474   const device_config *device = (const device_config *)ptr;
475475   pia6821_w(device, param >> 8, param & 0xff);
476476}
477477
src/mame/machine/neocrypt.c
r4425r4426
1515      Also contains 'S' (Text Layer) data on these games
1616      M1 (Z80) rom is also encrypted for CMC50
1717
18     the M1 roms contain some additional data at 0xf800.  Some of this
18     The M1 roms contain some additional data at 0xf800.  Some of this
1919     is said to be related to the C rom encryption.
20     If CMC50 is used, data located at 0xff00 - 0xffff is required for
21     m1 encryption checksum?.
2022
2123      Later games use additional basic scrambling on top of the standard
2224      CMC scramble.
r4425r4426
14091411}
14101412
14111413
1414// Thanks to IQ_132 for the info
14121415void kof2003h_decrypt_68k(running_machine *machine)
14131416{
14141417   static const UINT8 xor1[0x20] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 };
src/mame/machine/naomibd.c
r4425r4426
5959 *
6060 *************************************/
6161
62extern void naomi_game_decrypt(UINT64 key, UINT8* region, int length);
62extern void naomi_game_decrypt(running_machine* machine, UINT64 key, UINT8* region, int length);
6363
6464
6565/*************************************
r4425r4426
320320 *
321321 *************************************/
322322
323static void load_rom_gdrom(naomibd_state *v)
323static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
324324{
325325   UINT32 result;
326326   cdrom_file *gdromfile;
r4425r4426
473473   printf("key is %08x%08x\n", (UINT32)((key & 0xffffffff00000000ULL)>>32), (UINT32)(key & 0x00000000ffffffffULL));
474474
475475   // decrypt loaded data
476   naomi_game_decrypt(key, v->memory, size);
476   naomi_game_decrypt(machine, key, v->memory, size);
477477   cdrom_close(gdromfile);
478478}
479479
r4425r4426
515515         v->memory = (UINT8 *)memory_region(device->machine, config->regiontag);
516516         v->gdromchd = get_disk_handle(config->gdromregiontag);
517517         v->picdata = (UINT8 *)memory_region(device->machine, config->picregiontag);
518         load_rom_gdrom(v);
518         load_rom_gdrom(device->machine, v);
519519         break;
520520
521521      default:
src/mame/machine/tx1.c
r4425r4426
33    Tatsumi TX-1/Buggy Boy machine hardware
44
55***************************************************************************/
6
67#include "driver.h"
78#include "debugger.h"
8#include "machine/8255ppi.h"
99#include "tx1.h"
1010
11/*
12    6845 cursor output is connected to the main CPU interrupt pin.
13    The CRTC is programmed to provide a rudimentary VBLANK interrupt.
1411
15    TODO: Calc TX-1 values...
16*/
17#define CURSOR_YPOS 239
18#define CURSOR_XPOS 168
19
20
2112/*
2213    Globals
2314*/
24static UINT16 *prom;
25static emu_timer *interrupt_timer;
2615
2716static struct
2817{
r4425r4426
5847}
5948
6049
61
6250/*
63    TODO: Check interrupt timing from CRT config. Probably different between games.
64*/
65static TIMER_CALLBACK( interrupt_callback )
66{
67   cpu_set_input_line_and_vector(machine->cpu[0], 0, HOLD_LINE, 0xff);
68   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
69}
70
71/*
7251    SN74S516 16x16 Multiplier/Divider
7352*/
7453static struct
r4425r4426
192171   INT32 Z = 0;
193172   INT32 W = 0;
194173
195   if ( SN74S516.X == 0 )
174   if (SN74S516.X == 0)
196175   {
197176      mame_printf_debug("%s:SN74S516 tried to divide by zero\n", cpuexec_describe_context(machine));
198177      SN74S516.ZW.Z = 0xffff;
r4425r4426
201180      return;
202181   }
203182
204   switch ( SN74S516.code )
183   switch (SN74S516.code)
205184   {
206185      case 4:
207186      {
r4425r4426
228207   }
229208
230209   /* Divide overflow Only happens during chip test anyway */
231   if ( Z > 0xffff )
210   if (Z > 0xffff)
232211      Z |= 0xff00;
233212
234213   SN74S516.ZW.Z = Z;
r4425r4426
240219{
241220   SN74S516.state = state_table[SN74S516.state][ins];
242221
243   if ( SN74S516.state == 4 )
222   if (SN74S516.state == 4)
244223   {
245224      sn_multiply();
246225      SN74S516.state = 8;
247226   }
248   else if ( SN74S516.state == 5 )
227   else if (SN74S516.state == 5)
249228   {
250229      sn_divide(machine);
251230      SN74S516.state = 10;
r4425r4426
460439
461440   addr = ((math.inslatch & 0x1c00) << 1) | (math.ppshift & 0xff);
462441
463   if ( (math.inslatch >> 8) & TX1_RADCHG )
464   {
442   if ((math.inslatch >> 8) & TX1_RADCHG)
465443      addr |= (math.ppshift & 0x0700);
466   }
467444   else
468   {
469445      addr |= (math.promaddr << 3) & 0x0700;
470   }
471446
472447   return addr & 0x3fff;
473448}
r4425r4426
478453#define LLOEN(a)   !(a & 0x40)
479454#define GO_EN(a)   !(a & 0x4000)
480455
456   const UINT16 *prom = (UINT16*)memory_region(machine, "au_data") + (0x8000 >> 1);
457
481458   for (;;)
482459   {
483460      int go = 0;
484461
485      if ( !GO_EN(math.inslatch) && GO_EN(prom[math.promaddr]) )
486      {
462      if (!GO_EN(math.inslatch) && GO_EN(prom[math.promaddr]))
487463         go = 1;
488      }
489464      /*
490465            Example:
491466            120 /GO /LHIEN
492467            121 /GO        /LLOEN
493468            Both 120 and 121 are used.
494469        */
495      else if ( (GO_EN(math.inslatch) && GO_EN(prom[math.promaddr])) && (LHIEN(math.inslatch) && LLOEN(prom[math.promaddr])) )
496      {
470      else if ((GO_EN(math.inslatch) && GO_EN(prom[math.promaddr])) && (LHIEN(math.inslatch) && LLOEN(prom[math.promaddr])))
497471         go = 1;
498      }
499472
500473      /* Now update the latch */
501474      math.inslatch = prom[math.promaddr] & 0x7fff;
502475      math.mux = (math.inslatch >> 3) & 7;
503476
504      if ( math.mux == TX1_SEL_INSCL )
477      if (math.mux == TX1_SEL_INSCL)
505478      {
506         math.i0ff = 0;
479         math.i0ff = 0;
507480      }
508      else if ( math.mux == TX1_SEL_PPSEN )
481      else if (math.mux == TX1_SEL_PPSEN)
509482      {
510483         // NOTE: Doesn't do anything without SPCS.
511484      }
512485
513486      /* TODO */
514      if ( go )
487      if (go)
515488      {
516489         int ins = math.inslatch & 7;
517490
518491         TX1_SET_INS0_BIT;
519492
520         if ( math.mux == TX1_SEL_DSELOE )
493         if (math.mux == TX1_SEL_DSELOE)
521494         {
522495            int      dsel = (math.inslatch >> 8) & TX1_DSEL;
523496            int      tfad = (math.inslatch & 0x1c00) << 1;
r4425r4426
534507
535508            dsel = (dsel & 2) | ((dsel & o4) ^ 1);
536509
537            if ( dsel == 0 )
510            if (dsel == 0)
538511               data = math.muxlatch;
539            else if ( dsel == 1 )
512            else if (dsel == 1)
540513            {
541               UINT16 *romdata = (UINT16*)memory_region(machine, "user1");
514               UINT16 *romdata = (UINT16*)memory_region(machine, "au_data");
542515               UINT16 addr = get_tx1_datarom_addr();
543516               data = romdata[addr];
544517            }
545            else if ( dsel == 2 )
518            else if (dsel == 2)
546519               data = ROL16(math.muxlatch, 4);
547            else if ( dsel == 3 )
520            else if (dsel == 3)
548521               data = ROL16(SWAP16(math.muxlatch), 3);
549522
550523            kick_sn74s516(machine, &data, ins);
r4425r4426
559532                         !SD8.SD9./LMSEL + !SD7.SD8./LMSEL +
560533                         /LMSEL./DSEL1 + /LMSEL.TFAD13 + /LMSEL.TFAD12 + /LMSEL.TFAD11
561534            */
562         else if ( LHIEN(math.inslatch) || LLOEN(math.inslatch) )
535         else if (LHIEN(math.inslatch) || LLOEN(math.inslatch))
563536         {
564537            UINT16 data;
565538
566539            kick_sn74s516(machine, &data, ins);
567540
568541            /* All latches enabled */
569            if ( LHIEN(math.inslatch) && LLOEN(math.inslatch) )
542            if (LHIEN(math.inslatch) && LLOEN(math.inslatch))
570543            {
571544               math.muxlatch = data;
572545            }
573            else if ( math.mux == TX1_SEL_LMSEL ) // O4 = 0
546            else if (math.mux == TX1_SEL_LMSEL) // O4 = 0
574547            {
575548               // TMPLD2/TMPLD3 15-5
576               if ( LLOEN(math.inslatch) )
549               if (LLOEN(math.inslatch))
577550               {
578551                  math.muxlatch &= 0x001f;
579552                  math.muxlatch |= data & 0xffe0;
580553               }
581554               // TMLPD1 4-0???????
582               else if ( LHIEN(math.inslatch) )
555               else if (LHIEN(math.inslatch))
583556               {
584557                  math.muxlatch &= 0xffe0;
585558                  math.muxlatch |= data & 0x001f;
r4425r4426
591564                        /TMPLD1: /LHIEN
592565                        /TMPLD2: /LLOEN.!O4 + /LHIEN.O4
593566                        /TMPLD3: /LLOEN
594                             O4: !SD9.!SD10./LMSEL + SD7.SD10./LMSEL +
595                                 !SD8.SD9./LMSEL + !SD7.SD8./LMSEL +
596                                 /LMSEL./DSEL1 + /LMSEL.TFAD13 + /LMSEL.TFAD12 + /LMSEL.TFAD11
567                         O4: !SD9.!SD10./LMSEL + SD7.SD10./LMSEL +
568                             !SD8.SD9./LMSEL + !SD7.SD8./LMSEL +
569                             /LMSEL./DSEL1 + /LMSEL.TFAD13 + /LMSEL.TFAD12 + /LMSEL.TFAD11
597570                    */
598571               int      dsel = (math.inslatch >> 8) & TX1_DSEL;
599572               int      tfad = (math.inslatch & 0x1c00) << 1;
r4425r4426
607580                  (!BIT(sd, 7) &&  BIT(sd, 8)) ||
608581                  !BIT(dsel, 1) || BIT(tfad, 13) || BIT(tfad, 12) || BIT(tfad, 11);
609582
610               if ( LLOEN(math.inslatch) )
583               if (LLOEN(math.inslatch))
611584               {
612585                  math.muxlatch &= 0x0fff;
613586                  math.muxlatch |= data & 0xf000;
r4425r4426
619592                     math.muxlatch |= data & 0x0fe0;
620593                  }
621594               }
622               else if ( LHIEN(math.inslatch) )
595               else if (LHIEN(math.inslatch))
623596               {
624597                  math.muxlatch &= 0xffe0;
625598                  math.muxlatch |= data & 0x001f;
r4425r4426
635608         }
636609         else
637610         {
638            if ( math.mux == TX1_SEL_PPSEN )
611            if (math.mux == TX1_SEL_PPSEN)
639612            {
640613               kick_sn74s516(machine, &math.ppshift, ins);
641614            }
r4425r4426
649622      }
650623
651624      /* Is there another instruction in the sequence? */
652      if ( prom[math.promaddr] & 0x8000 )
625      if (prom[math.promaddr] & 0x8000)
653626         break;
654627      else
655628         INC_PROM_ADDR;
r4425r4426
661634   offset = offset << 1;
662635
663636   /* /MLPCS */
664   if ( offset < 0x400 )
637   if (offset < 0x400)
665638   {
666639      int ins;
667640
668      if ( offset & 0x200 )
641      if (offset & 0x200)
669642      {
670643         ins = math.inslatch & 7;
671644         TX1_SET_INS0_BIT;
r4425r4426
679652      kick_sn74s516(space->machine, &math.retval, ins);
680653   }
681654   /* /PPSEN */
682   else if ( offset < 0x800 )
655   else if (offset < 0x800)
683656   {
684657      // Unused - just pullups?
685658      math.retval = 0xffff;
686659   }
687660   /* /MUXCS */
688   else if ( (offset & 0xc00) == 0xc00 )
661   else if ((offset & 0xc00) == 0xc00)
689662   {
690663      int      dsel = (math.inslatch >> 8) & TX1_DSEL;
691664      int      tfad = (math.inslatch & 0x1c00) << 1;
692665      int      sd   = math.ppshift;
693666      int      o4;
694667
695      if ( math.mux == TX1_SEL_LMSEL )
668      if (math.mux == TX1_SEL_LMSEL)
696669         o4 = 0;
697670      else
698671      {
r4425r4426
706679
707680      dsel = (dsel & 2) | ((dsel & o4) ^ 1);
708681
709      if ( dsel == 0 )
682      if (dsel == 0)
710683         math.retval = math.muxlatch;
711      else if ( dsel == 1 )
684      else if (dsel == 1 )
712685      {
713686         /*
714687                TODO make this constant somewhere
715688                e.g. math.retval =  math.romptr[ get_tx1_datarom_addr() ];
716689            */
717         UINT16 *romdata = (UINT16*)memory_region(space->machine, "user1");
690         UINT16 *romdata = (UINT16*)memory_region(space->machine, "au_data");
718691         UINT16 addr = get_tx1_datarom_addr();
719692         math.retval = romdata[addr];
720693      }
721      else if ( dsel == 2 )
694      else if (dsel == 2)
722695         math.retval = ROL16(math.muxlatch, 4);
723      else if ( dsel == 3 )
696      else if (dsel == 3)
724697         math.retval = ROL16(SWAP16(math.muxlatch), 3);
725698
726699      /* TODO for TX-1: This is /SPCS region? */
727      if ( offset < 0xe00 )
700      if (offset < 0xe00)
728701      {
729702         // Load the PP with retval??????
730         if ( math.mux == TX1_SEL_PPSEN )
703         if (math.mux == TX1_SEL_PPSEN)
731704         {
732705            math.ppshift = math.retval & 0x3fff;
733706         }
734         else if ( math.mux == TX1_SEL_PSSEN )
707         else if (math.mux == TX1_SEL_PSSEN)
735708         {
736709            // WRONG!!!!
737710            mame_printf_debug("Math Read with PSSEN!\n");
738711            math.ppshift = math.retval;
739712         }
740713
741         if ( math.mux != TX1_SEL_ILDEN )
714         if (math.mux != TX1_SEL_ILDEN)
742715         {
743716            INC_PROM_ADDR;
744717            tx1_update_state(space->machine);
r4425r4426
750723   }
751724   else
752725   {
753      if ( math.mux == TX1_SEL_PPSEN )
726      if (math.mux == TX1_SEL_PPSEN)
754727         math.retval = math.ppshift & 0x3fff;
755728      else
756729         /* Nothing is mapped - read from pull up resistors! */
757730         math.retval = 0xffff;
758731   }
759732
760   if ( offset & TX1_INSLD )
733   if (offset & TX1_INSLD)
761734   {
762       math.promaddr = (offset << 2) & 0x1ff;
735      math.promaddr = (offset << 2) & 0x1ff;
763736      tx1_update_state(space->machine);
764737   }
765   else if ( offset & TX1_CNTST )
738   else if (offset & TX1_CNTST)
766739   {
767       INC_PROM_ADDR;
740      INC_PROM_ADDR;
768741      tx1_update_state(space->machine);
769742   }
770743
r4425r4426
779752//  printf("W %x: %x\n", 0x3000 + offset, data);
780753
781754   /* /MLPCS */
782   if ( offset < 0x400 )
755   if (offset < 0x400)
783756   {
784757      int ins;
785758
786      if ( offset & 0x200 )
759      if (offset & 0x200)
787760      {
788761         ins = math.inslatch & 7;
789762         TX1_SET_INS0_BIT;
r4425r4426
796769      kick_sn74s516(space->machine, &math.cpulatch, ins);
797770   }
798771   /* /PPSEN */
799   else if ( (offset & 0xc00) == 0x400 )
772   else if ((offset & 0xc00) == 0x400)
800773   {
801774      /* Input is 14 bits */
802775      math.ppshift = math.cpulatch & 0x3fff;
803776   }
804777   /* /PSSEN */
805   else if ( (offset & 0xc00) == 0x800 )
778   else if ((offset & 0xc00) == 0x800)
806779   {
807      //if ( ((math.inslatch >> 8) & TX1_DSEL) == 3 )
780      //if (((math.inslatch >> 8) & TX1_DSEL) == 3 )
808781      {
809782         int shift;
810783         UINT16 val = math.ppshift;
811784
812         if ( math.cpulatch & 0x3800 )
785         if (math.cpulatch & 0x3800)
813786         {
814787            shift = (math.cpulatch >> 11) & 0x7;
815788
r4425r4426
835808      }
836809   }
837810   /* /MUXCS */
838   else if ( (offset & 0xc00) == 0xc00 )
811   else if ((offset & 0xc00) == 0xc00)
839812   {
840813
841814      /*
r4425r4426
846819      math.muxlatch = math.cpulatch;
847820   }
848821
849   if ( offset & TX1_INSLD )
822   if (offset & TX1_INSLD)
850823   {
851       math.promaddr = (offset << 2) & 0x1ff;
824      math.promaddr = (offset << 2) & 0x1ff;
852825      tx1_update_state(space->machine);
853826   }
854   else if ( offset & TX1_CNTST )
827   else if (offset & TX1_CNTST)
855828   {
856       INC_PROM_ADDR;
829      INC_PROM_ADDR;
857830      tx1_update_state(space->machine);
858831   }
859832}
860833
861834READ16_HANDLER( tx1_spcs_rom_r )
862835{
863   math.cpulatch = *(UINT16*)((UINT8*)memory_region(space->machine, "math") + 0xfc000 + 0x1000 + offset*2);
836   math.cpulatch = *(UINT16*)((UINT8*)memory_region(space->machine, "math_cpu") + 0xfc000 + 0x1000 + offset*2);
864837
865   if ( math.mux == TX1_SEL_ILDEN )
838   if (math.mux == TX1_SEL_ILDEN)
866839   {
867840      math.i0ff = math.cpulatch & (1 << 14) ? 1 : 0;
868841   }
869   else if ( math.mux == TX1_SEL_MULEN )
842   else if (math.mux == TX1_SEL_MULEN)
870843   {
871844      int ins = math.inslatch & 7;
872845
873846      TX1_SET_INS0_BIT;
874847      kick_sn74s516(space->machine, &math.cpulatch, ins);
875848   }
876   else if ( math.mux == TX1_SEL_PPSEN )
849   else if (math.mux == TX1_SEL_PPSEN)
877850   {
878851      math.ppshift = math.cpulatch;
879852   }
880   else if ( math.mux == TX1_SEL_PSSEN )
853   else if (math.mux == TX1_SEL_PSSEN)
881854   {
882855         //if ( ((math.inslatch >> 8) & TX1_DSEL) == 3 )
883856      {
884857         int shift;
885858         UINT16 val = math.ppshift;
886859
887         if ( math.cpulatch & 0x3800 )
860         if (math.cpulatch & 0x3800)
888861         {
889862            shift = (math.cpulatch >> 11) & 0x7;
890863
r4425r4426
910883      }
911884   }
912885
913   if ( math.mux != TX1_SEL_ILDEN )
886   if (math.mux != TX1_SEL_ILDEN)
914887   {
915       INC_PROM_ADDR;
888      INC_PROM_ADDR;
916889      tx1_update_state(space->machine);
917890   }
918891
r4425r4426
926899
927900   offset <<= 1;
928901
929   if ( math.mux == TX1_SEL_ILDEN )
902   if (math.mux == TX1_SEL_ILDEN)
930903   {
931904      math.i0ff = math.cpulatch & (1 << 14) ? 1 : 0;
932905   }
933   else if ( math.mux == TX1_SEL_MULEN )
906   else if (math.mux == TX1_SEL_MULEN)
934907   {
935908      int ins = math.inslatch & 7;
936909
937910      TX1_SET_INS0_BIT;
938911      kick_sn74s516(space->machine, &math.cpulatch, ins);
939912   }
940   else if ( math.mux == TX1_SEL_PPSEN )
913   else if (math.mux == TX1_SEL_PPSEN)
941914   {
942915//      math.ppshift = math.retval & 0x3fff;
943916      math.ppshift = math.cpulatch;
944917   }
945   else if ( math.mux == TX1_SEL_PSSEN )
918   else if (math.mux == TX1_SEL_PSSEN)
946919   {
947920      int shift;
948921      UINT16 val = math.ppshift;
949922
950      if ( math.cpulatch & 0x3800 )
923      if (math.cpulatch & 0x3800)
951924      {
952925         shift = (math.cpulatch >> 11) & 0x7;
953926
r4425r4426
972945      math.ppshift = val & 0x7ff;
973946   }
974947
975   if ( math.mux != TX1_SEL_ILDEN )
948   if (math.mux != TX1_SEL_ILDEN)
976949   {
977       INC_PROM_ADDR;
950      INC_PROM_ADDR;
978951      tx1_update_state(space->machine);
979952   }
980953
r4425r4426
1019992
1020993   addr = ((math.inslatch & 0x1c00) << 1) | (math.ppshift & 0xff);
1021994
1022   if ( (math.inslatch >> 8) & BB_RADCHG )
995   if ((math.inslatch >> 8) & BB_RADCHG)
1023996   {
1024997      addr |= (math.ppshift & 0x0700);
1025998   }
r4425r4426
10371010#define LLOEN(a)   !(a & 0x40)
10381011#define GO_EN(a)   !(a & 0x4000)
10391012
1013   const UINT16 *prom = (UINT16*)memory_region(machine, "au_data") + (0x8000 >> 1);
1014
10401015   for (;;)
10411016   {
10421017      int go = 0;
10431018
1044      if ( !GO_EN(math.inslatch) && GO_EN(prom[math.promaddr]) )
1019      if (!GO_EN(math.inslatch) && GO_EN(prom[math.promaddr]))
10451020         go = 1;
1046      else if ( (GO_EN(math.inslatch) && GO_EN(prom[math.promaddr])) && (LHIEN(math.inslatch) && LLOEN(prom[math.promaddr])) )
1021      else if ((GO_EN(math.inslatch) && GO_EN(prom[math.promaddr])) && (LHIEN(math.inslatch) && LLOEN(prom[math.promaddr])))
10471022         go = 1;
10481023
10491024      /* Now update the latch */
10501025      math.inslatch = prom[math.promaddr] & 0x7fff;
10511026      math.mux = (math.inslatch >> 3) & 7;
10521027
1053      if ( math.mux == BB_MUX_INSCL )
1054         math.i0ff = 0;
1055      else if ( math.mux == BB_MUX_PPSEN )
1028      if (math.mux == BB_MUX_INSCL)
1029         math.i0ff = 0;
1030      else if (math.mux == BB_MUX_PPSEN)
10561031      {
10571032         // TODO: Needed?
10581033         //mame_printf_debug("/PPSEN with INS: %x\n", math.promaddr);
r4425r4426
10661041
10671042         BB_SET_INS0_BIT;
10681043
1069         if ( math.mux == BB_MUX_DPROE )
1044         if (math.mux == BB_MUX_DPROE)
10701045         {
1071            UINT16 *romdata = (UINT16*)memory_region(machine, "user1");
1046            UINT16 *romdata = (UINT16*)memory_region(machine, "au_data");
10721047            UINT16 addr = get_bb_datarom_addr();
10731048            kick_sn74s516(machine, &romdata[addr], ins);
10741049         }
1075         else if ( math.mux == BB_MUX_PPOE )
1050         else if (math.mux == BB_MUX_PPOE)
10761051         {
10771052            kick_sn74s516(machine, &math.ppshift, ins);
10781053         }
10791054         /* This is quite tricky. */
10801055         /* It can either be a read operation or */
10811056         /* What if /LHIEN and /LLOEN? */
1082         else if ( LHIEN(math.inslatch) || LLOEN(math.inslatch) )
1057         else if (LHIEN(math.inslatch) || LLOEN(math.inslatch))
10831058         {
10841059            UINT16 data;
10851060
10861061            kick_sn74s516(machine, &data, ins);
10871062
1088            if ( LHIEN(math.inslatch) && LLOEN(math.inslatch) )
1063            if (LHIEN(math.inslatch) && LLOEN(math.inslatch))
10891064            {
10901065               math.ppshift = data;
10911066            }
1092            else if ( math.mux == BB_MUX_LMSEL )
1067            else if (math.mux == BB_MUX_LMSEL)
10931068            {
1094               if ( LLOEN(math.inslatch) )
1069               if (LLOEN(math.inslatch))
10951070               {
10961071                  math.ppshift &= 0x000f;
10971072                  math.ppshift |= data & 0xfff0;
10981073               }
1099               else if ( LHIEN(math.inslatch) )
1074               else if (LHIEN(math.inslatch))
11001075               {
11011076                  math.ppshift &= 0xfff0;
11021077                  math.ppshift |= data & 0x000f;
r4425r4426
11041079            }
11051080            else
11061081            {
1107               if ( LLOEN(math.inslatch) )
1082               if (LLOEN(math.inslatch))
11081083               {
11091084                  math.ppshift &= 0x0fff;
11101085                  math.ppshift |= data & 0xf000;
11111086               }
1112               else if ( LHIEN(math.inslatch) )
1087               else if (LHIEN(math.inslatch))
11131088               {
11141089                  math.ppshift &= 0xf000;
11151090                  math.ppshift |= data & 0x0fff;
r4425r4426
11181093         }
11191094         else
11201095         {
1121            if ( math.mux == BB_MUX_PPSEN )
1096            if (math.mux == BB_MUX_PPSEN)
11221097            {
11231098               kick_sn74s516(machine, &math.ppshift, ins);
11241099            }
r4425r4426
11321107      }
11331108
11341109      /* Handle rotation */
1135      if ( ((math.inslatch >> 8) & BB_DSEL) == 1 )
1110      if (((math.inslatch >> 8) & BB_DSEL) == 1)
11361111      {
11371112         math.ppshift = ROR16(math.ppshift, 4);
11381113      }
1139      else if ( ((math.inslatch >> 8) & BB_DSEL) == 2 )
1114      else if (((math.inslatch >> 8) & BB_DSEL) == 2)
11401115      {
11411116         math.ppshift = ROL16(math.ppshift, 4);
11421117      }
11431118
11441119      /* Is there another instruction in the sequence? */
1145      if ( prom[math.promaddr] & 0x8000 )
1120      if (prom[math.promaddr] & 0x8000)
11461121         break;
11471122      else
11481123         INC_PROM_ADDR;
r4425r4426
11541129   offset = offset << 1;
11551130
11561131   /* /MLPCS */
1157   if ( offset < 0x400 )
1132   if (offset < 0x400)
11581133   {
11591134      int ins;
11601135
1161      if ( offset & 0x200 )
1136      if (offset & 0x200)
11621137      {
11631138         ins = math.inslatch & 7;
11641139         BB_SET_INS0_BIT;
r4425r4426
11761151      //  math.ppshift = math.retval;
11771152   }
11781153   /* /PPSEN */
1179   else if ( offset < 0x800 )
1154   else if (offset < 0x800)
11801155   {
11811156      math.retval = math.ppshift;
11821157   }
11831158   /* /DPROE */
1184   else if ( (offset & 0xc00) == 0xc00 )
1159   else if ((offset & 0xc00) == 0xc00)
11851160   {
1186      UINT16 *romdata = (UINT16*)memory_region(space->machine, "user1");
1161      UINT16 *romdata = (UINT16*)memory_region(space->machine, "au_data");
11871162      UINT16 addr = get_bb_datarom_addr();
11881163
11891164      math.retval = romdata[addr];
11901165
11911166      /* This is necessary */
1192      if ( math.mux == BB_MUX_PPSEN )
1167      if (math.mux == BB_MUX_PPSEN)
11931168         math.ppshift = romdata[addr];
11941169
11951170      /* This is /SPCS region? Necessary anyway */
1196      if ( offset < 0xe00 )
1171      if (offset < 0xe00)
11971172      {
1198         if ( math.mux != BB_MUX_ILDEN )
1173         if (math.mux != BB_MUX_ILDEN)
11991174         {
12001175            INC_PROM_ADDR;
12011176            buggyboy_update_state(space->machine);
r4425r4426
12041179   }
12051180   else
12061181   {
1207      if ( math.mux == BB_MUX_PPSEN )
1182      if (math.mux == BB_MUX_PPSEN)
12081183         math.retval = math.ppshift;
12091184      else
12101185         /* Nothing is mapped - read from pull up resistors! */
12111186         math.retval = 0xffff;
12121187   }
12131188
1214   if ( offset & BB_INSLD )
1189   if (offset & BB_INSLD)
12151190   {
1216       math.promaddr = (offset << 2) & 0x1ff;
1191      math.promaddr = (offset << 2) & 0x1ff;
12171192      buggyboy_update_state(space->machine);
12181193   }
1219   else if ( offset & BB_CNTST )
1194   else if (offset & BB_CNTST)
12201195   {
1221       INC_PROM_ADDR;
1196      INC_PROM_ADDR;
12221197      buggyboy_update_state(space->machine);
12231198   }
12241199
r4425r4426
12321207   offset <<= 1;
12331208
12341209   /* /MLPCS */
1235   if ( offset < 0x400 )
1210   if (offset < 0x400)
12361211   {
12371212      int ins;
12381213
1239      if ( offset & 0x200 )
1214      if (offset & 0x200)
12401215      {
12411216         ins = math.inslatch & 7;
12421217         BB_SET_INS0_BIT;
r4425r4426
12491224      kick_sn74s516(space->machine, &math.cpulatch, ins);
12501225   }
12511226   /* /PPSEN */
1252   else if ( (offset & 0xc00) == 0x400 )
1227   else if ((offset & 0xc00) == 0x400)
12531228   {
12541229      math.ppshift = math.cpulatch;
12551230   }
12561231   /* /PSSEN */
1257   else if ( (offset & 0xc00) == 0x800 )
1232   else if ((offset & 0xc00) == 0x800)
12581233   {
1259      if ( ((math.inslatch >> 8) & BB_DSEL) == 3 )
1234      if (((math.inslatch >> 8) & BB_DSEL) == 3)
12601235      {
12611236         int shift;
12621237         UINT16 val = math.ppshift;
12631238
1264         if ( math.cpulatch & 0x3800 )
1239         if (math.cpulatch & 0x3800)
12651240         {
12661241            shift = (math.cpulatch >> 11) & 0x7;
12671242
r4425r4426
12971272      debugger_break(space->machine);
12981273   }
12991274
1300   if ( offset & BB_INSLD )
1275   if (offset & BB_INSLD)
13011276   {
1302       math.promaddr = (offset << 2) & 0x1ff;
1277      math.promaddr = (offset << 2) & 0x1ff;
13031278      buggyboy_update_state(space->machine);
13041279   }
1305   else if ( offset & BB_CNTST )
1280   else if (offset & BB_CNTST)
13061281   {
1307       INC_PROM_ADDR;
1282      INC_PROM_ADDR;
13081283      buggyboy_update_state(space->machine);
13091284   }
13101285}
r4425r4426
13141289*/
13151290READ16_HANDLER( buggyboy_spcs_rom_r )
13161291{
1317   math.cpulatch = *(UINT16*)((UINT8*)memory_region(space->machine, "math") + 0xfc000 + 0x1000 + offset*2);
1292   math.cpulatch = *(UINT16*)((UINT8*)memory_region(space->machine, "math_cpu") + 0xfc000 + 0x1000 + offset*2);
13181293
1319   if ( math.mux == BB_MUX_ILDEN )
1294   if (math.mux == BB_MUX_ILDEN)
13201295   {
13211296      math.i0ff = math.cpulatch & (1 << 14) ? 1 : 0;
13221297   }
1323   else if ( math.mux == BB_MUX_MULEN )
1298   else if (math.mux == BB_MUX_MULEN)
13241299   {
13251300      int ins = math.inslatch & 7;
13261301
13271302      BB_SET_INS0_BIT;
13281303      kick_sn74s516(space->machine, &math.cpulatch, ins);
13291304   }
1330   else if ( math.mux == BB_MUX_PPSEN )
1305   else if (math.mux == BB_MUX_PPSEN)
13311306   {
13321307      math.ppshift = math.cpulatch;
13331308   }
1334   else if ( math.mux == BB_MUX_PSSEN )
1309   else if (math.mux == BB_MUX_PSSEN)
13351310   {
1336      if ( ((math.inslatch >> 8) & BB_DSEL) == 3 )
1311      if (((math.inslatch >> 8) & BB_DSEL) == 3)
13371312      {
13381313         int shift;
13391314         UINT16 val = math.ppshift;
13401315
1341         if ( math.cpulatch & 0x3800 )
1316         if (math.cpulatch & 0x3800)
13421317         {
13431318            shift = (math.cpulatch >> 11) & 0x7;
13441319
r4425r4426
13641339      }
13651340   }
13661341
1367   if ( math.mux != BB_MUX_ILDEN )
1342   if (math.mux != BB_MUX_ILDEN)
13681343   {
1369       INC_PROM_ADDR;
1344      INC_PROM_ADDR;
13701345      buggyboy_update_state(space->machine);
13711346   }
13721347
r4425r4426
13841359
13851360   offset <<= 1;
13861361
1387   if ( math.mux == BB_MUX_ILDEN )
1362   if (math.mux == BB_MUX_ILDEN)
13881363   {
13891364      math.i0ff = math.cpulatch & (1 << 14) ? 1 : 0;
13901365   }
1391   else if ( math.mux == BB_MUX_MULEN )
1366   else if (math.mux == BB_MUX_MULEN)
13921367   {
13931368      int ins = math.inslatch & 7;
13941369
13951370      BB_SET_INS0_BIT;
13961371      kick_sn74s516(space->machine, &math.cpulatch, ins);
13971372   }
1398   else if ( math.mux == BB_MUX_PPSEN )
1373   else if (math.mux == BB_MUX_PPSEN)
13991374   {
14001375      math.ppshift = math.cpulatch;
14011376   }
1402   else if ( math.mux == BB_MUX_PSSEN )
1377   else if (math.mux == BB_MUX_PSSEN)
14031378   {
1404      if ( ((math.inslatch >> 8) & BB_DSEL) == 3 )
1379      if (((math.inslatch >> 8) & BB_DSEL) == 3)
14051380      {
14061381         int shift;
14071382         UINT16 val = math.ppshift;
14081383
1409         if ( math.cpulatch & 0x3800 )
1384         if (math.cpulatch & 0x3800)
14101385         {
14111386            shift = (math.cpulatch >> 11) & 0x7;
14121387
r4425r4426
14321407      }
14331408   }
14341409
1435   if ( math.mux != BB_MUX_ILDEN )
1410   if (math.mux != BB_MUX_ILDEN)
14361411   {
1437       INC_PROM_ADDR;
1412      INC_PROM_ADDR;
14381413      buggyboy_update_state(space->machine);
14391414   }
14401415
r4425r4426
14631438{
14641439   memset(&math, 0, sizeof(math));
14651440}
1466
1467
1468/*************************************
1469 *
1470 *  Machine Reset
1471 *
1472 *************************************/
1473MACHINE_START( tx1 )
1474{
1475   /* Initialise for each game */
1476   prom = (UINT16*)memory_region(machine, "user1") + (0x8000 >> 1);
1477
1478   /* set a timer to run the interrupts */
1479   interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
1480
1481   /* /CUDISP CRTC interrupt */
1482   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
1483}
1484
1485MACHINE_START( buggyboy )
1486{
1487   /* Initialise for each game */
1488   prom = (UINT16*)memory_region(machine, "user1") + (0x8000 >> 1);
1489
1490   /* set a timer to run the interrupts */
1491   interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
1492
1493   /* /CUDISP CRTC interrupt */
1494   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
1495}
1496
1497MACHINE_START( buggybjr )
1498{
1499   /* Initialise for each game */
1500   prom = (UINT16*)memory_region(machine, "user1") + (0x8000 >> 1);
1501
1502   /* set a timer to run the interrupts */
1503   interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
1504
1505   /* /CUDISP CRTC interrupt */
1506   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
1507}
src/mame/machine/gdcrypt.c
r4425r4426
333333   }
334334}
335335
336void naomi_game_decrypt(UINT64 key, UINT8* region, int length)
336void naomi_game_decrypt(running_machine* machine, UINT64 key, UINT8* region, int length)
337337{
338338   int i;
339339
340340   des_generate_subkeys (rev64(key), des_subkeys);
341341
342   /* save the original file */
343   {
344      FILE *fp;
345      char filename[256];
346      sprintf(filename,"encrypted %s", machine->gamedrv->name);
347      fp=fopen(filename, "w+b");
348      if (fp)
349      {
350         fwrite(region, length, 1, fp);
351         fclose(fp);
352      }
353   }
354
342355   for(i=0;i<length;i+=8)
343356   {
344357      UINT64 ret;
r4425r4426
348361      ret = rev64(ret);
349362       write_from_qword(region+i, ret);
350363   }
364
365   /* save the decrypted file */
366   {
367      FILE *fp;
368      char filename[256];
369      sprintf(filename,"decrypted %s", machine->gamedrv->name);
370      fp=fopen(filename, "w+b");
371      if (fp)
372      {
373         fwrite(region, length, 1, fp);
374         fclose(fp);
375      }
376   }
377
351378}
352379
src/mame/mamedriv.c
r4425r4426
19231923   DRIVER( cbombers )
19241924
19251925   /* Taito F2 games */
1926   DRIVER( finalb )   /* B82 (c) 1988 Taito Corporation Japan (World) */
1927   DRIVER( finalbj )   /* B82 (c) 1988 Taito Corporation (Japan) */
1928   DRIVER( finalbu )   /* B82 (c) 1988 Taito America Corporation (US) */
1929   DRIVER( dondokod )   /* B95 (c) 1989 Taito Corporation Japan (World) */
1930   DRIVER( dondokdu )   /* B95 (c) 1989 Taito America Corporation (US) */
1931   DRIVER( dondokdj )   /* B95 (c) 1989 Taito Corporation (Japan) */
1932   DRIVER( megab )      /* C11 (c) 1989 Taito Corporation Japan (World) */
1933   DRIVER( megabj )   /* C11 (c) 1989 Taito Corporation (Japan) */
1934   DRIVER( thundfox )   /* C28 (c) 1990 Taito Corporation Japan (World) */
1935   DRIVER( thndfoxu )   /* C28 (c) 1990 Taito America Corporation (US) */
1936   DRIVER( thndfoxj )   /* C28 (c) 1990 Taito Corporation (Japan) */
1937   DRIVER( cameltry )   /* C38 (c) 1989 Taito America Corporation (US) */
1938   DRIVER( camltrya )   /* C38 (c) 1989 Taito America Corporation (US) */
1939   DRIVER( camltrua )   /* C38 (c) 1989 Taito America Corporation (US) */
1940   DRIVER( cameltrj )   /* C38 (c) 1989 Taito Corporation (Japan) */
1941   DRIVER( qtorimon )   /* C41 (c) 1990 Taito Corporation (Japan) */
1942   DRIVER( liquidk )   /* C49 (c) 1990 Taito Corporation Japan (World) */
1943   DRIVER( liquidku )   /* C49 (c) 1990 Taito America Corporation (US) */
1944   DRIVER( mizubaku )   /* C49 (c) 1990 Taito Corporation (Japan) */
1945   DRIVER( quizhq )   /* C53 (c) 1990 Taito Corporation (Japan) */
1946   DRIVER( ssi )      /* C64 (c) 1990 Taito Corporation Japan (World) */
1947   DRIVER( majest12 )   /* C64 (c) 1990 Taito Corporation (Japan) */
1948   DRIVER( gunfront )   /* C71 (c) 1990 Taito Corporation Japan (World) */
1949   DRIVER( gunfronj )   /* C71 (c) 1990 Taito Corporation (Japan) */
1950   DRIVER( growl )      /* C74 (c) 1990 Taito Corporation Japan (World) */
1951   DRIVER( growlu )   /* C74 (c) 1990 Taito America Corporation (US) */
1952   DRIVER( runark )   /* C74 (c) 1990 Taito Corporation (Japan) */
1953   DRIVER( mjnquest )   /* C77 (c) 1990 Taito Corporation (Japan) */
1954   DRIVER( mjnquesb )   /* C77 (c) 1990 Taito Corporation (Japan) */
1955   DRIVER( footchmp )   /* C80 (c) 1990 Taito Corporation Japan (World) */
1956   DRIVER( hthero )   /* C80 (c) 1990 Taito Corporation (Japan) */
1957   DRIVER( euroch92 )   /*     (c) 1992 Taito Corporation Japan (World) */
1958   DRIVER( koshien )   /* C81 (c) 1990 Taito Corporation (Japan) */
1959   DRIVER( yuyugogo )   /* C83 (c) 1990 Taito Corporation (Japan) */
1960   DRIVER( ninjak )   /* C85 (c) 1990 Taito Corporation Japan (World) */
1961   DRIVER( ninjakj )   /* C85 (c) 1990 Taito Corporation (Japan) */
1962   DRIVER( ninjaku )   /* C85 (c) 1990 Taito Corporation (Japan) */
1963   DRIVER( solfigtr )   /* C91 (c) 1991 Taito Corporation Japan (World) */
1964   DRIVER( qzquest )   /* C92 (c) 1991 Taito Corporation (Japan) */
1965   DRIVER( pulirula )   /* C98 (c) 1991 Taito Corporation Japan (World) */
1966   DRIVER( pulirulj )   /* C98 (c) 1991 Taito Corporation (Japan) */
1967   DRIVER( metalb )   /* D16? (c) 1991 Taito Corporation Japan (World) */
1968   DRIVER( metalbj )   /* D12 (c) 1991 Taito Corporation (Japan) */
1969   DRIVER( qzchikyu )   /* D19 (c) 1991 Taito Corporation (Japan) */
1970   DRIVER( yesnoj )   /* D20 (c) 1992 Taito Corporation (Japan) */
1971   DRIVER( deadconx )   /* D28 (c) 1992 Taito Corporation Japan (World) */
1972   DRIVER( deadconj )   /* D28 (c) 1992 Taito Corporation (Japan) */
1973   DRIVER( dinorex )   /* D39 (c) 1992 Taito Corporation Japan (World) */
1974   DRIVER( dinorexj )   /* D39 (c) 1992 Taito Corporation (Japan) */
1975   DRIVER( dinorexu )   /* D39 (c) 1992 Taito America Corporation (US) */
1976   DRIVER( qjinsei )   /* D48 (c) 1992 Taito Corporation (Japan) */
1977   DRIVER( qcrayon )   /* D55 (c) 1993 Taito Corporation (Japan) */
1978   DRIVER( qcrayon2 )   /* D63 (c) 1993 Taito Corporation (Japan) */
1979   DRIVER( driftout )   /* (c) 1991 Visco */
1926   DRIVER( finalb )   /* 1989.?? B82 (c) 1988 Taito Corporation Japan (World) */
1927   DRIVER( finalbj )   /* 1989.04 B82 (c) 1988 Taito Corporation (Japan) */
1928   DRIVER( finalbu )   /* 1989.06 B82 (c) 1988 Taito America Corporation (US) */
1929   DRIVER( dondokod )   /* 1989.?? B95 (c) 1989 Taito Corporation Japan (World) */
1930   DRIVER( dondokdu )   /* 1989.?? B95 (c) 1989 Taito America Corporation (US) */
1931   DRIVER( dondokdj )   /* 1989.07 B95 (c) 1989 Taito Corporation (Japan) */
1932   DRIVER( megab )      /* 1989.?? C11 (c) 1989 Taito Corporation Japan (World) */
1933   DRIVER( megabj )   /* 1989.11 C11 (c) 1989 Taito Corporation (Japan) */
1934   DRIVER( thundfox )   /* 1990.?? C28 (c) 1990 Taito Corporation Japan (World) */
1935   DRIVER( thndfoxu )   /* 1990.06 C28 (c) 1990 Taito America Corporation (US) */
1936   DRIVER( thndfoxj )   /* 1990.07 C28 (c) 1990 Taito Corporation (Japan) */
1937   DRIVER( cameltry )   /* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1938   DRIVER( camltrya )   /* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1939   DRIVER( camltrua )   /* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1940   DRIVER( cameltrj )   /* 1990.04 C38 (c) 1989 Taito Corporation (Japan) */
1941   DRIVER( qtorimon )   /* 1990.02 C41 (c) 1990 Taito Corporation (Japan) */
1942   DRIVER( liquidk )   /* 1990.?? C49 (c) 1990 Taito Corporation Japan (World) */
1943   DRIVER( liquidku )   /* 1990.?? C49 (c) 1990 Taito America Corporation (US) */
1944   DRIVER( mizubaku )   /* 1990.08 C49 (c) 1990 Taito Corporation (Japan) */
1945   DRIVER( quizhq )   /* 1990.07 C53 (c) 1990 Taito Corporation (Japan) */
1946   DRIVER( ssi )      /* 1990.?? C64 (c) 1990 Taito Corporation Japan (World) */
1947   DRIVER( majest12 )   /* 1990.11 C64 (c) 1990 Taito Corporation (Japan) */
1948                  /* 1990.12 C64 (US) */
1949   DRIVER( gunfront )   /* 1991.?? C71 (c) 1990 Taito Corporation Japan (World) */
1950   DRIVER( gunfronj )   /* 1991.01 C71 (c) 1990 Taito Corporation (Japan) */
1951   DRIVER( growl )      /* 1991.?? C74 (c) 1990 Taito Corporation Japan (World) */
1952   DRIVER( growlu )   /* 1991.02 C74 (c) 1990 Taito America Corporation (US) */
1953   DRIVER( runark )   /* 1991.02 C74 (c) 1990 Taito Corporation (Japan) */
1954   DRIVER( mjnquest )   /* 1991.05 C77 (c) 1990 Taito Corporation (Japan) */
1955   DRIVER( mjnquesb )   /* 1991.05 C77 (c) 1990 Taito Corporation (Japan) */
1956   DRIVER( footchmp )   /* 1991.?? C80 (c) 1990 Taito Corporation Japan (World) */
1957   DRIVER( hthero )   /* 1991.03 C80 (c) 1990 Taito Corporation (Japan) */
1958   DRIVER( euroch92 )   /* 1991.??     (c) 1992 Taito Corporation Japan (World) */
1959   DRIVER( koshien )   /* 1991.04 C81 (c) 1990 Taito Corporation (Japan) */
1960   DRIVER( yuyugogo )   /* 1991.03 C83 (c) 1990 Taito Corporation (Japan) */
1961   DRIVER( ninjak )   /* 1991.?? C85 (c) 1990 Taito Corporation Japan (World) */
1962   DRIVER( ninjakj )   /* 1991.04 C85 (c) 1990 Taito Corporation (Japan) */
1963   DRIVER( ninjaku )   /* 1991.03 C85 (c) 1990 Taito Corporation (Japan) */
1964   DRIVER( solfigtr )   /* 1991.?? C91 (c) 1991 Taito Corporation Japan (World) */
1965   DRIVER( qzquest )   /* 1991.07 C92 (c) 1991 Taito Corporation (Japan) */
1966   DRIVER( pulirula )   /* 1991.?? C98 (c) 1991 Taito Corporation Japan (World) */
1967   DRIVER( pulirulj )   /* 1991.11 C98 (c) 1991 Taito Corporation (Japan) */
1968   DRIVER( metalb )   /* 1991.?? D16? (c) 1991 Taito Corporation Japan (World) */
1969   DRIVER( metalbj )   /* 1991.11 D12 (c) 1991 Taito Corporation (Japan) */
1970   DRIVER( qzchikyu )   /* 1992.02 D19 (c) 1991 Taito Corporation (Japan) */
1971   DRIVER( yesnoj )   /* 1992.03 D20 (c) 1992 Taito Corporation (Japan) */
1972   DRIVER( deadconx )   /* 1992.?? D28 (c) 1992 Taito Corporation Japan (World) */
1973   DRIVER( deadconj )   /* 1992.08 D28 (c) 1992 Taito Corporation (Japan) */
1974   DRIVER( dinorex )   /* 1992.?? D39 (c) 1992 Taito Corporation Japan (World) */
1975   DRIVER( dinorexj )   /* 1992.11 D39 (c) 1992 Taito Corporation (Japan) */
1976   DRIVER( dinorexu )   /* 1992.?? D39 (c) 1992 Taito America Corporation (US) */
1977   DRIVER( qjinsei )   /* 1993.03 D48 (c) 1992 Taito Corporation (Japan) */
1978   DRIVER( qcrayon )   /* 1993.08 D55 (c) 1993 Taito Corporation (Japan) */
1979   DRIVER( qcrayon2 )   /* 1994.01 D63 (c) 1993 Taito Corporation (Japan) */
1980   DRIVER( driftout )   /* 1991.10 (c) 1991 Visco */
19801981   DRIVER( driveout )   /* bootleg */
19811982
19821983   /* Taito F3 games */
1983   DRIVER( ringrage )   /* D21 (c) 1992 Taito Corporation Japan (World) */
1984   DRIVER( ringragj )   /* D21 (c) 1992 Taito Corporation (Japan) */
1985   DRIVER( ringragu )   /* D21 (c) 1992 Taito America Corporation (US) */
1986   DRIVER( arabianm )   /* D29 (c) 1992 Taito Corporation Japan (World) */
1987   DRIVER( arabiamj )   /* D29 (c) 1992 Taito Corporation (Japan) */
1988   DRIVER( arabiamu )   /* D29 (c) 1992 Taito America Corporation (US) */
1989   DRIVER( ridingf )   /* D34 (c) 1992 Taito Corporation Japan (World) */
1990   DRIVER( ridefgtj )   /* D34 (c) 1992 Taito Corporation (Japan) */
1991   DRIVER( ridefgtu )   /* D34 (c) 1992 Taito America Corporation (US) */
1992   DRIVER( gseeker )   /* D40 (c) 1992 Taito Corporation Japan (World) */
1993   DRIVER( gseekerj )   /* D40 (c) 1992 Taito Corporation (Japan) */
1994   DRIVER( gseekeru )   /* D40 (c) 1992 Taito America Corporation (US) */
1995   DRIVER( hthero93 )   /* D49 (c) 1992 Taito Corporation (Japan) */
1996   DRIVER( cupfinal )   /* D49 (c) 1993 Taito Corporation Japan (World) */
1997   DRIVER( trstar )   /* D53 (c) 1993 Taito Corporation Japan (World) */
1998   DRIVER( trstarj )   /* D53 (c) 1993 Taito Corporation (Japan) */
1999   DRIVER( prmtmfgt )   /* D53 (c) 1993 Taito Corporation (US) */
2000   DRIVER( trstaro )   /* D53 (c) 1993 Taito Corporation (World) */
2001   DRIVER( trstaroj )   /* D53 (c) 1993 Taito Corporation (Japan) */
2002   DRIVER( prmtmfgo )   /* D53 (c) 1993 Taito Corporation (US) */
2003   DRIVER( gunlock )   /* D66 (c) 1993 Taito Corporation Japan (World) */
2004   DRIVER( rayforcj )   /* D66 (c) 1993 Taito Corporation (Japan) */
2005   DRIVER( rayforce )   /* D66 (c) 1993 Taito America Corporation (US) */
2006   DRIVER( scfinals )   /* D68 (c) 1993 Taito Corporation Japan (World) */
2007   DRIVER( intcup94 )   /* D78 (c) 1994 Taito */
2008   DRIVER( hthero94 )   /* D78 (c) 1994 Taito */
2009   DRIVER( dungeonm )   /* D69 (c) 1993 Taito Corporation Japan (World) */
2010   DRIVER( lightbr )   /* D69 (c) 1993 Taito Corporation (Japan) */
2011   DRIVER( dungenmu )   /* D69 (c) 1993 Taito America Corporation (US) */
2012   DRIVER( kaiserkn )   /* D84 (c) 1994 Taito Corporation Japan (World) */
2013   DRIVER( kaiserkj )   /* D84 (c) 1994 Taito Corporation (Japan) */
2014   DRIVER( gblchmp )   /* D84 (c) 1994 Taito America Corporation (US) */
2015   DRIVER( dankuga )   /* D84? (c) 1994 Taito Corporation (Japan) */
2016   DRIVER( dariusg )   /* D87 (c) 1994 Taito Corporation Japan (World) */
2017   DRIVER( dariusgj )   /* D87 (c) 1994 Taito Corporation (Japan) */
2018   DRIVER( dariusgu )   /* D87 (c) 1994 Taito America Corporation (US) */
2019   DRIVER( dariusgx )   /* D87 (c) 1994 Taito Corporation */
2020   DRIVER( bublbob2 )   /* D90 (c) 1994 Taito Corporation Japan (World) */
2021   DRIVER( bubsympe )   /* D90 (c) 1994 Taito Corporation Japan (Europe) */
2022   DRIVER( bubsympu )   /* D90 (c) 1994 Taito America Corporation (US) */
2023   DRIVER( bubsymph )   /* D90 (c) 1994 Taito Corporation (Japan) */
1984   DRIVER( ringrage )   /* 1992.?? D21 (c) 1992 Taito Corporation Japan (World) */
1985   DRIVER( ringragj )   /* 1992.09 D21 (c) 1992 Taito Corporation (Japan) */
1986   DRIVER( ringragu )   /* 1992.02 D21 (c) 1992 Taito America Corporation (US) */
1987   DRIVER( arabianm )   /* 1992.?? D29 (c) 1992 Taito Corporation Japan (World) */
1988   DRIVER( arabiamj )   /* 1992.09 D29 (c) 1992 Taito Corporation (Japan) */
1989   DRIVER( arabiamu )   /* 1992.10 D29 (c) 1992 Taito America Corporation (US) */
1990   DRIVER( ridingf )   /* 1992.?? D34 (c) 1992 Taito Corporation Japan (World) */
1991   DRIVER( ridefgtj )   /* 1992.12 D34 (c) 1992 Taito Corporation (Japan) */
1992   DRIVER( ridefgtu )   /* 1992.?? D34 (c) 1992 Taito America Corporation (US) */
1993   DRIVER( gseeker )   /* 1992.?? D40 (c) 1992 Taito Corporation Japan (World) */
1994   DRIVER( gseekerj )   /* 1992.12 D40 (c) 1992 Taito Corporation (Japan) */
1995   DRIVER( gseekeru )   /* 1992.?? D40 (c) 1992 Taito America Corporation (US) */
1996   DRIVER( hthero93 )   /* 1993.03 D49 (c) 1992 Taito Corporation (Japan) */
1997                  /* 1993.04 D49 (US) */
1998   DRIVER( cupfinal )   /* 1993.?? D49 (c) 1993 Taito Corporation Japan (World) */
1999   DRIVER( trstar )   /* 1993.?? D53 (c) 1993 Taito Corporation Japan (World) */
2000   DRIVER( trstarj )   /* 1993.07 D53 (c) 1993 Taito Corporation (Japan) */
2001   DRIVER( prmtmfgt )   /* 1993.08 D53 (c) 1993 Taito Corporation (US) */
2002   DRIVER( prmtmfgo )   /* 1993.08 D53 (c) 1993 Taito Corporation (US) */
2003   DRIVER( trstaro )   /* 1993.?? D53 (c) 1993 Taito Corporation (World) */
2004   DRIVER( trstaroj )   /* 1993.07 D53 (c) 1993 Taito Corporation (Japan) */
2005   DRIVER( gunlock )   /* 1994.?? D66 (c) 1993 Taito Corporation Japan (World) */
2006   DRIVER( rayforcj )   /* 1994.02 D66 (c) 1993 Taito Corporation (Japan) */
2007   DRIVER( rayforce )   /* 1994.?? D66 (c) 1993 Taito America Corporation (US) */
2008   DRIVER( scfinals )   /* 1994.?? D68 (c) 1993 Taito Corporation Japan (World) */
2009   DRIVER( intcup94 )   /* 1994.?? D78 (c) 1994 Taito (World) */
2010   DRIVER( hthero94 )   /* 1994.09 D78 (c) 1994 Taito (US) */
2011   DRIVER( dungeonm )   /* 1994.?? D69 (c) 1993 Taito Corporation Japan (World) */
2012   DRIVER( lightbr )   /* 1994.03 D69 (c) 1993 Taito Corporation (Japan) */
2013   DRIVER( dungenmu )   /* 1994.?? D69 (c) 1993 Taito America Corporation (US) */
2014   DRIVER( kaiserkn )   /* 1994.?? D84 (c) 1994 Taito Corporation Japan (World) */
2015   DRIVER( kaiserkj )   /* 1994.08 D84 (c) 1994 Taito Corporation (Japan) */
2016   DRIVER( gblchmp )   /* 1994.10 D84 (c) 1994 Taito America Corporation (US) */
2017   DRIVER( dankuga )   /* 1994.?? D84? (c) 1994 Taito Corporation (Japan) */
2018   DRIVER( dariusg )   /* 1994.?? D87 (c) 1994 Taito Corporation Japan (World) */
2019   DRIVER( dariusgj )   /* 1994.09 D87 (c) 1994 Taito Corporation (Japan) */
2020   DRIVER( dariusgu )   /* 1994.11 D87 (c) 1994 Taito America Corporation (US) */
2021   DRIVER( dariusgx )   /* 1994.?? D87 (c) 1994 Taito Corporation */
2022   DRIVER( bublbob2 )   /* 1994.?? D90 (c) 1994 Taito Corporation Japan (World) */
2023   DRIVER( bubsympe )   /* 1994.?? D90 (c) 1994 Taito Corporation Japan (Europe) */
2024   DRIVER( bubsympu )   /* 1994.10 D90 (c) 1994 Taito America Corporation (US) */
2025   DRIVER( bubsymph )   /* 1994.10 D90 (c) 1994 Taito Corporation (Japan) */
20242026   DRIVER( bubsympb )   /* bootleg */
2025   DRIVER( spcinvdj )   /* D93 (c) 1994 Taito Corporation (Japan) */
2026   DRIVER( pwrgoal )   /* D94 (c) 1995 Taito Corporation Japan (World) */
2027   DRIVER( hthero95 )   /* D94 (c) 1995 Taito Corporation (Japan) */
2028   DRIVER( hthro95u )   /* D94 (c) 1995 Taito America Corporation (US) */
2029   DRIVER( qtheater )   /* D95 (c) 1994 Taito Corporation (Japan) */
2030   DRIVER( elvactr )   /* E02 (c) 1994 Taito Corporation Japan (World) */
2031   DRIVER( elvactrj )   /* E02 (c) 1994 Taito Corporation (Japan) */
2032   DRIVER( elvact2u )   /* E02 (c) 1994 Taito America Corporation (US) */
2033   DRIVER( spcinv95 )   /* E06 (c) 1995 Taito Corporation Japan (World) */
2034   DRIVER( spcnv95u )   /* E06 (c) 1995 Taito America Corporation (US) */
2035   DRIVER( akkanvdr )   /* E06 (c) 1995 Taito Corporation (Japan) */
2036   DRIVER( twinqix )   /* ??? (c) 1995 Taito America Corporation (US) */
2037   DRIVER( quizhuhu )   /* E08 (c) 1995 Taito Corporation (Japan) */
2038   DRIVER( pbobble2 )   /* E10 (c) 1995 Taito Corporation Japan (World) */
2039   DRIVER( pbobbl2o )   /* E10 (c) 1995 Taito Corporation Japan (World) */
2040   DRIVER( pbobbl2j )   /* E10 (c) 1995 Taito Corporation (Japan) */
2041   DRIVER( pbobbl2u )   /* E10 (c) 1995 Taito America Corporation (US) */
2042   DRIVER( pbobbl2x )   /* E10 (c) 1995 Taito Corporation (Japan) */
2043   DRIVER( gekirido )   /* E11 (c) 1995 Taito Corporation (Japan) */
2044   DRIVER( tcobra2 )   /* E15 (c) 1995 Taito Corporation (Japan) */
2045   DRIVER( tcobra2u )   /* E15 (c) 1995 Taito Corporation (Japan) */
2046   DRIVER( ktiger2 )   /* E15 (c) 1995 Taito Corporation (Japan) */
2047   DRIVER( bubblem )   /* E21 (c) 1995 Taito Corporation Japan (World) */
2048   DRIVER( bubblemj )   /* E21 (c) 1995 Taito Corporation (Japan) */
2049   DRIVER( cleopatr )   /* E28 (c) 1996 Taito Corporation (Japan) */
2050   DRIVER( pbobble3 )   /* E29 (c) 1996 Taito Corporation (World) */
2051   DRIVER( pbobbl3u )   /* E29 (c) 1996 Taito Corporation (US) */
2052   DRIVER( pbobbl3j )   /* E29 (c) 1996 Taito Corporation (Japan) */
2053   DRIVER( arkretrn )   /* E36 (c) 1997 Taito Corporation (Japan) */
2054   DRIVER( kirameki )   /* E44 (c) 1997 Taito Corporation (Japan) */
2055   DRIVER( puchicar )   /* E46 (c) 1997 Taito Corporation (World) */
2056   DRIVER( puchicrj )   /* E46 (c) 1997 Taito Corporation (Japan) */
2057   DRIVER( pbobble4 )   /* E49 (c) 1997 Taito Corporation (World) */
2058   DRIVER( pbobbl4j )   /* E49 (c) 1997 Taito Corporation (Japan) */
2059   DRIVER( pbobbl4u )   /* E49 (c) 1997 Taito Corporation (US) */
2060   DRIVER( popnpop )   /* E51 (c) 1997 Taito Corporation (World) */
2061   DRIVER( popnpopj )   /* E51 (c) 1997 Taito Corporation (Japan) */
2062   DRIVER( popnpopu )   /* E51 (c) 1997 Taito Corporation (US) */
2063   DRIVER( landmakr )   /* E61 (c) 1998 Taito Corporation (Japan) */
2064   DRIVER( landmkrp )   /* E61 (c) 1998 Taito Corporation (World, prototype) */
2027   DRIVER( spcinvdj )   /* 1994.09 D93 (c) 1994 Taito Corporation (Japan) */
2028   DRIVER( pwrgoal )   /* 1994.?? D94 (c) 1995 Taito Corporation Japan (World) */
2029   DRIVER( hthero95 )   /* 1994.11 D94 (c) 1995 Taito Corporation (Japan) */
2030   DRIVER( hthro95u )   /* 1995.05 D94 (c) 1995 Taito America Corporation (US) */
2031   DRIVER( qtheater )   /* 1995.01 D95 (c) 1994 Taito Corporation (Japan) */
2032   DRIVER( elvactr )   /* 1995.?? E02 (c) 1994 Taito Corporation Japan (World) */
2033   DRIVER( elvactrj )   /* 1995.03 E02 (c) 1994 Taito Corporation (Japan) */
2034   DRIVER( elvact2u )   /* 1995.05 E02 (c) 1994 Taito America Corporation (US) */
2035   DRIVER( spcinv95 )   /* 1995.?? E06 (c) 1995 Taito Corporation Japan (World) */
2036   DRIVER( spcnv95u )   /* 1995.05 E06 (c) 1995 Taito America Corporation (US) */
2037   DRIVER( akkanvdr )   /* 1995.07 E06 (c) 1995 Taito Corporation (Japan) */
2038   DRIVER( twinqix )   /* 1995.03 ??? (c) 1995 Taito America Corporation (US) */
2039   DRIVER( quizhuhu )   /* 1995.07 E08 (c) 1995 Taito Corporation (Japan) */
2040   DRIVER( pbobble2 )   /* 1995.?? E10 (c) 1995 Taito Corporation Japan (World) */
2041   DRIVER( pbobbl2o )   /* 1995.?? E10 (c) 1995 Taito Corporation Japan (World) */
2042   DRIVER( pbobbl2j )   /* 1995.09 E10 (c) 1995 Taito Corporation (Japan) */
2043   DRIVER( pbobbl2u )   /* 1995.11 E10 (c) 1995 Taito America Corporation (US) */
2044   DRIVER( pbobbl2x )   /* 1995.12 E10 (c) 1995 Taito Corporation (Japan) */
2045   DRIVER( gekirido )   /* 1995.11 E11 (c) 1995 Taito Corporation (Japan) */
2046   DRIVER( tcobra2 )   /* 1996.?? E15 (c) 1995 Taito Corporation (World) */
2047   DRIVER( tcobra2u )   /* 1996.?? E15 (c) 1995 Taito Corporation (US) */
2048   DRIVER( ktiger2 )   /* 1996.02 E15 (c) 1995 Taito Corporation (Japan) */
2049   DRIVER( bubblem )   /* 1996.?? E21 (c) 1995 Taito Corporation Japan (World) */
2050   DRIVER( bubblemj )   /* 1996.04 E21 (c) 1995 Taito Corporation (Japan) */
2051   DRIVER( cleopatr )   /* 1996.10 E28 (c) 1996 Taito Corporation (Japan) */
2052   DRIVER( pbobble3 )   /* 1996.?? E29 (c) 1996 Taito Corporation (World) */
2053   DRIVER( pbobbl3u )   /* 1996.11 E29 (c) 1996 Taito Corporation (US) */
2054   DRIVER( pbobbl3j )   /* 1996.11 E29 (c) 1996 Taito Corporation (Japan) */
2055   DRIVER( arkretrn )   /* 1997.03 E36 (c) 1997 Taito Corporation (Japan) */
2056   DRIVER( kirameki )   /* 1997.09 E44 (c) 1997 Taito Corporation (Japan) */
2057   DRIVER( puchicar )   /* 1997.?? E46 (c) 1997 Taito Corporation (World) */
2058   DRIVER( puchicrj )   /* 1997.12 E46 (c) 1997 Taito Corporation (Japan) */
2059   DRIVER( pbobble4 )   /* 1998.?? E49 (c) 1997 Taito Corporation (World) */
2060   DRIVER( pbobbl4j )   /* 1998.02 E49 (c) 1997 Taito Corporation (Japan) */
2061   DRIVER( pbobbl4u )   /* 1998.?? E49 (c) 1997 Taito Corporation (US) */
2062   DRIVER( popnpop )   /* 1998.?? E51 (c) 1997 Taito Corporation (World) */
2063   DRIVER( popnpopj )   /* 1998.03 E51 (c) 1997 Taito Corporation (Japan) */
2064   DRIVER( popnpopu )   /* 1998.?? E51 (c) 1997 Taito Corporation (US) */
2065   DRIVER( landmakr )   /* 1998.08 E61 (c) 1998 Taito Corporation (Japan) */
2066   DRIVER( landmkrp )   /* 1998.?? E61 (c) 1998 Taito Corporation (World, prototype) */
20652067   DRIVER( recalh )   /* prototype */
20662068   DRIVER( commandw )   /* prototype */
20672069
20682070   /* Taito JC System */
2069   DRIVER( landgear )   /* E17 (c) 1995 Taito Corporation */
2070   DRIVER( dendeg )   /* E35 (c) 1996 Taito Corporation */
2071   DRIVER( dendegx )   /* E35 (c) 1996 Taito Corporation */
2072   DRIVER( dendeg2 )   /* E52 (c) 1998 Taito Corporation */
2073   DRIVER( dendeg2x )   /* E52 (c) 1998 Taito Corporation */
2074   DRIVER( sidebs )   /* E23 (c) 1996 Taito Corporation */
2075   DRIVER( sidebs2 )   /* E38 (c) 1997 Taito Corporation */
2076   DRIVER( sidebs2j )   /* E38 (c) 1997 Taito Corporation */
2077   DRIVER( dangcurv )   /* E09 (c) 1995 Taito Corporation */
2071   DRIVER( dangcurv )   /* 1995.?? E09 (c) 1995 Taito Corporation */
2072                  /* 1995.07 (Japan) */
2073                  /* 1995.10 (US) */
2074   DRIVER( landgear )   /* 1996.?? E17 (c) 1995 Taito Corporation Japan (World) */
2075                  /* 1996.03 (Japan) */
2076   DRIVER( sidebs )   /* 1996.07 E23 (c) 1996 Taito Corporation (Japan) */
2077   DRIVER( dendeg )   /* 1997.03 E35 (c) 1996 Taito Corporation (Japan) */
2078   DRIVER( sidebs2j )   /* 1997.07 E38 (c) 1997 Taito Corporation (Japan) */
2079   DRIVER( sidebs2 )   /* 1997.?? E38 (c) 1997 Taito Corporation (Japan) */
2080   DRIVER( dendegx )   /* 1997.09 E35 (c) 1996 Taito Corporation (Japan) */
2081   DRIVER( dendeg2 )   /* 1998.03 E52 (c) 1998 Taito Corporation (Japan) */
2082   DRIVER( dendeg2x )   /* 1998.08 E52 (c) 1998 Taito Corporation (Japan) */
20782083
20792084   /* Taito "Wolf" System */
20802085   DRIVER( pf2012 )   /* E59 (c) 1997 Taito */
20812086
20822087   /* Taito PPC JC System */
2083   DRIVER( optiger )   /* E63 (c) 1998 Taito */
2088   DRIVER( optiger )   /* 1998.09 E63 (c) 1998 Taito */
20842089
20852090   /* Taito Type-Zero System */
20862091   DRIVER( landhigh )   /* E68 (c) 1999 Taito */
r4425r4426
29522957
29532958   /* Taito GNET */
29542959   DRIVER( taitogn )
2960   DRIVER( chaoshea )  /* 1998.10 Chaos Heat (V2.08J) */
2961   DRIVER( raycris )   /* 1998.12 Ray Crisis (V2.03J) */
2962                  /* 1999.02 Otenami Haiken (Success) */
2963                  /* 1999.03 Super Puzzle Bobble (Japan) */
2964   DRIVER( spuzbobl )  /* 1999.?? Super Puzzle Bobble (V2.05O) */
2965   DRIVER( gobyrc )    /* 1999.?? Go By RC (V2.03O) */
2966   DRIVER( rcdego )    /* 1999.06 RC De Go (V2.03J) */
2967   DRIVER( flipmaze )  /* 1999.09 Flip Maze (V2.04J) */
2968   DRIVER( mahjngoh )  /* 1999.12 Mahjong Oh (V2.06J) */
2969   DRIVER( psyvaria )  /* 2000.03 Psyvariar -Medium Unit- (V2.04J) */
2970   DRIVER( shanghss )  /* 2000.07 Shanghai Shoryu Sairin (V2.03J) */
2971   DRIVER( psyvarrv )  /* 2000.09 Psyvariar -Revision- (V2.04J) */
2972   DRIVER( zokuoten )  /* 2000.12 Zoku Otenamihaiken (V2.03J) */
2973                  /* 2000.?? Taito Classic (Success, not released?) */
2974   DRIVER( soutenry )  /* 2001.02 Soutenryu (V2.07J) */
2975   DRIVER( nightrai )  /* 2001.05 Night Raid (V2.03J) */
2976                  /* 2001.09 Shikigami no Shiro */
2977                  /* 2001.10 Otenki Kororin */
2978   DRIVER( usagi )     /* 2001.12 Usagi (V2.02J) */
2979                  /* 2002.02 Shanghai Sangokuhaitougi */
2980   DRIVER( xiistag )   /* 2002.07 XII Stag (V2.01J) */
2981   DRIVER( sianniv )   /* 2003.10 Space Invaders Anniversary (V2.02J) */
2982                  /* 2003.11 Kollon */
2983                  /* 2004.05 Zooo */
29552984
29562985   /* Namco System 11 */
2957   DRIVER( tekken )   /* Tekken (TE4/VER.C) */
2958   DRIVER( tekkena )   /* Tekken (TE2/VER.C) */
2959   DRIVER( tekkenb )   /* Tekken (TE2/VER.B) */
2960   DRIVER( tekkenc )   /* Tekken (TE1/VER.B) */
2961   DRIVER( tekken2 )   /* Tekken 2 Ver.B (TES3/VER.B) */
2962   DRIVER( tekken2a )   /* Tekken 2 Ver.B (TES2/VER.B) */
2963   DRIVER( tekken2b )   /* Tekken 2 (TES2/VER.A) */
2964   DRIVER( souledge )   /* Soul Edge Ver. II (SO4/VER.C) */
2965   DRIVER( souledga )   /* Soul Edge Ver. II (SO3/VER.C) */
2966   DRIVER( souledgb )   /* Soul Edge (SO3/VER.A) */
2967   DRIVER( souledgc )   /* Soul Edge (SO1/VER.A) */
2968   DRIVER( dunkmnia )   /* Dunk Mania (DM1/VER.C) */
2969   DRIVER( dunkmnic )   /* Dunk Mania (DM1/VER.C) */
2970   DRIVER( xevi3dg )   /* Xevious 3D/G (XV31/VER.A) */
2971   DRIVER( primglex )   /* Prime Goal EX (PG1/VER.A) */
2972   DRIVER( danceyes )   /* Dancing Eyes (DC1/VER.A) */
2973   DRIVER( pocketrc )   /* Pocket Racer (PKR1/VER.B) */
2974   DRIVER( starswep )   /* Star Sweep (STP1/VER.A) */
2975   DRIVER( myangel3 )   /* Kosodate Quiz My Angel 3 (KQT1/VER.A) */
2976   DRIVER( ptblnk2a )   /* Point Blank 2 (GNB3/VER.A) */
2986   DRIVER( tekken )   /* 1994.?? Tekken (TE4/VER.C) */
2987   DRIVER( tekkena )   /* 1994.?? Tekken (TE2/VER.C) */
2988   DRIVER( tekkenb )   /* 1994.?? Tekken (TE2/VER.B) */
2989   DRIVER( tekkenc )   /* 1994.12 Tekken (TE1/VER.B, Japan) */
2990   DRIVER( tekken2 )   /* 1995.?? Tekken 2 Ver.B (TES3/VER.B) */
2991   DRIVER( tekken2a )   /* 1995.?? Tekken 2 Ver.B (TES2/VER.B) */
2992                  /* 1995.10 Tekken 2 Ver.B (TES1/VER.B, Japan) */
2993   DRIVER( tekken2b )   /* 1995.?? Tekken 2 (TES2/VER.A) */
2994                  /* 1995.08 Tekken 2 (TES1, Japan) */
2995   DRIVER( souledgb )   /* 1996.?? Soul Edge (SO3/VER.A) */
2996   DRIVER( souledgc )   /* 1996.02 Soul Edge (SO1/VER.A, Japan) */
2997   DRIVER( primglex )   /* 1996.03 Prime Goal EX (PG1/VER.A, Japan) */
2998   DRIVER( xevi3dg )   /* 1996.05 Xevious 3D/G (XV31/VER.A, Japan) */
2999   DRIVER( souledge )   /* 1996.?? Soul Edge Ver. II (SO4/VER.C) */
3000   DRIVER( souledga )   /* 1996.?? Soul Edge Ver. II (SO3/VER.C) */
3001                  /* 1996.05 Soul Edge Ver. II (SO1, Japan) */
3002   DRIVER( dunkmnia )   /* 1996.?? Dunk Mania (DM1/VER.C) */
3003   DRIVER( dunkmnic )   /* 1996.05 Dunk Mania (DM1/VER.C, Japan) */
3004   DRIVER( danceyes )   /* 1996.09 Dancing Eyes (DC1/VER.A, Japan) */
3005   DRIVER( pocketrc )   /* 1997.03 Pocket Racer (PKR1/VER.B, Japan) */
3006   DRIVER( starswep )   /* 1997.07 Star Sweep (STP1/VER.A, Japan) */
3007   DRIVER( myangel3 )   /* 1998.03 Kosodate Quiz My Angel 3 (KQT1/VER.A, Japan) */
3008   DRIVER( ptblnk2a )   /* 1999.?? Point Blank 2 (GNB3/VER.A) */
3009                  /* 1999.02 Gunbaarl (GNB1, Japan) */
29773010
29783011   /* Namco System 12 */
2979   DRIVER( tekken3 )   /* Tekken 3 (TET1/VER.E1) */
2980   DRIVER( tekken3a )   /* Tekken 3 (TET2/VER.B) */
2981   DRIVER( tekken3b )   /* Tekken 3 (TET3/VER.A) */
2982   DRIVER( tekken3c )   /* Tekken 3 (TET2/VER.A) */
2983   DRIVER( lbgrande )   /* Libero Grande (LG2/VER.A) */
2984   DRIVER( toukon3 )   /* Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (TR1/VER.A) */
2985   DRIVER( soulclbr )   /* Soul Calibur (SOC14/VER.C) */
2986   DRIVER( soulclba )   /* Soul Calibur (SOC11/VER.C) */
2987   DRIVER( soulclbb )   /* Soul Calibur (SOC13/VER.B) */
2988   DRIVER( soulclbc )   /* Soul Calibur (SOC11/VER.B) */
2989   DRIVER( soulclbd )   /* Soul Calibur (SOC11/VER.A2) */
2990   DRIVER( ehrgeiz )   /* Ehrgeiz (EG3/VER.A) */
2991   DRIVER( ehrgeiza )   /* Ehrgeiz (EG2/VER.A) */
2992   DRIVER( kaiunqz )   /* Kaiun Quiz (KW1/VER.A) */
2993   DRIVER( mdhorse )   /* Derby Quiz My Dream Horse (MDH1/VER.A2) */
2994   DRIVER( sws98 )      /* Super World Stadium '98 (SS81/VER.A) */
2995   DRIVER( tenkomor )   /* Tenkomori Shooting (TKM2/VER.A1) */
2996   DRIVER( tenkomoj )   /* Tenkomori Shooting (TKM1/VER.A1) */
2997   DRIVER( fgtlayer )   /* Fighting Layer (FTL0/VER.A) */
2998   DRIVER( pacapp )   /* Paca Paca Passion (PPP1/VER.A2) */
2999   DRIVER( ptblank2 )   /* Point Blank 2 (GNB5/VER.A) */
3000   DRIVER( sws99 )      /* Super World Stadium '99 (SS91/VER.A3) */
3001   DRIVER( tektagt )   /* Tekken Tag Tournament (TEG3/VER.C1) */
3002   DRIVER( tektagta )   /* Tekken Tag Tournament (TEG3/VER.B) */
3003   DRIVER( tektagtb )   /* Tekken Tag Tournament (TEG1/VER.B) */
3004   DRIVER( tektagtc )   /* Tekken Tag Tournament (TEG1/VER.A) */
3005   DRIVER( ghlpanic )   /* Ghoul Panic (OB2/VER.A) */
3006   DRIVER( pacapp2 )   /* Paca Paca Passion 2 (PKS1/VER.A) */
3007   DRIVER( mrdrillr )   /* Mr Driller (DRI1/VER.A2) */
3008   DRIVER( aquarush )   /* Aqua Rush (AQ1/VER.A1) */
3009   DRIVER( pacappsp )   /* Paca Paca Passion Special (PSP1/VER.A) */
3010   DRIVER( golgo13 )   /* Golgo 13 (GLG1/VER.A) */
3011   DRIVER( g13knd )   /* Golgo 13 Kiseki no Dandou (GLS1/VER.A) */
3012   DRIVER( sws2000 )   /* Super World Stadium 2000 (SS01/VER.A) */
3013   DRIVER( sws2001 )   /* Super World Stadium 2001 (SS11/VER.A) */
3012   DRIVER( tekken3 )   /* 1997.03 Tekken 3 (TET1/VER.E1, Japan) */
3013   DRIVER( tekken3a )   /* 1997.?? Tekken 3 (TET2/VER.B) */
3014   DRIVER( tekken3b )   /* 1997.?? Tekken 3 (TET3/VER.A) */
3015   DRIVER( tekken3c )   /* 1997.?? Tekken 3 (TET2/VER.A) */
3016   DRIVER( lbgrande )   /* 1997.?? Libero Grande (LG2/VER.A) */
3017                  /* 1997.12 Libero Grande (LG1, Japan) */
3018   DRIVER( toukon3 )   /* 1997.12 Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (TR1/VER.A, Japan) */
3019   DRIVER( ehrgeiz )   /* 1998.?? Ehrgeiz (EG3/VER.A) */
3020   DRIVER( ehrgeiza )   /* 1998.?? Ehrgeiz (EG2/VER.A) */
3021                  /* 1998.05 Ehrgeiz (EG1, Japan) */
3022   DRIVER( sws98 )      /* 1998.06 Super World Stadium '98 (SS81/VER.A, Japan) */
3023   DRIVER( soulclbr )   /* 1998.?? Soul Calibur (SOC14/VER.C) */
3024   DRIVER( soulclba )   /* 1998.07 Soul Calibur (SOC11/VER.C, Japan) */
3025   DRIVER( soulclbb )   /* 1998.?? Soul Calibur (SOC13/VER.B) */
3026   DRIVER( soulclbc )   /* 1998.?? Soul Calibur (SOC11/VER.B, Japan) */
3027   DRIVER( soulclbd )   /* 1998.?? Soul Calibur (SOC11/VER.A2, Japan) */
3028                  /* 1998.07 Techno Drive */
3029   DRIVER( mdhorse )   /* 1998.11 Derby Quiz My Dream Horse (MDH1/VER.A2, Japan) */
3030                  /* 1998.12 Attack Pla Rail */
3031   DRIVER( tenkomor )   /* 1998.?? Tenkomori Shooting (TKM2/VER.A1) */
3032   DRIVER( tenkomoj )   /* 1998.12 Tenkomori Shooting (TKM1/VER.A1, Japan) */
3033   DRIVER( pacapp )   /* 1998.12 Paca Paca Passion (PPP1/VER.A2, Japan) */
3034   DRIVER( fgtlayer )   /* 1998.12 Fighting Layer (FTL0/VER.A, Japan) */
3035                  /* 1999.01 Bust A Move (Metro) */
3036   DRIVER( ptblank2 )   /* 1999.?? Point Blank 2 (GNB5/VER.A) */
3037   DRIVER( sws99 )      /* 1999.05 Super World Stadium '99 (SS91/VER.A3, Japan) */
3038   DRIVER( ghlpanic )   /* 1999.?? Ghoul Panic (OB2/VER.A) */
3039                  /* 1999.07 Oh Bakyuun (OB1, Japan) */
3040   DRIVER( pacapp2 )   /* 1999.07 Paca Paca Passion 2 (PKS1/VER.A, Japan) */
3041                  /* 1999.07 Bust A Move 2 (Metro) */
3042   DRIVER( tektagt )   /* 1999.?? Tekken Tag Tournament (TEG3/VER.C1) */
3043   DRIVER( tektagta )   /* 1999.?? Tekken Tag Tournament (TEG3/VER.B) */
3044   DRIVER( tektagtb )   /* 1999.07 Tekken Tag Tournament (TEG1/VER.B, Japan) */
3045   DRIVER( tektagtc )   /* 1999.07 Tekken Tag Tournament (TEG1/VER.A, Japan) */
3046   DRIVER( mrdrillr )   /* 1999.11 Mr Driller (DRI1/VER.A2, Japan) */
3047                  /* 1999.12 UmJammer Lammy NOW! (Japan) */
3048                  /* 1999.12 Quest for Fame (Japan) */
3049   DRIVER( pacappsp )   /* 1999.12 Paca Paca Passion Special (PSP1/VER.A, Japan) */
3050   DRIVER( kaiunqz )   /* 1999.12 Kaiun Quiz (KW1/VER.A, Japan) */
3051   DRIVER( aquarush )   /* 2000.02 Aqua Rush (AQ1/VER.A1, Japan) */
3052   DRIVER( golgo13 )   /* 2000.03 Golgo 13 (GLG1/VER.A, Japan) */
3053   DRIVER( sws2000 )   /* 2000.03 Super World Stadium 2000 (SS01/VER.A, Japan) */
3054                  /* 2000.06 Truck Kyousoukyoku (Metro) */
3055                  /* 2000.07 Kart Duel */
3056                  /* 2000.08 Teknowerk */
3057   DRIVER( g13knd )   /* 2000.10 Golgo 13 Kiseki no Dandou (GLS1/VER.A, Japan) */
3058   DRIVER( sws2001 )   /* 2001.04 Super World Stadium 2001 (SS11/VER.A, Japan) */
30143059
30153060   /* Namco System 10 */
3016   DRIVER( mrdrilr2 )   /* Mr Driller 2 (DR21 Ver.A) */
3017   DRIVER( gjspace )   /* Gekitoride-Jong Space (10011 Ver.A) */
3018   DRIVER( mrdrilrg )   /* Mr. Driller G (DRG1 Ver.A) */
3019   DRIVER( knpuzzle )   /* Kotoba no Puzzle Mojipittan (KPM1 Ver.A) */
3020   DRIVER( startrgn )   /* Star Trigon (STT1 Ver.A) */
3021   DRIVER( gamshara )   /* Gamshara (10021 Ver.A) */
3061   DRIVER( mrdrilr2 )   /* 2000.07 Mr Driller 2 (DR21 Ver.A) */
3062                  /* 2000.12 Gunbarina */
3063                  /* 2001.02 Photo Battole */
3064                  /* 2001.02 Taiko no Tatsujin */
3065                  /* 2001.03 Gahaha Ippatsudou */
3066   DRIVER( mrdrilrg )   /* 2001.03 Mr. Driller G (DRG1 Ver.A) */
3067                  /* 2001.07 Golgo 13 Juusei no Requiem */
3068                  /* 2001.08 Taiko no Tatsujin 2 */
3069                  /* 2001.09 Gahaha Ippatsudou 2 */
3070                  /* 2001.11 Knock Down 2001 */
3071   DRIVER( knpuzzle )   /* 2001.12 Kotoba no Puzzle Mojipittan (KPM1 Ver.A) */
3072   DRIVER( gjspace )   /* 2001.12 Gekitoride-Jong Space (10011 Ver.A) */
3073                  /* 2002.03 Panicuru Panekuru */
3074                  /* 2002.03 Taiko no Tatsujin 3 */
3075   DRIVER( startrgn )   /* 2002.07 Star Trigon (STT1 Ver.A) */
3076                  /* 2002.07 Tsukkomi Yousei Gips Nice Tsukkomi */
3077   DRIVER( gamshara )   /* 2002.08 Gamshara (10021 Ver.A) */
3078                  /* 2002.10 Uchuu Daisakusen : Chocovader Contactee */
3079                  /* 2002.12 Taiko no Tatsujin 4 */
3080                  /* 2003.04 Seisyun Quiz Colorful High School */
3081                  /* 2003.10 Taiko no Tatsujin 5 */
3082                  /* 2004.07 Taiko no Tatsujin 6 */
30223083
30233084   /* Konami GQ */
30243085   DRIVER( cryptklr )   /* Crypt Killer (GQ420 UAA) */
r4425r4426
36583719   DRIVER( wb3bbl )   /* BOOTLEG */
36593720
36603721   /* System 18 */
3661   DRIVER( astorm )   /* (c) 1990 (protected 2 Players) */
3662   DRIVER( astorm3 )   /* (c) 1990 (FD1094, decrypted) */
3663   DRIVER( astormu )   /* (c) 1990 (FD1094, decrypted) */
3664   DRIVER( astormj )   /* (c) 1990 (FD1094, decrypted) */
3665   DRIVER( bloxeed )   /* (c) 1990 (FD1094, decrypted) */
3666   DRIVER( shdancer )   /* (c) 1989 */
3667   DRIVER( shdancej )   /* (c) 1989 */
3668   DRIVER( shdance1 )   /* (c) 1989 */
3669   DRIVER( ddcrew )   /* (c) 1991 (FD1094, decrypted) */
3670   DRIVER( ddcrewu )   /* (c) 1991 (FD1094, decrypted) */
3671   DRIVER( ddcrew2 )   /* (c) 1991 (FD1094, decrypted) */
3672   DRIVER( ddcrew1 )   /* (c) 1991 (FD1094, decrypted) */
3673   DRIVER( ddcrewj )   /* (c) 1991 (FD1094, decrypted) */
3674   DRIVER( cltchitr )   /* (c) 1991 (FD1094, decrypted) */
3675   DRIVER( cltchtrj )   /* (c) 1991 (FD1094, decrypted) */
3676   DRIVER( desertbr )   /* (c) 1993 (FD1094, decrypted) */
3677   DRIVER( mwalk )      /* (c) 1990 (FD1094+8751, decrypted) */
3678   DRIVER( mwalku )   /* (c) 1990 (FD1094+8751, decrypted) */
3679   DRIVER( mwalkj )   /* (c) 1990 (FD1094+8751, decrypted) */
3722   DRIVER( shdancer )   /* 1989.05 Shadow Dancer (US) */
3723   DRIVER( shdancej )   /* 1989.11 Shadow Dancer (Japan) */
3724   DRIVER( shdance1 )   /* 1989.?? Shadow Dancer (World) */
3725   DRIVER( bloxeed )   /* 1989.12 Bloxeed (Japan, FD1094, decrypted) */
3726                  /* 1990.04 Bloxeed (US) */
3727   DRIVER( astormu )   /* 1990.04 Alien Storm (US, FD1094, decrypted) */
3728   DRIVER( astormj )   /* 1990.05 Alien Storm (Japan, FD1094, decrypted) */
3729   DRIVER( astorm )   /* 1990.?? Alien Storm (World, protected 2 Players) */
3730   DRIVER( astorm3 )   /* 1990.?? Alien Storm (World, FD1094, decrypted) */
3731   DRIVER( mwalku )   /* 1990.08 Micheal Jackson's Moonwalker (US, FD1094+8751, decrypted) */
3732   DRIVER( mwalkj )   /* 1990.08 Micheal Jackson's Moonwalker (Japan, FD1094+8751, decrypted) */
3733   DRIVER( mwalk )      /* 1990.?? Micheal Jackson's Moonwalker (World, FD1094+8751, decrypted) */
3734   DRIVER( lghost )   /* 1990.?? Laser Ghost (World, FD1094, decrypted) */
3735                  /* 1990.12 Laser Ghost (Japan) */
3736   DRIVER( lghostu )   /* 1991.01 Laser Ghost (US, FD1094, decrypted) */
3737   DRIVER( cltchitr )   /* 1991.02 Clutch Hitter (US, FD1094, decrypted) */
3738   DRIVER( cltchtrj )   /* 1991.05 Clutch Hitter (Japan, FD1094, decrypted) */
3739   DRIVER( ddcrewj )   /* 1991.07 D.D.Crew (Japan, FD1094, decrypted) */
3740   DRIVER( ddcrewu )   /* 1991.09 D.D.Crew (US, FD1094, decrypted) */
3741   DRIVER( ddcrew )   /* 1991.?? D.D.Crew (World, FD1094, decrypted) */
3742   DRIVER( ddcrew2 )   /* 1991.?? D.D.Crew (World, FD1094, decrypted) */
3743   DRIVER( ddcrew1 )   /* 1991.?? D.D.Crew (World, FD1094, decrypted) */
3744   DRIVER( wwallyj )   /* 1992.06 Wally wo Sagase! (Japan, FD1094, decrypted) */
3745   DRIVER( wwallyja )   /* 1992.06 Wally wo Sagase! (Japan, FD1094, decrypted) */
3746                  /* 1992.10 Desert Breaker (Japan) */
3747   DRIVER( desertbr )   /* 1993.?? Desert Breaker (World, FD1094, decrypted) */
36803748   DRIVER( pontoon )
3681   DRIVER( lghost )   /* (c) 1990 (FD1094, decrypted) */
3682   DRIVER( lghostu )   /* (c) 1990 (FD1094, decrypted) */
3683   DRIVER( wwallyj )   /* (c) 1992 (FD1094, decrypted) */
3684   DRIVER( wwallyja )   /* (c) 1992 (FD1094, decrypted) */
36853749
36863750   /* System18 Bootlegs */
36873751   DRIVER( astormbl )   /* BOOTLEG */
r4425r4426
36913755
36923756
36933757   /* Outrun Hardware */
3694   DRIVER( outrun )   /* (c) 1986 (bootleg)*/
3695   DRIVER( outrun2 )   /* (c) 1986 (bootleg) */
3696   DRIVER( outrun1 )   /* (c) 1986 Deluxe? */
3697   DRIVER( outrunb )   /* (c) 1986 (protected beta bootleg) */
3698   DRIVER( toutrun )   /* (c) 1987 (FD1094, decrypted) */
3699   DRIVER( toutrun2 )   /* (c) 1987 (FD1094, decrypted) */
3700   DRIVER( toutrun1 )   /* (c) 1987 (protected) */
3701   DRIVER( toutrunu )   /* (c) 1987 (FD1094, decrypted) */
3702   DRIVER( shangon )   /* (c) 1987 (protected) */
3703   DRIVER( shangon3 )   /* (c) 1987 (FD1089B, decrypted) */
3704   DRIVER( shangon2 )   /* (c) 1987 (FD1089B, decrypted) */
3705   DRIVER( shangon1 )   /* (c) 1987 (FD1089B, decrypted) */
3706   DRIVER( shangnle )   /* (c) 1991 */
3758                  /* 1986.09 Outrun (Japan) */
3759                  /* 1986.11 Outrun (US) */
3760                  /* 1986.?? outrun (World) */
3761   DRIVER( outrun )
3762   DRIVER( outrun2 )
3763   DRIVER( outrun1 )
3764   DRIVER( outrunb )   /* 1986 (protected beta bootleg) */
3765                  /* 1987.04 Super Hang-On (Japan) */
3766                  /* 1987.06 Super Hang-On (US) */
3767                  /* 1987.?? Super Hang-On (World) */
3768   DRIVER( shangon )   /* 1987 (protected) */
3769   DRIVER( shangon3 )   /* 1987 (FD1089B, decrypted) */
3770   DRIVER( shangon2 )   /* 1987 (FD1089B, decrypted) */
3771   DRIVER( shangon1 )   /* 1987 (FD1089B, decrypted) */
3772   DRIVER( shangnle )   /* 1991 */
3773                  /* 1989.02 Turbo Outrun (Japan) */
3774                  /* 1989.04 Turbo Outrun (US) */
3775                  /* 1989.?? Turbo Outrun (World) */
3776   DRIVER( toutrun )   /* 1987 (FD1094, decrypted) */
3777   DRIVER( toutrun2 )   /* 1987 (FD1094, decrypted) */
3778   DRIVER( toutrun1 )   /* 1987 (protected) */
3779   DRIVER( toutrunu )   /* 1987 (FD1094, decrypted) */
37073780
37083781   /* X Board */
3709   DRIVER( aburner )   /* (c) 1987 */
3710   DRIVER( aburner2 )   /* (c) 1987 */
3711   DRIVER( thndrbld )   /* (c) 1987 (FD1094, decrypted) */
3712   DRIVER( thndrbd1 )   /* (c) 1987 */
3713   DRIVER( loffire )   /* (c) 1989 (FD1094, decrypted) */
3714   DRIVER( loffireu )   /* (c) 1989 (FD1094, decrypted) */
3715   DRIVER( loffirej )   /* (c) 1989 (FD1094, decrypted) */
3716   DRIVER( rachero )   /* (c) 1989 (FD1094, decrypted) */
3717   DRIVER( abcop )      /* (c) 1990 (FD1094, decrypted) */
3782   DRIVER( aburner )   /* 1987.07 After Burner (Japan) */
3783   DRIVER( aburner2 )   /* 1987.09 After Burner II (Japan) */
3784   DRIVER( thndrbd1 )   /* 1987.12 Thunder Blade (Japan, deluxe/standard) */
3785   DRIVER( thndrbld )   /* 1988.02 Thunder Blade (US?, upright, FD1094, decrypted) */
3786                  /* 1989.01 Last Survivor (Japan) */
3787   DRIVER( smgpj )      /* 1989.06 Super Monaco GP (Japan, FD1094, decrypted) */
3788   DRIVER( smgpja )   /* 1989.06 Super Monaco GP (Japan, FD1094, decrypted) */
3789   DRIVER( smgp )      /* 1989.?? Super Monaco GP (World, FD1094, decrypted) */
3790   DRIVER( smgp6 )      /* 1989.?? Super Monaco GP (World, FD1094, decrypted) */
3791   DRIVER( smgp5 )      /* 1989.?? Super Monaco GP (World, FD1094, decrypted) */
3792   DRIVER( smgpu )      /* 1989.08 Super Monaco GP (US, FD1094, decrypted) */
3793   DRIVER( smgpu3 )   /* 1989.08 Super Monaco GP (US, FD1094, decrypted) */
3794   DRIVER( smgpu2 )   /* 1989.08 Super Monaco GP (US, FD1094, decrypted) */
3795   DRIVER( smgpu1 )   /* 1989.08 Super Monaco GP (US, FD1094, decrypted) */
3796   DRIVER( loffirej )   /* 1989.12 Line of Fire (Japan, FD1094, decrypted) */
3797   DRIVER( loffire )   /* 1989.?? Line of Fire (World, FD1094, decrypted) */
3798   DRIVER( loffireu )   /* 1990.04 Line of Fire (US, FD1094, decrypted) */
3799                  /* 1990.03 Racing Hero (Japan) */
3800   DRIVER( rachero )   /* 1990.?? Racing Hero (World, FD1094, decrypted) */
3801   DRIVER( abcop )      /* 1990.?? A.B.Cop (World, FD1094, decrypted) */
3802                  /* 1991.01 A.B.Cop (Japan) */
3803                  /* 1990.10 GP Rider (Japan) */
3804   DRIVER( gprider )   /* 1990.?? GP Rider (World, protected) */
3805   DRIVER( gprider1 )   /* 1990.12 GP Rider (US, FD1094, decrypted) */
37183806
3719   DRIVER( gprider )   /* (c) 1990 (protected) */
3720   DRIVER( gprider1 )   /* (c) 1990 (FD1094, decrypted) */
3721   DRIVER( smgp )      /* (c) 1989 (FD1094, decrypted) */
3722   DRIVER( smgp6 )      /* (c) 1989 (FD1094, decrypted) */
3723   DRIVER( smgp5 )      /* (c) 1989 (FD1094, decrypted) */
3724   DRIVER( smgpu )      /* (c) 1989 (FD1094, decrypted) */
3725   DRIVER( smgpu3 )   /* (c) 1989 (FD1094, decrypted) */
3726   DRIVER( smgpu2 )   /* (c) 1989 (FD1094, decrypted) */
3727   DRIVER( smgpu1 )   /* (c) 1989 (FD1094, decrypted) */
3728   DRIVER( smgpj )      /* (c) 1989 (FD1094, decrypted) */
3729   DRIVER( smgpja )   /* (c) 1989 (FD1094, decrypted) */
3730
37313807   /* Y-Board */
3732   DRIVER( gforce2 )   /* (c) 1988 */
3733   DRIVER( gforce2j )   /* (c) 1988 */
3734   DRIVER( gloc )      /* (c) 1990 */
3735   DRIVER( glocr360 )   /* (c) 1990 */
3736   DRIVER( strkfgtr )   /* (c) 1991 */
3737   DRIVER( pdrift )   /* (c) 1988 */
3738   DRIVER( pdrifta )   /* (c) 1988 */
3739   DRIVER( pdrifte )   /* (c) 1988 */
3740   DRIVER( pdriftj )   /* (c) 1988 */
3741   DRIVER( rchase )   /* (c) 1991 */
3808                  /* 1988.05 Gaalxy Force (Japan) */
3809                  /* 1988.08 Galaxy Force (US) */
3810   DRIVER( gforce2j )   /* 1988.07 Galaxy Force II (Japan) */
3811   DRIVER( gforce2 )   /* 1988.?? Galaxy Force II (World) */
3812                  /* 1988.12 Galaxy Force II (US) */
3813                  /* 1988.08 Power Drift (US) */
3814   DRIVER( pdriftj )   /* 1988.09 Power Drift (Japan) */
3815   DRIVER( pdrift )   /* 1988.?? Power Drift (World) */
3816   DRIVER( pdrifta )
3817   DRIVER( pdrifte )
3818   DRIVER( gloc )      /* 1990.04 G-LOC Air Battle (US) */
3819                  /* 1990.05 G-LOC Air Battle (Japan) */
3820   DRIVER( glocr360 )   /* 1990.?? G-LOC (R360, World?) */
3821   DRIVER( strkfgtr )   /* 1991.06 Strike Fighter (Japan) */
3822   DRIVER( rchase )   /* 1991.09 Rail Chase (Japan) */
3823                  /* 1991.09 Rail Chase (US) */
37423824
3743/*
3744Sega System 24 game list
3745Apr.1988 Hot Rod
3746Oct.1988 Scramble Spirits
3747Nov.1988 Gain Ground
3748Apr.1989 Crack Down
3749Aug.1989 Jumbo Ozaki Super Masters
3750Jun.1990 Bonanza Bros.
3751Dec.1990 Rough Racer
3752Feb.1991 Quiz Syukudai wo Wasuremashita
3753Jul.1991 Dynamic C.C.
3754Dec.1991 Quiz Rouka ni Tattenasai
3755Dec.1992 Tokorosan no MahMahjan
3756May.1993 Quiz Mekurumeku Story
3757May.1994 Tokorosan no MahMahjan 2
3758Sep.1994 Quiz Ghost Hunter
3759*/
3825   /* Sega System 24 games */
37603826   /* disk based */
3761   DRIVER( hotrod )   /* (c) 1988 */
3762   DRIVER( hotroda )   /* (c) 1988 */
3763   DRIVER( hotrodj )   /* (c) 1988 */
3764   DRIVER( sspirits )    /* (c) 1988 */
3765   DRIVER( sspiritj )    /* (c) 1988 */
3766   DRIVER( sspirtfc )   /* (c) 1988 (protected) */
3767   DRIVER( gground )   /* (c) 1988 (FD1094, decrypted) */
3768   DRIVER( ggroundj )   /* (c) 1988 (FD1094, decrypted) */
3769   DRIVER( crkdown )   /* (c) 1989 (FD1094, decrypted) */
3770   DRIVER( crkdownu )   /* (c) 1989 (FD1094, decrypted) */
3771   DRIVER( crkdownj )   /* (c) 1989 (FD1094, decrypted) */
3772   DRIVER( sgmast )   /* (c) 1989 (protected) */
3773   DRIVER( sgmastc )   /* (c) 1989 (FD1094, decrypted) */
3774   DRIVER( sgmastj )   /* (c) 1989 (FD1094, decrypted) */
3775   DRIVER( roughrac )   /* (c) 1990 (FD1094, decrypted) */
3776   DRIVER( bnzabros )   /* (c) 1990 */
3777   DRIVER( bnzabrsj )   /* (c) 1990 */
3778   DRIVER( qsww )      /* (c) 1991 */
3779   DRIVER( dcclubfd )   /* (c) 1991 */
3827   DRIVER( hotrodj )   /* 1988.03 Hot Rod (Japan) */
3828   DRIVER( hotrod )   /* 1988.?? Hot Rod (World) */
3829   DRIVER( hotroda )
3830                  /* 1988.07 Hot Rod (US) */
3831   DRIVER( sspiritj )    /* 1988.10 Scramble Spirits (Japan) */
3832   DRIVER( sspirits )    /* 1988.?? Scramble Spirits (World) */
3833   DRIVER( sspirtfc )   /* 1988.?? Scramble Spirits (protected) */
3834                  /* 1988.11 Scramble Spirits (US) */
3835   DRIVER( ggroundj )   /* 1988.11 Gain Ground (Japan, FD1094, decrypted) */
3836   DRIVER( gground )   /* 1989.?? Gain Ground (World, FD1094, decrypted) */
3837                  /* 1989.03 Gain Ground (US) */
3838   DRIVER( crkdownj )   /* 1989.03 Crack Down (Japan, FD1094, decrypted) */
3839   DRIVER( crkdown )   /* 1989.?? Crack Down (World, FD1094, decrypted) */
3840   DRIVER( crkdownu )   /* 1989.06 Crack Down (US, FD1094, decrypted) */
3841   DRIVER( sgmastj )   /* 1989.06 Jumbo Ozaki Super Masters (Japan, FD1094, decrypted) */
3842   DRIVER( sgmast )   /* 1989.?? Super Masters Golf (World, protected) */
3843   DRIVER( sgmastc )   /* 1989.?? Jumbo Ozaki Super Masters Golf (World, FD1094, decrypted) */
3844                  /* 1989.09 Super Masters Golf (US) */
3845   DRIVER( roughrac )   /* 1990.03 Rough Racer (Japan, FD1094, decrypted) */
3846   DRIVER( bnzabrsj )   /* 1990.06 Bonanza Bros. (Japan) */
3847   DRIVER( bnzabros )   /* 1990.08 Bonanza Bros. (US) */
3848   DRIVER( qsww )      /* 1991.02 Quiz Syukudai wo Wasuremashita! (Japan) */
3849   DRIVER( dcclubfd )   /* 1991.07 Dynamic Country Club (US) */
37803850
37813851   /* ROM based */
3782   DRIVER( dcclub )   /* (c) 1991 */
3783   DRIVER( dcclubj )   /* (c) 1991 */
3784   DRIVER( mahmajn )   /* (c) 1992 */
3785   DRIVER( qgh )      /* (c) 1994 */
3786   DRIVER( quizmeku )   /* (c) 1994 */
3787   DRIVER( qrouka )   /* (c) 1994 */
3788   DRIVER( mahmajn2 )   /* (c) 1994 */
3852   DRIVER( dcclubj )   /* 1991.06 Dynamic Country Club (Japan) */
3853   DRIVER( dcclub )   /* 1991.?? Dynamic Country Club (World) */
3854   DRIVER( qrouka )   /* 1991.12 Quiz Rouka ni Tattenasai! (Japan) */
3855   DRIVER( mahmajn )   /* 1992.12 Tokorosan no Mahmahjong (Japan) */
3856   DRIVER( quizmeku )   /* 1993.05 Quiz Mekurumeku Story (Japan) */
3857   DRIVER( mahmajn2 )   /* 1994.05 Tokorosan no Mahmahjong 2 (Japan) */
3858   DRIVER( qgh )      /* 1994.09 Quiz Ghost Hunter */
37893859
37903860   /* Sega System 32 games */
3791   DRIVER( holo )      /* (c) 1992 (US) */
3792   DRIVER( svf )      /* (c) 1994 */
3793   DRIVER( svs )      /* (c) 1994 */
3794   DRIVER( jleague )   /* (c) 1994 (Japan) */
3795   DRIVER( brival )   /* (c) 1992 (World) */
3796   DRIVER( brivalj )   /* (c) 1992 (Japan) */
3797   DRIVER( radm )      /* (c) 1991 (World) */
3798   DRIVER( radmu )      /* (c) 1991 (US) */
3799   DRIVER( radr )      /* (c) 1991 (World) */
3800   DRIVER( radru )      /* (c) 1991 (US) */
3801   DRIVER( f1en )      /* (c) 1991 */
3802   DRIVER( alien3 )   /* (c) 1993 */
3803   DRIVER( alien3u )   /* (c) 1993 */
3804   DRIVER( sonic )      /* (c) 1992 (Japan) */
3805   DRIVER( sonicp )   /* (c) 1992 (Japan) */
3806   DRIVER( jpark )      /* (c) 1994 */
3807   DRIVER( kokoroj2 )   /* (c) 1994 */
3808   DRIVER( ga2 )      /* (c) 1992 (World) */
3809   DRIVER( ga2u )      /* (c) 1992 (US) */
3810   DRIVER( ga2j )      /* (c) 1992 (Japan) */
3811   DRIVER( spidman )   /* (c) 1991 (World) */
3812   DRIVER( spidmanu )   /* (c) 1991 (US) */
3813   DRIVER( arabfgt )   /* (c) 1991 */
3814   DRIVER( arabfgtu )   /* (c) 1991 (US) */
3815   DRIVER( arabfgtj )   /* (c) 1991 (Japan) */
3816   DRIVER( arescue )   /* (c) 1992 */
3817   DRIVER( f1lap )      /* (c) 1993 */
3818   DRIVER( dbzvrvs )   /* (c) 1994 Sega/Banpresto */
3819   DRIVER( darkedge )   /* (c) 1992 */
3820   DRIVER( darkedgj )   /* (c) 1992 (Japan) */
3821   DRIVER( slipstrm )   /* (c) 1995 Capcom */
3822   DRIVER( slipstrh )   /* (c) 1995 Capcom */
3861   DRIVER( radm )      /* 1991.?? Rad Mobile (World) */
3862   DRIVER( radmu )      /* 1991.03 Rad Mobile (US) */
3863                  /* 1991.02 Rad Mobile (Japan) */
3864   DRIVER( radr )      /* 1991.?? Rad Rally (World) */
3865   DRIVER( radru )      /* 1991.09 Rad Rally (US) */
3866                  /* 1991.07 Rad Rally (Japan) */
3867   DRIVER( spidman )   /* 1991.?? Spiderman (World) */
3868   DRIVER( spidmanu )   /* 1991.09 Spiderman (US) */
3869                  /* 1991.09 Spiderman (Japan) */
3870                  /* 1991.10 Hologram Time Traveler (Japan) */
3871   DRIVER( f1en )      /* 1991.?? F-1 Exhaust Note (World) */
3872                  /* 1992.01 F-1 Exhaust Note (US) */
3873                  /* 1991.11 F-1 Exhaust Note (Japan) */
3874   DRIVER( arabfgt )   /* 1992.?? Arabian Fight (World) */
3875   DRIVER( arabfgtu )   /* 1992.03 Arabian Fight (US) */
3876   DRIVER( arabfgtj )   /* 1992.03 Arabian Fight (Japan) */
3877   DRIVER( arescue )   /* 1992.03 Air Rescur (US) */
3878                  /* 1992.04 Air Rescue (Japan) */
3879   DRIVER( ga2 )      /* 1992.?? Golden Axe II (World) */
3880   DRIVER( ga2u )      /* 1992.09 Golden Axe II (US) */
3881   DRIVER( ga2j )      /* 1992.10 Golden Axe Death Adder no Fukusyuu (Japan) */
3882   DRIVER( holo )      /* 1992.?? Hologram Holosseum (US) */
3883                  /* 1992.11 Hologram Holosseum (Japan) */
3884   DRIVER( darkedge )   /* 1993.?? Dark Edge (World) */
3885                  /* 1993.?? Dark Edge (US) */
3886   DRIVER( darkedgj )   /* 1993.03 Dark Edge (Japan) */
3887   DRIVER( brival )   /* 1993.?? Burning Rival (World) */
3888   DRIVER( brivalj )   /* 1993.08 Burning Rival (Japan) */
3889   DRIVER( f1lap )      /* 1993.?? F-1 Super Lap (World) */
3890                  /* 1993.09 F-1 Super Lap (Japan) */
3891   DRIVER( alien3 )   /* 1993.?? Aliens 3 (World) */
3892   DRIVER( alien3u )   /* 1993.11 Aliens 3 (US) */
3893                  /* 1993.09 Aliens 3 the Gun (Japan) */
3894   DRIVER( sonic )      /* 1993.09 Sonic the Hedgehog (Japan) */
3895   DRIVER( sonicp )   /* 1993.?? Sonic the Hedgehog (proto, Japan) */
3896   DRIVER( kokoroj2 )   /* 1993.12 Soreike! Kokoroji 2 (Japan) */
3897   DRIVER( jpark )      /* 1994.?? Jurassic Park (World)  */
3898                  /* 1994.?? Jurassic Park (US) */
3899                  /* 1994.02 Jurassic Park (Japan) */
3900   DRIVER( dbzvrvs )   /* 1994.03 Dragon Ball Z V.R.V.S. (Japan) */
3901   DRIVER( jleague )   /* 1994.07 The J League 1994 (Japan) */
3902   DRIVER( svf )      /* 1994.?? Super Visual Football */
3903   DRIVER( svs )      /* 1994.?? Super Visual Soccer */
3904   DRIVER( slipstrm )   /* 1995.?? Slip Stream (Capcom) */
3905   DRIVER( slipstrh )
38233906
38243907   /* Sega Multi System 32 games */
3825   DRIVER( orunners )   /* (c) 1992 (World) */
3826   DRIVER( orunneru )   /* (c) 1992 (US) */
3827   DRIVER( harddunk )   /* (c) 1994 (World) */
3828   DRIVER( harddunj )   /* (c) 1994 (Japan) */
3829   DRIVER( titlef )   /* (c) 1992 (World) */
3830   DRIVER( titlefu )   /* (c) 1992 (US) */
3831   DRIVER( scross )   /* (c) 1992 (World) */
3832   DRIVER( scrossu )   /* (c) 1992 (World) */
3908                  /* 1993.05 Outrunners (Japan) */
3909   DRIVER( orunners )   /* 1993.?? Outrunners (World) */
3910   DRIVER( orunneru )   /* 1993.06 Outrunners (US) */
3911   DRIVER( harddunj )   /* 1994.04 Hard Dunk 3on3 (Japan) */
3912   DRIVER( harddunk )   /* 1994.?? Hard Dunk 3on3 (World) */
3913                  /* 1993.03 Title Fight (Japan) */
3914   DRIVER( titlef )   /* 1993.?? Title Fight (World) */
3915   DRIVER( titlefu )   /* 1993.04 Title Fight (US) */
3916                  /* 1992.07 Stadium Cross (Japan) */
3917   DRIVER( scross )   /* 1992.?? Stadium Cross (World) */
3918   DRIVER( scrossu )   /* 1992.09 Stadium Cross (US) */
38333919
38343920   /* Model 1 Games */
3835   DRIVER( vf )      /* (c) 1993 */
3836   DRIVER( vr )      /* (c) 1992 */
3837   DRIVER( vformula )   /* (c) 1993 */
3838   DRIVER( swa )      /* (c) 1993 */
3839   DRIVER( wingwar )   /* (c) 1994 */
3840   DRIVER( wingwara )   /* (c) 1994 (US) */
3921   DRIVER( vr )      /* 1992.08 Virtua Racing */
3922   DRIVER( vf )      /* 1993.12 Virtua Fighter */
3923   DRIVER( vformula )   /* 1993.?? Virtua Formula */
3924   DRIVER( swa )      /* 1994.04 Star Wars Arcade */
3925   DRIVER( wingwar )   /* 1994.06 Wing War */
3926   DRIVER( wingwara )   /* 1994.09 Wing War (US) */
38413927
38423928   /* Sega H1 games */
3843   DRIVER( coolridr )   /* (c) 1995 */
3929   DRIVER( coolridr )   /* 1995.04 Cool Riders */
38443930
38453931   /* Sega ST-V games */
38463932   DRIVER( stvbios )
3847   DRIVER( astrass )   /* (c) 1998 Sunsoft */
3848   DRIVER( bakubaku )   /* (c) 1996 */
3849   DRIVER( colmns97 )   /* (c) 1996 */
3850   DRIVER( cotton2 )   /* (c) 1997 Success */
3851   DRIVER( cottonbm )   /* (c) 1998 Success */
3852   DRIVER( decathlt )   /* (c) 1995 */
3853   DRIVER( decathlo )   /* (c) 1995 */
3854   DRIVER( diehard )   /* (c) 1996 */
3855   DRIVER( dnmtdeka )   /* (c) 1996 */
3856   DRIVER( ejihon )   /* (c) 1995 */
3857   DRIVER( elandore )   /* (c) 1998 Sai-Mate */
3858   DRIVER( ffreveng )   /* (c) 1999 Capcom */
3859   DRIVER( fhboxers )   /* (c) 1995 */
3860   DRIVER( findlove )   /* (c) 1996 Daika / FCF */
3861   DRIVER( finlarch )   /* (c) 1995 */
3862   DRIVER( gaxeduel )   /* (c) 1994 */
3863   DRIVER( grdforce )   /* (c) 1998 Success */
3864   DRIVER( groovef )   /* (c) 1996 Atlus */
3865   DRIVER( hanagumi )   /* (c) 1998 */
3866   DRIVER( introdon )   /* (c) 1996 Sunsoft / Success */
3867   DRIVER( kiwames )   /* (c) 1995 Athena */
3868   DRIVER( maruchan )   /* (c) 1992 Sega / Toyosuisan */
3869   DRIVER( myfairld )   /* (c) 1998 Micronet */
3870   DRIVER( othellos )   /* (c) 1998 Success */
3871   DRIVER( pblbeach )   /* (c) 1995 T&E Soft */
3872   DRIVER( prikura )   /* (c) 1996 Atlus */
3873   DRIVER( puyosun )   /* (c) 1996 Compile */
3874   DRIVER( rsgun )      /* (c) 1998 Treasure */
3875   DRIVER( sandor )   /* (c) 1995 */
3876   DRIVER( sanjeon )   /* (c) 1999 Sega / Deniam */
3877   DRIVER( thunt )      /* (c) 1995 Sega (Deniam License) */
3878   DRIVER( thuntk )   /* (c) 1995 Sega (Deniam License) */
3879   DRIVER( sasissu )   /* (c) 1992 */
3880   DRIVER( seabass )   /* (c) 1998 A wave Inc (Able License) */
3881   DRIVER( shanhigw )   /* (c) 1996 */
3882   DRIVER( shienryu )   /* (c) 1997 Warashi */
3883   DRIVER( smleague )   /* (c) 1995 */
3884   DRIVER( sokyugrt )   /* (c) 1996 Raizing / 8ing */
3885   DRIVER( sss )      /* (c) 1998 Capcom / Cave / Victor */
3886   DRIVER( suikoenb )   /* (c) 1995 Data East */
3887   DRIVER( twcup98 )   /* (c) 1998 Techmo */
3888   DRIVER( stress )   /* (c) 1997 Sega */
3889   DRIVER( vfkids )   /* (c) 1995 */
3890   DRIVER( vfremix )   /* (c) 1996 */
3891   DRIVER( vmahjong )   /* (c) 1997 Micronet */
3892   DRIVER( winterht )   /* (c) 1997 */
3893   DRIVER( znpwfv )   /* (c) 1997 */
3933                  /* 1994.07 Sports Fishing */
3934   DRIVER( gaxeduel )   /* 1995.02 Golden Axe the Duel */
3935   DRIVER( suikoenb )   /* 1995.03 Suiko Enbu (Data East) */
3936   DRIVER( bakubaku )   /* 1995.04 Bakubaku Animal */
3937   DRIVER( vfremix )   /* 1995.06 Virtua Fighter Remix */
3938   DRIVER( ejihon )   /* 1995.07 Ejihon Tantei Jimusyo */
3939   DRIVER( finlarch )   /* 1995.07 Final Arch */
3940   DRIVER( sfish2j )   /* 1995.08 Sports Fishing 2 (Japan) */
3941   DRIVER( shanhigw )   /* 1995.08 Shanghai Banri no Choujou */
3942   DRIVER( sandor )   /* 1995.11 Nido Aru Koto wa Sando-R */
3943   DRIVER( kiwames )   /* 1995.11 Pro Mahjong Kiwame S (Athena) */
3944   DRIVER( sfish2 )   /* 1995.11 Sports Fishing 2 (Export) */
3945   DRIVER( critcrsh )   /* 1995.?? Critter Crusher */
3946                  /* 1995.12 Tatakott */
3947   DRIVER( batmanfr )   /* 1996.02 Batman Forever (Acclaim) */
3948   DRIVER( fhboxers )   /* 1996.02 Funky Head Boxers */
3949   DRIVER( vfkids )   /* 1996.03 Virtua Fighter Kids */
3950   DRIVER( pblbeach )   /* 1996.03 Pebble Beach the Great Shot (T&E Soft) */
3951   DRIVER( introdon )   /* 1996.04 Karaoke Quiz Intro Dondon (Sunsoft / Success) */
3952   DRIVER( smleague )   /* 1996.04 Super Major League */
3953   DRIVER( decathlt )   /* 1996.05 Decathlete */
3954   DRIVER( decathlo )
3955   DRIVER( dnmtdeka )   /* 1996.07 Dynamite Deka */
3956   DRIVER( mausuke )   /* 1996.07 Mausuke no Ojama the World (Data East) */
3957   DRIVER( diehard )   /* 1996.08 Die Hard Arcade */
3958   DRIVER( sokyugrt )   /* 1996.09 Soukyuu Gurentai (Raizing / 8ing) */
3959   DRIVER( prikura )   /* 1996.10 Prikura Daisakusen (Atlus) */
3960   DRIVER( magzun )   /* 1996.11 Magical Zunou Power */
3961   DRIVER( puyosun )   /* 1996.12 Puyo Puyo SUN (Compile) */
3962   DRIVER( colmns97 )   /* 1997.01 Columns 97 */
3963   DRIVER( shienryu )   /* 1997.02 Shienryu (Warashi) */
3964   DRIVER( vmahjong )   /* 1997.02 Virtual Mahjong (Micronet) */
3965   DRIVER( groovef )   /* 1997.05 Groove on Fight (Atlus) */
3966   DRIVER( winterht )   /* 1997.10 Winter Heat (Data East) */
3967   DRIVER( cotton2 )   /* 1997.11 Cotton 2 (Success) */
3968   DRIVER( hanagumi )   /* 1997.11 Sakura Taisen Hanagumi Taisen Columns */
3969   DRIVER( findlove )   /* 1997.12 Find Love (Daiki / FCF) */
3970   DRIVER( maruchan )   /* 1997.12 Maruchan de Goo!!! */
3971   DRIVER( znpwfv )   /* 1997.12 Zen Nippon Pro Wrestling featuring Virtua */
3972   DRIVER( seabass )   /* 1998.02 Sea Bass Fishing (A wave Inc (Able License)) */
3973   DRIVER( sasissu )   /* 1998.02 Taisen Tanto-R Sasissu!! */
3974                  /* 1998.03 Bass Master Challenge */
3975   DRIVER( twcup98 )   /* 1998.04 Tecmo World Cup '98 (Tecmo) */
3976   DRIVER( grdforce )   /* 1998.05 Guardian Force (Success) */
3977   DRIVER( rsgun )      /* 1998.05 Radient Silver Gun (Treasure) */
3978   DRIVER( astrass )   /* 1998.06 Astra Super Stars (Sunsoft) */
3979   DRIVER( myfairld )   /* 1998.07 My Fair Lady (Micronet) */
3980   DRIVER( othellos )   /* 1998.07 Othello Shiyouyo (Success) */
3981   DRIVER( cottonbm )   /* 1998.09 Cotton Boomerang (Success) */
3982   DRIVER( stress )   /* 1998.10 Stress Busters */
3983   DRIVER( elandore )   /* 1998.11 Touryuu Densetsu Elandore (Sai-Mate) */
3984   DRIVER( sss )      /* 1998.12 Steep Slope Sliders (Capcom / Cave / Victor) */
3985   DRIVER( danchih )   /* 1999.06 Danchi de Hanafuda Okusan Komeya Desuyo! (Altron (Tecmo License)) */
3986   DRIVER( ffreveng )   /* 1999.09 Final Fight Revenge (Capcom) */
3987                  /* 2000.12 Danchi de Quiz Okusan Yontaku Desuyo! (Altron) */
38943988
3895   DRIVER( danchih )   /* (c) 1999 Altron (Tecmo License) */
3896   DRIVER( mausuke )   /* (c) 1995 Data East */
3897   DRIVER( batmanfr )   /* (c) 1996 Acclaim */
3989   DRIVER( thunt )      /* 1995.?? Puzzle & Action Treasure Hunt (Sega (Deniam License)) */
3990   DRIVER( thuntk )
3991   DRIVER( sanjeon )   /* 1999.?? Sanjun Sujun (Sega / Deniam) */
38983992
3899   DRIVER( critcrsh )   /* (c) 1995 Sega */
3900
3901   DRIVER( sfish2 )   /* (c) 1995 */
3902   DRIVER( sfish2j )   /* (c) 1995 */
3903   DRIVER( magzun )   /* (c) 1995 */
39043993   DRIVER( nclubv3 )
39053994
39063995   /* Sega Model 2 Games */
39073996
39083997   /* Model 2 (TGPs, Model 1 sound board) */
3909   DRIVER( daytona )   /* 1993 */
3910   DRIVER( dayton93 )   /* 1993 */
3911   DRIVER( daytonas )   /* 1993 */
3998   DRIVER( daytona )   /* 1994.03 Daytona USA */
3999   DRIVER( dayton93 )
4000   DRIVER( daytonas )
39124001   DRIVER( daytonat )   /* 1993, hack */
39134002   DRIVER( daytonam )   /* 1993, hack */
3914   DRIVER( desert )   /* 1994 */
3915   DRIVER( vcop )      /* 1994 */
4003   DRIVER( desert )   /* 1994.07 Desert Tank */
4004   DRIVER( vcop )      /* 1994.09 Virtua Cop */
39164005
39174006   /* Model 2A-CRX (TGPs, SCSP sound board) */
3918   DRIVER( manxtt )   /* 1995 */
3919   DRIVER( motoraid )   /* 1995 */
3920   DRIVER( srallyc )   /* 1995 */
3921   DRIVER( vf2 )      /* 1995 */
3922   DRIVER( vf2b )      /* 1995 */
3923   DRIVER( vf2a )      /* 1995 */
3924   DRIVER( vf2o )      /* 1995 */
3925   DRIVER( vcop2 )      /* 1995 */
3926   DRIVER( doaa )      /* 1996 */
3927   DRIVER( zeroguna )   /* 1997 */
3928   DRIVER( dynamcop )   /* 1998 */
3929   DRIVER( dyndeka2 )   /* 1998 */
3930   DRIVER( pltkidsa )   /* 1998 */
4007   DRIVER( vf2o )      /* 1994.11 Virtua Fighter 2 */
4008   DRIVER( vf2a )      /* 1995.?? */
4009   DRIVER( vf2b )      /* 1995.?? */
4010   DRIVER( srallyc )   /* 1995.02 Sega Rally Championship */
4011   DRIVER( vcop2 )      /* 1995.09 Virtua Cop 2 */
4012   DRIVER( vf2 )      /* 1995.09 Virtua Fighter 2.1*/
4013                  /* 1995.10 Sky Target */
4014   DRIVER( manxtt )   /* 1995.11 Manx T.T. */
4015                  /* 1996.08 Dynamite Baseball */
4016   DRIVER( doaa )      /* 1996.11 Dead or Alive */
4017                  /* 1997.04 Dynamite Baseball '97 */
4018   DRIVER( motoraid )   /* 1997.10 Motor Raid */
4019   DRIVER( zeroguna )   /* 1997.12 Zero Gunner */
4020   DRIVER( dyndeka2 )   /* 1998.05 Dynamite Deka 2 */
4021   DRIVER( dynamcop )   /* 1998.09 Dynamic Cop */
4022   DRIVER( pltkidsa )   /* 1999.03 Pilot Kids */
39314023
39324024   /* Model 2B-CRX (SHARC, SCSP sound board) */
3933   DRIVER( vstriker )   /* 1994 */
3934   DRIVER( vstrikro )   /* 1994 */
3935   DRIVER( fvipers )   /* 1995 */
3936   DRIVER( gunblade )   /* 1995 */
3937   DRIVER( indy500 )   /* 1995 */
3938   DRIVER( indy500d )   /* 1995 */
3939   DRIVER( skytargt )   /* 1995 */
3940   DRIVER( schamp )   /* 1996 */
3941   DRIVER( lastbrnx )   /* 1996 */
3942   DRIVER( lastbrnj )   /* 1996 */
3943   DRIVER( doa )      /* 1996 */
3944   DRIVER( sgt24h )   /* 1996 */
3945   DRIVER( von )      /* 1996 */
3946   DRIVER( vonj )      /* 1996 */
3947   DRIVER( dynabb )   /* 1996 */
3948   DRIVER( zerogun )   /* 1997 */
3949   DRIVER( zerogunj )   /* 1997 */
3950   DRIVER( dynmcopb )   /* 1998 */
3951   DRIVER( dyndek2b )   /* 1998 */
3952   DRIVER( pltkids )   /* 1998 */
3953   DRIVER( rchase2 )   /* 199? */
4025   DRIVER( vstriker )   /* 1995.05 virtua Striker */
4026   DRIVER( vstrikro )
4027   DRIVER( rchase2 )   /* 1995.06 Rail Chase 2 */
4028   DRIVER( indy500 )   /* 1995.07 Indy 500 */
4029   DRIVER( indy500d )
4030   DRIVER( skytargt )   /* 1995.10 Sky Target */
4031   DRIVER( fvipers )   /* 1995.11 Fighting Vipers */
4032   DRIVER( von )      /* 1996.01 Dennou Senki Virtual-On */
4033   DRIVER( vonj )
4034   DRIVER( gunblade )   /* 1996.04 Gunblade N.Y. */
4035   DRIVER( schamp )   /* 1996.05 Sonic the Fighters */
4036   DRIVER( lastbrnx )   /* 1996.06 Last Bronx */
4037   DRIVER( lastbrnj )
4038   DRIVER( sgt24h )   /* 1996.07 Super GT 24h */
4039   DRIVER( dynabb )   /* 1996.08 Dynamite Baseball */
4040   DRIVER( doa )      /* 1996.11 Dead or Alive */
4041                  /* 1997.04 Dynamite Baseball '97 */
4042   DRIVER( zerogun )   /* 1997.12 Zero Gunner */
4043   DRIVER( zerogunj )
4044   DRIVER( dyndek2b )   /* 1998.05 Dynamite Deka 2 */
4045   DRIVER( dynmcopb )   /* 1998.09 Dynamite Cop */
4046   DRIVER( pltkids )   /* 1999.03 Pilot Kids */
39544047
39554048   /* Model 2C-CRX (TGPx4, SCSP sound board) */
3956   DRIVER( skisuprg )   /* 1996 */
3957   DRIVER( stcc )      /* 1996 */
3958   DRIVER( waverunr )   /* 1996 */
3959   DRIVER( hotd )      /* 1997 */
3960   DRIVER( overrev )   /* 1997 */
3961   DRIVER( segawski )   /* 1997 */
3962   DRIVER( topskatr )   /* 1997 */
3963   DRIVER( topskatu )   /* 1997 */
3964   DRIVER( bel )      /* 1998 */
3965   DRIVER( dynmcopc )   /* 1998 */
4049   DRIVER( skisuprg )   /* 1996.12 Sega Ski Super G */
4050   DRIVER( stcc )      /* 1996.09 Sega Touring Car Championship */
4051   DRIVER( waverunr )   /* 1996.10 Wave Runner */
4052   DRIVER( hotd )      /* 1997.03 The House of the Dead */
4053   DRIVER( topskatr )   /* 1997.05 Top Skater */
4054   DRIVER( topskatu )
4055   DRIVER( overrev )   /* 1997.09 Overrev */
4056   DRIVER( segawski )   /* 1997.09 Sega Water Ski */
4057   DRIVER( dynmcopc )   /* 1998.09 Dynamite Cop */
4058   DRIVER( bel )      /* 1998.12 Behind Enemy Lines */
39664059
39674060   /* Sega Model 3 Games */
39684061
39694062   /* Step 1.0 */
3970   DRIVER( vf3 )      /* 1996 */
3971   DRIVER( vf3a )      /* 1996 */
3972   DRIVER( vf3tb )      /* 1996 */
3973   DRIVER( bass )      /* 1997 */
3974   DRIVER( getbass )   /* 1997 */
4063   DRIVER( vf3 )      /* 1996.09 Virtua Fighter 3 */
4064   DRIVER( vf3a )
4065   DRIVER( vf3tb )      /* 1997.10 Virtua Fighter 3tb */
4066   DRIVER( bass )      /* 1997.12 Get Bass */
4067   DRIVER( getbass )
4068                  /* 1998.03 Get Bass Brast */
39754069
39764070   /* Step 1.5 */
3977   DRIVER( scud )      /* 1996 */
3978   DRIVER( scudj )      /* 1996 */
3979   DRIVER( scuda )      /* 1996 */
3980   DRIVER( scudp )      /* 1997 */
3981   DRIVER( lostwsga )   /* 1997 */
3982   DRIVER( vs215 )      /* 1997 */
3983   DRIVER( lemans24 )   /* 1997 */
3984   DRIVER( vs29815 )   /* 1998 */
4071   DRIVER( scud )      /* 1996.12 Scud Race */
4072   DRIVER( scudj )
4073   DRIVER( scuda )
4074   DRIVER( vs215 )      /* 1997.06 Virtua Striker 2 */
4075   DRIVER( lostwsga )   /* 1997.07 Lost World Jurassic Park */
4076   DRIVER( scudp )      /* 1997.09 Scud Race Plus */
4077   DRIVER( lemans24 )   /* 1997.09 Le Mans 24 */
4078   DRIVER( vs29815 )   /* 1998.05 Virtua Striker 2 ver.98 */
39854079
39864080   /* Step 2.0 */
3987   DRIVER( vs2 )      /* 1997 */
3988   DRIVER( harley )   /* 1997 */
3989   DRIVER( skichamp )   /* 1998 */
3990   DRIVER( srally2 )   /* 1998 */
3991   DRIVER( sraly2dx )   /* 1998 */
3992   DRIVER( von2 )      /* 1998 */
3993   DRIVER( von254g )   /* 1998 */
3994   DRIVER( fvipers2 )   /* 1998 */
3995   DRIVER( vs298 )      /* 1998 */
3996   DRIVER( vs2v991 )   /* 1999 */
3997   DRIVER( vs299 )      /* 1999 */
4081   DRIVER( vs2 )      /* 1997.06 Virtua Striker 2 */
4082   DRIVER( harley )   /* 1997.12 Harley Davidson & L.A.Riders */
4083   DRIVER( skichamp )   /* 1998.01 Ski Champ */
4084   DRIVER( srally2 )   /* 1998.02 Sega Rally 2 Championship */
4085   DRIVER( sraly2dx )
4086   DRIVER( von2 )      /* 1998.03 Dennou Senki Virtual-On Oratorio Tangram */
4087   DRIVER( fvipers2 )   /* 1998.04 Fighting Vipers 2 */
4088   DRIVER( vs298 )      /* 1998.05 Virtua Striker 2 ver.98*/
4089   DRIVER( vs299 )      /* 1998.12 Virtual Striker 2 ver.99 */
4090   DRIVER( vs2v991 )   /* 1999.?? Virtual Striker 2 ver.99.1 */
4091   DRIVER( von254g )   /* 1999.05 Dennou Senki Virtual-On Oratorio Tangram ver.5.4 */
39984092
39994093   /* Step 2.1 */
4000   DRIVER( daytona2 )   /* 1998 */
4001   DRIVER( dayto2pe )   /* 1998 */
4002   DRIVER( dirtdvls )   /* 1998 */
4003   DRIVER( dirtdvla )   /* 1998 */
4004   DRIVER( swtrilgy )   /* 1998 */
4005   DRIVER( swtrilga )   /* 1998 */
4006   DRIVER( spikeout )   /* 1998 */
4007   DRIVER( spikeofe )   /* 1998 */
4008   DRIVER( eca )      /* 1999 */
4009   DRIVER( ecax )      /* 1999 */
4094   DRIVER( daytona2 )   /* 1998.06 Daytona USA 2 */
4095                  /* 1998.09 Ocean Hunter */
4096   DRIVER( spikeout )   /* 1998.09 Spikeout */
4097   DRIVER( dirtdvls )   /* 1998.10 Dirt Devils */
4098   DRIVER( dirtdvla )
4099   DRIVER( swtrilgy )   /* 1998.11 Star Wars Trilogy Arcade */
4100   DRIVER( swtrilga )
4101                  /* 1998.11 Magical Trocco Adventure */
4102                  /* 1998.12 L.A. Machine Guns */
4103   DRIVER( dayto2pe )   /* 1998.12 Daytone USA 2 Power Edition */
4104                  /* 1998.12 Virtua Striker 2 ver.99 */
4105   DRIVER( spikeofe )   /* 1999.01 Spikeout Final Edition */
4106   DRIVER( eca )      /* 1999.10 Kyukyuusya Emergency Call Ambulance */
4107   DRIVER( ecax )
40104108
40114109
40124110   /* Deniam games */
r4425r4426
41914289   DRIVER( dybb99 )   /* 1999.11 Dynamite Baseball '99 */
41924290   DRIVER( doa2 )      /* 1999.11 Dead or Alive 2 */
41934291   DRIVER( samba )      /* 1999.12 Samba de Amigo */
4194   DRIVER( vtennis )   /* 1999.12 Power Smash */
4292   DRIVER( vtennis )   /* 1999.12 Virtua Tennis / Power Smash (ROM) */
4293   DRIVER( vtennisg )   /* 1999.12 Virtua Tennis / Power Smash (GD-ROM) */
41954294                  /* 1999.12 Puyopuyo DA! */
41964295                  /* 1999.12 Mars TV */
41974296                  /* 2000.01 18 Wheeler */
r4425r4426
42014300                  /* 2000.02 Touch de UNO! 2 */
42024301   DRIVER( virnba )   /* 2000.02 Virtua NBA */
42034302   DRIVER( smarinef )   /* 2000.03 Sega Marine Fishing */
4204                  /* 2000.03 Marble vs. Capcom 2 */
4303                  /* 2000.03 Marvel vs. Capcom 2 */
42054304                  /* 2000.03 World Kicks */
42064305   DRIVER( pstone2 )   /* 2000.04 Power Stone 2 */
42074306                  /* 2000.04 Shin Nippon Pro-wres Toukon Retsuden 4 */
r4425r4426
42214320                  /* 2000.10 Death Crimson OX */
42224321                  /* 2000.11 WWF Royal Rumble */
42234322                  /* 2000.11 Ninja Assault */
4224                  /* 2000.11 Confidential Mission */
4323   DRIVER( confmiss )   /* 2000.11 Confidential Mission */                                 /* First GD-ROM game? */
42254324                  /* 2000.11 Shakatto Tambourine */
42264325                  /* 2000.12 Samba de Amigo ver.2000 */
42274326                  /* 2000.12 Derby Owners Club 2000 ver.2 */
r4425r4426
42384337                  /* 2001.04 Shakatto Tambourine Motto Norinori Shinkyoku Tsuika */
42394338   DRIVER( dygolf )   /* 2001.04 Dynamic Golf */
42404339                  /* 2001.05 Wild Riders */
4241                  /* 2001.05 Monkey Ball */
4340   DRIVER( monkeyba )   /* 2001.05 Monkey Ball */
42424341                  /* 2001.06 Club Cart */
42434342   DRIVER( cvsgd )      /* 2001.06 Capcom vs. SNK Pro */
42444343                  /* 2001.06 Crackin' DJ Part2 */
42454344   DRIVER( wsbbgd )   /* 2001.06 Super Major League */
4246                  /* 2001.07 Beach Spikers */
4345   DRIVER( beachspi )   /* 2001.07 Beach Spikers */
42474346   DRIVER( spkrbtl )   /* 2001.07 Spikers Battle */
42484347                  /* 2001.07 Dokidoki Idol Star Seeker */
42494348                  /* 2001.08 Wave Runner GP */
4250   DRIVER( vf4 )      /* 2001.08 Virtua Fighter 4 */
4349   DRIVER( vf4 )      /* 2001.08 Virtua Fighter 4 (Naomi 2) */
42514350   DRIVER( cvs2gd )   /* 2001.08 Capcom vs. SNK 2 */
42524351   DRIVER( hmgeo )      /* 2001.09 Heavy Metal Geo Matrix */
42534352                  /* 2001.09 Alien Front */
42544353   DRIVER( gundmxgd )   /* 2001.09 Kidou Senshi Gundam Renpou vs. Zeon DX */
42554354                  /* 2001.10 Derby Owners Club 2 */
42564355                  /* 2001.10 Inu no Osanpo */
4257                  /* 2001.10 Power Smash 2 */
4356   DRIVER( vtennis2 )  /* 2001.10 Power Smash 2 / Virtua Tennis 2 */
42584357                  /* 2001.11 La Keyboardu */
42594358                  /* 2001.11 Shakatto Tambourine Cho Powerup Chu */
42604359   DRIVER( ikaruga )   /* 2001.12 Ikaruga */
4261                  /* 2001.12 Lupin the Third the Shooting */
4360   DRIVER( lupinsho)   /* 2001.12 Lupin the Third the Shooting */
42624361                  /* 2002.02 The King of Route 66 */
4263   DRIVER( initd )      /* 2002.03 Initial D Arcade Stage */
4362   DRIVER( initd )      /* 2002.03 Initial D Arcade Stage (Naomi 2) */
42644363   DRIVER( vathlete )   /* 2002.03 Virtua Athlete */
4265                  /* 2002.04 Lupin the Third the Typing */
4364   DRIVER( luptype )   /* 2002.04 Lupin the Third the Typing */
42664365   DRIVER( ggxx )      /* 2002.05 Guilty Gear XX */
42674366                  /* 2002.05 Cleopatra Fortune + */
4268                  /* 2002.05 The Maze of the Kings */
4367   DRIVER( mok )      /* 2002.05 The Maze of the Kings */
42694368                  /* 2002.06 World Club Champion Football */
42704369   DRIVER( chocomk )   /* 2002.06 Musapy no Choco Marker */
42714370                  /* 2002.07 Mazan */
42724371                  /* 2002.07 Soul Surfer */
4273                  /* 2002.08 Virtua Fighter 4 Evolution */
4372   DRIVER( vf4evo )   /* 2002.08 Virtua Fighter 4 Evolution (Naomi 2) */
42744373                  /* 2002.09 Yonin Uchi Mahjong MJ */
4275                  /* 2002.12 Initial D Arcade Stage ver.2 */
4374   DRIVER( initdv2j )   /* 2002.12 Initial D Arcade Stage ver.2 */
42764375                  /* 2002.12 Moeru Casinyo */
42774376   DRIVER( quizqgd )   /* 2003.01 Quiz Keitai Q mode */
42784377                  /* 2003.02 Kouchuu Ouja Mushiking */
r4425r4426
42804379                  /* 2003.03 WCCF 2001-2002 ver.2.0 */
42814380   DRIVER( ggxxrl )   /* 2003.03 Guilty Gear XX # Reload */
42824381   DRIVER( shikgam2 )   /* 2003.04 Shikigami no Shiro 2 */
4283                  /* 2003.04 Border Down */
4382   DRIVER( bdrdown )   /* 2003.04 Border Down */
42844383                  /* 2003.09 WCCF 2002-2003 */
4285                  /* 2003.11 Psyvariar 2 */
4286                  /* 2003.11 Puyopuyo Fever */
4384   DRIVER( psyvar2 )   /* 2003.11 Psyvariar 2 */
4385   DRIVER( puyofev   )   /* 2003.11 Puyopuyo Fever */
42874386                  /* 2004.01 Initial D Arcade Stage ver.3 */
42884387                  /* 2004.06 WCCF 2002-2003 ver.2.0 */
4289                  /* 2004.07 Virtua Fighter 4 Final Tuned */
4290                  /* 2004.09 Trizeal */
4388   DRIVER( vf4tuned )   /* 2004.07 Virtua Fighter 4 Final Tuned (Naomi 2) */
4389   DRIVER( trizeal )   /* 2004.09 Trizeal */
42914390                  /* 2004.10 Oshare Majo Love & Berry */
42924391                  /* 2004.12 WCCF 2002-2003 ver.2.1 */
42934392   DRIVER( meltybld )   /* 2005.03 Melty Blood Act Cadenza */
42944393                  /* 2005.04 Menkyo no Tetsujin */
42954394   DRIVER( ss2005 )   /* 2005.04 Super Shanghai 2005 */
42964395   DRIVER( senko )      /* 2005.04 Senkou no Rondo */
4396   DRIVER( senkoo )   /*          ^^ */
42974397                  /* 2005.07 WCCF 2004-2005 */
42984398                  /* 2005.09 Kodai Ouja Kyouryuu King */
4299                  /* 2005.10 Under Defeat */
4399                  /* 2005.10 Radirgy */
4400   DRIVER( undefeat )   /* 2005.10 Under Defeat */
4401                  /* 2006.03 Kurukuru Chameleon */
4402   DRIVER( trgheart )   /* 2006.05 Trigger Heart Exelica */
4403                  /* 2006.07 Touch de Zunou */
4404                  /* 2006.08 Senkou no Rondo SP */
4405   DRIVER( jingystm )   /* 2006.09 Jingi Storm */
4406                  /* 2006.11 Karous */
4407                  /* 2006.12 Guilty Gear XX Accent Core */
4408                  /* 2006.12 Melty Blood Act Cadenza ver.B */
4409                  /* 2007.02 Noukone Puzzle Takoron */
4410                  /* 2007.07 Shooting Love */
4411                  /* 2007.07 Dynamite Deka EX - Asian dynamite */
4412                  /* 2007.09 Rhythm Tengoku */
4413                  /* 2007.?? Issyo ni Wanwan */
4414                  /* 2007.?? Konchuu Dash!! */
4415                  /* 2007.?? Pokasuka Ghost! */
4416                  /* 2007.?? Magical Dance on Dream Stage */
4417                  /* 2007.?? Marine Marine */
4418                  /* 2008.?? Akatsuki Denkou Senki Ausf.Achse */
4419                  /* 2008.?? Illvelo */
4420                  /* 2008.?? Mamoru Kun wa Norowarete Shimatta! */
4421                  /* 2008.?? Melty Blood Actress Again */
4422                  /* 2009.?? Project Cerberus */
4423                  /* 2009.?? Radirgy Noah */
4424   DRIVER( ggxxsla  )   /* 200?.?? Guilty Gear XX Slash */
43004425
4426   DRIVER( initdexp )   /* 200?.?? Initial D Export Version (Naomi 2) */
4427
43014428   /* Atomiswave (Dreamcast-based) games */
43024429   DRIVER( awbios )
4303   DRIVER( fotns )
4304   DRIVER( demofist )
4430                  /* 2002.12 Maximum Speed */
4431                  /* 2003.03 Guilty Gear X ver.1.5 */
4432   DRIVER( demofist )   /* 2003.06 Demolish Fist */
4433                  /* 2003.08 Dolphin Blue */
4434                  /* 2003.12 Guilty Gear Isuka */
4435                  /* 2003.?? Sangoku Senki Shichisei Tensei (IGS) */
4436                  /* 2004.03 The Rumble Fish */
4437                  /* 2004.03 Ranger Mission */
4438                  /* 2004.06 Salary Man Kintarou Net Select */
4439                  /* 2004.07 The King of Fighters Neo Wave */
4440                  /* 2004.09 Extreme Hunting */
4441                  /* 2004.09 Dirty Pig Skin Football */
4442                  /* 2004.09 Faster than Speed */
4443                  /* 2005.03 The Rumble Fish 2 */
4444                  /* 2005.03 Net Select Keiba Victory Furlong */
4445                  /* 2005.07 NeoGeo Battle Colloseum */
4446                  /* 2005.09 Samurai Spirits Tenkaichi Kenkakuden */
4447                  /* 2005.10 The King of Fighters XI */
4448   DRIVER( fotns )      /* 2005.12 Hokuto no Ken */
4449                  /* 2006.02 Metal Slug 6 */
4450                  /* 2006.09 Extreme Hunting 2 Tournament Edition */
4451                  /* 2008.?? Sega Cray challenge */
43054452
43064453   /* Hikaru */
43074454   DRIVER( hikaru )    /* BIOS (c)2000 */
4308   DRIVER( airtrix )   /* (c) 2000 */
4309   DRIVER( pharrier )   /* (c) 2001 */
4310   DRIVER( podrace )   /* (c) 2001 */
4455                  /* 1999.06 Syouboushi Brave Fire Fighters */
4456   DRIVER( podrace )   /* 2000.06 Star Wars: Racer Arcade */
4457                  /* 2000.09 Nascar Arcade */
4458   DRIVER( pharrier )   /* 2000.12 Planet Harriers */
4459   DRIVER( airtrix )   /* 2001.02 Air Trix */
4460                  /* 2001.10 Dennou Senki Virtual-On Force */
4461                  /* 2002.04 Dennou Senki Virtual-On Force ver.7.7 */
43114462
4463   /* Triforce (GameCube based) */
4464   DRIVER( triforce )
4465   DRIVER( vs2002ex )   /* GDT-0002 2002.10 Virtua Striker 2002 */
4466                  /* 2003.06 F-ZERO AX */
4467                  /* 2003.07 Avalon no Kagi */
4468                  /* 2003.10 Avalon no Kagi ver.1.01 */
4469                  /* 2003.10 Gekitou Pro Yakyuu Mizushima Shinji All Stars vs. Pro Yakyuu */
4470                  /* 2003.12 Avalon no Kagi ver.1.10 */
4471                  /* 2004.04 Avalon no Kagi ver.1.20 Aratanaru Syoukan */
4472                  /* 2004.07 Avalon no Kagi ver.1.30 Konton no Utage */
4473   DRIVER( vs4 )      /* GDT-0015 2004.10 Virtua Striker 4 */
4474                  /* 2004.11 Avalon no Kagi ver.2.0 Chitsujo to Kairitsu */
4475                  /* 2005.08 Avalon no Kagi ver.2.5 Kagi Seisen */
4476
4477   /* Chihiro (X-Box based) */
4478   DRIVER( chihiro )
4479                  /* 2002.12 The House of the Dead III */
4480                  /* 2003.03 Crazy Taxi High Roller */
4481   DRIVER( vcop3 )      /* 2003.04 Virtua Cop 3 */
4482                  /* 2003.12 Outrun 2 */
4483                  /* 2004.03 Ollie King */
4484                  /* 2004.07 Wangan Midnight Maximum Tune */
4485                  /* 2004.09 Quest of D */
4486                  /* 2004.11 Sega Golf Club Network Pro Tour */
4487                  /* 2004.12 Outrun 2 Special Tours */
4488                  /* 2004.12 Quest of D ver.1.10 */
4489   DRIVER( ghostsqu )   /* 2004.12 Ghost Squad */
4490                  /* 2005.03 Kidou Senshi Gundam Battle Operating Simulator */
4491                  /* 2005.03 Sangokushi Taisen */
4492                  /* 2005.04 Wangan Midnight Maximum Tune 2 */
4493                  /* 2005.05 Quest of D ver.1.20 */
4494                  /* 2005.06 Sega Golf Club Network Pro Tour 2005 */
4495                  /* 2005.09 Quest of D ver.1.21 */
4496                  /* 2005.10 Sangokushi Taisen Ranse no Gunrou ver.1.100 */
4497                  /* 2005.10 Wangan Midnight Maximum Tune 2 ver.B */
4498                  /* 2005.12 Kidou Senshi Gundam 0079 Card Builder */
4499                  /* 2005.12 Quest of D ver.2.01 Gofu no Keisyousya */
4500                  /* 2005.12 Sega Golf Club 2006 Next Tours */
4501                  /* 2006.05 Sangokushi Taisen 2 */
4502                  /* 2007.03 Kidou Senshi Gundam 0083 Card Builder */
4503                  /* 2007.10 Kidou Senshi Gundam 0083 Card Builder Ryouyuu Gekitotsu */
4504
43124505   DRIVER( hshavoc )   /* (c) 1993 Data East */
43134506
43144507   /* Data East "Burger Time hardware" games */
r4425r4426
50495242   DRIVER( konamigx )
50505243
50515244   /* GX Type 1 */
5052   DRIVER( racinfrc )   /* GX250 (c) 1994 */
5053   DRIVER( racinfru )   /* GX250 (c) 1994 */
5054   DRIVER( opengolf )   /* GX218 (c) 1994 */
5055   DRIVER( opengol2 )   /* GX218 (c) 1994 */
5056   DRIVER( ggreats2 )   /* GX218 (c) 1994 */
5245   DRIVER( racinfrc )   /* 1994.?? GX250 (Europe) */
5246   DRIVER( racinfru )   /* 1994.03 GX250 (US) */
5247                  /* 1994.02 (Japan) */
5248   DRIVER( opengolf )   /* 1994.?? GX218 (Europe) */
5249   DRIVER( opengol2 )   /* 1994.?? GX218 (Europe) */
5250   DRIVER( ggreats2 )   /* 1994.03 GX218 (Japan) */
5251                  /* 1995.03 GX218 (US) */
50575252
50585253   /* GX Type 2 */
5059   DRIVER( le2 )      /* GX312 (c) 1994 */
5060   DRIVER( le2u )      /* GX312 (c) 1994 */
5061   DRIVER( le2j )      /* GX312 (c) 1994 */
5062   DRIVER( puzldama )   /* GX315 (c) 1994 (Japan) */
5063   DRIVER( gokuparo )   /* GX321 (c) 1994 (Japan) */
5064   DRIVER( fantjour )   /* GX321 (c) 1994 */
5065   DRIVER( dragoona )   /* GX417 (c) 1995 (Asia) */
5066   DRIVER( dragoonj )   /* GX417 (c) 1995 (Japan) */
5067   DRIVER( tbyahhoo )   /* GX424 (c) 1995 (Japan) */
5068   DRIVER( tkmmpzdm )   /* GX515 (c) 1995 (Japan) */
5069   DRIVER( salmndr2 )   /* GX521 (c) 1996 (Japan) */
5070   DRIVER( salmnd2a )   /* GX521 (c) 1996 (Asia) */
5071   DRIVER( sexyparo )   /* GX533 (c) 1996 (Japan) */
5072   DRIVER( daiskiss )   /* GX535 (c) 1996 (Japan) */
5073   DRIVER( tokkae )   /* GX615 (c) 1996 (Japan) */
5074   DRIVER( winspike )   /* GX705 (c) 1997 EAA */
5075   DRIVER( winspikj )   /* GX705 (c) 1997 JAA */
5254   DRIVER( le2 )      /* 1994.?? GX312 (Europe) */
5255   DRIVER( le2u )      /* 1994.04 GX312 (US) */
5256   DRIVER( le2j )      /* 1994.06 GX312 (Japan) */
5257   DRIVER( puzldama )   /* 1994.07 GX315 (Japan) */
5258   DRIVER( gokuparo )   /* 1994.04 GX321 (Japan) */
5259   DRIVER( fantjour )   /* 1994.?? GX321 (US?) */
5260   DRIVER( dragoona )   /* 1995.?? GX417 (Asia) */
5261   DRIVER( dragoonj )   /* 1995.08 GX417 (Japan) */
5262   DRIVER( tbyahhoo )   /* 1995.04 GX424 (Japan) */
5263   DRIVER( tkmmpzdm )   /* 1995.12 GX515 (Japan) */
5264   DRIVER( salmndr2 )   /* 1996.01 GX521 (Japan) */
5265   DRIVER( salmnd2a )   /* 1996.?? GX521 (Asia) */
5266   DRIVER( sexyparo )   /* 1996.02 GX533 (Japan) */
5267   DRIVER( daiskiss )   /* 1996.03 GX535 (Japan) */
5268   DRIVER( tokkae )   /* 1996.10 GX615 (Japan) */
5269   DRIVER( winspike )   /* 1997.?? GX705 (Europe) */
5270   DRIVER( winspikj )   /* 1997.07 GX705 (Japan) */
50765271
50775272   /* GX Type 3 */
5078   DRIVER( soccerss )   /* GX427 (c) 1994 */
5079   DRIVER( soccersj )   /* GX427 (c) 1994 */
5080   DRIVER( soccersa )   /* GX427 (c) 1994 */
5273   DRIVER( soccerss )   /* 1994.?? GX427 (Europe) */
5274   DRIVER( soccersj )   /* 1994.12 GX427 (Japan) */
5275   DRIVER( soccersa )   /* 1994.?? GX427 (Asia) */
5276                  /* 1995.04 GX427 (US) */
50815277
50825278   /* GX Type 4 */
5083   DRIVER( vsnetscr )   /* GX627 (c) 1996 */
5084   DRIVER( vsnetseb )   /* GX627 (c) 1996 */
5085   DRIVER( vsnetscu )   /* GX627 (c) 1996 */
5086   DRIVER( vsnetsca )   /* GX627 (c) 1996 */
5087   DRIVER( vsnetscj )   /* GX627 (c) 1996 */
5088   DRIVER( rungun2 )   /* GX505 (c) 1996 */
5089   DRIVER( slamdnk2 )   /* GX505 (c) 1996 */
5090   DRIVER( rushhero )   /* GX605 (c) 1996 */
5279   DRIVER( vsnetscr )   /* 1996.?? GX627 (Europe) */
5280   DRIVER( vsnetseb )   /* 1996.?? GX627 (Europe) */
5281   DRIVER( vsnetscu )   /* 1996.?? GX627 (US) */
5282   DRIVER( vsnetsca )   /* 1996.?? GX627 (Asia) */
5283   DRIVER( vsnetscj )   /* 1996.12 GX627 (Japan) */
5284   DRIVER( rungun2 )   /* 1996.03 GX505 (US) */
5285   DRIVER( slamdnk2 )   /* 1996.03 GX505 (Japan) */
5286   DRIVER( rushhero )   /* 1997.10 GX605 (US) */
50915287
50925288   /* 68k + HD */
5093   DRIVER( qdrmfgp )   /* GQ460 (c) 1994 (Japan) */
5094   DRIVER( qdrmfgp2 )   /* GE557 (c) 1995 (Japan) */
5289   DRIVER( qdrmfgp )   /* 1994.12 GQ460 (Japan) */
5290   DRIVER( qdrmfgp2 )   /* 1995.09 GE557 (Japan) */
50955291
50965292   /* DJ Main */
50975293   DRIVER( bm1stmix )   /* GQ753 (c) 1997 (Japan) */
r4425r4426
69537149    2002: ATV Track
69547150    */
69557151
7152   /* Galeco PC based games */
7153   DRIVER( tokyocop )
7154
69567155   /* Kaneko games */
69577156   DRIVER( hvyunit )   /* (c) 1988 Kaneko */
69587157   DRIVER( hvyunitj )   /* (c) 1988 Kaneko */
r4425r4426
70077206
70087207   /* Kaneko "Super Nova System" games */
70097208   DRIVER( skns )
7010   DRIVER( galpani4 )   /* (c) 1996 Kaneko (Japan) */
7011   DRIVER( galpanis )   /* (c) 1997 Kaneko (Japan) */
7012   DRIVER( sengekis )   /* (c) 1997 Kaneko / Warashi (Asia) */
7013   DRIVER( sengekij )   /* (c) 1997 Kaneko / Warashi (Japan) */
7014   DRIVER( vblokbrk )   /* (c) 1997 Kaneko / Mediaworks (Asia) */
7015   DRIVER( sarukani )   /* (c) 1997 Kaneko / Mediaworks (Japan) */
7016   DRIVER( cyvern )   /* (c) 1998 Kaneko (Japan) */
7017   DRIVER( galpans2 )   /* (c) 1999 Kaneko (Japan) */
7018   DRIVER( galpans2a )   /* (c) 1999 Kaneko (Asia) */
7019   DRIVER( galpansu )   /* (c) 1999 Kaneko (Korea) */
7020   DRIVER( panicstr )   /* (c) 1999 Kaneko (Japan) */
7021   DRIVER( senknow )   /* (c) 1999 Kaneko / Kouyousha (Japan) */
7022   DRIVER( gutsn )      /* (c) 2000 Kaneko / Kouyousha (Japan) */
7023   DRIVER( puzzloop )   /* (c) 1998 Mitchell (Europe) */
7024   DRIVER( puzzloopj )   /* (c) 1998 Mitchell (Japan) */
7025   DRIVER( puzzloopk )   /* (c) 1998 Mitchell (Korea) */
7026   DRIVER( puzzloopu )   /* (c) 1998 Mitchell (USA) */
7027   DRIVER( jjparads )   /* (c) 1996 Electro Design Co. (Japan) */
7028   DRIVER( jjparad2 )   /* (c) 1997 Electro Design Co. (Japan) */
7029   DRIVER( ryouran )   /* (c) 1998 Electro Design Co. (Japan) */
7030   DRIVER( teljan )   /* (c) 1999 Electro Design Co. (Japan) */
7031   DRIVER( galpans3 )   /* (c) 2002 Kaneko (Japan) */
7209   DRIVER( galpani4 )   /* 1996.09 (c) 1996 Kaneko (Japan) */
7210   DRIVER( jjparads )   /* 1996.12 (c) 1996 Electro Design Co. (Japan) */
7211   DRIVER( sarukani )   /* 1997.01 (c) 1997 Kaneko / Mediaworks (Japan) */
7212   DRIVER( vblokbrk )   /* 1997.?? (c) 1997 Kaneko / Mediaworks (Asia) */
7213   DRIVER( galpanis )   /* 1997.04 (c) 1997 Kaneko (Japan) */
7214   DRIVER( sengekis )   /* 1997.?? (c) 1997 Kaneko / Warashi (Asia) */
7215   DRIVER( sengekij )   /* 1997.07 (c) 1997 Kaneko / Warashi (Japan) */
7216   DRIVER( jjparad2 )   /* 1997.12 (c) 1997 Electro Design Co. (Japan) */
7217   DRIVER( cyvern )   /* 1998.02 (c) 1998 Kaneko (Japan) */
7218   DRIVER( ryouran )   /* 1998.07 (c) 1998 Electro Design Co. (Japan) */
7219   DRIVER( puzzloop )   /* 1998.?? (c) 1998 Mitchell (Europe) */
7220   DRIVER( puzzloopj )   /* 1998.12 (c) 1998 Mitchell (Japan) */
7221   DRIVER( puzzloopk )   /* 1998.?? (c) 1998 Mitchell (Korea) */
7222   DRIVER( puzzloopu )   /* 1999.05 (c) 1998 Mitchell (USA) */
7223   DRIVER( galpans2 )   /* 1999.02 (c) 1999 Kaneko (Japan) */
7224   DRIVER( galpans2a )   /* 1999.?? (c) 1999 Kaneko (Asia) */
7225   DRIVER( galpansu )   /* 1999.?? (c) 1999 Kaneko (Korea) */
7226   DRIVER( senknow )   /* 1999.04 (c) 1999 Kaneko / Kouyousha (Japan) */
7227   DRIVER( panicstr )   /* 1999.09 (c) 1999 Kaneko (Japan) */
7228   DRIVER( teljan )   /* 1999.11 (c) 1999 Electro Design Co. (Japan) */
7229   DRIVER( gutsn )      /* 2000.06 (c) 2000 Kaneko / Kouyousha (Japan) */
7230   DRIVER( galpans3 )   /* 2002.07 (c) 2002 Kaneko (Japan) */
70327231
70337232   /* Seta games (seta.c) */
70347233   DRIVER( hanaawas )   /* (c) SetaKikaku */
r4425r4426
72137412   DRIVER( blocken )   /* (c) 1994 KID / Visco */
72147413/*
72157414Other Sun games
72161978 (GT)Block Perfect
72171978 (GT)Block Challenger
72181979 Galaxy Force
72191979 Run Away
72201979 Dai San Wakusei (The Third Planet)
72211979 Warp 1
72221980 Cosmo Police (Cosmopolis?)
72231985 Ikki
72241993 Saikyou Battler Retsuden
72251995 Shanghai Banri no Choujou (ST-V)
72261996 Karaoke Quiz Intro DonDon (ST-V)
72271998 Astra Super Stars (ST-V)
72281998 Shanghai Mateki Buyuu (TPS)
74151978.11 (GT)Block Perfect
74161978.12 (GT)Block Challenger
74171979.04 Galaxy Force
74181979.07 Run Away
74191979.09 Dai San Wakusei (The Third Planet)
74201979.12 Warp 1
74211980.10 Cosmo Police (Cosmopolis?)
72297422*/
72307423
72317424   /* SunA games */
r4425r4426
76047797   DRIVER( chleagul )   /* (c) 199? IGS */
76057798   DRIVER( number10 )   /* (c) IGS (Board labeled Playmark Srl) */
76067799   DRIVER( numbr10l )   /* (c) IGS (Board labeled Playmark Srl) */
7607   DRIVER( citalian )
7608   DRIVER( citaliana )
7800   DRIVER( cpokerpk )   /* (c) SGS (bootleg blue board) */
7801   DRIVER( cpokerpkg )   /* (c) SGS (bootleg green board) */
7802   DRIVER( citalcup )   /* (c) SGS (bootleg of IGS v220it) */
76097803   DRIVER( stellecu )   /* (c) 1998 */
76107804   DRIVER( iqblock )   /* (c) 1993 */
76117805   DRIVER( grndtour )   /* (c) 1993 */
r4425r4426
76807874     DRIVER( kov2 )      /* (c) 2000 */
76817875    DRIVER( kov2106 )   /* (c) 2000 */
76827876     DRIVER( kov2p )      /* (c) 2000 */
7877     DRIVER( kov2p205 )   /* (c) 2000 */
76837878   DRIVER( ddp2 )      /* (c) 2001 */
76847879   DRIVER( puzzli2 )   /* (c) 2001 */
76857880   DRIVER( martmast )   /* (c) 2001 */
7881   DRIVER( martmasc )   /* (c) 2001 */
76867882   DRIVER( theglad )   /* (c) 2001 */
76877883   DRIVER( dmnfrnt )   /* (c) 2002 */
76887884   DRIVER( dmnfrnta )   /* (c) 2002 */
r4425r4426
78618057   DRIVER( lsrquiz2 )   /* (c) 1995 */
78628058   DRIVER( mgprem11 )   /* (c) 1995 */
78638059   DRIVER( lasstixx )   /* (c) 1995 */
8060   DRIVER( mgnumber )   /* (c) 1995 */
78648061
78658062   /* American Laser Games */
78668063   DRIVER( alg_bios )
r4425r4426
81488345   DRIVER( eggvent7 )   /* (c) 1997 The Game Room */
81498346   DRIVER( eggventa )   /* (c) 1997 The Game Room (Allied Leisure license) */
81508347   DRIVER( eggvntdx )   /* (c) 1997 The Game Room */
8348   DRIVER( calchase )  /* (c) 1999 The Game Room */
81518349   DRIVER( ripribit )   /* (c) 1997 LAI Games */
81528350   DRIVER( cfarm )      /* (c) 1999 LAI Games */
81538351   DRIVER( cclownz )   /* (c) 1999 LAI Games */
r4425r4426
81648362   DRIVER( luplup29 )   /* (c) 1999 Omega System */
81658363   DRIVER( puzlbang )   /* (c) 1999 Omega System */
81668364   DRIVER( suplup )   /* (c) 1999 Omega System */
8365   DRIVER( jmpbreak )   /* (c) 1999 F2 System */
81678366   DRIVER( vamphalf )   /* (c) 1999 DanBi & F2 System */
81688367   DRIVER( vamphafk )   /* (c) 1999 DanBi & F2 System */
81698368   DRIVER( dquizgo2 )   /* (c) 2000 Semicom */
r4425r4426
83758574   DRIVER( ampkr2b1 )   /* 1990 bootleg */
83768575   DRIVER( ampkr2b2 )   /* 1990 bootleg */
83778576   DRIVER( ampkr2b3 )   /* 1994 bootleg */
8577   DRIVER( ampkr2b4 )   /* 1994 bootleg */
83788578   DRIVER( ampkr228 )   /* 1990 bootleg */
83798579   DRIVER( pkrdewin )   /* 1990 bootleg */
83808580   DRIVER( ampkr95 )   /* 1995 bootleg */
r4425r4426
86688868   /* Sure games */
86698869   DRIVER( mil4000 )   /* (c) 2000 Sure Milano */
86708870   DRIVER( mil4000a )   /* (c) 2000 Sure Milano */
8871   DRIVER( mil4000b )   /* (c) 2000 Sure Milano */
86718872
86728873   /* Mitsubishi/Renesas M16/62A italian gambling games */
86738874   DRIVER( ejollyx5 )   /* (c) 200? Solar Games */
r4425r4426
89649165   DRIVER( atworld )
89659166   DRIVER( atworlda )
89669167
9168   DRIVER( chsuper3 )   /* unknown */
9169   DRIVER( chsuper2 )   /* unknown */
89679170   DRIVER( 3super8 )   /* unknown */
89689171   DRIVER( buster )   /* (c) 1987 Marian Electronics Ltd. */
89699172   DRIVER( spielbud )   /* (c) 1985 ADP */
r4425r4426
89799182   /* Sanki Denshi Kogyo */
89809183   DRIVER( pachifev )   /* (c) 1983? */
89819184
9185   /* New Image Technologies */
9186   DRIVER( bonanza )     /* (c) 1993 */
9187   DRIVER( bonanzar2 )   /* (c) 1993 */
9188   DRIVER( streetg )     /* (c) 1993 */
9189   DRIVER( streetgr3 )   /* (c) 1993 */
9190   DRIVER( streetg2 )    /* (c) 1993 */
9191   DRIVER( streetg2r5 )  /* (c) 1993 */
9192
89829193   /* Igrosoft - SHA1 information is not available for commented out sets, only MD5/CRC32 */
9194
9195   /* Multifish */
89839196   //DRIVER( mfish )
8984   DRIVER( mfish_2 )
8985   DRIVER( mfish_2a )
9197   //DRIVER( mfish_2 )
89869198   //DRIVER( mfish_3 )
89879199   //DRIVER( mfish_4 )
89889200   //DRIVER( mfish_5 )
r4425r4426
89929204   //DRIVER( mfish_9 )
89939205   //DRIVER( mfish_10 )
89949206   //DRIVER( mfish_11 )
8995   //DRIVER( mfish_12 )
8996   //DRIVER( mfish_13 )
9207   DRIVER( mfish_12 )
9208   DRIVER( mfish_12a )
89979209
9210   /* Crazy Monkey */
9211   //DRIVER( crzmon )
9212   //DRIVER( crzmon_2 )
9213   //DRIVER( crzmon_3 )
9214   //DRIVER( crzmon_4 )
9215   //DRIVER( crzmon_5 )
9216   //DRIVER( crzmon_6 )
9217   DRIVER( crzmon_7 )
89989218
9219   /* Fruit Cocktail */
9220   //DRIVER( fcock )
9221   //DRIVER( fcock_2 )
9222   //DRIVER( fcock_3 )
9223   //DRIVER( fcock_4 )
9224   //DRIVER( fcock_5 )
9225   DRIVER( fcock_6 )
89999226
9227   /* Lucky Haunter */
9228   //DRIVER( lhaunt )
9229   //DRIVER( lhaunt_2 )
9230   //DRIVER( lhaunt_3 )
9231   DRIVER( lhaunt_4 )
9232   DRIVER( lhaunt_5 )
9233   DRIVER( lhaunt_6 )
9234
9235   /* Garage */
9236   //DRIVER( garage )
9237   //DRIVER( garage_2 )
9238   //DRIVER( garage_3 )
9239   DRIVER( garage_4 )
9240
9241   /* Rock Climber */
9242   //DRIVER( rclimb )
9243   //DRIVER( rclimb_2 )
9244   DRIVER( rclimb_3 )
9245
9246   /* Sweet Life */
9247   DRIVER( sweetl )
9248
9249   /* Resident */
9250   //DRIVER( resdnt )
9251   DRIVER( resdnt_2 )
9252
9253   /* Rollfruit */
9254   //DRIVER( rollfr )
9255   //DRIVER( rollfr_2 )
9256
9257   /* Island */
9258   DRIVER( island )
9259
9260
90009261   /* Drivers below are mechanical games, usually with no video display, requiring external artwork to function.
90019262       These are currently mostly 'fruit machine' style games, although this may later be extended to system logic
90029263       emulation for pinball machiens.
r4425r4426
90339294   /* System85 games */
90349295   DRIVER( m_supcrd )   /* (c) 198? BFM */
90359296
9297   /* JPM Impact games */
9298   DRIVER( m_tbirds )
9299
90369300   /* Scorpion1 games */
90379301   DRIVER( m_lotsse )   /* (c) 198? BFM Dutch ROMS, prelim*/
90389302   DRIVER( m_roulet )   /* (c) 198? BFM Dutch ROMS, prelim*/
src/mame/includes/tx1.h
r4425r4426
33    TX-1/Buggy Boy hardware
44
55*************************************************************************/
6#include "machine/8255ppi.h"
76
87#define TX1_PIXEL_CLOCK      (XTAL_18MHz / 3)
98#define TX1_HBSTART         256
r4425r4426
1312#define TX1_VBEND         0
1413#define TX1_VTOTAL         264
1514
15/*
16 * HACK! Increased VTOTAL to 'fix' a timing issue
17 * that prevents one of the start countdown tones
18 * from playing.
19 */
1620#define BB_PIXEL_CLOCK      (XTAL_18MHz / 3)
1721#define BB_HBSTART         256
1822#define BB_HBEND         0
1923#define BB_HTOTAL         384
2024#define BB_VBSTART         240
2125#define BB_VBEND         0
22#define BB_VTOTAL         288
26#define BB_VTOTAL         288 + 1
2327
2428#define CPU_MASTER_CLOCK   (XTAL_15MHz)
2529#define BUGGYBOY_ZCLK      (CPU_MASTER_CLOCK / 2)
src/mame/includes/pgm.h
r4425r4426
1212void pgm_kov_decrypt(running_machine *machine);
1313void pgm_kovsh_decrypt(running_machine *machine);
1414void pgm_kov2_decrypt(running_machine *machine);
15void pgm_kov2p_decrypt(running_machine *machine);
1516void pgm_mm_decrypt(running_machine *machine);
1617void pgm_dw2_decrypt(running_machine *machine);
1718void pgm_djlzz_decrypt(running_machine *machine);
src/mame/includes/cidelsa.h
r4425r4426
44#include "cpu/cdp1802/cdp1802.h"
55
66#define SCREEN_TAG   "screen"
7#define CDP1802_TAG   "cpd1802"
7#define CDP1802_TAG   "cdp1802"
88#define CDP1869_TAG   "cdp1869"
99#define AY8910_TAG   "ay8910"
1010
src/mame/mame.mak
r4425r4426
132132CPUS += ESRIP
133133CPUS += R3000
134134CPUS += R3041
135CPUS += VR4300
135136CPUS += R4600
136137CPUS += R4650
137138CPUS += R4700
r4425r4426
598599   $(DRIVERS)/vulgus.o $(VIDEO)/vulgus.o \
599600   $(DRIVERS)/tigeroad.o $(VIDEO)/tigeroad.o \
600601   $(DRIVERS)/zn.o $(MACHINE)/znsec.o \
602   $(DRIVERS)/taitogn.o \
601603   $(MACHINE)/cps2crpt.o \
602604   $(MACHINE)/kabuki.o \
603605
r4425r4426
684686   $(DRIVERS)/ddenlovr.o \
685687   $(DRIVERS)/dynax.o $(VIDEO)/dynax.o \
686688   $(DRIVERS)/hnayayoi.o $(VIDEO)/hnayayoi.o \
687   $(DRIVERS)/rcasino.o \
688689   $(DRIVERS)/realbrk.o $(VIDEO)/realbrk.o \
689690   $(DRIVERS)/royalmah.o \
690691
r4425r4426
740741   $(DRIVERS)/thoop2.o $(VIDEO)/thoop2.o \
741742   $(DRIVERS)/xorworld.o $(VIDEO)/xorworld.o \
742743   $(DRIVERS)/wrally.o $(MACHINE)/wrally.o $(VIDEO)/wrally.o \
744   $(DRIVERS)/tokyocop.o \
743745
744746$(MAMEOBJ)/gameplan.a: \
745747   $(DRIVERS)/enigma2.o \
r4425r4426
15561558   $(DRIVERS)/big10.o \
15571559   $(DRIVERS)/blackt96.o \
15581560   $(DRIVERS)/buster.o \
1561   $(DRIVERS)/calchase.o \
15591562   $(DRIVERS)/calomega.o $(VIDEO)/calomega.o \
15601563   $(DRIVERS)/carrera.o \
15611564   $(DRIVERS)/cave.o $(VIDEO)/cave.o \
1565   $(DRIVERS)/chsuper.o \
15621566   $(DRIVERS)/cidelsa.o $(VIDEO)/cidelsa.o \
15631567   $(DRIVERS)/coinmstr.o \
15641568   $(DRIVERS)/comebaby.o \
r4425r4426
16461650   $(DRIVERS)/pangofun.o \
16471651   $(DRIVERS)/pasha2.o \
16481652   $(DRIVERS)/pass.o $(VIDEO)/pass.o \
1653   $(DRIVERS)/pcat_nit.o \
16491654   $(DRIVERS)/pcxt.o \
16501655   $(DRIVERS)/peplus.o \
16511656   $(DRIVERS)/pipeline.o \
r4425r4426
18481853
18491854$(DRIVERS)/superchs.o:   $(LAYOUT)/superchs.lh
18501855
1856$(DRIVERS)/sfbonus.o:   $(LAYOUT)/pirpok2.lh
1857
18511858$(DRIVERS)/taito_z.o:   $(LAYOUT)/contcirc.lh \
18521859                  $(LAYOUT)/dblaxle.lh
18531860
src/mame/video/psx.c
r4425r4426
234234static UINT16 m_p_n_r1[ 0x10000 ];
235235static UINT16 m_p_n_b1g1[ 0x10000 ];
236236
237static int need_sianniv_vblank_hack;
238
237239#define SINT11( x ) ( ( (INT32)( x ) << 21 ) >> 21 )
238240
239241#define ADJUST_COORD( a ) \
r4425r4426
625627   int width = video_screen_get_width(machine->primary_screen);
626628   int height = video_screen_get_height(machine->primary_screen);
627629
630   need_sianniv_vblank_hack = !strcmp(machine->gamedrv->name, "sianniv");
631
628632#if defined( MAME_DEBUG )
629633   DebugMeshInit(machine);
630634#endif
r4425r4426
33453349      case 0x48:
33463350      case 0x4a:
33473351      case 0x4c:
3352      case 0x4e:
33483353         if( m_n_gpu_buffer_offset < 3 )
33493354         {
33503355            m_n_gpu_buffer_offset++;
r4425r4426
33673372         break;
33683373      case 0x50:
33693374      case 0x52:
3375
33703376         if( m_n_gpu_buffer_offset < 3 )
33713377         {
33723378            m_n_gpu_buffer_offset++;
r4425r4426
39033909#endif
39043910
39053911   m_n_gpustatus ^= ( 1L << 31 );
3912
3913   if(need_sianniv_vblank_hack)
3914   {
3915      UINT32 pc = cpu_get_pc(device);
3916      if((pc >= 0x80010018 && pc <= 0x80010028) || pc == 0x8002a4f0)
3917         return;
3918   }
3919
39063920   psx_irq_set( device->machine, 0x0001 );
39073921}
39083922
src/mame/video/pgm.c
r4425r4426
77static tilemap *pgm_tx_tilemap, *pgm_bg_tilemap;
88static UINT16 *pgm_spritebufferram; // buffered spriteram
99static UINT16 *sprite_temp_render;
10static bitmap_t *tmppgmbitmap;
1011
1112/* Sprites - These are a pain! */
1213
r4425r4426
5354}
5455
5556
56
57static void draw_sprite_line(int wide, UINT16* dest, int xzoom, int xgrow, int yoffset, int flip, int xpos)
57// in the dest bitmap 0x10000 is used to mark 'used pixel' and 0x8000 is used to mark 'high priority'
58static void draw_sprite_line(int wide, UINT32* dest, int xzoom, int xgrow, int yoffset, int flip, int xpos, int pri)
5859{
5960   int xcnt,xcntdraw;
6061   int xzoombit;
r4425r4426
7778         xdrawpos = xpos + xcntdraw;
7879         if (!(srcdat&0x8000))
7980         {
80            if ((xdrawpos >= 0) && (xdrawpos < 448))  dest[xdrawpos] = srcdat;
81            if ((xdrawpos >= 0) && (xdrawpos < 448))
82            {
83               if (pri) dest[xdrawpos] = srcdat | 0x8000 | 0x10000;
84               else dest[xdrawpos] = srcdat | 0x10000;
85            }
8186         }
8287         xcntdraw++;
8388
r4425r4426
8590
8691         if (!(srcdat&0x8000))
8792         {
88            if ((xdrawpos >= 0) && (xdrawpos < 448))  dest[xdrawpos] = srcdat;
93            if ((xdrawpos >= 0) && (xdrawpos < 448))
94            {
95               if (pri) dest[xdrawpos] = srcdat | 0x8000 | 0x10000;
96               else dest[xdrawpos] = srcdat | 0x10000;
97            }
8998         }
9099         xcntdraw++;
91100      }
r4425r4426
98107         xdrawpos = xpos + xcntdraw;
99108         if (!(srcdat&0x8000))
100109         {
101            if ((xdrawpos >= 0) && (xdrawpos < 448))  dest[xdrawpos] = srcdat;
110            if ((xdrawpos >= 0) && (xdrawpos < 448))
111            {
112               if (pri) dest[xdrawpos] = srcdat | 0x8000 | 0x10000;
113               else dest[xdrawpos] = srcdat | 0x10000;
114            }
102115         }
103116         xcntdraw++;
104117      }
r4425r4426
109122   }
110123}
111124/* this just loops over our decoded bitmap and puts it on the screen */
112static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, bitmap_t* bitmap, UINT32 xzoom, int xgrow, UINT32 yzoom, int ygrow )
125static void draw_sprite_new_zoomed(running_machine *machine, int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, bitmap_t* bitmap, UINT32 xzoom, int xgrow, UINT32 yzoom, int ygrow, int pri )
113126{
114127   int ycnt;
115128   int ydrawpos;
116   UINT16 *dest;
129   UINT32 *dest;
117130   int yoffset;
118131   int ycntdraw;
119132   int yzoombit;
r4425r4426
135148         else yoffset = ( (high-ycnt-1)*(wide*16));
136149         if ((ydrawpos >= 0) && (ydrawpos < 224))
137150         {
138            dest = BITMAP_ADDR16(bitmap, ydrawpos, 0);
139            draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos);
151            dest = BITMAP_ADDR32(bitmap, ydrawpos, 0);
152            draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos, pri);
140153         }
141154         ycntdraw++;
142155
r4425r4426
145158         else yoffset = ( (high-ycnt-1)*(wide*16));
146159         if ((ydrawpos >= 0) && (ydrawpos < 224))
147160         {
148            dest = BITMAP_ADDR16(bitmap, ydrawpos, 0);
149            draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos);
161            dest = BITMAP_ADDR32(bitmap, ydrawpos, 0);
162            draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos, pri);
150163         }
151164         ycntdraw++;
152165
r4425r4426
165178         else yoffset = ( (high-ycnt-1)*(wide*16));
166179         if ((ydrawpos >= 0) && (ydrawpos < 224))
167180         {
168            dest = BITMAP_ADDR16(bitmap, ydrawpos, 0);
169            draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos);
181            dest = BITMAP_ADDR32(bitmap, ydrawpos, 0);
182            draw_sprite_line(wide, dest, xzoom, xgrow, yoffset, flip, xpos, pri);
170183         }
171184         ycntdraw++;
172185
r4425r4426
180193
181194static UINT16 *pgm_sprite_source;
182195
183static void draw_sprites(running_machine *machine, int priority, bitmap_t* bitmap)
196static void draw_sprites(running_machine *machine, bitmap_t* spritebitmap)
184197{
185198   /* ZZZZ Zxxx xxxx xxxx
186199       zzzz z-yy yyyy yyyy
r4425r4426
232245
233246      if (high == 0) break; /* is this right? */
234247
235      if ((priority == 1) && (pri == 0)) break;
248      //if ((priority == 1) && (pri == 0)) break;
236249
237      draw_sprite_new_zoomed(machine, wide, high, xpos, ypos, palt, boff, flip, bitmap, xzoom,xgrow, yzoom,ygrow);
250      draw_sprite_new_zoomed(machine, wide, high, xpos, ypos, palt, boff, flip, spritebitmap, xzoom,xgrow, yzoom,ygrow, pri);
238251
239252      pgm_sprite_source += 5;
240253   }
r4425r4426
304317
305318VIDEO_START( pgm )
306319{
320   int i;
321
307322   pgm_tx_tilemap= tilemap_create(machine, get_pgm_tx_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
308323   tilemap_set_transparent_pen(pgm_tx_tilemap,15);
309324
r4425r4426
311326   tilemap_set_transparent_pen(pgm_bg_tilemap,31);
312327   tilemap_set_scroll_rows(pgm_bg_tilemap,64*32);
313328
329   tmppgmbitmap = auto_bitmap_alloc(448,224,BITMAP_FORMAT_RGB32);
330
331   for (i=0; i < 0x1200/2; i++)
332      palette_set_color(machine, i, MAKE_RGB(0, 0, 0));
333
314334   pgm_spritebufferram = auto_malloc (0xa00);
315335
316336   /* we render each sprite to a bitmap then copy the bitmap to screen bitmap with zooming */
r4425r4426
323343   int y;
324344
325345   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
346   bitmap_fill(tmppgmbitmap, cliprect, 0x00000000);
326347
348
327349   pgm_sprite_source = pgm_spritebufferram;
328   draw_sprites(screen->machine, 1, bitmap);
350   draw_sprites(screen->machine, tmppgmbitmap);
329351
330352   tilemap_set_scrolly(pgm_bg_tilemap,0, pgm_videoregs[0x2000/2]);
331353
332354   for (y = 0; y < 224; y++)
333355      tilemap_set_scrollx(pgm_bg_tilemap,(y+pgm_videoregs[0x2000/2])&0x7ff, pgm_videoregs[0x3000/2]+pgm_rowscrollram[y]);
334356
357   {
358      int y,x;
359
360      for (y=0;y<224;y++)
361      {
362         UINT32* src = BITMAP_ADDR32(tmppgmbitmap, y, 0);
363         UINT16* dst = BITMAP_ADDR16(bitmap, y, 0);
364
365         for (x=0;x<448;x++)
366         {
367            if (src[x]&0x10000)
368               if ((src[x]&0x8000)==0x8000)
369                  dst[x] = src[x]&0x7fff;
370         }
371      }
372   }
373
374
335375   tilemap_draw(bitmap,cliprect,pgm_bg_tilemap,0,0);
336376
337   draw_sprites(screen->machine, 0, bitmap);
377   {
378      int y,x;
338379
380      for (y=0;y<224;y++)
381      {
382         UINT32* src = BITMAP_ADDR32(tmppgmbitmap, y, 0);
383         UINT16* dst = BITMAP_ADDR16(bitmap, y, 0);
384
385         for (x=0;x<448;x++)
386         {
387            if (src[x]&0x10000)
388               if ((src[x]&0x8000)==0x0000)
389                  dst[x] = src[x];
390         }
391      }
392   }
393
339394   tilemap_set_scrolly(pgm_tx_tilemap,0, pgm_videoregs[0x5000/2]);
340395   tilemap_set_scrollx(pgm_tx_tilemap,0, pgm_videoregs[0x6000/2]); // Check
341396   tilemap_draw(bitmap,cliprect,pgm_tx_tilemap,0,0);
src/mame/video/toaplan2.c
r4425r4426
7272  ---- xxxx  ---- ---- = Priority (0 - Fh)
7373  ---x ----  ---- ---- = Flip X
7474  --x- ----  ---- ---- = Flip Y
75  -?-- ----  ---- ---- = unknown / unused
75  -x-- ----  ---- ---- = Multi-sprite
7676  x--- ----  ---- ---- = Show sprite ?
7777
7878  1
r4425r4426
13151315{
13161316   const gfx_element *gfx = machine->gfx[ ((controller*2)+1) ];
13171317
1318   int offs;
1318   int offs, old_x, old_y;
13191319
13201320   UINT16 *source = (UINT16 *)(spriteram16_n[controller]);
13211321
13221322
13231323   priority_to_display <<= 8;
13241324
1325   old_x = (-(sprite_scrollx[controller]+xoffset[3])) & 0x1ff;
1326   old_y = (-(sprite_scrolly[controller]+yoffset[3])) & 0x1ff;
1327
13251328   for (offs = 0; offs < (TOAPLAN2_SPRITERAM_SIZE/2); offs += 4)
13261329   {
13271330      int attrib, sprite, color, priority, flipx, flipy, sx, sy;
r4425r4426
13501353         sprite_sizey = ((source[offs + 3] & 0x0f) + 1) * 8;
13511354
13521355         /***** find position to display sprite *****/
1353         sx_base = ((source[offs + 2] >> 7) - (sprite_scrollx[controller]+xoffset[3])) & 0x1ff;
1354         sy_base = ((source[offs + 3] >> 7) - (sprite_scrolly[controller]+yoffset[3])) & 0x1ff;
1356         if (!(attrib & 0x4000))
1357         {
1358            sx_base = ((source[offs + 2] >> 7) - (sprite_scrollx[controller]+xoffset[3])) & 0x1ff;
1359            sy_base = ((source[offs + 3] >> 7) - (sprite_scrolly[controller]+yoffset[3])) & 0x1ff;
1360         } else {
1361            sx_base = (old_x + (source[offs + 2] >> 7)) & 0x1ff;
1362            sy_base = (old_y + (source[offs + 3] >> 7)) & 0x1ff;
1363         }
13551364
1365         old_x = sx_base;
1366         old_y = sy_base;
1367
13561368         flipx = attrib & TOAPLAN2_SPRITE_FLIPX;
13571369         flipy = attrib & TOAPLAN2_SPRITE_FLIPY;
13581370
src/mame/video/wc90b.c
r4425r4426
140140
141141VIDEO_UPDATE( wc90b )
142142{
143   tilemap_set_scrollx(bg_tilemap,0,8 * wc90b_scroll2x[0] + 256 - 4 + (wc90b_scroll_x_lo[0] & 0x07));
144   tilemap_set_scrolly(bg_tilemap,0,wc90b_scroll2y[0] + 1 + ((wc90b_scroll2y[0] < 0x10 || wc90b_scroll2y[0] == 0xff) ? 256 : 0));
145   tilemap_set_scrollx(fg_tilemap,0,8 * wc90b_scroll1x[0] + 256 - 6 + ((wc90b_scroll_x_lo[0] & 0x38) >> 3));
146   tilemap_set_scrolly(fg_tilemap,0,wc90b_scroll1y[0] + 1 + ((wc90b_scroll1y[0] < 0x10 || wc90b_scroll1y[0] == 0xff) ? 256 : 0));
143   tilemap_set_scrollx(bg_tilemap,0,8 * (wc90b_scroll2x[0] & 0x7f) + 256 - 4 + (wc90b_scroll_x_lo[0] & 0x07));
144   tilemap_set_scrolly(bg_tilemap,0,wc90b_scroll2y[0] + 1 + ((wc90b_scroll2x[0] & 0x80) ? 256 : 0));
145   tilemap_set_scrollx(fg_tilemap,0,8 * (wc90b_scroll1x[0] & 0x7f) + 256 - 6 + ((wc90b_scroll_x_lo[0] & 0x38) >> 3));
146   tilemap_set_scrolly(fg_tilemap,0,wc90b_scroll1y[0] + 1 + ((wc90b_scroll1x[0] & 0x80) ? 256 : 0));
147147
148148   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
149149   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
src/mame/video/tx1.c
r4425r4426
1717 *
1818 *************************************/
1919
20#define CURSOR_YPOS 239
21#define CURSOR_XPOS 168
2022#define PRINT_CRTC_DATA 0
2123
24/*
25    6845 cursor output is connected to the main CPU interrupt pin.
26    The CRTC is programmed to provide a rudimentary VBLANK interrupt.
27
28    TODO: Calc TX-1 values...
29*/
30static emu_timer *interrupt_timer;
31
32/*
33    TODO: Check interrupt timing from CRT config. Probably different between games.
34*/
35static TIMER_CALLBACK( interrupt_callback )
36{
37   cpu_set_input_line_and_vector(machine->cpu[0], 0, HOLD_LINE, 0xff);
38   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
39}
40
41
2242READ16_HANDLER( tx1_crtc_r )
2343{
2444   return 0xffff;
r4425r4426
161181
162182   offset <<= 1;
163183
164   if ( offset & 0x04 )
184   if (offset & 0x04)
165185   {
166186      tx1_vregs.ba_inc &= ~0x0000ffff;
167187      tx1_vregs.ba_inc |= data;
168188
169      if ( !(offset & 2)  )
189      if (!(offset & 2))
170190         tx1_vregs.ba_val &= ~0x000ffff;
171191   }
172   if ( offset & 0x08 )
192   if (offset & 0x08)
173193   {
174194      data &= 0xff;
175195      tx1_vregs.ba_inc &= ~0xffff0000;
r4425r4426
178198      // TODO: Schems say D15.
179199      tx1_vregs.bank_mode = BIT(data, 1);
180200
181      if ( !(offset & 2)  )
201      if (!(offset & 2))
182202         tx1_vregs.ba_val &= ~0xffff0000;
183203   }
184204   if ( !(offset & 0x10) )
185205   {
186206      /* Ignore data */
187      if ( offset & 2 )
207      if (offset & 2)
188208         tx1_vregs.ba_val = (tx1_vregs.ba_inc + tx1_vregs.ba_val) & 0x00ffffff;
189209   }
190   if ( offset & 0x20 )
210   if (offset & 0x20)
191211   {
192212      tx1_vregs.h_inc = data;
193213
194214      if ( !(offset & 2) )
195215         tx1_vregs.h_val = 0;
196216   }
197   if ( !(offset & 0x40) )
217   if (!(offset & 0x40))
198218   {
199219      /* TODO: Looks safe to remove this */
200220//      if ( offset & 2 )
r4425r4426
204224
205225WRITE16_HANDLER( tx1_slincs_w )
206226{
207   if ( offset == 1 )
227   if (offset == 1)
208228      tx1_vregs.slin_inc = data;
209229   else
210230      tx1_vregs.slin_inc = tx1_vregs.slin_val = 0;
r4425r4426
236256{
237257   INT32 x, y;
238258   UINT32 scroll_x;
239   UINT8 *gfx1, *gfx2;
259   UINT8 *chars, *gfx2;
240260
241261   /* 2bpp characters */
242   gfx1 = memory_region(machine, "gfx1");
243   gfx2 = gfx1 + 0x4000;
262   chars = memory_region(machine, "char_tiles");
263   gfx2 = chars + 0x4000;
244264
245265   /* X scroll value is the last word in char RAM */
246266   scroll_x = tx1_vram[0xfff] & 0x3ff;
r4425r4426
256276      /* No y-scrolling? */
257277      y_offs = y;
258278
259      if ( (y_offs >= 64) && (y_offs < 128) )
279      if ((y_offs >= 64) && (y_offs < 128))
260280         x_offs = tx1_vregs.slock ? scroll_x : 0;
261281      else
262282         x_offs = 0;
r4425r4426
271291         tilenum = (ram_val & 0x03ff) | ((ram_val & 0x8000) >> 5);
272292         colour = (ram_val & 0xfc00) >> 8;
273293         d0 = *(gfx2 + (tilenum << 3) + y_gran);
274         d1 = *(gfx1 + (tilenum << 3) + y_gran);
294         d1 = *(chars + (tilenum << 3) + y_gran);
275295      }
276296
277297      for (x = 0; x < 256 * 3; ++x)
r4425r4426
286306            tilenum = (ram_val & 0x03ff) | ((ram_val & 0x8000) >> 5);
287307            colour = (ram_val & 0xfc00) >> 8;
288308            d0 = *(gfx2 + (tilenum << 3) + y_gran);
289            d1 = *(gfx1 + (tilenum << 3) + y_gran);
309            d1 = *(chars + (tilenum << 3) + y_gran);
290310         }
291311
292312         *bitmap++ = colour |
r4425r4426
319339}
320340
321341INLINE void tx1_draw_road_pixel(int screen, UINT8 *bmpaddr,
322                   UINT8 apix[3], UINT8 bpix[3], UINT32 pixnuma, UINT32 pixnumb,
323                   UINT8 stl, UINT8 sld, UINT8 selb,
324                   UINT8 bnk, UINT8 rorev, UINT8 eb, UINT8 r, UINT8 delr,
325                   running_machine *machine)
342                        UINT8 apix[3], UINT8 bpix[3], UINT32 pixnuma, UINT32 pixnumb,
343                        UINT8 stl, UINT8 sld, UINT8 selb,
344                        UINT8 bnk, UINT8 rorev, UINT8 eb, UINT8 r, UINT8 delr,
345                        running_machine *machine)
326346{
327347   UINT8 a0 = BIT(apix[0], pixnuma);
328348   UINT8 a1 = BIT(apix[1], pixnuma);
r4425r4426
484504      int febc[2] = { 0, 0 };
485505
486506      /* Road vertical address */
487      if ( BIT(tx1_vregs.h_val, 15) )
507      if (BIT(tx1_vregs.h_val, 15))
488508         rva6_0 = 0x7f;
489509      else
490510         rva6_0 = (~tx1_vregs.h_val >> 7) & 0x7f;
r4425r4426
655675         scrcnt1 = (road1_hcnt >> 5) & 0xf;
656676
657677         /* Get new pixel data? */
658         if ( !(road0_pcnt & 7) )
678         if (!(road0_pcnt & 7))
659679         {
660680            TX1_GET_ROADPIX(0);
661681
r4425r4426
665685            febr[0] = (scrcnt0 + 2) & 0xc;
666686         }
667687
668         if ( !(road1_pcnt & 7) )
688         if (!(road1_pcnt & 7))
669689         {
670690            UINT32 y4 = (road1_hcnt >> 4) & 1;
671691            UINT32 temp = (road1_hcnt >> 5) & 0xf;
r4425r4426
693713         }
694714
695715         /* Road camber/banking */
696         if ( BIT(tx1_vregs.ba_val, 23) )
716         if (BIT(tx1_vregs.ba_val, 23))
697717         {
698718            bnkls = 1;
699719            bnkcs = 1;
r4425r4426
856876   UINT32 offs;
857877
858878   /* The many lookup table ROMs */
859   const UINT8 *const user3 = memory_region(machine, "user3");
860   const UINT8 *const ic48  = user3;
861   const UINT8 *const ic281 = user3 + 0x2000;
879   const UINT8 *const ic48 = memory_region(machine, "user3");
880   const UINT8 *const ic281 = ic48 + 0x2000;
862881
863882   const UINT8 *const proms = memory_region(machine, "proms");
883   const UINT8 *const ic190 = proms + 0xc00;
884   const UINT8 *const ic162 = proms + 0xe00;
864885   const UINT8 *const ic25  = proms + 0x1000;
865886
866   const UINT8 *const user2 = memory_region(machine, "user2");
867   const UINT8 *const ic106 = user2;
868   const UINT8 *const ic73  = user2 + 0x4000;
887   const UINT8 *const ic106 = memory_region(machine, "obj_map");
888   const UINT8 *const ic73  = ic106 + 0x4000;
869889
870   const UINT8 *const ic190 = proms + 0xc00;
871   const UINT8 *const ic162 = proms + 0xe00;
890   const UINT8 *const pixdata_rgn = memory_region(machine, "obj_tiles");
872891
873   const UINT8 *const pixdata_rgn = memory_region(machine, "gfx2");
874
875892   for (offs = 0x0; offs <= tx1_objram_size; offs += 8)
876893   {
877894      UINT32   x;
r4425r4426
887904      UINT8   code;
888905
889906      /* Check for end of object list */
890      if ( (tx1_objram[offs] & 0xff00) == 0xff00 )
907      if ((tx1_objram[offs] & 0xff00) == 0xff00)
891908         break;
892909
893910      /* X scale */
894911      x_scale = tx1_objram[offs + 2] & 0xff;
895912
896913      /* TODO: Confirm against hardware? */
897      if ( x_scale == 0 )
914      if (x_scale == 0)
898915         continue;
899916
900917      /* 16-bit y-scale accumulator */
r4425r4426
922939         /* Are we drawing on this line? */
923940
924941         /* TODO: See big lampposts. */
925         if ( y_scale & 0x8000 )
942         if (y_scale & 0x8000)
926943            break;
927944
928945         {
r4425r4426
945962            ic48_data = ic48[ic48_addr];
946963
947964            /* Reached the bottom of the object? (/PASS2E) */
948            if ( ic48_data == 0xff )
965            if (ic48_data == 0xff)
949966               break;
950967
951968            /* Combine ROM and PROM data */
r4425r4426
979996                  {
980997                     UINT32 xor_mask;
981998
982                     if ( BIT(psa0_11, 11) && BIT(psa0_11, 10) )
999                     if (BIT(psa0_11, 11) && BIT(psa0_11, 10))
9831000                        xor_mask = 0xf;
984                     else if ( BIT(psa0_11, 11) || BIT(psa0_11, 10) || BIT(psa0_11, 9) )
1001                     else if (BIT(psa0_11, 11) || BIT(psa0_11, 10) || BIT(psa0_11, 9))
9851002                        xor_mask = 0x7;
9861003                     else
9871004                        xor_mask = 0x3;
r4425r4426
9931010
9941011                  ic106_data = ic106[rom_addr2 & 0x3fff];
9951012
996                  if ( (ic106_data & 0x40) && dataend )
1013                  if ((ic106_data & 0x40) && dataend)
9971014                     lasttile = 1;
9981015
9991016                  dataend |= ic106_data & 0x40;
r4425r4426
10011018                  /* Retrieve data for an 8x8 tile */
10021019                  ic73_data = ic73[rom_addr2];
10031020
1004                  // This is the data from the LUT pair
1021                  /* This is the data from the LUT pair */
10051022                  lut_data = (ic106_data << 8) | ic73_data;
10061023                  psbb0_12 = lut_data & 0x1fff;
10071024
10081025                  pscb0_14 = (psbb0_12 & 0xc3f);
10091026
10101027                  /* Bits 9_6 are from PCTMP11-8 or PSBB9-6 */
1011                  if ( BIT(psbb0_12, 12) )
1028                  if (BIT(psbb0_12, 12))
10121029                     pscb0_14 |= psbb0_12 & 0x3c0;
10131030                  else
10141031                     pscb0_14 |= (pctmp0_7 & 0xf) << 6;
10151032
1016                  if ( BIT(lut_data, 13) )
1017                     pscb0_14 |= BIT(psbb0_12, 10) << 12;   // NOT USED
1033                  if (BIT(lut_data, 13))
1034                     pscb0_14 |= BIT(psbb0_12, 10) << 12;
10181035                  else
10191036                     pscb0_14 |= ((pctmp0_7 & 0x70) << 8);
10201037
1021                  /* Bit 12 is Bit 10 duplicated. */
1038                  /* Bit 12 is bit 10 duplicated. */
10221039                  pscb0_14 &= ~(1 << 12);
10231040                  pscb0_14 |= BIT(psbb0_12, 10) << 12;
10241041
r4425r4426
10461063               }
10471064
10481065               /* Draw a pixel? */
1049               if ( x < 768 )
1066               if (x < 768)
10501067               {
10511068                  UINT8   pix;
10521069                  UINT8   bit;
10531070
10541071                  bit   = (x_acc >> FRAC) & 7;
10551072
1056                  if ( xflip )
1073                  if (xflip)
10571074                     bit ^= 7;
10581075
10591076                  pix = (((data1 >> bit) & 1) << 1) | ((data2 >> bit) & 1);
r4425r4426
10721089                     else
10731090                        color = ~ic162[prom_addr] & 0x3f;
10741091
1075//                          *BITMAP_ADDR16(bitmap, y, x) = machine->pens[TX1_COLORS_OBJ + color];
10761092                     *(bitmap + 768*y + x) = 0x40 | color;
10771093                  }
10781094               }
10791095
10801096               /* Check if we've stepped into a new 8x8 tile */
1081               /* TODO */
1082               if ( (((x_acc + x_step) >> (FRAC + 3)) & TX1_MASK) != ((x_acc >> (FRAC + 3)) & TX1_MASK) )
1097
1098               if ((((x_acc + x_step) >> (FRAC + 3)) & TX1_MASK) != ((x_acc >> (FRAC + 3)) & TX1_MASK))
10831099               {
10841100                  if (lasttile)
10851101                     break;
r4425r4426
10871103                  newtile = 1;
10881104               }
10891105
1090                 x = (x + 1) & TX1_MASK;
1106               x = (x + 1) & TX1_MASK;
10911107               x_acc += x_step;
10921108            }
1093         }// if (yscale)
1109         }
10941110         y_scale += y_step;
1095      } /* for (y) */
1096   }/* for (offs) */
1111      }
1112   }
10971113}
10981114
10991115
r4425r4426
11131129   tx1_chr_bmp = auto_malloc(sizeof(UINT8) * 256 * 3 * 240);
11141130   tx1_obj_bmp = auto_malloc(sizeof(UINT8) * 256 * 3 * 240);
11151131   tx1_rod_bmp = auto_malloc(sizeof(UINT8) * 256 * 3 * 240);
1132
1133   /* Set a timer to run the interrupts */
1134   interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
1135
1136   /* /CUDISP CRTC interrupt */
1137   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
11161138}
11171139
11181140VIDEO_EOF( tx1 )
r4425r4426
13201342{
13211343   INT32 x, y;
13221344   UINT32 scroll_x, scroll_y;
1323   UINT8 *gfx1, *gfx2;
1345   UINT8 *chars, *gfx2;
13241346   UINT32 total_width;
13251347   UINT32 x_mask;
13261348
13271349   /* 2bpp characters */
1328   gfx1 = memory_region(machine, "gfx1");
1329   gfx2 = memory_region(machine, "gfx1") + 0x4000;
1350   chars = memory_region(machine, "char_tiles");
1351   gfx2 = memory_region(machine, "char_tiles") + 0x4000;
13301352
13311353   /* X/Y scroll values are the last word in char RAM */
13321354   if (wide)
r4425r4426
13641386            y_offs |= 0xc0;
13651387      }
13661388
1367      if ( (y_offs >= 64) && (y_offs < 128) )
1389      if ((y_offs >= 64) && (y_offs < 128))
13681390         x_offs = scroll_x;
13691391      else
13701392         x_offs = 0;
r4425r4426
13851407         tilenum = (ram_val & 0x03ff) | ((ram_val & 0x8000) >> 5);
13861408         colour = (ram_val & 0xfc00) >> 8;
13871409         d0 = *(gfx2 + (tilenum << 3) + y_gran);
1388         d1 = *(gfx1 + (tilenum << 3) + y_gran);
1410         d1 = *(chars + (tilenum << 3) + y_gran);
13891411      }
13901412
13911413      for (x = 0; x < total_width; ++x)
r4425r4426
14051427            tilenum = (ram_val & 0x03ff) | ((ram_val & 0x8000) >> 5);
14061428            colour = (ram_val & 0xfc00) >> 8;
14071429            d0 = *(gfx2 + (tilenum << 3) + y_gran);
1408            d1 = *(gfx1 + (tilenum << 3) + y_gran);
1430            d1 = *(chars + (tilenum << 3) + y_gran);
14091431         }
14101432
14111433         *bitmap++ = colour |
r4425r4426
14221444
14231445  Buggy Boy Road Hardware
14241446
1425  A mega-hack of TX-1 but without the second road.
1447  A hacked up version of TX-1 but without the second road.
14261448
14271449  There are two lists in road/common RAM (double buffered) starting at 0x800
14281450  and 0xa00:
r4425r4426
14461468  1 : Road list select
14471469  0 : Wall angle enable ('WANGL')
14481470
1449  Road PAL equations:
1471  Buggy Boy Jr. Road PAL equations:
14501472
14511473  http://philwip.mameworld.info/buggyboy/PAL14H4.149.htm
14521474  http://philwip.mameworld.info/buggyboy/PAL14L4.151.htm
r4425r4426
14561478
14571479***************************************************************************/
14581480
1459static void buggybjr_draw_road(running_machine *machine, UINT8 *bitmap, int wide)
1481void buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev,
1482                    UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3,
1483                    const UINT8 *rom, const UINT8 *prom0, const UINT8 *prom1, const UINT8 *prom2)
14601484{
1461#define X_ADJUST 384
1462#define LOAD_HPOS_COUNTER( NUM )                                    \
1485   /* Counter Q10-7 are added to 384 */
1486   UINT16 ls283_159 = (ls161 & 0x780) + 128 + (256 * screen);
1487   UINT32 ls283_159_co = ls283_159 & 0x800;
1488   UINT32 rom_flip = ls283_159 & 0x200 ? 0 : 1;
1489   UINT32 rom_en = !(ls283_159 & 0x400) && !(ls283_159_co ^ (ls161 & 0x800));
1490   UINT8 d0 = 0;
1491   UINT8 d1 = 0;
1492
1493   /* Latch road reverse bit */
1494   *_rorev = !( (rom_en && rom_flip) || (!rom_en && (ls161 & 0x4000)) );
1495
1496   /* TODO: ROM data is 0xff if not enabled. */
1497   if (rom_en)
1498   {
1499      UINT8  rom_data;
1500      UINT16 prom_addr;
1501
1502      /* 6 bit road horizontal address */
1503      UINT16 rha = (ls283_159 & 0x180) | (ls161 & 0x78);
1504
1505      if (rom_flip)
1506         rha ^= 0x1f8;
1507
1508      /* Get road chunk first */
1509      rom_data = rom[(1 << 13) | (rha << 4) | rva0_6];
1510      prom_addr = (rom_flip ? 0x80 : 0) | (rom_data & 0x7f);
1511
1512      *rc0 = prom0[prom_addr];
1513      *rc1 = prom1[prom_addr];
1514      *rc2 = prom2[prom_addr];
1515
1516      /* Now get the dirt chunk */
1517      rom_data = rom[(rha << 4) | rva0_6];
1518      prom_addr = 0x100 | rom_data;
1519
1520      d0 = prom0[prom_addr];
1521      d1 = prom1[prom_addr];
1522   }
1523   else
1524   {
1525      /*
1526            TODO: When ROM is not enabled, data = 0xff
1527            But does anybody care?
1528        */
1529      *rc0 = *rc1 = *rc2 = *rc3 = 0;
1530   }
1531
1532   /* The data is mixed by two TZ0314 PALs */
1533   if (BIT(sld, 4))
1534   {
1535      if (BIT(sld, 5))
1536         d1 = ~d1;
1537
1538      *rc3 = d0 & d1;
1539
1540      if (rom_flip)
1541         *rc3 = BITSWAP8(*rc3, 0, 1, 2, 3, 4, 5, 6, 7);
1542   }
1543   else
1544      *rc3 = 0;
1545}
1546
1547#define LOAD_HPOS_COUNTER(NUM)                                       \
14631548   ram_val = buggyboy_rcram[(rva_offs + 0x1f8 + (2*NUM)) >> 1];            \
14641549   rcrs10 = ram_val & 0xfc00 ? 0x0400 : 0x0000;                        \
14651550   hp = vregs.wa8 + ((BIT(ram_val, 15) << 11) | rcrs10 | (ram_val & 0x03ff));   \
r4425r4426
14691554   hps##NUM##1 = (BIT(hp, 1) || BIT(hp, 2)) && !BIT(hp, 3);               \
14701555   hps##NUM##2 = BIT(hp, 2);                                       \
14711556
1472/* Check carry out calc */
1473#define UPDATE_HPOS( NUM )            \
1557#define UPDATE_HPOS(NUM)            \
14741558   if (hp##NUM##_en)               \
14751559   {                           \
14761560      if ((hp##NUM & 0xff) == 0xff)   \
r4425r4426
14791563         hp##NUM = hp##NUM + 1;      \
14801564   }                           \
14811565
1566static void buggyboy_draw_road(running_machine *machine, UINT8 *bitmap)
1567{
14821568   INT32 x;
14831569   UINT32 y;
14841570   UINT16 rva_offs;
r4425r4426
14941580
14951581   /* ROM/PROM lookup tables */
14961582   const UINT8 *rcols = (UINT8*)(memory_region(machine, "proms") + 0x1500);
1497   const UINT8 *rom   = memory_region(machine, "gfx6");
1583   const UINT8 *rom   = memory_region(machine, "road");
14981584   const UINT8 *prom0 = rom + 0x4000;
14991585   const UINT8 *prom1 = rom + 0x4200;
15001586   const UINT8 *prom2 = rom + 0x4400;
r4425r4426
15231609      UINT32   rva8;
15241610      UINT32   rm0, rm1;
15251611      UINT32   rcmd;
1612      UINT32   bnkls = 1;
15261613      UINT32   bnkcs = 1;
1614      UINT32   bnkrs = 1;
15271615
15281616      UINT32   x_offs;
1617      UINT8 sf;
15291618
15301619      /* Vertical positions shift register */
15311620      UINT32   ram_val;
15321621      UINT32   hp;
15331622      UINT32   vp1, vp2, vp3, vp4, vp5, vp6, vp7;
15341623
1624      /* Horizontal positions */
1625      UINT32   hp0, hp1, hp2, hp3;
1626      UINT8   hps00, hps01, hps02;
1627      UINT8   hps10, hps11, hps12;
1628      UINT8   hps20, hps21, hps22;
1629      UINT8   hps30, hps31, hps32;
1630
1631      /* Road pixel data planes */
1632      UINT8   rc0[3] = {0, 0, 0};
1633      UINT8   rc1[3] = {0, 0, 0};
1634      UINT8   rc2[3] = {0, 0, 0};
1635      UINT8   rc3[3] = {0, 0, 0};
1636
1637      /* Horizontal position counter carry out */
1638      UINT8   hp0_cy = 0, hp1_cy = 0, hp2_cy = 0, hp3_cy = 0;
1639
1640      UINT8   *bmpaddr = bitmap + (y * 256 * 3);
1641
1642      UINT32   bank_cnt;
1643      UINT32   _rorevls = 0;
1644      UINT32   _rorevcs = 0;
1645      UINT32   _rorevrs = 0;
1646
1647      UINT32   ic96_o17;
1648      UINT32   ic96_term1;
1649      UINT32   ic97_o12;
1650      UINT32   ic97_o13;
1651      UINT32   ic79_p19;
1652
1653      rva8 = (vregs.h_val & 0x8000) || !(vregs.shift & 0x80);
1654
1655      /* Get RVA0_6 from TZ113 accumulator chain @ 122/123 */
1656      rva0_6 = (vregs.h_val >> 7) & 0x7f;
1657
1658      /* For /WAVE bit logic later */
1659      rva20_6 = ((rva0_6 >> 3) & 0xe) | ((rva0_6 & 2) >> 1);
1660
1661      /* RVA is inverted! */
1662      ram_addr = (~rva0_6 & 0x7f) << 1;
1663
1664      /* Get the road RAM data for this line */
1665      rcrdb0_15 = buggyboy_rcram[(rva_offs + ram_addr) >> 1];
1666
1667      /* If 15-10 == 000000, then 0 */
1668      rcrs10 = rcrdb0_15 & 0xfc00 ? 0x0400 : 0x0000;
1669
1670      /* If 15-10 == 111111, then 1 */
1671      ls161_156_a = (rcrdb0_15 & 0xfc00) == 0xfc00 ? 0x800 : 0x0000;
1672
1673      /* LS161 15-bit counter chain - loaded with RAM data (bar bits 10-13) */
1674      ls161 =  ((rcrdb0_15 & 0x8000) >> 1) | ls161_156_a | rcrs10 | (rcrdb0_15 & 0x03ff);
1675
1676      /* SLD */
1677      sld = (vprom[rva0_6] + vregs.slin) & 0x38;
1678
1679      /* Determine the x-offset */
1680      x_offs = ls161 & 7;
1681
1682      /* Fill vertical position shift register with bits for this line */
1683      /* TODO; cheated slightly to shift stuff up one pixel*/
1684      vp1 = buggyboy_rcram[(rva_offs + 0x1e2) >> 1] >= y ? 0 : 1;
1685      vp2 = buggyboy_rcram[(rva_offs + 0x1e4) >> 1] >= y ? 0 : 1;
1686      vp3 = buggyboy_rcram[(rva_offs + 0x1e6) >> 1] >= y ? 0 : 1;
1687      vp4 = buggyboy_rcram[(rva_offs + 0x1e8) >> 1] >= y ? 0 : 1;
1688      vp5 = buggyboy_rcram[(rva_offs + 0x1ea) >> 1] >= y ? 0 : 1;
1689      vp6 = buggyboy_rcram[(rva_offs + 0x1ec) >> 1] >= y ? 0 : 1;
1690      vp7 = buggyboy_rcram[(rva_offs + 0x1ee) >> 1] >= y ? 0 : 1;
1691
1692      /* Stuff */
1693      rm0 = vp7 ? BIT(vregs.scol, 4) : BIT(vregs.scol, 12);
1694      rm1 = vp7 ? BIT(vregs.scol, 5) : BIT(vregs.scol, 13);
1695
1696      /* Wall/tunnel control */
1697      rcmd = (vp7 ? vregs.scol : vregs.scol >> 8) & 0xf;
1698
1699      /* Load 'em up */
1700      LOAD_HPOS_COUNTER(0);
1701      LOAD_HPOS_COUNTER(1);
1702      LOAD_HPOS_COUNTER(2);
1703      LOAD_HPOS_COUNTER(3);
1704
1705      /* Load the bank counter with accumulator bits 14-5 */
1706      bank_cnt = (vregs.ba_val >> 5) & 0x3ff;
1707
1708      /* Have we crossed a road gfx strip boundary? */
1709      if (ls161 & 7)
1710      {
1711         buggyboy_get_roadpix(0, ls161, rva0_6, sld, &_rorevls, &rc0[0], &rc1[0], &rc2[0], &rc3[0], rom, prom0, prom1, prom2);
1712         buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0[1], &rc1[1], &rc2[1], &rc3[1], rom, prom0, prom1, prom2);
1713         buggyboy_get_roadpix(2, ls161, rva0_6, sld, &_rorevrs, &rc0[2], &rc1[2], &rc2[2], &rc3[2], rom, prom0, prom1, prom2);
1714      }
1715
1716      /* We can evaluate some of the pixel logic outside of the x-loop */
1717      ic96_term1 = !tnlf || (vp5 && vp6) || (!vp3 && vp6) || (!vp4 && vp5) || (!vp3 && !vp4);
1718      ic96_o17 = (vp3 && vp4) || tnlmd0 || tnlmd1 || !vp1 || !tnlf;
1719
1720      ic97_o12 = (!vp1 && !vp2 && !vp6) || (!vp1 && !vp2 && vp7) || (vp4 && !vp6) || (vp4 && vp7);
1721      ic97_o13 = (!vp1 && !vp2 && !vp5) || (!vp1 && !vp2 && vp7) || (vp3 && !vp5) || (vp3 && vp7);
1722
1723      ic79_p19 = !(!(vp5 || vp6) || vp7) && !(tnlmd0 || tnlmd1);
1724
1725      for (x = 0; x < 256; ++x)
1726      {
1727         UINT32   pix;
1728         UINT32   hp0_en, hp1_en, hp2_en, hp3_en;
1729
1730         UINT32   ic97_o17;
1731         UINT32   ic97_o18;
1732         UINT32   ic97_o19;
1733
1734         UINT32   ic96_o14;
1735         UINT32   ic96_o15;
1736         UINT32   ic96_o16;
1737
1738         UINT32   ic79_o15;
1739         UINT32   ic79_o16;
1740         UINT32   ic79_o17;
1741
1742         UINT32   ic82_o17;
1743         UINT32   ic82_o16;
1744         UINT32   ic82_o15;
1745         UINT32   ic82_o14;
1746
1747         UINT32   ic80_o17;
1748         UINT32   ic80_o16;
1749         UINT32   ic80_o15;
1750         UINT32   ic80_o14;
1751
1752         UINT32   ic78_o17;
1753         UINT32   ic78_o16;
1754         UINT32   ic78_o15;
1755         UINT32   ic78_o14;
1756
1757         UINT32   ic48_o12, ic50_o12, ic52_o12;
1758         UINT32   ic48_o16, ic50_o16, ic52_o16;
1759         UINT32   ic48_o17, ic50_o17, ic52_o17;
1760         UINT32   ic48_o18, ic50_o18, ic52_o18;
1761         UINT32   ic48_o19, ic50_o19, ic52_o19;
1762
1763         UINT32   tmp;
1764
1765         UINT8   px0[3];
1766         UINT8   px1[3];
1767         UINT8   px2[3];
1768         UINT8   px3[3];
1769
1770         UINT32 lfsr = vregs.wave_lfsr;
1771         UINT32 wave =
1772                  (wave0 ^ BIT(lfsr, 0))
1773                  && (wave1 ^ BIT(lfsr, 3))
1774                  && BIT(lfsr, 5)
1775                  && !BIT(lfsr, 15)
1776                  && BIT(lfsr, 11)
1777                  && BIT(lfsr, 13)
1778                  && (rva20_6 < ((lfsr >> 8) & 0xf));
1779
1780
1781         /* Strip pixel number */
1782         pix = (ls161 & 7) ^ 7;
1783
1784         /* Horizontal position counter enables - also used as PAL inputs */
1785         hp0_en = !(hp0_cy || hps02);
1786         hp1_en = !(hp1_cy || hps12);
1787         hp2_en = !(hp2_cy || hps22);
1788         hp3_en = !(hp3_cy || hps32);
1789
1790         /* Load in a new road gfx strip? */
1791         if (!(ls161 & 7))
1792         {
1793            buggyboy_get_roadpix(0, ls161, rva0_6, sld, &_rorevls, &rc0[0], &rc1[0], &rc2[0], &rc3[0], rom, prom0, prom1, prom2);
1794            buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0[1], &rc1[1], &rc2[1], &rc3[1], rom, prom0, prom1, prom2);
1795            buggyboy_get_roadpix(2, ls161, rva0_6, sld, &_rorevrs, &rc0[2], &rc1[2], &rc2[2], &rc3[2], rom, prom0, prom1, prom2);
1796         }
1797
1798         /* Road camber/banking */
1799         if (BIT(vregs.ba_val, 23))
1800         {
1801            bnkls = 1; bnkcs = 1; bnkrs = 1;
1802         }
1803         else if (vregs.ba_val & 0x007f8000)
1804         {
1805            bnkls = 0; bnkcs = 0; bnkrs = 0;
1806         }
1807         else
1808         {
1809            bnkls = bank_cnt < 0x400;
1810            bnkcs = bank_cnt < 0x300;
1811            bnkrs = bank_cnt < 0x200;
1812         }
1813
1814         if (vregs.bank_mode)
1815         {
1816            bnkls ^= 1; bnkcs ^= 1; bnkrs ^= 1;
1817         }
1818
1819         px0[0] = BIT(rc0[0], pix);
1820         px1[0] = BIT(rc1[0], pix);
1821         px2[0] = BIT(rc2[0], pix);
1822         px3[0] = BIT(rc3[0], pix);
1823
1824         px0[1] = BIT(rc0[1], pix);
1825         px1[1] = BIT(rc1[1], pix);
1826         px2[1] = BIT(rc2[1], pix);
1827         px3[1] = BIT(rc3[1], pix);
1828
1829         px0[2] = BIT(rc0[2], pix);
1830         px1[2] = BIT(rc1[2], pix);
1831         px2[2] = BIT(rc2[2], pix);
1832         px3[2] = BIT(rc3[2], pix);
1833
1834         /*
1835                Now evaluate the pixel logic for each of the three screens
1836
1837                TODO: A lot of this could be macrofied to avoid repetition.
1838                Shuffling the equations around would squeeze out some extra speed.
1839            */
1840
1841         /* Left */
1842         ic96_o14 =
1843         ic96_term1
1844         || (!hp1_en && hps10 && vp4 && !hps20 && !hps21)
1845         || (!hp1_en && hps10 && vp4 && hp2_en && !hps21)
1846         || (!hp1_en && hps10 && vp4 && vp6)
1847         || (hps11 && vp4 && !hps20 && !hps21)
1848         || (hps11 && vp4 && hp2_en && !hps21)
1849         || (vp5 && !hps20 && !hps21)
1850         || (!vp3 && !hps20 && !hps21)
1851         || (vp5 && hp2_en && !hps21)
1852         || (!vp3 && hp2_en && !hps21)
1853         || (!hp1_en && hps10 && !vp4)
1854         || (hps11 && vp4 && vp6)
1855         || (hps11 && !vp4);
1856
1857         /* Centre */
1858         ic96_o15 =
1859         ic96_term1
1860         || (hps10 && hps11 && vp4 && hp2_en && !hps20)
1861         ||(!hp1_en && hps11 && vp4 && hp2_en && !hps20)
1862         || (hps10 && hps11 && vp6)
1863         || (!hp1_en && hps11 && vp6)
1864         || (hps10 && hps11 && vp4 && !hps21)
1865         || (!hp1_en && hps11 && vp4 && !hps21)
1866         || (vp5 && hp2_en && !hps20)
1867         || (!vp3 && hp2_en && !hps20)
1868         || (hps10 && hps11 && !vp4)
1869         || (!hp1_en && hps11 && !vp4)
1870         || (vp5 && !hps21)
1871         || (!vp3 && !hps21);
1872
1873         /* Right */
1874         ic96_o16 =
1875         ic96_term1
1876         || (!hp1_en && hps10 && hps11 && vp6)
1877         || (!hp1_en && hps10 && hps11 && !vp4)
1878         || (!hp1_en && hps10 && hps11 && !hps20)
1879         || (!hp1_en && hps10 && hps11 && hp2_en)
1880         || (!hp1_en && hps10 && hps11 && !hps21)
1881         || (vp5 && !hps20)
1882         || (!vp3 && !hps20)
1883         || (vp5 && hp2_en)
1884         || (!vp3 && hp2_en)
1885         || (vp5 && !hps21)
1886         || (!vp3 && !hps21);
1887
1888         tmp = (!vp1 && !vp2) || (vp2 && vp7);
1889         ic97_o17 = tmp || (!hp0_en && hps00 && vp2 && !hps30 && !hps31) || (!hp0_en && hps00 && vp2 && hp3_en && !hps31) || (hps01 && vp2 && !hps30 && !hps31) || (hps01 && vp2 && hp3_en && !hps31);
1890         ic97_o18 = tmp || (hps00 && hps01 && vp2 && hp3_en && !hps30) || (!hp0_en && hps01 && vp2 && hp3_en && !hps30) || (hps00 && hps01 && vp2 && !hps31) || (!hp0_en && hps01 && vp2 && !hps31);
1891         ic97_o19 = tmp || (!hp0_en && hps00 && hps01 && vp2 && !hps30) || (!hp0_en && hps00 && hps01 && vp2 && hp3_en) || (!hp0_en && hps00 && hps01 && vp2 && !hps31);
1892
1893
1894         /* Left */
1895         {
1896         UINT32 P4, P6, P7, P18, P19;
1897
1898         P4 = !(ic96_o16 && ic96_o17 && ic97_o19);
1899         P6 = BIT(sld, 3);
1900         P7 = (!vp5 && !vp6) || vp7 || !linf;
1901         P19 = wangl && bnkls;
1902
1903         ic78_o17 = (_rorevls && !tnlmd1 && tnlmd0) || (!_rorevls && tnlmd1 && !tnlmd0) || (_rorevls && ic97_o12) || (!_rorevls && ic97_o13);
1904         P18 = ic78_o17;
1905         ic78_o16 = P7 || (px1[0] && !px0[0] && tnlmd1 && !tnlmd0) || (px2[0] && tnlmd1 && tnlmd0);
1906         ic78_o15 = !tnlf || (!P4 && px0[0] && P19) || (!P4 && px1[0] && P19) || (!P4 && P18) || (!P4 && px2[0]);
1907         ic78_o14 = !P6 || tnlmd0 || tnlmd1 || P7;
1908         }
1909
1910         /* Centre */
1911         {
1912         UINT32 P4, P6, P7, P18, P19;
1913
1914         P4 = !(ic96_o15 && ic96_o17 && ic97_o18);
1915         P6 = BIT(sld, 3);
1916         P7 = (!vp5 && !vp6) || vp7 || !linf;
1917         P19 = wangl && bnkcs;
1918
1919         ic80_o17 = (_rorevcs && !tnlmd1 && tnlmd0) || (!_rorevcs && tnlmd1 && !tnlmd0) || (_rorevcs && ic97_o12) || (!_rorevcs && ic97_o13);
1920         P18 = ic80_o17;
1921         ic80_o16 = P7 || (px1[1] && !px0[1] && tnlmd1 && !tnlmd0) || (px2[1] && tnlmd1 && tnlmd0);
1922         ic80_o15 = !tnlf || (!P4 && px0[1] && P19) || (!P4 && px1[1] && P19) || (!P4 && P18) || (!P4 && px2[1]);
1923         ic80_o14 = !P6 || tnlmd0 || tnlmd1 || P7;
1924         }
1925
1926         /* Right */
1927         {
1928         UINT32 P4, P6, P7, P18, P19;
1929
1930         P4 = !(ic96_o14 && ic96_o17 && ic97_o17);
1931         P6 = BIT(sld, 3);
1932         P7 = (!vp5 && !vp6) || vp7 || !linf;
1933         P19 = wangl && bnkrs;
1934
1935         ic82_o17 = (_rorevrs && !tnlmd1 && tnlmd0) || (!_rorevrs && tnlmd1 && !tnlmd0) || (_rorevrs && ic97_o12) || (!_rorevrs && ic97_o13);
1936         P18 = ic82_o17;
1937         ic82_o16 = P7 || (px1[2] && !px0[2] && tnlmd1 && !tnlmd0) || (px2[2] && tnlmd1 && tnlmd0);
1938         ic82_o15 = !tnlf || (!P4 && px0[2] && P19) || (!P4 && px1[2] && P19) || (!P4 && P18) || (!P4 && px2[2]);
1939         ic82_o14 = !P6 || tnlmd0 || tnlmd1 || P7;
1940         }
1941
1942
1943         ic79_o17 = (!px2[0] && _rorevls && ic78_o15) || (tnlf && !ic97_o19) || (tnlf && ic79_p19 && px2[0] && ic78_o15);
1944         ic79_o16 = (!px2[1] && _rorevcs && ic80_o15) || (tnlf && !ic97_o18) || (tnlf && ic79_p19 && px2[1] && ic80_o15);
1945         ic79_o15 = (!px2[2] && _rorevrs && ic82_o15) || (tnlf && !ic97_o17) || (tnlf && ic79_p19 && px2[2] && ic82_o15);
1946
1947
1948         /* Left */
1949         {
1950         UINT32 P5,P7, P8;
1951         UINT32 rcsd0_3;
1952         UINT32 cprom_addr;
1953
1954         P5 = BIT(tcmd, 3) ? ((!vp5 && !vp6) || vp7 || !linf) : ic78_o16;
1955         P7 = BIT(sld, 5);
1956         P8 = BIT(sld, 4);
1957
1958         ic48_o19 = (px2[0] && !rva8) || !bnkls || !P5 || !ic78_o15;
1959
1960         if (ic48_o19)
1961         {
1962            ic48_o12 =
1963            ic78_o14 &&
1964            (
1965               (px2[0] && px1[0] && px0[0] && rm1 && !rm0)
1966               || (!px2[0] && px1[0] && px0[0] && !P8 && rm0)
1967               || (px2[0] && px0[0] && !P7 && !rm1 && !rm0)
1968               || (px2[0] && !px1[0] && px0[0] && !P7 && !rm1)
1969               || (px2[0] && px1[0] && px0[0] && !P7 && !P8)
1970               || (px2[0] && px1[0] && px0[0] && !P8 && rm1)
1971               || (!px2[0] && !px3[0] && !rm0)
1972               || (!px1[0] && !px3[0] && rm1)
1973               || (!px2[0] && !px1[0] && !px3[0])
1974               || (rva8)
1975               || (!px0[0] && !px3[0])
1976               || (!ic78_o15)
1977               || (!P5)
1978            );
1979
1980            ic48_o16 = (px2[0] && P5 && rm1) || (P5 && rva8 && ic78_o15) || (!px0[0] && P5) || !ic78_o15;
1981            ic48_o17 = (px0[0] && P5 && !rm0 && ic78_o15) || (!px1[0] && P5 && ic78_o15) || (P5 && rva8 && ic78_o15);
1982            ic48_o18 = (!px2[0] && P5 && ic78_o15) || (P5 && rva8 && ic78_o15);
1983
1984            if (vp6 || ic78_o16)
1985            {
1986               if (!(ic78_o15 && P5))
1987                  cprom_addr = (tcmd & 0x7) | (ic78_o16 << 3);
1988               else
1989                  cprom_addr = rcmd;
1990
1991               cprom_addr = (~cprom_addr & 0xf) << 4;
1992            }
1993            else
1994               cprom_addr = 0xf0;
1995
1996            cprom_addr |= (ic79_o17 << 3) |
1997                       (ic48_o18 << 2) |
1998                       (ic48_o17 << 1) |
1999                       ic48_o16;
2000
2001            rcsd0_3 = rcols[cprom_addr] & 0xf;
2002            *(bmpaddr + 0) = 0x40 | (!wave << 5) | (ic48_o12 << 4) | rcsd0_3;
2003         }
2004         else
2005            *(bmpaddr + 0) = 0;
2006         }
2007
2008         /* Centre */
2009         {
2010         UINT32 rcsd0_3;
2011         UINT32 cprom_addr;
2012         UINT32 P5, P7, P8;
2013
2014         P5 = BIT(tcmd, 3) ? ((!vp5 && !vp6) || vp7 || !linf) : ic80_o16;
2015         P7 = BIT(sld, 5);
2016         P8 = BIT(sld, 4);
2017
2018         ic50_o19 = (px2[1] && !rva8) || !bnkcs || !P5 || !ic80_o15;
2019
2020         if (ic50_o19)
2021         {
2022            if (ic80_o14)
2023               ic50_o12 =
2024               (px2[1] && px1[1] && px0[1] && rm1 && !rm0)
2025               || (!px2[1] && px1[1] && px0[1] && !P8 && rm0)
2026               || (px2[1] && px0[1] && !P7 && !rm1 && !rm0)
2027               || (px2[1] && !px1[1] && px0[1] && !P7 && !rm1)
2028               || (px2[1] && px1[1] && px0[1] && !P7 && !P8)
2029               || (px2[1] && px1[1] && px0[1] && !P8 && rm1)
2030               || (!px2[1] && !px3[1] && !rm0)
2031               || (!px1[1] && !px3[1] && rm1)
2032               || (!px2[1] && !px1[1] && !px3[1])
2033               || (rva8)
2034               || (!px0[1] && !px3[1])
2035               || (!ic80_o15)
2036               || (!P5);
2037            else
2038               ic50_o12 = 0;
2039
2040
2041            ic50_o16 = (P5 && px2[1] && rm1) || (P5 && rva8 && ic80_o15) || (P5 && !px0[1]) || !ic80_o15;
2042            ic50_o17 = (P5 && px0[1] && !rm0 && ic80_o15) || (P5 && !px1[1] && ic80_o15) || (P5 && rva8 && ic80_o15);
2043            ic50_o18 = (P5 && !px2[1] && ic80_o15) || (P5 && rva8 && ic80_o15);
2044
2045            if (vp6 || ic80_o16)
2046            {
2047               if (!(ic80_o15 && P5))
2048                  cprom_addr = (tcmd & 0x7) | (ic80_o16 << 3);
2049               else
2050                  cprom_addr = rcmd;
2051
2052               cprom_addr = ((~cprom_addr) & 0xf) << 4;
2053            }
2054            else
2055               cprom_addr = 0xf0;
2056
2057            cprom_addr |= (ic79_o16 << 3) |
2058                       (ic50_o18 << 2) |
2059                       (ic50_o17 << 1) |
2060                       ic50_o16;
2061
2062            rcsd0_3 = rcols[cprom_addr] & 0xf;
2063            *(bmpaddr + 256) = 0x40 | (!wave << 5) | (ic50_o12 << 4) | rcsd0_3;
2064         }
2065         else
2066            *(bmpaddr + 256) = 0;
2067         }
2068
2069         /* Right */
2070         {
2071         UINT32 rcsd0_3;
2072         UINT32 cprom_addr;
2073         UINT32 P5, P7, P8;
2074
2075         P5 = BIT(tcmd, 3) ? ((!vp5 && !vp6) || vp7 || !linf) : ic82_o16;
2076         P7 = BIT(sld, 5);
2077         P8 = BIT(sld, 4);
2078
2079         ic52_o19 = (px2[2] && !rva8) || !bnkrs || !P5 || !ic82_o15;
2080
2081         if (ic52_o19)
2082         {
2083            ic52_o12 =
2084            ic82_o14 &&
2085            (
2086               (px2[2] && px1[2] && px0[2] && rm1 && !rm0)
2087               || (!px2[2] && px1[2] && px0[2] && !P8 && rm0)
2088               || (px2[2] && px0[2] && !P7 && !rm1 && !rm0)
2089               || (px2[2] && !px1[2] && px0[2] && !P7 && !rm1)
2090               || (px2[2] && px1[2] && px0[2] && !P7 && !P8)
2091               || (px2[2] && px1[2] && px0[2] && !P8 && rm1)
2092               || (!px2[2] && !px3[2] && !rm0)
2093               || (!px1[2] && !px3[2] && rm1)
2094               || (!px2[2] && !px1[2] && !px3[2])
2095               || (rva8)
2096               || (!px0[2] && !px3[2])
2097               || (!ic82_o15)
2098               || (!P5)
2099            );
2100
2101            ic52_o16 = (px2[2] && P5 && rm1) || (P5 && rva8 && ic82_o15) || (!px0[2] && P5) || !ic82_o15;
2102            ic52_o17 = (px0[2] && P5 && !rm0 && ic82_o15) || (!px1[2] && P5 && ic82_o15) || (P5 && rva8 && ic82_o15);
2103            ic52_o18 = (P5 && ic82_o15 && !px2[2]) || (P5 && ic82_o15 && rva8);
2104
2105            if (vp6 || ic82_o16)
2106            {
2107               if (!(ic82_o15 && P5))
2108                  cprom_addr = (tcmd & 0x7) | (ic82_o16 << 3);
2109               else
2110                  cprom_addr = rcmd;
2111
2112               cprom_addr = (~cprom_addr & 0xf) << 4;
2113            }
2114            else
2115               cprom_addr = 0xf0;
2116
2117            cprom_addr |= (ic79_o15 << 3) |
2118                       (ic52_o18 << 2) |
2119                       (ic52_o17 << 1) |
2120                       ic52_o16;
2121
2122            rcsd0_3 = rcols[cprom_addr] & 0xf;
2123
2124            *(bmpaddr + 512) = 0x40 | (!wave << 5) | (ic52_o12 ? 0x10 : 0) | rcsd0_3;
2125         }
2126         else
2127            *(bmpaddr + 512) = 0;
2128         }
2129
2130         /* Now update counters and whatnot */
2131         ++bmpaddr;
2132
2133         UPDATE_HPOS(0);
2134         UPDATE_HPOS(1);
2135         UPDATE_HPOS(2);
2136         UPDATE_HPOS(3);
2137
2138         /* Update the wave LFSR */
2139         vregs.wave_lfsr = (vregs.wave_lfsr << 1) | (BIT(vregs.wave_lfsr, 6) ^ !BIT(vregs.wave_lfsr, 15));
2140
2141         /* Increment the bank counter */
2142         bank_cnt = (bank_cnt + 1) & 0x7ff;
2143
2144         /* X pos */
2145         ls161 = (ls161 + 1) & 0x7fff;
2146      }
2147
2148      /* WANGL active? Update the 8-bit counter */
2149      if (wangl)
2150      {
2151         if (BIT(vregs.flags, BB_RDFLAG_TNLMD0))
2152            --vregs.wa8;
2153         else
2154            ++vregs.wa8;
2155      }
2156
2157      /* No carry out - just increment */
2158      if (vregs.wa4 != 0xf)
2159         ++vregs.wa4;
2160      else
2161      {
2162         /* Carry out; increment again on /TMG2S rise */
2163         if (wangl)
2164         {
2165            if (BIT(vregs.flags, BB_RDFLAG_TNLMD0))
2166               --vregs.wa8;
2167            else
2168               ++vregs.wa8;
2169         }
2170         vregs.wa4 = 1;
2171      }
2172
2173      /* Update accumulator */
2174      vregs.h_val += vregs.h_inc;
2175
2176      /* Seems correct */
2177      sf = vregs.shift;
2178
2179      if ((vregs.shift & 0x80) == 0)
2180      {
2181         vregs.shift <<= 1;
2182
2183         if ((sf & 0x08) == 0)
2184            vregs.shift |= BIT(vregs.h_val, 15);
2185      }
2186
2187      if ((sf & 0x08) && !(vregs.shift & 0x08))
2188         vregs.h_inc = vregs.gas;
2189
2190      /* Finally, increment the banking accumulator */
2191      vregs.ba_val = (vregs.ba_val + vregs.ba_inc) & 0x00ffffff;
2192   }
2193}
2194
2195static void buggybjr_draw_road(running_machine *machine, UINT8 *bitmap, int wide)
2196{
2197   INT32 x;
2198   UINT32 y;
2199   UINT16 rva_offs;
2200   UINT32 tnlmd0;
2201   UINT32 tnlmd1;
2202   UINT32 linf;
2203   UINT32 tnlf;
2204   UINT32 wangl;
2205   UINT32 tcmd;
2206   UINT32 wave0;
2207   UINT32 wave1;
2208   UINT32 rva20_6;
2209
2210   /* ROM/PROM lookup tables */
2211   const UINT8 *rcols = (UINT8*)(memory_region(machine, "proms") + 0x1500);
2212   const UINT8 *rom   = memory_region(machine, "road");
2213   const UINT8 *prom0 = rom + 0x4000;
2214   const UINT8 *prom1 = rom + 0x4200;
2215   const UINT8 *prom2 = rom + 0x4400;
2216   const UINT8 *vprom = rom + 0x4600;
2217
2218   /* Extract constant values */
2219   tcmd    = ((vregs.scol & 0xc000) >> 12) | ((vregs.scol & 0x00c0) >> 6);
2220   tnlmd0   = BIT(vregs.flags, BB_RDFLAG_TNLMD0);
2221   tnlmd1   = BIT(vregs.flags, BB_RDFLAG_TNLMD1);
2222   linf     = BIT(vregs.flags, BB_RDFLAG_LINF);
2223   tnlf     = BIT(vregs.flags, BB_RDFLAG_TNLF);
2224   wangl    = BIT(vregs.flags, BB_RDFLAG_WANGL);
2225   wave0    = BIT(vregs.flags, BB_RDFLAG_WAVE0);
2226   wave1    = BIT(vregs.flags, BB_RDFLAG_WAVE1);
2227   rva_offs = BIT(vregs.flags, BB_RDFLAG_RVA7) ? 0x800 : 0xc00;
2228
2229   for (y = 0; y < 240; ++y)
2230   {
2231      UINT8   rva0_6;
2232      UINT8   ram_addr;
2233      UINT16   rcrdb0_15;
2234      UINT16   rcrs10;
2235      UINT16   ls161_156_a;
2236      UINT16   ls161;
2237      UINT8   sld;
2238      UINT32   rva8;
2239      UINT32   rm0, rm1;
2240      UINT32   rcmd;
2241      UINT32   bnkcs = 1;
2242
2243      UINT32   x_offs;
2244      UINT8   sf;
2245
2246      /* Vertical positions shift register */
2247      UINT32   ram_val;
2248      UINT32   hp;
2249      UINT32   vp1, vp2, vp3, vp4, vp5, vp6, vp7;
2250
15352251      /* PAL outputs */
15362252      UINT32   ic4_o12;
15372253      UINT32   ic4_o13;
r4425r4426
15542270      UINT8   *bmpaddr = bitmap + (y * 256);
15552271
15562272      UINT32   bank_cnt;
1557      UINT8   roadpix;
15582273      UINT32   _rorevcs = 0;
15592274
15602275      rva8 = (vregs.h_val & 0x8000) || !(vregs.shift & 0x80);
r4425r4426
15852300
15862301      /* Determine the x-offset */
15872302      x_offs = ls161 & 7;
1588      ls161 &= ~7;
15892303
15902304      /* Fill vertical position shift register with bits for this line */
15912305      /* TODO; cheated slightly to shift stuff up one pixel*/
r4425r4426
16192333      /* Load the bank counter with accumulator bits 14-5 */
16202334      bank_cnt = (vregs.ba_val >> 5) & 0x3ff;
16212335
1622      bnkcs = 1;
2336      /* Have we crossed a road gfx strip boundary? */
2337      if (ls161 & 7)
2338         buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0, &rc1, &rc2, &rc3, rom, prom0, prom1, prom2);
16232339
1624      for (x = -x_offs; x < 256; ++x)
2340      for (x = 0; x < 256; ++x)
16252341      {
1626         UINT16   ls283_159;
1627         UINT32   ls283_159_co;
1628         UINT16   rha;
1629         UINT32   rom_flip;
1630         UINT32   rom_en;
16312342         UINT32   pix;
16322343         UINT32   hp0_en, hp1_en, hp2_en, hp3_en;
1633
1634         /* The many PALs */
1635
16362344         UINT32   ic149_o16;
1637
16382345         UINT32   ic4_o18;
16392346         UINT32   ic3_o15;
16402347         UINT32   ic150_o12 = 0;
r4425r4426
16452352         UINT32   ic151_o15;
16462353         UINT32   ic151_o16;
16472354         UINT32   ic151_o17;
1648
16492355         UINT32   rcsd0_3 = 0;
1650
16512356         UINT32   sld5 = BIT(sld, 5);
16522357         UINT32   sld4 = BIT(sld, 4);
16532358         UINT32   mux;
1654
16552359         UINT32   cprom_addr;
1656
16572360         UINT8   px0, px1, px2, px3;
16582361
1659         /* Counter Q10-7 are added to 384 */
1660         ls283_159_co = (ls283_159 = (ls161 & 0x780) + X_ADJUST) & 0x800;
1661         rom_flip = ls283_159 & 0x200 ? 0 : 1;
1662         rom_en = !(ls283_159 & 0x400) && !(ls283_159_co ^ (ls161 & 0x800));
1663
16642362         /* Strip pixel number */
16652363         pix = (ls161 & 7) ^ 7;
16662364
1667         /* Horizotnal position counter enables - also used as PAL inputs */
2365         /* Horizontal position counter enables - also used as PAL inputs */
16682366         hp0_en = !(hp0_cy || hps02);
16692367         hp1_en = !(hp1_cy || hps12);
16702368         hp2_en = !(hp2_cy || hps22);
16712369         hp3_en = !(hp3_cy || hps32);
16722370
1673         /* Load in a new road gfx strip */
1674         if ( (ls161 & 7) == 0 )
1675         {
1676            UINT8 d0 = 0;
1677            UINT8 d1 = 0;
2371         /* Load in a new road gfx strip? */
2372         if (!(ls161 & 7))
2373            buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0, &rc1, &rc2, &rc3, rom, prom0, prom1, prom2);
16782374
1679            /* I think it's correct to latch it here */
1680            _rorevcs = !( (rom_en && rom_flip) || (!rom_en && (ls161 & 0x4000)) );
1681
1682            /* TODO: ROM data is 0xff if not enabled. */
1683            if (rom_en)
1684            {
1685               UINT8  rom_data;
1686               UINT16 prom_addr;
1687
1688               /* 6 bit road horizontal address */
1689               rha = (ls283_159 & 0x180) | (ls161 & 0x78);
1690
1691               if (rom_flip)
1692                  rha ^= 0x1f8;
1693
1694               /* Get road chunk first */
1695               rom_data = rom[(1 << 13) | (rha << 4) | rva0_6];
1696               prom_addr = (rom_flip ? 0x80 : 0) | (rom_data & 0x7f);
1697
1698               rc0 = prom0[prom_addr];
1699               rc1 = prom1[prom_addr];
1700               rc2 = prom2[prom_addr];
1701
1702               /* Now get the dirt chunk */
1703               rom_data = rom[(rha << 4) | rva0_6];
1704               prom_addr = 0x100 | rom_data;
1705
1706               d0 = prom0[prom_addr];
1707               d1 = prom1[prom_addr];
1708            }
1709            else
1710            {
1711               /*
1712                        TODO: When ROM is not enabled, data = 0xff
1713                        But does anybody care?
1714                    */
1715               rc0 = rc1 = rc2 = rc3 = 0;
1716            }
1717
1718            /* The data is mixed by two TZ0314 PALs */
1719            if (BIT(sld, 4))
1720            {
1721               if (BIT(sld, 5))
1722                  d1 = ~d1;
1723
1724               rc3 = d0 & d1;
1725
1726               if (rom_flip)
1727                  rc3 = BITSWAP8(rc3, 0, 1, 2, 3, 4, 5, 6, 7);
1728            }
1729            else
1730               rc3 = 0;
1731         }
1732
1733         /* NEW!!!! Road camber */
2375         /* Road camber */
17342376         if (vregs.bank_mode == 0)
17352377         {
1736            if ( BIT(vregs.ba_val, 23) )
2378            if (BIT(vregs.ba_val, 23))
17372379               bnkcs = 1;
17382380            else if (vregs.ba_val & 0x007f8000)
17392381               bnkcs = 0;
r4425r4426
17422384         }
17432385         else
17442386         {
1745            if ( BIT(vregs.ba_val, 23) )
2387            if (BIT(vregs.ba_val, 23))
17462388               bnkcs = 0;
17472389            else if (vregs.ba_val & 0x007f8000)
17482390               bnkcs = 1;
r4425r4426
17552397         px2 = BIT(rc2, pix);
17562398         px3 = BIT(rc3, pix);
17572399
1758         /*
1759                Uh oh...
1760            */
2400         /* Now go through and evaluate all the pixel logic */
17612401         if (vp2)
17622402            ic4_o18 = (hps00 && hps01 && hp3_en && !hps30)      ||
17632403                    (!hp0_en && hps01 && hp3_en && !hps30)   ||
r4425r4426
17902430                     px2                     ||
17912431                     !tnlf;
17922432         else
1793            ic151_o15 =   !tnlf;
2433            ic151_o15 = !tnlf;
17942434
17952435         ic151_o16 = (px1 && !px0 && tnlmd1 && !tnlmd0)   ||
17962436                  (px2 && tnlmd1 && tnlmd0)         ||
r4425r4426
18462486            {
18472487               UINT32 ic150_i5 = BIT(tcmd, 3) ? ic149_o15 : ic151_o16;
18482488
1849               if ( !(ic151_o15 && ic150_i5) )
2489               if (!(ic151_o15 && ic150_i5))
18502490                  cprom_addr = (tcmd & 0x7) | (ic151_o16 ? 0x08 : 0);
18512491               else
18522492                  cprom_addr = rcmd;
r4425r4426
18762516                        BIT(lfsr, 13)         &&
18772517                        (rva20_6 < ((lfsr >> 8) & 0xf));
18782518
1879               roadpix = 0x40 | (wave ? 0 : 0x20) | (ic150_o12 ? 0x10 : 0) | rcsd0_3;
2519               *bmpaddr++ = 0x40 | (wave ? 0 : 0x20) | (ic150_o12 ? 0x10 : 0) | rcsd0_3;
18802520            }
18812521         }
18822522         else
1883            roadpix = 0;
2523            *bmpaddr++ = 0;
18842524
2525         /* Update the various horizontal counters */
2526         UPDATE_HPOS(0);
2527         UPDATE_HPOS(1);
2528         UPDATE_HPOS(2);
2529         UPDATE_HPOS(3);
18852530
1886         /* Horizontal position counters */
1887         if (x >= 0)
1888         {
1889            *bmpaddr++ = roadpix;
2531         /* Update the LFSR */
2532         vregs.wave_lfsr = (vregs.wave_lfsr << 1) | (BIT(vregs.wave_lfsr, 6) ^ !BIT(vregs.wave_lfsr, 15));
18902533
1891            UPDATE_HPOS(0);
1892            UPDATE_HPOS(1);
1893            UPDATE_HPOS(2);
1894            UPDATE_HPOS(3);
2534         /* Increment the bank counter */
2535         bank_cnt = (bank_cnt + 1) & 0x7ff;
18952536
1896            /* Update the LFSR */
1897            vregs.wave_lfsr = (vregs.wave_lfsr << 1) | (BIT(vregs.wave_lfsr, 6) ^ !BIT(vregs.wave_lfsr, 15));
1898
1899            /* Increment the bank counter */
1900            bank_cnt = (bank_cnt + 1) & 0x7ff;
1901         }
1902
19032537         /* X pos */
19042538         ls161 = (ls161 + 1) & 0x7fff;
19052539      }
19062540
1907      /* WANGL active? Update the 8-bit counter */
1908      if ( wangl )
2541      /* WANGL active? Then update the 8-bit counter */
2542      if (wangl)
19092543      {
1910         if ( BIT(vregs.flags, BB_RDFLAG_TNLMD0) )
1911            vregs.wa8 -= 1;
2544         if (BIT(vregs.flags, BB_RDFLAG_TNLMD0))
2545            --vregs.wa8;
19122546         else
1913            vregs.wa8 += 1;
2547            ++vregs.wa8;
19142548      }
19152549
19162550      /* No carry out - just increment */
1917      if ( vregs.wa4 != 0xf )
1918         vregs.wa4 += 1;
2551      if (vregs.wa4 != 0xf)
2552         ++vregs.wa4;
19192553      else
19202554      {
19212555         /* Carry out; increment again on /TMG2S rise */
1922         if ( wangl )
2556         if (wangl)
19232557         {
1924            if ( BIT(vregs.flags, BB_RDFLAG_TNLMD0) )
1925               vregs.wa8 -= 1;
2558            if (BIT(vregs.flags, BB_RDFLAG_TNLMD0))
2559               --vregs.wa8;
19262560            else
1927               vregs.wa8 += 1;
2561               ++vregs.wa8;
19282562         }
19292563         vregs.wa4 = 1;
19302564      }
r4425r4426
19332567      vregs.h_val += vregs.h_inc;
19342568
19352569      /* Seems correct */
2570      sf = vregs.shift;
2571
2572      if ((vregs.shift & 0x80) == 0)
19362573      {
1937         UINT8 sf = vregs.shift;
2574         vregs.shift <<= 1;
19382575
1939         if ((vregs.shift & 0x80) == 0)
1940         {
1941            vregs.shift <<= 1;
2576         if ((sf & 0x08) == 0)
2577            vregs.shift |= BIT(vregs.h_val, 15);
2578      }
19422579
1943            if ((sf & 0x08) == 0)
1944               vregs.shift |= BIT(vregs.h_val, 15);
1945         }
2580      if ((sf & 0x08) && !(vregs.shift & 0x08))
2581         vregs.h_inc = vregs.gas;
19462582
1947         if ((sf & 0x08) && !(vregs.shift & 0x08))
1948            vregs.h_inc = vregs.gas;
1949      }
1950
19512583      /* Finally, increment the banking accumulator */
19522584      vregs.ba_val = (vregs.ba_val + vregs.ba_inc) & 0x00ffffff;
1953      }
2585   }
19542586}
19552587
19562588
r4425r4426
19872619   UINT32 x_stride;
19882620
19892621   /* The many lookup table ROMs */
1990   const UINT8 *const bug13  = (UINT8*)memory_region(machine, "user3");
1991   const UINT8 *const bug18s = (UINT8*)memory_region(machine, "user3") + 0x2000;
2622   const UINT8 *const bug13  = (UINT8*)memory_region(machine, "obj_luts");
2623   const UINT8 *const bug18s = bug13 + 0x2000;
19922624   const UINT8 *const bb8    = (UINT8*)memory_region(machine, "proms") + 0x1600;
19932625
1994   const UINT8 *const bug16s = (UINT8*)memory_region(machine, "user2");
1995   const UINT8 *const bug17s = (UINT8*)memory_region(machine, "user2") + 0x8000;
2626   const UINT8 *const bug16s = (UINT8*)memory_region(machine, "obj_map");
2627   const UINT8 *const bug17s = bug16s + 0x8000;
19962628
19972629   const UINT8 *const bb9o = (UINT8*)memory_region(machine, "proms") + 0x500;
1998   const UINT8 *const bb9e = (UINT8*)memory_region(machine, "proms") + 0xd00;
2630   const UINT8 *const bb9e = bb9o + 0x800;
19992631
2000   const UINT8 *const pixdata_rgn = (UINT8*)memory_region(machine, "gfx2");
2632   const UINT8 *const pixdata_rgn = (UINT8*)memory_region(machine, "obj_tiles");
20012633
20022634   if (wide)
20032635   {
2004      x_mask = 0x7ff; // ???????
2636      x_mask = 0x7ff;
20052637      x_stride = 768;
20062638   }
20072639   else
r4425r4426
20252657      UINT8   code;
20262658
20272659      /* Check for end of object list */
2028      if ( (buggyboy_objram[offs] & 0xff00) == 0xff00 )
2660      if ((buggyboy_objram[offs] & 0xff00) == 0xff00)
20292661         break;
20302662
20312663      /* X scale */
20322664      x_scale = buggyboy_objram[offs + 2] & 0xff;
20332665
20342666      /* TODO: Confirm against hardware? */
2035      if ( x_scale == 0 )
2667      if (x_scale == 0)
20362668         continue;
20372669
20382670      /* 16-bit y-scale accumulator */
r4425r4426
20512683      /* Add 1 to account for line buffering */
20522684      y = (buggyboy_objram[offs] >> 8) + 1;
20532685
2054      if (code == 0xa8)
2055         code = 0xa8;
2056
20572686      for (; y < 240; ++y)
20582687      {
20592688         UINT32   rom_addr2   = 0;
r4425r4426
20632692         /* Are we drawing on this line? */
20642693
20652694         // TODO: See big lampposts.
2066         if ( y_scale & 0x8000 )
2695         if (y_scale & 0x8000)
20672696            break;
20682697
20692698         {
r4425r4426
21272756                  {
21282757                     UINT32   xor_mask;
21292758
2130                     if   ( BIT(psa0_12, 11) || !BIT(psa0_12, 12) )
2759                     if (BIT(psa0_12, 11) || !BIT(psa0_12, 12))
21312760                        xor_mask = 0xf;
2132                     else if   ( !BIT(psa0_12, 9) )
2761                     else if (!BIT(psa0_12, 9))
21332762                        xor_mask = 0x7;
21342763                     else
21352764                        xor_mask = 0x3;
r4425r4426
21472776                  dataend |= (bug17s_data & 0x40);
21482777
21492778                  /* Retrieve data for an 8x8 tile */
2150                  bug16s_data = bug16s[rom_addr2];
2779                  bug16s_data = bug16s[rom_addr2 & 0x7fff];
21512780                  psbb0_15 = (bug17s_data << 8) | bug16s_data;
21522781                  psbb6_7 = (BIT(psbb0_15, 12) ? psbb0_15 : (pctmp0_7 << 6)) & 0xc0;
21532782
r4425r4426
21572786                  /* Choose from one of three banks */
21582787                  rombank = ((BIT(pctmp0_7, 4) << 1) | BIT(psbb0_15, 13)) & 3;
21592788
2160                  /* TODO: Remember to put all the data into one GFX region */
21612789                  romptr = (UINT8*)(pixdata_rgn + rombank * (0x8000 * 2));
21622790
21632791                  /* Get raw 8x8 pixel row data */
r4425r4426
21942822                  pix = (((data1 >> bit) & 1) << 1) | ((data2 >> bit) & 1);
21952823
21962824                  /* Write the pixel if not transparent */
2197                  if ( !(!(opcd0_11 & 0x80) && !pix) )
2825                  if (!(!(opcd0_11 & 0x80) && !pix))
21982826                  {
21992827                     UINT8 color;
22002828                     UINT32 bb9_addr;
r4425r4426
22132841               }
22142842
22152843               /* Check if we've stepped into a new 8x8 tile */
2216               if ( (((x_acc + x_step) >> (FRAC + 3)) & x_mask) != ((x_acc >> (FRAC + 3)) & x_mask) )
2844               if ((((x_acc + x_step) >> (FRAC + 3)) & x_mask) != ((x_acc >> (FRAC + 3)) & x_mask))
22172845               {
22182846                  if (lasttile)
22192847                     break;
r4425r4426
23292957
23302958WRITE16_HANDLER( buggyboy_slincs_w )
23312959{
2332   if ( offset == 1 )
2960   if (offset == 1)
23332961      vregs.slin_inc = data;
23342962   else
23352963      vregs.slin_inc = vregs.slin = 0;
r4425r4426
24203048   bb_chr_bmp = auto_malloc(sizeof(UINT8) * 3 * 256 * 240);
24213049   bb_obj_bmp = auto_malloc(sizeof(UINT8) * 3 * 256 * 240);
24223050   bb_rod_bmp = auto_malloc(sizeof(UINT8) * 3 * 256 * 240);
3051
3052   /* Set a timer to run the interrupts */
3053   interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
3054
3055   /* /CUDISP CRTC interrupt */
3056   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
24233057}
24243058
24253059VIDEO_START( buggybjr )
r4425r4426
24283062   bb_chr_bmp = auto_malloc(sizeof(UINT8) * 256 * 240);
24293063   bb_obj_bmp = auto_malloc(sizeof(UINT8) * 256 * 240);
24303064   bb_rod_bmp = auto_malloc(sizeof(UINT8) * 256 * 240);
3065
3066   /* Set a timer to run the interrupts */
3067   interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
3068
3069   /* /CUDISP CRTC interrupt */
3070   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, CURSOR_YPOS, CURSOR_XPOS), 0);
24313071}
24323072
24333073VIDEO_EOF( buggyboy )
r4425r4426
24523092      memset(bb_rod_bmp, 0, 768*240);
24533093
24543094      buggyboy_draw_char(screen->machine, bb_chr_bmp, 1);
2455//      buggyboy_draw_road(screen->machine, bb_rod_bmp, 1);
3095      buggyboy_draw_road(screen->machine, bb_rod_bmp);
24563096      buggyboy_draw_objs(screen->machine, bb_obj_bmp, 1);
24573097
24583098      bb_combine_layers(screen->machine, bitmap, 0);
src/mame/video/retofinv.c
r4425r4426
9090
9191static TILE_GET_INFO( fg_get_tile_info )
9292{
93   /* not sure about the transparency thing, but it makes sense */
9493   int color = retofinv_fg_videoram[0x400 + tile_index];
9594
9695   tileinfo->group = color;
r4425r4426
9998         0,
10099         retofinv_fg_videoram[tile_index] + 256 * fg_bank,
101100         color,
102         (tile_index < 0x40 || tile_index >= 0x3c0) ? TILE_FORCE_LAYER0 : 0);
101         0);
103102}
104103
105104
src/mame/video/equites.c
r4425r4426
121121
122122VIDEO_START( equites )
123123{
124   equites_fg_videoram = auto_malloc(0x800);
124   equites_fg_videoram = (UINT8 *)auto_malloc(0x800);
125125
126126   fg_tilemap = tilemap_create(machine, equites_fg_info, tilemap_scan_cols,  8, 8, 32, 32);
127127   tilemap_set_transparent_pen(fg_tilemap, 0);
r4425r4426
135135{
136136   assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_INDEXED16);
137137
138   equites_fg_videoram = auto_malloc(0x800);
138   equites_fg_videoram = (UINT8 *)auto_malloc(0x800);
139139
140140   fg_tilemap = tilemap_create(machine, splndrbt_fg_info, tilemap_scan_cols,  8, 8, 32, 32);
141141   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/m57.c
r4425r4426
174174
175175static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
176176{
177   int y;
177   int y,x;
178   INT16 scrolly;
178179
179   for (y = 0; y < 256; y++)
180      tilemap_set_scrollx(bg_tilemap, y, (y < 64) ? 0 : (y < 128) ? m57_scroll[64] : m57_scroll[y]);
180   // from 64 to 127: not wrapped
181   for (y = 64; y < 128; y++)
182      tilemap_set_scrollx(bg_tilemap, y, m57_scroll[0x40]);
183
181184   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
185
186   // from 128 to 255: wrapped
187   for (y = 128; y <= cliprect->max_y; y++)
188   {
189      scrolly = m57_scroll[y] + (m57_scroll[y + 0x100] << 8);
190
191      if (scrolly >= 0)
192      {
193         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
194         {
195            if ((x + scrolly) <= cliprect->max_x)
196               *BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(bitmap, y, x + scrolly);
197            else
198               *BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(bitmap, y, cliprect->max_x);
199         }
200      } else {
201         for (x = cliprect->max_x; x >= cliprect->min_x; x--)
202         {
203            if ((x + scrolly) >= cliprect->min_x)
204               *BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(bitmap, y, x + scrolly);
205            else
206               *BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(bitmap, y, cliprect->min_x);
207         }
208      }
209   }
182210}
183211
184212/*************************************
src/mame/layout/pirpok2.lay
r0r4426
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="CARD1" defstate="1">
4      <rect state="1">
5         <color red="1.0" green="0.0" blue="0.0" />
6      </rect>
7      <rect state="0">
8         <color red="0.3" green="0.0" blue="0.0" />
9      </rect>
10      <text string="CARD1">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.1" width="1" height="0.4" />
13      </text>
14      <text string="BET">
15         <color red="0.0" green="0.0" blue="0.0" />
16         <bounds x="0" y="0.6" width="1" height="0.4" />
17      </text>   
18   </element>
19
20   <element name="CARD2" defstate="1">
21      <rect state="1">
22         <color red="1.0" green="0.0" blue="0.0" />
23      </rect>
24      <rect state="0">
25         <color red="0.3" green="0.0" blue="0.0" />
26      </rect>
27      <text string="CARD2">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.1" width="1" height="0.4" />
30      </text>
31      <text string="BIG">
32         <color red="0.0" green="0.0" blue="0.0" />
33         <bounds x="0" y="0.6" width="1" height="0.4" />
34      </text>   
35   </element>   
36   
37   <element name="CARD3" defstate="1">
38      <rect state="1">
39         <color red="1.0" green="0.0" blue="0.0" />
40      </rect>
41      <rect state="0">
42         <color red="0.3" green="0.0" blue="0.0" />
43      </rect>
44      <text string="CARD3">
45         <color red="0.0" green="0.0" blue="0.0" />
46         <bounds x="0" y="0.1" width="1" height="0.4" />
47      </text>
48      <text string="DOUBLE">
49         <color red="0.0" green="0.0" blue="0.0" />
50         <bounds x="0" y="0.6" width="1" height="0.4" />
51      </text>   
52   </element>     
53   
54   <element name="CARD4" defstate="1">
55      <rect state="1">
56         <color red="1.0" green="0.0" blue="0.0" />
57      </rect>
58      <rect state="0">
59         <color red="0.3" green="0.0" blue="0.0" />
60      </rect>
61      <text string="CARD4">
62         <color red="0.0" green="0.0" blue="0.0" />
63         <bounds x="0" y="0.1" width="1" height="0.4" />
64      </text>
65      <text string="SMALL">
66         <color red="0.0" green="0.0" blue="0.0" />
67         <bounds x="0" y="0.6" width="1" height="0.4" />
68      </text>   
69   </element>
70
71   <element name="CARD5" defstate="1">
72      <rect state="1">
73         <color red="1.0" green="0.0" blue="0.0" />
74      </rect>
75      <rect state="0">
76         <color red="0.3" green="0.0" blue="0.0" />
77      </rect>
78      <text string="CARD5">
79         <color red="0.0" green="0.0" blue="0.0" />
80         <bounds x="0" y="0.1" width="1" height="0.4" />
81      </text>
82      <text string="     ">
83         <color red="0.0" green="0.0" blue="0.0" />
84         <bounds x="0" y="0.6" width="1" height="0.4" />
85      </text>   
86   </element>     
87
88   <element name="START" defstate="1">
89      <rect state="1">
90         <color red="0.0" green="1.0" blue="0.0" />
91      </rect>
92      <rect state="0">
93         <color red="0.0" green="0.3" blue="0.0" />
94      </rect>
95      <text string="START">
96         <color red="0.0" green="0.0" blue="0.0" />
97         <bounds x="0" y="0.1" width="1" height="0.4" />
98      </text>
99      <text string="TAKE">
100         <color red="0.0" green="0.0" blue="0.0" />
101         <bounds x="0" y="0.6" width="1" height="0.4" />
102      </text>   
103   </element>         
104   
105   <view name="Button Lamps">
106      <screen index="0">
107         <bounds left="0" top="0" right="4" bottom="3" />
108      </screen>
109      <bezel name="lamp0" element="CARD1">
110         <bounds x="0.0" y="3.15" width="0.40" height="0.24" />
111      </bezel>
112      <bezel name="lamp1" element="CARD2">
113         <bounds x="0.5" y="3.15" width="0.40" height="0.24" />
114      </bezel>
115      <bezel name="lamp2" element="CARD3">
116         <bounds x="1.0" y="3.15" width="0.40" height="0.24" />
117      </bezel>   
118      <bezel name="lamp3" element="CARD4">
119         <bounds x="1.5" y="3.15" width="0.40" height="0.24" />
120      </bezel>   
121      <bezel name="lamp4" element="CARD5">
122         <bounds x="2.0" y="3.15" width="0.40" height="0.24" />
123      </bezel>     
124      <bezel name="lamp5" element="START">
125         <bounds x="2.5" y="3.15" width="0.40" height="0.24" />
126      </bezel>     
127   </view>
128</mamelayout>
src/mame/drivers/deco_mlc.c
r4425r4426
278278   AM_RANGE(0x0300000, 0x0307fff) AM_READ(SMH_RAM) AM_MIRROR(0xff000000)
279279   AM_RANGE(0x0400000, 0x0400003) AM_READ_PORT("INPUTS") AM_MIRROR(0xff000000)
280280   AM_RANGE(0x0440000, 0x044001f) AM_READ(test3_r)   AM_MIRROR(0xff000000)
281   AM_RANGE(0x0600004, 0x0600007) AM_DEVREAD8("ymz", ymz280b_r, 0xff000000) AM_MIRROR(0xff000000)
281   AM_RANGE(0x0600000, 0x0600007) AM_DEVREAD8("ymz", ymz280b_r, 0xff000000) AM_MIRROR(0xff000000)
282282   AM_RANGE(0x070f000, 0x070ffff) AM_READ(stadhr96_prot_146_r) AM_MIRROR(0xff000000)
283283ADDRESS_MAP_END
284284
r4425r4426
392392   raster_irq_timer = timer_alloc(machine, interrupt_gen, NULL);
393393}
394394
395static NVRAM_HANDLER( mlc )
396{
397   if (read_or_write)
398      eeprom_save(file);
399   else
400   {
401      eeprom_init(machine, &eeprom_interface_93C46); // actually 93C45
402
403      if (file) eeprom_load(file);
404      else
405      {
406         UINT8* defaultram = memory_region(machine, "defaults");
407
408         if (defaultram)
409            eeprom_set_data(defaultram, memory_region_length(machine, "defaults"));
410      }
411   }
412}
413
395414static MACHINE_DRIVER_START( avengrgs )
396415
397416   /* basic machine hardware */
r4425r4426
399418   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
400419
401420   MDRV_MACHINE_RESET(mlc)
402   MDRV_NVRAM_HANDLER(93C46) /* Actually 93c45 */
421   MDRV_NVRAM_HANDLER(mlc) /* Actually 93c45 */
403422
404423   /* video hardware */
405424   MDRV_SCREEN_ADD("screen", RASTER)
r4425r4426
430449   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
431450
432451   MDRV_MACHINE_RESET(mlc)
433   MDRV_NVRAM_HANDLER(93C46) /* Actually 93c45 */
452   MDRV_NVRAM_HANDLER(mlc) /* Actually 93c45 */
434453
435454   /* video hardware */
436455   MDRV_SCREEN_ADD("screen", RASTER)
r4425r4426
653672   ROM_REGION( 0x800000, "ymz", ROMREGION_ERASE00 )
654673   ROM_LOAD( "mch-06.6a",  0x200000, 0x200000, CRC(b2efe4ae) SHA1(5a9dab74c2ba73a65e8f1419b897467804734fa2) )
655674   ROM_LOAD( "mch-07.11j", 0x400000, 0x200000, CRC(bc1a50a1) SHA1(3de191fbc92d2ae84e54263f1c70afec6ff7cc3c) )
675
676   ROM_REGION( 0x80, "defaults", ROMREGION_ERASE00 )
677   ROM_LOAD_OPTIONAL( "skullfng.eeprom",  0x00, 0x80, CRC(240d882e) SHA1(3c1a15ccac91d95b02a8c54b051aa64ff28ce2ab) )
656678ROM_END
657679
658680ROM_START( skullfnj )
r4425r4426
674696   ROM_REGION( 0x800000, "ymz", ROMREGION_ERASE00 )
675697   ROM_LOAD( "mch-06.6a",  0x200000, 0x200000, CRC(b2efe4ae) SHA1(5a9dab74c2ba73a65e8f1419b897467804734fa2) )
676698   ROM_LOAD( "mch-07.11j", 0x400000, 0x200000, CRC(bc1a50a1) SHA1(3de191fbc92d2ae84e54263f1c70afec6ff7cc3c) )
699
700   ROM_REGION( 0x80, "defaults", ROMREGION_ERASE00 )
701   ROM_LOAD_OPTIONAL( "skullfng.eeprom",  0x00, 0x80, CRC(240d882e) SHA1(3c1a15ccac91d95b02a8c54b051aa64ff28ce2ab) )
677702ROM_END
678703
679704/***************************************************************************/
src/mame/drivers/sfbonus.c
r4425r4426
1010- The code to handle the 'multple' reel layers is dubious.  rowscroll values are always used
1111  based on only one of the tilemaps displayed in that screen region.
1212
13- There are still priority bugs in Tiger Hook, I thuoght I'd fixed these by doing the single
14  pass rendering of the reels, but they seem to have been reintroduced somehow, needs further
15  investigation
16
1317- Inputs not done, Lamps not done
1418
1519- Printer busy errors, Hopper timeout errors
r4425r4426
2226#include "cpu/z80/z80.h"
2327#include "sound/okim6295.h"
2428
29#include "pirpok2.lh"
30
31
2532static bitmap_t *temp_reel_bitmap;
2633static tilemap *sfbonus_tilemap;
2734static tilemap *sfbonus_reel_tilemap;
r4425r4426
3744static UINT8 *sfbonus_vregs;
3845static UINT8 *nvram;
3946static size_t nvram_size;
47static UINT8* sfbonus_1800_regs;
48static UINT8* sfbonus_3800_regs;
49static UINT8* sfbonus_3000_regs;
50static UINT8* sfbonus_2801_regs;
51static UINT8* sfbonus_2c01_regs;
4052
53
54/* 8-liners input define */
55static INPUT_PORTS_START( amcoebase )
56   PORT_START("KEY1")
57   PORT_DIPNAME( 0x01, 0x01, "Key1-0" )
58   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
59   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
60   PORT_DIPNAME( 0x02, 0x02, "Key1-1" )
61   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
62   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
63   PORT_DIPNAME( 0x04, 0x04, "Key1-2" )
64   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
65   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
66   PORT_DIPNAME( 0x08, 0x08, "Key1-3" )
67   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
68   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
69   PORT_DIPNAME( 0x10, 0x10, "Key1-4" )
70   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
71   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
72   PORT_DIPNAME( 0x20, 0x20, "Key1-5" )
73   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
74   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
75   PORT_DIPNAME( 0x40, 0x40, "Key1-6" )
76   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
77   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
78   PORT_DIPNAME( 0x80, 0x80, "Key1-7" )
79   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
80   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
81
82   PORT_START("KEY2")
83   PORT_DIPNAME( 0x01, 0x01, "Key2-0" )
84   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
85   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
86   PORT_DIPNAME( 0x02, 0x02, "Key2-1" )
87   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
88   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
89   PORT_DIPNAME( 0x04, 0x04, "Key2-2" )
90   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
91   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
92   PORT_DIPNAME( 0x08, 0x08, "Key2-3" )
93   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
94   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
95   PORT_DIPNAME( 0x10, 0x10, "Key2-4" )
96   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
97   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
98   PORT_DIPNAME( 0x20, 0x20, "Key2-5" )
99   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
100   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
101   PORT_DIPNAME( 0x40, 0x40, "Key2-6" )
102   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
103   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
104   PORT_DIPNAME( 0x80, 0x80, "Key2-7" )
105   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
106   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
107
108   PORT_START("KEY3")
109   PORT_DIPNAME( 0x01, 0x01, "Key3-0" )
110   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
111   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
112   PORT_DIPNAME( 0x02, 0x02, "Key3-1" )
113   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
114   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
115   PORT_DIPNAME( 0x04, 0x04, "Key3-2" )
116   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
117   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
118   PORT_DIPNAME( 0x08, 0x08, "Key3-3" )
119   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
120   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
121   PORT_DIPNAME( 0x10, 0x10, "Key3-4" )
122   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
123   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
124   PORT_DIPNAME( 0x20, 0x20, "Key3-5" )
125   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
126   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
127   PORT_DIPNAME( 0x40, 0x40, "Key3-6" )
128   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
129   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
130   PORT_DIPNAME( 0x80, 0x80, "Key3-7" )
131   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
133
134   /* the dipswitches are probably for debugging the games only, all settings are in NVRAM */
135   PORT_START("SWITCH1")
136   PORT_DIPNAME( 0x01, 0x01, "Switch1-0" )
137   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
138   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
139   PORT_DIPNAME( 0x02, 0x02, "Switch1-1" )
140   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
141   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
142   PORT_DIPNAME( 0x04, 0x04, "Switch1-2" )
143   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145   PORT_DIPNAME( 0x08, 0x08, "Switch1-3" )
146   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
147   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
148   PORT_DIPNAME( 0x10, 0x10, "Switch1-4" )
149   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
150   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
151   PORT_DIPNAME( 0x20, 0x20, "Switch1-5" )
152   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
153   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
154   PORT_DIPNAME( 0x40, 0x40, "Switch1-6" )
155   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
157   PORT_DIPNAME( 0x80, 0x80, "Switch1-7" )
158   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
159   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
160
161   PORT_START("SWITCH2")
162   PORT_DIPNAME( 0x01, 0x01, "Switch2-0" )
163   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
165   PORT_DIPNAME( 0x02, 0x02, "Switch2-1" )
166   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
167   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
168   PORT_DIPNAME( 0x04, 0x04, "Switch2-2" )
169   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
170   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
171   PORT_DIPNAME( 0x08, 0x08, "Switch2-3" )
172   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
173   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
174   PORT_DIPNAME( 0x10, 0x10, "Switch2-4" )
175   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
176   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
177   PORT_DIPNAME( 0x20, 0x20, "Switch2-5" )
178   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
179   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
180   PORT_DIPNAME( 0x40, 0x40, "Switch2-6" )
181   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
182   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
183   PORT_DIPNAME( 0x80, 0x80, "Switch2-7" )
184   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
185   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
186
187   PORT_START("SWITCH3")
188   PORT_DIPNAME( 0x01, 0x01, "Switch3-0" )
189   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
190   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
191   PORT_DIPNAME( 0x02, 0x02, "Switch3-1" )
192   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
194   PORT_DIPNAME( 0x04, 0x04, "Switch3-2" )
195   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
196   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
197   PORT_DIPNAME( 0x08, 0x08, "Switch3-3" )
198   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
199   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
200   PORT_DIPNAME( 0x10, 0x10, "Switch3-4" )
201   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
202   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
203   PORT_DIPNAME( 0x20, 0x20, "Switch3-5" )
204   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
205   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
206   PORT_DIPNAME( 0x40, 0x40, "Switch3-6" )
207   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
208   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
209   PORT_DIPNAME( 0x80, 0x80, "Switch3-7" )
210   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
211   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
212
213   PORT_START("SWITCH4")
214   PORT_DIPNAME( 0x01, 0x01, "Switch4-0" )
215   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
216   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
217   PORT_DIPNAME( 0x02, 0x02, "Switch4-1" )
218   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
219   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
220   PORT_DIPNAME( 0x04, 0x04, "Switch4-2" )
221   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
223   PORT_DIPNAME( 0x08, 0x08, "Switch4-3" )
224   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
225   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
226   PORT_DIPNAME( 0x10, 0x10, "Switch4-4" )
227   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
228   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
229   PORT_DIPNAME( 0x20, 0x20, "Switch4-5" )
230   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
231   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
232   PORT_DIPNAME( 0x40, 0x40, "Switch4-6" )
233   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
234   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
235   PORT_DIPNAME( 0x80, 0x80, "Switch4-7" )
236   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
237   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
238
239   PORT_START("SWITCH5")
240   PORT_DIPNAME( 0x01, 0x01, "Switch5-0" )
241   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
242   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
243   PORT_DIPNAME( 0x02, 0x02, "Switch5-1" )
244   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
245   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
246   PORT_DIPNAME( 0x04, 0x04, "Switch5-2" )
247   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
248   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
249   PORT_DIPNAME( 0x08, 0x08, "Switch5-3" )
250   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
251   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
252   PORT_DIPNAME( 0x10, 0x10, "Switch5-4" )
253   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
254   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
255   PORT_DIPNAME( 0x20, 0x20, "Switch5-5" )
256   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
257   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
258   PORT_DIPNAME( 0x40, 0x40, "Switch5-6" )
259   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
260   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
261   PORT_DIPNAME( 0x80, 0x80, "Switch5-7" )
262   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
263   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264INPUT_PORTS_END
265
266static INPUT_PORTS_START( amcoecommon )
267   PORT_INCLUDE(amcoebase)
268   PORT_MODIFY("KEY1")
269   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9)  PORT_NAME("Payout?") PORT_CODE(KEYCODE_Y) // causes hopper error
270   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON10) PORT_NAME("Clear SW.") PORT_CODE(KEYCODE_U)
271   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON11) PORT_NAME("Account") PORT_CODE(KEYCODE_I)
272   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON12) PORT_NAME("Confirm / Port Test") PORT_CODE(KEYCODE_O)
273   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2) // causes coin jam if held
274   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3)    // 'key in'
275
276   PORT_MODIFY("KEY3")
277   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1)
278INPUT_PORTS_END
279
280static INPUT_PORTS_START( amcoetype1 )
281   PORT_INCLUDE(amcoecommon)
282
283   PORT_MODIFY("KEY2")
284   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1)  PORT_IMPULSE(2) // causes service jam if held
285   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1)     PORT_IMPULSE(2) // causes coin jam if held
286   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("All Stop / Left") PORT_CODE(KEYCODE_Z)
287   /*        0x08 ? */
288   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 1 / Select Letter / Double / Hold Help") PORT_CODE(KEYCODE_X)
289   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Stop 3 / Erase / Take") PORT_CODE(KEYCODE_V)
290   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Play / Bet") PORT_CODE(KEYCODE_B)
291   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 2 / Right") PORT_CODE(KEYCODE_C)
292INPUT_PORTS_END
293
294static INPUT_PORTS_START( amcoetype2 )
295   PORT_INCLUDE(amcoecommon)
296
297   PORT_MODIFY("KEY2") // reverse order
298   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Small / Right") PORT_CODE(KEYCODE_C)
299   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Play / Bet") PORT_CODE(KEYCODE_B)
300   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_V)
301   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Double / Select") PORT_CODE(KEYCODE_X)
302   /*        0x10 ? */
303   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Big / Left") PORT_CODE(KEYCODE_Z)
304   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1)     PORT_IMPULSE(2) // causes coin jam if held
305   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1)  PORT_IMPULSE(2) // causes service jam if held
306INPUT_PORTS_END
307
308
309
41310static TILE_GET_INFO( get_sfbonus_tile_info )
42311{
43312   int code = sfbonus_tilemap_ram[(tile_index*2)+0] | (sfbonus_tilemap_ram[(tile_index*2)+1]<<8);
r4425r4426
386655         }
387656      }
388657   }
658   /*
659    popmessage("%02x %02x %02x %02x %02x %02x %02x %02x -- %02x -- %02x %02x -- %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",
660    sfbonus_3800_regs[0],
661    sfbonus_3800_regs[1],
662    sfbonus_3800_regs[2],
663    sfbonus_3800_regs[3],
664    sfbonus_3800_regs[4],
665    sfbonus_3800_regs[5],
666    sfbonus_3800_regs[6],
667    sfbonus_3800_regs[7],
668    sfbonus_3000_regs[0],
669    sfbonus_2801_regs[0],
670    sfbonus_2c01_regs[0],
671    sfbonus_vregs[8],
672    sfbonus_vregs[0],
673    sfbonus_vregs[10],
674    sfbonus_vregs[11],
675    sfbonus_vregs[12],
676    sfbonus_vregs[13],
677    sfbonus_vregs[14],
678    sfbonus_vregs[15],
679    sfbonus_vregs[16],
680    sfbonus_vregs[17],
681    sfbonus_vregs[18],
682    sfbonus_vregs[19],
683    sfbonus_vregs[20],
684    sfbonus_vregs[21],
685    sfbonus_vregs[22],
686    sfbonus_vregs[23],
687    sfbonus_vregs[24],
688    sfbonus_vregs[25],
689    sfbonus_vregs[26],
690    sfbonus_vregs[27],
691    sfbonus_vregs[28],
692    sfbonus_vregs[29],
693    sfbonus_vregs[30],
694    sfbonus_vregs[31]
695    );
696    */
389697
390   /* High Priority Reels */
391//  sfbonus_draw_reel_layer(screen->machine,bitmap,cliprect, screen, 1);
698   /*
699    popmessage("-- %02x %02x %02x %02x %02x %02x %02x %02x",
700    sfbonus_1800_regs[0],
701    sfbonus_1800_regs[1],
702    sfbonus_1800_regs[2],
703    sfbonus_1800_regs[3],
704    sfbonus_1800_regs[4],
705    sfbonus_1800_regs[5],
706    sfbonus_1800_regs[6],
707    sfbonus_1800_regs[7]);
708    */
392709
710   if (screen->machine->gamedrv->ipt==ipt_amcoetype2)
711   {
712      // based on pirpok2
713      output_set_lamp_value(0, (sfbonus_1800_regs[6]&0x1)>>0);
714      output_set_lamp_value(1, (sfbonus_1800_regs[6]&0x4)>>2);
715      output_set_lamp_value(2, (sfbonus_1800_regs[5]&0x4)>>2);
716      output_set_lamp_value(3, (sfbonus_1800_regs[5]&0x1)>>0);
717      output_set_lamp_value(4, (sfbonus_1800_regs[4]&0x4)>>2);
718      output_set_lamp_value(5, (sfbonus_1800_regs[4]&0x1)>>0);
719   }
720   else if (screen->machine->gamedrv->ipt==ipt_amcoetype1)
721   {
722      output_set_lamp_value(0, (sfbonus_1800_regs[0]&0x2)>>1);
723      output_set_lamp_value(1, (sfbonus_1800_regs[4]&0x2)>>1);
724      output_set_lamp_value(2, (sfbonus_1800_regs[3]&0x2)>>1);
725      output_set_lamp_value(3, (sfbonus_1800_regs[6]&0x4)>>2);
726      output_set_lamp_value(4, (sfbonus_1800_regs[4]&0x4)>>2);
727      output_set_lamp_value(5, (sfbonus_1800_regs[3]&0x4)>>2);
728   }
729
730
731
732
393733   return 0;
394734}
395735
r4425r4426
474814}
475815
476816
817// lamps and coin counters
818static WRITE8_HANDLER( sfbonus_1800_w )
819{
820   sfbonus_1800_regs[offset] = data;
821}
822
823static WRITE8_HANDLER( sfbonus_3800_w )
824{
825   sfbonus_3800_regs[offset] = data;
826}
827
828static WRITE8_HANDLER( sfbonus_3000_w )
829{
830   sfbonus_3000_regs[offset] = data;
831}
832
833static WRITE8_HANDLER( sfbonus_2801_w )
834{
835   sfbonus_2801_regs[offset] = data;
836}
837
838static WRITE8_HANDLER( sfbonus_2c01_w )
839{
840   sfbonus_2c01_regs[offset] = data;
841}
842
843
477844static ADDRESS_MAP_START( sfbonus_io, ADDRESS_SPACE_IO, 8 )
478845   AM_RANGE(0x0400, 0x0400) AM_READ_PORT("KEY1")
479846   AM_RANGE(0x0408, 0x0408) AM_READ_PORT("KEY2")
r4425r4426
489856
490857   AM_RANGE(0x0c00, 0x0c03) AM_WRITE( paletteram_io_w )
491858
859   AM_RANGE(0x1800, 0x1807) AM_WRITE(sfbonus_1800_w) AM_BASE(&sfbonus_1800_regs) // lamps and coin counters
860
492861   AM_RANGE(0x2400, 0x241f) AM_RAM AM_BASE(&sfbonus_vregs)
493862
494863   AM_RANGE(0x2800, 0x2800) AM_READ(sfbonus_2800_r)
495   AM_RANGE(0x2801, 0x2801) AM_READ(sfbonus_2801_r) AM_WRITE(SMH_NOP)
864   AM_RANGE(0x2801, 0x2801) AM_READ(sfbonus_2801_r) AM_WRITE(sfbonus_2801_w) AM_BASE(&sfbonus_2801_regs)
496865
497866   AM_RANGE(0x2c00, 0x2c00) AM_READ(sfbonus_2c00_r)
498   AM_RANGE(0x2c01, 0x2c01) AM_READ(sfbonus_2c01_r) AM_WRITE(SMH_NOP)
867   AM_RANGE(0x2c01, 0x2c01) AM_READ(sfbonus_2c01_r) AM_WRITE(sfbonus_2c01_w) AM_BASE(&sfbonus_2c01_regs)
499868
500   AM_RANGE(0x3000, 0x3000) AM_WRITE(SMH_NOP)
869   AM_RANGE(0x3000, 0x3000) AM_WRITE(sfbonus_3000_w) AM_BASE(&sfbonus_3000_regs)
501870   AM_RANGE(0x3400, 0x3400) AM_WRITE(sfbonus_bank_w)
502   AM_RANGE(0x3800, 0x3800) AM_READ(sfbonus_3800_r) AM_WRITE(SMH_NOP)
871   AM_RANGE(0x3800, 0x3800) AM_READ(sfbonus_3800_r)
503872
504   AM_RANGE(0x1800, 0x1800) AM_WRITE(SMH_NOP)
505   AM_RANGE(0x1801, 0x1801) AM_WRITE(SMH_NOP)
506   AM_RANGE(0x1802, 0x1802) AM_WRITE(SMH_NOP)
507   AM_RANGE(0x1803, 0x1803) AM_WRITE(SMH_NOP)
508   AM_RANGE(0x1804, 0x1804) AM_WRITE(SMH_NOP)
509   AM_RANGE(0x1805, 0x1805) AM_WRITE(SMH_NOP)
510   AM_RANGE(0x1806, 0x1806) AM_WRITE(SMH_NOP)
511
512   AM_RANGE(0x3801, 0x3801) AM_WRITE(SMH_NOP)
513   AM_RANGE(0x3802, 0x3802) AM_WRITE(SMH_NOP)
514   AM_RANGE(0x3803, 0x3803) AM_WRITE(SMH_NOP)
515   AM_RANGE(0x3806, 0x3806) AM_WRITE(SMH_NOP)
516   AM_RANGE(0x3807, 0x3807) AM_WRITE(SMH_NOP)
873   AM_RANGE(0x3800, 0x3807) AM_WRITE(sfbonus_3800_w) AM_BASE(&sfbonus_3800_regs)
517874ADDRESS_MAP_END
518875
519/* 8-liners input define */
520static INPUT_PORTS_START( amcoebase )
521   PORT_START("KEY1")
522   PORT_DIPNAME( 0x01, 0x01, "Key1-0" )
523   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
524   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
525   PORT_DIPNAME( 0x02, 0x02, "Key1-1" )
526   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
527   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
528   PORT_DIPNAME( 0x04, 0x04, "Key1-2" )
529   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
530   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
531   PORT_DIPNAME( 0x08, 0x08, "Key1-3" )
532   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
533   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
534   PORT_DIPNAME( 0x10, 0x10, "Key1-4" )
535   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
536   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
537   PORT_DIPNAME( 0x20, 0x20, "Key1-5" )
538   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
539   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
540   PORT_DIPNAME( 0x40, 0x40, "Key1-6" )
541   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
542   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
543   PORT_DIPNAME( 0x80, 0x80, "Key1-7" )
544   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
545   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
546876
547   PORT_START("KEY2")
548   PORT_DIPNAME( 0x01, 0x01, "Key2-0" )
549   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
550   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
551   PORT_DIPNAME( 0x02, 0x02, "Key2-1" )
552   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
553   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
554   PORT_DIPNAME( 0x04, 0x04, "Key2-2" )
555   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
556   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
557   PORT_DIPNAME( 0x08, 0x08, "Key2-3" )
558   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
559   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
560   PORT_DIPNAME( 0x10, 0x10, "Key2-4" )
561   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
562   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
563   PORT_DIPNAME( 0x20, 0x20, "Key2-5" )
564   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
565   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
566   PORT_DIPNAME( 0x40, 0x40, "Key2-6" )
567   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
568   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
569   PORT_DIPNAME( 0x80, 0x80, "Key2-7" )
570   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
571   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
572
573   PORT_START("KEY3")
574   PORT_DIPNAME( 0x01, 0x01, "Key3-0" )
575   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
576   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
577   PORT_DIPNAME( 0x02, 0x02, "Key3-1" )
578   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
579   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
580   PORT_DIPNAME( 0x04, 0x04, "Key3-2" )
581   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
582   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
583   PORT_DIPNAME( 0x08, 0x08, "Key3-3" )
584   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
585   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
586   PORT_DIPNAME( 0x10, 0x10, "Key3-4" )
587   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
588   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
589   PORT_DIPNAME( 0x20, 0x20, "Key3-5" )
590   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
591   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
592   PORT_DIPNAME( 0x40, 0x40, "Key3-6" )
593   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
594   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
595   PORT_DIPNAME( 0x80, 0x80, "Key3-7" )
596   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
597   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
598
599   /* the dipswitches are probably for debugging the games only, all settings are in NVRAM */
600   PORT_START("SWITCH1")
601   PORT_DIPNAME( 0x01, 0x01, "Switch1-0" )
602   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
603   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
604   PORT_DIPNAME( 0x02, 0x02, "Switch1-1" )
605   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
606   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
607   PORT_DIPNAME( 0x04, 0x04, "Switch1-2" )
608   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
609   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
610   PORT_DIPNAME( 0x08, 0x08, "Switch1-3" )
611   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
612   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
613   PORT_DIPNAME( 0x10, 0x10, "Switch1-4" )
614   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
615   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
616   PORT_DIPNAME( 0x20, 0x20, "Switch1-5" )
617   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
618   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
619   PORT_DIPNAME( 0x40, 0x40, "Switch1-6" )
620   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
621   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
622   PORT_DIPNAME( 0x80, 0x80, "Switch1-7" )
623   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
624   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625
626   PORT_START("SWITCH2")
627   PORT_DIPNAME( 0x01, 0x01, "Switch2-0" )
628   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
629   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
630   PORT_DIPNAME( 0x02, 0x02, "Switch2-1" )
631   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
632   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
633   PORT_DIPNAME( 0x04, 0x04, "Switch2-2" )
634   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
635   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
636   PORT_DIPNAME( 0x08, 0x08, "Switch2-3" )
637   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
638   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
639   PORT_DIPNAME( 0x10, 0x10, "Switch2-4" )
640   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
641   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
642   PORT_DIPNAME( 0x20, 0x20, "Switch2-5" )
643   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
644   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
645   PORT_DIPNAME( 0x40, 0x40, "Switch2-6" )
646   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
647   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
648   PORT_DIPNAME( 0x80, 0x80, "Switch2-7" )
649   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
650   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
651
652   PORT_START("SWITCH3")
653   PORT_DIPNAME( 0x01, 0x01, "Switch3-0" )
654   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
655   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
656   PORT_DIPNAME( 0x02, 0x02, "Switch3-1" )
657   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
658   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
659   PORT_DIPNAME( 0x04, 0x04, "Switch3-2" )
660   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
661   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
662   PORT_DIPNAME( 0x08, 0x08, "Switch3-3" )
663   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
664   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
665   PORT_DIPNAME( 0x10, 0x10, "Switch3-4" )
666   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
667   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
668   PORT_DIPNAME( 0x20, 0x20, "Switch3-5" )
669   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
670   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
671   PORT_DIPNAME( 0x40, 0x40, "Switch3-6" )
672   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
673   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
674   PORT_DIPNAME( 0x80, 0x80, "Switch3-7" )
675   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
676   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
677
678   PORT_START("SWITCH4")
679   PORT_DIPNAME( 0x01, 0x01, "Switch4-0" )
680   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
681   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
682   PORT_DIPNAME( 0x02, 0x02, "Switch4-1" )
683   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
684   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
685   PORT_DIPNAME( 0x04, 0x04, "Switch4-2" )
686   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
687   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
688   PORT_DIPNAME( 0x08, 0x08, "Switch4-3" )
689   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
690   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
691   PORT_DIPNAME( 0x10, 0x10, "Switch4-4" )
692   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
693   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
694   PORT_DIPNAME( 0x20, 0x20, "Switch4-5" )
695   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
696   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
697   PORT_DIPNAME( 0x40, 0x40, "Switch4-6" )
698   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
699   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
700   PORT_DIPNAME( 0x80, 0x80, "Switch4-7" )
701   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
702   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
703
704   PORT_START("SWITCH5")
705   PORT_DIPNAME( 0x01, 0x01, "Switch5-0" )
706   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
707   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
708   PORT_DIPNAME( 0x02, 0x02, "Switch5-1" )
709   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
710   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
711   PORT_DIPNAME( 0x04, 0x04, "Switch5-2" )
712   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
713   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
714   PORT_DIPNAME( 0x08, 0x08, "Switch5-3" )
715   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
716   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
717   PORT_DIPNAME( 0x10, 0x10, "Switch5-4" )
718   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
719   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
720   PORT_DIPNAME( 0x20, 0x20, "Switch5-5" )
721   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
722   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
723   PORT_DIPNAME( 0x40, 0x40, "Switch5-6" )
724   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
725   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
726   PORT_DIPNAME( 0x80, 0x80, "Switch5-7" )
727   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
728   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
729INPUT_PORTS_END
730
731static INPUT_PORTS_START( amcoecommon )
732   PORT_INCLUDE(amcoebase)
733   PORT_MODIFY("KEY1")
734   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON9)  PORT_NAME("Payout?") PORT_CODE(KEYCODE_Y) // causes hopper error
735   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON10) PORT_NAME("Clear SW.") PORT_CODE(KEYCODE_U)
736   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON11) PORT_NAME("Account") PORT_CODE(KEYCODE_I)
737   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON12) PORT_NAME("Confirm / Port Test") PORT_CODE(KEYCODE_O)
738   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2) // causes coin jam if held
739   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3)    // 'key in'
740
741   PORT_MODIFY("KEY3")
742   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1)
743INPUT_PORTS_END
744
745static INPUT_PORTS_START( amcoetype1 )
746   PORT_INCLUDE(amcoecommon)
747
748   PORT_MODIFY("KEY2")
749   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1)  PORT_IMPULSE(2) // causes service jam if held
750   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1)     PORT_IMPULSE(2) // causes coin jam if held
751   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("All Stop / Left") PORT_CODE(KEYCODE_Z)
752   /*        0x08 ? */
753   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 1 / Select Letter / Double / Hold Help") PORT_CODE(KEYCODE_X)
754   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Stop 3 / Erase / Take") PORT_CODE(KEYCODE_V)
755   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Play / Bet") PORT_CODE(KEYCODE_B)
756   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 2 / Right") PORT_CODE(KEYCODE_C)
757INPUT_PORTS_END
758
759static INPUT_PORTS_START( amcoetype2 )
760   PORT_INCLUDE(amcoecommon)
761
762   PORT_MODIFY("KEY2") // reverse order
763   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Small / Right") PORT_CODE(KEYCODE_C)
764   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Play / Bet") PORT_CODE(KEYCODE_B)
765   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_V)
766   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Double / Select") PORT_CODE(KEYCODE_X)
767   /*        0x10 ? */
768   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Big / Left") PORT_CODE(KEYCODE_Z)
769   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1)     PORT_IMPULSE(2) // causes coin jam if held
770   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1)  PORT_IMPULSE(2) // causes service jam if held
771INPUT_PORTS_END
772
773
774877static const gfx_layout sfbonus_layout =
775878{
776879   8,8,
r4425r4426
819922   else
820923   {
821924      if (file)
925      {
926         memset(nvram,0x00,nvram_size);
822927         mame_fread(file,nvram,nvram_size);
928      }
823929      else
930      {
931         UINT8* defaultram = memory_region(machine, "defaults");
824932         memset(nvram,0x00,nvram_size);
933
934         if (defaultram)
935            if ((defaultram[0x02]==0x00) && (defaultram[0x03]==0x00)) // hack! rom region optional regions get cleared with garbage if no rom is present, this is not good!
936               memcpy(nvram, memory_region(machine, "defaults"), memory_region_length(machine, "defaults"));
937      }
825938   }
826939}
827940
r4425r4426
831944   MDRV_CPU_PROGRAM_MAP(0,sfbonus_map)
832945   MDRV_CPU_IO_MAP(0,sfbonus_io)
833946   MDRV_CPU_VBLANK_INT("screen",irq0_line_hold)
834//  MDRV_CPU_PERIODIC_INT(nmi_line_pulse,100)
947   //MDRV_CPU_PERIODIC_INT(nmi_line_pulse,100)
835948
836949   MDRV_MACHINE_RESET( sfbonus )
837950
r4425r4426
9091022   ROM_REGION( 0x100000, "gfx2", 0 )
9101023   ROM_LOAD16_BYTE( "skfbrom5a.bin", 0x00000, 0x80000, CRC(ed07a635) SHA1(a31ee06d8cb78c43affa9d899e9cec87a0875934) )
9111024   ROM_LOAD16_BYTE( "skfbrom6a.bin", 0x00001, 0x80000, CRC(b9a39e5a) SHA1(cb875db25d8bccf48542bd6dbecc474b1205563b) )
1025
1026   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1027   ROM_LOAD_OPTIONAL( "skfb19rb.id", 0x00, 0x20, CRC(fc9c8ef9) SHA1(402eed23f820f09b18feca60cc90196e7c43db39) )
9121028ROM_END
9131029
9141030ROM_START( sfbonusd )
r4425r4426
9251041   ROM_REGION( 0x100000, "gfx2", 0 )
9261042   ROM_LOAD16_BYTE( "skfbrom5a.bin", 0x00000, 0x80000, CRC(ed07a635) SHA1(a31ee06d8cb78c43affa9d899e9cec87a0875934) )
9271043   ROM_LOAD16_BYTE( "skfbrom6a.bin", 0x00001, 0x80000, CRC(b9a39e5a) SHA1(cb875db25d8bccf48542bd6dbecc474b1205563b) )
1044
1045   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1046   ROM_LOAD_OPTIONAL( "skfb19r.id", 0x00, 0x20, CRC(431bc668) SHA1(10d0d96b3b50faa56f0a958449a7ad1d1f2c1382) )
9281047ROM_END
9291048
9301049ROM_START( sfbonusv )
r4425r4426
9411060   ROM_REGION( 0x100000, "gfx2", 0 )
9421061   ROM_LOAD16_BYTE( "skfbrom5a.bin", 0x00000, 0x80000, CRC(ed07a635) SHA1(a31ee06d8cb78c43affa9d899e9cec87a0875934) )
9431062   ROM_LOAD16_BYTE( "skfbrom6a.bin", 0x00001, 0x80000, CRC(b9a39e5a) SHA1(cb875db25d8bccf48542bd6dbecc474b1205563b) )
1063
1064   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1065   ROM_LOAD_OPTIONAL( "skfb19r.id", 0x00, 0x20, CRC(431bc668) SHA1(10d0d96b3b50faa56f0a958449a7ad1d1f2c1382) )
9441066ROM_END
9451067
9461068
r4425r4426
9741096   ROM_REGION( 0x100000, "gfx2", 0 )
9751097   ROM_LOAD16_BYTE( "p4rom5.bin", 0x00000, 0x80000, CRC(34a00b25) SHA1(a0bf3b6a40b73e69d790d0f36d12de4851411995) )
9761098   ROM_LOAD16_BYTE( "p4rom6.bin", 0x00001, 0x80000, CRC(4b9f30a6) SHA1(c6aac500085225d1684533dc765c6c5461a7e652) )
1099
1100   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1101   ROM_LOAD_OPTIONAL( "p4p26r_.id", 0x00, 0x20, CRC(ed815a5a) SHA1(dd2ff09025567725b047ca3750b76248d5eb2682) )
9771102ROM_END
9781103
9791104ROM_START( parrot3d )
r4425r4426
9901115   ROM_REGION( 0x100000, "gfx2", 0 )
9911116   ROM_LOAD16_BYTE( "p4rom5.bin", 0x00000, 0x80000, CRC(34a00b25) SHA1(a0bf3b6a40b73e69d790d0f36d12de4851411995) )
9921117   ROM_LOAD16_BYTE( "p4rom6.bin", 0x00001, 0x80000, CRC(4b9f30a6) SHA1(c6aac500085225d1684533dc765c6c5461a7e652) )
1118
1119   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1120   ROM_LOAD_OPTIONAL( "p4p26r.id", 0x00, 0x20, CRC(0cd529ee) SHA1(c473d82a7e7255df057dcc78f9e00ebfceee6f09) )
9931121ROM_END
9941122
9951123ROM_START( parrot3v )
r4425r4426
10061134   ROM_REGION( 0x100000, "gfx2", 0 )
10071135   ROM_LOAD16_BYTE( "p4rom5.bin", 0x00000, 0x80000, CRC(34a00b25) SHA1(a0bf3b6a40b73e69d790d0f36d12de4851411995) )
10081136   ROM_LOAD16_BYTE( "p4rom6.bin", 0x00001, 0x80000, CRC(4b9f30a6) SHA1(c6aac500085225d1684533dc765c6c5461a7e652) )
1137
1138   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1139   ROM_LOAD_OPTIONAL( "p4p26e.id", 0x00, 0x20, CRC(af6ee199) SHA1(e5cebc2a182f70366834390c64e9a2576b2cf4d2) )
10091140ROM_END
10101141
10111142ROM_START( parrot3v2 )
r4425r4426
10221153   ROM_REGION( 0x100000, "gfx2", 0 )
10231154   ROM_LOAD16_BYTE( "p4rom5.bin", 0x00000, 0x80000, CRC(34a00b25) SHA1(a0bf3b6a40b73e69d790d0f36d12de4851411995) )
10241155   ROM_LOAD16_BYTE( "p4rom6.bin", 0x00001, 0x80000, CRC(4b9f30a6) SHA1(c6aac500085225d1684533dc765c6c5461a7e652) )
1156
1157   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1158   ROM_LOAD_OPTIONAL( "p4p26r.id", 0x00, 0x20, CRC(0cd529ee) SHA1(c473d82a7e7255df057dcc78f9e00ebfceee6f09) )
10251159ROM_END
10261160
10271161ROM_START( hldspin1 )
r4425r4426
10321166   ROM_LOAD( "hs_2.bin", 0x00000, 0x40000, CRC(3b0f5374) SHA1(7e7b185b62d1a321e2853b4b08e8ee2aa54933f5) )
10331167
10341168   ROM_REGION( 0x100000, "gfx1", 0 )
1035   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
1169   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
10361170   ROM_LOAD16_BYTE( "hs1_4.bin", 0x00001, 0x40000, CRC(4313c099) SHA1(620452ac607b044ce4c8a5a7b03bc831125c81eb) )
10371171
10381172   ROM_REGION( 0x100000, "gfx2", 0 )
r4425r4426
10481182   ROM_LOAD( "hs_2.bin", 0x00000, 0x40000, CRC(3b0f5374) SHA1(7e7b185b62d1a321e2853b4b08e8ee2aa54933f5) )
10491183
10501184   ROM_REGION( 0x100000, "gfx1", 0 )
1051   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
1185   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
10521186   ROM_LOAD16_BYTE( "hs1_4.bin", 0x00001, 0x40000, CRC(4313c099) SHA1(620452ac607b044ce4c8a5a7b03bc831125c81eb) )
10531187
10541188   ROM_REGION( 0x100000, "gfx2", 0 )
10551189   ROM_LOAD16_BYTE( "hs_5.bin", 0x00000, 0x40000, CRC(09931910) SHA1(cac792f7c67d0ea274ecb369cef0554a033e8d88) )
10561190   ROM_LOAD16_BYTE( "hs_6.bin", 0x00001, 0x40000, CRC(801703e4) SHA1(7da822b03a6d4f53a49bb1fedc9e1262d8a84782) )
1191
1192   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1193   ROM_LOAD_OPTIONAL( "hsi27t_.id", 0x00, 0x20, CRC(f42e2f6c) SHA1(ae6c85b2f6419cdde6d7e074ef2feff7e6d8f9b6) )
10571194ROM_END
10581195
10591196ROM_START( hldspin1d )
r4425r4426
10641201   ROM_LOAD( "hs_2.bin", 0x00000, 0x40000, CRC(3b0f5374) SHA1(7e7b185b62d1a321e2853b4b08e8ee2aa54933f5) )
10651202
10661203   ROM_REGION( 0x100000, "gfx1", 0 )
1067   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
1204   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
10681205   ROM_LOAD16_BYTE( "hs1_4.bin", 0x00001, 0x40000, CRC(4313c099) SHA1(620452ac607b044ce4c8a5a7b03bc831125c81eb) )
10691206
10701207   ROM_REGION( 0x100000, "gfx2", 0 )
10711208   ROM_LOAD16_BYTE( "hs_5.bin", 0x00000, 0x40000, CRC(09931910) SHA1(cac792f7c67d0ea274ecb369cef0554a033e8d88) )
10721209   ROM_LOAD16_BYTE( "hs_6.bin", 0x00001, 0x40000, CRC(801703e4) SHA1(7da822b03a6d4f53a49bb1fedc9e1262d8a84782) )
1210
1211   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1212   ROM_LOAD_OPTIONAL( "hsi27t.id", 0x00, 0x20, CRC(c3761302) SHA1(c2253092425650cf99098dbc8fd96966b5726a90) )
10731213ROM_END
10741214
10751215ROM_START( hldspin1v )
r4425r4426
10801220   ROM_LOAD( "hs_2.bin", 0x00000, 0x40000, CRC(3b0f5374) SHA1(7e7b185b62d1a321e2853b4b08e8ee2aa54933f5) )
10811221
10821222   ROM_REGION( 0x100000, "gfx1", 0 )
1083   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
1223   ROM_LOAD16_BYTE( "hs1_3.bin", 0x00000, 0x40000, CRC(85a016cb) SHA1(abb32c0191a531706593088b2ecfb48ceb02a127) )
10841224   ROM_LOAD16_BYTE( "hs1_4.bin", 0x00001, 0x40000, CRC(4313c099) SHA1(620452ac607b044ce4c8a5a7b03bc831125c81eb) )
10851225
10861226   ROM_REGION( 0x100000, "gfx2", 0 )
10871227   ROM_LOAD16_BYTE( "hs_5.bin", 0x00000, 0x40000, CRC(09931910) SHA1(cac792f7c67d0ea274ecb369cef0554a033e8d88) )
10881228   ROM_LOAD16_BYTE( "hs_6.bin", 0x00001, 0x40000, CRC(801703e4) SHA1(7da822b03a6d4f53a49bb1fedc9e1262d8a84782) )
1229
1230   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1231   ROM_LOAD_OPTIONAL( "hsi27t.id", 0x00, 0x20, CRC(c3761302) SHA1(c2253092425650cf99098dbc8fd96966b5726a90) )
10891232ROM_END
10901233
10911234ROM_START( hldspin2 )
r4425r4426
11181261   ROM_REGION( 0x100000, "gfx2", 0 )
11191262   ROM_LOAD16_BYTE( "hs_5.bin", 0x00000, 0x40000, CRC(09931910) SHA1(cac792f7c67d0ea274ecb369cef0554a033e8d88) )
11201263   ROM_LOAD16_BYTE( "hs_6.bin", 0x00001, 0x40000, CRC(801703e4) SHA1(7da822b03a6d4f53a49bb1fedc9e1262d8a84782) )
1264
1265   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1266   ROM_LOAD_OPTIONAL( "hsii28r_.id", 0x00, 0x20, CRC(a3aef393) SHA1(c21c425e598fb01b151bb37bc16791e26c96c021) )
11211267ROM_END
11221268
11231269ROM_START( hldspin2d )
r4425r4426
11341280   ROM_REGION( 0x100000, "gfx2", 0 )
11351281   ROM_LOAD16_BYTE( "hs_5.bin", 0x00000, 0x40000, CRC(09931910) SHA1(cac792f7c67d0ea274ecb369cef0554a033e8d88) )
11361282   ROM_LOAD16_BYTE( "hs_6.bin", 0x00001, 0x40000, CRC(801703e4) SHA1(7da822b03a6d4f53a49bb1fedc9e1262d8a84782) )
1283
1284   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1285   ROM_LOAD_OPTIONAL( "hsii28r.id", 0x00, 0x20, CRC(ee237c53) SHA1(30b2cf73256a1815936cbb7147ea9d0bd2150a93) )
11371286ROM_END
11381287
11391288ROM_START( hldspin2v )
r4425r4426
11501299   ROM_REGION( 0x100000, "gfx2", 0 )
11511300   ROM_LOAD16_BYTE( "hs_5.bin", 0x00000, 0x40000, CRC(09931910) SHA1(cac792f7c67d0ea274ecb369cef0554a033e8d88) )
11521301   ROM_LOAD16_BYTE( "hs_6.bin", 0x00001, 0x40000, CRC(801703e4) SHA1(7da822b03a6d4f53a49bb1fedc9e1262d8a84782) )
1302
1303   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1304   ROM_LOAD_OPTIONAL( "hsii28r.id", 0x00, 0x20, CRC(ee237c53) SHA1(30b2cf73256a1815936cbb7147ea9d0bd2150a93) )
11531305ROM_END
11541306
11551307ROM_START( pickwin )
r4425r4426
11981350   ROM_REGION( 0x100000, "gfx2", 0 )
11991351   ROM_LOAD16_BYTE( "pw-5.bin", 0x00000, 0x40000, CRC(ec2ac284) SHA1(35cfab27db3740823b3cba821bd178d28e0be5f8) )
12001352   ROM_LOAD16_BYTE( "pw-6.bin", 0x00001, 0x40000, CRC(aba36d00) SHA1(5abb1fe7d4f212fa0f7d5314f76e7c6b07e6c4bb) )
1353
1354   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1355   ROM_LOAD_OPTIONAL( "pw28t_.id", 0x00, 0x20, CRC(5cea03d7) SHA1(421afef36be9228a87bf81d8df001a91f6c9ec98) )
12011356ROM_END
12021357
12031358ROM_START( pickwinb2 )
r4425r4426
12141369   ROM_REGION( 0x100000, "gfx2", 0 )
12151370   ROM_LOAD16_BYTE( "pw-5.bin", 0x00000, 0x40000, CRC(ec2ac284) SHA1(35cfab27db3740823b3cba821bd178d28e0be5f8) )
12161371   ROM_LOAD16_BYTE( "pw-6.bin", 0x00001, 0x40000, CRC(aba36d00) SHA1(5abb1fe7d4f212fa0f7d5314f76e7c6b07e6c4bb) )
1372
1373   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1374   ROM_LOAD_OPTIONAL( "pw29r_.id", 0x00, 0x20, CRC(f3903673) SHA1(e8ab992fcc19e271b141d6e3233db3fb0a1f6181) )
12171375ROM_END
12181376
12191377ROM_START( pickwind )
r4425r4426
12231381   ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
12241382   ROM_LOAD( "pw-2.bin", 0x00000, 0x40000, CRC(3b0f5374) SHA1(7e7b185b62d1a321e2853b4b08e8ee2aa54933f5) )
12251383
1226
1227
12281384   ROM_REGION( 0x100000, "gfx1", 0 )
12291385   ROM_LOAD16_BYTE( "pw-3.bin", 0x00000, 0x40000, CRC(9a27acbd) SHA1(3a3a6d0b5f6eeeebcb2ccaff773b8971b3bfd3c7) )
12301386   ROM_LOAD16_BYTE( "pw-4.bin", 0x00001, 0x40000, CRC(6b629619) SHA1(3842a7579f67866aa9744b0d6fa6a47c923be6fe) )
r4425r4426
12321388   ROM_REGION( 0x100000, "gfx2", 0 )
12331389   ROM_LOAD16_BYTE( "pw-5.bin", 0x00000, 0x40000, CRC(ec2ac284) SHA1(35cfab27db3740823b3cba821bd178d28e0be5f8) )
12341390   ROM_LOAD16_BYTE( "pw-6.bin", 0x00001, 0x40000, CRC(aba36d00) SHA1(5abb1fe7d4f212fa0f7d5314f76e7c6b07e6c4bb) )
1391
1392   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1393   ROM_LOAD_OPTIONAL( "pw28t.id", 0x00, 0x20, CRC(9f6dbd2a) SHA1(56cb91bffc45000c0f600bdc55b98e464a041be3) )
12351394ROM_END
12361395
12371396ROM_START( pickwind2 )
r4425r4426
12481407   ROM_REGION( 0x100000, "gfx2", 0 )
12491408   ROM_LOAD16_BYTE( "pw-5.bin", 0x00000, 0x40000, CRC(ec2ac284) SHA1(35cfab27db3740823b3cba821bd178d28e0be5f8) )
12501409   ROM_LOAD16_BYTE( "pw-6.bin", 0x00001, 0x40000, CRC(aba36d00) SHA1(5abb1fe7d4f212fa0f7d5314f76e7c6b07e6c4bb) )
1410
1411   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1412   ROM_LOAD_OPTIONAL( "pw29r.id", 0x00, 0x20, CRC(4e79a0ee) SHA1(941d94da4f4bf40fb1c851b032ebb1d7f4241efb) )
12511413ROM_END
12521414
12531415ROM_START( pickwinv )
r4425r4426
12641426   ROM_REGION( 0x100000, "gfx2", 0 )
12651427   ROM_LOAD16_BYTE( "pw-5.bin", 0x00000, 0x40000, CRC(ec2ac284) SHA1(35cfab27db3740823b3cba821bd178d28e0be5f8) )
12661428   ROM_LOAD16_BYTE( "pw-6.bin", 0x00001, 0x40000, CRC(aba36d00) SHA1(5abb1fe7d4f212fa0f7d5314f76e7c6b07e6c4bb) )
1429
1430   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1431   ROM_LOAD_OPTIONAL( "pw28t.id", 0x00, 0x20, CRC(9f6dbd2a) SHA1(56cb91bffc45000c0f600bdc55b98e464a041be3) )
12671432ROM_END
12681433
12691434ROM_START( pickwinv2 )
r4425r4426
12731438   ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
12741439   ROM_LOAD( "pw-2.bin", 0x00000, 0x40000, CRC(3b0f5374) SHA1(7e7b185b62d1a321e2853b4b08e8ee2aa54933f5) )
12751440
1276
12771441   ROM_REGION( 0x100000, "gfx1", 0 )
12781442   ROM_LOAD16_BYTE( "pw-3.bin", 0x00000, 0x40000, CRC(9a27acbd) SHA1(3a3a6d0b5f6eeeebcb2ccaff773b8971b3bfd3c7) )
12791443   ROM_LOAD16_BYTE( "pw-4.bin", 0x00001, 0x40000, CRC(6b629619) SHA1(3842a7579f67866aa9744b0d6fa6a47c923be6fe) )
r4425r4426
12811445   ROM_REGION( 0x100000, "gfx2", 0 )
12821446   ROM_LOAD16_BYTE( "pw-5.bin", 0x00000, 0x40000, CRC(ec2ac284) SHA1(35cfab27db3740823b3cba821bd178d28e0be5f8) )
12831447   ROM_LOAD16_BYTE( "pw-6.bin", 0x00001, 0x40000, CRC(aba36d00) SHA1(5abb1fe7d4f212fa0f7d5314f76e7c6b07e6c4bb) )
1448
1449   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1450   ROM_LOAD_OPTIONAL( "pw29e.id", 0x00, 0x20, CRC(3a412685) SHA1(2c650d20dcf4f05154a9e589865d90496bbf4192) )
12841451ROM_END
12851452
12861453ROM_START( pickwinv3 )
r4425r4426
12971464   ROM_REGION( 0x100000, "gfx2", 0 )
12981465   ROM_LOAD16_BYTE( "pw-5.bin", 0x00000, 0x40000, CRC(ec2ac284) SHA1(35cfab27db3740823b3cba821bd178d28e0be5f8) )
12991466   ROM_LOAD16_BYTE( "pw-6.bin", 0x00001, 0x40000, CRC(aba36d00) SHA1(5abb1fe7d4f212fa0f7d5314f76e7c6b07e6c4bb) )
1467
1468   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1469   ROM_LOAD_OPTIONAL( "pw29r.id", 0x00, 0x20, CRC(4e79a0ee) SHA1(941d94da4f4bf40fb1c851b032ebb1d7f4241efb) )
13001470ROM_END
13011471
13021472ROM_START( tighook )
r4425r4426
13131483   ROM_REGION( 0x100000, "gfx2", 0 )
13141484   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
13151485   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1486
1487   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1488   ROM_LOAD_OPTIONAL( "thk17t.id", 0x00, 0x20, CRC(2732964b) SHA1(1a72804d993ec05bb92693a6bc1d3253a8f1ada0) )
13161489ROM_END
13171490
13181491ROM_START( tighooka )
r4425r4426
13291502   ROM_REGION( 0x100000, "gfx2", 0 )
13301503   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
13311504   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1505
1506   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1507   ROM_LOAD_OPTIONAL( "thk17r.id", 0x00, 0x20, CRC(4766771f) SHA1(9436d647dddc793cc373b1e45163f5af34d025b8) )
1508
13321509ROM_END
13331510
13341511
r4425r4426
13471524   ROM_REGION( 0x100000, "gfx2", 0 )
13481525   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
13491526   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1527
1528   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1529   ROM_LOAD_OPTIONAL( "thk21r.id", 0x00, 0x20, CRC(6d92c0ad) SHA1(1f1be92bcbdda461f6d36382d72af389f767d63d) )
13501530ROM_END
13511531
13521532ROM_START( tighookc2 )
r4425r4426
13631543   ROM_REGION( 0x100000, "gfx2", 0 )
13641544   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
13651545   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1546
1547   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1548   ROM_LOAD_OPTIONAL( "thk20lt.id", 0x00, 0x20, CRC(042cd62e) SHA1(1d145001ddbab44dee055d8dea72426a95150922) )
13661549ROM_END
13671550
13681551ROM_START( tighookv )
r4425r4426
13791562   ROM_REGION( 0x100000, "gfx2", 0 )
13801563   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
13811564   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1565
1566   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1567   ROM_LOAD_OPTIONAL( "thk21r.id", 0x00, 0x20, CRC(6d92c0ad) SHA1(1f1be92bcbdda461f6d36382d72af389f767d63d) )
13821568ROM_END
13831569
13841570ROM_START( tighookv2 )
r4425r4426
13951581   ROM_REGION( 0x100000, "gfx2", 0 )
13961582   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
13971583   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1584
1585   ROM_REGION( 0x20, "defaults", ROMREGION_ERASE00 ) /* default settings */
1586   ROM_LOAD_OPTIONAL( "thk21e.id", 0x00, 0x20, CRC(cfeb62ed) SHA1(2e8032736b1b450a03ee21ba407494c273399a60) )
13981587ROM_END
13991588
14001589ROM_START( tighookv3 )
r4425r4426
14111600   ROM_REGION( 0x100000, "gfx2", 0 )
14121601   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
14131602   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1603
1604   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1605   ROM_LOAD_OPTIONAL( "thk20lt.id", 0x00, 0x20, CRC(042cd62e) SHA1(1d145001ddbab44dee055d8dea72426a95150922) )
14141606ROM_END
14151607
14161608ROM_START( tighookd )
r4425r4426
14271619   ROM_REGION( 0x100000, "gfx2", 0 )
14281620   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
14291621   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1622
1623   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1624   ROM_LOAD_OPTIONAL( "thk21r.id", 0x00, 0x20, CRC(6d92c0ad) SHA1(1f1be92bcbdda461f6d36382d72af389f767d63d) )
14301625ROM_END
14311626
14321627ROM_START( tighookd2 )
r4425r4426
14431638   ROM_REGION( 0x100000, "gfx2", 0 )
14441639   ROM_LOAD16_BYTE( "thkrom5.bin", 0x00000, 0x80000, CRC(4085e345) SHA1(38c8e4727a782630527141e1586fcceff1d07d76) )
14451640   ROM_LOAD16_BYTE( "thkrom6.bin", 0x00001, 0x80000, CRC(637695ff) SHA1(a5707b545968ac9d41c1a4ffd4de60a9df4bcbf1) )
1641
1642   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1643   ROM_LOAD_OPTIONAL( "thk20lt.id", 0x00, 0x20, CRC(042cd62e) SHA1(1d145001ddbab44dee055d8dea72426a95150922) )
14461644ROM_END
14471645
14481646ROM_START( robadv )
r4425r4426
14591657   ROM_REGION( 0x100000, "gfx2", 0 )
14601658   ROM_LOAD16_BYTE( "rarom5.bin", 0x00000, 0x80000, CRC(9bf41c2b) SHA1(8cc8ca5c2c63223e670e00ca5802b8677856bc16) )
14611659   ROM_LOAD16_BYTE( "rarom6.bin", 0x00001, 0x80000, CRC(0fb69b4c) SHA1(8e1aaf5ade707b4045d55ff64e72cfe5db696332) )
1660
1661   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1662   ROM_LOAD_OPTIONAL( "ra15r.id", 0x00, 0x20, CRC(7bc9c013) SHA1(83aa66ae0a9e9f9ee75541847c98df919907c5cb) )
14621663ROM_END
14631664
14641665ROM_START( robadvc )
r4425r4426
14751676   ROM_REGION( 0x100000, "gfx2", 0 )
14761677   ROM_LOAD16_BYTE( "rarom5.bin", 0x00000, 0x80000, CRC(9bf41c2b) SHA1(8cc8ca5c2c63223e670e00ca5802b8677856bc16) )
14771678   ROM_LOAD16_BYTE( "rarom6.bin", 0x00001, 0x80000, CRC(0fb69b4c) SHA1(8e1aaf5ade707b4045d55ff64e72cfe5db696332) )
1679
1680   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1681   ROM_LOAD_OPTIONAL( "ra17r1.id", 0x00, 0x20, CRC(95984bfa) SHA1(b345e2a12795f8b8e3f301800c9b4c196db218c6) )
14781682ROM_END
14791683
14801684ROM_START( robadvd )
r4425r4426
14911695   ROM_REGION( 0x100000, "gfx2", 0 )
14921696   ROM_LOAD16_BYTE( "rarom5.bin", 0x00000, 0x80000, CRC(9bf41c2b) SHA1(8cc8ca5c2c63223e670e00ca5802b8677856bc16) )
14931697   ROM_LOAD16_BYTE( "rarom6.bin", 0x00001, 0x80000, CRC(0fb69b4c) SHA1(8e1aaf5ade707b4045d55ff64e72cfe5db696332) )
1698
1699   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1700   ROM_LOAD_OPTIONAL( "ra17r1.id", 0x00, 0x20, CRC(95984bfa) SHA1(b345e2a12795f8b8e3f301800c9b4c196db218c6) )
14941701ROM_END
14951702
14961703ROM_START( robadvv1 )
r4425r4426
15071714   ROM_REGION( 0x100000, "gfx2", 0 )
15081715   ROM_LOAD16_BYTE( "rarom5.bin", 0x00000, 0x80000, CRC(9bf41c2b) SHA1(8cc8ca5c2c63223e670e00ca5802b8677856bc16) )
15091716   ROM_LOAD16_BYTE( "rarom6.bin", 0x00001, 0x80000, CRC(0fb69b4c) SHA1(8e1aaf5ade707b4045d55ff64e72cfe5db696332) )
1717
1718   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1719   ROM_LOAD_OPTIONAL( "ra17e1.id", 0x00, 0x20, CRC(e1a0cd91) SHA1(7f1543374dff9c027c438fa71e622450c9d9bb11) )
15101720ROM_END
15111721
15121722ROM_START( robadvv2 )
r4425r4426
15231733   ROM_REGION( 0x100000, "gfx2", 0 )
15241734   ROM_LOAD16_BYTE( "rarom5.bin", 0x00000, 0x80000, CRC(9bf41c2b) SHA1(8cc8ca5c2c63223e670e00ca5802b8677856bc16) )
15251735   ROM_LOAD16_BYTE( "rarom6.bin", 0x00001, 0x80000, CRC(0fb69b4c) SHA1(8e1aaf5ade707b4045d55ff64e72cfe5db696332) )
1736
1737   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1738   ROM_LOAD_OPTIONAL( "ra17r1.id", 0x00, 0x20, CRC(95984bfa) SHA1(b345e2a12795f8b8e3f301800c9b4c196db218c6) )
15261739ROM_END
15271740
15281741
r4425r4426
16731886   ROM_REGION( 0x100000, "gfx2", 0 )
16741887   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
16751888   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
1889
1890   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1891   ROM_LOAD_OPTIONAL( "ab17r_.id", 0x00, 0x20, CRC(429d536e) SHA1(29c3cae00c3a11f25fdc1fe2d5a99d28ab7e3fbd) )
16761892ROM_END
16771893
16781894ROM_START( anibonusb2 )
r4425r4426
16891905   ROM_REGION( 0x100000, "gfx2", 0 )
16901906   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
16911907   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
1908
1909   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1910   ROM_LOAD_OPTIONAL( "ab17lt_.id", 0x00, 0x20, CRC(cee2a8e9) SHA1(8c5fe465f1397b3d40f616d6a4d842c2bbc767de) )
16921911ROM_END
16931912
16941913ROM_START( anibonusd )
r4425r4426
17051924   ROM_REGION( 0x100000, "gfx2", 0 )
17061925   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
17071926   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
1927
1928   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1929   ROM_LOAD_OPTIONAL( "ab17r.id", 0x00, 0x20, CRC(2dcec152) SHA1(092971dd78cf923a8b17d40d0aca5a8e67468425) )
17081930ROM_END
17091931
17101932ROM_START( anibonusd2 )
r4425r4426
17211943   ROM_REGION( 0x100000, "gfx2", 0 )
17221944   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
17231945   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
1946
1947   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1948   ROM_LOAD_OPTIONAL( "ab17lt.id", 0x00, 0x20, CRC(5e9ea82a) SHA1(91adfef2b71be838929b2cd3b619b90270c2464f) )
17241949ROM_END
17251950
17261951ROM_START( anibonusv )
r4425r4426
17371962   ROM_REGION( 0x100000, "gfx2", 0 )
17381963   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
17391964   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
1965
1966   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1967   ROM_LOAD_OPTIONAL( "ab17r.id", 0x00, 0x20, CRC(2dcec152) SHA1(092971dd78cf923a8b17d40d0aca5a8e67468425) ) // game version is 1.8, but still writes 1.7 to nvram
17401968ROM_END
17411969
17421970ROM_START( anibonusv2 )
r4425r4426
17531981   ROM_REGION( 0x100000, "gfx2", 0 )
17541982   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
17551983   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
1984
1985   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
1986   ROM_LOAD_OPTIONAL( "ab17lt.id", 0x00, 0x20, CRC(5e9ea82a) SHA1(91adfef2b71be838929b2cd3b619b90270c2464f) ) // game version is 1.8, but still writes 1.7 to nvram
17561987ROM_END
17571988
17581989ROM_START( anibonusv3 )
r4425r4426
17692000   ROM_REGION( 0x100000, "gfx2", 0 )
17702001   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
17712002   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
2003
2004   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2005   ROM_LOAD_OPTIONAL( "ab17e.id", 0x00, 0x20, CRC(5a729357) SHA1(8a218c27fda8991ec9e122eb75675250aa7f73d6) ) // game version is 1.8, but still writes 1.7 to nvram
17722006ROM_END
17732007
17742008ROM_START( abnudge )
r4425r4426
18012035   ROM_REGION( 0x100000, "gfx2", 0 )
18022036   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
18032037   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
2038
2039   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2040   ROM_LOAD_OPTIONAL( "ab20n_.id", 0x00, 0x20, CRC(031117ce) SHA1(00b7eb7a4af62085273223354380924898f1e7f0) )
18042041ROM_END
18052042
18062043ROM_START( abnudged )
r4425r4426
18172054   ROM_REGION( 0x100000, "gfx2", 0 )
18182055   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
18192056   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
2057
2058   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2059   ROM_LOAD_OPTIONAL( "ab20n.id", 0x00, 0x20, CRC(fb59eefe) SHA1(dd6f75440bd3c12a01233b54e7f618010152799d) )
18202060ROM_END
18212061
18222062ROM_START( abnudgev )
r4425r4426
18332073   ROM_REGION( 0x100000, "gfx2", 0 )
18342074   ROM_LOAD16_BYTE( "abrom5n.bin", 0x00000, 0x80000, CRC(d3db86eb) SHA1(e7e2cdfa6b4795d4021f589d2a292c67cc32f03a) )
18352075   ROM_LOAD16_BYTE( "abrom6n.bin", 0x00001, 0x80000, CRC(0d8dcaa1) SHA1(a74c64bb89b4273e9d1e092786a5cf8ebd60477c) )
2076
2077   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2078   ROM_LOAD_OPTIONAL( "ab20n.id", 0x00, 0x20, CRC(fb59eefe) SHA1(dd6f75440bd3c12a01233b54e7f618010152799d) )
18362079ROM_END
18372080
18382081ROM_START( anithunt )
r4425r4426
18812124   ROM_REGION( 0x100000, "gfx2", 0 )
18822125   ROM_LOAD16_BYTE( "ath-rom5.bin", 0x00000, 0x80000, CRC(536a7e23) SHA1(51dc6b2b022a672810b00e1006b0c7ee610a4e4f) )
18832126   ROM_LOAD16_BYTE( "ath-rom6.bin", 0x00001, 0x80000, CRC(23bc5067) SHA1(1e279e58437b897c7a68c9cdd15277c6a906a142) )
2127
2128   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2129   ROM_LOAD_OPTIONAL( "ath19r_.id", 0x00, 0x20, CRC(1095cfc5) SHA1(3a2f83d2e442ee802e14191db48e7486097c50d3) )
18842130ROM_END
18852131
18862132ROM_START( anithuntd )
r4425r4426
18972143   ROM_REGION( 0x100000, "gfx2", 0 )
18982144   ROM_LOAD16_BYTE( "ath-rom5.bin", 0x00000, 0x80000, CRC(536a7e23) SHA1(51dc6b2b022a672810b00e1006b0c7ee610a4e4f) )
18992145   ROM_LOAD16_BYTE( "ath-rom6.bin", 0x00001, 0x80000, CRC(23bc5067) SHA1(1e279e58437b897c7a68c9cdd15277c6a906a142) )
2146
2147   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2148   ROM_LOAD_OPTIONAL( "ath19r.id", 0x00, 0x20, CRC(6c98b3ae) SHA1(63d7a2fe10871a0ee6d02180166f5b64d9d533fc) )
19002149ROM_END
19012150
19022151ROM_START( anithuntv )
r4425r4426
19132162   ROM_REGION( 0x100000, "gfx2", 0 )
19142163   ROM_LOAD16_BYTE( "ath-rom5.bin", 0x00000, 0x80000, CRC(536a7e23) SHA1(51dc6b2b022a672810b00e1006b0c7ee610a4e4f) )
19152164   ROM_LOAD16_BYTE( "ath-rom6.bin", 0x00001, 0x80000, CRC(23bc5067) SHA1(1e279e58437b897c7a68c9cdd15277c6a906a142) )
2165
2166   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2167   ROM_LOAD_OPTIONAL( "ath19r.id", 0x00, 0x20, CRC(6c98b3ae) SHA1(63d7a2fe10871a0ee6d02180166f5b64d9d533fc) )
19162168ROM_END
19172169
19182170
r4425r4426
19462198   ROM_REGION( 0x100000, "gfx2", 0 )
19472199   ROM_LOAD16_BYTE( "dcrom5.bin", 0x00000, 0x80000, CRC(a55f4ed3) SHA1(9f7427357af84026c056624523fd20bc556f3c22) )
19482200   ROM_LOAD16_BYTE( "dcrom6.bin", 0x00001, 0x80000, CRC(cf783d82) SHA1(d3f8ae5cb3a5f848e2d84721a5a4ee486a52de85) )
2201
2202   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2203   ROM_LOAD_OPTIONAL( "dc15r_.id", 0x00, 0x20, CRC(5e39f9f5) SHA1(fa8b5bf53eaa6f332a2ae875409ec4015889a70f) )
19492204ROM_END
19502205
19512206ROM_START( dblchalc )
r4425r4426
19622217   ROM_REGION( 0x100000, "gfx2", 0 )
19632218   ROM_LOAD16_BYTE( "dcrom5.bin", 0x00000, 0x80000, CRC(a55f4ed3) SHA1(9f7427357af84026c056624523fd20bc556f3c22) )
19642219   ROM_LOAD16_BYTE( "dcrom6.bin", 0x00001, 0x80000, CRC(cf783d82) SHA1(d3f8ae5cb3a5f848e2d84721a5a4ee486a52de85) )
2220
2221   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2222   ROM_LOAD_OPTIONAL( "dc15r.id", 0x00, 0x20, CRC(4a0f2f34) SHA1(a169f671b2e61e95ad071ca986711694ef2f7364) )
19652223ROM_END
19662224
19672225ROM_START( dblchald )
r4425r4426
19782236   ROM_REGION( 0x100000, "gfx2", 0 )
19792237   ROM_LOAD16_BYTE( "dcrom5.bin", 0x00000, 0x80000, CRC(a55f4ed3) SHA1(9f7427357af84026c056624523fd20bc556f3c22) )
19802238   ROM_LOAD16_BYTE( "dcrom6.bin", 0x00001, 0x80000, CRC(cf783d82) SHA1(d3f8ae5cb3a5f848e2d84721a5a4ee486a52de85) )
2239
2240   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2241   ROM_LOAD_OPTIONAL( "dc15r.id", 0x00, 0x20, CRC(4a0f2f34) SHA1(a169f671b2e61e95ad071ca986711694ef2f7364) )
19812242ROM_END
19822243
19832244ROM_START( dblchalv )
r4425r4426
19942255   ROM_REGION( 0x100000, "gfx2", 0 )
19952256   ROM_LOAD16_BYTE( "dcrom5.bin", 0x00000, 0x80000, CRC(a55f4ed3) SHA1(9f7427357af84026c056624523fd20bc556f3c22) )
19962257   ROM_LOAD16_BYTE( "dcrom6.bin", 0x00001, 0x80000, CRC(cf783d82) SHA1(d3f8ae5cb3a5f848e2d84721a5a4ee486a52de85) )
2258
2259   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2260   ROM_LOAD_OPTIONAL( "dc15r.id", 0x00, 0x20, CRC(4a0f2f34) SHA1(a169f671b2e61e95ad071ca986711694ef2f7364) )
19972261ROM_END
19982262
19992263
r4425r4426
20112275   ROM_REGION( 0x100000, "gfx2", 0 )
20122276   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
20132277   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2278
2279   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2280   ROM_LOAD_OPTIONAL( "ra15r2.id", 0x00, 0x20, CRC(8d2a7cd7) SHA1(ce1a67b4848c74c50c957d2ced081298e9fde3ee) )
20142281ROM_END
20152282
20162283ROM_START( robadv2a )
r4425r4426
20272294   ROM_REGION( 0x100000, "gfx2", 0 )
20282295   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
20292296   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2297
2298   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2299   ROM_LOAD_OPTIONAL( "ra15r2.id", 0x00, 0x20, CRC(8d2a7cd7) SHA1(ce1a67b4848c74c50c957d2ced081298e9fde3ee) )
20302300ROM_END
20312301
20322302ROM_START( robadv2c )
r4425r4426
20432313   ROM_REGION( 0x100000, "gfx2", 0 )
20442314   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
20452315   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2316
2317   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2318   ROM_LOAD_OPTIONAL( "ra17lt2.id", 0x00, 0x20, CRC(697f1668) SHA1(cbac3a24fd9f73c91a2903f5dfe2aee7944cffeb) )
20462319ROM_END
20472320
20482321ROM_START( robadv2v1 )
r4425r4426
20592332   ROM_REGION( 0x100000, "gfx2", 0 )
20602333   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
20612334   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2335
2336   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2337   ROM_LOAD_OPTIONAL( "ra17r2.id", 0x00, 0x20, CRC(a4705167) SHA1(97573248b4d35c665933e34e6e2fa2ea62e0c8a5) )
20622338ROM_END
20632339
20642340ROM_START( robadv2v2 )
r4425r4426
20752351   ROM_REGION( 0x100000, "gfx2", 0 )
20762352   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
20772353   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2354
2355   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2356   ROM_LOAD_OPTIONAL( "ra17r2.id", 0x00, 0x20, CRC(a4705167) SHA1(97573248b4d35c665933e34e6e2fa2ea62e0c8a5) )
20782357ROM_END
20792358
20802359ROM_START( robadv2v3 )
r4425r4426
20912370   ROM_REGION( 0x100000, "gfx2", 0 )
20922371   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
20932372   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2373
2374   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2375   ROM_LOAD_OPTIONAL( "ra17lt2.id", 0x00, 0x20, CRC(697f1668) SHA1(cbac3a24fd9f73c91a2903f5dfe2aee7944cffeb) )
20942376ROM_END
20952377
20962378ROM_START( robadv2v4 )
r4425r4426
21072389   ROM_REGION( 0x100000, "gfx2", 0 )
21082390   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
21092391   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2392
2393   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2394   ROM_LOAD_OPTIONAL( "ra17e2.id", 0x00, 0x20, CRC(d048d70c) SHA1(602b0bd23e02577e822e09b3b0bc363f3aeceaba) )
21102395ROM_END
21112396
21122397ROM_START( robadv2d )
r4425r4426
21232408   ROM_REGION( 0x100000, "gfx2", 0 )
21242409   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
21252410   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2411
2412   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2413   ROM_LOAD_OPTIONAL( "ra17lt2.id", 0x00, 0x20, CRC(697f1668) SHA1(cbac3a24fd9f73c91a2903f5dfe2aee7944cffeb) )
21262414ROM_END
21272415
21282416ROM_START( robadv2d2 )
r4425r4426
21392427   ROM_REGION( 0x100000, "gfx2", 0 )
21402428   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
21412429   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2430
2431   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2432   ROM_LOAD_OPTIONAL( "ra17r2.id", 0x00, 0x20, CRC(a4705167) SHA1(97573248b4d35c665933e34e6e2fa2ea62e0c8a5) )
21422433ROM_END
21432434
21442435ROM_START( robadv2d3 )
r4425r4426
21552446   ROM_REGION( 0x100000, "gfx2", 0 )
21562447   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
21572448   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2449
2450   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2451   ROM_LOAD_OPTIONAL( "ra17r2.id", 0x00, 0x20, CRC(a4705167) SHA1(97573248b4d35c665933e34e6e2fa2ea62e0c8a5) )
21582452ROM_END
21592453
21602454ROM_START( robadv2c2 )
r4425r4426
21712465   ROM_REGION( 0x100000, "gfx2", 0 )
21722466   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
21732467   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2468
2469   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2470   ROM_LOAD_OPTIONAL( "ra17r2.id", 0x00, 0x20, CRC(a4705167) SHA1(97573248b4d35c665933e34e6e2fa2ea62e0c8a5) )
21742471ROM_END
21752472
21762473ROM_START( robadv2c3 )
r4425r4426
21872484   ROM_REGION( 0x100000, "gfx2", 0 )
21882485   ROM_LOAD16_BYTE( "ra2rom5.bin", 0x00000, 0x80000, CRC(ad9379a2) SHA1(93126969677cfce20e5b2e287662ac6b2ceee425) )
21892486   ROM_LOAD16_BYTE( "ra2rom6.bin", 0x00001, 0x80000, CRC(12312874) SHA1(9d4d9d9fbec8536e8a003892643654d15f4535fa) )
2487
2488   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2489   ROM_LOAD_OPTIONAL( "ra17r2.id", 0x00, 0x20, CRC(a4705167) SHA1(97573248b4d35c665933e34e6e2fa2ea62e0c8a5) )
21902490ROM_END
21912491
21922492
r4425r4426
22202520   ROM_REGION( 0x100000, "gfx2", 0 )
22212521   ROM_LOAD16_BYTE( "p3rom5.bin", 0x00000, 0x80000, CRC(c5eca135) SHA1(bdaccd32e1434016c77579bc8c4214ab2a3ae474) )
22222522   ROM_LOAD16_BYTE( "p3rom6.bin", 0x00001, 0x80000, CRC(d990cbb8) SHA1(6f822e38bf401b2eb0b2e36f3b4fc6822fafd3fa) )
2523
2524   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2525   ROM_LOAD_OPTIONAL( "p3p22r_.id", 0x00, 0x20, CRC(30f56bca) SHA1(6325121e9f11ec96af90c0f3b57b98c11f8f97b7) )
22232526ROM_END
22242527
22252528ROM_START( pirpok2d )
r4425r4426
22362539   ROM_REGION( 0x100000, "gfx2", 0 )
22372540   ROM_LOAD16_BYTE( "p3rom5.bin", 0x00000, 0x80000, CRC(c5eca135) SHA1(bdaccd32e1434016c77579bc8c4214ab2a3ae474) )
22382541   ROM_LOAD16_BYTE( "p3rom6.bin", 0x00001, 0x80000, CRC(d990cbb8) SHA1(6f822e38bf401b2eb0b2e36f3b4fc6822fafd3fa) )
2542
2543   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2544   ROM_LOAD_OPTIONAL( "p3p22r.id", 0x00, 0x20, CRC(fc07ce9b) SHA1(50ea8edd5c2f73f7e8abaa8af0d717152648dcd0) )
22392545ROM_END
22402546
22412547ROM_START( pirpok2v )
r4425r4426
22522558   ROM_REGION( 0x100000, "gfx2", 0 )
22532559   ROM_LOAD16_BYTE( "p3rom5.bin", 0x00000, 0x80000, CRC(c5eca135) SHA1(bdaccd32e1434016c77579bc8c4214ab2a3ae474) )
22542560   ROM_LOAD16_BYTE( "p3rom6.bin", 0x00001, 0x80000, CRC(d990cbb8) SHA1(6f822e38bf401b2eb0b2e36f3b4fc6822fafd3fa) )
2561
2562   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2563   ROM_LOAD_OPTIONAL( "p3p22r.id", 0x00, 0x20, CRC(fc07ce9b) SHA1(50ea8edd5c2f73f7e8abaa8af0d717152648dcd0) )
22552564ROM_END
22562565
22572566ROM_START( pirpok2v2 )
r4425r4426
22682577   ROM_REGION( 0x100000, "gfx2", 0 )
22692578   ROM_LOAD16_BYTE( "p3rom5.bin", 0x00000, 0x80000, CRC(c5eca135) SHA1(bdaccd32e1434016c77579bc8c4214ab2a3ae474) )
22702579   ROM_LOAD16_BYTE( "p3rom6.bin", 0x00001, 0x80000, CRC(d990cbb8) SHA1(6f822e38bf401b2eb0b2e36f3b4fc6822fafd3fa) )
2580
2581   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2582   ROM_LOAD_OPTIONAL( "p3p24e.id", 0x00, 0x20, CRC(99d30f6b) SHA1(fb7937e8b595def542f87c08ad69163d18bcde81) )
22712583ROM_END
22722584
22732585
r4425r4426
23022614   ROM_REGION( 0x100000, "gfx2", 0 )
23032615   ROM_LOAD16_BYTE( "fcrom5n.bin", 0x00000, 0x80000, CRC(42955842) SHA1(383be3049da5b10ea57a278bc6578ece046058fd) )
23042616   ROM_LOAD16_BYTE( "fcrom6n.bin", 0x00001, 0x80000, CRC(eee0f84d) SHA1(4ac096ccea258710f58c8121e7f0af28593d6368) )
2617
2618   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2619   ROM_LOAD_OPTIONAL( "fc20n.id", 0x00, 0x20, CRC(1d8fa4c9) SHA1(f389aab05538688e21bc41ded91f8a2ccf0a7a38) ) // game is 2.1, but writes 2.0 to nvram
23052620ROM_END
23062621
23072622ROM_START( fcnudge3 )
r4425r4426
23182633   ROM_REGION( 0x100000, "gfx2", 0 )
23192634   ROM_LOAD16_BYTE( "fcrom5n.bin", 0x00000, 0x80000, CRC(42955842) SHA1(383be3049da5b10ea57a278bc6578ece046058fd) )
23202635   ROM_LOAD16_BYTE( "fcrom6n.bin", 0x00001, 0x80000, CRC(eee0f84d) SHA1(4ac096ccea258710f58c8121e7f0af28593d6368) )
2636
2637   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2638   ROM_LOAD_OPTIONAL( "fc20n_.id", 0x00, 0x20, CRC(b6072181) SHA1(f666cdc7be23bb2445cae6a338a6739c7f64f907) )
23212639ROM_END
23222640
23232641ROM_START( fcnudge4 )
r4425r4426
23342652   ROM_REGION( 0x100000, "gfx2", 0 )
23352653   ROM_LOAD16_BYTE( "fcrom5n.bin", 0x00000, 0x80000, CRC(42955842) SHA1(383be3049da5b10ea57a278bc6578ece046058fd) )
23362654   ROM_LOAD16_BYTE( "fcrom6n.bin", 0x00001, 0x80000, CRC(eee0f84d) SHA1(4ac096ccea258710f58c8121e7f0af28593d6368) )
2655
2656   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2657   ROM_LOAD_OPTIONAL( "fc20n.id", 0x00, 0x20, CRC(1d8fa4c9) SHA1(f389aab05538688e21bc41ded91f8a2ccf0a7a38) )
23372658ROM_END
23382659
23392660ROM_START( sfruitb )
r4425r4426
23982719   ROM_REGION( 0x100000, "gfx2", 0 )
23992720   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
24002721   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2722
2723   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2724   ROM_LOAD_OPTIONAL( "sfb20lt_.id", 0x00, 0x20, CRC(a3b85e54) SHA1(b0d07780f2047beb14f624f8306ad41d88502c10) )
24012725ROM_END
24022726
24032727ROM_START( sfruitbb2 )
r4425r4426
24142738   ROM_REGION( 0x100000, "gfx2", 0 )
24152739   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
24162740   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2741
2742   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2743   ROM_LOAD_OPTIONAL( "sfb22b_.id", 0x00, 0x20, CRC(29523bc1) SHA1(99ac1b7898c2f48ad3846bb59c8af6d04b5a6a55) )
24172744ROM_END
24182745
24192746ROM_START( sfruitbb3 )
r4425r4426
24302757   ROM_REGION( 0x100000, "gfx2", 0 )
24312758   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
24322759   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2760
2761   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2762   ROM_LOAD_OPTIONAL( "sfb25r_.id", 0x00, 0x20, CRC(ef2307d4) SHA1(31126388ffddeb346724d03ed5d983d2952dfc07) )
24332763ROM_END
24342764
24352765ROM_START( sfruitbd )
r4425r4426
24462776   ROM_REGION( 0x100000, "gfx2", 0 )
24472777   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
24482778   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2779
2780   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2781   ROM_LOAD_OPTIONAL( "sfb20lt.id", 0x00, 0x20, CRC(eb233ded) SHA1(02882a386ebd3b739ab318cd97b3a371bbdba739) )
24492782ROM_END
24502783
24512784ROM_START( sfruitbd2 )
r4425r4426
24622795   ROM_REGION( 0x100000, "gfx2", 0 )
24632796   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
24642797   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2798
2799   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2800   ROM_LOAD_OPTIONAL( "sfb22b.id", 0x00, 0x20, CRC(6bccb043) SHA1(aed25ed09d34a98432436739a00fae4d6b3f6324) )
24652801ROM_END
24662802
24672803ROM_START( sfruitbd3 )
r4425r4426
24782814   ROM_REGION( 0x100000, "gfx2", 0 )
24792815   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
24802816   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2817
2818   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2819   ROM_LOAD_OPTIONAL( "sfb25r.id", 0x00, 0x20, CRC(06d72594) SHA1(53b8ddd2166e0345d7ab83c8ab5fc05672201b88) )
24812820ROM_END
24822821
24832822
r4425r4426
24952834   ROM_REGION( 0x100000, "gfx2", 0 )
24962835   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
24972836   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2837
2838   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2839   ROM_LOAD_OPTIONAL( "sfb25r.id", 0x00, 0x20, CRC(06d72594) SHA1(53b8ddd2166e0345d7ab83c8ab5fc05672201b88) )
24982840ROM_END
24992841
25002842ROM_START( sfruitbv2 )
r4425r4426
25112853   ROM_REGION( 0x100000, "gfx2", 0 )
25122854   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
25132855   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2856
2857   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2858   ROM_LOAD_OPTIONAL( "sfb25e.id", 0x00, 0x20, CRC(a4ae87d4) SHA1(d19b6cc31b6011f5467ba6fe70cced8ca5ddffc9) )
25142859ROM_END
25152860
25162861ROM_START( sfruitbv3 )
r4425r4426
25272872   ROM_REGION( 0x100000, "gfx2", 0 )
25282873   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
25292874   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2875
2876   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2877   ROM_LOAD_OPTIONAL( "sfb22eb.id", 0x00, 0x20, CRC(eb57209c) SHA1(1ea1acdd92bb399fe0ed20a53ced47d8923af6dc) )
25302878ROM_END
25312879
25322880ROM_START( sfruitbv4 )
r4425r4426
25432891   ROM_REGION( 0x100000, "gfx2", 0 )
25442892   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
25452893   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2894
2895   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2896   ROM_LOAD_OPTIONAL( "sfb22b.id", 0x00, 0x20, CRC(6bccb043) SHA1(aed25ed09d34a98432436739a00fae4d6b3f6324) )
25462897ROM_END
25472898
25482899ROM_START( sfruitbv5 )
r4425r4426
25592910   ROM_REGION( 0x100000, "gfx2", 0 )
25602911   ROM_LOAD16_BYTE( "sfbrom5.bin", 0x00000, 0x80000, CRC(31588ff3) SHA1(6e2a65d50457ec0e93a647fd8ca5ebeeb16bdb1c) )
25612912   ROM_LOAD16_BYTE( "sfbrom6.bin", 0x00001, 0x80000, CRC(232d6216) SHA1(ca7780adc85fa570698736785ad700797e6a98fb) )
2913
2914   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2915   ROM_LOAD_OPTIONAL( "sfb20lt.id", 0x00, 0x20, CRC(eb233ded) SHA1(02882a386ebd3b739ab318cd97b3a371bbdba739) )
25622916ROM_END
25632917
25642918
r4425r4426
25762930   ROM_REGION( 0x100000, "gfx2", 0 )
25772931   ROM_LOAD16_BYTE( "fb2grom5_older.bin", 0x00000, 0x80000, CRC(1c4172a8) SHA1(c45a57cd799681d442de02f8f07dbd9751929ca4) )
25782932   ROM_LOAD16_BYTE( "fb2grom6_older.bin", 0x00001, 0x80000, CRC(953fdcc4) SHA1(c57e2b4a8273e789b96d39fe28d02bec5359b5f4) )
2933
2934   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2935   ROM_LOAD_OPTIONAL( "fb2g16t.id", 0x00, 0x20, CRC(fd1f2ea8) SHA1(8845b68132aead4a5d6dc0f69ccde7d0df898427) )
25792936ROM_END
25802937
25812938ROM_START( fb2gena )
r4425r4426
25922949   ROM_REGION( 0x100000, "gfx2", 0 )
25932950   ROM_LOAD16_BYTE( "fb2grom5_older.bin", 0x00000, 0x80000, CRC(1c4172a8) SHA1(c45a57cd799681d442de02f8f07dbd9751929ca4) )
25942951   ROM_LOAD16_BYTE( "fb2grom6_older.bin", 0x00001, 0x80000, CRC(953fdcc4) SHA1(c57e2b4a8273e789b96d39fe28d02bec5359b5f4) )
2952
2953   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2954   ROM_LOAD_OPTIONAL( "fb2g15r.id", 0x00, 0x20, CRC(18e86971) SHA1(2f0c277b211c43cf43a067e6bc166fec8e55f190) )
25952955ROM_END
25962956
25972957
r4425r4426
26092969   ROM_REGION( 0x100000, "gfx2", 0 )
26102970   ROM_LOAD16_BYTE( "fb2grom5.bin", 0x00000, 0x80000, CRC(6aa1e45d) SHA1(a821c98513ad851f5f9e2452620feb662c28f8bb) )
26112971   ROM_LOAD16_BYTE( "fb2grom6.bin", 0x00001, 0x80000, CRC(1a525dcf) SHA1(20b1b2d6bdb0953300a6d9937b582fd5e20931ed) )
2972
2973   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2974   ROM_LOAD_OPTIONAL( "fb2g18r.id", 0x00, 0x20, CRC(b8fe27b5) SHA1(fdb5fe80e553f92647c023d4718242934bab59b0) )
26122975ROM_END
26132976
26142977ROM_START( fb2genc2 )
r4425r4426
26252988   ROM_REGION( 0x100000, "gfx2", 0 )
26262989   ROM_LOAD16_BYTE( "fb2grom5.bin", 0x00000, 0x80000, CRC(6aa1e45d) SHA1(a821c98513ad851f5f9e2452620feb662c28f8bb) )
26272990   ROM_LOAD16_BYTE( "fb2grom6.bin", 0x00001, 0x80000, CRC(1a525dcf) SHA1(20b1b2d6bdb0953300a6d9937b582fd5e20931ed) )
2991
2992   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
2993   ROM_LOAD_OPTIONAL( "fb2g18lt.id", 0x00, 0x20, CRC(8f36bc08) SHA1(53d970cb1a1055c459e64a09f4e495c52aa2ab9f) )
26282994ROM_END
26292995
26302996ROM_START( fb2genv )
r4425r4426
26413007   ROM_REGION( 0x100000, "gfx2", 0 )
26423008   ROM_LOAD16_BYTE( "fb2grom5.bin", 0x00000, 0x80000, CRC(6aa1e45d) SHA1(a821c98513ad851f5f9e2452620feb662c28f8bb) )
26433009   ROM_LOAD16_BYTE( "fb2grom6.bin", 0x00001, 0x80000, CRC(1a525dcf) SHA1(20b1b2d6bdb0953300a6d9937b582fd5e20931ed) )
3010
3011   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3012   ROM_LOAD_OPTIONAL( "fb2g18r.id", 0x00, 0x20, CRC(b8fe27b5) SHA1(fdb5fe80e553f92647c023d4718242934bab59b0) )
26443013ROM_END
26453014
26463015ROM_START( fb2genv2 )
r4425r4426
26573026   ROM_REGION( 0x100000, "gfx2", 0 )
26583027   ROM_LOAD16_BYTE( "fb2grom5.bin", 0x00000, 0x80000, CRC(6aa1e45d) SHA1(a821c98513ad851f5f9e2452620feb662c28f8bb) )
26593028   ROM_LOAD16_BYTE( "fb2grom6.bin", 0x00001, 0x80000, CRC(1a525dcf) SHA1(20b1b2d6bdb0953300a6d9937b582fd5e20931ed) )
3029
3030   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3031   ROM_LOAD_OPTIONAL( "fb2g18lt.id", 0x00, 0x20, CRC(8f36bc08) SHA1(53d970cb1a1055c459e64a09f4e495c52aa2ab9f) )
26603032ROM_END
26613033
26623034ROM_START( fb2genv3 )
r4425r4426
26733045   ROM_REGION( 0x100000, "gfx2", 0 )
26743046   ROM_LOAD16_BYTE( "fb2grom5.bin", 0x00000, 0x80000, CRC(6aa1e45d) SHA1(a821c98513ad851f5f9e2452620feb662c28f8bb) )
26753047   ROM_LOAD16_BYTE( "fb2grom6.bin", 0x00001, 0x80000, CRC(1a525dcf) SHA1(20b1b2d6bdb0953300a6d9937b582fd5e20931ed) )
3048
3049   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3050   ROM_LOAD_OPTIONAL( "fb2g18e.id", 0x00, 0x20, CRC(a62d1596) SHA1(a04c248e7441e5c8afe7fc30392fe053734de4ef) )
26763051ROM_END
26773052
26783053ROM_START( fb2gend )
r4425r4426
26893064   ROM_REGION( 0x100000, "gfx2", 0 )
26903065   ROM_LOAD16_BYTE( "fb2grom5.bin", 0x00000, 0x80000, CRC(6aa1e45d) SHA1(a821c98513ad851f5f9e2452620feb662c28f8bb) )
26913066   ROM_LOAD16_BYTE( "fb2grom6.bin", 0x00001, 0x80000, CRC(1a525dcf) SHA1(20b1b2d6bdb0953300a6d9937b582fd5e20931ed) )
3067
3068   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3069   ROM_LOAD_OPTIONAL( "fb2g18r.id", 0x00, 0x20, CRC(b8fe27b5) SHA1(fdb5fe80e553f92647c023d4718242934bab59b0) )
26923070ROM_END
26933071
26943072ROM_START( fb2gend2 )
r4425r4426
27053083   ROM_REGION( 0x100000, "gfx2", 0 )
27063084   ROM_LOAD16_BYTE( "fb2grom5.bin", 0x00000, 0x80000, CRC(6aa1e45d) SHA1(a821c98513ad851f5f9e2452620feb662c28f8bb) )
27073085   ROM_LOAD16_BYTE( "fb2grom6.bin", 0x00001, 0x80000, CRC(1a525dcf) SHA1(20b1b2d6bdb0953300a6d9937b582fd5e20931ed) )
3086
3087   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3088   ROM_LOAD_OPTIONAL( "fb2g18lt.id", 0x00, 0x20, CRC(8f36bc08) SHA1(53d970cb1a1055c459e64a09f4e495c52aa2ab9f) )
27083089ROM_END
27093090
27103091ROM_START( fb2nd )
r4425r4426
27213102   ROM_REGION( 0x100000, "gfx2", 0 )
27223103   ROM_LOAD16_BYTE( "fb2erom5.bin", 0x00000, 0x80000, CRC(1bc55876) SHA1(d04ff7bf97145d45de943129bc9f3cbe27f4588e) )
27233104   ROM_LOAD16_BYTE( "fb2erom6.bin", 0x00001, 0x80000, CRC(71b43f19) SHA1(a0b7f2b1968e6c083f9793f1249edb339422370d) )
3105
3106   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3107   ROM_LOAD_OPTIONAL( "fb2e15r.id", 0x00, 0x20, CRC(1c1db94c) SHA1(3438c43b31640b3d052bc4e740f9056b70a57550) )
27243108ROM_END
27253109
27263110
r4425r4426
27383122   ROM_REGION( 0x100000, "gfx2", 0 )
27393123   ROM_LOAD16_BYTE( "fb2erom5.bin", 0x00000, 0x80000, CRC(1bc55876) SHA1(d04ff7bf97145d45de943129bc9f3cbe27f4588e) )
27403124   ROM_LOAD16_BYTE( "fb2erom6.bin", 0x00001, 0x80000, CRC(71b43f19) SHA1(a0b7f2b1968e6c083f9793f1249edb339422370d) )
3125
3126   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3127   ROM_LOAD_OPTIONAL( "fb2e18r.id", 0x00, 0x20, CRC(bc0bf788) SHA1(d0bb6887e6cf8c18897ce6057743117423bd3035) )
27413128ROM_END
27423129
27433130ROM_START( fb2ndc2 )
r4425r4426
27543141   ROM_REGION( 0x100000, "gfx2", 0 )
27553142   ROM_LOAD16_BYTE( "fb2erom5.bin", 0x00000, 0x80000, CRC(1bc55876) SHA1(d04ff7bf97145d45de943129bc9f3cbe27f4588e) )
27563143   ROM_LOAD16_BYTE( "fb2erom6.bin", 0x00001, 0x80000, CRC(71b43f19) SHA1(a0b7f2b1968e6c083f9793f1249edb339422370d) )
3144
3145   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3146   ROM_LOAD_OPTIONAL( "fb2e18lt.id", 0x00, 0x20, CRC(8bc36c35) SHA1(fddbc8629df06c470a9cd76e609e0f7e5ae23202) )
27573147ROM_END
27583148
27593149ROM_START( fb2ndv )
r4425r4426
27703160   ROM_REGION( 0x100000, "gfx2", 0 )
27713161   ROM_LOAD16_BYTE( "fb2erom5.bin", 0x00000, 0x80000, CRC(1bc55876) SHA1(d04ff7bf97145d45de943129bc9f3cbe27f4588e) )
27723162   ROM_LOAD16_BYTE( "fb2erom6.bin", 0x00001, 0x80000, CRC(71b43f19) SHA1(a0b7f2b1968e6c083f9793f1249edb339422370d) )
3163
3164   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3165   ROM_LOAD_OPTIONAL( "fb2e18r.id", 0x00, 0x20, CRC(bc0bf788) SHA1(d0bb6887e6cf8c18897ce6057743117423bd3035) )
27733166ROM_END
27743167
27753168ROM_START( fb2ndv2 )
r4425r4426
27863179   ROM_REGION( 0x100000, "gfx2", 0 )
27873180   ROM_LOAD16_BYTE( "fb2erom5.bin", 0x00000, 0x80000, CRC(1bc55876) SHA1(d04ff7bf97145d45de943129bc9f3cbe27f4588e) )
27883181   ROM_LOAD16_BYTE( "fb2erom6.bin", 0x00001, 0x80000, CRC(71b43f19) SHA1(a0b7f2b1968e6c083f9793f1249edb339422370d) )
3182
3183   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3184   ROM_LOAD_OPTIONAL( "fb2e18lt.id", 0x00, 0x20, CRC(8bc36c35) SHA1(fddbc8629df06c470a9cd76e609e0f7e5ae23202) )
27893185ROM_END
27903186
27913187ROM_START( fb2ndd )
r4425r4426
28023198   ROM_REGION( 0x100000, "gfx2", 0 )
28033199   ROM_LOAD16_BYTE( "fb2erom5.bin", 0x00000, 0x80000, CRC(1bc55876) SHA1(d04ff7bf97145d45de943129bc9f3cbe27f4588e) )
28043200   ROM_LOAD16_BYTE( "fb2erom6.bin", 0x00001, 0x80000, CRC(71b43f19) SHA1(a0b7f2b1968e6c083f9793f1249edb339422370d) )
3201
3202   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3203   ROM_LOAD_OPTIONAL( "fb2e18r.id", 0x00, 0x20, CRC(bc0bf788) SHA1(d0bb6887e6cf8c18897ce6057743117423bd3035) )
28053204ROM_END
28063205
28073206ROM_START( fb2ndd2 )
r4425r4426
28183217   ROM_REGION( 0x100000, "gfx2", 0 )
28193218   ROM_LOAD16_BYTE( "fb2erom5.bin", 0x00000, 0x80000, CRC(1bc55876) SHA1(d04ff7bf97145d45de943129bc9f3cbe27f4588e) )
28203219   ROM_LOAD16_BYTE( "fb2erom6.bin", 0x00001, 0x80000, CRC(71b43f19) SHA1(a0b7f2b1968e6c083f9793f1249edb339422370d) )
3220
3221   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3222   ROM_LOAD_OPTIONAL( "fb2e18lt.id", 0x00, 0x20, CRC(8bc36c35) SHA1(fddbc8629df06c470a9cd76e609e0f7e5ae23202) )
28213223ROM_END
28223224
28233225ROM_START( fb4 )
r4425r4426
28343236   ROM_REGION( 0x100000, "gfx2", 0 )
28353237   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
28363238   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3239
3240   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3241   ROM_LOAD_OPTIONAL( "fb413xt_.id", 0x00, 0x20, CRC(ecaf2430) SHA1(1e31019cad55d17571f9671d7f150e884b84246c) )
28373242ROM_END
28383243
28393244ROM_START( fb4a )
r4425r4426
28523257   ROM_REGION( 0x100000, "gfx2", 0 )
28533258   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
28543259   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3260
3261   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3262   ROM_LOAD_OPTIONAL( "fb412r_.id", 0x00, 0x20, CRC(cc3c192e) SHA1(cdaa8c78dcea5fee3bc88c0c88f5276f193112a9) )
28553263ROM_END
28563264
28573265ROM_START( fb4b )
r4425r4426
28693277   ROM_REGION( 0x100000, "gfx2", 0 )
28703278   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
28713279   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3280
3281   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3282   ROM_LOAD_OPTIONAL( "fb415lt_.id", 0x00, 0x20, CRC(17385187) SHA1(01e424457b37f79e02124245cf6d502fd54b2265) )
28723283ROM_END
28733284
28743285ROM_START( fb4b2 )
r4425r4426
28873298   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
28883299   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
28893300
3301   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3302   ROM_LOAD_OPTIONAL( "fb415r_.id", 0x00, 0x20, CRC(099b27a0) SHA1(f70e8ade2527b42a6b64382bc3a60a180578fba3) )
28903303ROM_END
28913304
28923305ROM_START( fb4v )
r4425r4426
29053318   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
29063319   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
29073320
3321   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3322   ROM_LOAD_OPTIONAL( "fb415r.id", 0x00, 0x20, CRC(51592891) SHA1(4e1b0e6e88d73a37d025f7a21d6e13c409aed59a) )
29083323ROM_END
29093324
29103325ROM_START( fb4v2 )
r4425r4426
29213336   ROM_REGION( 0x100000, "gfx2", 0 )
29223337   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
29233338   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3339
3340   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3341   ROM_LOAD_OPTIONAL( "fb415lt.id", 0x00, 0x20, CRC(f44d3e8c) SHA1(af462959a37c271c840324d74b2619691fadf8bd) )
29243342ROM_END
29253343
29263344ROM_START( fb4v3 )
r4425r4426
29373355   ROM_REGION( 0x100000, "gfx2", 0 )
29383356   ROM_LOAD16_BYTE( "fb4rom5e.bin", 0x00000, 0x80000, CRC(ddc02e07) SHA1(b1cce95ab09822646c835b066d4510a51633d107) )
29393357   ROM_LOAD16_BYTE( "fb4rom6e.bin", 0x00001, 0x80000, CRC(e3de53a4) SHA1(3168ec7e10eee205655ee259fb5ba7201d7eb711) )
3358
3359   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3360   ROM_LOAD_OPTIONAL( "fb415e.id", 0x00, 0x20, CRC(f1663488) SHA1(93ba94df442d90790cb0eafb6e5db0506ffa8bc5))
29403361ROM_END
29413362
29423363ROM_START( fb4d )
r4425r4426
29543375   ROM_REGION( 0x100000, "gfx2", 0 )
29553376   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
29563377   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3378
3379   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3380   ROM_LOAD_OPTIONAL( "fb415r.id", 0x00, 0x20, CRC(51592891) SHA1(4e1b0e6e88d73a37d025f7a21d6e13c409aed59a) )
29573381ROM_END
29583382
29593383ROM_START( fb4d2 )
r4425r4426
29673391   ROM_LOAD16_BYTE( "fb4rom3.bin", 0x00000, 0x80000, CRC(4176937d) SHA1(dbde944a154f648a86628a8165fa27032115c417) )
29683392   ROM_LOAD16_BYTE( "fb4rom4.bin", 0x00001, 0x80000, CRC(f8c57041) SHA1(ca8f58e89d31563b363a78db89e2711402f3ba80) )
29693393
2970
29713394   ROM_REGION( 0x100000, "gfx2", 0 )
29723395   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
29733396   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3397
3398   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3399   ROM_LOAD_OPTIONAL( "fb415lt.id", 0x00, 0x20, CRC(f44d3e8c) SHA1(af462959a37c271c840324d74b2619691fadf8bd) )
29743400ROM_END
29753401
29763402ROM_START( fb4c )
r4425r4426
29843410   ROM_LOAD16_BYTE( "fb4rom3.bin", 0x00000, 0x80000, CRC(4176937d) SHA1(dbde944a154f648a86628a8165fa27032115c417) )
29853411   ROM_LOAD16_BYTE( "fb4rom4.bin", 0x00001, 0x80000, CRC(f8c57041) SHA1(ca8f58e89d31563b363a78db89e2711402f3ba80) )
29863412
2987
29883413   ROM_REGION( 0x100000, "gfx2", 0 )
29893414   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
29903415   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3416
3417   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3418   ROM_LOAD_OPTIONAL( "fb415r.id", 0x00, 0x20, CRC(51592891) SHA1(4e1b0e6e88d73a37d025f7a21d6e13c409aed59a) )
29913419ROM_END
29923420
29933421ROM_START( fb4c2 )
r4425r4426
30053433   ROM_REGION( 0x100000, "gfx2", 0 )
30063434   ROM_LOAD16_BYTE( "fb4rom5.bin", 0x00000, 0x80000, CRC(41ad506c) SHA1(19086ab859a60e5127af0e51381cbb9fda6de74a) )
30073435   ROM_LOAD16_BYTE( "fb4rom6.bin", 0x00001, 0x80000, CRC(f6c07f3d) SHA1(709fe2a443fdd32a3f9ab9161d5321a01c0119bb) )
3436
3437   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3438   ROM_LOAD_OPTIONAL( "fb415lt.id", 0x00, 0x20, CRC(f44d3e8c) SHA1(af462959a37c271c840324d74b2619691fadf8bd) )
30083439ROM_END
30093440
30103441ROM_START( ch2000 )
r4425r4426
30713502   ROM_REGION( 0x100000, "gfx2", 0 )
30723503   ROM_LOAD16_BYTE( "fbrom5.bin", 0x00000, 0x40000, CRC(494fd1fa) SHA1(01ca60e35b68da398612fc7c8a7da6f8835eabd5) )
30733504   ROM_LOAD16_BYTE( "fbrom6.bin", 0x00001, 0x40000, CRC(0ebe2ea5) SHA1(d83c1ba940e43ce1d392969055f36b3c49ac9727) )
3505
3506   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3507   ROM_LOAD_OPTIONAL( "fb44r_.id", 0x00, 0x20, CRC(5ea37646) SHA1(1bfd7bdceb5831357c622997817e417bb028091d) )
30743508ROM_END
30753509
30763510ROM_START( ch2000b2 )
r4425r4426
30873521   ROM_REGION( 0x100000, "gfx2", 0 )
30883522   ROM_LOAD16_BYTE( "fbrom5.bin", 0x00000, 0x40000, CRC(494fd1fa) SHA1(01ca60e35b68da398612fc7c8a7da6f8835eabd5) )
30893523   ROM_LOAD16_BYTE( "fbrom6.bin", 0x00001, 0x40000, CRC(0ebe2ea5) SHA1(d83c1ba940e43ce1d392969055f36b3c49ac9727) )
3524
3525   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3526   ROM_LOAD_OPTIONAL( "fb41lt_.id", 0x00, 0x20, CRC(9a3c83a5) SHA1(d09931228339ca744567095006ae1c512c462fee) )
30903527ROM_END
30913528
30923529/* v type */
r4425r4426
31043541   ROM_REGION( 0x100000, "gfx2", 0 )
31053542   ROM_LOAD16_BYTE( "fb2rom5.bin", 0x00000, 0x40000, CRC(1dbf0566) SHA1(9b643cf03b543b9d7689daa00b2b06af5bc57c90) )
31063543   ROM_LOAD16_BYTE( "fb2rom6.bin", 0x00001, 0x40000, CRC(a0116b86) SHA1(e2a0abbfbfa531683ea9077cdbed57d965f9c5c2) )
3544
3545   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3546   ROM_LOAD_OPTIONAL( "fb44r.id", 0x00, 0x20, CRC(1867578d) SHA1(47178b153fab7811d26fe49e851244a36182db15) )
31073547ROM_END
31083548
31093549ROM_START( ch2000v2 )
r4425r4426
31203560   ROM_REGION( 0x100000, "gfx2", 0 )
31213561   ROM_LOAD16_BYTE( "fb2rom5.bin", 0x00000, 0x40000, CRC(1dbf0566) SHA1(9b643cf03b543b9d7689daa00b2b06af5bc57c90) )
31223562   ROM_LOAD16_BYTE( "fb2rom6.bin", 0x00001, 0x40000, CRC(a0116b86) SHA1(e2a0abbfbfa531683ea9077cdbed57d965f9c5c2) )
3563
3564   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3565   ROM_LOAD_OPTIONAL( "fb44e.id", 0x00, 0x20, CRC(6c5fd1e6) SHA1(a26901ed4d02dfd374d807b0d7255f73d19ca2b7) )
31233566ROM_END
31243567
31253568ROM_START( ch2000v3 )
r4425r4426
31363579   ROM_REGION( 0x100000, "gfx2", 0 )
31373580   ROM_LOAD16_BYTE( "fb2rom5.bin", 0x00000, 0x40000, CRC(1dbf0566) SHA1(9b643cf03b543b9d7689daa00b2b06af5bc57c90) )
31383581   ROM_LOAD16_BYTE( "fb2rom6.bin", 0x00001, 0x40000, CRC(a0116b86) SHA1(e2a0abbfbfa531683ea9077cdbed57d965f9c5c2) )
3582
3583   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3584   ROM_LOAD_OPTIONAL( "fb41lt.id", 0x00, 0x20, CRC(21a07bba) SHA1(6fd88c243c554684e49667a8d2dc6b16348ae8dd) )
31393585ROM_END
31403586
31413587ROM_START( ch2000c )
r4425r4426
31523598   ROM_REGION( 0x100000, "gfx2", 0 )
31533599   ROM_LOAD16_BYTE( "fb2rom5.bin", 0x00000, 0x40000, CRC(1dbf0566) SHA1(9b643cf03b543b9d7689daa00b2b06af5bc57c90) )
31543600   ROM_LOAD16_BYTE( "fb2rom6.bin", 0x00001, 0x40000, CRC(a0116b86) SHA1(e2a0abbfbfa531683ea9077cdbed57d965f9c5c2) )
3601
3602   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3603   ROM_LOAD_OPTIONAL( "fb41lt.id", 0x00, 0x20, CRC(21a07bba) SHA1(6fd88c243c554684e49667a8d2dc6b16348ae8dd) )
31553604ROM_END
31563605
31573606ROM_START( ch2000c2 )
r4425r4426
31683617   ROM_REGION( 0x100000, "gfx2", 0 )
31693618   ROM_LOAD16_BYTE( "fb2rom5.bin", 0x00000, 0x40000, CRC(1dbf0566) SHA1(9b643cf03b543b9d7689daa00b2b06af5bc57c90) )
31703619   ROM_LOAD16_BYTE( "fb2rom6.bin", 0x00001, 0x40000, CRC(a0116b86) SHA1(e2a0abbfbfa531683ea9077cdbed57d965f9c5c2) )
3620
3621   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3622   ROM_LOAD_OPTIONAL( "fb44r.id", 0x00, 0x20, CRC(1867578d) SHA1(47178b153fab7811d26fe49e851244a36182db15) )
31713623ROM_END
31723624
31733625
r4425r4426
31853637   ROM_REGION( 0x100000, "gfx2", 0 )
31863638   ROM_LOAD16_BYTE( "fb2rom5.bin", 0x00000, 0x40000, CRC(1dbf0566) SHA1(9b643cf03b543b9d7689daa00b2b06af5bc57c90) )
31873639   ROM_LOAD16_BYTE( "fb2rom6.bin", 0x00001, 0x40000, CRC(a0116b86) SHA1(e2a0abbfbfa531683ea9077cdbed57d965f9c5c2) )
3640
3641   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3642   ROM_LOAD_OPTIONAL( "fb41lt.id", 0x00, 0x20, CRC(21a07bba) SHA1(6fd88c243c554684e49667a8d2dc6b16348ae8dd) )
31883643ROM_END
31893644
31903645ROM_START( ch2000d2 )
r4425r4426
32013656   ROM_REGION( 0x100000, "gfx2", 0 )
32023657   ROM_LOAD16_BYTE( "fb2rom5.bin", 0x00000, 0x40000, CRC(1dbf0566) SHA1(9b643cf03b543b9d7689daa00b2b06af5bc57c90) )
32033658   ROM_LOAD16_BYTE( "fb2rom6.bin", 0x00001, 0x40000, CRC(a0116b86) SHA1(e2a0abbfbfa531683ea9077cdbed57d965f9c5c2) )
3659
3660   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3661   ROM_LOAD_OPTIONAL( "fb44r.id", 0x00, 0x20, CRC(1867578d) SHA1(47178b153fab7811d26fe49e851244a36182db15) )
32043662ROM_END
32053663
32063664
r4425r4426
32993757   ROM_REGION( 0x100000, "gfx2", 0 )
33003758   ROM_LOAD16_BYTE( "a2klink5.bin", 0x00000, 0x80000, CRC(7083106a) SHA1(39e7da2ef91dda40b2a9d9b8d50c587d637fda54) )
33013759   ROM_LOAD16_BYTE( "a2klink6.bin", 0x00001, 0x80000, CRC(ba0de415) SHA1(fb4d718b9ad95eaa0ca259605fc1f2916bd1b7b7) )
3760
3761   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3762   ROM_LOAD_OPTIONAL( "a2k35r.id", 0x00, 0x20, CRC(66e3dc03) SHA1(d0be2d0b1c90e0b4b498cb6a3026d07e1946edcf) )
33023763ROM_END
33033764
33043765ROM_START( act2000v2 )
r4425r4426
33153776   ROM_REGION( 0x100000, "gfx2", 0 )
33163777   ROM_LOAD16_BYTE( "a2klink5.bin", 0x00000, 0x80000, CRC(7083106a) SHA1(39e7da2ef91dda40b2a9d9b8d50c587d637fda54) )
33173778   ROM_LOAD16_BYTE( "a2klink6.bin", 0x00001, 0x80000, CRC(ba0de415) SHA1(fb4d718b9ad95eaa0ca259605fc1f2916bd1b7b7) )
3779
3780   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3781   ROM_LOAD_OPTIONAL( "a2k35e.id", 0x00, 0x20, CRC(c6dcc01a) SHA1(745c2450967c28cc9477be1c8563b9b1c279e239) )
33183782ROM_END
33193783
33203784ROM_START( act2000v3 )
r4425r4426
33313795   ROM_REGION( 0x100000, "gfx2", 0 )
33323796   ROM_LOAD16_BYTE( "a2klink5.bin", 0x00000, 0x80000, CRC(7083106a) SHA1(39e7da2ef91dda40b2a9d9b8d50c587d637fda54) )
33333797   ROM_LOAD16_BYTE( "a2klink6.bin", 0x00001, 0x80000, CRC(ba0de415) SHA1(fb4d718b9ad95eaa0ca259605fc1f2916bd1b7b7) )
3798
3799   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3800   ROM_LOAD_OPTIONAL( "a2k33t.id", 0x00, 0x20, CRC(c11a5ee7) SHA1(36615ed41d2537493d18ff8e2b2e801aa71efd23) )
33343801ROM_END
33353802
33363803ROM_START( act2000d )
r4425r4426
33473814   ROM_REGION( 0x100000, "gfx2", 0 )
33483815   ROM_LOAD16_BYTE( "a2klink5.bin", 0x00000, 0x80000, CRC(7083106a) SHA1(39e7da2ef91dda40b2a9d9b8d50c587d637fda54) )
33493816   ROM_LOAD16_BYTE( "a2klink6.bin", 0x00001, 0x80000, CRC(ba0de415) SHA1(fb4d718b9ad95eaa0ca259605fc1f2916bd1b7b7) )
3817
3818   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3819   ROM_LOAD_OPTIONAL( "a2k35r.id", 0x00, 0x20, CRC(66e3dc03) SHA1(d0be2d0b1c90e0b4b498cb6a3026d07e1946edcf) )
33503820ROM_END
33513821
33523822ROM_START( act2000d2 )
r4425r4426
33633833   ROM_REGION( 0x100000, "gfx2", 0 )
33643834   ROM_LOAD16_BYTE( "a2klink5.bin", 0x00000, 0x80000, CRC(7083106a) SHA1(39e7da2ef91dda40b2a9d9b8d50c587d637fda54) )
33653835   ROM_LOAD16_BYTE( "a2klink6.bin", 0x00001, 0x80000, CRC(ba0de415) SHA1(fb4d718b9ad95eaa0ca259605fc1f2916bd1b7b7) )
3836
3837   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3838   ROM_LOAD_OPTIONAL( "a2k33t.id", 0x00, 0x20, CRC(c11a5ee7) SHA1(36615ed41d2537493d18ff8e2b2e801aa71efd23) )
33663839ROM_END
33673840
33683841ROM_START( act2000b )
r4425r4426
33793852   ROM_REGION( 0x100000, "gfx2", 0 )
33803853   ROM_LOAD16_BYTE( "a2klink5.bin", 0x00000, 0x80000, CRC(7083106a) SHA1(39e7da2ef91dda40b2a9d9b8d50c587d637fda54) )
33813854   ROM_LOAD16_BYTE( "a2klink6.bin", 0x00001, 0x80000, CRC(ba0de415) SHA1(fb4d718b9ad95eaa0ca259605fc1f2916bd1b7b7) )
3855
3856   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3857   ROM_LOAD_OPTIONAL( "a2k35r_.id", 0x00, 0x20, CRC(6b54454b) SHA1(f90f4567f63739f6449a48b4a91b3b969ad6d22f) )
33823858ROM_END
33833859
33843860ROM_START( act2000b2 )
r4425r4426
33953871   ROM_REGION( 0x100000, "gfx2", 0 )
33963872   ROM_LOAD16_BYTE( "a2klink5.bin", 0x00000, 0x80000, CRC(7083106a) SHA1(39e7da2ef91dda40b2a9d9b8d50c587d637fda54) )
33973873   ROM_LOAD16_BYTE( "a2klink6.bin", 0x00001, 0x80000, CRC(ba0de415) SHA1(fb4d718b9ad95eaa0ca259605fc1f2916bd1b7b7) )
3874
3875   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3876   ROM_LOAD_OPTIONAL( "a2k33t_.id", 0x00, 0x20, CRC(ecebf1ee) SHA1(8e2aea99bea43467fafb2629dc7551230ec4a6bb) )
33983877ROM_END
33993878
34003879ROM_START( pir2001 )
r4425r4426
34593938   ROM_REGION( 0x100000, "gfx2", 0 )
34603939   ROM_LOAD16_BYTE( "piratrom5.bin", 0x00000, 0x80000, CRC(6d7e502a) SHA1(4910a0bb1e779e04e87eb6cba092f976f85c0f96) )
34613940   ROM_LOAD16_BYTE( "piratrom6.bin", 0x00001, 0x80000, CRC(470ff052) SHA1(b63293e2f244d992e64df085d6565931b982dcd3) )
3941
3942   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3943   ROM_LOAD_OPTIONAL( "pi124xt_.id", 0x00, 0x20,  CRC(bb9624e0) SHA1(8827fabb48d51d88af0822d4e896568a898ca44b) )
34623944ROM_END
34633945
34643946ROM_START( pir2001b3 )
r4425r4426
34753957   ROM_REGION( 0x100000, "gfx2", 0 )
34763958   ROM_LOAD16_BYTE( "piratrom5.bin", 0x00000, 0x80000, CRC(6d7e502a) SHA1(4910a0bb1e779e04e87eb6cba092f976f85c0f96) )
34773959   ROM_LOAD16_BYTE( "piratrom6.bin", 0x00001, 0x80000, CRC(470ff052) SHA1(b63293e2f244d992e64df085d6565931b982dcd3) )
3960
3961   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3962   ROM_LOAD_OPTIONAL( "pi125r_.id", 0x00, 0x20,  CRC(ec11baad) SHA1(4159a99fd732d3a42a1fb14f8cf2e4a7b5836436) )
34783963ROM_END
34793964
34803965ROM_START( pir2001v )
r4425r4426
34913976   ROM_REGION( 0x100000, "gfx2", 0 )
34923977   ROM_LOAD16_BYTE( "piratrom5.bin", 0x00000, 0x80000, CRC(6d7e502a) SHA1(4910a0bb1e779e04e87eb6cba092f976f85c0f96) )
34933978   ROM_LOAD16_BYTE( "piratrom6.bin", 0x00001, 0x80000, CRC(470ff052) SHA1(b63293e2f244d992e64df085d6565931b982dcd3) )
3979
3980   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
3981   ROM_LOAD_OPTIONAL( "pi125r.id", 0x00, 0x20,  CRC(2f0ddeb1) SHA1(0fb0871ee0b059eeedd782ac32d10ab268b00b52) )
34943982ROM_END
34953983
34963984ROM_START( pir2001v2 )
r4425r4426
35073995   ROM_REGION( 0x100000, "gfx2", 0 )
35083996   ROM_LOAD16_BYTE( "piratrom5.bin", 0x00000, 0x80000, CRC(6d7e502a) SHA1(4910a0bb1e779e04e87eb6cba092f976f85c0f96) )
35093997   ROM_LOAD16_BYTE( "piratrom6.bin", 0x00001, 0x80000, CRC(470ff052) SHA1(b63293e2f244d992e64df085d6565931b982dcd3) )
3998
3999   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4000   ROM_LOAD_OPTIONAL( "pi125e.id", 0x00, 0x20,  CRC(339852cb) SHA1(02977f8cbca378f22ff43c299a61b1f1da3c5d50) )
35104001ROM_END
35114002
35124003ROM_START( pir2001v3 )
r4425r4426
35234014   ROM_REGION( 0x100000, "gfx2", 0 )
35244015   ROM_LOAD16_BYTE( "piratrom5.bin", 0x00000, 0x80000, CRC(6d7e502a) SHA1(4910a0bb1e779e04e87eb6cba092f976f85c0f96) )
35254016   ROM_LOAD16_BYTE( "piratrom6.bin", 0x00001, 0x80000, CRC(470ff052) SHA1(b63293e2f244d992e64df085d6565931b982dcd3) )
4017
4018   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4019   ROM_LOAD_OPTIONAL( "pi124xt.id", 0x00, 0x20,  CRC(26f50e35) SHA1(53de077007ae042cf2c1eb2fa7cca06247768dd3) )
35264020ROM_END
35274021
35284022ROM_START( pir2001d )
r4425r4426
35394033   ROM_REGION( 0x100000, "gfx2", 0 )
35404034   ROM_LOAD16_BYTE( "piratrom5.bin", 0x00000, 0x80000, CRC(6d7e502a) SHA1(4910a0bb1e779e04e87eb6cba092f976f85c0f96) )
35414035   ROM_LOAD16_BYTE( "piratrom6.bin", 0x00001, 0x80000, CRC(470ff052) SHA1(b63293e2f244d992e64df085d6565931b982dcd3) )
4036
4037   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4038   ROM_LOAD_OPTIONAL( "pi125r.id", 0x00, 0x20,  CRC(2f0ddeb1) SHA1(0fb0871ee0b059eeedd782ac32d10ab268b00b52) )
35424039ROM_END
35434040
35444041ROM_START( pir2001d2 )
r4425r4426
35554052   ROM_REGION( 0x100000, "gfx2", 0 )
35564053   ROM_LOAD16_BYTE( "piratrom5.bin", 0x00000, 0x80000, CRC(6d7e502a) SHA1(4910a0bb1e779e04e87eb6cba092f976f85c0f96) )
35574054   ROM_LOAD16_BYTE( "piratrom6.bin", 0x00001, 0x80000, CRC(470ff052) SHA1(b63293e2f244d992e64df085d6565931b982dcd3) )
4055
4056   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4057   ROM_LOAD_OPTIONAL( "pi124xt.id", 0x00, 0x20,  CRC(26f50e35) SHA1(53de077007ae042cf2c1eb2fa7cca06247768dd3) )
35584058ROM_END
35594059
35604060ROM_START( pir2002 )
r4425r4426
36034103   ROM_REGION( 0x100000, "gfx2", 0 )
36044104   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
36054105   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
3606ROM_END
4106   ROM_END
36074107
36084108/* these had the pir2001 sound rom in, mistake? */
36094109ROM_START( pir2002b2 )
r4425r4426
36204120   ROM_REGION( 0x100000, "gfx2", 0 )
36214121   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
36224122   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
4123
4124   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4125   ROM_LOAD_OPTIONAL( "pi219xt_.id", 0x00, 0x20, CRC(7babba9f) SHA1(0ec0453d1368669d1829edd84123c871958a4fce) )
36234126ROM_END
36244127
36254128ROM_START( pir2002b3 )
r4425r4426
36364139   ROM_REGION( 0x100000, "gfx2", 0 )
36374140   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
36384141   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
4142
4143   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4144   ROM_LOAD_OPTIONAL( "pi220r_.id", 0x00, 0x20, CRC(57eb901d) SHA1(a4815a043f7ce3c8bfd3c3a572ca3e561d69ab91) )
36394145ROM_END
36404146
36414147ROM_START( pir2002v )
r4425r4426
36454151   ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */
36464152   ROM_LOAD( "pirom2.bin", 0x00000, 0x20000, CRC(eeb92009) SHA1(e6c69437a7fd0f9fae375bf0b6dcfd6226823cf2) )
36474153
3648
3649
36504154   ROM_REGION( 0x100000, "gfx1", 0 )
36514155   ROM_LOAD16_BYTE( "pirom3.bin", 0x00000, 0x80000, CRC(ad175fea) SHA1(07585fcb0d4828fb2b99bebfe583e54a835636ed) )
36524156   ROM_LOAD16_BYTE( "pirom4.bin", 0x00001, 0x80000, CRC(a94061ec) SHA1(2c3b37a1144a873f0b4b884cbeb938947270f5a3) )
r4425r4426
36544158   ROM_REGION( 0x100000, "gfx2", 0 )
36554159   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
36564160   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
4161
4162   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4163   ROM_LOAD_OPTIONAL( "pi220r.id", 0x00, 0x20, CRC(e4d79717) SHA1(fdcdd28a71293739a02dd958648300656a743567) )
36574164ROM_END
36584165
36594166ROM_START( pir2002v2 )
r4425r4426
36704177   ROM_REGION( 0x100000, "gfx2", 0 )
36714178   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
36724179   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
4180
4181   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4182   ROM_LOAD_OPTIONAL( "pi220e.id", 0x00, 0x20, CRC(f8421b6d) SHA1(73ff95f558b93a661f2d6f15e0258a3698dc668e) )
36734183ROM_END
36744184
36754185ROM_START( pir2002v3 )
r4425r4426
36864196   ROM_REGION( 0x100000, "gfx2", 0 )
36874197   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
36884198   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
4199
4200   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4201   ROM_LOAD_OPTIONAL( "pi219xt.id", 0x00, 0x20, CRC(e74d3531) SHA1(2a5df88c502ad85451796cdb3255e037e76470bd) )
36894202ROM_END
36904203
36914204ROM_START( pir2002d )
36924205   ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */
36934206   ROM_LOAD( "pi2d20r.bin", 0x00000, 0x40000,  CRC(83a264c4) SHA1(7de1902f5b63d6c44df5726c450ff21b5d911ec4) )
36944207
3695
36964208   ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */
36974209   ROM_LOAD( "pirom2.bin", 0x00000, 0x20000, CRC(eeb92009) SHA1(e6c69437a7fd0f9fae375bf0b6dcfd6226823cf2) )
36984210
r4425r4426
37034215   ROM_REGION( 0x100000, "gfx2", 0 )
37044216   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
37054217   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
4218
4219   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4220   ROM_LOAD_OPTIONAL( "pi220r.id", 0x00, 0x20, CRC(e4d79717) SHA1(fdcdd28a71293739a02dd958648300656a743567) )
37064221ROM_END
37074222
37084223ROM_START( pir2002d2 )
r4425r4426
37194234   ROM_REGION( 0x100000, "gfx2", 0 )
37204235   ROM_LOAD16_BYTE( "pirom5.bin", 0x00000, 0x80000, CRC(c3ccb77b) SHA1(39ab58e2e55a7fabed0a0c8e5777b9be10ae67ae) )
37214236   ROM_LOAD16_BYTE( "pirom6.bin", 0x00001, 0x80000, CRC(c64bc2e5) SHA1(cfb231aa47d6e57481c24a4ba9d8623ed0fca58e) )
4237
4238   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4239   ROM_LOAD_OPTIONAL( "pi219xt.id", 0x00, 0x20, CRC(e74d3531) SHA1(2a5df88c502ad85451796cdb3255e037e76470bd) )
37224240ROM_END
37234241
37244242ROM_START( classice )
r4425r4426
37354253   ROM_REGION( 0x100000, "gfx2", 0 )
37364254   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
37374255   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4256
4257   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4258   ROM_LOAD_OPTIONAL( "fcs16lt.id", 0x00, 0x20,  CRC(9888f6bb) SHA1(638dbb61a26743159e012bca906206eae0ba1d66) )
37384259ROM_END
37394260
37404261ROM_START( classicea )
r4425r4426
37514272   ROM_REGION( 0x100000, "gfx2", 0 )
37524273   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
37534274   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4275
4276   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4277   ROM_LOAD_OPTIONAL( "fcs16r.id", 0x00, 0x20,  CRC(3d9ce0a6) SHA1(c1a9a0c26ab3b7faaf7734db6ffe5754f9d8eac1) )
37544278ROM_END
37554279
37564280ROM_START( classiced )
r4425r4426
37674291   ROM_REGION( 0x100000, "gfx2", 0 )
37684292   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
37694293   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4294
4295   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4296   ROM_LOAD_OPTIONAL( "fcs16r.id", 0x00, 0x20,  CRC(3d9ce0a6) SHA1(c1a9a0c26ab3b7faaf7734db6ffe5754f9d8eac1) )
37704297ROM_END
37714298
37724299ROM_START( classiced2 )
r4425r4426
37834310   ROM_REGION( 0x100000, "gfx2", 0 )
37844311   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
37854312   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4313
4314   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4315   ROM_LOAD_OPTIONAL( "fcs16lt.id", 0x00, 0x20,  CRC(9888f6bb) SHA1(638dbb61a26743159e012bca906206eae0ba1d66) )
37864316ROM_END
37874317
37884318ROM_START( classiced3 )
r4425r4426
37994329   ROM_REGION( 0x100000, "gfx2", 0 )
38004330   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
38014331   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4332
4333   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4334   ROM_LOAD_OPTIONAL( "fcs16e.id", 0x00, 0x20,  CRC(9da3fcbf) SHA1(541d63dbe539718727eb8cb637bc02f824f0c264) )
38024335ROM_END
38034336
38044337ROM_START( classicev )
r4425r4426
38154348   ROM_REGION( 0x100000, "gfx2", 0 )
38164349   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
38174350   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4351
4352   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4353   ROM_LOAD_OPTIONAL( "fcs16r.id", 0x00, 0x20,  CRC(3d9ce0a6) SHA1(c1a9a0c26ab3b7faaf7734db6ffe5754f9d8eac1) )
38184354ROM_END
38194355
38204356ROM_START( classicev2 )
r4425r4426
38314367   ROM_REGION( 0x100000, "gfx2", 0 )
38324368   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
38334369   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4370
4371   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4372   ROM_LOAD_OPTIONAL( "fcs16lt.id", 0x00, 0x20,  CRC(9888f6bb) SHA1(638dbb61a26743159e012bca906206eae0ba1d66) )
38344373ROM_END
38354374
38364375ROM_START( classicev3 )
r4425r4426
38474386   ROM_REGION( 0x100000, "gfx2", 0 )
38484387   ROM_LOAD16_BYTE( "fcsrom5.bin", 0x00000, 0x40000, CRC(fb827363) SHA1(ff9630e8be8facbff040f8a23bf5ff66c62609df) )
38494388   ROM_LOAD16_BYTE( "fcsrom6.bin", 0x00001, 0x40000, CRC(9ec17dcd) SHA1(c1aefb7711feac1e9642eecbd41a1782d30bf7fa) )
4389
4390   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4391   ROM_LOAD_OPTIONAL( "fcs16e.id", 0x00, 0x20,  CRC(9da3fcbf) SHA1(541d63dbe539718727eb8cb637bc02f824f0c264) )
38504392ROM_END
38514393
38524394ROM_START( seawld )
38534395   ROM_REGION( 0x80000, "maincpu", 0 ) /* Z80 Code */
38544396   ROM_LOAD( "swd16r.bin", 0x00000, 0x80000, CRC(081c84c1) SHA1(5f0d40c38ca26d3633cfe4c7ead2773a1dcc177d) )
38554397
3856   ROM_REGION( 0x010000, "debugram", ROMREGION_ERASE00 ) /* DEBUG */
3857
3858
38594398   ROM_REGION( 0x040000, "oki", ROMREGION_ERASE00 ) /* Samples */
38604399   ROM_LOAD( "swrom2.bin", 0x00000, 0x40000, CRC(e1afe0ad) SHA1(097233255b486944b79a8504b4312173ab1aad06) )
38614400
r4425r4426
38664405   ROM_REGION( 0x100000, "gfx2", 0 )
38674406   ROM_LOAD16_BYTE( "swrom5.bin", 0x00000, 0x80000, CRC(cd6aa69f) SHA1(abcbda547b0c6f4a03ed3500f55ff32bc23bedeb) )
38684407   ROM_LOAD16_BYTE( "swrom6.bin", 0x00001, 0x80000, CRC(5c9a4847) SHA1(f19aca69f42282e3e88e50e2b4fe05cde990a3e6) )
4408
4409   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4410   ROM_LOAD_OPTIONAL( "sw16r.id", 0x00, 0x20, CRC(c582917f) SHA1(8a1bae27a54d3efa8014229f0bbe0c3d4f2d25c1) )
38694411ROM_END
38704412
38714413ROM_START( seawlda )
r4425r4426
38824424   ROM_REGION( 0x100000, "gfx2", 0 )
38834425   ROM_LOAD16_BYTE( "swrom5.bin", 0x00000, 0x80000, CRC(cd6aa69f) SHA1(abcbda547b0c6f4a03ed3500f55ff32bc23bedeb) )
38844426   ROM_LOAD16_BYTE( "swrom6.bin", 0x00001, 0x80000, CRC(5c9a4847) SHA1(f19aca69f42282e3e88e50e2b4fe05cde990a3e6) )
4427
4428   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4429   ROM_LOAD_OPTIONAL( "sw16ex.id", 0x00, 0x20,  CRC(48e315f1) SHA1(21a54386aaad3a37b2db18e7bbd159d289c99ddd) )
38854430ROM_END
38864431
38874432
r4425r4426
38994444   ROM_REGION( 0x100000, "gfx2", 0 )
39004445   ROM_LOAD16_BYTE( "mmrom5.bin", 0x00000, 0x80000, CRC(7009308d) SHA1(8c09bfa025ae5cdab5c488af9cf1747da5d1ac67) )
39014446   ROM_LOAD16_BYTE( "mmrom6.bin", 0x00001, 0x80000, CRC(828dde28) SHA1(3024d5d449acce1f78254053866f3aa8d36aff53) )
4447
4448   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4449   ROM_LOAD_OPTIONAL( "mm17rx.id", 0x00, 0x20,  CRC(1a677994) SHA1(b351ce6a1cae30000d0c3c8bf5eade8ba560524d) )
39024450ROM_END
39034451
39044452ROM_START( moneymacv )
r4425r4426
39154463   ROM_REGION( 0x100000, "gfx2", 0 )
39164464   ROM_LOAD16_BYTE( "mmrom5.bin", 0x00000, 0x80000, CRC(7009308d) SHA1(8c09bfa025ae5cdab5c488af9cf1747da5d1ac67) )
39174465   ROM_LOAD16_BYTE( "mmrom6.bin", 0x00001, 0x80000, CRC(828dde28) SHA1(3024d5d449acce1f78254053866f3aa8d36aff53) )
4466
4467   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4468   ROM_LOAD_OPTIONAL( "mm17ex.id", 0x00, 0x20,  CRC(6e5fffff) SHA1(dbabb86903be2b0a0588041cccc5545142587f69) )
39184469ROM_END
39194470
39204471ROM_START( moneymacv2 )
r4425r4426
39314482   ROM_REGION( 0x100000, "gfx2", 0 )
39324483   ROM_LOAD16_BYTE( "mmrom5.bin", 0x00000, 0x80000, CRC(7009308d) SHA1(8c09bfa025ae5cdab5c488af9cf1747da5d1ac67) )
39334484   ROM_LOAD16_BYTE( "mmrom6.bin", 0x00001, 0x80000, CRC(828dde28) SHA1(3024d5d449acce1f78254053866f3aa8d36aff53) )
4485
4486   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4487   ROM_LOAD_OPTIONAL( "mm17lt.id", 0x00, 0x20,  CRC(b6b08ea0) SHA1(a56c7648424ca4dd0d405059f07af6f7cee0111a) )
39344488ROM_END
39354489
39364490ROM_START( moneymacd )
r4425r4426
39474501   ROM_REGION( 0x100000, "gfx2", 0 )
39484502   ROM_LOAD16_BYTE( "mmrom5.bin", 0x00000, 0x80000, CRC(7009308d) SHA1(8c09bfa025ae5cdab5c488af9cf1747da5d1ac67) )
39494503   ROM_LOAD16_BYTE( "mmrom6.bin", 0x00001, 0x80000, CRC(828dde28) SHA1(3024d5d449acce1f78254053866f3aa8d36aff53) )
4504
4505   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4506   ROM_LOAD_OPTIONAL( "mm17rx.id", 0x00, 0x20,  CRC(1a677994) SHA1(b351ce6a1cae30000d0c3c8bf5eade8ba560524d) )
39504507ROM_END
39514508
39524509ROM_START( moneymacd2 )
r4425r4426
39634520   ROM_REGION( 0x100000, "gfx2", 0 )
39644521   ROM_LOAD16_BYTE( "mmrom5.bin", 0x00000, 0x80000, CRC(7009308d) SHA1(8c09bfa025ae5cdab5c488af9cf1747da5d1ac67) )
39654522   ROM_LOAD16_BYTE( "mmrom6.bin", 0x00001, 0x80000, CRC(828dde28) SHA1(3024d5d449acce1f78254053866f3aa8d36aff53) )
4523
4524   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4525   ROM_LOAD_OPTIONAL( "mm17lt.id", 0x00, 0x20,  CRC(b6b08ea0) SHA1(a56c7648424ca4dd0d405059f07af6f7cee0111a) )
39664526ROM_END
39674527
39684528
r4425r4426
39804540   ROM_REGION( 0x100000, "gfx2", 0 )
39814541   ROM_LOAD16_BYTE( "aw_rom5.bin", 0x00000, 0x80000, CRC(c461c4d5) SHA1(2815511f8ae9b74c44aa9987eebf1a14642b4458) )
39824542   ROM_LOAD16_BYTE( "aw_rom6.bin", 0x00001, 0x80000, CRC(686c9f2d) SHA1(94da22c775292020aa00c8f12f833a7f5c70ec36) )
4543
4544   ROM_REGION( 0x1000, "defaults", 0 ) /* default settings */
4545   ROM_LOAD_OPTIONAL( "aw13re.id", 0x00, 0x1000,  CRC(0f9991fb) SHA1(5ea9e49c6b8b00c2c3638cc39e479d6e5e112b7a) )
39834546ROM_END
39844547
39854548ROM_START( atworlda )
r4425r4426
39964559   ROM_REGION( 0x100000, "gfx2", 0 )
39974560   ROM_LOAD16_BYTE( "aw_rom5.bin", 0x00000, 0x80000, CRC(c461c4d5) SHA1(2815511f8ae9b74c44aa9987eebf1a14642b4458) )
39984561   ROM_LOAD16_BYTE( "aw_rom6.bin", 0x00001, 0x80000, CRC(686c9f2d) SHA1(94da22c775292020aa00c8f12f833a7f5c70ec36) )
4562
4563   ROM_REGION( 0x1000, "defaults", 0 ) /* default settings */
4564   ROM_LOAD_OPTIONAL( "aw13ex.id", 0x00, 0x1000, CRC(c26305c9) SHA1(ee3aea8926ee4890d45896cf0be175c2262c7341) )
39994565ROM_END
40004566
40014567#if 1 // incomplete / mixed sets etc. sort these first before doing anything else with them
r4425r4426
40134579   ROM_REGION( 0x100000, "gfx2", 0 )
40144580   ROM_LOAD16_BYTE( "fb5rom5.bin", 0x00000, 0x80000, CRC(f358df3e) SHA1(a82980ee04160e0ec541e114c198944b2802d0ff) )
40154581   ROM_LOAD16_BYTE( "fb5rom6.bin", 0x00001, 0x80000, CRC(7fba66f3) SHA1(7889394940db76172e1e78be852b0362197cbd8b) )
4582
4583   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4584   ROM_LOAD_OPTIONAL( "fb515sh_.id", 0x00, 0x20, CRC(8447a3b7) SHA1(8afb0154b60012d15b0296b395508946adc5ceb0) )
40164585ROM_END
40174586
40184587ROM_START( fb5c )
r4425r4426
40294598   ROM_REGION( 0x100000, "gfx2", 0 )
40304599   ROM_LOAD16_BYTE( "fb5rom5.bin", 0x00000, 0x80000, CRC(f358df3e) SHA1(a82980ee04160e0ec541e114c198944b2802d0ff) )
40314600   ROM_LOAD16_BYTE( "fb5rom6.bin", 0x00001, 0x80000, CRC(7fba66f3) SHA1(7889394940db76172e1e78be852b0362197cbd8b) )
4601
4602   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4603   ROM_LOAD_OPTIONAL( "fb515sh.id", 0x00, 0x20, CRC(d20771d2) SHA1(6a61d89d1c583c587106003849091a6c4f8b0faf) )
40324604ROM_END
40334605
40344606ROM_START( fb5d )
r4425r4426
40454617   ROM_REGION( 0x100000, "gfx2", 0 )
40464618   ROM_LOAD16_BYTE( "fb5rom5.bin", 0x00000, 0x80000, CRC(f358df3e) SHA1(a82980ee04160e0ec541e114c198944b2802d0ff) )
40474619   ROM_LOAD16_BYTE( "fb5rom6.bin", 0x00001, 0x80000, CRC(7fba66f3) SHA1(7889394940db76172e1e78be852b0362197cbd8b) )
4620
4621   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4622   ROM_LOAD_OPTIONAL( "fb515sh.id", 0x00, 0x20, CRC(d20771d2) SHA1(6a61d89d1c583c587106003849091a6c4f8b0faf) )
40484623ROM_END
40494624
40504625ROM_START( fb5v )
r4425r4426
40614636   ROM_REGION( 0x100000, "gfx2", 0 )
40624637   ROM_LOAD16_BYTE( "fb5rom5.bin", 0x00000, 0x80000, CRC(f358df3e) SHA1(a82980ee04160e0ec541e114c198944b2802d0ff) )
40634638   ROM_LOAD16_BYTE( "fb5rom6.bin", 0x00001, 0x80000, CRC(7fba66f3) SHA1(7889394940db76172e1e78be852b0362197cbd8b) )
4639
4640   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4641   ROM_LOAD_OPTIONAL( "fb515sh.id", 0x00, 0x20, CRC(d20771d2) SHA1(6a61d89d1c583c587106003849091a6c4f8b0faf) )
40644642ROM_END
40654643
40664644
r4425r4426
40784656   ROM_REGION( 0x100000, "gfx2", 0 )
40794657   ROM_LOAD16_BYTE( "fb06rom5.bin", 0x00000, 0x80000, CRC(97b80b5d) SHA1(871a3f90b6bc6c0b0aa2d1b863149bd17c8403bc) )
40804658   ROM_LOAD16_BYTE( "fb06rom6.bin", 0x00001, 0x80000, CRC(94f66c23) SHA1(c08ff1ffaf75621ab28cd7b7f43d3744614cd5c3) )
4659
4660   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4661   ROM_LOAD_OPTIONAL( "fb617ex.id", 0x00, 0x20, CRC(0c5e0598) SHA1(978eb1924b6fd68798eb48f0a78eeb56ecd476f3) )
40814662ROM_END
40824663
40834664ROM_START( fb6d )
r4425r4426
40944675   ROM_REGION( 0x100000, "gfx2", 0 )
40954676   ROM_LOAD16_BYTE( "fb06rom5.bin", 0x00000, 0x80000, CRC(97b80b5d) SHA1(871a3f90b6bc6c0b0aa2d1b863149bd17c8403bc) )
40964677   ROM_LOAD16_BYTE( "fb06rom6.bin", 0x00001, 0x80000, CRC(94f66c23) SHA1(c08ff1ffaf75621ab28cd7b7f43d3744614cd5c3) )
4678
4679   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4680   ROM_LOAD_OPTIONAL( "fb617lt.id", 0x00, 0x20, CRC(9903b0a6) SHA1(840873524b1cc33539926655ef94d23f6b219f76) )
40974681ROM_END
40984682
40994683ROM_START( fb6d2 )
r4425r4426
41104694   ROM_REGION( 0x100000, "gfx2", 0 )
41114695   ROM_LOAD16_BYTE( "fb06rom5.bin", 0x00000, 0x80000, CRC(97b80b5d) SHA1(871a3f90b6bc6c0b0aa2d1b863149bd17c8403bc) )
41124696   ROM_LOAD16_BYTE( "fb06rom6.bin", 0x00001, 0x80000, CRC(94f66c23) SHA1(c08ff1ffaf75621ab28cd7b7f43d3744614cd5c3) )
4697
4698   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4699   ROM_LOAD_OPTIONAL( "fb617re.id", 0x00, 0x20, CRC(132908c4) SHA1(4e4c58327a181c511c8144349432a178936a997f) )
41134700ROM_END
41144701
41154702
r4425r4426
41274714   ROM_REGION( 0x100000, "gfx2", 0 )
41284715   ROM_LOAD16_BYTE( "fb06rom5.bin", 0x00000, 0x80000, CRC(97b80b5d) SHA1(871a3f90b6bc6c0b0aa2d1b863149bd17c8403bc) )
41294716   ROM_LOAD16_BYTE( "fb06rom6.bin", 0x00001, 0x80000, CRC(94f66c23) SHA1(c08ff1ffaf75621ab28cd7b7f43d3744614cd5c3) )
4717
4718   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4719   ROM_LOAD_OPTIONAL( "fb617re.id", 0x00, 0x20, CRC(132908c4) SHA1(4e4c58327a181c511c8144349432a178936a997f) )
41304720ROM_END
41314721
41324722ROM_START( fb6v2 )
r4425r4426
41434733   ROM_REGION( 0x100000, "gfx2", 0 )
41444734   ROM_LOAD16_BYTE( "fb06rom5.bin", 0x00000, 0x80000, CRC(97b80b5d) SHA1(871a3f90b6bc6c0b0aa2d1b863149bd17c8403bc) )
41454735   ROM_LOAD16_BYTE( "fb06rom6.bin", 0x00001, 0x80000, CRC(94f66c23) SHA1(c08ff1ffaf75621ab28cd7b7f43d3744614cd5c3) )
4736
4737   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4738   ROM_LOAD_OPTIONAL( "fb617lt.id", 0x00, 0x20, CRC(9903b0a6) SHA1(840873524b1cc33539926655ef94d23f6b219f76) )
41464739ROM_END
41474740
41484741ROM_START( fb6v3 )
r4425r4426
41594752   ROM_REGION( 0x100000, "gfx2", 0 )
41604753   ROM_LOAD16_BYTE( "fb06rom5.bin", 0x00000, 0x80000, CRC(97b80b5d) SHA1(871a3f90b6bc6c0b0aa2d1b863149bd17c8403bc) )
41614754   ROM_LOAD16_BYTE( "fb06rom6.bin", 0x00001, 0x80000, CRC(94f66c23) SHA1(c08ff1ffaf75621ab28cd7b7f43d3744614cd5c3) )
4755
4756   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4757   ROM_LOAD_OPTIONAL( "fb617ex.id", 0x00, 0x20, CRC(0c5e0598) SHA1(978eb1924b6fd68798eb48f0a78eeb56ecd476f3) )
41624758ROM_END
41634759
41644760ROM_START( fb6s )
r4425r4426
41784774   /* these should be different */
41794775   ROM_LOAD16_BYTE( "fb06rom5_s.bin", 0x00000, 0x80000, NO_DUMP )
41804776   ROM_LOAD16_BYTE( "fb06rom6_s.bin", 0x00001, 0x80000, NO_DUMP )
4777
4778   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4779   ROM_LOAD_OPTIONAL( "fb617re.id", 0x00, 0x20, CRC(132908c4) SHA1(4e4c58327a181c511c8144349432a178936a997f) )
41814780ROM_END
41824781
41834782ROM_START( fb6s2 )
r4425r4426
41974796   /* these should be different */
41984797   ROM_LOAD16_BYTE( "fb06rom5_s.bin", 0x00000, 0x80000, NO_DUMP )
41994798   ROM_LOAD16_BYTE( "fb06rom6_s.bin", 0x00001, 0x80000, NO_DUMP )
4799
4800   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4801   ROM_LOAD_OPTIONAL( "fb617lt.id", 0x00, 0x20, CRC(9903b0a6) SHA1(840873524b1cc33539926655ef94d23f6b219f76) )
42004802ROM_END
42014803
42024804/* Special Edition */
r4425r4426
42154817   ROM_REGION( 0x100000, "gfx2", 0 )
42164818   ROM_LOAD16_BYTE( "se06rom5.bin", 0x00000, 0x80000, CRC(d7530334) SHA1(faa336f2d4a32006c2854a34fb365e89e86660ce) )
42174819   ROM_LOAD16_BYTE( "se06rom6.bin", 0x00001, 0x80000, CRC(19f5873f) SHA1(c74a8b19faa754c77a50545a543e2b3069372046) )
4820
4821   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4822   ROM_LOAD_OPTIONAL( "fb6se14re.id", 0x00, 0x20, CRC(7261f79e) SHA1(ef66734cda8117d77cdd52e3079d472504010ead) )
42184823ROM_END
42194824
42204825ROM_START( fb6sed )
r4425r4426
42314836   ROM_REGION( 0x100000, "gfx2", 0 )
42324837   ROM_LOAD16_BYTE( "se06rom5.bin", 0x00000, 0x80000, CRC(d7530334) SHA1(faa336f2d4a32006c2854a34fb365e89e86660ce) )
42334838   ROM_LOAD16_BYTE( "se06rom6.bin", 0x00001, 0x80000, CRC(19f5873f) SHA1(c74a8b19faa754c77a50545a543e2b3069372046) )
4839
4840   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4841   ROM_LOAD_OPTIONAL( "fb6se14lt.id", 0x00, 0x20, CRC(8d72c5a4) SHA1(51d874c14f4fcb5e0f72cbc0bef053170bdc5ee5) )
42344842ROM_END
42354843
42364844ROM_START( fb6sed2 )
r4425r4426
42474855   ROM_REGION( 0x100000, "gfx2", 0 )
42484856   ROM_LOAD16_BYTE( "se06rom5.bin", 0x00000, 0x80000, CRC(d7530334) SHA1(faa336f2d4a32006c2854a34fb365e89e86660ce) )
42494857   ROM_LOAD16_BYTE( "se06rom6.bin", 0x00001, 0x80000, CRC(19f5873f) SHA1(c74a8b19faa754c77a50545a543e2b3069372046) )
4858
4859   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4860   ROM_LOAD_OPTIONAL( "fb6se14ex.id", 0x00, 0x20, CRC(188a49fb) SHA1(d94a238f34ff28c254a505adf49535871fd6e52f) )
42504861ROM_END
42514862
42524863ROM_START( fb6sev )
r4425r4426
42634874   ROM_REGION( 0x100000, "gfx2", 0 )
42644875   ROM_LOAD16_BYTE( "se06rom5.bin", 0x00000, 0x80000, CRC(d7530334) SHA1(faa336f2d4a32006c2854a34fb365e89e86660ce) )
42654876   ROM_LOAD16_BYTE( "se06rom6.bin", 0x00001, 0x80000, CRC(19f5873f) SHA1(c74a8b19faa754c77a50545a543e2b3069372046) )
4877
4878   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4879   ROM_LOAD_OPTIONAL( "fb6se14re.id", 0x00, 0x20, CRC(7261f79e) SHA1(ef66734cda8117d77cdd52e3079d472504010ead) )
42664880ROM_END
42674881
42684882ROM_START( fb6sev2 )
r4425r4426
42794893   ROM_REGION( 0x100000, "gfx2", 0 )
42804894   ROM_LOAD16_BYTE( "se06rom5.bin", 0x00000, 0x80000, CRC(d7530334) SHA1(faa336f2d4a32006c2854a34fb365e89e86660ce) )
42814895   ROM_LOAD16_BYTE( "se06rom6.bin", 0x00001, 0x80000, CRC(19f5873f) SHA1(c74a8b19faa754c77a50545a543e2b3069372046) )
4896
4897   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4898   ROM_LOAD_OPTIONAL( "fb6se14lt.id", 0x00, 0x20, CRC(8d72c5a4) SHA1(51d874c14f4fcb5e0f72cbc0bef053170bdc5ee5) )
42824899ROM_END
42834900
42844901ROM_START( fb6sev3 )
r4425r4426
42954912   ROM_REGION( 0x100000, "gfx2", 0 )
42964913   ROM_LOAD16_BYTE( "se06rom5.bin", 0x00000, 0x80000, CRC(d7530334) SHA1(faa336f2d4a32006c2854a34fb365e89e86660ce) )
42974914   ROM_LOAD16_BYTE( "se06rom6.bin", 0x00001, 0x80000, CRC(19f5873f) SHA1(c74a8b19faa754c77a50545a543e2b3069372046) )
4915
4916   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4917   ROM_LOAD_OPTIONAL( "fb6se14ex.id", 0x00, 0x20, CRC(188a49fb) SHA1(d94a238f34ff28c254a505adf49535871fd6e52f) )
42984918ROM_END
42994919
43004920ROM_START( version4 )
r4425r4426
43114931   ROM_REGION( 0x100000, "gfx2", 0 )
43124932   ROM_LOAD16_BYTE( "96rom5.bin", 0x00000, 0x40000, NO_DUMP )
43134933   ROM_LOAD16_BYTE( "96rom6.bin", 0x00001, 0x40000, NO_DUMP )
4934
4935   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4936   ROM_LOAD_OPTIONAL( "fcs40r1.id", 0x00, 0x20, CRC(b3638cdb) SHA1(283824c57f3f62f6e2b505f6e13b100a7d7f33af) )
43144937ROM_END
43154938
43164939ROM_START( bugfever )
r4425r4426
43274950   ROM_REGION( 0x100000, "gfx2", 0 )
43284951   ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP )
43294952   ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP )
4953
4954   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4955   ROM_LOAD_OPTIONAL( "bf17re.id", 0x00, 0x20, CRC(a482948d) SHA1(62b802e4906ebb00b2584bb0562a64e9a30aa6ed) )
43304956ROM_END
43314957
43324958ROM_START( bugfeverd )
r4425r4426
43434969   ROM_REGION( 0x100000, "gfx2", 0 )
43444970   ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP )
43454971   ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP )
4972
4973   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4974   ROM_LOAD_OPTIONAL( "bf17ex.id", 0x00, 0x20, CRC(38bd8ec4) SHA1(4e6b85348f2fa821934f7666f77ba0f016e200ec) )
43464975ROM_END
43474976
43484977ROM_START( bugfeverv )
r4425r4426
43594988   ROM_REGION( 0x100000, "gfx2", 0 )
43604989   ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP )
43614990   ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP )
4991
4992   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
4993   ROM_LOAD_OPTIONAL( "bf17re.id", 0x00, 0x20, CRC(a482948d) SHA1(62b802e4906ebb00b2584bb0562a64e9a30aa6ed) )
43624994ROM_END
43634995
43644996ROM_START( bugfeverv2 )
r4425r4426
43755007   ROM_REGION( 0x100000, "gfx2", 0 )
43765008   ROM_LOAD16_BYTE( "bfrom5.bin", 0x00000, 0x80000, NO_DUMP )
43775009   ROM_LOAD16_BYTE( "bfrom6.bin", 0x00001, 0x80000, NO_DUMP )
5010
5011   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
5012   ROM_LOAD_OPTIONAL( "bf17ex.id", 0x00, 0x20, CRC(38bd8ec4) SHA1(4e6b85348f2fa821934f7666f77ba0f016e200ec) )
43785013ROM_END
43795014
43805015ROM_START( dvisland )
r4425r4426
43915026   ROM_REGION( 0x100000, "gfx2", 0 )
43925027   ROM_LOAD16_BYTE( "dirom5.bin", 0x00000, 0x80000, NO_DUMP )
43935028   ROM_LOAD16_BYTE( "dirom6.bin", 0x00001, 0x80000, NO_DUMP )
5029
5030   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
5031   ROM_LOAD_OPTIONAL( "di24re.id", 0x00, 0x20, CRC(d69c8ee5) SHA1(122c196fe03817b5c507339c7c64d6ee7ae12bad) )
43945032ROM_END
43955033
43965034ROM_START( funriver )
r4425r4426
44075045   ROM_REGION( 0x100000, "gfx2", 0 )
44085046   ROM_LOAD16_BYTE( "frrom5.bin", 0x00000, 0x80000, NO_DUMP )
44095047   ROM_LOAD16_BYTE( "frrom6.bin", 0x00001, 0x80000, NO_DUMP )
5048
5049   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
5050   ROM_LOAD_OPTIONAL( "fr14r.id", 0x00, 0x20, CRC(1542e2bc) SHA1(56e615866d451abd2d6c2d689a85bdca447c2538) )
44105051ROM_END
44115052
44125053ROM_START( funriverv )
r4425r4426
44235064   ROM_REGION( 0x100000, "gfx2", 0 )
44245065   ROM_LOAD16_BYTE( "frrom5.bin", 0x00000, 0x80000, NO_DUMP )
44255066   ROM_LOAD16_BYTE( "frrom6.bin", 0x00001, 0x80000, NO_DUMP )
5067
5068   ROM_REGION( 0x20, "defaults", 0 ) /* default settings */
5069   ROM_LOAD_OPTIONAL( "fr14r.id", 0x00, 0x20, CRC(1542e2bc) SHA1(56e615866d451abd2d6c2d689a85bdca447c2538) )
44265070ROM_END
44275071
44285072// diagnostics?
r4425r4426
44435087static DRIVER_INIT( sfbonus_common)
44445088{
44455089   sfbonus_tilemap_ram = auto_malloc(0x4000);
5090   memset(sfbonus_tilemap_ram,0xff,0x4000);
44465091   state_save_register_global_pointer(machine, sfbonus_tilemap_ram , 0x4000);
44475092
44485093   sfbonus_reel_ram = auto_malloc(0x0800);
5094   memset(sfbonus_reel_ram,0xff,0x0800);
44495095   state_save_register_global_pointer(machine, sfbonus_reel_ram , 0x0800);
44505096
44515097   sfbonus_reel2_ram = auto_malloc(0x0800);
5098   memset(sfbonus_reel2_ram,0xff,0x0800);
44525099   state_save_register_global_pointer(machine, sfbonus_reel2_ram , 0x0800);
44535100
44545101   sfbonus_reel3_ram = auto_malloc(0x0800);
5102   memset(sfbonus_reel3_ram,0xff,0x0800);
44555103   state_save_register_global_pointer(machine, sfbonus_reel3_ram , 0x0800);
44565104
44575105   sfbonus_reel4_ram = auto_malloc(0x0800);
5106   memset(sfbonus_reel4_ram,0xff,0x0800);
44585107   state_save_register_global_pointer(machine, sfbonus_reel4_ram , 0x0800);
44595108
44605109   // hack, because the debugger is broken
44615110   sfbonus_videoram = memory_region(machine,"debugram");
44625111   if (!sfbonus_videoram) sfbonus_videoram = auto_malloc(0x10000);
44635112
5113   memset(sfbonus_videoram,0xff,0x10000);
44645114
44655115   state_save_register_global_pointer(machine, sfbonus_videoram, 0x10000);
44665116
r4425r4426
46735323GAME( 2004, sfbonusd,    sfbonus,  sfbonus,    amcoetype1,    sfbonusd,ROT0,  "Amcoe", "Skill Fruit Bonus (Version 1.9R, set 2)", 0)
46745324GAME( 2004, sfbonusv,    sfbonus,  sfbonus,    amcoetype1,    sfbonusv,ROT0,  "Amcoe", "Skill Fruit Bonus (Version 1.9R Dual)", 0)
46755325
4676GAME( 2004, parrot3,     0,        sfbonus,    amcoetype2,    pirpok2,  ROT0,  "Amcoe", "Parrot Poker III (Version 2.4)", 0)
5326GAMEL( 2004, parrot3,     0,        sfbonus,    amcoetype2,    pirpok2,  ROT0,  "Amcoe", "Parrot Poker III (Version 2.4)", 0, layout_pirpok2)
46775327
4678GAME( 2004, parrot3b,    parrot3,  sfbonus,    amcoetype2,    pirpok2,  ROT0,  "Amcoe", "Parrot Poker III (Version 2.6R, set 1)", 0)
4679GAME( 2004, parrot3d,    parrot3,  sfbonus,    amcoetype1,    parrot3d, ROT0,  "Amcoe", "Parrot Poker III (Version 2.6R, set 2)", 0)
4680GAME( 2004, parrot3v2,   parrot3,  sfbonus,    amcoetype1,    parrot3v2,ROT0,  "Amcoe", "Parrot Poker III (Version 2.6R Dual)", 0)
5328GAMEL( 2004, parrot3b,    parrot3,  sfbonus,    amcoetype2,    pirpok2,  ROT0,  "Amcoe", "Parrot Poker III (Version 2.6R, set 1)", 0, layout_pirpok2)
5329GAMEL( 2004, parrot3d,    parrot3,  sfbonus,    amcoetype1,    parrot3d, ROT0,  "Amcoe", "Parrot Poker III (Version 2.6R, set 2)", 0, layout_pirpok2)
5330GAMEL( 2004, parrot3v2,   parrot3,  sfbonus,    amcoetype1,    parrot3v2,ROT0,  "Amcoe", "Parrot Poker III (Version 2.6R Dual)", 0, layout_pirpok2)
46815331
4682GAME( 2004, parrot3v,    parrot3,  sfbonus,    amcoetype1,    parrot3v, ROT0,  "Amcoe", "Parrot Poker III (Version 2.6E Dual)", 0)
5332GAMEL( 2004, parrot3v,    parrot3,  sfbonus,    amcoetype1,    parrot3v, ROT0,  "Amcoe", "Parrot Poker III (Version 2.6E Dual)", 0, layout_pirpok2)
46835333
46845334GAME( 2000, hldspin1,    0,        sfbonus,    amcoetype2,    hldspin1, ROT0,  "Amcoe", "Hold & Spin I (Version 2.5T)", 0)
46855335
r4425r4426
47515401
47525402GAME( 2004, robadv2v4,   robadv2,  sfbonus,    amcoetype1,    robadv2v4,ROT0,  "Amcoe", "Robin Adventure 2 (Version 1.7E Dual)", 0)
47535403
4754GAME( 2003, pirpok2,     0,        sfbonus,    amcoetype2,    pirpok2, ROT0,  "Amcoe", "Pirate Poker II (Version 2.0)", 0)
5404GAMEL( 2003, pirpok2,     0,        sfbonus,    amcoetype2,    pirpok2, ROT0,  "Amcoe", "Pirate Poker II (Version 2.0)", 0, layout_pirpok2)
47555405
4756GAME( 2003, pirpok2b,    pirpok2,  sfbonus,    amcoetype2,    pirpok2, ROT0,  "Amcoe", "Pirate Poker II (Version 2.2R, set 1)", 0)
4757GAME( 2003, pirpok2d,    pirpok2,  sfbonus,    amcoetype1,    pirpok2d,ROT0,  "Amcoe", "Pirate Poker II (Version 2.2R, set 2)", 0)
4758GAME( 2003, pirpok2v,    pirpok2,  sfbonus,    amcoetype1,    pirpok2v,ROT0,  "Amcoe", "Pirate Poker II (Version 2.2R Dual)", 0)
5406GAMEL( 2003, pirpok2b,    pirpok2,  sfbonus,    amcoetype2,    pirpok2, ROT0,  "Amcoe", "Pirate Poker II (Version 2.2R, set 1)", 0, layout_pirpok2)
5407GAMEL( 2003, pirpok2d,    pirpok2,  sfbonus,    amcoetype1,    pirpok2d,ROT0,  "Amcoe", "Pirate Poker II (Version 2.2R, set 2)", 0, layout_pirpok2)
5408GAMEL( 2003, pirpok2v,    pirpok2,  sfbonus,    amcoetype1,    pirpok2v,ROT0,  "Amcoe", "Pirate Poker II (Version 2.2R Dual)", 0, layout_pirpok2)
47595409
4760GAME( 2003, pirpok2v2,   pirpok2,  sfbonus,    amcoetype1,   pirpok2v2,ROT0,  "Amcoe", "Pirate Poker II (Version 2.4E Dual)", 0)
5410GAMEL( 2003, pirpok2v2,   pirpok2,  sfbonus,    amcoetype1,   pirpok2v2,ROT0,  "Amcoe", "Pirate Poker II (Version 2.4E Dual)", 0, layout_pirpok2)
47615411
47625412GAME( 2003, anibonus,    0,        sfbonus,    amcoetype2,    anibonus, ROT0,  "Amcoe", "Animal Bonus (Version 1.50XT)", 0)
47635413
src/mame/drivers/tokyocop.c
r0r4426
1/* Tokyo Cop
2
3Italian Version
4
5PC based hardware
6Custom motherboard with
782815
882801
982562 (LAN)
10RTM 560-25R (Audio)
11TI4200 128Mb AGP
12256 Mb PC133
13Pentium 4 (??? XXXXMhz)
14
15I/O Board with Altera Flex EPF15K50EQC240-3
16
17*/
18
19#include "driver.h"
20#include "cpu/i386/i386.h"
21
22static VIDEO_START(tokyocop)
23{
24}
25
26static VIDEO_UPDATE(tokyocop)
27{
28   return 0;
29}
30
31static ADDRESS_MAP_START( tokyocop_map, ADDRESS_SPACE_PROGRAM, 32 )
32   AM_RANGE(0x00000000, 0x0001ffff) AM_ROM
33ADDRESS_MAP_END
34
35static INPUT_PORTS_START( tokyocop )
36INPUT_PORTS_END
37
38
39static MACHINE_DRIVER_START( tokyocop )
40   /* basic machine hardware */
41   MDRV_CPU_ADD("maincpu", PENTIUM, 2000000000) /* Pentium4? */
42   MDRV_CPU_PROGRAM_MAP(tokyocop_map, 0)
43
44    /* video hardware */
45   MDRV_SCREEN_ADD("screen", RASTER)
46   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
47   MDRV_SCREEN_REFRESH_RATE(60)
48   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
49   MDRV_SCREEN_SIZE(64*8, 32*8)
50   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
51
52   MDRV_PALETTE_LENGTH(0x100)
53
54   MDRV_VIDEO_START(tokyocop)
55   MDRV_VIDEO_UPDATE(tokyocop)
56MACHINE_DRIVER_END
57
58
59ROM_START(tokyocop)
60   ROM_REGION32_LE(0x20000, "maincpu", 0)   /* motherboard bios */
61   ROM_LOAD("tokyocop.pcbios", 0x000000, 0x10000, NO_DUMP )
62
63   DISK_REGION( "disks" )
64   DISK_IMAGE( "tokyocop", 0, SHA1(a3cf011c8ef8ec80724c28e1534191b40ae8515d) )
65ROM_END
66
67
68GAME( 200?, tokyocop,  0,   tokyocop, tokyocop, 0, ROT0, "Gaelco", "Tokyo Cop (Italy)", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/cntsteer.c
r4425r4426
1212        - correct roz rotation;
1313        - make cntsteer work, comms looks awkward and probably different than Zero Target;
1414        - flip screen support;
15        - according to a side-by-side test, sound should be "darker" by some octanes,
15        - according to a side-by-side test, sound should be "darker" by some octaves,
1616          likely that a sound filter is needed;
1717    cleanup
1818        - split into driver/video;
1919
20    note: To boot cntsteer, set a CPU #1 breakpoint on c225 and then 'do pc=c230'.
21          Protection maybe?
22
2023***************************************************************************************/
2124
2225#include "driver.h"
2326#include "cpu/m6502/m6502.h"
2427#include "cpu/m6809/m6809.h"
2528#include "sound/ay8910.h"
29#include "sound/dac.h"
2630#include <math.h>
2731
2832static tilemap *bg_tilemap, *fg_tilemap;
r4425r4426
4448      bit0 = (color_prom[i] >> 0) & 0x01;
4549      bit1 = (color_prom[i] >> 1) & 0x01;
4650      bit2 = (color_prom[i] >> 2) & 0x01;
47      g = /*255 - */(0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
51      g = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
4852      /* green component */
4953      bit0 = (color_prom[i] >> 4) & 0x01;
5054      bit1 = (color_prom[i] >> 5) & 0x01;
5155      bit2 = (color_prom[i] >> 6) & 0x01;
52      r =/* 255 - */(0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
56      r = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
5357      /* blue component */
5458      bit0 = (color_prom[i+256] >> 0) & 0x01;
5559      bit1 = (color_prom[i+256] >> 1) & 0x01;
5660      bit2 = (color_prom[i+256] >> 2) & 0x01;
57      b = /*255 - */(0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
61      b = (0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2);
5862
5963      palette_set_color(machine,i,MAKE_RGB(r,g,b));
6064   }
r4425r4426
110114[2] xxxx xxxx X attribute
111115[3] xxxx xxxx sprite number
112116*/
113static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
117static void zerotrgt_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
114118{
115119   int offs;
116120
r4425r4426
156160   }
157161}
158162
163/*
164[00] --x- ---- magnify
165     ---x ---- double height
166     ---- -x-- flipy
167
168[80] -xxx ---- palette entry
169     ---- --xx tile bank
170*/
171
172static void cntsteer_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
173{
174   int offs;
175
176   for (offs = 0;offs < 0x80;offs += 4)
177   {
178      int multi,fx,fy,sx,sy,code,color;
179
180      if((spriteram[offs+0] & 1) == 0)
181         continue;
182
183      code = spriteram[offs+1] + ( ( spriteram[offs+0x80] & 0x03 ) << 8 );
184      sx = 0x100 - spriteram[offs+3];
185      sy = 0x100 - spriteram[offs+2];
186      color = 0x10+((spriteram[offs+0x80] & 0x70)>>4);
187
188      fx = (spriteram[offs+0] & 0x04);
189      fy = (spriteram[offs+0] & 0x02);
190
191      multi = spriteram[offs+0] & 0x10;
192
193      if (flipscreen) {
194         sy=240-sy;
195         sx=240-sx;
196         if (fx) fx=0; else fx=1;
197         //sy2=sy-16;
198      }
199
200        if(multi)
201        {
202         if(fy)
203         {
204            drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
205            drawgfx(bitmap,machine->gfx[1],code+1,color,fx,fy,sx,sy-16,cliprect,TRANSPARENCY_PEN,0);
206         }
207         else
208         {
209              drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy-16,cliprect,TRANSPARENCY_PEN,0);
210              drawgfx(bitmap,machine->gfx[1],code+1,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
211         }
212      }
213      else
214            drawgfx(bitmap,machine->gfx[1],code,color,fx,fy,sx,sy,cliprect,TRANSPARENCY_PEN,0);
215   }
216}
217
159218static VIDEO_UPDATE( zerotrgt )
160219{
161220   if(disable_roz)
r4425r4426
200259                  0, 0);
201260   }
202261
203   draw_sprites(screen->machine,bitmap,cliprect);
262   zerotrgt_draw_sprites(screen->machine,bitmap,cliprect);
204263   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
205264
206265   return 0;
207266}
208267
268static VIDEO_UPDATE( cntsteer )
269{
270   if(disable_roz)
271      bitmap_fill(bitmap, cliprect, screen->machine->pens[8*bg_color_bank]);
272   else
273   {
274      static int p1,p2,p3,p4;
275      static int rot_val,x,y;
209276
277      rotation_x |= rotation_x|(rotation_sign & 3)<<8;
278
279      rot_val = (rotation_sign & 4) ? (rotation_x) : (-rotation_x);
280
281//      popmessage("%d %02x %02x",rot_val,rotation_sign,rotation_x);
282
283      /*
284        (u, v) = (a + cx + dy, b - dx + cy) when (x, y)=screen and (u, v) = tilemap
285        */
286      /*
287             1
288        0----|----0
289            -1
290             0
291        0----|----1
292             0
293        */
294      /*65536*z*cos(a), 65536*z*sin(a), -65536*z*sin(a), 65536*z*cos(a)*/
295      p1 = -65536*1*cos(2*M_PI*(rot_val)/1024);
296      p2 = -65536*1*sin(2*M_PI*(rot_val)/1024);
297      p3 = 65536*1*sin(2*M_PI*(rot_val)/1024);
298      p4 = -65536*1*cos(2*M_PI*(rot_val)/1024);
299
300      x = 256+(scrollx | scrollx_hi);
301      y = 256-(scrolly | scrolly_hi);
302
303      tilemap_draw_roz(bitmap, cliprect, bg_tilemap,
304                  (x << 16), (y << 16),
305                  p1, p2,
306                  p3, p4,
307                  1,
308                  0, 0);
309   }
310
311   cntsteer_draw_sprites(screen->machine,bitmap,cliprect);
312   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
313
314   return 0;
315}
316
210317/*
211318[0] = scroll y
212319[1] = scroll x
r4425r4426
219326      ---- ---x rotation sign (landscape should be turning right (0) == / , turning left (1) == \)
220327[4] = xxxx xxxx rotation factor?
221328*/
222static WRITE8_HANDLER(cntsteer_vregs_w)
329static WRITE8_HANDLER(zerotrgt_vregs_w)
223330{
224331//  static UINT8 test[5];
225332
r4425r4426
236343   }
237344}
238345
346static WRITE8_HANDLER(cntsteer_vregs_w)
347{
348//  static UINT8 test[5];
349
350//  test[offset] = data;
351//   popmessage("%02x %02x %02x %02x %02x",test[0],test[1],test[2],test[3],test[4]);
352
353   switch(offset)
354   {
355      case 0:   scrolly = data; break;
356      case 1: scrollx = data; break;
357      case 2: bg_bank = (data & 0x01) << 8; (bg_color_bank = (data & 6)>>1); tilemap_mark_all_tiles_dirty(bg_tilemap); break;
358      case 3:   rotation_sign = (data & 7);  disable_roz = (~data & 0x08); scrolly_hi = (data & 0x30) << 4; scrollx_hi = (data & 0xc0) << 2; break;
359      case 4: rotation_x = data; break;
360   }
361}
362
239363static WRITE8_HANDLER( cntsteer_foreground_vram_w )
240364{
241365   videoram[offset] = data;
r4425r4426
282406//  if (offset==2) cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE);
283407}
284408
409static WRITE8_HANDLER( cntsteer_sub_irq_w )
410{
411   cpu_set_input_line(space->machine->cpu[1], M6809_IRQ_LINE, ASSERT_LINE);
412//  printf("%02x IRQ\n",data);
413}
414
415static WRITE8_HANDLER( cntsteer_sub_nmi_w )
416{
417//  if(data)
418//  cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
419//  popmessage("%02x",data);
420}
421
422static WRITE8_HANDLER( cntsteer_main_irq_w )
423{
424   cpu_set_input_line(space->machine->cpu[0], M6809_IRQ_LINE, HOLD_LINE);
425}
426
427/* Convert weird input handling with MAME standards.*/
428static READ8_HANDLER( cntsteer_adx_r )
429{
430   static UINT8 res,adx_val;
431
432   adx_val = input_port_read(space->machine, "AN_STEERING");
433
434   if(adx_val >= 0x70 && adx_val <= 0x90)
435      res = 0xff;
436   else if(adx_val > 0x90)
437   {
438      if(adx_val > 0x90 && adx_val <= 0xb0)
439         res = 0xfe;
440      else if(adx_val > 0xb0 && adx_val <= 0xd0)
441         res = 0xfc;
442      else if(adx_val > 0xd0 && adx_val <= 0xf0)
443         res = 0xf8;
444      else if(adx_val > 0xf0)
445         res = 0xf0;
446   }
447   else
448   {
449      if(adx_val >= 0x50 && adx_val < 0x70)
450         res = 0xef;
451      else if(adx_val >= 0x30 && adx_val < 0x50)
452         res = 0xcf;
453      else if(adx_val >= 0x10 && adx_val < 0x30)
454         res = 0x8f;
455      else if(adx_val < 0x10)
456         res = 0x0f;
457   }
458
459   //popmessage("%02x",adx_val);
460
461   return res;
462}
463
285464/***************************************************************************/
286465
287466static ADDRESS_MAP_START( gekitsui_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
r4425r4426
301480   AM_RANGE(0x3001, 0x3001) AM_READ_PORT("P2")
302481   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1")
303482   AM_RANGE(0x3003, 0x3003) AM_READ_PORT("COINS")
304   AM_RANGE(0x3000, 0x3004) AM_WRITE(cntsteer_vregs_w)
483   AM_RANGE(0x3000, 0x3004) AM_WRITE(zerotrgt_vregs_w)
305484   AM_RANGE(0x3005, 0x3005) AM_WRITE(gekitsui_sub_irq_ack)
306485   AM_RANGE(0x3007, 0x3007) AM_WRITE(cntsteer_sound_w)
307486   AM_RANGE(0x4000, 0xffff) AM_ROM
308487ADDRESS_MAP_END
309488
310489static ADDRESS_MAP_START( cntsteer_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
311   AM_RANGE(0x0000, 0x0fff) AM_RAM //AM_SHARE(1)
490   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE(1)
312491   AM_RANGE(0x1000, 0x11ff) AM_RAM AM_BASE(&spriteram)
313   AM_RANGE(0x1200, 0x1fff) AM_RAM
314492   AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(cntsteer_foreground_vram_w) AM_BASE(&videoram)
315493   AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(cntsteer_foreground_attr_w) AM_BASE(&colorram)
316   AM_RANGE(0x3000, 0x3003) AM_WRITE(zerotrgt_ctrl_w)
494   AM_RANGE(0x3000, 0x3000) AM_WRITE(cntsteer_sub_nmi_w)
495   AM_RANGE(0x3001, 0x3001) AM_WRITE(cntsteer_sub_irq_w)
317496   AM_RANGE(0x8000, 0xffff) AM_ROM
318497ADDRESS_MAP_END
319498
320499static ADDRESS_MAP_START( cntsteer_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
321   AM_RANGE(0x0000, 0x1fff) AM_RAM //AM_SHARE(1)
322   AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(cntsteer_background_w) AM_BASE(&videoram2)
500   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE(1)
501   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_BASE(&videoram2) AM_SHARE(3)
502   AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE(3)
323503   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW0")
324   AM_RANGE(0x3001, 0x3001) AM_READ_PORT("P2")
504   AM_RANGE(0x3001, 0x3001) AM_READ(cntsteer_adx_r)
325505   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1")
326506   AM_RANGE(0x3003, 0x3003) AM_READ_PORT("COINS")
327507   AM_RANGE(0x3000, 0x3004) AM_WRITE(cntsteer_vregs_w)
328508   AM_RANGE(0x3005, 0x3005) AM_WRITE(gekitsui_sub_irq_ack)
509   AM_RANGE(0x3006, 0x3006) AM_WRITE(cntsteer_main_irq_w)
329510   AM_RANGE(0x3007, 0x3007) AM_WRITE(cntsteer_sound_w)
511   AM_RANGE(0x3007, 0x3007) AM_READNOP //m6809 bug.
330512   AM_RANGE(0x4000, 0xffff) AM_ROM
331513ADDRESS_MAP_END
332514
r4425r4426
404586   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
405587INPUT_PORTS_END
406588
407/* inputs needs some work in this one.*/
589static INPUT_CHANGED( coin_inserted )
590{
591   cpu_set_input_line(field->port->machine->cpu[1], INPUT_LINE_NMI, newval ? CLEAR_LINE : PULSE_LINE);
592}
593
408594static INPUT_PORTS_START( cntsteer )
409   PORT_INCLUDE( zerotrgt )
410
411   PORT_MODIFY("P1")
412   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
413   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
414   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
415   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
416   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
417   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
418   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
419   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
420   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
421   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
422   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
423   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
424   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
425   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
426   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
595   PORT_START("P1")
596   PORT_BIT( 0x0f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x0f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) //todo
597   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
427598   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
428599   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
429600   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4425r4426
434605   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
435606   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
436607
437   PORT_MODIFY("P2")
438   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
439   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
440   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
441   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
442   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
443   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
444   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
445   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
446   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
447   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
448   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
449   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
450   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
451   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
452   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
453   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
454   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
455   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
456   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
457   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
458   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
459   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
460   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
461   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
608   PORT_START("AN_STEERING")
609   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(10) PORT_KEYDELTA(2)
462610
463   PORT_MODIFY("COINS")
464   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
465   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
466   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
467   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
468   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
469   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
470   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
471   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
472   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
473   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
611   PORT_START("COINS")
612   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
613   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0)
614   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED(coin_inserted, 0)
615   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) //unused
474616   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
475617   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
476618   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
r4425r4426
482624   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
483625   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
484626   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
485   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
486   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
487   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
627   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
488628
489   PORT_MODIFY("DSW0")
629   PORT_START("DSW0")
490630   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
491631   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
492632   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
r4425r4426
583723   nmimask = 0;
584724}
585725
726static const ay8910_interface ay8910_config =
727{
728   AY8910_LEGACY_OUTPUT,
729   AY8910_DEFAULT_LOADS,
730   DEVCB_NULL,
731   DEVCB_NULL,
732   DEVCB_DEVICE_HANDLER("dac", dac_w),
733   DEVCB_NULL
734};
735
586736static MACHINE_DRIVER_START( cntsteer )
587737   MDRV_CPU_ADD("maincpu", M6809, 2000000)       /* ? */
588738   MDRV_CPU_PROGRAM_MAP(cntsteer_cpu1_map,0)
r4425r4426
611761//  MDRV_PALETTE_INIT(zerotrgt)
612762
613763   MDRV_VIDEO_START(cntsteer)
614   MDRV_VIDEO_UPDATE(zerotrgt)
764   MDRV_VIDEO_UPDATE(cntsteer)
615765
616766   /* sound hardware */
617767   MDRV_SPEAKER_STANDARD_MONO("mono")
618768   MDRV_SOUND_ADD("ay1", AY8910, 1500000)
769   MDRV_SOUND_CONFIG(ay8910_config)
619770   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
620771
621772   MDRV_SOUND_ADD("ay2", AY8910, 1500000)
622773   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
774
775   MDRV_SOUND_ADD("dac", DAC, 0)
776   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
623777MACHINE_DRIVER_END
624778
625779static MACHINE_DRIVER_START( zerotrgt )
r4425r4426
633787
634788   MDRV_CPU_ADD("audiocpu", M6502, 1500000)      /* ? */
635789   MDRV_CPU_PROGRAM_MAP(sound_map,0)
636   MDRV_CPU_PERIODIC_INT(sound_interrupt, 640)
790   MDRV_CPU_PERIODIC_INT(sound_interrupt, 480)
637791
638792   MDRV_QUANTUM_TIME(HZ(6000))
639793
r4425r4426
703857   ROM_LOAD( "by18", 0x20000, 0x2000, CRC(1e9ce047) SHA1(7579ba6b401eb1bfc7d2d9311ebab623bd1095a2) )
704858   ROM_LOAD( "by20", 0x30000, 0x2000, CRC(e2198c9e) SHA1(afea262db9154301f4b9e53e1fc91985dd934170) )
705859
706   ROM_REGION( 0x200, "proms", ROMREGION_ERASE00 )
707   ROM_LOAD( "mb7118h.7k",  0x0000, 0x100, NO_DUMP )
708   ROM_LOAD( "mb7052.6k",   0x0100, 0x100, NO_DUMP )
860   ROM_REGION( 0x300, "proms", ROMREGION_ERASE00 )
861   ROM_LOAD( "by21.j4",  0x0000, 0x100, NO_DUMP ) /* All 82s129 or equivalent */
862   ROM_LOAD( "by22.j5",  0x0100, 0x100, NO_DUMP )
863   ROM_LOAD( "by23.j6",  0x0200, 0x100, NO_DUMP )
709864ROM_END
710865
711866ROM_START( zerotrgt )
712867   ROM_REGION( 0x10000, "maincpu", 0 )
713    ROM_LOAD( "ct01-s.4c", 0x8000, 0x8000, CRC(b35a16cb) SHA1(49581324c3e3d5219f0512d08a40161185368b10) )
868   ROM_LOAD( "ct01-s.4c", 0x8000, 0x8000, CRC(b35a16cb) SHA1(49581324c3e3d5219f0512d08a40161185368b10) )
714869
715870   ROM_REGION( 0x10000, "sub", 0 )
716871   ROM_LOAD( "ct08.16a",  0x4000, 0x4000,  CRC(7e8db408) SHA1(2ae407d15645753a2a0d691c9f1cf1eb383d3e8a) )
r4425r4426
753908
754909ROM_START( gekitsui )
755910   ROM_REGION( 0x10000, "maincpu", 0 )
756    ROM_LOAD( "ct01", 0x8000, 0x8000, CRC(d3d82d8d) SHA1(c175c626d4cb89a2d82740c04892092db6faf616) )
911   ROM_LOAD( "ct01", 0x8000, 0x8000, CRC(d3d82d8d) SHA1(c175c626d4cb89a2d82740c04892092db6faf616) )
757912
758913   ROM_REGION( 0x10000, "sub", 0 )
759914   ROM_LOAD( "ct08.16a",  0x4000, 0x4000,  CRC(7e8db408) SHA1(2ae407d15645753a2a0d691c9f1cf1eb383d3e8a) )
r4425r4426
839994
840995/***************************************************************************/
841996
842GAME( 1985, cntsteer, 0,        cntsteer,  cntsteer, zerotrgt, ROT90,  "Data East Corporation", "Counter Steer", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NO_COCKTAIL|GAME_NOT_WORKING )
843997GAME( 1985, zerotrgt, 0,        zerotrgt,  zerotrgt, zerotrgt, ROT0,   "Data East Corporation", "Zero Target (World)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NO_COCKTAIL|GAME_NOT_WORKING )
844998GAME( 1985, gekitsui, zerotrgt, zerotrgt,  zerotrgt, zerotrgt, ROT0,   "Data East Corporation", "Gekitsui Oh (Japan)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NO_COCKTAIL|GAME_NOT_WORKING )
999GAME( 1985, cntsteer, 0,        cntsteer,  cntsteer, zerotrgt, ROT270, "Data East Corporation", "Counter Steer (Japan)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_WRONG_COLORS|GAME_NO_COCKTAIL|GAME_NOT_WORKING )
src/mame/drivers/multfish.c
r4425r4426
1818  Press 'F2' (Turn Service Mode ON)
1919  Press 'F3' (Reset)
2020  Use 'C' (3 Lines) to move pointer to INIT
21  press 'M' (Start) to enter INIT menu
21  press '1' (Start) to enter INIT menu
2222  hold 'Z' (Bet/Double) for 5 seconds while counter counts down
2323  press 'F2' (Turn Service Mode OFF)
2424  Press 'F3' (Reset)
r4425r4426
244244   PORT_DIPNAME(     0x04, 0x04, "P Reserve (13 A)" )
245245   PORT_DIPSETTING(  0x04, DEF_STR( Off ) )
246246   PORT_DIPSETTING(  0x00, DEF_STR( On ) )
247   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Start") PORT_CODE(KEYCODE_M)
247   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start")
248248   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN8 ) // BILL 4 (07 A)
249249   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) // unused?
250250
r4425r4426
457457
458458
459459/*********************************************************
460   Multifish (14 sets)
460   Multifish
461461**********************************************************/
462462
463463#if ALL_REVISIONS
464ROM_START( mfish ) // 040316
464ROM_START( mfish_13 ) // 040316
465465   ROM_REGION( 0x40000, "maincpu", 0 )
466466   ROM_LOAD( "mf040316.rom", 0x00000, 0x40000, MD5(66019927201954518261652147b05e43) SHA1(c1f4d1c51632a45b533d19c8b6f63d337d84d9cd) )
467467
r4425r4426
477477ROM_END
478478#endif
479479
480ROM_START( mfish_2 ) // 040308
480ROM_START( mfish_12 ) // 040308
481481   ROM_REGION( 0x40000, "maincpu", 0 )
482482   ROM_LOAD( "mf040308.rom", 0x00000, 0x40000, CRC(adb9c1d9) SHA1(88c69f48766dc7c98a6f03c1a0a4aa63b76560b6) )
483483
r4425r4426
492492   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
493493ROM_END
494494
495ROM_START( mfish_2a ) // 040308
495ROM_START( mfish_12a ) // 040308
496496   ROM_REGION( 0x40000, "maincpu", 0 )
497497   ROM_LOAD( "mf040308_alt.rom", 0x00000, 0x40000, CRC(44537648) SHA1(7bce6085778ff0b21c052ae91703de3b78b8eed0))
498498
r4425r4426
508508ROM_END
509509
510510#if ALL_REVISIONS
511ROM_START( mfish_3 ) // 031124
511ROM_START( mfish_11 ) // 031124
512512   ROM_REGION( 0x40000, "maincpu", 0 )
513513   ROM_LOAD( "mf031124.rom", 0x00000, 0x40000, MD5(9cd800719c6e4a2267e3c140467238d3) SHA1(c0d1b541c4b076bbc810ad637acb4a2663a919ba) )
514514
r4425r4426
523523   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
524524ROM_END
525525
526ROM_START( mfish_4 ) // 031117
526ROM_START( mfish_10 ) // 031117
527527   ROM_REGION( 0x40000, "maincpu", 0 )
528528   ROM_LOAD( "mf031117.rom", 0x00000, 0x40000, MD5(531a3e63c46be33a151c06bdd9479655) SHA1(1d244a332af0fb6aa593a246211ff2b6d2c48a59) )
529529
r4425r4426
538538   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
539539ROM_END
540540
541ROM_START( mfish_5 ) // 031026
541ROM_START( mfish_9 ) // 031026
542542   ROM_REGION( 0x40000, "maincpu", 0 )
543543   ROM_LOAD( "mf031026.rom", 0x00000, 0x40000, MD5(a0a31829705ad78786f7c1bd36cee0cf) SHA1(451b390793f89188afe2b6e82fc02b474fb97a7c) )
544544
r4425r4426
553553   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
554554ROM_END
555555
556ROM_START( mfish_6 ) // 030522
556ROM_START( mfish_8 ) // 030522
557557   ROM_REGION( 0x40000, "maincpu", 0 )
558558   ROM_LOAD( "mf030522.rom", 0x00000, 0x40000, MD5(17dc6bf0308a4ac53bdff0ade1216235) SHA1(fa80e12275b960374c84518bcaa1e32d0a4ff437) )
559559
r4425r4426
583583   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
584584ROM_END
585585
586ROM_START( mfish_8 ) // 030124
586ROM_START( mfish_6 ) // 030124
587587   ROM_REGION( 0x40000, "maincpu", 0 )
588588   ROM_LOAD( "mf030124.rom", 0x00000, 0x40000, MD5(4772becb7c2b3220492c690501e174a7) SHA1(b119b086bad3f6f8acc64a5809ce449800615406) )
589589
r4425r4426
598598   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
599599ROM_END
600600
601ROM_START( mfish_9 ) // 021227
601ROM_START( mfish_5 ) // 021227
602602   ROM_REGION( 0x40000, "maincpu", 0 )
603603   ROM_LOAD( "mf021227.rom", 0x00000, 0x40000, MD5(1bbdff5bd2b89a0c9c474286c55d16db) SHA1(58b74c41a88a781da01dba52744dc74e41deae70) )
604604
r4425r4426
613613   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
614614ROM_END
615615
616ROM_START( mfish_10 ) // 021219
616ROM_START( mfish_4 ) // 021219
617617   ROM_REGION( 0x40000, "maincpu", 0 )
618618   ROM_LOAD( "mf021219.rom", 0x00000, 0x40000, MD5(c8810d803d320d9fefa46588c8ef28c0) SHA1(887d456b2ba89560329457d9eaea26fb72223a38) )
619619
r4425r4426
628628   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
629629ROM_END
630630
631ROM_START( mfish_11 ) // 021124
631ROM_START( mfish_3 ) // 021124
632632   ROM_REGION( 0x40000, "maincpu", 0 )
633633   ROM_LOAD( "mf021124.rom", 0x00000, 0x40000, MD5(a3bfe235ca1d2efa51cc55465a8161e4) SHA1(ea132f68e9c09c40369d4cc02c670ee6e26bdcbe) )
634634
r4425r4426
643643   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
644644ROM_END
645645
646ROM_START( mfish_12 ) // 021121
646ROM_START( mfish_2 ) // 021121
647647   ROM_REGION( 0x40000, "maincpu", 0 )
648648   ROM_LOAD( "mf021121.rom", 0x00000, 0x40000, MD5(727dc01459f6745caa2b19fbd4432055) SHA1(87a1fb81330cf4b66e17702c22fda694ebff58eb) )
649649
r4425r4426
658658   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
659659ROM_END
660660
661ROM_START( mfish_13 ) // 021120
661ROM_START( mfish ) // 021120
662662   ROM_REGION( 0x40000, "maincpu", 0 )
663663   ROM_LOAD( "mf021120.rom", 0x00000, 0x40000, MD5(6021e2bfa67abdfc0beb7f291fdc9d9c) SHA1(eb7eb5aae00a77edcf328f460970eb180d86d058) )
664664
r4425r4426
674674ROM_END
675675#endif
676676
677/*********************************************************
678   Crazy Monkey
679**********************************************************/
680
681ROM_START( crzmon ) // 030217
682   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
683   ROM_LOAD( "cm030217.rom", 0x00000, 0x40000, MD5(5e2e4eec4cb20437a3e389003f8e2bb7) SHA1(75787f32aa4c8e8ff7bc11c57a37ad5a65f71c52) )
684
685   ROM_REGION( 0x400000, "gfx", 0 )
686   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
687   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
688   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
689   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
690   ROM_LOAD( "5", 0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
691   ROM_LOAD( "6", 0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
692   ROM_LOAD( "7", 0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
693   ROM_LOAD( "8", 0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
694ROM_END
695
696
697ROM_START( crzmon_2 ) // 030225
698   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
699   ROM_LOAD( "cm030225.rom", 0x00000, 0x40000, MD5(8f8d0ca97b5a2ad255d36094a6b30e0e) SHA1(3627a3d6a4a50ed8544456d53ab5a489af389a19) )
700
701   ROM_REGION( 0x400000, "gfx", 0 )
702   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
703   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
704   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
705   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
706   ROM_LOAD( "5", 0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
707   ROM_LOAD( "6", 0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
708   ROM_LOAD( "7", 0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
709   ROM_LOAD( "8", 0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
710ROM_END
711
712
713ROM_START( crzmon_3 ) // 030227
714   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
715   ROM_LOAD( "cm030227.rom", 0x00000, 0x40000, MD5(e2704337640db28a92b9946209eec2b1) SHA1(4f8cd68dd2b6abeaabc9b45da18469cc6e7ac74d) )
716
717   ROM_REGION( 0x400000, "gfx", 0 )
718   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
719   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
720   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
721   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
722   ROM_LOAD( "5", 0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
723   ROM_LOAD( "6", 0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
724   ROM_LOAD( "7", 0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
725   ROM_LOAD( "8", 0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
726ROM_END
727
728ROM_START( crzmon_4 ) // 030404
729   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
730   ROM_LOAD( "cm030404.rom", 0x00000, 0x40000, MD5(a3a9fce896f75cf9f8046c68a70a098d) SHA1(fd99caa2b6ef7218563db4f3b755e34dd551e05f) )
731
732   ROM_REGION( 0x400000, "gfx", 0 )
733   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
734   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
735   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
736   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
737   ROM_LOAD( "5", 0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
738   ROM_LOAD( "6", 0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
739   ROM_LOAD( "7", 0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
740   ROM_LOAD( "8", 0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
741ROM_END
742
743
744ROM_START( crzmon_5 ) // 030421
745   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
746   ROM_LOAD( "cm030421.rom", 0x00000, 0x40000, MD5(2b30aabb2c1becc3209018580ebe0086) SHA1(6559e45e3ec39c1d201ed54a10fdb5c6aeff6582) )
747
748   ROM_REGION( 0x400000, "gfx", 0 )
749   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
750   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
751   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
752   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
753   ROM_LOAD( "5", 0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
754   ROM_LOAD( "6", 0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
755   ROM_LOAD( "7", 0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
756   ROM_LOAD( "8", 0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
757ROM_END
758
759ROM_START( crzmon_6 ) // 031016
760   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
761   ROM_LOAD( "cm031016.rom", 0x00000, 0x40000, MD5(36901e462cd3a9d221a9cefcdf377cbe) SHA1(2f2a5ecbb311ade75f8fdc322c6e63836d4119c3) )
762
763   ROM_REGION( 0x400000, "gfx", 0 )
764   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
765   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
766   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
767   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
768   ROM_LOAD( "5", 0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
769   ROM_LOAD( "6", 0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
770   ROM_LOAD( "7", 0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
771   ROM_LOAD( "8", 0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
772ROM_END
773
774
775ROM_START( crzmon_7 ) // 031110
776   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
777   ROM_LOAD( "cm031110.rom", 0x00000, 0x40000, CRC(d3e67980) SHA1(f0daa91abdde211a2ff61414d84386b763c30949) )
778
779   ROM_REGION( 0x400000, "gfx", 0 )
780   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
781   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
782   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
783   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
784   ROM_LOAD( "5", 0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
785   ROM_LOAD( "6", 0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
786   ROM_LOAD( "7", 0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
787   ROM_LOAD( "8", 0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
788ROM_END
789
790
791
792
793/*********************************************************
794   Fruit Cocktail
795**********************************************************/
796
797ROM_START( fcock ) // 030505
798   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
799   ROM_LOAD( "fc030505.rom", 0x00000, 0x40000, MD5(5ee5ad269498787e5eb69194874b6544) SHA1(cc65334e8dfae5ffef1d73bd5085e3555905e259) )
800
801   ROM_REGION( 0x400000, "gfx", 0 )
802   ROM_LOAD( "1b", 0x000000, 0x80000, CRC(da72c0bb) SHA1(41c9eebccce82520dfe41d6a3a574b2890945ffa) )
803   ROM_LOAD( "2b", 0x100000, 0x80000, CRC(6239ba9d) SHA1(22486ad30c28341784e7e490255247b82782b72e) )
804   ROM_LOAD( "3b", 0x200000, 0x80000, CRC(2c14a464) SHA1(5fce2f4ef95c5054b055db94399946257bc7321f) )
805   ROM_LOAD( "4b", 0x300000, 0x80000, CRC(115898f4) SHA1(55b93bddaeede1c2f6b18083a6a2e6329af087cc) )
806   ROM_LOAD( "5b", 0x080000, 0x80000, CRC(f0176b60) SHA1(f764aea00ed306a28cacc62f8d2db9cc42895db8) )
807   ROM_LOAD( "6b", 0x180000, 0x80000, CRC(ef24f255) SHA1(6ff924627c179868a25f180f79cd57182b72d9d4) )
808   ROM_LOAD( "7",  0x280000, 0x80000, CRC(20f87a15) SHA1(cb60866a3543668f3592c270b445dee881d78128) ) // the same as newer sets?
809   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
810ROM_END
811
812
813ROM_START( fcock_2 ) // 030512
814   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
815   ROM_LOAD( "fc030512.rom", 0x00000, 0x40000, MD5(e94917c5935641601f17a3fe56dedb17) SHA1(c23ebcf64609a56a029f05101185f3adf73cdadd) )
816
817   ROM_REGION( 0x400000, "gfx", 0 )
818   ROM_LOAD( "1b", 0x000000, 0x80000, CRC(da72c0bb) SHA1(41c9eebccce82520dfe41d6a3a574b2890945ffa) )
819   ROM_LOAD( "2b", 0x100000, 0x80000, CRC(6239ba9d) SHA1(22486ad30c28341784e7e490255247b82782b72e) )
820   ROM_LOAD( "3b", 0x200000, 0x80000, CRC(2c14a464) SHA1(5fce2f4ef95c5054b055db94399946257bc7321f) )
821   ROM_LOAD( "4b", 0x300000, 0x80000, CRC(115898f4) SHA1(55b93bddaeede1c2f6b18083a6a2e6329af087cc) )
822   ROM_LOAD( "5b", 0x080000, 0x80000, CRC(f0176b60) SHA1(f764aea00ed306a28cacc62f8d2db9cc42895db8) )
823   ROM_LOAD( "6b", 0x180000, 0x80000, CRC(ef24f255) SHA1(6ff924627c179868a25f180f79cd57182b72d9d4) )
824   ROM_LOAD( "7",  0x280000, 0x80000, CRC(20f87a15) SHA1(cb60866a3543668f3592c270b445dee881d78128) ) // the same as newer sets?
825   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
826ROM_END
827
828ROM_START( fcock_3 ) // 030623
829   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
830   ROM_LOAD( "fc030623.rom", 0x00000, 0x40000, MD5(f787356afecbe02dcfcd89060cc30daf) SHA1(b95c5e06cf41762802199e1b55a5eda2243c9af7) )
831
832   ROM_REGION( 0x400000, "gfx", 0 )
833   ROM_LOAD( "1b", 0x000000, 0x80000, CRC(da72c0bb) SHA1(41c9eebccce82520dfe41d6a3a574b2890945ffa) )
834   ROM_LOAD( "2b", 0x100000, 0x80000, CRC(6239ba9d) SHA1(22486ad30c28341784e7e490255247b82782b72e) )
835   ROM_LOAD( "3b", 0x200000, 0x80000, CRC(2c14a464) SHA1(5fce2f4ef95c5054b055db94399946257bc7321f) )
836   ROM_LOAD( "4b", 0x300000, 0x80000, CRC(115898f4) SHA1(55b93bddaeede1c2f6b18083a6a2e6329af087cc) )
837   ROM_LOAD( "5b", 0x080000, 0x80000, CRC(f0176b60) SHA1(f764aea00ed306a28cacc62f8d2db9cc42895db8) )
838   ROM_LOAD( "6b", 0x180000, 0x80000, CRC(ef24f255) SHA1(6ff924627c179868a25f180f79cd57182b72d9d4) )
839   ROM_LOAD( "7",  0x280000, 0x80000, CRC(20f87a15) SHA1(cb60866a3543668f3592c270b445dee881d78128) ) // the same as newer sets?
840   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
841ROM_END
842
843ROM_START( fcock_4 ) // 031028
844   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
845   ROM_LOAD( "fc031028.rom", 0x00000, 0x40000, MD5(ffab543f86538d4717da7cf20d97e3d1) SHA1(18a0ac6e3c6f1d6ae7aeae5322e6b6617923cfdf) )
846
847   ROM_REGION( 0x400000, "gfx", 0 )
848   ROM_LOAD( "1b", 0x000000, 0x80000, CRC(da72c0bb) SHA1(41c9eebccce82520dfe41d6a3a574b2890945ffa) )
849   ROM_LOAD( "2b", 0x100000, 0x80000, CRC(6239ba9d) SHA1(22486ad30c28341784e7e490255247b82782b72e) )
850   ROM_LOAD( "3b", 0x200000, 0x80000, CRC(2c14a464) SHA1(5fce2f4ef95c5054b055db94399946257bc7321f) )
851   ROM_LOAD( "4b", 0x300000, 0x80000, CRC(115898f4) SHA1(55b93bddaeede1c2f6b18083a6a2e6329af087cc) )
852   ROM_LOAD( "5b", 0x080000, 0x80000, CRC(f0176b60) SHA1(f764aea00ed306a28cacc62f8d2db9cc42895db8) )
853   ROM_LOAD( "6b", 0x180000, 0x80000, CRC(ef24f255) SHA1(6ff924627c179868a25f180f79cd57182b72d9d4) )
854   ROM_LOAD( "7",  0x280000, 0x80000, CRC(20f87a15) SHA1(cb60866a3543668f3592c270b445dee881d78128) ) // the same as newer sets?
855   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
856ROM_END
857
858
859ROM_START( fcock_5 ) // 031111
860   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
861   ROM_LOAD( "fc031111.rom", 0x00000, 0x40000, MD5(6df6a06bf0c4df16b6f4d76493d31a39) SHA1(7cc9aeb88a2923f6c5c176abcd6c6b241b353eab) )
862
863   ROM_REGION( 0x400000, "gfx", 0 )
864   ROM_LOAD( "1b", 0x000000, 0x80000, CRC(da72c0bb) SHA1(41c9eebccce82520dfe41d6a3a574b2890945ffa) )
865   ROM_LOAD( "2b", 0x100000, 0x80000, CRC(6239ba9d) SHA1(22486ad30c28341784e7e490255247b82782b72e) )
866   ROM_LOAD( "3b", 0x200000, 0x80000, CRC(2c14a464) SHA1(5fce2f4ef95c5054b055db94399946257bc7321f) )
867   ROM_LOAD( "4b", 0x300000, 0x80000, CRC(115898f4) SHA1(55b93bddaeede1c2f6b18083a6a2e6329af087cc) )
868   ROM_LOAD( "5b", 0x080000, 0x80000, CRC(f0176b60) SHA1(f764aea00ed306a28cacc62f8d2db9cc42895db8) )
869   ROM_LOAD( "6b", 0x180000, 0x80000, CRC(ef24f255) SHA1(6ff924627c179868a25f180f79cd57182b72d9d4) )
870   ROM_LOAD( "7",  0x280000, 0x80000, CRC(20f87a15) SHA1(cb60866a3543668f3592c270b445dee881d78128) ) // the same as newer sets?
871   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
872ROM_END
873
874
875ROM_START( fcock_6 ) // 040216
876   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
877   ROM_LOAD( "fc040216.rom", 0x00000, 0x40000, CRC(d12b0201) SHA1(09f4b0b5239609ebf13e643782d1881920a1203d) )
878
879   ROM_REGION( 0x400000, "gfx", 0 )
880   ROM_LOAD( "1b", 0x000000, 0x80000, CRC(da72c0bb) SHA1(41c9eebccce82520dfe41d6a3a574b2890945ffa) )
881   ROM_LOAD( "2b", 0x100000, 0x80000, CRC(6239ba9d) SHA1(22486ad30c28341784e7e490255247b82782b72e) )
882   ROM_LOAD( "3b", 0x200000, 0x80000, CRC(2c14a464) SHA1(5fce2f4ef95c5054b055db94399946257bc7321f) )
883   ROM_LOAD( "4b", 0x300000, 0x80000, CRC(115898f4) SHA1(55b93bddaeede1c2f6b18083a6a2e6329af087cc) )
884   ROM_LOAD( "5b", 0x080000, 0x80000, CRC(f0176b60) SHA1(f764aea00ed306a28cacc62f8d2db9cc42895db8) )
885   ROM_LOAD( "6b", 0x180000, 0x80000, CRC(ef24f255) SHA1(6ff924627c179868a25f180f79cd57182b72d9d4) )
886   ROM_LOAD( "7",  0x280000, 0x80000, CRC(20f87a15) SHA1(cb60866a3543668f3592c270b445dee881d78128) ) // the same as newer sets?
887   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
888ROM_END
889
890
891/*********************************************************
892   Lucky Haunter
893**********************************************************/
894
895ROM_START( lhaunt ) // 030707
896   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
897   ROM_LOAD( "lh030707.rom", 0x00000, 0x40000, MD5(f2e42fb479888c21351e3029025e6700) SHA1(c7b8e1b98cd0aa665d62c1652716993539c9f3ef) )
898
899   ROM_REGION( 0x400000, "gfx", 0 )
900   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(5f1000c6) SHA1(05154d786caf7f5fb9ed90c7d3391cec42e871f8) )
901   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b18abebc) SHA1(66c28fd3f338360b9236dcf414548bfb53655951) )
902   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(2e67a1d9) SHA1(a3eff78f25e4e4878706d7c9e4ca71f6914006c6) )
903   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(90c963f6) SHA1(2a9c689315cdfb67425f0710511dc0e0241741a7) )
904   ROM_LOAD( "5", 0x080000, 0x80000, CRC(b50c90a3) SHA1(74749f4ffb5b0630631b511fc3230c6e7b50dc3b) )
905   ROM_LOAD( "6", 0x180000, 0x80000, CRC(4eaaab64) SHA1(9fed16f8e0308200fd16c4b1e511e1bf6c22ae66) )
906   ROM_LOAD( "7", 0x280000, 0x80000, CRC(64d16ba9) SHA1(3b897183d6e0f1256be7657441f234fc72077682) )
907   ROM_LOAD( "8", 0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
908ROM_END
909
910
911ROM_START( lhaunt_2 ) // 030804
912   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
913   ROM_LOAD( "lh030804.rom", 0x00000, 0x40000, MD5(01352f3dd0e7d301f8edfb170600e2a1) SHA1(b75702a678d716cd0ccb1f2d1e58c1d3e9f7ca98) )
914
915   ROM_REGION( 0x400000, "gfx", 0 )
916   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(5f1000c6) SHA1(05154d786caf7f5fb9ed90c7d3391cec42e871f8) )
917   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b18abebc) SHA1(66c28fd3f338360b9236dcf414548bfb53655951) )
918   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(2e67a1d9) SHA1(a3eff78f25e4e4878706d7c9e4ca71f6914006c6) )
919   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(90c963f6) SHA1(2a9c689315cdfb67425f0710511dc0e0241741a7) )
920   ROM_LOAD( "5", 0x080000, 0x80000, CRC(b50c90a3) SHA1(74749f4ffb5b0630631b511fc3230c6e7b50dc3b) )
921   ROM_LOAD( "6", 0x180000, 0x80000, CRC(4eaaab64) SHA1(9fed16f8e0308200fd16c4b1e511e1bf6c22ae66) )
922   ROM_LOAD( "7", 0x280000, 0x80000, CRC(64d16ba9) SHA1(3b897183d6e0f1256be7657441f234fc72077682) )
923   ROM_LOAD( "8", 0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
924ROM_END
925
926
927ROM_START( lhaunt_3 ) // 031027
928   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
929   ROM_LOAD( "lh031027.rom", 0x00000, 0x40000, MD5(49b1cf6f89d03b36c5f80d0ccfc23aa2) SHA1(caec736dde2878588ab197ba37801cf7a9ed975b) )
930
931   ROM_REGION( 0x400000, "gfx", 0 )
932   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(5f1000c6) SHA1(05154d786caf7f5fb9ed90c7d3391cec42e871f8) )
933   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b18abebc) SHA1(66c28fd3f338360b9236dcf414548bfb53655951) )
934   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(2e67a1d9) SHA1(a3eff78f25e4e4878706d7c9e4ca71f6914006c6) )
935   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(90c963f6) SHA1(2a9c689315cdfb67425f0710511dc0e0241741a7) )
936   ROM_LOAD( "5", 0x080000, 0x80000, CRC(b50c90a3) SHA1(74749f4ffb5b0630631b511fc3230c6e7b50dc3b) )
937   ROM_LOAD( "6", 0x180000, 0x80000, CRC(4eaaab64) SHA1(9fed16f8e0308200fd16c4b1e511e1bf6c22ae66) )
938   ROM_LOAD( "7", 0x280000, 0x80000, CRC(64d16ba9) SHA1(3b897183d6e0f1256be7657441f234fc72077682) )
939   ROM_LOAD( "8", 0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
940ROM_END
941
942
943ROM_START( lhaunt_4 ) // 031111
944   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
945   ROM_LOAD( "lh031111.rom", 0x00000, 0x40000, CRC(fc357b75) SHA1(512e4f57612851284bb93ba97c276cbc7cb758d9) )
946
947   ROM_REGION( 0x400000, "gfx", 0 )
948   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(5f1000c6) SHA1(05154d786caf7f5fb9ed90c7d3391cec42e871f8) )
949   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b18abebc) SHA1(66c28fd3f338360b9236dcf414548bfb53655951) )
950   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(2e67a1d9) SHA1(a3eff78f25e4e4878706d7c9e4ca71f6914006c6) )
951   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(90c963f6) SHA1(2a9c689315cdfb67425f0710511dc0e0241741a7) )
952   ROM_LOAD( "5", 0x080000, 0x80000, CRC(b50c90a3) SHA1(74749f4ffb5b0630631b511fc3230c6e7b50dc3b) )
953   ROM_LOAD( "6", 0x180000, 0x80000, CRC(4eaaab64) SHA1(9fed16f8e0308200fd16c4b1e511e1bf6c22ae66) )
954   ROM_LOAD( "7", 0x280000, 0x80000, CRC(64d16ba9) SHA1(3b897183d6e0f1256be7657441f234fc72077682) )
955   ROM_LOAD( "8", 0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
956ROM_END
957
958ROM_START( lhaunt_5 ) // 040216
959   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
960   ROM_LOAD( "lh040216.rom", 0x00000, 0x40000, CRC(558d8345) SHA1(30a87902b291413b1e6eaad6bf4964c54e391e23) )
961
962   ROM_REGION( 0x400000, "gfx", 0 )
963   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(5f1000c6) SHA1(05154d786caf7f5fb9ed90c7d3391cec42e871f8) )
964   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b18abebc) SHA1(66c28fd3f338360b9236dcf414548bfb53655951) )
965   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(2e67a1d9) SHA1(a3eff78f25e4e4878706d7c9e4ca71f6914006c6) )
966   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(90c963f6) SHA1(2a9c689315cdfb67425f0710511dc0e0241741a7) )
967   ROM_LOAD( "5", 0x080000, 0x80000, CRC(b50c90a3) SHA1(74749f4ffb5b0630631b511fc3230c6e7b50dc3b) )
968   ROM_LOAD( "6", 0x180000, 0x80000, CRC(4eaaab64) SHA1(9fed16f8e0308200fd16c4b1e511e1bf6c22ae66) )
969   ROM_LOAD( "7", 0x280000, 0x80000, CRC(64d16ba9) SHA1(3b897183d6e0f1256be7657441f234fc72077682) )
970   ROM_LOAD( "8", 0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
971ROM_END
972
973ROM_START( lhaunt_6 ) // 040825
974   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
975   ROM_LOAD( "lh040825.rom", 0x00000, 0x40000, CRC(f9924fa1) SHA1(57a1730fef4963d30f3991f27021647a8c681952) )
976
977   ROM_REGION( 0x400000, "gfx", 0 )
978   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(5f1000c6) SHA1(05154d786caf7f5fb9ed90c7d3391cec42e871f8) )
979   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b18abebc) SHA1(66c28fd3f338360b9236dcf414548bfb53655951) )
980   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(2e67a1d9) SHA1(a3eff78f25e4e4878706d7c9e4ca71f6914006c6) )
981   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(90c963f6) SHA1(2a9c689315cdfb67425f0710511dc0e0241741a7) )
982   ROM_LOAD( "5", 0x080000, 0x80000, CRC(b50c90a3) SHA1(74749f4ffb5b0630631b511fc3230c6e7b50dc3b) )
983   ROM_LOAD( "6", 0x180000, 0x80000, CRC(4eaaab64) SHA1(9fed16f8e0308200fd16c4b1e511e1bf6c22ae66) )
984   ROM_LOAD( "7", 0x280000, 0x80000, CRC(64d16ba9) SHA1(3b897183d6e0f1256be7657441f234fc72077682) )
985   ROM_LOAD( "8", 0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
986ROM_END
987
988/*********************************************************
989   Garage
990**********************************************************/
991
992ROM_START( garage ) // 040122.
993   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
994   ROM_LOAD( "gg040122.rom", 0x00000, 0x40000, MD5(b1fca0a1293d6891171b168ade2112c0) SHA1(327e55d1f4bdc0ad0556faa2fbdaa05b9a5f1c16) )
995
996   ROM_REGION( 0x400000, "gfx", 0 )
997   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(57acd4bc) SHA1(8796f463787c359cce6ac09c1b6895f871bbb7c9) )
998   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(6d591fa3) SHA1(ddbdf87e0e88dc848b963fbfcb6e14d7b3b9efdc) )
999   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(6a15eeda) SHA1(ac35a20893b0518a159207401f6b7f58e3de45fa) )
1000   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(38f2cd3c) SHA1(5a4463ac352e4e340c6aaa61102841541e9f4c48) )
1001   ROM_LOAD( "5", 0x080000, 0x80000, CRC(5bf85bc5) SHA1(ff9d2b9cbcd2af6f5fda972e387820d830c196a9) )
1002   ROM_LOAD( "6", 0x180000, 0x80000, CRC(e5082b26) SHA1(6547409d39dd51498ce8e3f82ff813a8ac3c6522) )
1003   ROM_LOAD( "7", 0x280000, 0x80000, CRC(dfa2ceb1) SHA1(ec7de8a8f6e7785a563df973841cc1f1603f79fc) )
1004   ROM_LOAD( "8", 0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
1005ROM_END
1006
1007
1008ROM_START( garage_2 ) // 040123.
1009   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1010   ROM_LOAD( "gg040123.rom", 0x00000, 0x40000, MD5(7b66e7c7b9ddf74bd344a626c64fce5e) SHA1(3051c99d22cfe46b532fcc59a0b98eec186f4a76) )
1011
1012   ROM_REGION( 0x400000, "gfx", 0 )
1013   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(57acd4bc) SHA1(8796f463787c359cce6ac09c1b6895f871bbb7c9) )
1014   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(6d591fa3) SHA1(ddbdf87e0e88dc848b963fbfcb6e14d7b3b9efdc) )
1015   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(6a15eeda) SHA1(ac35a20893b0518a159207401f6b7f58e3de45fa) )
1016   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(38f2cd3c) SHA1(5a4463ac352e4e340c6aaa61102841541e9f4c48) )
1017   ROM_LOAD( "5", 0x080000, 0x80000, CRC(5bf85bc5) SHA1(ff9d2b9cbcd2af6f5fda972e387820d830c196a9) )
1018   ROM_LOAD( "6", 0x180000, 0x80000, CRC(e5082b26) SHA1(6547409d39dd51498ce8e3f82ff813a8ac3c6522) )
1019   ROM_LOAD( "7", 0x280000, 0x80000, CRC(dfa2ceb1) SHA1(ec7de8a8f6e7785a563df973841cc1f1603f79fc) )
1020   ROM_LOAD( "8", 0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
1021ROM_END
1022
1023ROM_START( garage_3 ) // 040216.
1024   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1025   ROM_LOAD( "gg040216.rom", 0x00000, 0x40000, MD5(9d89036118ece87c98bb9b64021014ff) SHA1(321c4106ce07e195a05eacdef6387d61d5e58bb9) )
1026
1027   ROM_REGION( 0x400000, "gfx", 0 )
1028   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(57acd4bc) SHA1(8796f463787c359cce6ac09c1b6895f871bbb7c9) )
1029   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(6d591fa3) SHA1(ddbdf87e0e88dc848b963fbfcb6e14d7b3b9efdc) )
1030   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(6a15eeda) SHA1(ac35a20893b0518a159207401f6b7f58e3de45fa) )
1031   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(38f2cd3c) SHA1(5a4463ac352e4e340c6aaa61102841541e9f4c48) )
1032   ROM_LOAD( "5", 0x080000, 0x80000, CRC(5bf85bc5) SHA1(ff9d2b9cbcd2af6f5fda972e387820d830c196a9) )
1033   ROM_LOAD( "6", 0x180000, 0x80000, CRC(e5082b26) SHA1(6547409d39dd51498ce8e3f82ff813a8ac3c6522) )
1034   ROM_LOAD( "7", 0x280000, 0x80000, CRC(dfa2ceb1) SHA1(ec7de8a8f6e7785a563df973841cc1f1603f79fc) )
1035   ROM_LOAD( "8", 0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
1036ROM_END
1037
1038ROM_START( garage_4 ) // 040219.
1039   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1040   ROM_LOAD( "gg040219.rom", 0x00000, 0x40000, CRC(49fe4a55) SHA1(df55df0065b4718d2b0c7ff3da85f5d66c2dd95f) )
1041
1042   ROM_REGION( 0x400000, "gfx", 0 )
1043   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(57acd4bc) SHA1(8796f463787c359cce6ac09c1b6895f871bbb7c9) )
1044   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(6d591fa3) SHA1(ddbdf87e0e88dc848b963fbfcb6e14d7b3b9efdc) )
1045   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(6a15eeda) SHA1(ac35a20893b0518a159207401f6b7f58e3de45fa) )
1046   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(38f2cd3c) SHA1(5a4463ac352e4e340c6aaa61102841541e9f4c48) )
1047   ROM_LOAD( "5", 0x080000, 0x80000, CRC(5bf85bc5) SHA1(ff9d2b9cbcd2af6f5fda972e387820d830c196a9) )
1048   ROM_LOAD( "6", 0x180000, 0x80000, CRC(e5082b26) SHA1(6547409d39dd51498ce8e3f82ff813a8ac3c6522) )
1049   ROM_LOAD( "7", 0x280000, 0x80000, CRC(dfa2ceb1) SHA1(ec7de8a8f6e7785a563df973841cc1f1603f79fc) )
1050   ROM_LOAD( "8", 0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
1051ROM_END
1052
1053/*********************************************************
1054   Rock Clibmer
1055**********************************************************/
1056
1057ROM_START( rclimb ) // 040815
1058   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1059   ROM_LOAD( "rc040815.rom", 0x00000, 0x40000, MD5(82c3ee54f8112c0d0f8007c7e87bb8a2) SHA1(593e64bfe57ba271c04bdd2a35c9484c4efaaa00))
1060
1061   ROM_REGION( 0x400000, "gfx", 0 )
1062   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(934f18c7) SHA1(da3a7cddc68e104d415d947e89c0e7f0d067c056) )
1063   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(7364bd2b) SHA1(c0edfd3b8de813c95fe5d6072662fa0e39fec89e) )
1064   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(e7befb17) SHA1(8a214680142cd657784a667ab3f6422165fea224) )
1065   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(dc6d43a0) SHA1(62fc47136775f3fa9369857ec91fe897a1f1ebd6) )
1066   ROM_LOAD( "5", 0x080000, 0x80000, CRC(ea127c3d) SHA1(a6391eed69a4723b68d727f59b6baebe51633e66) )
1067   ROM_LOAD( "6", 0x180000, 0x80000, CRC(277fa273) SHA1(6320e6c5b5e48dc451cc48189054c42d85e8ccc1) )
1068   ROM_LOAD( "7", 0x280000, 0x80000, CRC(3ca7f69a) SHA1(878cca181d915dc3548d5285a4bbb51aef31a64e) )
1069   ROM_LOAD( "8", 0x380000, 0x80000, CRC(8cf6b4c2) SHA1(4c36c217b83c82acfdd615f5547bf597af7b8833) )
1070ROM_END
1071
1072ROM_START( rclimb_2 ) // 040823
1073   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1074   ROM_LOAD( "rc040823.rom", 0x00000, 0x40000, MD5(f3f5edf6f838f07f4848fbcf9e566a38) SHA1(31cf4d7f50102d35556817273893182e30c9a70c) )
1075
1076   ROM_REGION( 0x400000, "gfx", 0 )
1077   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(934f18c7) SHA1(da3a7cddc68e104d415d947e89c0e7f0d067c056) )
1078   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(7364bd2b) SHA1(c0edfd3b8de813c95fe5d6072662fa0e39fec89e) )
1079   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(e7befb17) SHA1(8a214680142cd657784a667ab3f6422165fea224) )
1080   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(dc6d43a0) SHA1(62fc47136775f3fa9369857ec91fe897a1f1ebd6) )
1081   ROM_LOAD( "5", 0x080000, 0x80000, CRC(ea127c3d) SHA1(a6391eed69a4723b68d727f59b6baebe51633e66) )
1082   ROM_LOAD( "6", 0x180000, 0x80000, CRC(277fa273) SHA1(6320e6c5b5e48dc451cc48189054c42d85e8ccc1) )
1083   ROM_LOAD( "7", 0x280000, 0x80000, CRC(3ca7f69a) SHA1(878cca181d915dc3548d5285a4bbb51aef31a64e) )
1084   ROM_LOAD( "8", 0x380000, 0x80000, CRC(8cf6b4c2) SHA1(4c36c217b83c82acfdd615f5547bf597af7b8833) )
1085ROM_END
1086
1087ROM_START( rclimb_3 ) // 040827
1088   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1089   ROM_LOAD( "rc040827.rom", 0x00000, 0x40000, CRC(3ba55647) SHA1(56e96be0d9782da4b3d5d911ea67962257626ae0) )
1090
1091   ROM_REGION( 0x400000, "gfx", 0 )
1092   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(934f18c7) SHA1(da3a7cddc68e104d415d947e89c0e7f0d067c056) )
1093   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(7364bd2b) SHA1(c0edfd3b8de813c95fe5d6072662fa0e39fec89e) )
1094   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(e7befb17) SHA1(8a214680142cd657784a667ab3f6422165fea224) )
1095   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(dc6d43a0) SHA1(62fc47136775f3fa9369857ec91fe897a1f1ebd6) )
1096   ROM_LOAD( "5", 0x080000, 0x80000, CRC(ea127c3d) SHA1(a6391eed69a4723b68d727f59b6baebe51633e66) )
1097   ROM_LOAD( "6", 0x180000, 0x80000, CRC(277fa273) SHA1(6320e6c5b5e48dc451cc48189054c42d85e8ccc1) )
1098   ROM_LOAD( "7", 0x280000, 0x80000, CRC(3ca7f69a) SHA1(878cca181d915dc3548d5285a4bbb51aef31a64e) )
1099   ROM_LOAD( "8", 0x380000, 0x80000, CRC(8cf6b4c2) SHA1(4c36c217b83c82acfdd615f5547bf597af7b8833) )
1100ROM_END
1101
1102/*********************************************************
1103   Sweet Life
1104**********************************************************/
1105
1106ROM_START( sweetl ) // 041220
1107   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1108   ROM_LOAD( "sl041220.rom", 0x00000, 0x40000, CRC(851b85c6) SHA1(a5db94d94fe82d06f3fac1c16aed5358fcb92f29) )
1109
1110   ROM_REGION( 0x400000, "gfx", 0 )
1111   ROM_LOAD( "1", 0x000000, 0x80000, CRC(a096c786) SHA1(81f6b083cb089e9412a8506889196354c670d945) )
1112   ROM_LOAD( "2", 0x100000, 0x80000, CRC(c5e1e22c) SHA1(973ad27681a0f3beee7084b1b85fc9deb79d638e) )
1113   ROM_LOAD( "3", 0x200000, 0x80000, CRC(af335323) SHA1(b8afdce231a8ec0f313cc47e00a27f05461bbbc4) )
1114   ROM_LOAD( "4", 0x300000, 0x80000, CRC(a35c7503) SHA1(78f7a868660bbaa066e8e9e341db52018aaf3af1) )
1115   ROM_LOAD( "5", 0x080000, 0x80000, CRC(e2d6b632) SHA1(65d05e55671b8c335cae2dfbf6a6f5bd8cc90e2c) )
1116   ROM_LOAD( "6", 0x180000, 0x80000, CRC(d34e0905) SHA1(cc4afe64fb9052a31f759be41ff07a727e0a9093) )
1117   ROM_LOAD( "7", 0x280000, 0x80000, CRC(978b67bb) SHA1(87357d5832588f00272bd76df736c06c599f3853) )
1118   ROM_LOAD( "8", 0x380000, 0x80000, CRC(75954355) SHA1(e6ef2b70d859b61e8e3d1751de8558b8778e502d) )
1119ROM_END
1120
1121/*********************************************************
1122   Resident
1123**********************************************************/
1124
1125ROM_START( resdnt ) // 040415
1126   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1127   ROM_LOAD( "rs040415.rom", 0x00000, 0x40000, MD5(a46e993839a7ce5c4a3d90ba0e961e69) SHA1(b9f07bc2765d4f366e548007e51b9f605c884ba1) )
1128
1129   ROM_REGION( 0x400000, "gfx", 0 )
1130   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(e0645da6) SHA1(dd72f4830d8011f603aa6d430f34ac2598005281) )
1131   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(dd8de247) SHA1(498c5b931ce65e289f52d8864b603166f81e3dc4) )
1132   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(0d346ec2) SHA1(e2456b28825c54c5e16829525627c40611c0083d) )
1133   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(1f95aad9) SHA1(51d003288d5ff23b3c981fbaa99d29b66dd2c101) )
1134   ROM_LOAD( "5", 0x080000, 0x80000, CRC(0cfe7d44) SHA1(9f0e4925e815ff9f79188f18e78c0a7b377daa3f) )
1135   ROM_LOAD( "6", 0x180000, 0x80000, CRC(7437904f) SHA1(630c79cd6a990ce7658a1ffabba5a27efba985a1) )
1136   ROM_LOAD( "7", 0x280000, 0x80000, CRC(6e94728a) SHA1(ab414879cb957d9bc8d653b5e3bb2bbf91139ec0) )
1137   ROM_LOAD( "8", 0x380000, 0x80000, CRC(a9f55043) SHA1(4771df3d45bdc0a21b1c479f45e09ac5bab6c94f) )
1138ROM_END
1139
1140ROM_START( resdnt_2 ) // 040513
1141   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1142   ROM_LOAD( "rs040513.rom", 0x00000, 0x40000, CRC(95f74cb3) SHA1(2e4862ac0ad86899b8ce12580ebd217dfb74f6a2) )
1143
1144   ROM_REGION( 0x400000, "gfx", 0 )
1145   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(e0645da6) SHA1(dd72f4830d8011f603aa6d430f34ac2598005281) )
1146   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(dd8de247) SHA1(498c5b931ce65e289f52d8864b603166f81e3dc4) )
1147   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(0d346ec2) SHA1(e2456b28825c54c5e16829525627c40611c0083d) )
1148   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(1f95aad9) SHA1(51d003288d5ff23b3c981fbaa99d29b66dd2c101) )
1149   ROM_LOAD( "5", 0x080000, 0x80000, CRC(0cfe7d44) SHA1(9f0e4925e815ff9f79188f18e78c0a7b377daa3f) )
1150   ROM_LOAD( "6", 0x180000, 0x80000, CRC(7437904f) SHA1(630c79cd6a990ce7658a1ffabba5a27efba985a1) )
1151   ROM_LOAD( "7", 0x280000, 0x80000, CRC(6e94728a) SHA1(ab414879cb957d9bc8d653b5e3bb2bbf91139ec0) )
1152   ROM_LOAD( "8", 0x380000, 0x80000, CRC(a9f55043) SHA1(4771df3d45bdc0a21b1c479f45e09ac5bab6c94f) )
1153ROM_END
1154
1155/*********************************************************
1156   Roll Fruit
1157**********************************************************/
1158
1159ROM_START( rollfr ) // 030821
1160   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1161   ROM_LOAD( "rf030821.rom", 0x00000, 0x40000, MD5(ef4e9d1845676fe655d2f415ca7bd953) SHA1(5e9c2235ea4207086db23870993d8e28356c9eb8) )
1162
1163   ROM_REGION( 0x400000, "gfx", 0 ) // no gfx roms listed in dat..
1164   ROM_LOAD( "1", 0x000000, 0x80000, MD5(0454d9eb65543d84d24f408727cb9ac1) SHA1(14b9f99f892849faecb3327e572dc134e1065463) )
1165   ROM_LOAD( "2", 0x100000, 0x80000, MD5(ce5c575474407ecde9c43e01418f8f4a) SHA1(a247bbbd1c4ca99978dcc705bd62590815a891f2) )
1166   ROM_LOAD( "3", 0x200000, 0x80000, MD5(eac0f328e620fca521f5efa778393df0) SHA1(c2553136252aebe3b3ce0b5c33e740d0e27fb7b2) )
1167   ROM_LOAD( "4", 0x300000, 0x80000, MD5(76c7538d4b422a7f6a31acd46771ff09) SHA1(4c50ce17bd5714149eae91279a0133059397b776) )
1168   ROM_LOAD( "5", 0x080000, 0x80000, MD5(4a1fb67e2bd1bb46588c1525403c2739) SHA1(684b7b370fcad07bf74bddffaf432bd52e5d29e2) )
1169   ROM_LOAD( "6", 0x180000, 0x80000, MD5(9b0c24815eb969eeb91ab8c43e4776b3) SHA1(73700e88358ed9bccbb63643b7daaff416737e43) )
1170   ROM_LOAD( "7", 0x280000, 0x80000, MD5(088c3eee9f8db9112740be800a809a4d) SHA1(c0f006cf2a4747359cb79f14976ac3411951af1c) )
1171   ROM_LOAD( "8", 0x380000, 0x80000, MD5(532c2ac982cebd221430cd62f84a9534) SHA1(8ec808069053f0c07d81c45090b2ba22ef8e9c32) )
1172ROM_END
1173
1174ROM_START( rollfr_2 ) // 040318
1175   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1176   ROM_LOAD( "rf040318.rom", 0x00000, 0x40000, MD5(fbf850ce559e623282ee6d6378625372) SHA1(71edd1541df400fef97abacabb10d882ace4c8b0) )
1177
1178   ROM_REGION( 0x400000, "gfx", 0 ) // no gfx roms listed in dat..
1179   ROM_LOAD( "1", 0x000000, 0x80000, MD5(0454d9eb65543d84d24f408727cb9ac1) SHA1(14b9f99f892849faecb3327e572dc134e1065463) )
1180   ROM_LOAD( "2", 0x100000, 0x80000, MD5(ce5c575474407ecde9c43e01418f8f4a) SHA1(a247bbbd1c4ca99978dcc705bd62590815a891f2) )
1181   ROM_LOAD( "3", 0x200000, 0x80000, MD5(eac0f328e620fca521f5efa778393df0) SHA1(c2553136252aebe3b3ce0b5c33e740d0e27fb7b2) )
1182   ROM_LOAD( "4", 0x300000, 0x80000, MD5(76c7538d4b422a7f6a31acd46771ff09) SHA1(4c50ce17bd5714149eae91279a0133059397b776) )
1183   ROM_LOAD( "5", 0x080000, 0x80000, MD5(4a1fb67e2bd1bb46588c1525403c2739) SHA1(684b7b370fcad07bf74bddffaf432bd52e5d29e2) )
1184   ROM_LOAD( "6", 0x180000, 0x80000, MD5(9b0c24815eb969eeb91ab8c43e4776b3) SHA1(73700e88358ed9bccbb63643b7daaff416737e43) )
1185   ROM_LOAD( "7", 0x280000, 0x80000, MD5(088c3eee9f8db9112740be800a809a4d) SHA1(c0f006cf2a4747359cb79f14976ac3411951af1c) )
1186   ROM_LOAD( "8", 0x380000, 0x80000, MD5(532c2ac982cebd221430cd62f84a9534) SHA1(8ec808069053f0c07d81c45090b2ba22ef8e9c32) )
1187ROM_END
1188
1189/*********************************************************
1190   Island
1191**********************************************************/
1192
1193ROM_START( island ) // 050713
1194   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1195   ROM_LOAD( "is050713.rom", 0x00000, 0x40000, CRC(26c7013e) SHA1(5d604f5b4859e9e82830424a1e21f32a9e49bf34) )
1196
1197   ROM_REGION( 0x400000, "gfx", 0 )
1198   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(dbe8cdda) SHA1(4747cf0d85afdef22d3ba9fa5e75b39548725745) )
1199   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(64064745) SHA1(91a7bc7204a8f7a7512eeaf4906da20a9f587565) )
1200   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(1d993f68) SHA1(b0459d3941d50668f7533909e3f3da91453d3efd) )
1201   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(a4739404) SHA1(8f7ffcc13dcb35adfa8060ab1930d07195b6110c) )
1202   ROM_LOAD( "5a", 0x080000, 0x80000, CRC(d016eb31) SHA1(a84f18af470f72730b241b9031cd6131c8a03db2) )
1203   ROM_LOAD( "6a", 0x180000, 0x80000, CRC(0faaa968) SHA1(0f05546e6e0559e24c6afdde65b3feeb66b6adff) )
1204   ROM_LOAD( "7a", 0x280000, 0x80000, CRC(d7277a6c) SHA1(d96a0befc965ad22087381982305d68208978a7e) )
1205   ROM_LOAD( "8a", 0x380000, 0x80000, CRC(ac6fba48) SHA1(64dd03d624f16da52bc7fa0702246e91ae39a806) )
1206ROM_END
1207
1208
6771209#if ALL_REVISIONS /* Multifish sets verified against dat */
678GAME(   2004, mfish,      0,       multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040316)",  0 )
679GAME(   2004, mfish_2,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 1)",  0 )
680GAME(   2004, mfish_2a,   mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 2, hack?)",  0 )
681GAME(   2003, mfish_3,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031124)",  0 )
682GAME(   2003, mfish_4,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031117)",  0 )
683GAME(   2003, mfish_5,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031026)",  0 )
684GAME(   2003, mfish_6,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030522)",  0 )
685GAME(   2003, mfish_7,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030511)",  0 )
686GAME(   2003, mfish_8,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030124)",  0 )
687GAME(   2002, mfish_9,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021227)",  0 )
688GAME(   2002, mfish_10,   mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021219)",  0 )
689GAME(   2002, mfish_11,   mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021124)",  0 )
690GAME(   2002, mfish_12,   mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021121)",  0 )
691GAME(   2002, mfish_13,   mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021120)",  0 )
1210GAME(   2002, mfish,    0,        multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021120)",  0 )
1211GAME(   2002, mfish_2,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021121)",  0 )
1212GAME(   2002, mfish_3,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021124)",  0 )
1213GAME(   2002, mfish_4,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021219)",  0 )
1214GAME(   2002, mfish_5,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021227)",  0 )
1215GAME(   2002, mfish_6,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030124)",  0 )
1216GAME(   2002, mfish_7,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030511)",  0 )
1217GAME(   2002, mfish_8,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030522)",  0 )
1218GAME(   2002, mfish_9,  mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031026)",  0 )
1219GAME(   2002, mfish_10, mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031117)",  0 )
1220GAME(   2002, mfish_11, mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031124)",  0 )
1221GAME(   2002, mfish_12, mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 1)",  0 )
1222GAME(   2002, mfish_12a mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 2, hack?)",  0 )
1223GAME(   2002, mfish_13, mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040316)",  0 )
1224
6921225#else /* Multifish sets for which SHA1 information is available */
693GAME(   2004, mfish_2,    0,       multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 1)",  0 )
694GAME(   2004, mfish_2a,   mfish_2,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 2, hack?)",  0 )
1226GAME(   2004, mfish_12,    0,       multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 1)",  0 )
1227GAME(   2004, mfish_12a,   mfish_12,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 2, hack?)",  0 )
6951228#endif
6961229
1230#if ALL_REVISIONS /* Crazy Monkey sets checked against dat */
1231GAME(   2003, crzmon,      0,       multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030217)",  0 )
1232GAME(   2003, crzmon_2,    crzmon,    multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030225)",  0 )
1233GAME(   2003, crzmon_3,    crzmon,    multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030227)",  0 )
1234GAME(   2003, crzmon_4,    crzmon,    multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030404)",  0 )
1235GAME(   2003, crzmon_5,    crzmon,    multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030421)",  0 )
1236GAME(   2003, crzmon_6,    crzmon,    multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031016)",  0 )
1237GAME(   2003, crzmon_7,    crzmon,    multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110)",  0 )
1238#else
1239GAME(   2003, crzmon_7,    0,       multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110)",  0 )
1240#endif
6971241
1242#if ALL_REVISIONS  /* Fruit Cocktail sets checked against dat */
1243GAME(   2003, fcock,    0,       multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030505)",  0 )
1244GAME(   2003, fcock_2,  fcock,    multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030512)",  0 )
1245GAME(   2003, fcock_3,  fcock,    multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030623)",  0 )
1246GAME(   2003, fcock_4,  fcock,    multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (031028)",  0 )
1247GAME(   2003, fcock_5,  fcock,    multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (031111)",  0 )
1248GAME(   2003, fcock_6,  fcock,    multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216)",  0 )
1249#else
1250GAME(   2003, fcock_6,  0,       multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216)",  0 )
1251#endif
6981252
1253#if ALL_REVISIONS /* Lucky Hanter sets checked against dat */
1254GAME(   2003, lhaunt,    0,       multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (030707)",  0 )
1255GAME(   2003, lhaunt_2,  lhaunt,    multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (030804)",  0 )
1256GAME(   2003, lhaunt_3,  lhaunt,    multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031027)",  0 )
1257GAME(   2003, lhaunt_4,  lhaunt,    multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031111)",  0 )
1258GAME(   2003, lhaunt_5,  lhaunt,    multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040216)",  0 )
1259GAME(   2003, lhaunt_6,  lhaunt,    multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040825)",  0 )
1260#else
1261GAME(   2003, lhaunt_4,  0,       multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031111)",  0 )
1262GAME(   2003, lhaunt_5,  lhaunt_4,  multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040216)",  0 )
1263GAME(   2003, lhaunt_6,  lhaunt_4,  multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040825)",  0 )
1264#endif
6991265
7001266
1267#if ALL_REVISIONS /* Garage sets verified against dat */
1268GAME(   2004, garage,    0,     multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040122)",  0 )
1269GAME(   2004, garage_2,  garage,  multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040123)",  0 )
1270GAME(   2004, garage_3,  garage,  multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040216)",  0 )
1271GAME(   2004, garage_4,  garage,  multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040219)",  0 )
1272#else
1273GAME(   2004, garage_4,  0,     multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040219)",  0 )
1274#endif
1275
1276
1277#if ALL_REVISIONS /* Rock Climber sets checked against dat */
1278GAME(   2004, rclimb,    0,     multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040815)", 0 )
1279GAME(   2004, rclimb_2,  rclimb,  multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040823)", 0 )
1280GAME(   2004, rclimb_3,  rclimb,  multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827)", 0 )
1281#else
1282GAME(   2004, rclimb_3,  0,     multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827)", 0 )
1283#endif
1284
1285/* Sweet Life sets checked against dat */
1286GAME(   2004, sweetl,    0,    multfish, multfish,  0, ROT0, "Igrosoft", "Sweet Life (041220)",  0 )
1287
1288#if ALL_REVISIONS  /* Resident sets verified against dat */
1289GAME(   2004, resdnt,    0,    multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040415)",  0 )
1290GAME(   2004, resdnt_2,  resdnt, multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040513)",  0 )
1291#else
1292GAME(   2004, resdnt_2,  0,    multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040513)",  0 )
1293#endif
1294
1295#if ALL_REVISIONS
1296/* Roll Fruit sets verified against dat */
1297GAME(   2003, rollfr,    0,    multfish, multfish,  0, ROT0, "Igrosoft", "Roll Fruit (030821)",  0 )
1298GAME(   2003, rollfr_2,  rollfr, multfish, multfish,  0, ROT0, "Igrosoft", "Roll Fruit (040318)",  0 )
1299#else
1300// ... none
1301#endif
1302
1303GAME(   2005, island,    0,    multfish, multfish,  0, ROT0, "Igrosoft", "Island (050713)",  0 )
1304
src/mame/drivers/mediagx.c
r4425r4426
12121212
12131213/*****************************************************************************/
12141214
1215ROM_START(a51site4)
1215ROM_START( a51site4 )
12161216   ROM_REGION32_LE(0x40000, "bios", 0)
12171217   ROM_LOAD("tinybios.rom", 0x00000, 0x40000, CRC(5ee189cc) SHA1(0b0d9321a4c59b1deea6854923e655a4d8c4fcfe))
12181218
r4425r4426
12201220    ROM_LOAD("cga.chr",     0x00000, 0x01000, CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd))
12211221
12221222   DISK_REGION( "ide" )
1223   DISK_IMAGE( "a51site4", 0, MD5(be0dd1a6f0bba175c25da3d056fa426d) SHA1(49dee1b903a37b99266cc3e19227942c3cf75821) )
1223   DISK_IMAGE( "a51site4", 0, SHA1(48496666d1613700ae9274f9a5361ea5bbaebea0) )
12241224ROM_END
12251225
12261226/*****************************************************************************/
12271227
1228GAME(1998, a51site4, 0,   mediagx, mediagx, a51site4,   ROT0,   "Atari Games",  "Area 51: Site 4", GAME_NOT_WORKING)
1228GAME( 1998, a51site4, 0,   mediagx, mediagx, a51site4,   ROT0,   "Atari Games",  "Area 51: Site 4", GAME_NOT_WORKING )
src/mame/drivers/cultures.c
r4425r4426
101101
102102static WRITE8_HANDLER( bg0_videoram_w )
103103{
104
105   if(video_bank==0)
104   if(video_bank == 0)
106105   {
107106      int r,g,b,datax;
108107      paletteram[offset] = data;
r4425r4426
328327   GFXDECODE_ENTRY("gfx3", 0, gfxlayout, 0x1000, 0x10 )
329328GFXDECODE_END
330329
331
332//WRONG!
333static PALETTE_INIT( cultures )
334{
335
336}
337
338
339330static INTERRUPT_GEN( cultures_interrupt )
340331{
341332   if (irq_enable)
r4425r4426
347338   old_bank = -1;
348339}
349340
350
351341static MACHINE_DRIVER_START( cultures )
352342
353343   /* basic machine hardware */
r4425r4426
356346   MDRV_CPU_IO_MAP(cultures_io_map,0)
357347   MDRV_CPU_VBLANK_INT("screen", cultures_interrupt)
358348
359   MDRV_MACHINE_RESET( cultures )
349   MDRV_MACHINE_RESET(cultures)
360350
361351   /* video hardware */
362352   MDRV_SCREEN_ADD("screen", RASTER)
r4425r4426
369359   MDRV_GFXDECODE(culture)
370360   MDRV_PALETTE_LENGTH(0x2000)
371361
372   MDRV_PALETTE_INIT(cultures)
373
374362   MDRV_VIDEO_START(cultures)
375363   MDRV_VIDEO_UPDATE(cultures)
376364
r4425r4426
445433   ROM_RELOAD(               0x000000, 0x020000 )
446434ROM_END
447435
448static DRIVER_INIT(cultures)
436static DRIVER_INIT( cultures )
449437{
450   paletteram=auto_malloc(0x4000);
438   paletteram = auto_malloc(0x4000);
451439}
452440
453441GAME( 1994, cultures, 0, cultures, cultures, cultures, ROT0, "Face", "Jibun wo Migaku Culture School Mahjong Hen", 0 )
src/mame/drivers/zn.c
r4425r4426
13051305
13061306/*
13071307
1308GNET Motherboard
1309Taito, 1998
1310
1311The Taito GNET System comprises the following main parts....
1312- Sony ZN-2 Motherboard (Main CPU/GPU/SPU, RAM, BIOS, EEPROM & peripheral interfaces)
1313- Taito FC PCB (Sound hardware & FLASHROMs for storage of PCMCIA cart contents)
1314- Taito CD PCB (PCMCIA cart interface)
1315
1316Also available are...
1317- Optional Communication Interface PCB
1318- Optional Save PCB
1319
1320On power-up, the system checks for a PCMCIA cart. If the cart matches the contents of the flashROMs,
1321the game boots immediately with no delay. If the cart doesn't match, it re-flashes the flashROMs with _some_
1322of the information contained in the cart, which takes approximately 2-3 minutes. The game then resets
1323and boots up.
1324
1325If no cart is present on power-up, the Taito GNET logo is displayed, then a message 'SYSTEM ERROR'
1326Since the logo is shown on boot even without a cart, there must be another sub-BIOS for the initial booting,
1327which I suspect is one of the flashROMs that is acting like a standard ROM and is not flashed at all.
1328Upon inspecting the GNET top board, it appears flash.u30 is the sub-BIOS and perhaps U27 is something sound related.
1329The flashROMs at U55, U56 & U29 appear to be the ones that are re-flashed when swapping game carts.
1330
1331PCB Layouts
1332-----------
1333(Standard ZN2 Motherboard)
1334
1335ZN-2 COH-3000 (sticker says COH-3002T denoting Taito GNET BIOS version)
1336|--------------------------------------------------------|
1337|  LA4705             |---------------------------|      |
1338|                     |---------------------------|      |
1339|    AKM_AK4310VM      AT28C16                           |
1340|  VOL                                                   |
1341|       S301           COH3002T.353                      |
1342|                                                        |
1343|                                                        |
1344|J                                                       |
1345|                                                        |
1346|A              814260    CXD2925Q     EPM7064           |
1347|                                                        |
1348|M                                     67.73MHz          |
1349|                                                        |
1350|M                                                       |
1351|            S551    KM4132G271BQ-8                      |
1352|A                                                       |
1353|                                CXD8654Q    CXD8661R    |
1354|                    KM4132G271BQ-8                      |
1355|CN505  CN506                   53.693MHz    100MHz      |
1356|            CAT702                                      |
1357|                                                        |
1358|CN504  CN503                                            |
1359|                                                        |
1360|            MC44200FT                                   |
1361|  NEC_78081G503        KM416V1204BT-L5  KM416V1204BT-L5 |
1362|                                                        |
1363|CN651  CN652                 *                 *        |
1364|                CN654                                   |
1365|--------------------------------------------------------|
1366Notes:
1367      CN506 - Connector for optional 3rd player controls
1368      CN505 - Connector for optional 4th player controls
1369      CN503 - Connector for optional 15kHz external video output (R,G,B,Sync, GND)
1370      CN504 - Connector for optional 2nd speaker (for stereo output)
1371      CN652 - Connector for optional trackball
1372      CN651 - Connector for optional analog controls
1373      CN654 - Connector for optional memory card
1374      S301  - Slide switch for stereo or mono sound output
1375      S551  - Dip switch (4 position, defaults all OFF)
1376
1377      COH3002T.353   - GNET BIOS 4MBit MaskROM type M534002 (SOP40)
1378      AT28C16        - Atmel AT28C16 2K x8 EEPROM
1379      814260-70      - 256K x16 (4MBit) DRAM
1380      KM4132G271BQ-8 - 128K x 32Bit x 2 Banks SGRAM
1381      KM416V1204BT-L5- 1M x16 EDO DRAM
1382      EPM7064        - Altera EPM7064QC100 CPLD (QFP100)
1383      CAT702         - Protection chip labelled 'TT10' (DIP20)
1384      *              - Unpopulated position for additional KM416V1204BT-L5 RAMs
1385
1386
1387FC PCB  K91X0721B  M43X0337B
1388|--------------------------------------------|
1389|   |---------------------------|            |
1390|   |---------------------------|            |
1391| NJM2100  NJM2100                           |
1392| MB87078                                    |
1393| *MB3773     XC95108         DIP40   CAT702 |
1394| *ADM708AR                                  |
1395| *UPD6379GR                                 |
1396|             FLASH.U30                      |
1397|                                            |
1398| DIP24                                      |
1399|                  *RF5C296                  |
1400| -------CD-PCB------- _                     |
1401| |                   | |                    |
1402| |                   | |                    |
1403| |                   | |                    |
1404| |                   | |                    |
1405| |                   | |                    |
1406| |                   | |                    |
1407| |                   | |                    |
1408| |                   |-|                    |
1409| --------------------                       |
1410|          M66220FP   FLASH.U55   FLASH16.U29|
1411|      FLASH.U27             FLASH.U56       |
1412|*LC321664                                   |
1413| TMS57002DPHA                *ZSG-2         |
1414|           LH52B256      25MHz              |
1415|   MN1020012A                               |
1416|--------------------------------------------|
1417Notes:
1418      DIP40           - Unpopulated socket for 8MBit DIP40 EPROM type AM27C800
1419      DIP24           - Unpopulated position for FM1208 DIP24 IC
1420      FLASH.U30       - Intel TE28F160 16MBit FLASHROM (TSOP56)
1421      FLASH.U29/55/56 - Intel TE28F160 16MBit FLASHROM (TSOP56)
1422      FLASH.U27       - Intel E28F400 4MBit FLASHROM (TSOP48)
1423      LH52B256        - Sharp 32K x8 SRAM (SOP28)
1424      LC321664        - Sanyo 64K x16 EDO DRAM (SOP40)
1425      XC95108         - XILINX XC95108 CPLD labelled 'E65-01' (QFP100)
1426      MN1020012A      - Panasonic MN1020012A Sound CPU (QFP128)
1427      ZSG-2           - Zoom Corp ZSG-2 Sound DSP (QFP100)
1428      TMS57002DPHA    - Texas Instruments TMS57002DPHA Sound DSP (QFP80)
1429      RF5C296         - Ricoh RF5C296 PCMCIA controller (TQFP144)
1430      M66220FP        - 256 x8bit Mail-Box (Inter-MPU data transfer)
1431      CAT702          - Protection chip labelled 'TT16' (DIP20)
1432      CD PCB          - A PCMCIA cart slot connector mounted onto a small daughterboard
1433      *               - These parts located under the PCB
1434
1435*/
1436
1437static UINT32 coh3002t_unknown;
1438
1439static WRITE32_HANDLER( coh3002t_unknown_w )
1440{
1441   COMBINE_DATA( &coh3002t_unknown );
1442}
1443
1444static READ32_HANDLER( coh3002t_unknown_r )
1445{
1446   return coh3002t_unknown;
1447}
1448
1449static DRIVER_INIT( coh3002t )
1450{
1451   memory_install_read32_handler     ( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f000000, 0x1f1fffff, 0, 0, SMH_BANK1 );
1452   memory_install_readwrite32_handler( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1fb40000, 0x1fb40003, 0, 0, coh3002t_unknown_r, coh3002t_unknown_w );
1453
1454   zn_driver_init(machine);
1455}
1456
1457static MACHINE_RESET( coh3002t )
1458{
1459   memory_set_bankptr(machine,  1, memory_region( machine, "user2" ) ); /* GNET boot rom */
1460   zn_machine_init(machine);
1461}
1462
1463static MACHINE_DRIVER_START( coh3002t )
1464   MDRV_IMPORT_FROM( zn2 )
1465
1466   MDRV_MACHINE_RESET( coh3002t )
1467MACHINE_DRIVER_END
1468
1469/*
1470
14711308Primal Rage 2
14721309Atari, 1996
14731310
r4425r4426
21591996
21601997static READ32_DEVICE_HANDLER( jdredd_idestat_r )
21611998{
2162   return ide_controller_r( device, 0x1f7 );
1999   return ide_controller_r( device, 0x1f7, 1 );
21632000}
21642001
21652002static READ32_DEVICE_HANDLER( jdredd_ide_r )
r4425r4426
21682005
21692006   if( ACCESSING_BITS_0_7 )
21702007   {
2171      data |= ide_controller_r( device, 0x1f0 + ( offset * 2 ) ) << 0;
2008      data |= ide_controller_r( device, 0x1f0 + ( offset * 2 ), 1 ) << 0;
21722009   }
21732010   if( ACCESSING_BITS_8_15 )
21742011   {
2175      data |= ide_controller_r( device, 0x1f0 + ( offset * 2 ) ) << 8;
2012      data |= ide_controller_r( device, 0x1f0 + ( offset * 2 ), 1 ) << 8;
21762013   }
21772014   if( ACCESSING_BITS_16_23 )
21782015   {
2179      data |= ide_controller_r( device, 0x1f1 + ( offset * 2 ) ) << 16;
2016      data |= ide_controller_r( device, 0x1f1 + ( offset * 2 ), 1 ) << 16;
21802017   }
21812018   if( ACCESSING_BITS_24_31 )
21822019   {
2183      data |= ide_controller_r( device, 0x1f1 + ( offset * 2 ) ) << 24;
2020      data |= ide_controller_r( device, 0x1f1 + ( offset * 2 ), 1 ) << 24;
21842021   }
21852022
21862023   return data;
r4425r4426
21902027{
21912028   if( ACCESSING_BITS_0_7 )
21922029   {
2193      ide_controller_w( device, 0x1f0 + ( offset * 2 ), data >> 0 );
2030      ide_controller_w( device, 0x1f0 + ( offset * 2 ), 1, data >> 0 );
21942031   }
21952032   if( ACCESSING_BITS_8_15 )
21962033   {
2197      ide_controller_w( device, 0x1f0 + ( offset * 2 ), data >> 8 );
2034      ide_controller_w( device, 0x1f0 + ( offset * 2 ), 1, data >> 8 );
21982035   }
21992036   if( ACCESSING_BITS_16_23 )
22002037   {
2201      ide_controller_w( device, 0x1f1 + ( offset * 2 ), data >> 16 );
2038      ide_controller_w( device, 0x1f1 + ( offset * 2 ), 1, data >> 16 );
22022039   }
22032040   if( ACCESSING_BITS_24_31 )
22042041   {
2205      ide_controller_w( device, 0x1f1 + ( offset * 2 ), data >> 24 );
2042      ide_controller_w( device, 0x1f1 + ( offset * 2 ), 1, data >> 24 );
22062043   }
22072044}
22082045
r4425r4426
41724009   ROM_LOAD( "e18-01.15",           0x0000000, 0x200000, CRC(dbd1408c) SHA1(ef81064f2f95e5ae25eb1f10d1e78f27f9e294f5) )
41734010ROM_END
41744011
4175#define TAITOGNET_BIOS \
4176   ROM_REGION32_LE( 0x080000, "user1", 0 ) \
4177   ROM_LOAD( "coh-3002t.353", 0x0000000, 0x080000, CRC(03967fa7) SHA1(0e17fec2286e4e25deb23d40e41ce0986f373d49) ) \
4178\
4179   ROM_REGION32_LE( 0x0200000, "user2", 0 ) \
4180    ROM_LOAD( "flash.u30",    0x000000, 0x200000, CRC(2d6740fc) SHA1(9a17411c1bd07b714227e84de23976ec900bdeed) ) \
4181\
4182   ROM_REGION( 0x080000, "link", 0 ) \
4183    ROM_LOAD( "flash.u27",    0x000000, 0x080000, CRC(75bd9c51) SHA1(e1eeab509faedb1ed815551fcc63a5a41e1cfdf0) ) \
4184
4185ROM_START( taitogn )
4186   TAITOGNET_BIOS
4187ROM_END
4188
41894012/* Eighteen Raizing */
41904013
41914014#define PSARC95_BIOS \
r4425r4426
42934116   ROM_REGION32_LE( 0x0400000, "user3", ROMREGION_ERASE00 )
42944117
42954118   DISK_REGION( "ide" )
4296   DISK_IMAGE("bam2", 0, MD5(bda5db36e18a41183dfb2459abfd3f3b) SHA1(cc4662f0eb988807b74a71d6c95eb54c81d672ed) )
4119   DISK_IMAGE("bam2", 0, SHA1(634d9a745a82c567fc4d7ce48e3570d88326c5f9) )
42974120ROM_END
42984121
42994122/* Atari PSX */
r4425r4426
43164139   ROM_LOAD16_BYTE( "pr2_036.u15",  0x100000, 0x080000, CRC(4b24bd54) SHA1(7f27cd524d10e5869aab6d4dc6a4217d049c475d) )
43174140
43184141   DISK_REGION( "ide" )
4319   DISK_IMAGE( "primrag2", 0, MD5(618a56ce62a5f7a94a7781b994a201e4) SHA1(d79b2dad16fbdb174bcd34eb70025a53ebdb0e51) )
4142   DISK_IMAGE( "primrag2", 0, SHA1(bc615068ddf4fd967f770ee01c02f285c052c4c5) )
43204143ROM_END
43214144
43224145/* Acclaim PSX */
r4425r4426
43674190   ROM_LOAD16_BYTE( "j-dread.u35",  0x000000, 0x020000, CRC(c1e17191) SHA1(82901439b1a51b9aadb4df4b9d944f26697a1460) )
43684191
43694192   DISK_REGION( "ide" )
4370   DISK_IMAGE( "jdreddc", 0, MD5(b66074f3df1e90ec4e3ff09dcdf33033) SHA1(83ed8df25d100b1c060f4dde2f162ba31803db7d) )
4193   DISK_IMAGE( "jdreddc", 0, SHA1(eee205f83e5f590f8baf36452c873d7063156bd0) )
43714194ROM_END
43724195
43734196ROM_START( jdreddb )
r4425r4426
43784201   ROM_LOAD16_BYTE( "j-dread.u35",  0x000000, 0x020000, CRC(c1e17191) SHA1(82901439b1a51b9aadb4df4b9d944f26697a1460) )
43794202
43804203   DISK_REGION( "ide" )
4381   DISK_IMAGE( "jdreddb", 0, MD5(0da1d048d7223df74fca4f349473cefa) SHA1(9b810e3a16de62cabfc8271b6606574c7034cf41) )
4204   DISK_IMAGE( "jdreddb", 0, SHA1(20f696fa6e1fbf97793bac2a794631c5dd4fb39a) )
43824205ROM_END
43834206
43844207/* Atlus */
r4425r4426
45324355GAME( 1997, gdariusb, gdarius2, coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.02A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
45334356GAME( 1997, gdarius2, taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius Ver.2 (Ver 2.03J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
45344357
4535/* A dummy driver, so that the bios can be debugged, and to serve as */
4536/* parent for the coh-3002t.353 file, so that we do not have to include */
4537/* it in every zip file */
4538GAME( 1997, taitogn,  0,        coh3002t, zn, coh3002t, ROT0, "Sony/Taito", "Taito GNET", GAME_IS_BIOS_ROOT )
4539
45404358/* Eighting/Raizing */
45414359
45424360/* A dummy driver, so that the bios can be debugged, and to serve as */
src/mame/drivers/calchase.c
r0r4426
1/************************************************************************************
2
3California Chase (c) 1999 The Game Room
4
5preliminary driver by Angelo Salese
6
7TODO:
8- currently calls int 13h with ah=0 -> "Reset Disk Drives" and returns an error code
9for whatever reason;
10- video emulation not even started (it currently fills vram with 0x0720, hence it's
11unneeded for now...)
12- clean-ups;
13
14I/O Memo (http://bochs.sourceforge.net/techspec/PORTS.LST):
1546E8    ----    8514/A and compatible video cards (e.g. ATI Graphics Ultra)
1646E8    w   ROM page select
1783C0-83CF ----  Compaq QVision - Line Draw Engine
1883C4      ----  Compaq Qvision EISA - Virtual Controller Select
1983C6-83C9 ----  Compaq Qvision EISA - DAC color registers
20
2143c4 is a 83c4 mirror?
22
2304D0-04D1 ---- EISA IRQ control
2400F0-00F5 ----  PCjr Disk Controller
25(or)
2600F0-00FF ----  coprocessor (8087..80387)
27
28=====================================================================================
29
30California Chase
31The Game Room, 1999
32
33This is a rip off of Chase HQ running on PC hardware
34and standard 15kHz arcade monitor
35
36Main board is a cheap Taiwanese one made by SOYO.
37Model SY-5EAS
38Major main board chips are....
39Cyrix 686MX-PR200 CPU
401M BIOS (Winbond 29C011)
4164M RAM (2x 32M 72 pin SIMMs)
42ETEQ EQ82C6617'97 MB817A0AG12 (QFP100, x2)
43UT6164C32Q-6 (QFP100, x2)
44ETEQ 82C6619'97 MB13J15001 (QFP208)
45ETEQ 82C6618'97 MB14B10971 (QFP208)
46UM61256
47PLL52C61
48SMC FD37C669QF (QFP100)
493V coin battery
503x PCI slots
514x 16-bit ISA slots
524x 72 pin RAM slots
53connectors for COM1, COM2, LPT1, IDE0, IDE1, floppy etc
54uses standard AT PSU
55
56Video card is Trident TGUI9680 with 512k on-board VRAM
57RAM is AS4C256K16EO-50JC (x2)
58Trident BIOS V5.5 (DIP28). Actual size unknown, dumped as 64k, 128k, 256k and 512k (can only be one of these sizes)
596.5536MHz xtal
60
61Custom JAMMA I/O board plugs into one ISA slot
62Major components are...
63XILINX XC3042
64Dallas DS1220Y NVRAM (dumped)
65MACH210 (protected)
6616MHz OSC
67VGA connector (tied to VGA card with a cable)
682x 4-pin connectors for controls
69AD7547
70ULN2803
71LM324 (op amp)
72TDA1552 (power amp)
73ST TS272 (dual op amp)
742 volume pots
75power input connector (from AT PSU)
76JAMMA edge connector
77ISA edge connector
78
79HDD is WD Caviar 2170. C/H/S = 1010/6/55. Capacity = 170.6MB
80The HDD is DOS-readable and in fact the OS is just Windows 98 DOS and can
81be easily copied. Tested with another HDD.... formatted with DOS, copied
82all files across to new HDD, boots up fine.
83
84************************************************************************************/
85
86#include "driver.h"
87#include "cpu/i386/i386.h"
88#include "memconv.h"
89#include "devconv.h"
90#include "machine/8237dma.h"
91#include "machine/pic8259.h"
92#include "machine/pit8253.h"
93#include "machine/mc146818.h"
94#include "machine/pcshare.h"
95#include "machine/pci.h"
96#include "machine/8042kbdc.h"
97#include "machine/pckeybrd.h"
98#include "machine/idectrl.h"
99
100static void ide_interrupt(const device_config *device, int state);
101
102static UINT32 *bios_ram;
103static UINT32 *vga_vram;
104
105static struct {
106   const device_config   *pit8254;
107   const device_config   *pic8259_1;
108   const device_config   *pic8259_2;
109   const device_config   *dma8237_1;
110   const device_config   *dma8237_2;
111} calchase_devices;
112
113
114static VIDEO_START(calchase)
115{
116
117}
118
119static VIDEO_UPDATE(calchase)
120{
121   int x,y,count,i;
122
123   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
124
125   count = (0);
126
127   for(y=0;y<256;y++)
128   {
129      for(x=0;x<320;x+=32)
130      {
131         for (i=0;i<32;i++)
132         {
133            UINT32 color;
134
135            color = (vga_vram[count])>>(32-i) & 0x1;
136
137            if((x+i)<video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y)
138               *BITMAP_ADDR32(bitmap, y, x+(32-i)) = screen->machine->pens[color];
139
140         }
141
142         count++;
143      }
144   }
145
146   return 0;
147}
148
149static READ8_DEVICE_HANDLER(at_dma8237_2_r)
150{
151   return dma8237_r(device, offset / 2);
152}
153
154static WRITE8_DEVICE_HANDLER(at_dma8237_2_w)
155{
156   dma8237_w(device, offset / 2, data);
157}
158
159static READ32_DEVICE_HANDLER(at32_dma8237_2_r)
160{
161   return read32le_with_read8_device_handler(at_dma8237_2_r, device, offset, mem_mask);
162}
163
164static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w)
165{
166   write32le_with_write8_device_handler(at_dma8237_2_w, device, offset, data, mem_mask);
167}
168
169static UINT8 dma_offset[2][4];
170static UINT8 at_pages[0x10];
171
172
173static READ8_HANDLER(at_page8_r)
174{
175   UINT8 data = at_pages[offset % 0x10];
176
177   switch(offset % 8) {
178   case 1:
179      data = dma_offset[(offset / 8) & 1][2];
180      break;
181   case 2:
182      data = dma_offset[(offset / 8) & 1][3];
183      break;
184   case 3:
185      data = dma_offset[(offset / 8) & 1][1];
186      break;
187   case 7:
188      data = dma_offset[(offset / 8) & 1][0];
189      break;
190   }
191   return data;
192}
193
194
195static WRITE8_HANDLER(at_page8_w)
196{
197   at_pages[offset % 0x10] = data;
198
199   switch(offset % 8) {
200   case 1:
201      dma_offset[(offset / 8) & 1][2] = data;
202      break;
203   case 2:
204      dma_offset[(offset / 8) & 1][3] = data;
205      break;
206   case 3:
207      dma_offset[(offset / 8) & 1][1] = data;
208      break;
209   case 7:
210      dma_offset[(offset / 8) & 1][0] = data;
211      break;
212   }
213}
214
215
216static DMA8237_MEM_READ( pc_dma_read_byte )
217{
218   const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
219   offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
220      & 0xFF0000;
221
222   return memory_read_byte(space, page_offset + offset);
223}
224
225
226static DMA8237_MEM_WRITE( pc_dma_write_byte )
227{
228   const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
229   offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
230      & 0xFF0000;
231
232   memory_write_byte(space, page_offset + offset, data);
233}
234
235
236static const struct dma8237_interface dma8237_1_config =
237{
238   "maincpu",
239   1.0e-6, // 1us
240
241   pc_dma_read_byte,
242   pc_dma_write_byte,
243
244   { 0, 0, NULL, NULL },
245   { 0, 0, NULL, NULL },
246   NULL
247};
248
249
250static const struct dma8237_interface dma8237_2_config =
251{
252   "maincpu",
253   1.0e-6, // 1us
254
255   NULL,
256   NULL,
257
258   { NULL, NULL, NULL, NULL },
259   { NULL, NULL, NULL, NULL },
260   NULL
261};
262
263static READ32_HANDLER(at_page32_r)
264{
265   return read32le_with_read8_handler(at_page8_r, space, offset, mem_mask);
266}
267
268
269static WRITE32_HANDLER(at_page32_w)
270{
271   write32le_with_write8_handler(at_page8_w, space, offset, data, mem_mask);
272}
273
274static READ32_DEVICE_HANDLER( ide_r )
275{
276   return ide_controller32_r(device, 0x1f0/4 + offset, mem_mask);
277}
278
279static WRITE32_DEVICE_HANDLER( ide_w )
280{
281   ide_controller32_w(device, 0x1f0/4 + offset, data, mem_mask);
282}
283
284static READ32_DEVICE_HANDLER( fdc_r )
285{
286   return ide_controller32_r(device, 0x3f0/4 + offset, mem_mask);
287}
288
289static WRITE32_DEVICE_HANDLER( fdc_w )
290{
291   //mame_printf_debug("FDC: write %08X, %08X, %08X\n", data, offset, mem_mask);
292   ide_controller32_w(device, 0x3f0/4 + offset, data, mem_mask);
293}
294
295// Intel 82439TX System Controller (MXTC)
296static UINT8 mxtc_config_reg[256];
297
298static UINT8 mxtc_config_r(const device_config *busdevice, const device_config *device, int function, int reg)
299{
300//  mame_printf_debug("MXTC: read %d, %02X\n", function, reg);
301
302   return mxtc_config_reg[reg];
303}
304
305static void mxtc_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data)
306{
307//  mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data);
308
309   switch(reg)
310   {
311      case 0x59:      // PAM0
312      {
313         if (data & 0x10)      // enable RAM access to region 0xf0000 - 0xfffff
314         {
315            memory_set_bankptr(busdevice->machine, 1, bios_ram);
316         }
317         else               // disable RAM access (reads go to BIOS ROM)
318         {
319            memory_set_bankptr(busdevice->machine, 1, memory_region(busdevice->machine, "bios") + 0x10000);
320         }
321         break;
322      }
323   }
324
325   mxtc_config_reg[reg] = data;
326}
327
328static void intel82439tx_init(void)
329{
330   mxtc_config_reg[0x60] = 0x02;
331   mxtc_config_reg[0x61] = 0x02;
332   mxtc_config_reg[0x62] = 0x02;
333   mxtc_config_reg[0x63] = 0x02;
334   mxtc_config_reg[0x64] = 0x02;
335   mxtc_config_reg[0x65] = 0x02;
336}
337
338static UINT32 intel82439tx_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask)
339{
340   UINT32 r = 0;
341   if (ACCESSING_BITS_24_31)
342   {
343      r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24;
344   }
345   if (ACCESSING_BITS_16_23)
346   {
347      r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16;
348   }
349   if (ACCESSING_BITS_8_15)
350   {
351      r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8;
352   }
353   if (ACCESSING_BITS_0_7)
354   {
355      r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0;
356   }
357   return r;
358}
359
360static void intel82439tx_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask)
361{
362   if (ACCESSING_BITS_24_31)
363   {
364      mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff);
365   }
366   if (ACCESSING_BITS_16_23)
367   {
368      mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff);
369   }
370   if (ACCESSING_BITS_8_15)
371   {
372      mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff);
373   }
374   if (ACCESSING_BITS_0_7)
375   {
376      mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff);
377   }
378}
379
380// Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4)
381static UINT8 piix4_config_reg[4][256];
382
383static UINT8 piix4_config_r(const device_config *busdevice, const device_config *device, int function, int reg)
384{
385//  mame_printf_debug("PIIX4: read %d, %02X\n", function, reg);
386   return piix4_config_reg[function][reg];
387}
388
389static void piix4_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data)
390{
391//  mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data);
392   piix4_config_reg[function][reg] = data;
393}
394
395static UINT32 intel82371ab_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask)
396{
397   UINT32 r = 0;
398   if (ACCESSING_BITS_24_31)
399   {
400      r |= piix4_config_r(busdevice, device, function, reg + 3) << 24;
401   }
402   if (ACCESSING_BITS_16_23)
403   {
404      r |= piix4_config_r(busdevice, device, function, reg + 2) << 16;
405   }
406   if (ACCESSING_BITS_8_15)
407   {
408      r |= piix4_config_r(busdevice, device, function, reg + 1) << 8;
409   }
410   if (ACCESSING_BITS_0_7)
411   {
412      r |= piix4_config_r(busdevice, device, function, reg + 0) << 0;
413   }
414   return r;
415}
416
417static void intel82371ab_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask)
418{
419   if (ACCESSING_BITS_24_31)
420   {
421      piix4_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff);
422   }
423   if (ACCESSING_BITS_16_23)
424   {
425      piix4_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff);
426   }
427   if (ACCESSING_BITS_8_15)
428   {
429      piix4_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff);
430   }
431   if (ACCESSING_BITS_0_7)
432   {
433      piix4_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff);
434   }
435}
436
437static WRITE32_HANDLER(bios_ram_w)
438{
439   if (mxtc_config_reg[0x59] & 0x20)      // write to RAM if this region is write-enabled
440   {
441      COMBINE_DATA(bios_ram + offset);
442   }
443}
444
445static ADDRESS_MAP_START( calchase_map, ADDRESS_SPACE_PROGRAM, 32 )
446   AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
447   AM_RANGE(0x000a0000, 0x000bffff) AM_RAM AM_BASE(&vga_vram)
448   AM_RANGE(0x000c0000, 0x000c7fff) AM_RAM AM_REGION("video_bios", 0)
449   AM_RANGE(0x000e0000, 0x000effff) AM_RAM
450   AM_RANGE(0x000f0000, 0x000fffff) AM_ROMBANK(1)
451   AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE(bios_ram_w)
452   AM_RANGE(0x00100000, 0x01ffffff) AM_RAM
453   AM_RANGE(0x04000000, 0x040001ff) AM_RAM
454   AM_RANGE(0x08000000, 0x080001ff) AM_RAM
455   AM_RANGE(0x0c000000, 0x0c0001ff) AM_RAM
456   AM_RANGE(0x10000000, 0x100001ff) AM_RAM
457   AM_RANGE(0x14000000, 0x140001ff) AM_RAM
458   AM_RANGE(0x18000000, 0x180001ff) AM_RAM
459   AM_RANGE(0x20000000, 0x200001ff) AM_RAM
460   AM_RANGE(0x28000000, 0x280001ff) AM_RAM
461   AM_RANGE(0xfffe0000, 0xffffffff) AM_ROM AM_REGION("bios", 0)   /* System BIOS */
462ADDRESS_MAP_END
463
464static ADDRESS_MAP_START( calchase_io, ADDRESS_SPACE_IO, 32)
465   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", dma8237_r, dma8237_w, 0xffffffff)
466   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_1", pic8259_r, pic8259_w, 0xffffffff)
467   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff)
468   AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r,         kbdc8042_32le_w)
469   AM_RANGE(0x0070, 0x007f) AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
470   AM_RANGE(0x0080, 0x009f) AM_READWRITE(at_page32_r,            at_page32_w)
471   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_2", pic8259_r, pic8259_w, 0xffffffff)
472   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w)
473   AM_RANGE(0x00e8, 0x00eb) AM_NOP
474   AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE("ide", ide_r, ide_w)
475   AM_RANGE(0x0300, 0x03af) AM_NOP
476   AM_RANGE(0x03b0, 0x03df) AM_NOP
477   AM_RANGE(0x0278, 0x027b) AM_WRITENOP//AM_WRITE(pnp_config_w)
478   AM_RANGE(0x03f0, 0x03ff) AM_DEVREADWRITE("ide", fdc_r, fdc_w)
479   AM_RANGE(0x0a78, 0x0a7b) AM_WRITENOP//AM_WRITE(pnp_data_w)
480   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_32le_r,   pci_32le_w)
481   AM_RANGE(0x43c0, 0x43cf) AM_RAM AM_SHARE(1)
482   AM_RANGE(0x83c0, 0x83cf) AM_RAM AM_SHARE(1)
483ADDRESS_MAP_END
484
485
486static const gfx_layout CGA_charlayout =
487{
488   8,8,
489    256,
490    1,
491    { 0 },
492    { 0,1,2,3,4,5,6,7 },
493   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 },
494    8*8
495};
496
497static GFXDECODE_START( CGA )
498   GFXDECODE_ENTRY( "video_bios", 0x5182, CGA_charlayout,              0, 256 )
499   //there's also a 8x16 entry (just after the 8x8)
500GFXDECODE_END
501
502#define AT_KEYB_HELPER(bit, text, key1) \
503   PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(text) PORT_CODE(key1)
504
505static INPUT_PORTS_START( calchase )
506   PORT_START("pc_keyboard_0")
507   PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED )    /* unused scancode 0 */
508   AT_KEYB_HELPER( 0x0002, "Esc",          KEYCODE_Q           ) /* Esc                         01  81 */
509
510   PORT_START("pc_keyboard_1")
511   AT_KEYB_HELPER( 0x0020, "Y",            KEYCODE_Y           ) /* Y                           15  95 */
512   AT_KEYB_HELPER( 0x1000, "Enter",        KEYCODE_ENTER       ) /* Enter                       1C  9C */
513
514   PORT_START("pc_keyboard_2")
515
516   PORT_START("pc_keyboard_3")
517   AT_KEYB_HELPER( 0x0002, "N",            KEYCODE_N           ) /* N                           31  B1 */
518   AT_KEYB_HELPER( 0x0800, "F1",           KEYCODE_S           ) /* F1                          3B  BB */
519
520   PORT_START("pc_keyboard_4")
521
522   PORT_START("pc_keyboard_5")
523
524   PORT_START("pc_keyboard_6")
525   AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up",      KEYCODE_UP          ) /* Up                          67  e7 */
526   AT_KEYB_HELPER( 0x0080, "(MF2)Page Up",         KEYCODE_PGUP        ) /* Page Up                     68  e8 */
527   AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left",      KEYCODE_LEFT        ) /* Left                        69  e9 */
528   AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right",   KEYCODE_RIGHT       ) /* Right                       6a  ea */
529   AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down",      KEYCODE_DOWN        ) /* Down                        6c  ec */
530   AT_KEYB_HELPER( 0x1000, "(MF2)Page Down",      KEYCODE_PGDN        ) /* Page Down                   6d  ed */
531   AT_KEYB_HELPER( 0x4000, "Del",                 KEYCODE_A           ) /* Delete                      6f  ef */
532
533   PORT_START("pc_keyboard_7")
534INPUT_PORTS_END
535
536static IRQ_CALLBACK(irq_callback)
537{
538   int r = 0;
539   r = pic8259_acknowledge( calchase_devices.pic8259_2);
540   if (r==0)
541   {
542      r = pic8259_acknowledge( calchase_devices.pic8259_1);
543   }
544   return r;
545}
546
547static MACHINE_START(calchase)
548{
549   cpu_set_irq_callback(machine->cpu[0], irq_callback);
550
551   calchase_devices.pit8254 = devtag_get_device( machine, "pit8254" );
552   calchase_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
553   calchase_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
554   calchase_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
555   calchase_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
556}
557
558/*************************************************************
559 *
560 * pic8259 configuration
561 *
562 *************************************************************/
563
564static PIC8259_SET_INT_LINE( calchase_pic8259_1_set_int_line ) {
565   cpu_set_input_line(device->machine->cpu[0], 0, interrupt ? HOLD_LINE : CLEAR_LINE);
566}
567
568
569static PIC8259_SET_INT_LINE( calchase_pic8259_2_set_int_line ) {
570   pic8259_set_irq_line( calchase_devices.pic8259_1, 2, interrupt);
571}
572
573
574static const struct pic8259_interface calchase_pic8259_1_config = {
575   calchase_pic8259_1_set_int_line
576};
577
578
579static const struct pic8259_interface calchase_pic8259_2_config = {
580   calchase_pic8259_2_set_int_line
581};
582
583
584/*************************************************************
585 *
586 * pit8254 configuration
587 *
588 *************************************************************/
589
590static PIT8253_OUTPUT_CHANGED( pc_timer0_w )
591{
592   pic8259_set_irq_line(calchase_devices.pic8259_1, 0, state);
593}
594
595static const struct pit8253_config calchase_pit8254_config =
596{
597   {
598      {
599         4772720/4,            /* heartbeat IRQ */
600         pc_timer0_w
601      }, {
602         4772720/4,            /* dram refresh */
603         NULL
604      }, {
605         4772720/4,            /* pio port c pin 4, and speaker polling enough */
606         NULL
607      }
608   }
609};
610
611static MACHINE_RESET(calchase)
612{
613   memory_set_bankptr(machine, 1, memory_region(machine, "bios") + 0x10000);
614}
615
616static void set_gate_a20(running_machine *machine, int a20)
617{
618   cpu_set_input_line(machine->cpu[0], INPUT_LINE_A20, a20);
619}
620
621static void keyboard_interrupt(running_machine *machine, int state)
622{
623   pic8259_set_irq_line(calchase_devices.pic8259_1, 1, state);
624}
625
626static void ide_interrupt(const device_config *device, int state)
627{
628   pic8259_set_irq_line(calchase_devices.pic8259_2, 6, state);
629}
630
631static int calchase_get_out2(running_machine *machine) {
632   return pit8253_get_output(calchase_devices.pit8254, 2 );
633}
634
635static const struct kbdc8042_interface at8042 =
636{
637   KBDC8042_AT386, set_gate_a20, keyboard_interrupt, calchase_get_out2
638};
639
640static void calchase_set_keyb_int(running_machine *machine, int state) {
641   pic8259_set_irq_line(calchase_devices.pic8259_1, 1, state);
642}
643
644
645static MACHINE_DRIVER_START( calchase )
646   MDRV_CPU_ADD("maincpu", PENTIUM, 200000000) // Cyrix 686MX-PR200 CPU
647   MDRV_CPU_PROGRAM_MAP(calchase_map, 0)
648   MDRV_CPU_IO_MAP(calchase_io, 0)
649
650   MDRV_MACHINE_START(calchase)
651   MDRV_MACHINE_RESET(calchase)
652
653   MDRV_PIT8254_ADD( "pit8254", calchase_pit8254_config )
654   MDRV_DMA8237_ADD( "dma8237_1", dma8237_1_config )
655   MDRV_DMA8237_ADD( "dma8237_2", dma8237_2_config )
656   MDRV_PIC8259_ADD( "pic8259_1", calchase_pic8259_1_config )
657   MDRV_PIC8259_ADD( "pic8259_2", calchase_pic8259_2_config )
658   MDRV_IDE_CONTROLLER_ADD("ide", ide_interrupt)
659   MDRV_NVRAM_HANDLER( mc146818 )
660   MDRV_PCI_BUS_ADD("pcibus", 0)
661   MDRV_PCI_BUS_DEVICE(0, NULL, intel82439tx_pci_r, intel82439tx_pci_w)
662   MDRV_PCI_BUS_DEVICE(7, NULL, intel82371ab_pci_r, intel82371ab_pci_w)
663
664   MDRV_PALETTE_LENGTH(0x200)
665   MDRV_GFXDECODE( CGA )
666
667   MDRV_SCREEN_ADD("screen", RASTER)
668   MDRV_SCREEN_REFRESH_RATE(60)
669   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
670   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
671   MDRV_SCREEN_SIZE(64*8, 32*8)
672   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
673
674   MDRV_VIDEO_START(calchase)
675   MDRV_VIDEO_UPDATE(calchase)
676MACHINE_DRIVER_END
677
678static DRIVER_INIT( calchase )
679{
680   bios_ram = auto_malloc(0x10000);
681
682   init_pc_common(machine, PCCOMMON_KEYBOARD_AT, calchase_set_keyb_int);
683   mc146818_init(machine, MC146818_STANDARD);
684
685   intel82439tx_init();
686
687   kbdc8042_init(machine, &at8042);
688}
689
690
691ROM_START( calchase )
692   ROM_REGION( 0x40000, "bios", 0 )
693   ROM_LOAD( "mb_bios.bin", 0x00000, 0x20000, CRC(dea7a51b) SHA1(e2028c00bfa6d12959fc88866baca8b06a1eab68) )
694
695   ROM_REGION( 0x8000, "video_bios", 0 )
696   ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) )
697   ROM_CONTINUE(                                 0x0001, 0x4000 )
698
699   ROM_REGION( 0x800, "nvram", 0 )
700   ROM_LOAD( "ds1220y_nv.bin", 0x000, 0x800, CRC(7912c070) SHA1(b4c55c7ca76bcd8dad1c4b50297233349ae02ed3) )
701
702   DISK_REGION( "ide" )
703   DISK_IMAGE( "calchase", 0,SHA1(487e304ffeed23ca618fa936258136605ce9d1a1) )
704ROM_END
705
706
707GAME( 1999, calchase,  0,    calchase, calchase,  calchase, ROT0, "The Game Room", "California Chase", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/aleck64.c
r4425r4426
423423
424424static MACHINE_DRIVER_START( aleck64 )
425425   /* basic machine hardware */
426   MDRV_CPU_ADD("maincpu", R4600BE, 93750000)
426   MDRV_CPU_ADD("maincpu", VR4300BE, 93750000)
427427   MDRV_CPU_CONFIG(config)
428428   MDRV_CPU_PROGRAM_MAP(n64_map, 0)
429429   MDRV_CPU_VBLANK_INT("screen", n64_vblank)
src/mame/drivers/vegas.c
r4425r4426
23142314   ROM_LOAD( "legend15.bin", 0x000000, 0x80000, CRC(a8372d70) SHA1(d8cd4fd4d7007ee38bb58b5a818d0f83043d5a48) )
23152315
23162316   DISK_REGION( "ide" )   /* Guts 1.5 1/14/1999 Game 1/14/1999 */
2317   DISK_IMAGE( "gauntleg", 0, MD5(e8c0c5fafbf004ab2e5808bcd80bfb07) SHA1(fa042d9b565282e69192096bd6f66d8af5aacd2e) )
2317   DISK_IMAGE( "gauntleg", 0, SHA1(66eb70e2fba574a7abe54be8bd45310654b24b08) )
23182318
23192319   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
23202320   ROM_LOAD16_BYTE( "vegassio.bin", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
23262326   ROM_LOAD( "legend12.bin", 0x000000, 0x80000, CRC(34674c5f) SHA1(92ec1779f3ab32944cbd953b6e1889503a57794b) )
23272327
23282328   DISK_REGION( "ide" )   /* Guts 1.4 10/22/1998 Main 10/23/1998 */
2329   DISK_IMAGE( "gauntl12", 0, MD5(d5712ae31835bcae086ec7259c2541e0) SHA1(40ba1b8464ffd4003aac5511306b4c34bfa227ea) )
2329   DISK_IMAGE( "gauntl12", 0, SHA1(c8208e3ce3b02a271dc6b089efa98dd996b66ce0) )
23302330
23312331   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
23322332   ROM_LOAD16_BYTE( "vegassio.bin", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
23382338   ROM_LOAD( "gauntdl.bin", 0x000000, 0x80000, CRC(3d631518) SHA1(d7f5a3bc109a19c9c7a711d607ff87e11868b536) )
23392339
23402340   DISK_REGION( "ide" )   /* Guts: 1.9 3/17/2000 Game 5/9/2000 */
2341   DISK_IMAGE( "gauntdl", 0, MD5(3a83b244543f0076fc0cbc8eb6c742b8) SHA1(30bfc810debeca6a4fccd954d0b68c1185f2c384) )
2341   DISK_IMAGE( "gauntdl", 0, SHA1(ba3af48171e727c2f7232c06dcf8411cbcf14de8) )
23422342
23432343   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
23442344   ROM_LOAD16_BYTE( "vegassio.bin", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
23502350   ROM_LOAD( "gauntdl.bin", 0x000000, 0x80000, CRC(3d631518) SHA1(d7f5a3bc109a19c9c7a711d607ff87e11868b536) )
23512351
23522352   DISK_REGION( "ide" )   /* Guts: 1.9 3/17/2000 Game 3/19/2000 */
2353   DISK_IMAGE( "gauntd24", 0, MD5(1faed82ad08aba21be061ccca709e691) SHA1(d6d9b15f3e20e3456431a6799aceeb2c0b4336aa) )
2353   DISK_IMAGE( "gauntd24", 0, SHA1(3e055794d23d62680732e906cfaf9154765de698) )
23542354
23552355   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
23562356   ROM_LOAD16_BYTE( "vegassio.bin", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
23622362   ROM_LOAD( "warboot.v19", 0x000000, 0x80000, CRC(b0c095cd) SHA1(d3b8cccdca83f0ecb49aa7993864cfdaa4e5c6f0) )
23632363
23642364   DISK_REGION( "ide" )   /* Guts 1.3 4/20/1999 Game 4/20/1999 */
2365   DISK_IMAGE( "warfa", 0, MD5(01035f301d84d665f7c4bf7e3554c516) SHA1(9ce1d4a3115329b9b6fb6482b11b22b52a7fef79) )
2365   DISK_IMAGE( "warfa", 0, SHA1(87f8a8878cd6be716dbd6c68fb1bc7f564ede484) )
23662366
23672367   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
23682368   ROM_LOAD16_BYTE( "warsnd.106", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
23742374   ROM_LOAD( "tenthdeg.bio", 0x000000, 0x80000, CRC(1cd2191b) SHA1(a40c48f3d6a9e2760cec809a79a35abe762da9ce) )
23752375
23762376   DISK_REGION( "ide" )   /* Guts 5/26/1998 Main 8/25/1998 */
2377   DISK_IMAGE( "tenthdeg", 0, MD5(be653883b640f540945e9c8ab8f72463) SHA1(5ba31d22c0fa29897b45e01c4f1afed8b906f500) )
2377   DISK_IMAGE( "tenthdeg", 0, SHA1(41a1a045a2d118cf6235be2cc40bf16dbb8be5d1) )
23782378
23792379   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
23802380   ROM_LOAD16_BYTE( "tenthdeg.snd", 0x000000, 0x8000, CRC(1c75c1c1) SHA1(02ac1419b0fd4acc3f39676e7dce879e926d998b) )
r4425r4426
23862386   ROM_LOAD( "rbmain.bin", 0x000000, 0x80000, CRC(060e1aa8) SHA1(2a1027d209f87249fe143500e721dfde7fb5f3bc) )
23872387
23882388   DISK_REGION( "ide" )   /* Guts 4/22/1999 Game 4/22/1999 */
2389   DISK_IMAGE( "roadburn", 0, MD5(ce4710671f4266389e7d71f1fc0da81d) SHA1(1c971c9ed573d178d9f318ccd88d305d8146de2d) )
2389   DISK_IMAGE( "roadburn", 0, SHA1(a62870cceafa6357d7d3505aca250c3f16087566) )
23902390ROM_END
23912391
23922392
r4425r4426
23952395   ROM_LOAD( "nbau27.100", 0x000000, 0x80000, CRC(ff5d620d) SHA1(8f07567929f40a2269a42495dfa9dd5edef688fe) )
23962396
23972397   DISK_REGION( "ide" )
2398   DISK_IMAGE( "nbashowt", 0, MD5(2dab719f8f0fdeb8ac1db3844ed8c1e4) SHA1(bf60b8f74647dc911f78f364a72ef0301ae0167a) )
2398   DISK_IMAGE( "nbashowt", 0, SHA1(f7c56bc3dcbebc434de58034986179ae01127f87) )
23992399
24002400   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
24012401   ROM_LOAD16_BYTE( "vegassio.bin", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
24082408//  ROM_LOAD( "bootnflnba.bin", 0x000000, 0x80000, CRC(3def7053) SHA1(8f07567929f40a2269a42495dfa9dd5edef688fe) )
24092409
24102410   DISK_REGION( "ide" )
2411   DISK_IMAGE( "nbanfl", 0, MD5(9e3748957c672f6d7a1e464546f46b15) SHA1(4256c7487a55fd0d0e4241f595cc886d4402fd7d) )
2411   DISK_IMAGE( "nbanfl", 0, SHA1(f60c627f85f1bf58f2ea674063736a1e516e7e9e) )
24122412
24132413   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* Vegas SIO boot ROM */
24142414   ROM_LOAD16_BYTE( "vegassio.bin", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
24202420   ROM_LOAD( "bootu27", 0x000000, 0x80000, CRC(c44550a2) SHA1(ad30f1c3382ff2f5902a4cbacbb1f0c4e37f42f9) )
24212421
24222422   DISK_REGION( "ide" )
2423   DISK_IMAGE( "cartfury", 0, MD5(d8e9d2616f8d70155f1068f884aa39e5) SHA1(98597d79ea25c0e74a575ba636abccc68fd5d301) )
2423   DISK_IMAGE( "cartfury", 0, SHA1(4c5bc2803297ea9a191bbd8b002d0e46b4ae1563) )
24242424
24252425   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2105 data */
24262426   ROM_LOAD16_BYTE( "vegassio.bin", 0x000000, 0x8000, CRC(d1470e23) SHA1(f6e8405cfa604528c0224401bc374a6df9caccef) )
r4425r4426
24322432   ROM_LOAD( "sf2049.u27", 0x000000, 0x80000, CRC(174ba8fe) SHA1(baba83b811eca659f00514a008a86ef0ac9680ee) )
24332433
24342434   DISK_REGION( "ide" )   /* Guts 1.03 9/3/1999 Game 9/8/1999 */
2435   DISK_IMAGE( "sf2049", 0, MD5(2f56375670c0f72b69c1b5ec6a54ba70) SHA1(e08d026ab2745cac6b8c820f010b28dffd5388dd) )
2435   DISK_IMAGE( "sf2049", 0, SHA1(9e0661b8566a6c78d18c59c11cd3a6628d025405) )
24362436ROM_END
24372437
24382438
r4425r4426
24412441   ROM_LOAD( "sf2049se.u27", 0x000000, 0x80000, CRC(da4ecd9c) SHA1(2574ff3d608ebcc59a63cf6dea13ee7650ae8921) )
24422442
24432443   DISK_REGION( "ide" )
2444   DISK_IMAGE( "sf2049se", 0, MD5(3ea8c0f8394cb73e96176b1a70c03219) SHA1(b195f98756d9d7cde71b6467409faed33134a2d7) )
2444   DISK_IMAGE( "sf2049se", 0, SHA1(7b27a8ce2a953050ce267548bb7160b41f3e8054) )
24452445ROM_END
24462446
24472447
r4425r4426
24502450   ROM_LOAD( "sf2049te.u27", 0x000000, 0x80000, CRC(cc7c8601) SHA1(3f37dbd1b32b3ac5caa300725468e8e426f0fb83) )
24512451
24522452   DISK_REGION( "ide" )
2453   DISK_IMAGE( "sf2049te", 0, MD5(476abcfbeb0d2817cb38ca36e78cddc6) SHA1(c01972f1b642f013d760f29f1e2ed7dcf78896c4) )
2453   DISK_IMAGE( "sf2049te", 0, SHA1(625aa36436587b7bec3e7db1d19793b760e2ea51) )
24542454ROM_END
24552455
24562456
src/mame/drivers/igspoker.c
r4425r4426
160160   return 0;
161161}
162162
163static VIDEO_UPDATE(number10)
163static VIDEO_START(cpokerpk)
164164{
165   bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
165   fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows,   8,  8,   64, 32);
166}
166167
168static VIDEO_UPDATE(cpokerpk)
169{
167170   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
168171
169172   return 0;
r4425r4426
934937   AM_RANGE(0x0000, 0xffff) AM_READ( exp_rom_r )
935938ADDRESS_MAP_END
936939
940static ADDRESS_MAP_START( cpokerpk_io_map, ADDRESS_SPACE_IO, 8 )
941   AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split1_w ) AM_BASE( &paletteram )
942   AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE( paletteram_xBBBBBGGGGGRRRRR_split2_w ) AM_BASE( &paletteram_2 )
943   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1")         /* DSW1 */
944   AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2")         /* DSW2 */
945   AM_RANGE(0x4002, 0x4002) AM_READ_PORT("DSW3")         /* DSW3 */
946   AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW4")         /* DSW4 */
947   AM_RANGE(0x4004, 0x4004) AM_READ_PORT("DSW5")         /* DSW5 */
948   AM_RANGE(0x50f0, 0x50f0) AM_WRITE(igs_nmi_and_coins_w)
949   AM_RANGE(0x5081, 0x5081) AM_READ_PORT("SERVICE")         /* Services */
950   AM_RANGE(0x5082, 0x5082) AM_READ_PORT("COINS")         /* Coing & Kbd */
951   AM_RANGE(0x5090, 0x5090) AM_WRITE(custom_io_w)
952   AM_RANGE(0x5091, 0x5091) AM_READ(custom_io_r) AM_WRITE( igs_lamps_w )         /* Keyboard */
953   AM_RANGE(0x50a0, 0x50a0) AM_READ_PORT("BUTTONS2")
954   /* Sound synthesys has been patched out, replaced by ADPCM samples */
955   AM_RANGE(0x50b0, 0x50b0) AM_DEVREADWRITE( "oki", okim6295_r, okim6295_w )
956   AM_RANGE(0x50c0, 0x50c0) AM_READ(igs_irqack_r) AM_WRITE(igs_irqack_w)
957   AM_RANGE(0x7000, 0x77ff) AM_RAM_WRITE( fg_tile_w )  AM_BASE( &fg_tile_ram )
958   AM_RANGE(0x7800, 0x7fff) AM_RAM_WRITE( fg_color_w ) AM_BASE( &fg_color_ram )
959   AM_RANGE(0x0000, 0xffff) AM_READ( exp_rom_r )
960ADDRESS_MAP_END
961
937962static INPUT_PORTS_START( number10 )
938963
939964   PORT_START("DSW1")
r4425r4426
10701095
10711096INPUT_PORTS_END
10721097
1098static INPUT_PORTS_START( cpokerpk )
1099
1100   PORT_START("DSW1")
1101   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:8")
1102   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1103   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1104   PORT_DIPNAME( 0x06, 0x06, "Min Bet to Start" ) PORT_DIPLOCATION("SWA:7,6")
1105   PORT_DIPSETTING(    0x06, "1" )
1106   PORT_DIPSETTING(    0x04, "2" )
1107   PORT_DIPSETTING(    0x02, "5" )
1108   PORT_DIPSETTING(    0x00, "10" )
1109   PORT_DIPNAME( 0x18, 0x10, "Max Bet" ) PORT_DIPLOCATION("SWA:5,4")
1110   PORT_DIPSETTING(    0x18, "5" )
1111   PORT_DIPSETTING(    0x10, "10" )
1112   PORT_DIPSETTING(    0x08, "20" )
1113   PORT_DIPSETTING(    0x00, "50" )
1114   PORT_DIPNAME( 0x60, 0x60, "Min Bet to play Fever" ) PORT_DIPLOCATION("SWA:3,2")
1115   PORT_DIPSETTING(    0x60, "1" )
1116   PORT_DIPSETTING(    0x40, "5" )
1117   PORT_DIPSETTING(    0x20, "10" )
1118   PORT_DIPSETTING(    0x00, "20" )
1119   PORT_DIPNAME( 0x80, 0x00, "Credit Limit" ) PORT_DIPLOCATION("SWA:1")
1120   PORT_DIPSETTING(    0x80, "50000" )
1121   PORT_DIPSETTING(    0x00, "50000" )
1122
1123   PORT_START("DSW2")
1124   PORT_DIPNAME( 0x07, 0x07, "Coin In Rate" ) PORT_DIPLOCATION("SWB:8,7,6")
1125   PORT_DIPSETTING(    0x07, "1" )
1126   PORT_DIPSETTING(    0x06, "2" )
1127   PORT_DIPSETTING(    0x05, "5" )
1128   PORT_DIPSETTING(    0x04, "10" )
1129   PORT_DIPSETTING(    0x03, "20" )
1130   PORT_DIPSETTING(    0x02, "5" )
1131   PORT_DIPSETTING(    0x01, "50" )
1132   PORT_DIPSETTING(    0x00, "100" )
1133   PORT_DIPNAME( 0x18, 0x18, "Key In Rate" ) PORT_DIPLOCATION("SWB:5,4")
1134   PORT_DIPSETTING(    0x18, "10" )
1135   PORT_DIPSETTING(    0x10, "20" )
1136   PORT_DIPSETTING(    0x08, "50" )
1137   PORT_DIPSETTING(    0x00, "100" )
1138   PORT_DIPNAME( 0x60, 0x60, "Val Premio" ) PORT_DIPLOCATION("SWB:3,2")
1139   PORT_DIPSETTING(    0x60, "1" )
1140   PORT_DIPSETTING(    0x40, "10" )
1141   PORT_DIPSETTING(    0x20, "20" )
1142   PORT_DIPSETTING(    0x00, "50" )
1143   /* Whatever value is selected, code will force ACTIVE_LOW, thus Manual mode */
1144   PORT_DIPNAME( 0x80, 0x80, "Payout" ) PORT_DIPLOCATION("SWB:1")
1145   PORT_DIPSETTING(    0x80, "Manual" )
1146   PORT_DIPSETTING(    0x00, "Auto" )
1147
1148   PORT_START("DSW3")
1149   PORT_DIPNAME( 0x01, 0x01, "W-UP Limit" ) PORT_DIPLOCATION("SWC:8")
1150   PORT_DIPSETTING(    0x01, "3000" )
1151   PORT_DIPSETTING(    0x00, "5000" )
1152   PORT_DIPNAME( 0x02, 0x02, "W-UP Pool" ) PORT_DIPLOCATION("SWC:7")
1153   PORT_DIPSETTING(    0x02, "300" )
1154   PORT_DIPSETTING(    0x00, "500" )
1155   PORT_DIPNAME( 0x0c, 0x0c, "W-UP Chance" ) PORT_DIPLOCATION("SWC:6,5")
1156   PORT_DIPSETTING(    0x0c, "94%" )
1157   PORT_DIPSETTING(    0x08, "96%" )
1158   PORT_DIPSETTING(    0x04, "98%" )
1159   PORT_DIPSETTING(    0x00, "100%" )
1160   PORT_DIPNAME( 0x30, 0x20, "W-UP Type" ) PORT_DIPLOCATION("SWC:4,3")
1161   PORT_DIPSETTING(    0x30, DEF_STR( None ) )
1162   PORT_DIPSETTING(    0x20, "High-Low" )
1163   PORT_DIPSETTING(    0x10, "Red-Black" )      /* Bit 4 is equal for ON/OFF */
1164   PORT_DIPNAME( 0x40, 0x00, "Strip Girl" ) PORT_DIPLOCATION("SWC:2")
1165   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
1166   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1167
1168   PORT_START("DSW4")
1169   PORT_DIPNAME( 0x0f, 0x07, "Main Game Chance" ) PORT_DIPLOCATION("SWD:8,7,6,5")
1170   PORT_DIPSETTING(    0x0f, "69%" )
1171   PORT_DIPSETTING(    0x0e, "72%" )
1172   PORT_DIPSETTING(    0x0d, "75%" )
1173   PORT_DIPSETTING(    0x0c, "78%" )
1174   PORT_DIPSETTING(    0x0b, "81%" )
1175   PORT_DIPSETTING(    0x0a, "83%" )
1176   PORT_DIPSETTING(    0x09, "85%" )
1177   PORT_DIPSETTING(    0x08, "87%" )
1178   PORT_DIPSETTING(    0x07, "89%" )
1179   PORT_DIPSETTING(    0x06, "91%" )
1180   PORT_DIPSETTING(    0x05, "93%" )
1181   PORT_DIPSETTING(    0x04, "95%" )
1182   PORT_DIPSETTING(    0x03, "97%" )
1183   PORT_DIPSETTING(    0x02, "99%" )
1184   PORT_DIPSETTING(    0x01, "101%" )
1185   PORT_DIPSETTING(    0x00, "103%" )
1186   PORT_DIPNAME( 0x10, 0x00, "Five Jokers" ) PORT_DIPLOCATION("SWD:4")
1187   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
1188   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1189   PORT_DIPNAME( 0x20, 0x00, "Royal Flush" ) PORT_DIPLOCATION("SWD:3")
1190   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
1191   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1192   PORT_DIPNAME( 0x40, 0x00, "Auto Hold" ) PORT_DIPLOCATION("SWD:2")
1193   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
1194   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1195   PORT_DIPNAME( 0x80, 0x00, "Anytime Key-in" ) PORT_DIPLOCATION("SWD:1")
1196   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
1197   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1198
1199   PORT_START("DSW5")
1200   PORT_DIPNAME( 0x01, 0x00, "Hopper" ) PORT_DIPLOCATION("SWE:8")
1201   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
1202   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1203   PORT_DIPNAME( 0x02, 0x00, "Payout Select" ) PORT_DIPLOCATION("SWE:7")
1204   PORT_DIPSETTING(    0x02, "Hopper" )
1205   PORT_DIPSETTING(    0x00, "Ticket" )
1206   PORT_DIPNAME( 0x0c, 0x0c, "Ticket Rate" ) PORT_DIPLOCATION("SWE:6,5")
1207   PORT_DIPSETTING(    0x0c, "10:1" )
1208   PORT_DIPSETTING(    0x08, "20:1" )
1209   PORT_DIPSETTING(    0x04, "50:1" )
1210   PORT_DIPSETTING(    0x00, "100:1" )
1211
1212   PORT_START("SERVICE")
1213   PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_SPECIAL  ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW")   // hopper sensor
1214   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("Payout")
1215   PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
1216   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F1) PORT_NAME("Statistics")
1217
1218   PORT_START("COINS")
1219   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1220   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1221   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
1222   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_Q) PORT_NAME("Key In")
1223   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_W) PORT_NAME("Key Down")
1224   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
1225
1226   PORT_START("BUTTONS1")
1227   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
1228
1229   PORT_START("BUTTONS2")
1230   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CODE(KEYCODE_N)
1231   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Hold1/High/Low")
1232   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("Hold5/Bet")
1233   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_V) PORT_NAME("Hold4/Take")
1234   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("Hold3/W-Up")
1235   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("Hold2/Red/Black")
1236   PORT_BIT(0xC0, IP_ACTIVE_LOW, IPT_UNUSED )
1237
1238INPUT_PORTS_END
1239
10731240static INPUT_PORTS_START( chleague )
10741241
10751242   PORT_START("DSW1")
r4425r4426
13761543   8*32*2
13771544};
13781545
1379static const gfx_layout charlayout8bpp =
1380{
1381   8, 8,   /* 8*8 characters */
1382   RGN_FRAC(1, 1),
1383   8,
1384   { 0,1,2,3,4,5,6,7 },
1385   { 0,8,16,24,32,40,48,56 },
1386   { 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64 },
1387   64*8
1388};
13891546
1390
13911547static GFXDECODE_START( igspoker )
13921548   GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout,   0, 16 )
13931549   GFXDECODE_ENTRY( "gfx2", 0x04000, charlayout2,  0, 16 )
r4425r4426
13961552   GFXDECODE_ENTRY( "gfx2", 0x00000, charlayout2,  0, 16 )
13971553GFXDECODE_END
13981554
1399static GFXDECODE_START( citalian )
1400   GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout8bpp,   0, 1 )
1555static const gfx_layout charlayoutcpk =
1556{
1557   8, 8,   /* 8*8 characters */
1558   RGN_FRAC(1, 1),
1559   6,
1560   { 2,3,4,5,6,7 },
1561   { 0,8,16,24,32,40,48,56 },
1562   { 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64 },
1563   64*8
1564};
1565
1566static GFXDECODE_START( cpokerpk )
1567   GFXDECODE_ENTRY( "gfx1", 0x00000, charlayoutcpk,   0, 16 )
14011568   /* these not used? */
14021569   GFXDECODE_ENTRY( "gfx2", 0x04000, charlayout2,  0, 1 )
14031570   GFXDECODE_ENTRY( "gfx2", 0x08000, charlayout2,  0, 1 )
r4425r4426
14611628   MDRV_CPU_IO_MAP(number10_io_map,0)
14621629
14631630   MDRV_SCREEN_MODIFY("screen")
1464   MDRV_VIDEO_UPDATE(number10)
1631   MDRV_VIDEO_START(cpokerpk)
1632   MDRV_VIDEO_UPDATE(cpokerpk)
14651633
14661634   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_12MHz / 12)
14671635   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
14681636   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
14691637MACHINE_DRIVER_END
14701638
1471static MACHINE_DRIVER_START( citalian )
1639static MACHINE_DRIVER_START( cpokerpk )
14721640
1473   MDRV_PALETTE_LENGTH(0x8000)
1474
14751641   MDRV_IMPORT_FROM(number10)
1476   MDRV_GFXDECODE(citalian)
1642   MDRV_CPU_MODIFY("maincpu")
1643   MDRV_CPU_IO_MAP(cpokerpk_io_map,0)
1644   MDRV_GFXDECODE(cpokerpk)
14771645MACHINE_DRIVER_END
14781646
14791647
r4425r4426
19762144   ROM_LOAD( "9.bin",   0x0000, 0x40000, CRC(dd213b5c) SHA1(82e32aa44eee227d7424553a743df48606bbd48e) )
19772145ROM_END
19782146
1979ROM_START( citalian )
2147static DRIVER_INIT( cpokerpk )
2148{
2149   int A;
2150   UINT8 *rom = memory_region(machine, "maincpu");
2151
2152   for (A=0x0714; A < 0xF000; A+=0x1000)
2153      rom[A] ^= 0x20;
2154}
2155
2156ROM_START( cpokerpk )
19802157   ROM_REGION( 0x20000, "maincpu", 0 )
2158   ROM_LOAD( "blue.bin", 0x00000, 0x20000, CRC(3e987389) SHA1(ab154db89406590d04270d7b29e60efab15758ca) )
2159
2160   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE )
2161   ROM_LOAD16_BYTE( "red.bin",   0x00000, 0x40000, CRC(b72fe1e0) SHA1(0507df7e1495aa265b276337c9c151478dd9d376) )
2162   ROM_LOAD16_BYTE( "white.bin", 0x00001, 0x40000, CRC(bdf55fa4) SHA1(487999d22941a0ef2f3874d31527f45d122aadb0) )
2163
2164   ROM_REGION( 0x40000, "gfx2", ROMREGION_ERASE00 | ROMREGION_DISPOSE )
2165
2166   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
2167   ROM_LOAD( "yellow.bin",   0x0000, 0x40000, CRC(dd213b5c) SHA1(82e32aa44eee227d7424553a743df48606bbd48e) )
2168ROM_END
2169
2170ROM_START( cpokerpkg )
2171   ROM_REGION( 0x20000, "maincpu", 0 )
19812172   ROM_LOAD( "cp.u35", 0x00000, 0x20000, CRC(25e129b9) SHA1(01dc9e09603cef233da28e30194e53ef4cd04475) )
19822173
19832174   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE )
r4425r4426
19932184   ROM_LOAD( "palce22v10h.u44.bad.dump", 0x000, 0x2dd, BAD_DUMP CRC(5c4e9024) SHA1(e9d1e4df3d79c21f4ce053a84bb7b7a43d650f91) )
19942185ROM_END
19952186
1996ROM_START( citaliana )
2187ROM_START( citalcup )
19972188   ROM_REGION( 0x20000, "maincpu", 0 )
19982189   ROM_LOAD( "ic.u35", 0x00000, 0x20000, CRC(f120eb31) SHA1(b87f638d4eebe05323b6952956d44368077f27aa) )
19992190
r4425r4426
20512242GAMEL( 2000, number10,  0,        number10, number10, number10, ROT0, "PlayMark Srl",   "Number Dieci (Poker)",            0,   layout_igspoker )
20522243GAMEL( 2000, numbr10l,  number10, number10, number10, number10, ROT0, "PlayMark Srl",   "Number Dieci (Lattine)",          0,   layout_igspoker )
20532244GAMEL( 198?,  igs_ncs,  0,        igs_ncs,  igs_ncs, igs_ncs, ROT0, "IGS",    "New Champion Skill (v100n)",                0,   layout_igspoker ) /* SU 062 */
2054GAMEL( 199?, citalian,   0,       citalian,number10,  0,  ROT0, "SGS",    "Champion Italian Cup (bootleg, set 1)",                   GAME_NOT_WORKING, layout_igspoker )
2055GAMEL( 199?, citaliana,  citalian,citalian,number10,  0,  ROT0, "SGS",    "Champion Italian Cup (bootleg, set 2)",                   GAME_NOT_WORKING, layout_igspoker )
2245GAMEL( 199?, cpokerpk,  0,        cpokerpk, cpokerpk,  cpokerpk,  ROT0, "SGS",    "Champion Poker PK (bootleg, blue board)",   0,   layout_igspoker )
2246GAMEL( 199?, cpokerpkg, cpokerpk, cpokerpk, cpokerpk,  cpokerpk,  ROT0, "SGS",    "Champion Poker PK (bootleg, green board)",  0, layout_igspoker )
2247GAMEL( 199?, citalcup,  cpokerpk, cpokerpk, cpokerpk,  cpokerpk,  ROT0, "SGS",    "Champion Italian Cup (bootleg V220IT)",     0, layout_igspoker )
20562248
20572249GAMEL( 2000, igs_ncs2,  0,        igs_ncs,  igs_ncs, igs_ncs2, ROT0, "IGS",   "New Champion Skill (v100n 2000)",           GAME_IMPERFECT_GRAPHICS, layout_igspoker )
20582250
src/mame/drivers/mil4000.c
r4425r4426
402402// palce22v10h.u74.bad.dump= palce22v10h-ch-jin-u27.u27  Jingle Bell (Italy, V133I)
403403ROM_END
404404
405ROM_START( mil4000b )
406   ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code
407   ROM_LOAD16_BYTE( "27.u75", 0x000001, 0x20000, CRC(a5ca8a1e) SHA1(c42244e27031175c37e83995f548d960708eabab) )
408   ROM_LOAD16_BYTE( "28.u76", 0x000000, 0x20000, CRC(5bf4e681) SHA1(818d0ec1b2cc544334b0349ae15fd53ff32ef8c1) )
405409
410   ROM_REGION( 0xa0000, "gfx1", 0 ) // 5bpp?
411   ROM_LOAD( "2.u36",   0x000000, 0x20000, CRC(bb4fcfde) SHA1(7e19722ce42b9ec86faac32a526429b0e56639b5) )
412   ROM_LOAD( "3.u35",   0x020000, 0x20000, CRC(21c43d81) SHA1(a266b85378723ad8e219dd63a639add64624de13) )
413   ROM_LOAD( "4.u34",   0x040000, 0x20000, CRC(372a67a4) SHA1(c1c1352dd3152603827224d8970e6cb04aa1e858) )
414   ROM_LOAD( "5.u33",   0x060000, 0x20000, CRC(8058882e) SHA1(2de7b1e6e39d89913b2d6c1290d3cf326d2527d4) )
415   ROM_LOAD( "6.u32",   0x080000, 0x20000, CRC(7217a8c2) SHA1(275c2d5a128960dd6cd56d5e3647354b17129a12) )
416
417   ROM_REGION( 0x40000, "oki", 0 ) // 6295 samples
418   ROM_LOAD( "1.u54",   0x000000, 0x40000, CRC(e4a89163) SHA1(c0622c4e97b23daf9775137a2754bf9c47a29385) )
419
420   ROM_REGION( 0x4d4c, "mcu", 0 ) // MCU code
421   ROM_LOAD( "pic16c65b_millennium4000.u60", 0x000, 0x4d4c, BAD_DUMP CRC(4f3f7b90) SHA1(fdf689dda57960820315dcf0138d2ade28248681) )
422ROM_END
423
424
406425GAMEL( 2000, mil4000,    0,        mil4000,    mil4000,    0, ROT0,  "Sure Milano", "Millennium Nuovo 4000 (Version 2.0)", 0, layout_mil4000 )
407426GAMEL( 2000, mil4000a,   mil4000,  mil4000,    mil4000,    0, ROT0,  "Sure Milano", "Millennium Nuovo 4000 (Version 1.8)", 0, layout_mil4000 )
427GAMEL( 2000, mil4000b,   mil4000,  mil4000,    mil4000,    0, ROT0,  "Sure Milano", "Millennium Nuovo 4000 (Version 1.5)", 0, layout_mil4000 )
src/mame/drivers/namcos10.c
r4425r4426
507507   ROM_LOAD( "10021a.8d",    0x1000000, 0x1000000, CRC(bebafef6) SHA1(6c965c09f3186523d27c50894a15b9c1dd02a794) )
508508ROM_END
509509
510GAME( 2000, mrdrilr2,  0,        namcos10, namcos10, mrdrilr2, ROT0, "Namco", "Mr Driller 2 (DR21 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
510GAME( 2000, mrdrilr2,  0,        namcos10, namcos10, mrdrilr2, ROT0, "Namco", "Mr Driller 2 (Japan, DR21 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
511511GAME( 2001, gjspace,   0,        namcos10, namcos10, gjspace,  ROT0, "Namco/Metro", "Gekitoride-Jong Space (10011 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
512GAME( 2001, mrdrilrg,  0,        namcos10, namcos10, mrdrilrg, ROT0, "Namco", "Mr. Driller G (DRG1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
513GAME( 2001, knpuzzle,  0,        namcos10, namcos10, knpuzzle, ROT0, "Namco", "Kotoba no Puzzle Mojipittan (KPM1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
514GAME( 2002, startrgn,  0,        namcos10, namcos10, startrgn, ROT0, "Namco", "Star Trigon (STT1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
512GAME( 2001, mrdrilrg,  0,        namcos10, namcos10, mrdrilrg, ROT0, "Namco", "Mr. Driller G (Japan, DRG1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
513GAME( 2001, knpuzzle,  0,        namcos10, namcos10, knpuzzle, ROT0, "Namco", "Kotoba no Puzzle Mojipittan (Japan, KPM1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
514GAME( 2002, startrgn,  0,        namcos10, namcos10, startrgn, ROT0, "Namco", "Star Trigon (Japan, STT1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
515515GAME( 2003, gamshara,  0,        namcos10, namcos10, gamshara, ROT0, "Mitchell", "Gamshara (10021 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/viper.c
r4425r4426
667667   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
668668
669669   DISK_REGION( "ide" )
670   DISK_IMAGE( "ppp2nd", 0, MD5(06012243d4b64ebd9b81e9781fb5624d) SHA1(54b45e2df3f4239191000900181a94227a351c67))
670   DISK_IMAGE( "ppp2nd", 0, SHA1(b8b90483d515c83eac05ffa617af19612ea990b0))
671671ROM_END
672672
673673/* Viper games with Compact Flash card */
r4425r4426
678678   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(c24e29fc) SHA1(efb6ecaf25cbdf9d8dfcafa85e38a195fa5ff6c4))
679679
680680   DISK_REGION( "ide" )
681   DISK_IMAGE( "a45jaa02", 0, MD5(db0e9de39e2b4e6bd9f6f768472ab24a) SHA1(046c766fdb1b6607e794c598d5d603215b8e81a3) )
681   DISK_IMAGE( "a45jaa02", 0, SHA1(3aaf9bc713c9ea8922d8f8acfeab5b4bdf058f41) )
682682ROM_END
683683
684684ROM_START(code1d)
r4425r4426
687687   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
688688
689689   DISK_REGION( "ide" )
690   DISK_IMAGE( "gk922d02", 0, MD5(c2713080273300a963fbf96dc22f70d7) SHA1(fcf451e8d49a93ca25a2177f2eb014da6ca6bcb3) )
690   DISK_IMAGE( "gk922d02", 0, SHA1(99b199e061621ecdd48ca125250c52656c814f38) )
691691ROM_END
692692
693693ROM_START(code1db)
r4425r4426
696696   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
697697
698698   DISK_REGION( "ide" )
699   DISK_IMAGE( "gk922b02", 0, MD5(c1a9b406300c2e258be1cca00746ad6c) SHA1(ce949cdbe16ff8539e7fa46ccc58a06a90c7edde) )
699   DISK_IMAGE( "gk922b02", 0, SHA1(d1ecbfe3c76ba482638982879c96874537b89995) )
700700ROM_END
701701
702702ROM_START(gticlub2)
r4425r4426
706706   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(d0604e84) SHA1(18d1183f1331af3e655a56692eb7ab877b4bc239))
707707
708708   DISK_REGION( "ide" )
709   DISK_IMAGE( "gm941b02", 0, MD5(8403c7f5fa5c254a30d87b59f8d1fedc) SHA1(217ef1628e8a377d22f537507dbe18fa9fe01fa2) )
709   DISK_IMAGE( "gm941b02", 0, SHA1(5f7e023d2ed0df5fa6876ac086864ffd69e9aa5a) )
710710ROM_END
711711
712712ROM_START(jpark3)
r4425r4426
716716   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(55d1681d) SHA1(26868cf0d14f23f06b81f2df0b4186924439bb43))
717717
718718   DISK_REGION( "ide" )
719   DISK_IMAGE( "b41c02", 0, MD5(4909b6c4007cc24f8cc514aa0ea26170) SHA1(386059033832c70063ff38363d473050162835e9) )
719   DISK_IMAGE( "b41c02", 0, SHA1(ad7c42b06b9a75c2d28a2368387fe55fbec36a70) )
720720ROM_END
721721
722722ROM_START(mocapglf)
r4425r4426
725725   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
726726
727727   DISK_REGION( "ide" )
728   DISK_IMAGE( "b33a02", 0, MD5(5e7d62ab51dae4e9ace35d7e52b08b5d) SHA1(a56df1917fb476cbacfe24f1a2f2cacc770eb80a) )
728   DISK_IMAGE( "b33a02", 0, SHA1(6c52cd8d52a5282c1650ee5aac088b293915d32c) )
729729ROM_END
730730
731731ROM_START(mocapb)
r4425r4426
735735   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(14b9fe68) SHA1(3c59e6df1bb46bc1835c13fd182b1bb092c08759))
736736
737737   DISK_REGION( "ide" )
738   DISK_IMAGE( "a29b02", 0, MD5(18f7070bbde3c3ca38d71425bdc074ab) SHA1(167b4b9f0960503db37c22e81ce4149925c5ec71) )
738   DISK_IMAGE( "a29b02", 0, SHA1(017d2fb91dbef4ade0e3a02ee046b18e3d741f23) )
739739ROM_END
740740
741741ROM_START(mocapbj)
r4425r4426
745745   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(2f7cdf27) SHA1(0b69d8728be12909e235268268a312982f81d46a))
746746
747747   DISK_REGION( "ide" )
748   DISK_IMAGE( "a29a02", 0, MD5(ba06338534dbad61071d39907a3aed85) SHA1(8ab0b63f6e4d1401380a286736964f0cd668a70e) )
748   DISK_IMAGE( "a29a02", 0, SHA1(900899cd0e5adc1fe28382b22f25a3ee447e7986) )
749749ROM_END
750750
751751ROM_START(p911)
r4425r4426
755755   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(cca056ca) SHA1(de1a00d84c1311d48bbe6d24f5b36e22ecf5e85a))
756756
757757   DISK_REGION( "ide" )
758   DISK_IMAGE( "a00aad02", 0, MD5(894ec7584841d7e1775e76edc53e739e) SHA1(2fc73fdaf9bc9ab6942672458206517bf8d851e1) )
758   DISK_IMAGE( "a00aad02", 0, SHA1(c9b92bd53e62cc83c30db32d6cf329273af4ca8d) )
759759ROM_END
760760
761761ROM_START(p911uc)
r4425r4426
764764   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
765765
766766   DISK_REGION( "ide" )
767   DISK_IMAGE( "a00aac02", 0, MD5(c1d1a18932490c9d6185d0c3b55b50cf) SHA1(5cbdfce13ce2cb5c45ea66e20e092d5a5fe69c5d) )
767   DISK_IMAGE( "a00aac02", 0, SHA1(dc665581d854cb7f69621927beff145676926af7) )
768768ROM_END
769769
770770ROM_START(p911e)
r4425r4426
773773   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
774774
775775   DISK_REGION( "ide" )
776   DISK_IMAGE( "a00eaa02", 0, MD5(5c870c38a408591e080516ae6a5f28e5) SHA1(8ff93666c33c7ee3ac2e4eeca9077c8296036187) )
776   DISK_IMAGE( "a00eaa02", 0, SHA1(9763c4c05da9dae0b9abe3ee979773443102dd19) )
777777ROM_END
778778
779779ROM_START(p911j)
r4425r4426
783783   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(9ecf70dc) SHA1(4769a99b0cc28563e219860b8d480f32d1e21f60))
784784
785785   DISK_REGION( "ide" )
786   DISK_IMAGE( "a00jac02", 0, MD5(6c4b7c934159a54c93d5aa386e44969a) SHA1(80217103ad96b06855a57763c702140cbe4a2494) )
786   DISK_IMAGE( "a00jac02", 0, SHA1(24ba15af85342eb30951e9aa74049a1127f30d7d) )
787787ROM_END
788788
789789ROM_START(p9112)
r4425r4426
792792   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
793793
794794   DISK_REGION( "ide" )
795   DISK_IMAGE( "b11a02", 0, MD5(7ddf6139577bce2062b2f9a9ac99e56a) SHA1(56d9c47f3c7fceb2d8c36a8fa205c90595923c6f) )
795   DISK_IMAGE( "b11a02", 0, SHA1(412dfdf065fa2bf59256a1ec84c7c130a0182069) )
796796ROM_END
797797
798798ROM_START(popn9)
r4425r4426
801801   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
802802
803803   DISK_REGION( "ide" )
804   DISK_IMAGE( "c00jab", 0, MD5(f16cfaae05d29fdeeb7289265bf45712) SHA1(fd5b374731975e956b6e4e7102bc8350bfd8b5f4) )
804   DISK_IMAGE( "c00jab", 0, SHA1(3763aaded9b45388a664edd84a3f7f8ff4101be4) )
805805ROM_END
806806
807807ROM_START(sscopex)
r4425r4426
811811   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(7b0e1ac8) SHA1(1ea549964539e27f87370e9986bfa44eeed037cd))
812812
813813   DISK_REGION( "ide" )
814   DISK_IMAGE( "gka13c02", 0, MD5(994ced1f61dfe5ea10eac4b407359392) SHA1(179145b0e98c2ab5a7fc5c93cbc0c5398f961f65) )
814   DISK_IMAGE( "gka13c02", 0, SHA1(53ae5cd4ff38581816502b0fe7d0fcf1b6364a93) )
815815ROM_END
816816
817817ROM_START(sogeki)
r4425r4426
821821   ROM_LOAD("nvram.u39", 0x000000, 0x2000, CRC(2f325c55) SHA1(0bc44f40f981a815c8ce64eae95ae55db510c565))
822822
823823   DISK_REGION( "ide" )
824   DISK_IMAGE( "a13b02", 0, MD5(b476764d13ebf3fc3ec52e1fc2b36f96) SHA1(16965f5f164f4f8191e93274f8c99d84def15c70) )
824   DISK_IMAGE( "a13b02", 0, SHA1(d518111819cde7f78de8d4702a04f93871da4f8d) )
825825ROM_END
826826
827827ROM_START(thrild2)
r4425r4426
831831   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(d5de9b8e) SHA1(768bcd46a6ad20948f60f5e0ecd2f7b9c2901061))
832832
833833   DISK_REGION( "ide" )
834   DISK_IMAGE( "gma41b02", 0, MD5(a3c39be28464fa737390e2e1e2aeb683) SHA1(0a451e33f5a6b708a54b70cc247e4d49ada0025a) )
834   DISK_IMAGE( "gma41b02", 0, SHA1(03b59d2662b8e37228450acb075b46e96191681e) )
835835ROM_END
836836
837837ROM_START(thrild2a)
r4425r4426
841841   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(3b7b0969) SHA1(3f11b6420ad3e3ee6f807e1ae14908bdc6e86d8f))
842842
843843   DISK_REGION( "ide" )
844   DISK_IMAGE( "gma41a02", 0, MD5(e73843d28afaef6c6af2513b6cf064e6) SHA1(abdaba1f539cf5d723fa51e939c0ffcbf5cdf28f) )
844   DISK_IMAGE( "gma41a02", 0, SHA1(6c7d31bddd79c61785aea8bbbd5170885a1002d8) )
845845ROM_END
846846
847847ROM_START(tsurugi)
r4425r4426
851851   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(c123342c) SHA1(55416767608fe0311a362854a16b214b04435a31))
852852
853853   DISK_REGION( "ide" )
854   DISK_IMAGE( "a30eab02", 0, MD5(81593f4d5a10f7dea124bef0b02d15e6) SHA1(2202d8f8fa7cc752d4ebae16eac6818a5de06b98) )
854   DISK_IMAGE( "a30eab02", 0, SHA1(b6b3dbcf52ea5da54ccc5e14c08174eef4d02c30) )
855855ROM_END
856856
857857ROM_START(tsurugij)
r4425r4426
860860   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
861861
862862   DISK_REGION( "ide" )
863   DISK_IMAGE( "a30jac02", 0, MD5(c7400ccdb4b045bbf2de4fa9d63a9e87) SHA1(64cc19941c2f3b39cbbe158042f3b312a678752d) )
863   DISK_IMAGE( "a30jac02", 0, SHA1(62a6d8572fa65c62c70e41ade51aac4269da2081) )
864864ROM_END
865865
866866ROM_START(wcombat)
r4425r4426
870870   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(4f8b5858) SHA1(68066241c6f9db7f45e55b3c5da101987f4ce53c))
871871
872872   DISK_REGION( "ide" )
873   DISK_IMAGE( "c22d02", 0, MD5(f3b63ac0b2f613c9183356e7cf966ba6) SHA1(f7a6e8eba877f213075bd4836a62a898f17a27dc) )
873   DISK_IMAGE( "c22d02", 0, SHA1(85d2a8b5ec4cfd932190486cad991f0c180ca6b3) )
874874ROM_END
875875
876876ROM_START(wcombak)
r4425r4426
880880   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(ebd4d645) SHA1(2fa7e2c6b113214f3eb1900c8ceef4d5fcf0bb76))
881881
882882   DISK_REGION( "ide" )
883   DISK_IMAGE( "c22c02", 0, MD5(e108a01a0a3ada065f42b0b4b16a4480) SHA1(6caff33b9b22fc56a619d58cfb8fb5aca2ecd289) )
883   DISK_IMAGE( "c22c02", 0, SHA1(8bd1dfbf926ad5b28fa7dafd7e31c475325ec569) )
884884ROM_END
885885
886886ROM_START(wcombaj)
r4425r4426
890890   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(bd8a6640) SHA1(2d409197ef3fb07d984d27fa943f29c7a711d715))
891891
892892   DISK_REGION( "ide" )
893   DISK_IMAGE( "c22a02", 0, MD5(0df54ceaa46c00e9b849af4bea6df1eb) SHA1(63ba75403ff714b2169f3c2e8ae3246a035da2d3) )
893   DISK_IMAGE( "c22a02", 0, SHA1(b607fb2ddfd0bd552b7a736cea4ac1aa3ea021bd) )
894894ROM_END
895895
896896ROM_START(xtrial)
r4425r4426
900900   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(33708a93) SHA1(715968e3c9c15edf628fa6ac655dc0864e336c6c))
901901
902902   DISK_REGION( "ide" )
903   DISK_IMAGE( "b4xb02", 0, MD5(c915e4946231fee8d3df00d5be08c177) SHA1(8631efafc19cc34ab8fbee2ed912d35de1f8b161) )
903   DISK_IMAGE( "b4xb02", 0, SHA1(27be96c5ea534d51b2e6d052e98c30e5848e572c) )
904904ROM_END
905905
906906/* Viper Satellite Terminal games */
r4425r4426
957957   ROM_LOAD("nvram.u39", 0x00000, 0x2000, CRC(9fb551a5) SHA1(a33d185e186d404c3bf62277d7e34e5ad0000b09))
958958
959959   DISK_REGION( "ide" )
960   DISK_IMAGE( "c09jad04", 0, MD5(a858ca8f04838e8b5b603ea12526016c) SHA1(97e9b57c72787737c976cf9d7e997aee50befd53) )
960   DISK_IMAGE( "c09jad04", 0, SHA1(d81930829619bb95fa718c591be1ecb4a54d2af5) )
961961ROM_END
962962
963963ROM_START(mfightcc)
r4425r4426
966966   ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00)      /* M48T58 Timekeeper NVRAM */
967967
968968   DISK_REGION( "ide" )
969   DISK_IMAGE( "c09jac04", 0, MD5(3d502e1f9c8dbd7a9179ffd754a3de1b) SHA1(d27f04cc25df9955c014b7b97f768324f8e47c5c) )
969   DISK_IMAGE( "c09jac04", 0, SHA1(9c6177b9f38a23ee0d1614622bd9e576fd8a446f) )
970970ROM_END
971971
972972/*****************************************************************************/
src/mame/drivers/btime.c
r4425r4426
13431343
13441344/* R49 has 4.7k in schematics, but listed as 47k in bill of material
13451345 * 47k gives proper low pass filtering
1346 *
1347 * Anoid measured R49 to R52 on a Burger Time pcb. These are
1348 * listed below
13461349 */
1347#define BTIME_R49   RES_K(47)
1350#define BTIME_R49   RES_K(47)   /* pcb: 47.4k */
13481351
13491352/* The input divider R51 R50 is not independant of R52, which
13501353 * also depends on ay internal resistance.
r4425r4426
13531356 * With R51 being 1K, the gain is way to high (23.5). Therefore R51
13541357 * is set to 5k, but this is a hack. With the modification,
13551358 * sound levels are in line with observations.
1356 * FIXME: Verify R51,R50,R52 and R49 on real pcb
1359 * R51,R50,R52 and R49 verified on real pcb by Anoid.
13571360 *
13581361 * http://www.coinopvideogames.com/videogames01.php
13591362 * There are two recordings from 1982 where the filtered sound is way louder
r4425r4426
13631366 *
13641367 */
13651368
1366#define BTIME_R52   RES_K(1)
1367#define BTIME_R51   RES_K(5)    /* schematics 1k */
1368#define BTIME_R50   RES_K(10)
1369#define BTIME_R52   RES_K(1)   /* pcb: .912k = 1K || 11k */
1370#define BTIME_R51   RES_K(5)    /* pcb: .923k = 1k || 11k schematics 1k */
1371#define BTIME_R50   RES_K(10)   /* pcb: 1.667k = 10k || 2k */
13691372
13701373static const discrete_op_amp_filt_info btime_opamp_desc =
13711374   {BTIME_R51, 0, BTIME_R50, 0, BTIME_R49, CAP_U(0.068), CAP_U(0.068), 0, 0, 5.0, -5.0};
src/mame/drivers/qdrmfgp.c
r4425r4426
732732   ROM_LOAD( "gq_460_a06.12h", 0x080000, 0x80000, CRC(97ed5a77) SHA1(68600fd8d914451284cf181fb4bd5872860fb9ad) )
733733
734734   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
735   DISK_IMAGE( "gq460a08", 0, MD5(b79eebad38782e6713ab0bd7560817a2) SHA1(0cae7769fbb603d3c3e3627dde84a6c5a9b1062d) )
735   DISK_IMAGE( "gq460a08", 0, SHA1(2f142f986fa3c79d5c4102e800980d1706c35f75) )
736736ROM_END
737737
738738ROM_START( qdrmfgp2 )
r4425r4426
749749   ROM_LOAD( "ge_557_a08.19k", 0x080000, 0x80000, CRC(3da2b20c) SHA1(fdc2cdc27f3299f541944a78ce36ed33a7926056) )
750750
751751   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
752   DISK_IMAGE( "ge557a09", 0, MD5(df5039dc4e9dbb1f02ec408d839a42db) SHA1(5e836dbace34c9c1b107cce6a50071a4205a1534) )
752   DISK_IMAGE( "ge557a09", 0, SHA1(1ef8093b542fe0bf8240a5fd64e5af3839b6a04c) )
753753ROM_END
754754
755755
src/mame/drivers/chsuper.c
r0r4426
1/*******************************************************************************************
2
3Notes:
4-To init chsuper3, just soft-reset and keep pressed both service keys (9 & 0)
5
6TODO:
7-sound;
8-inputs are grossly mapped;
9-lamps;
10
11*******************************************************************************************/
12
13#include "driver.h"
14#include "cpu/z180/z180.h"
15#include "sound/dac.h"
16
17static int chsuper_tilexor;
18
19static VIDEO_START(chsuper)
20{
21}
22
23static VIDEO_UPDATE(chsuper)
24{
25   const gfx_element *gfx = screen->machine->gfx[0];
26   UINT8 *vram = memory_region(screen->machine, "vram");
27   int count = 0x0000;
28   int y,x;
29
30   for (y=0;y<64;y++)
31   {
32      for (x=0;x<128;x++)
33      {
34         int tile = ((vram[count+1]<<8) | vram[count]) & 0xffff;
35
36         tile ^=chsuper_tilexor;
37         //int colour = tile>>12;
38
39         drawgfx(bitmap,gfx,tile,0,0,0,x*4,y*8,cliprect,TRANSPARENCY_NONE,0);
40         count+=2;
41      }
42   }
43
44   return 0;
45}
46
47static WRITE8_HANDLER( paletteram_io_w )
48{
49   static int pal_offs,r,g,b,internal_pal_offs;
50
51   switch(offset)
52   {
53      case 0:
54         pal_offs = data;
55         break;
56      case 2:
57         internal_pal_offs = 0;
58         break;
59      case 1:
60         switch(internal_pal_offs)
61         {
62            case 0:
63               r = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
64               internal_pal_offs++;
65               break;
66            case 1:
67               g = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
68               internal_pal_offs++;
69               break;
70            case 2:
71               b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
72               palette_set_color(space->machine, pal_offs, MAKE_RGB(r, g, b));
73               internal_pal_offs = 0;
74               pal_offs++;
75               break;
76         }
77
78         break;
79   }
80}
81
82static READ8_HANDLER( ff_r )
83{
84   return 0xff;
85}
86
87static WRITE8_HANDLER( chsuper_vram_w )
88{
89   UINT8 *vram = memory_region(space->machine, "vram");
90
91   vram[offset] = data;
92}
93
94static ADDRESS_MAP_START( chsuper_prg_map, ADDRESS_SPACE_PROGRAM, 8 )
95   AM_RANGE(0x00000, 0x0efff) AM_ROM
96   AM_RANGE(0x00000, 0x01fff) AM_WRITE( chsuper_vram_w )
97   AM_RANGE(0x0f000, 0x0ffff) AM_RAM AM_REGION("maincpu", 0xf000)
98   AM_RANGE(0xfb000, 0xfbfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
99ADDRESS_MAP_END
100
101//  AM_RANGE(0xaff8, 0xaff8) AM_DEVWRITE("oki", okim6295_w)
102
103static ADDRESS_MAP_START( chsuper_portmap, ADDRESS_SPACE_IO, 8 )
104   AM_RANGE( 0x0000, 0x003f ) AM_RAM // Z180 internal regs
105   AM_RANGE( 0x00e8, 0x00e8 ) AM_READ_PORT("IN0")
106   AM_RANGE( 0x00e9, 0x00e9 ) AM_READ_PORT("IN1")
107   AM_RANGE( 0x00ea, 0x00ea ) AM_READ_PORT("DSW0")
108   AM_RANGE( 0x00ed, 0x00ef ) AM_WRITENOP //lamps
109   AM_RANGE( 0x00fc, 0x00fe ) AM_WRITE( paletteram_io_w )
110   AM_RANGE( 0x8300, 0x8300 ) AM_READ( ff_r ) //probably data for the dac
111   AM_RANGE( 0xff20, 0xff3f ) AM_DEVWRITE("dac", dac_w) // unk writes
112ADDRESS_MAP_END
113
114static INPUT_PORTS_START( chsuper )
115   PORT_START("IN0")
116   PORT_DIPNAME( 0x01, 0x01, "0" )
117   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
118   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
119   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
120   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Bet / Cancel All") PORT_CODE(KEYCODE_A)
121   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
122   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
123   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Analyzer")
124   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
125   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
126
127   PORT_START("IN1")
128   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
129   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
130   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
131   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
133   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
134   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
136   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
137   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
138   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
139   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
140   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
141   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
142   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
143   PORT_DIPNAME( 0x80, 0x80, "Credit clear" ) //hopper?
144   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
145   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
146
147   PORT_START("DSW0")
148   PORT_DIPNAME( 0x01, 0x01, "2" )
149   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
150   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
151   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
152   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
153   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
154   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
155   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
156   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
157   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
158   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
159   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
160   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
161   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
163   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
164   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
165   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
166   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
167   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
169   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
170   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
171   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
172
173   PORT_START("DSW1")
174   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
175
176INPUT_PORTS_END
177
178
179static const gfx_layout charlayout =
180{
181   4,8,
182   RGN_FRAC(1,1),
183   8,
184   { 0,1,2,3,4,5,6,7},
185   { 2*8,3*8,0*8,1*8 },
186   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32},
187   8*32
188};
189
190static GFXDECODE_START( chsuper )
191   GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout,   0, 16 )
192GFXDECODE_END
193
194static MACHINE_DRIVER_START( chsuper )
195
196   /* basic machine hardware */
197   MDRV_CPU_ADD("maincpu", Z180, XTAL_12MHz / 2)   /* HD64180RP8, 8 MHz? */
198   MDRV_CPU_PROGRAM_MAP(chsuper_prg_map,0)
199   MDRV_CPU_IO_MAP(chsuper_portmap,0)
200   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
201
202   /* video hardware */
203   MDRV_SCREEN_ADD("screen", RASTER)
204   MDRV_SCREEN_REFRESH_RATE(57)
205   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
206   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
207   MDRV_SCREEN_SIZE(64*8, 64*8)
208   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0, 30*8-1)
209
210   MDRV_NVRAM_HANDLER( generic_0fill )
211
212   MDRV_GFXDECODE(chsuper)
213   MDRV_PALETTE_LENGTH(0x100)
214
215   MDRV_VIDEO_START(chsuper)
216   MDRV_VIDEO_UPDATE(chsuper)
217
218   /* sound hardware */
219   MDRV_SPEAKER_STANDARD_MONO("mono")
220
221   MDRV_SOUND_ADD("dac", DAC, 0)
222   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
223MACHINE_DRIVER_END
224
225
226/*  ROM Regions definition
227 */
228
229ROM_START( chsuper3 )
230   ROM_REGION( 0x80000, "maincpu", 0 )
231   ROM_LOAD( "c.bin",  0x0000, 0x80000, CRC(e987ed1f) SHA1(8d1ee01914356714c7d1f8437d98b41a707a174a) )
232
233   ROM_REGION( 0x100000, "gfx1", ROMREGION_DISPOSE )
234   ROM_LOAD( "a.bin",  0x00000, 0x80000, CRC(ace8b591) SHA1(e9ba5efebdc9b655056ed8b2621f062f50e0528f) )
235   ROM_LOAD( "b.bin",  0x80000, 0x80000, CRC(5f58c722) SHA1(d339ae27af010b058eae9084fba85fb2fbed3952) )
236
237   ROM_REGION( 0x10000, "vram", ROMREGION_ERASE00 )
238
239   ROM_REGION( 0x80000, "adpcm", 0 )
240   ROM_COPY( "maincpu", 0x10000, 0x00000, 0x70000 )
241ROM_END
242
243ROM_START( chsuper2 )
244   ROM_REGION( 0x80000, "maincpu", 0 )
245   ROM_LOAD( "c.bin",  0x0000, 0x80000, CRC(cbf59e69) SHA1(68e4b167fdf9103fd748cff401f4fe7c1d214552) )
246
247   ROM_REGION( 0x100000, "gfx1", ROMREGION_DISPOSE )
248   ROM_LOAD( "a.bin",  0x00000, 0x80000, CRC(7caa8ebe) SHA1(440306a208ec8afd570b15f05b5dc542acc98510) )
249   ROM_LOAD( "b.bin",  0x80000, 0x80000, CRC(7bb463d7) SHA1(fb3842ba53e545fa47574c91df7281a9cb417395) )
250
251   ROM_REGION( 0x10000, "vram", ROMREGION_ERASE00 )
252
253   ROM_REGION( 0x80000, "adpcm", 0 )
254   ROM_COPY( "maincpu", 0x10000, 0x00000, 0x70000 )
255ROM_END
256
257static DRIVER_INIT( chsuper2 )
258{
259   chsuper_tilexor = 0x7f00;
260}
261
262static DRIVER_INIT( chsuper3 )
263{
264   chsuper_tilexor = 0x0e00;
265}
266
267
268GAME( 1999, chsuper3, 0,        chsuper, chsuper,  chsuper3, ROT0, "unknown",    "Champion Super 3 (V0.35)", GAME_NO_SOUND ) //24/02/99
269GAME( 1999, chsuper2, chsuper3, chsuper, chsuper,  chsuper2, ROT0, "unknown",    "Champion Super 2 (V0.13)", GAME_NO_SOUND ) //26/01/99
src/mame/drivers/namcos11.c
r4425r4426
16401640GAME( 1994, tekken,    0,        coh100, tekken,   namcos11, ROT0, "Namco", "Tekken (TE4/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
16411641GAME( 1994, tekkena,   tekken,   coh100, tekken,   namcos11, ROT0, "Namco", "Tekken (TE2/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
16421642GAME( 1994, tekkenb,   tekken,   coh100, tekken,   namcos11, ROT0, "Namco", "Tekken (TE2/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1643GAME( 1994, tekkenc,   tekken,   coh100, tekken,   namcos11, ROT0, "Namco", "Tekken (TE1/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1643GAME( 1994, tekkenc,   tekken,   coh100, tekken,   namcos11, ROT0, "Namco", "Tekken (Japan, TE1/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
16441644GAME( 1995, tekken2,   0,        coh100, tekken,   namcos11, ROT0, "Namco", "Tekken 2 Ver.B (TES3/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
16451645GAME( 1995, tekken2a,  tekken2,  coh100, tekken,   namcos11, ROT0, "Namco", "Tekken 2 Ver.B (TES2/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
16461646GAME( 1995, tekken2b,  tekken2,  coh100, tekken,   namcos11, ROT0, "Namco", "Tekken 2 (TES2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
16471647GAME( 1996, souledge,  0,        coh110, souledge, namcos11, ROT0, "Namco", "Soul Edge Ver. II (SO4/VER.C)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
16481648GAME( 1995, souledga,  souledge, coh110, souledge, namcos11, ROT0, "Namco", "Soul Edge Ver. II (SO3/VER.C)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
16491649GAME( 1995, souledgb,  souledge, coh110, souledge, namcos11, ROT0, "Namco", "Soul Edge (SO3/VER.A)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
1650GAME( 1995, souledgc,  souledge, coh110, souledge, namcos11, ROT0, "Namco", "Soul Edge (SO1/VER.A)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
1650GAME( 1995, souledgc,  souledge, coh110, souledge, namcos11, ROT0, "Namco", "Soul Edge (Japan, SO1/VER.A)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
16511651GAME( 1995, dunkmnia,  0,        coh110, namcos11, namcos11, ROT0, "Namco", "Dunk Mania (DM2/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1652GAME( 1995, dunkmnic,  dunkmnia, coh110, namcos11, namcos11, ROT0, "Namco", "Dunk Mania (DM1/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1653GAME( 1995, xevi3dg,   0,        coh110, namcos11, namcos11, ROT0, "Namco", "Xevious 3D/G (XV31/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1654GAME( 1996, primglex,  0,        coh110, tekken,   namcos11, ROT0, "Namco", "Prime Goal EX (PG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1655GAME( 1996, danceyes,  0,        coh110, namcos11, namcos11, ROT0, "Namco", "Dancing Eyes (DC1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1656GAME( 1996, pocketrc,  0,        coh110, pocketrc, namcos11, ROT0, "Namco", "Pocket Racer (PKR1/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1657GAME( 1997, starswep,  0,        coh110, namcos11, namcos11, ROT0, "Axela/Namco", "Star Sweep (STP1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1658GAME( 1998, myangel3,  0,        coh110, myangel3, namcos11, ROT0, "Namco", "Kosodate Quiz My Angel 3 (KQT1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1652GAME( 1995, dunkmnic,  dunkmnia, coh110, namcos11, namcos11, ROT0, "Namco", "Dunk Mania (Japan, DM1/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1653GAME( 1995, xevi3dg,   0,        coh110, namcos11, namcos11, ROT0, "Namco", "Xevious 3D/G (Japan, XV31/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1654GAME( 1996, primglex,  0,        coh110, tekken,   namcos11, ROT0, "Namco", "Prime Goal EX (Japan, PG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1655GAME( 1996, danceyes,  0,        coh110, namcos11, namcos11, ROT0, "Namco", "Dancing Eyes (Japan, DC1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1656GAME( 1996, pocketrc,  0,        coh110, pocketrc, namcos11, ROT0, "Namco", "Pocket Racer (Japan, PKR1/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1657GAME( 1997, starswep,  0,        coh110, namcos11, namcos11, ROT0, "Axela/Namco", "Star Sweep (Japan, STP1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1658GAME( 1998, myangel3,  0,        coh110, myangel3, namcos11, ROT0, "Namco", "Kosodate Quiz My Angel 3 (Japan, KQT1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
16591659GAME( 1999, ptblnk2a,  ptblank2, coh110, ptblnk2a, namcos11, ROT0, "Namco", "Point Blank 2 (GNB3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/galaxian.c
r4425r4426
17841784
17851785   MDRV_SOUND_ADD("konami", DISCRETE, 0)
17861786   MDRV_SOUND_CONFIG_DISCRETE(konami_sound)
1787   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2)
1787   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
17881788MACHINE_DRIVER_END
17891789
17901790
src/mame/drivers/namconb1.c
r4425r4426
20042004GAME( 1995, sws95,    0,        namconb1, nbsports, sws95,    ROT0,  "Namco", "Super World Stadium '95 (Japan)", GAME_IMPERFECT_SOUND )
20052005GAME( 1996, sws96,    0,        namconb1, nbsports, sws96,    ROT0,  "Namco", "Super World Stadium '96 (Japan)", GAME_IMPERFECT_SOUND )
20062006GAME( 1997, sws97,    0,        namconb1, nbsports, sws97,    ROT0,  "Namco", "Super World Stadium '97 (Japan)", GAME_IMPERFECT_SOUND )
2007GAME( 1994, vshoot,   0,        namconb1, namconb1, vshoot,   ROT0,  "Namco", "J-League Soccer V-Shoot", GAME_IMPERFECT_SOUND )
2007GAME( 1994, vshoot,   0,        namconb1, namconb1, vshoot,   ROT0,  "Namco", "J-League Soccer V-Shoot (Japan)", GAME_IMPERFECT_SOUND )
20082008
20092009/*     YEAR, NAME,     PARENT,   MACHINE,  INPUT,    INIT,     MNTR,  COMPANY, FULLNAME,   FLAGS */
20102010GAME( 1994, outfxies, 0,      namconb2, outfxies, outfxies, ROT0, "Namco", "Outfoxies", GAME_IMPERFECT_SOUND )
src/mame/drivers/pcat_nit.c
r0r4426
1/********************************************************************************************************************
2
3Street Games (c) 1993 New Image Technologies
4
5A modified 386 PC-AT HW
6
7preliminary driver by Angelo Salese
8
9=====================================================================================================================
10
11These games were made by New Image Technologies. They are touch screen multi games from around 1993.
12Guru dumped one of their games a year ago but the pcb was rusted out and I think the roms might
13be bad, not sure.
14
15nvram is a potential problem. I have them separated into their own folder for now. I'm not really s
16ure if they are needed, but I found this inside a Bonanza rom so they may hold a key:
17
18-------------------------------------------
19INVALID KEY
20_
21Programming DS1204
22_
23Successfully Programmed DS1204
24_
25Failed Programming DS1204
26_
27Verifying DS1204
28_
29Failed to read secure data
30_
31Failed to read ID DS1204
32_
33Verified DS1204
34-------------------------------------------
35
36I have them (the real chips) for my Bonanza rom boards, but they are missing on my Street Games boards.
37However, the back of one of the manuals mentions game swapping on these boards, and it doesn't mention
38this chip as needing to be changed. I included the nvram dump from Guru's Street Games II dump, so maybe
39that will work on all the Street Games sets? I don't know. My Dallas chip read good as 2764 and verified
40ok. The other one (bq4010yma-150) reads the same crc most reads but won't pass the verify function.
41It may still be good. Those are for the Bonanza sets as you'll see in the pics.
42
43I made copies of the manuals for Street Games and Bonanza and included lots of pics.
44
45From the looks of the boards I got, Street Games II looks like it uses the 3 original Street Games roms
46and just builds on them. You'll see what I mean in the pics.
47
48I don't know if all 3 vga bioses are needed or not, one is soldered and not dumped, I dumped the other two.
49I can get the soldered one dumped in the future if it turns out we need it. When these games got upgraded,
50they sometimes came with a new video board. Switching from Street Games to Street Games II probably didn't need
51it but switching to Bonanza did. The vga bioses I dumped came off of the 2 different video boards for Bonanza.
52I dumped them as 27c256. The one on the Street Games video board is the surface mounted one.
53
54The end numbers on the rom stickers give away the version info. For example, it looks like Guru's old dump
55of Street Games II is revision 7C.
56
57The system bios roms I dumped give an error in romcmp but they seem to verify ok so I think they are good.
58
59My 2 rom boards for Bonanza were fortunately 2 different revisions. I ended up with 2 sets of Street Games,
601 set of Street Games II, and 2 different sets of Bonanza. A second set of Street Games II might be able to be
61"created" if his dump is good because you will notice in the pics, it looks like Street Games II used 3 roms
62from Street Games I. That or one of my rom boards came populated incorrectly.
63
64The ATI keyboard bios is an HT6542. The Jet one I'm not sure. I don't think they can be read. Same for the M5818's.
65
66My set naming logic...
67
68bonanza = Bonanza (Rev 3)
69bonanza2 = Bonanza (Rev 2)
70
71streetg = Street Games (Rev 4)
72streetg2 = Street Games (Rev 2)
73
74streetgii = Street Games II (Rev 5)
75
76Anything else need to be dumped? More pics needed, etc.? Contact me.
77
78
79Smitdogg
80
81********************************************************************************************************************/
82
83#include "driver.h"
84#include "cpu/i386/i386.h"
85#include "memconv.h"
86#include "devconv.h"
87#include "machine/8237dma.h"
88#include "machine/pic8259.h"
89#include "machine/pit8253.h"
90#include "machine/mc146818.h"
91#include "machine/pcshare.h"
92#include "machine/pci.h"
93#include "machine/8042kbdc.h"
94#include "machine/pckeybrd.h"
95#include "machine/idectrl.h"
96
97static UINT32 *vga_vram;
98static UINT8 vga_regs[0x19];
99
100#define SET_VISIBLE_AREA(_x_,_y_) \
101   { \
102   rectangle visarea = *video_screen_get_visible_area(machine->primary_screen); \
103   visarea.min_x = 0; \
104   visarea.max_x = _x_-1; \
105   visarea.min_y = 0; \
106   visarea.max_y = _y_-1; \
107   video_screen_configure(machine->primary_screen, _x_, _y_, &visarea, video_screen_get_frame_period(machine->primary_screen).attoseconds ); \
108   } \
109
110#define RES_320x200 0
111#define RES_640x200 1
112
113static VIDEO_START(streetg2)
114{
115}
116
117
118
119static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num)
120{
121   static UINT32 offs,x,y,max_x,max_y;
122   int tile,color;
123
124   /*define the visible area*/
125   switch(size)
126   {
127      case RES_320x200:
128         SET_VISIBLE_AREA(320,200);
129         max_x = 40;
130         max_y = 25;
131         break;
132      case RES_640x200:
133         SET_VISIBLE_AREA(640,200);
134         max_x = 80;
135         max_y = 25;
136         break;
137   }
138
139   offs = map_offs;
140
141   for(y=0;y<max_y;y++)
142      for(x=0;x<max_x;x+=2)
143      {
144         tile =  (vga_vram[offs] & 0x00ff0000)>>16;
145         color = (vga_vram[offs] & 0xff000000)>>24;
146
147         drawgfx(bitmap,machine->gfx[gfx_num],
148               tile,
149               color,
150               0,0,
151               (x+1)*8,y*8,
152               cliprect,TRANSPARENCY_NONE,0);
153
154
155         tile =  (vga_vram[offs] & 0x000000ff);
156         color = (vga_vram[offs] & 0x0000ff00)>>8;
157
158         drawgfx(bitmap,machine->gfx[gfx_num],
159               tile,
160               color,
161               0,0,
162               (x+0)*8,y*8,
163               cliprect,TRANSPARENCY_NONE,0);
164
165         offs++;
166      }
167}
168
169static VIDEO_UPDATE(streetg2)
170{
171   cga_alphanumeric_tilemap(screen->machine,bitmap,cliprect,RES_640x200,0x18000/4,0);
172
173   return 0;
174}
175
176static struct {
177   const device_config   *pit8253;
178   const device_config   *pic8259_1;
179   const device_config   *pic8259_2;
180   const device_config   *dma8237_1;
181   const device_config   *dma8237_2;
182} streetg2_devices;
183
184/******************
185DMA8237 Controller
186******************/
187
188static UINT8 dma_offset[2][4];
189static UINT8 at_pages[0x10];
190
191static DMA8237_MEM_READ( pc_dma_read_byte )
192{
193   const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
194   offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
195      & 0xFF0000;
196
197   return memory_read_byte(space, page_offset + offset);
198}
199
200
201static DMA8237_MEM_WRITE( pc_dma_write_byte )
202{
203   const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
204   offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
205      & 0xFF0000;
206
207   memory_write_byte(space, page_offset + offset, data);
208}
209
210static READ8_HANDLER(dma_page_select_r)
211{
212   UINT8 data = at_pages[offset % 0x10];
213
214   switch(offset % 8) {
215   case 1:
216      data = dma_offset[(offset / 8) & 1][2];
217      break;
218   case 2:
219      data = dma_offset[(offset / 8) & 1][3];
220      break;
221   case 3:
222      data = dma_offset[(offset / 8) & 1][1];
223      break;
224   case 7:
225      data = dma_offset[(offset / 8) & 1][0];
226      break;
227   }
228   return data;
229}
230
231
232static WRITE8_HANDLER(dma_page_select_w)
233{
234   at_pages[offset % 0x10] = data;
235
236   switch(offset % 8) {
237   case 1:
238      dma_offset[(offset / 8) & 1][2] = data;
239      break;
240   case 2:
241      dma_offset[(offset / 8) & 1][3] = data;
242      break;
243   case 3:
244      dma_offset[(offset / 8) & 1][1] = data;
245      break;
246   case 7:
247      dma_offset[(offset / 8) & 1][0] = data;
248      break;
249   }
250}
251
252
253static const struct dma8237_interface dma8237_1_config =
254{
255   "maincpu",
256   1.0e-6, // 1us
257
258   pc_dma_read_byte,
259   pc_dma_write_byte,
260
261   { 0, 0, NULL, NULL },
262   { 0, 0, NULL, NULL },
263   NULL
264};
265
266static const struct dma8237_interface dma8237_2_config =
267{
268   "maincpu",
269   1.0e-6, // 1us
270
271   NULL,
272   NULL,
273
274   { 0, 0, NULL, NULL },
275   { 0, 0, NULL, NULL },
276   NULL
277};
278
279
280/******************
2818259 IRQ controller
282******************/
283
284static PIC8259_SET_INT_LINE( pic8259_1_set_int_line ) {
285   cpu_set_input_line(device->machine->cpu[0], 0, interrupt ? HOLD_LINE : CLEAR_LINE);
286}
287
288static const struct pic8259_interface pic8259_1_config = {
289   pic8259_1_set_int_line
290};
291
292static PIC8259_SET_INT_LINE( pic8259_2_set_int_line ) {
293   pic8259_set_irq_line( streetg2_devices.pic8259_1, 2, interrupt);
294}
295
296static const struct pic8259_interface pic8259_2_config = {
297   pic8259_2_set_int_line
298};
299
300static IRQ_CALLBACK(irq_callback)
301{
302   int r = 0;
303   r = pic8259_acknowledge(streetg2_devices.pic8259_2);
304   if (r==0)
305   {
306      r = pic8259_acknowledge(streetg2_devices.pic8259_1);
307   }
308   return r;
309}
310
311static PIT8253_OUTPUT_CHANGED( at_pit8254_out0_changed )
312{
313   if ( streetg2_devices.pic8259_1 ) {
314      pic8259_set_irq_line(streetg2_devices.pic8259_1, 0, state);
315   }
316}
317
318
319static PIT8253_OUTPUT_CHANGED( at_pit8254_out2_changed )
320{
321   //at_speaker_set_input( state ? 1 : 0 );
322}
323
324
325const struct pit8253_config at_pit8254_config =
326{
327   {
328      {
329         4772720/4,            /* heartbeat IRQ */
330         at_pit8254_out0_changed
331      }, {
332         4772720/4,            /* dram refresh */
333         NULL
334      }, {
335         4772720/4,            /* pio port c pin 4, and speaker polling enough */
336         at_pit8254_out2_changed
337      }
338   }
339};
340
341//ce9b8
342/* TODO: understand the proper ROM loading.*/
343static ADDRESS_MAP_START( pcat_map, ADDRESS_SPACE_PROGRAM, 32 )
344   AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
345   AM_RANGE(0x000a0000, 0x000bffff) AM_RAM AM_BASE(&vga_vram)
346   AM_RANGE(0x000c0000, 0x000c7fff) AM_RAM
347   AM_RANGE(0x000c8000, 0x000cffff) AM_RAM AM_REGION("video_bios", 0)
348   AM_RANGE(0x000d0000, 0x000d7fff) AM_RAM AM_REGION("disk_bios", 0)
349   AM_RANGE(0x000d8000, 0x000dffff) AM_RAM AM_REGION("disk_bios", 0)
350   AM_RANGE(0x000e0000, 0x000effff) AM_ROM AM_REGION("game_prg", 0)
351   AM_RANGE(0x000f0000, 0x000fffff) AM_ROM AM_REGION("bios", 0 )
352   AM_RANGE(0x00100000, 0x0027ffff) AM_ROM AM_REGION("game_prg", 0)
353   AM_RANGE(0xffff0000, 0xffffffff) AM_ROM AM_REGION("bios", 0 )
354ADDRESS_MAP_END
355
356
357static READ32_HANDLER( kludge_r )
358{
359   return mame_rand(space->machine);
360}
361
362/* 3c8-3c9 -> ramdac*/
363static WRITE32_HANDLER( vga_ramdac_w )
364{
365   static int pal_offs,r,g,b,internal_pal_offs;
366
367   if (ACCESSING_BITS_0_7)
368   {
369      //printf("%02x X\n",data);
370      pal_offs = internal_pal_offs = data;
371   }
372   if (ACCESSING_BITS_8_15)
373   {
374      //printf("%02x\n",data);
375      data>>=8;
376      switch(internal_pal_offs)
377      {
378         case 0:
379            r = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
380            internal_pal_offs++;
381            break;
382         case 1:
383            g = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
384            internal_pal_offs++;
385            break;
386         case 2:
387            b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
388            palette_set_color(space->machine, 0x200+pal_offs, MAKE_RGB(r, g, b));
389            internal_pal_offs = 0;
390            pal_offs++;
391            break;
392      }
393   }
394}
395
396static WRITE32_HANDLER( vga_regs_w )
397{
398   static UINT8 vga_address;
399
400   if (ACCESSING_BITS_0_7)
401      vga_address = data;
402   if (ACCESSING_BITS_8_15)
403   {
404      if(vga_address < 0x19)
405      {
406         vga_regs[vga_address] = data>>8;
407         logerror("VGA reg %02x with data %02x\n",vga_address,vga_regs[vga_address]);
408      }
409      else
410         logerror("Warning: used undefined VGA reg %02x with data %02x\n",vga_address,data>>8);
411   }
412}
413
414static ADDRESS_MAP_START( pcat_io, ADDRESS_SPACE_IO, 32 )
415   AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", dma8237_r, dma8237_w, 0xffffffff)
416   AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_1", pic8259_r, pic8259_w, 0xffffffff)
417   AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff)
418   AM_RANGE(0x0060, 0x006f) AM_READWRITE(kbdc8042_32le_r,         kbdc8042_32le_w)
419   AM_RANGE(0x0070, 0x007f) AM_RAM//READWRITE(mc146818_port32le_r,     mc146818_port32le_w)
420   AM_RANGE(0x0080, 0x009f) AM_READWRITE8(dma_page_select_r,dma_page_select_w, 0xffffffff)//TODO
421   AM_RANGE(0x00a0, 0x00bf) AM_DEVREADWRITE8("pic8259_2", pic8259_r, pic8259_w, 0xffffffff)
422   AM_RANGE(0x00c0, 0x00df) AM_DEVREADWRITE8("dma8237_2", dma8237_r, dma8237_w, 0xffff)
423   AM_RANGE(0x0278, 0x027f) AM_RAM //parallel port 2
424   AM_RANGE(0x0378, 0x037f) AM_RAM //parallel port
425   AM_RANGE(0x03c0, 0x03c3) AM_RAM
426   AM_RANGE(0x03cc, 0x03cf) AM_RAM
427   AM_RANGE(0x03b4, 0x03b7) AM_WRITE(vga_regs_w)
428   AM_RANGE(0x03c4, 0x03c7) AM_RAM //vga regs
429   AM_RANGE(0x03c8, 0x03cb) AM_WRITE(vga_ramdac_w)
430   AM_RANGE(0x03b8, 0x03bb) AM_READ(kludge_r) //hv_retrace
431   AM_RANGE(0x03c8, 0x03cb) AM_READ(kludge_r) //hv_retrace
432   AM_RANGE(0x03d4, 0x03d7) AM_WRITE(vga_regs_w)
433   AM_RANGE(0x03d8, 0x03db) AM_RAM
434   AM_RANGE(0x03bc, 0x03bf) AM_RAM //parallel port 3
435ADDRESS_MAP_END
436
437#define AT_KEYB_HELPER(bit, text, key1) \
438   PORT_BIT( bit, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(text) PORT_CODE(key1)
439
440static INPUT_PORTS_START( pcat_nit )
441   PORT_START("pc_keyboard_0")
442   PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED )    /* unused scancode 0 */
443   AT_KEYB_HELPER( 0x0002, "Esc",          KEYCODE_Q           ) /* Esc                         01  81 */
444
445   PORT_START("pc_keyboard_1")
446   AT_KEYB_HELPER( 0x0020, "Y",            KEYCODE_Y           ) /* Y                           15  95 */
447   AT_KEYB_HELPER( 0x1000, "Enter",        KEYCODE_ENTER       ) /* Enter                       1C  9C */
448
449   PORT_START("pc_keyboard_2")
450
451   PORT_START("pc_keyboard_3")
452   AT_KEYB_HELPER( 0x0002, "N",            KEYCODE_N           ) /* N                           31  B1 */
453   AT_KEYB_HELPER( 0x0800, "F1",           KEYCODE_S           ) /* F1                          3B  BB */
454
455   PORT_START("pc_keyboard_4")
456
457   PORT_START("pc_keyboard_5")
458
459   PORT_START("pc_keyboard_6")
460   AT_KEYB_HELPER( 0x0040, "(MF2)Cursor Up",      KEYCODE_UP          ) /* Up                          67  e7 */
461   AT_KEYB_HELPER( 0x0080, "(MF2)Page Up",         KEYCODE_PGUP        ) /* Page Up                     68  e8 */
462   AT_KEYB_HELPER( 0x0100, "(MF2)Cursor Left",      KEYCODE_LEFT        ) /* Left                        69  e9 */
463   AT_KEYB_HELPER( 0x0200, "(MF2)Cursor Right",   KEYCODE_RIGHT       ) /* Right                       6a  ea */
464   AT_KEYB_HELPER( 0x0800, "(MF2)Cursor Down",      KEYCODE_DOWN        ) /* Down                        6c  ec */
465   AT_KEYB_HELPER( 0x1000, "(MF2)Page Down",      KEYCODE_PGDN        ) /* Page Down                   6d  ed */
466   AT_KEYB_HELPER( 0x4000, "Del",                 KEYCODE_A           ) /* Delete                      6f  ef */
467
468   PORT_START("pc_keyboard_7")
469INPUT_PORTS_END
470
471static const rgb_t defcolors[]=
472{
473   MAKE_RGB(0x00,0x00,0x00),
474   MAKE_RGB(0x00,0x00,0xaa),
475   MAKE_RGB(0x00,0xaa,0x00),
476   MAKE_RGB(0x00,0xaa,0xaa),
477   MAKE_RGB(0xaa,0x00,0x00),
478   MAKE_RGB(0xaa,0x00,0xaa),
479   MAKE_RGB(0xaa,0xaa,0x00),
480   MAKE_RGB(0xaa,0xaa,0xaa),
481   MAKE_RGB(0x55,0x55,0x55),
482   MAKE_RGB(0x55,0x55,0xff),
483   MAKE_RGB(0x55,0xff,0x55),
484   MAKE_RGB(0x55,0xff,0xff),
485   MAKE_RGB(0xff,0x55,0x55),
486   MAKE_RGB(0xff,0x55,0xff),
487   MAKE_RGB(0xff,0xff,0x55),
488   MAKE_RGB(0xff,0xff,0xff)
489};
490
491static PALETTE_INIT(pcat_286)
492{
493   /*Note:palette colors are 6bpp...
494    xxxx xx--
495    */
496   int ix,iy;
497
498   for(ix=0;ix<0x300;ix++)
499      palette_set_color(machine, ix,MAKE_RGB(0x00,0x00,0x00));
500
501   //regular colors
502   for(iy=0;iy<0x10;iy++)
503   {
504      for(ix=0;ix<0x10;ix++)
505      {
506         palette_set_color(machine,(ix*2)+1+(iy*0x20),defcolors[ix]);
507         palette_set_color(machine,(ix*2)+0+(iy*0x20),defcolors[iy]);
508      }
509   }
510
511   //bitmap mode
512   for(ix=0;ix<0x10;ix++)
513      palette_set_color(machine, 0x200+ix,defcolors[ix]);
514   //todo: 256 colors
515}
516
517static void streetg2_set_keyb_int(running_machine *machine, int state) {
518   pic8259_set_irq_line(streetg2_devices.pic8259_1, 1, state);
519}
520
521
522static MACHINE_START( streetg2 )
523{
524//  bank = -1;
525//  lastvalue = -1;
526//  hv_blank = 0;
527   cpu_set_irq_callback(machine->cpu[0], irq_callback);
528   streetg2_devices.pit8253 = devtag_get_device( machine, "pit8254" );
529   streetg2_devices.pic8259_1 = devtag_get_device( machine, "pic8259_1" );
530   streetg2_devices.pic8259_2 = devtag_get_device( machine, "pic8259_2" );
531   streetg2_devices.dma8237_1 = devtag_get_device( machine, "dma8237_1" );
532   streetg2_devices.dma8237_2 = devtag_get_device( machine, "dma8237_2" );
533
534   init_pc_common(machine, PCCOMMON_KEYBOARD_AT, streetg2_set_keyb_int);
535   mc146818_init(machine, MC146818_STANDARD);
536}
537
538static const gfx_layout CGA_charlayout =
539{
540   8,8,
541    256,
542    1,
543    { 0 },
544    { 0,1,2,3,4,5,6,7 },
545   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 },
546    8*8
547};
548
549static GFXDECODE_START( streetg2 )
550   GFXDECODE_ENTRY( "video_bios", 0x2da2, CGA_charlayout,              0, 256 )
551   //there's also a 8x16 entry (just after the 8x8)
552GFXDECODE_END
553
554static GFXDECODE_START( bonanza )
555   GFXDECODE_ENTRY( "video_bios", 0x56f3, CGA_charlayout,              0, 256 )
556   //there's also a 8x16 entry (just after the 8x8)
557GFXDECODE_END
558
559static MACHINE_DRIVER_START( pcat_nit )
560   /* basic machine hardware */
561   MDRV_CPU_ADD("maincpu", I386, 14318180*2)   /* I386 ?? Mhz */
562   MDRV_CPU_PROGRAM_MAP(pcat_map, 0)
563   MDRV_CPU_IO_MAP(pcat_io, 0)
564
565    /* video hardware */
566   MDRV_SCREEN_ADD("screen", RASTER)
567   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
568   MDRV_SCREEN_REFRESH_RATE(60)
569   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
570   MDRV_SCREEN_SIZE(64*8, 32*8)
571   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
572   MDRV_GFXDECODE( streetg2 )
573
574   MDRV_MACHINE_START(streetg2)
575   MDRV_NVRAM_HANDLER( mc146818 )
576
577//  MDRV_IMPORT_FROM( at_kbdc8042 )
578   MDRV_PIC8259_ADD( "pic8259_1", pic8259_1_config )
579   MDRV_PIC8259_ADD( "pic8259_2", pic8259_2_config )
580   MDRV_DMA8237_ADD( "dma8237_1", dma8237_1_config )
581   MDRV_DMA8237_ADD( "dma8237_2", dma8237_2_config )
582   MDRV_PIT8254_ADD( "pit8254", at_pit8254_config )
583
584   MDRV_PALETTE_INIT(pcat_286)
585
586   MDRV_PALETTE_LENGTH(0x300)
587
588   MDRV_VIDEO_START(streetg2)
589   MDRV_VIDEO_UPDATE(streetg2)
590MACHINE_DRIVER_END
591
592static MACHINE_DRIVER_START( pcat_nitB )
593   MDRV_IMPORT_FROM( pcat_nit )
594   MDRV_GFXDECODE( bonanza )
595MACHINE_DRIVER_END
596
597/***************************************
598*
599* ROM definitions
600*
601***************************************/
602
603ROM_START(streetg)
604   ROM_REGION32_LE(0x10000, "bios", 0)   /* motherboard bios */
605   ROM_LOAD("system-bios-10-0004-01.u6", 0x00000, 0x10000, CRC(e4d6511f) SHA1(d432743f549fa6ecc04bc5bf94999253f86af08c) )
606
607   ROM_REGION(0x08000, "video_bios", 0)
608   ROM_LOAD16_BYTE("vga1-bios-ver-b-1.00-07.u8",     0x00000, 0x04000, CRC(a40551d6) SHA1(db38190f06e4af2c2d59ae310e65883bb16cd3d6))
609   ROM_CONTINUE(                                     0x00001, 0x04000 )
610
611   ROM_REGION(0x180000, "game_prg", 0)   /* proper game */
612   ROM_LOAD("10-0003-04.u11", 0x000000,0x80000, CRC(1471a728) SHA1(5e12a9230f8130282a1be9a10118a3556bafbc37) )
613   ROM_LOAD("10-0003-04.u12", 0x080000,0x80000, CRC(5a50f519) SHA1(c07a583b4220d4d5506824def91774fede760e65) )
614   ROM_LOAD("10-0003-04.u13", 0x100000,0x80000, CRC(8a609145) SHA1(18fcb58b461aa9149a163b85dd8267dec90da3cd) )
615
616   ROM_REGION(0x10000, "disk_bios", 0) //TODO: should be half size
617   ROM_LOAD("disk-bios-10-0001-04.u10",     0x00000, 0x10000, CRC(f2b50115) SHA1(b329f798ade8d891614e1af78e3d91f5c82af73d))
618
619   ROM_REGION(0x08000, "nvram_data", 0)
620   ROM_LOAD("8k_nvram.u9",     0x00000, 0x02000, CRC(44be0b89) SHA1(81666dd369d1d85269833293136d61ffe80e940a))
621ROM_END
622
623ROM_START(streetgr3)
624   ROM_REGION32_LE(0x10000, "bios", 0)   /* motherboard bios */
625   ROM_LOAD("system-bios-10-0004-01.u6", 0x00000, 0x10000, CRC(e4d6511f) SHA1(d432743f549fa6ecc04bc5bf94999253f86af08c) )
626
627   ROM_REGION(0x08000, "video_bios", 0)
628   ROM_LOAD16_BYTE("vga1-bios-ver-b-1.00-07.u8",     0x00000, 0x04000, CRC(a40551d6) SHA1(db38190f06e4af2c2d59ae310e65883bb16cd3d6))
629   ROM_CONTINUE(                                     0x00001, 0x04000 )
630
631   ROM_REGION(0x180000, "game_prg", 0)   /* proper game */
632   ROM_LOAD("10-00003-03.u11", 0x000000,0x80000, CRC(2fbcb12b) SHA1(f6413565fc1289ba32b411de877cdf6526f1fa9d) )
633   ROM_LOAD("10-00003-03.u12", 0x080000,0x80000, CRC(75660aac) SHA1(6a521e1d2a632c26e53b83d2cc4b0edecfc1e68c) )
634   ROM_LOAD("10-00003-03.u13", 0x100000,0x80000, CRC(6a9d0771) SHA1(6cd9a56a2413416d0928e5cf9340c94bc0c87c46) )
635
636   ROM_REGION(0x10000, "disk_bios", 0) //TODO: should be half size
637   ROM_LOAD("disk-bios-10-0001-04.u10",     0x00000, 0x10000, CRC(f2b50115) SHA1(b329f798ade8d891614e1af78e3d91f5c82af73d))
638
639   ROM_REGION(0x08000, "nvram_data", 0)
640   ROM_LOAD("8k_nvram.u9",     0x00000, 0x02000, CRC(44be0b89) SHA1(81666dd369d1d85269833293136d61ffe80e940a))
641ROM_END
642
643ROM_START(bonanza)
644   ROM_REGION32_LE(0x10000, "bios", 0)   /* motherboard bios */
645   ROM_LOAD("system-bios-sx-10-0004-02.u6", 0x00000, 0x10000, CRC(fa545ba8) SHA1(db64548bd87262cd2e82175a1b66f168b5ae072d) )
646
647   ROM_REGION(0x08000, "video_bios", 0)
648   ROM_LOAD16_BYTE("techyosd-isa-bios-v1.2.u8",     0x00000, 0x04000, BAD_DUMP CRC(1446cc86) SHA1(b51ba8dde59b3cd5bbd92e15903187a9a06d4018) )
649   ROM_CONTINUE(                                    0x00001, 0x04000 ) //FIXED BITS (xxxx0xxx)
650
651   ROM_REGION(0x300000, "game_prg", 0)   /* proper game */
652   ROM_LOAD("10-0018-03-090894.u11", 0x000000,0x80000, BAD_DUMP CRC(75660aac) SHA1(6a521e1d2a632c26e53b83d2cc4b0edecfc1e68c) ) //BLANK!
653   ROM_LOAD("10-0018-03-090894.u12", 0x080000,0x80000, CRC(d7cb191d) SHA1(2047f3668b0e41ad5347107f4e3446c0374c5bb7) )
654   ROM_LOAD("10-0018-03-090894.u13", 0x100000,0x80000, CRC(1d3ddeaa) SHA1(8e73fe535882f6d634668733e550281e727fbdbc) )
655   ROM_LOAD("10-0018-03-090894.u15", 0x180000,0x80000, CRC(b9b3f442) SHA1(6ea5ce3eb007b95ad3350fdb634625b151ae7bdb) )
656   ROM_LOAD("10-0018-03-090894.u16", 0x200000,0x80000, CRC(5b0dd6f5) SHA1(8172118185179ecb7d3f958480186bf9c906785f) )
657   ROM_LOAD("10-0018-03-090894.u17", 0x280000,0x80000, CRC(b637eb58) SHA1(7c4615f58118d9b82575d816ef916fccbb1be0f9) )
658
659   ROM_REGION(0x10000, "disk_bios", 0) //TODO: should be half size
660   ROM_LOAD("disk-bios-10-0001-04.u10",     0x00000, 0x10000, CRC(f2b50115) SHA1(b329f798ade8d891614e1af78e3d91f5c82af73d))
661
662   ROM_REGION(0x08000, "nvram_data", 0)
663   ROM_LOAD("bq4010yma-150.u9",     0x00000, 0x02000, CRC(f4ca28ee) SHA1(17b852028568fb814df62f5870b91a8303302b55))
664ROM_END
665
666ROM_START(bonanzar2)
667   ROM_REGION32_LE(0x10000, "bios", 0)   /* motherboard bios */
668   ROM_LOAD("system-bios-sx-10-0004-02.u6", 0x00000, 0x10000, CRC(fa545ba8) SHA1(db64548bd87262cd2e82175a1b66f168b5ae072d) )
669
670   ROM_REGION(0x08000, "video_bios", 0)
671   ROM_LOAD16_BYTE("techyosd-isa-bios-v1.2.u8",     0x00000, 0x04000, BAD_DUMP CRC(1446cc86) SHA1(b51ba8dde59b3cd5bbd92e15903187a9a06d4018) )
672   ROM_CONTINUE(                                    0x00001, 0x04000 ) //FIXED BITS (xxxx0xxx)
673
674   ROM_REGION(0x300000, "game_prg", 0)   /* proper game */
675   ROM_LOAD("10-0018-02-081794.u11", 0x000000,0x80000, CRC(f87fa935) SHA1(b06144496406231aa63149ae12a048ffab8f77d0) )
676   ROM_LOAD("10-0018-02-081794.u12", 0x080000,0x80000, CRC(bd892e3e) SHA1(1b9174fe2a6eaa7687b543798099b86b9039c049) )
677   ROM_LOAD("10-0018-02-081794.u13", 0x100000,0x80000, CRC(626d999e) SHA1(5c27e3b064b0235c0d6e0be8d8f78538a11647a2) )
678   ROM_LOAD("10-0018-02-081794.u15", 0x180000,0x80000, CRC(3b28f582) SHA1(3da61fbd92e6cc60e00eaa21d8fb04aa78cce663) )
679   ROM_LOAD("10-0018-02-081794.u16", 0x200000,0x80000, CRC(fe29ad76) SHA1(64aaae639f024c50c09fe920bc92e6d45ced5648) )
680   ROM_LOAD("10-0018-02-081794.u17", 0x280000,0x80000, CRC(066108fe) SHA1(ef837422a2a81f5ac3375b6ed68f20143ac6caec) )
681
682   ROM_REGION(0x10000, "disk_bios", 0) //TODO: should be half size
683   ROM_LOAD("disk-bios-10-0001-04.u10",     0x00000, 0x10000, CRC(f2b50115) SHA1(b329f798ade8d891614e1af78e3d91f5c82af73d))
684
685   ROM_REGION(0x08000, "nvram_data", 0)
686   ROM_LOAD("bq4010yma-150.u9",     0x00000, 0x02000, CRC(f4ca28ee) SHA1(17b852028568fb814df62f5870b91a8303302b55))
687ROM_END
688
689ROM_START(streetg2)
690   ROM_REGION32_LE(0x10000, "bios", 0)   /* motherboard bios */
691   ROM_LOAD("10-0004-01_mb-bios.bin", 0x00000, 0x10000, CRC(e4d6511f) SHA1(d432743f549fa6ecc04bc5bf94999253f86af08c) )
692
693   ROM_REGION(0x08000, "video_bios", 0)
694   ROM_LOAD16_BYTE("vga1-bios-ver-b-1.00-07.u8",     0x00000, 0x04000, CRC(a40551d6) SHA1(db38190f06e4af2c2d59ae310e65883bb16cd3d6))
695   ROM_CONTINUE(                                     0x00001, 0x04000 )
696
697   ROM_REGION(0x180000, "game_prg", 0)   /* proper game */
698   ROM_LOAD("10-0007-07c_083194_rom4.u11", 0x000000,0x80000, CRC(244c2bfa) SHA1(4f2f0fb6923b4e3f1ab4e607e29a27fb15b39fac) )
699   ROM_LOAD("10-0007-07c_083194_rom5.u12", 0x080000,0x80000, CRC(c89d5dca) SHA1(212bcbf7a39243f4524b4a855fbedabd387d17f2) )
700   ROM_LOAD("10-0007-07c_083194_rom6.u13", 0x100000,0x80000, CRC(6264f65f) SHA1(919a8e5d9861dc642ac0f0885faed544bbafa321) )
701
702   ROM_REGION(0x08000, "disk_bios", 0)
703   ROM_LOAD("10-0001-03_disk_bios.u10",     0x00000, 0x08000, CRC(d6ba8b37) SHA1(1d1d984bc15fd154fc07dcfa2132bd44636d7bf1))
704
705   ROM_REGION(0x08000, "nvram_data", 0)
706   ROM_LOAD("8k_nvram.u9",     0x00000, 0x02000, CRC(44be0b89) SHA1(81666dd369d1d85269833293136d61ffe80e940a))
707ROM_END
708
709ROM_START(streetg2r5)
710   ROM_REGION32_LE(0x10000, "bios", 0)   /* motherboard bios */
711   ROM_LOAD("10-0004-01_mb-bios.bin", 0x00000, 0x10000, CRC(e4d6511f) SHA1(d432743f549fa6ecc04bc5bf94999253f86af08c) )
712
713   ROM_REGION(0x08000, "video_bios", 0)
714   ROM_LOAD16_BYTE("vga1-bios-ver-b-1.00-07.u8",     0x00000, 0x04000, CRC(a40551d6) SHA1(db38190f06e4af2c2d59ae310e65883bb16cd3d6))
715   ROM_CONTINUE(                                     0x00001, 0x04000 )
716
717   ROM_REGION(0x180000, "game_prg", 0)   /* proper game */
718   ROM_LOAD("10-00007-05-032194.u15", 0x000000,0x80000, CRC(cefa230f) SHA1(91fd30a3def381974fae0edb4d42d452acda19bb) )
719   ROM_LOAD("10-00007-05-032194.u16", 0x080000,0x80000, CRC(0be5dd19) SHA1(d0474ff5156e1fa8b4edb502c49b7e1a2b3f6169) )
720   ROM_LOAD("10-00007-05-032194.u17", 0x100000,0x80000, CRC(f6c996b9) SHA1(871a8d093b856511a0e2b03334ef5c66a2482622) )
721
722   ROM_REGION(0x08000, "disk_bios", 0)
723   ROM_LOAD("10-0001-03_disk_bios.u10",     0x00000, 0x08000, CRC(d6ba8b37) SHA1(1d1d984bc15fd154fc07dcfa2132bd44636d7bf1))
724
725   ROM_REGION(0x08000, "nvram_data", 0)
726   ROM_LOAD("8k_nvram.u9",     0x00000, 0x02000, CRC(44be0b89) SHA1(81666dd369d1d85269833293136d61ffe80e940a))
727ROM_END
728
729GAME( 1993, bonanza,    0,         pcat_nitB, pcat_nit, 0, ROT0, "New Image Technologies",  "Bonanza (Revision 3)", GAME_NOT_WORKING|GAME_NO_SOUND )
730GAME( 1993, bonanzar2,  bonanza,   pcat_nitB, pcat_nit, 0, ROT0, "New Image Technologies",  "Bonanza (Revision 2)", GAME_NOT_WORKING|GAME_NO_SOUND )
731GAME( 1993, streetg,    0,         pcat_nit,  pcat_nit, 0, ROT0, "New Image Technologies",  "Street Games (Revision 4)", GAME_NOT_WORKING|GAME_NO_SOUND )
732GAME( 1993, streetgr3,  streetg,   pcat_nit,  pcat_nit, 0, ROT0, "New Image Technologies",  "Street Games (Revision 3)", GAME_NOT_WORKING|GAME_NO_SOUND )
733GAME( 1993, streetg2,   0,         pcat_nit,  pcat_nit, 0, ROT0, "New Image Technologies",  "Street Games II (Revision 7C)", GAME_NOT_WORKING|GAME_NO_SOUND )
734GAME( 1993, streetg2r5, streetg2,  pcat_nit,  pcat_nit, 0, ROT0, "New Image Technologies",  "Street Games II (Revision 5)", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/jpmimpct.c
r4425r4426
10591059GAME( 1997, scrabble, 0,      jpmimpct, scrabble, 0, ROT0, "JPM", "Scrabble (rev. F)",           GAME_SUPPORTS_SAVE )
10601060GAME( 1998, hngmnjpm, 0,      jpmimpct, hngmnjpm, 0, ROT0, "JPM", "Hangman (JPM)",               GAME_SUPPORTS_SAVE )
10611061GAME( 1999, coronatn, 0,      jpmimpct, coronatn, 0, ROT0, "JPM", "Coronation Street Quiz Game", GAME_SUPPORTS_SAVE )
1062
1063/**************************************************************************
1064
1065    Mechanical IMPACT Games
1066        AGEMAME driver
1067
1068    This is mostly based on old documentation, and needs a proper look.
1069***************************************************************************/
1070
1071#include "video/awpvid.h"
1072#include "machine/steppers.h"
1073#include "machine/roc10937.h"
1074#include "machine/8255ppi.h"
1075
1076/*************************************
1077 *
1078 *  Statics
1079 *
1080 *************************************/
1081
1082static int optic_pattern;
1083static int payen;
1084
1085/*************************************
1086 *
1087 *  Initialisation
1088 *
1089 *************************************/
1090
1091static READ8_DEVICE_HANDLER( hopper_b_r )
1092{
1093   //?
1094   return 0;
1095}
1096
1097static READ8_DEVICE_HANDLER( hopper_c_r )
1098{
1099   //?
1100   return 0;
1101}
1102
1103static WRITE8_DEVICE_HANDLER( payen_a_w )
1104{
1105   if ( data )
1106   {
1107      if ( data & 0x10 )
1108      payen = 1;
1109      else
1110      payen = 0;
1111    }
1112}
1113
1114static WRITE8_DEVICE_HANDLER( display_c_w )
1115{
1116   //?
1117}
1118
1119static const ppi8255_interface ppi8255_intf[1] =
1120{
1121   {
1122      DEVCB_NULL,
1123      DEVCB_HANDLER(hopper_b_r),
1124      DEVCB_HANDLER(hopper_c_r),
1125      DEVCB_HANDLER(payen_a_w),
1126      DEVCB_NULL,
1127      DEVCB_HANDLER(display_c_w)
1128   }
1129};
1130
1131static MACHINE_RESET( impctawp )
1132{
1133   memset(&duart_1, 0, sizeof(duart_1));
1134
1135   duart_1_timer = timer_alloc(machine, duart_1_timer_event, NULL);
1136
1137   /* Reset states */
1138   duart_1_irq = 0;
1139
1140   state_save_register_global(machine, duart_1_irq);
1141   state_save_register_global(machine, touch_cnt);
1142   state_save_register_global_array(machine, touch_data);
1143
1144   /* TODO! */
1145   state_save_register_global(machine, duart_1.ISR);
1146   state_save_register_global(machine, duart_1.IMR);
1147   state_save_register_global(machine, duart_1.CT);
1148
1149   ROC10937_init(0, MSC1937,0);
1150   ROC10937_reset(0);   /* reset display1 */
1151   stepper_config(machine, 0, &starpoint_interface_48step);
1152   stepper_config(machine, 1, &starpoint_interface_48step);
1153   stepper_config(machine, 2, &starpoint_interface_48step);
1154   stepper_config(machine, 3, &starpoint_interface_48step);
1155   stepper_config(machine, 4, &starpoint_interface_48step);
1156   stepper_config(machine, 5, &starpoint_interface_48step);
1157   stepper_config(machine, 6, &starpoint_interface_48step);
1158}
1159/*************************************
1160 *
1161 *  I/O handlers
1162 *
1163 *************************************/
1164
1165/*
1166 *  0: DIP switches
1167 *  1: Percentage key
1168 *  2: Lamps + switches (J10)
1169 *  3: Lamps + switches (J10)
1170 *  4: Lamps + switches (J10)
1171 *      ---- ---x   Back door
1172 *      ---- --x-   Cash door
1173 *      ---- -x--   Refill key
1174 *  5: Lamps + switches (J9)
1175 *  6: Lamps + switches (J9)
1176 *  7: Lamps + switches (J9)
1177 *  8: Payslides
1178 *  9: Coin mechanism
1179 */
1180static READ16_HANDLER( optos_r )
1181{
1182   int i;
1183
1184   for (i=0; i<6; i++)
1185   {
1186      if ( stepper_optic_state(i) ) optic_pattern |= (1 << i);
1187      else                          optic_pattern &= ~(1 << i);
1188   }
1189   return optic_pattern;
1190}
1191
1192/*************************************
1193 *
1194 *  Mysterious stuff
1195 *
1196 *************************************/
1197
1198static WRITE16_HANDLER( jpmioawp_w )
1199{
1200   int i;
1201   UINT64 cycles  = cpu_get_total_cycles(space->cpu);
1202   switch (offset)
1203   {
1204      case 0x00:
1205      {
1206         output_set_value("PWRLED",!(data&0x100));
1207         output_set_value("STATLED",!(data&0x200));
1208         break;
1209      }
1210
1211
1212      case 0x02:
1213      {
1214         for (i=0; i<4; i++)
1215         {
1216            stepper_update(i, (data >> i)& 0x0F );
1217         }
1218         break;
1219      }
1220      case 0x04:
1221      {
1222         for (i=0; i<2; i++)
1223         {
1224            stepper_update(i, (data >> (i + 4)& 0x0F ));
1225         }
1226         break;
1227      }
1228      case 0x06:
1229      {
1230         if ( data & 0x10 )
1231         {   // PAYEN ?
1232            if ( data & 0xf )
1233            {
1234         //      slide = 1;
1235            }
1236            else
1237            {
1238            //  slide = 0;
1239            }
1240         }
1241         else
1242//          slide = 0;
1243         Mechmtr_update(0, cycles, data >> 10);
1244         if ( data )
1245         {
1246            duart_1.IP &= ~0x10;
1247         }
1248         else
1249         {
1250            duart_1.IP |= 0x10;
1251         }
1252         break;
1253      }
1254
1255      case 0x08:
1256      {
1257         jpm_draw_lamps(data, lamp_strobe);
1258         break;
1259      }
1260
1261      case 0x0b:
1262      {
1263         output_set_digit_value(lamp_strobe,data);
1264         break;
1265      }
1266      case 0x0f:
1267      {
1268         if (data & 0x10)
1269         {
1270            lamp_strobe = (data & 0x0f);
1271         }
1272         break;
1273      }
1274   }
1275}
1276
1277static READ16_HANDLER( ump_r )
1278{
1279   return 0xffff;
1280}
1281
1282/*************************************
1283 *
1284 *  Main CPU memory handlers
1285 *
1286 *************************************/
1287static ADDRESS_MAP_START( awp68k_program_map, ADDRESS_SPACE_PROGRAM, 16 )
1288   AM_RANGE(0x00000000, 0x000fffff) AM_ROM
1289   AM_RANGE(0x00100000, 0x001fffff) AM_ROM
1290   AM_RANGE(0x00400000, 0x00403fff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
1291   AM_RANGE(0x00480000, 0x0048001f) AM_READWRITE(duart_1_r, duart_1_w)
1292   AM_RANGE(0x00480020, 0x00480033) AM_READ(inputs1_r)
1293   AM_RANGE(0x00480034, 0x00480035) AM_READ(ump_r)
1294   AM_RANGE(0x00480040, 0x00480041) AM_READ(optos_r)
1295   AM_RANGE(0x00480060, 0x00480067) AM_DEVREADWRITE8("ppi8255_0", ppi8255_r, ppi8255_w, 0xff00)
1296   AM_RANGE(0x004800a0, 0x004800af) AM_READWRITE(jpmio_r, jpmioawp_w)
1297   AM_RANGE(0x004800e0, 0x004800e1) AM_WRITE(unk_w)
1298   AM_RANGE(0x004801dc, 0x004801dd) AM_READ(unk_r)
1299   AM_RANGE(0x004801de, 0x004801df) AM_READ(unk_r)
1300   AM_RANGE(0x00480080, 0x00480081) AM_DEVWRITE("upd", upd7759_w)
1301   AM_RANGE(0x00480082, 0x00480083) AM_DEVWRITE("upd",volume_w)
1302   AM_RANGE(0x00480084, 0x00480085) AM_DEVREAD("upd", upd7759_r)
1303//  AM_RANGE(0x004801e0, 0x004801ff) AM_READWRITE(duart_2_r, duart_2_w)
1304//  AM_RANGE(0x00800000, 0x00800007) AM_READWRITE(m68k_tms_r, m68k_tms_w)
1305   AM_RANGE(0x00c00000, 0x00cfffff) AM_ROM
1306   AM_RANGE(0x00d00000, 0x00dfffff) AM_ROM
1307   AM_RANGE(0x00e00000, 0x00efffff) AM_ROM
1308   AM_RANGE(0x00f00000, 0x00ffffff) AM_ROM
1309ADDRESS_MAP_END
1310
1311/*************************************
1312 *
1313 *  Machine driver
1314 *
1315 *************************************/
1316
1317static MACHINE_DRIVER_START( impctawp )
1318   MDRV_CPU_ADD("maincpu",M68000, 8000000)
1319   MDRV_CPU_PROGRAM_MAP(awp68k_program_map, 0)
1320
1321   MDRV_QUANTUM_TIME(HZ(30000))
1322
1323   MDRV_MACHINE_RESET(impctawp)
1324   MDRV_NVRAM_HANDLER(generic_0fill)
1325
1326   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
1327
1328   MDRV_SPEAKER_STANDARD_MONO("mono")
1329   MDRV_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK)
1330   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1331   MDRV_DEFAULT_LAYOUT(layout_awpvid16)
1332MACHINE_DRIVER_END
1333
1334/*************************************
1335 *
1336 *  ROM definition(s)
1337 *
1338 *************************************/
1339
1340ROM_START( m_tbirds )
1341   ROM_REGION( 0x1000000, "maincpu", 0 )
1342   ROM_LOAD16_BYTE( "thbi-3_1.bin", 0x000000, 0x020000, CRC(ecbdd85c) SHA1(626306a72d658af6ecfa4b65212cf8aa35630539) )
1343   ROM_LOAD16_BYTE( "thbi-3_2.bin", 0x000001, 0x020000, CRC(61e98f71) SHA1(315044637bde8ab862af08bf9825917c87fcc77d) )
1344
1345   ROM_FILL(                   0x040000, 0x100000, 0xff )
1346
1347   ROM_REGION( 0x80000, "upd", 0 )
1348   ROM_LOAD( "tbcl-snd.bin", 0x000000, 0x80000, CRC(1cc197be) SHA1(2247aa1a0e6aab7389b3222f373890f54e907361) )
1349ROM_END
1350
1351/*************************************
1352 *
1353 *  Game driver(s)
1354 *
1355 *************************************/
1356
1357GAME( 199?, m_tbirds, 0,      impctawp, trivialp, 0, ROT0, "JPM", "Thunderbirds", GAME_NOT_WORKING )
src/mame/drivers/namcos12.c
r4425r4426
23572357   ROM_LOAD( "tr1wave1.4",  0x0400000, 0x400000, CRC(34539cdd) SHA1(afb7079c0f447fbda285a5b97a37c04baf26db75) )
23582358ROM_END
23592359
2360GAME( 1996, tekken3,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken 3 (TET1/VER.E1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
2360GAME( 1996, tekken3,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken 3 (Japan, TET1/VER.E1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
23612361GAME( 1996, tekken3a,  tekken3,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken 3 (TET2/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
23622362GAME( 1996, tekken3b,  tekken3,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken 3 (TET3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
23632363GAME( 1996, tekken3c,  tekken3,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken 3 (TET2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
23642364GAME( 1997, lbgrande,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Libero Grande (LG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
2365GAME( 1997, toukon3,   0,        coh700,   namcos12, namcos12, ROT0, "Tomy/Namco",    "Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (TR1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC019 */
2365GAME( 1997, toukon3,   0,        coh700,   namcos12, namcos12, ROT0, "Tomy/Namco",    "Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (Japan, TR1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC019 */
23662366GAME( 1998, soulclbr,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC14/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2367GAME( 1998, soulclba,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2367GAME( 1998, soulclba,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (Japan, SOC11/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
23682368GAME( 1998, soulclbb,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC13/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2369GAME( 1998, soulclbc,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2370GAME( 1998, soulclbd,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2369GAME( 1998, soulclbc,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (Japan, SOC11/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2370GAME( 1998, soulclbd,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (Japan, SOC11/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
23712371GAME( 1998, ehrgeiz,   0,        coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
23722372GAME( 1998, ehrgeiza,  ehrgeiz,  coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
2373GAME( 1998, mdhorse,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Derby Quiz My Dream Horse (MDH1/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC035 */
2374GAME( 1998, sws98,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium '98 (SS81/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC0?? */
2373GAME( 1998, mdhorse,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Derby Quiz My Dream Horse (Japan, MDH1/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC035 */
2374GAME( 1998, sws98,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium '98 (Japan, SS81/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC0?? */
23752375GAME( 1998, tenkomor,  0,        coh700,   namcos12, namcos12, ROT90, "Namco",        "Tenkomori Shooting (TKM2/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC036 */
2376GAME( 1998, tenkomoj,  tenkomor, coh700,   namcos12, namcos12, ROT90, "Namco",        "Tenkomori Shooting (TKM1/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC036 */
2377GAME( 1998, fgtlayer,  0,        coh700,   namcos12, namcos12, ROT0, "Arika/Namco",   "Fighting Layer (FTL0/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC037 */
2378GAME( 1999, pacapp,    0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion (PPP1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC038 */
2376GAME( 1998, tenkomoj,  tenkomor, coh700,   namcos12, namcos12, ROT90, "Namco",        "Tenkomori Shooting (Japan, TKM1/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC036 */
2377GAME( 1998, fgtlayer,  0,        coh700,   namcos12, namcos12, ROT0, "Arika/Namco",   "Fighting Layer (Japan, FTL1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC037 */
2378GAME( 1999, pacapp,    0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion (Japan, PPP1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC038 */
23792379GAME( 1999, ptblank2,  0,        coh700,   ptblank2, ptblank2, ROT0, "Namco",         "Point Blank 2 (GNB5/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC042 */
2380GAME( 1999, sws99,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium '99 (SS91/VER.A3)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC043 */
2380GAME( 1999, sws99,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium '99 (Japan, SS91/VER.A3)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC043 */
23812381GAME( 1999, tektagt,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG3/VER.C1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
23822382GAME( 1999, tektagta,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG3/VER.B)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
2383GAME( 1999, tektagtb,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG1/VER.B)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
2384GAME( 1999, tektagtc,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG1/VER.A3)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
2383GAME( 1999, tektagtb,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (Japan, TEG1/VER.B)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
2384GAME( 1999, tektagtc,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (Japan, TEG1/VER.A3)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
23852385GAME( 1999, ghlpanic,  0,        coh700,   ghlpanic, ghlpanic, ROT0, "Namco",         "Ghoul Panic (OB2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC045 */
2386GAME( 1999, pacapp2,   0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion 2 (PKS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC046 */
2387GAME( 1999, mrdrillr,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Mr Driller (DRI1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC048 */
2388GAME( 1999, kaiunqz,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Kaiun Quiz (KW1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC050 */
2389GAME( 1999, pacappsp,  0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion Special (PSP1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC052 */
2390GAME( 1999, aquarush,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Aqua Rush (AQ1/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC053 */
2391GAME( 1999, golgo13,   0,        coh700,   golgo13,  namcos12, ROT0, "Raizing/Namco", "Golgo 13 (GLG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC054 */
2392GAME( 1999, g13knd,    0,        coh700,   golgo13,  namcos12, ROT0, "Raizing/Namco", "Golgo 13 Kiseki no Dandou (GLS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC059 */
2393GAME( 2000, sws2000,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium 2000 (SS01/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC055 */
2394GAME( 2001, sws2001,   sws2000,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium 2001 (SS11/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC061 */
2386GAME( 1999, pacapp2,   0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion 2 (Japan, PKS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC046 */
2387GAME( 1999, mrdrillr,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Mr Driller (Japan, DRI1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC048 */
2388GAME( 1999, kaiunqz,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Kaiun Quiz (Japan, KW1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC050 */
2389GAME( 1999, pacappsp,  0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion Special (Japan, PSP1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC052 */
2390GAME( 1999, aquarush,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Aqua Rush (Japan, AQ1/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC053 */
2391GAME( 1999, golgo13,   0,        coh700,   golgo13,  namcos12, ROT0, "Raizing/Namco", "Golgo 13 (Japan, GLG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC054 */
2392GAME( 1999, g13knd,    0,        coh700,   golgo13,  namcos12, ROT0, "Raizing/Namco", "Golgo 13 Kiseki no Dandou (Japan, GLS1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC059 */
2393GAME( 2000, sws2000,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium 2000 (Japan, SS01/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC055 */
2394GAME( 2001, sws2001,   sws2000,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium 2001 (Japan, SS11/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* KC061 */
src/mame/drivers/ampoker2.c
r4425r4426
11131113   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) SHA1(e4882868a43e21a509a180b9731600d1dd63b5cc) )
11141114ROM_END
11151115
1116ROM_START( ampkr2b4 )
1117   ROM_REGION( 0x10000, "maincpu", 0 )
1118   ROM_LOAD( "9.bin", 0x0000, 0x10000, CRC(657fa846) SHA1(1ef8fea81627b86aab6f682919d7432c57816e5f) )
1119
1120   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
1121   ROM_LOAD( "ampoker.u47", 0x0000, 0x4000, CRC(cefed6c7) SHA1(79591339eab2712b432dfe89929dbc97000a13d2) )
1122
1123   ROM_REGION( 0x200, "proms", 0 )
1124   ROM_LOAD( "82s147an.u48", 0x0000, 0x0200, CRC(9bc8e543) SHA1(e4882868a43e21a509a180b9731600d1dd63b5cc) )
1125ROM_END
1126
11161127ROM_START( ampkr95 )
11171128   ROM_REGION( 0x10000, "maincpu", 0 )
11181129   ROM_LOAD( "amp95rus.u6", 0x0000, 0x10000, CRC(6ec74b2b) SHA1(2dca05bc111071f1407dd524b67b5a3dc5848c70) )
r4425r4426
12071218GAMEL( 1990, ampkr2b1, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "American Poker II (bootleg, set 1)", GAME_SUPPORTS_SAVE,     layout_ampoker2 )
12081219GAMEL( 1990, ampkr2b2, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "American Poker II (bootleg, set 2)", GAME_SUPPORTS_SAVE,     layout_ampoker2 )
12091220GAMEL( 1994, ampkr2b3, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "American Poker II (bootleg, set 3)", GAME_SUPPORTS_SAVE,     layout_ampoker2 )
1221GAMEL( 1994, ampkr2b4, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "American Poker II (bootleg, set 4)", GAME_SUPPORTS_SAVE,     layout_ampoker2 )
12101222GAMEL( 1994, ampkr228, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg?",   "American Poker II (iamp2 v28)",      GAME_SUPPORTS_SAVE,     layout_ampoker2 )
12111223GAMEL( 1995, ampkr95,  ampoker2, ampoker2, ampkr95,  0,    ROT0, "Bootleg",    "American Poker 95",                  GAME_SUPPORTS_SAVE,     layout_ampoker2 )
12121224GAMEL( 1990, pkrdewin, ampoker2, ampoker2, ampoker2, 0,    ROT0, "Bootleg",    "Poker De Win",                       GAME_SUPPORTS_SAVE,     layout_ampoker2 )
src/mame/drivers/namcos21.c
r4425r4426
19971997   ROM_LOAD16_BYTE( "de1-pt2-u.5n",  0x80000, 0x20000, CRC(10e83d81) SHA1(446fedc3b1e258a39fb9467e5327c9f9a9f1ac3f) )
19981998   ROM_LOAD16_BYTE( "de1-pt2-l.7n",  0x80001, 0x20000, CRC(3339a976) SHA1(c9eb9c04f7b3f2a85e5ab64ffb2fe4fcfb6c494b) )
19991999
2000   ROM_REGION( 0x100000, "c140", 0 ) /* sound samples */
2001   ROM_LOAD("de1-voi0.12b",  0x00000, 0x40000, CRC(fc44adbd) SHA1(4268bb1f025e47a94212351d1c1cfd0e5029221f) )
2002   ROM_LOAD("de1-voi1.12c",  0x40000, 0x40000, CRC(a71dc55a) SHA1(5e746184db9144ab4e3a97b20195b92b0f56c8cc) )
2003   ROM_LOAD("de1-voi2.12d",  0x80000, 0x40000, CRC(4d32879a) SHA1(eae65f4b98cee9efe4e5dad7298c3717cfb1e6bf) )
2004   ROM_LOAD("de1-voi3.12e",  0xc0000, 0x40000, CRC(e4832d18) SHA1(0460c79d3942aab89a765b0bd8bbddaf19a6d682) )
2000   ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */
2001   ROM_LOAD("de1-voi0.12b",  0x040000, 0x40000, CRC(fc44adbd) SHA1(4268bb1f025e47a94212351d1c1cfd0e5029221f) )
2002   ROM_LOAD("de1-voi1.12c",  0x0c0000, 0x40000, CRC(a71dc55a) SHA1(5e746184db9144ab4e3a97b20195b92b0f56c8cc) )
2003   ROM_LOAD("de1-voi2.12d",  0x140000, 0x40000, CRC(4d32879a) SHA1(eae65f4b98cee9efe4e5dad7298c3717cfb1e6bf) )
2004   ROM_LOAD("de1-voi3.12e",  0x1c0000, 0x40000, CRC(e4832d18) SHA1(0460c79d3942aab89a765b0bd8bbddaf19a6d682) )
20052005ROM_END
20062006
20072007ROM_START( starblad )
r4425r4426
21462146   ROM_LOAD16_BYTE( "sg1-gd1-l.3s",  0x80001, 0x40000, CRC(a6c4da96) SHA1(377dbf21a1bede01de16708c96c112abab4417ce) )
21472147
21482148   ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */
2149   ROM_LOAD("sg-voi-1.11c",0x000000,0x80000,CRC(7dcccb31) SHA1(4441b37691434b13eae5dee2d04dc12a56b04d2a) )
2150   ROM_LOAD("sg-voi-3.11e",0x080000,0x80000,CRC(a198141c) SHA1(b4ca352e6aedd9d7a7e5e39e840f1d3a7145900e) )
2149   ROM_LOAD("sg-voi-1.11c",0x080000,0x80000,CRC(7dcccb31) SHA1(4441b37691434b13eae5dee2d04dc12a56b04d2a) )
2150   ROM_LOAD("sg-voi-3.11e",0x180000,0x80000,CRC(a198141c) SHA1(b4ca352e6aedd9d7a7e5e39e840f1d3a7145900e) )
21512151ROM_END
21522152
21532153ROM_START( winrun91 )
r4425r4426
21952195   ROM_LOAD16_BYTE( "gd1l.3s",  0x80001, 0x40000, CRC(64df59a2) SHA1(1e9d0945b94780bb0be16803e767466d2cda07e8) )
21962196
21972197   ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */
2198   ROM_LOAD("avo1.11c",0x000000,0x80000,CRC(9fb33af3) SHA1(666630a8e5766ca4c3275961963c3e713dfdda2d) )
2199   ROM_LOAD("avo3.11e",0x080000,0x80000,CRC(76e22f92) SHA1(0e1b8d35a5b9c20cc3192d935f0c9da1e69679d2) )
2198   ROM_LOAD("avo1.11c",0x080000,0x80000,CRC(9fb33af3) SHA1(666630a8e5766ca4c3275961963c3e713dfdda2d) )
2199   ROM_LOAD("avo3.11e",0x180000,0x80000,CRC(76e22f92) SHA1(0e1b8d35a5b9c20cc3192d935f0c9da1e69679d2) )
22002200ROM_END
22012201
22022202static void namcos21_init( running_machine *machine, int game_type )
r4425r4426
25952595GAME( 1993, cybsledj, cybsled, poly_c140_typeA,   cybsled,      cybsled,  ROT0,    "Namco", "Cyber Sled (Japan)",            GAME_IMPERFECT_GRAPHICS )
25962596/* 1992, ShimDrive */
25972597GAME( 1991, solvalou, 0,       poly_c140_typeA,   s21default,   solvalou, ROT0,    "Namco", "Solvalou (Japan)",              GAME_IMPERFECT_GRAPHICS )
2598GAME( 1991, starblad, 0,       poly_c140_typeA,   s21default,   starblad, ROT0,    "Namco", "Starblade",                     GAME_IMPERFECT_GRAPHICS )
2599GAME( 1991, winrun91, 0,       winrun_c140_typeB, winrun,       winrun,   ROT0,    "Namco", "Winning Run 91",                GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2600GAME( 1989, winrun,   0,       winrun_c140_typeB, winrun,       winrun,   ROT0,    "Namco", "Winning Run Suzuka Grand Prix", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2598GAME( 1991, starblad, 0,       poly_c140_typeA,   s21default,   starblad, ROT0,    "Namco", "Starblade (Japan)",                     GAME_IMPERFECT_GRAPHICS )
2599GAME( 1991, winrun91, 0,       winrun_c140_typeB, winrun,       winrun,   ROT0,    "Namco", "Winning Run 91 (Japan)",                GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2600GAME( 1989, winrun,   0,       winrun_c140_typeB, winrun,       winrun,   ROT0,    "Namco", "Winning Run Suzuka Grand Prix (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
26012601/* 1988, Winning Run */
2602GAME( 1991, driveyes, 0,       driveyes,          winrun,       driveyes, ROT0,    "Namco", "Driver's Eyes",                 GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2602GAME( 1991, driveyes, 0,       driveyes,          winrun,       driveyes, ROT0,    "Namco", "Driver's Eyes (US)",                 GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/pgm.c
r4425r4426
607607static ADDRESS_MAP_START( olds_mem, ADDRESS_SPACE_PROGRAM, 16)
608608   AM_RANGE(0x000000, 0x01ffff) AM_ROM   /* BIOS ROM */
609609   AM_RANGE(0x100000, 0x3fffff) AM_ROMBANK(1) /* Game ROM */
610   AM_RANGE(0x400000, 0x4fffff) AM_RAM AM_BASE(&olds_sharedprotram) // Shared with protection device
610   AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_BASE(&olds_sharedprotram) // Shared with protection device
611611
612612   AM_RANGE(0x700006, 0x700007) AM_WRITENOP // Watchdog?
613613
r4425r4426
13991399   pgm_kov2_decrypt(machine);
14001400}
14011401
1402static DRIVER_INIT( kov2p )
1403{
1404// this hacks the identification of the kov2 rom to return the string required for kov2p
1405// this is _NOT_ appropriate for use in MAME, the internal rom should be dumped.
1406#if 0
1407   UINT8 *mem8 = (UINT8 *)memory_region(machine, "user1");
1408   pgm_basic_init(machine);
1409   pgm_kov2p_decrypt(machine);
1410
1411   mem8[0xDE] = 0xC0;
1412   mem8[0xDF] = 0x46;
1413   mem8[0x4ED8] = 0xA8;// B0
1414   mem8[0x4EDC] = 0x9C;// A4
1415   mem8[0x4EE0] = 0x5C;// 64
1416   mem8[0x4EE4] = 0x94;// 9C
1417   mem8[0x4EE8] = 0xE8;// F0
1418   mem8[0x4EEC] = 0x6C;// 74
1419   mem8[0x4EF0] = 0xD4;// DC
1420   mem8[0x4EF4] = 0x50;// 58
1421   mem8[0x4EF8] = 0x80;// 88
1422   mem8[0x4EFC] = 0x9C;// A4
1423   mem8[0x4F00] = 0x28;// 30
1424   mem8[0x4F04] = 0x30;// 38
1425   mem8[0x4F08] = 0x34;// 3C
1426   mem8[0x4F0C] = 0x1C;// 24
1427   mem8[0x1FFFFC] = 0x33;
1428   mem8[0x1FFFFD] = 0x99;
1429#endif
1430}
1431
14021432static DRIVER_INIT( martmast )
14031433{
14041434   pgm_basic_init(machine);
r4425r4426
17881818//  mem16[0x100072/2]=0x5D78;
17891819}
17901820
1821static UINT16 olds_bs,olds_cmd3;
1822
1823static UINT32 olds_prot_addr( UINT16 addr)
1824{
1825   UINT32 mode = addr&0xff;
1826   UINT32 offset = addr >> 8;
1827   UINT32 realaddr;
1828
1829   switch(mode)
1830   {
1831      case 0:
1832      case 5:
1833      case 0xA:
1834         realaddr= 0x402A00+(offset<<2);
1835         break;
1836
1837      case 2:
1838      case 8:
1839         realaddr= 0x402E00+(offset<<2);
1840         break;
1841
1842      case 1:
1843         realaddr= 0x40307E;
1844         break;
1845
1846      case 3:
1847         realaddr= 0x403090;
1848         break;
1849
1850      case 4:
1851         realaddr= 0x40309A;
1852         break;
1853
1854      case 6:
1855         realaddr= 0x4030A4;
1856         break;
1857
1858      case 7:
1859         realaddr= 0x403000;
1860         break;
1861
1862      case 9:
1863         realaddr= 0x40306E;
1864         break;
1865
1866      default:
1867         realaddr= 0;
1868   }
1869   return realaddr;
1870}
1871
1872static UINT32 olds_read_reg( UINT16 addr)
1873{
1874   UINT32 protaddr = (olds_prot_addr(addr)-0x400000)/2;
1875   return olds_sharedprotram[protaddr]<<16|olds_sharedprotram[protaddr+1];
1876}
1877
1878static void olds_write_reg( UINT16 addr, UINT32 val)
1879{
1880   olds_sharedprotram[(olds_prot_addr(addr)-0x400000)/2]=val>>16;
1881   olds_sharedprotram[(olds_prot_addr(addr)-0x400000)/2+1]=val&0xffff;
1882}
1883
17911884static MACHINE_RESET( olds )
17921885{
17931886   UINT16 *mem16 = (UINT16 *)memory_region(machine, "user2");
1794//  UINT16 *mem16_a = (UINT16 *)memory_region(machine, "maincpu");
17951887   int i;
17961888
17971889   MACHINE_RESET_CALL(pgm);
17981890
17991891   /* populate shared protection ram with data read from pcb .. */
18001892
1801//  for(i=0;i<0x100000/2;i++)
1802//  {
1803//      mem16_a[i+(0x300000/2)] = mem16[i];
1804//  }
1893   for(i=0;i<0x40000/2;i++)
1894   {
1895      olds_sharedprotram[i] = mem16[i];
1896   }
18051897
1806   for(i=0;i<0x100000/2;i++)
1898   //ROM:004008B4                 .word 0xFBA5
1899   for(i=0;i<0x20000/2;i++)
18071900   {
1808      olds_sharedprotram[i] = mem16[(0x100000/2)+i];
1809
1901      if(olds_sharedprotram[i]==(0xffff-i))
1902         olds_sharedprotram[i]=0x4e75;
18101903   }
18111904}
18121905
1813
1814static UINT16 olds_bs,olds_cmd3;
1815
1816
1817//UINT16 olds_r16(UINT32 addr)
18181906static READ16_HANDLER( olds_r16 )
18191907{
1820//  int offset = addr&0xf;
18211908   UINT16 res ;
18221909   res = 0;
18231910
r4425r4426
18401927   return res;
18411928}
18421929
1843//void olds_w16(UINT32 addr,UINT16 data)
18441930static WRITE16_HANDLER( olds_w16 )
18451931{
1846//  int offset=addr&0xf;
1847
18481932   if(offset==0)
18491933      kb_cmd=data;
18501934   else //offset==2
r4425r4426
18671951      }
18681952      else if(kb_cmd==3)
18691953      {
1870         //UINT16 cmd=fast_r16(0x403026);
1871         UINT16 cmd = 0;
1872         if(cmd==0x12)   //memcpy
1954         UINT16 cmd=olds_sharedprotram[0x3026/2];
1955         switch(cmd)
18731956         {
1874         //  UINT16 src=fast_r16(0x40306A);
1875         //  UINT32 dst=0x400000+(fast_r16(0x403084)<<1);
1876         //  UINT16 size=fast_r16(0x4030A2);
1877         //  UINT16 mode=fast_r16(0x40303E)&0xf;
1878            //int a=1;
1957            case 0x11:
1958            case 0x12:
1959                  break;
1960            case 0x64:
1961               {
1962                  UINT16 cmd0 = olds_sharedprotram[0x3082/2];
1963                  UINT16 val0 = olds_sharedprotram[0x3050/2];   //CMD_FORMAT
1964                  {
1965                     if((cmd0&0xff)==0x2)
1966                        olds_write_reg(val0,olds_read_reg(val0)+0x10000);
1967                  }
1968                  break;
1969               }
1970
1971            default:
1972                  break;
18791973         }
1880         //else
1881         //  int a=1;
18821974         olds_cmd3=((data>>4)+1)&0x3;
18831975      }
18841976      else if(kb_cmd==4)
r4425r4426
18881980   }
18891981}
18901982
1983static READ16_HANDLER( olds_prot_swap_r16 )
1984{
18911985
1986   if(cpu_get_pc(space->cpu)<0x100000)      //bios
1987      return pgm_mainram[0x178F4/2];
1988   else                  //game
1989      return pgm_mainram[0x178D8/2];
18921990
1991}
18931992
18941993static DRIVER_INIT( olds )
18951994{
1896//  UINT16 *mem16 = (UINT16 *)memory_region(machine, "maincpu");
1897
18981995   pgm_basic_init(machine);
18991996
19001997   memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xdcb400, 0xdcb403, 0, 0, olds_r16, olds_w16);
1901
1998   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8178f4, 0x8178f5, 0, 0, olds_prot_swap_r16);
19021999}
19032000
19042001/*** Rom Loading *************************************************************/
r4425r4426
31473244
31483245   ROM_REGION( 0x010000, "user1", ROMREGION_ERASEFF ) /* ASIC25? Protection Data */
31493246   /* missing from this set .. */
3150   ROM_LOAD( "protection_data.u6", 0x000000, 0x010000, NO_DUMP )
31513247
3152   ROM_REGION( 0x200000, "user2", ROMREGION_ERASEFF ) /* its a dump of the shared protection rom/ram from pcb. */
3248   ROM_REGION( 0x40000, "user2", ROMREGION_ERASEFF ) /* its a dump of the shared protection rom/ram from pcb. */
31533249   // used to simulate encrypted DMA protection device for now ..
3154   ROM_LOAD16_WORD_SWAP( "ram_dump", 0x000000, 0x200000, CRC(e7b26aea) SHA1(17d101f760d790619ce4858984787b494bdbbc8a) )
3250   ROM_LOAD16_WORD_SWAP( "ram_dump", 0x000000, 0x40000, CRC(619cc52d) SHA1(f249a0b58c8790a42d042ad09eb28d8d4eeb20eb) )
31553251
3156
31573252   ROM_REGION( 0xc00000, "gfx1",  ROMREGION_DISPOSE ) /* 8x8 Text Tiles + 32x32 BG Tiles */
31583253   ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS)
31593254   ROM_LOAD( "t0500.rom",    0x400000, 0x400000, CRC(d881726c) SHA1(a82517e665996f7b7017c940f1fcf016fccb65c2) )
r4425r4426
32663361
32673362   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
32683363   /* not correct for this set, needs dumping from internal rom */
3269   ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, BAD_DUMP CRC(e0d7679f) SHA1(e1c2d127eba4ddbeb8ad173c55b90ac1467e1ca8) ) // NOT for this version, works with a patch
3364   //ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, BAD_DUMP CRC(e0d7679f) SHA1(e1c2d127eba4ddbeb8ad173c55b90ac1467e1ca8) ) // NOT for this version, works with a hack
3365   ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, NO_DUMP )
32703366
32713367   ROM_REGION32_LE( 0x400000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */
32723368   ROM_LOAD( "v200-16.rom", 0x000000, 0x200000,  CRC(16a0c11f) SHA1(ce449cef76ebd5657d49b57951e2eb0f132e203e) )
r4425r4426
32943390   ROM_LOAD( "m1200.rom",    0x800000, 0x800000, CRC(b0d88720) SHA1(44ab137e3f8e15b7cb5697ffbd9b1143d8210c4f) )
32953391ROM_END
32963392
3393
3394ROM_START( kov2p205 )
3395   ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */
3396   ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )  // (BIOS)
3397   ROM_LOAD16_WORD_SWAP( "u8-27322.rom",    0x100000, 0x400000, CRC(3a2cc0de) SHA1(d7511478b34bfb03b2fb5b8268b60502d05b9414) )
3398
3399   /* CPU2 = Z80, romless, code uploaded by 68k */
3400
3401   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
3402   /* not correct for this set, needs dumping from internal rom */
3403   //ROM_LOAD( "kov2p.asic", 0x000000, 0x04000, BAD_DUMP CRC(e0d7679f) SHA1(e1c2d127eba4ddbeb8ad173c55b90ac1467e1ca8) ) // NOT for this version, works with a hack
3404   ROM_LOAD( "kov2p205.asic", 0x000000, 0x04000, NO_DUMP )
3405
3406
3407   ROM_REGION32_LE( 0x400000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */
3408   ROM_LOAD( "v200-16.rom", 0x000000, 0x200000,  CRC(16a0c11f) SHA1(ce449cef76ebd5657d49b57951e2eb0f132e203e) )
3409
3410   ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */
3411   ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS)
3412   ROM_LOAD( "t1200.rom",    0x400000, 0x800000, CRC(d7e26609) SHA1(bdad810f82fcf1d50a8791bdc495374ec5a309c6) )
3413
3414   ROM_REGION( 0xc00000/5*8, "gfx2", ROMREGION_DISPOSE | ROMREGION_ERASEFF ) /* Region for 32x32 BG Tiles */
3415   /* 32x32 Tile Data is put here for easier Decoding */
3416
3417   ROM_REGION( 0x2800000, "gfx3", 0 ) /* Sprite Colour Data */
3418   ROM_LOAD( "a1200.rom",    0x0000000, 0x0800000, CRC(ceeb81d8) SHA1(5476729443fc1bc9593ae10fbf7cbc5d7290b017) )
3419   ROM_LOAD( "a1201.rom_p",  0x0800000, 0x0800000, CRC(21063ca7) SHA1(cf561b44902425a920d5cbea5bf65dd9530b2289) ) // either this or a1201.rom in kov2 is probably bad
3420   ROM_LOAD( "a1202.rom",    0x1000000, 0x0800000, CRC(4bb92fae) SHA1(f0b6d72ed425de1c69dc8f8d5795ea760a4a59b0) )
3421   ROM_LOAD( "a1203.rom",    0x1800000, 0x0800000, CRC(e73cb627) SHA1(4c6e48b845a5d1e8f9899010fbf273d54c2b8899) )
3422   ROM_LOAD( "a1204.rom_p",  0x2000000, 0x0200000, CRC(14b4b5bb) SHA1(d7db5740eec971f2782fb2885ee3af8f2a796550) ) // either this or a1204.rom in kov2 is probably bad
3423
3424   ROM_REGION( 0x1000000, "gfx4", 0 ) /* Sprite Masks + Colour Indexes */
3425   ROM_LOAD( "b1200.rom",   0x0000000, 0x0800000,  CRC(bed7d994) SHA1(019dfba8154256d64cd249eb0fa4c451edce34b8) )
3426   ROM_LOAD( "b1201.rom",   0x0800000, 0x0800000,  CRC(f251eb57) SHA1(56a5fc14ab7822f83379cecb26638e5bb266349a) )
3427
3428   ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */
3429   ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // (BIOS)
3430   ROM_LOAD( "m1200.rom",    0x800000, 0x800000, CRC(b0d88720) SHA1(44ab137e3f8e15b7cb5697ffbd9b1143d8210c4f) )
3431ROM_END
3432
32973433/*
32983434
32993435Do Donpachi II
r4425r4426
35223658   ROM_LOAD( "m1001.u7",    0xc00000, 0x400000, CRC(662d2d48) SHA1(2fcc3099d9c04456cae3b13035fb28eaf709e7d8) )
35233659ROM_END
35243660
3661ROM_START( martmasc )
3662   ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */
3663   ROM_LOAD16_WORD_SWAP( "pgm_p01s.rom", 0x000000, 0x020000, CRC(e42b166e) SHA1(2a9df9ec746b14b74fae48b1a438da14973702ea) )  // (BIOS)
3664   ROM_LOAD16_WORD_SWAP( "v104_32m.u9",    0x100000, 0x400000, CRC(cfd9dff4) SHA1(328eaf6ac49a73265ee4e0f992b1b1312f49877b) )
3665
3666   /* CPU2 = Z80, romless, code uploaded by 68k */
3667
3668   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
3669   ROM_LOAD( "martial_masters_v101_cn.asic", 0x000000, 0x04000, BAD_DUMP CRC(b3e25b7d) SHA1(6147d7ee2e11636521df1bb96ed5da8ad21b2a57) ) // not verified, could be bad
3670
3671   ROM_REGION32_LE( 0x400000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */
3672   ROM_LOAD( "v102_16m.u10", 0x000000, 0x200000,  CRC(18b745e6) SHA1(7bcb58dd3a2d6072f492cf0dd7181cb061c1f49d) )
3673
3674   ROM_REGION( 0xc00000, "gfx1", 0 ) /* 8x8 Text Tiles + 32x32 BG Tiles */
3675   ROM_LOAD( "pgm_t01s.rom", 0x000000, 0x200000, CRC(1a7123a0) SHA1(cc567f577bfbf45427b54d6695b11b74f2578af3) ) // (BIOS)
3676   ROM_LOAD( "t1000.u3",    0x400000, 0x800000, CRC(bbf879b5) SHA1(bd9a6aea34ad4001e89e62ff4b7a2292eb833c00) )
3677
3678   ROM_REGION( 0xc00000/5*8, "gfx2", ROMREGION_DISPOSE | ROMREGION_ERASEFF ) /* Region for 32x32 BG Tiles */
3679   /* 32x32 Tile Data is put here for easier Decoding */
3680
3681   ROM_REGION( 0x2800000, "gfx3", 0 ) /* Sprite Colour Data */
3682   ROM_LOAD( "a1000.u3",    0x0000000, 0x0800000, CRC(43577ac8) SHA1(6eea8b455985d5bac74dcc9943cdc3c0902de6cc) )
3683   ROM_LOAD( "a1001.u4",    0x0800000, 0x0800000, CRC(fe7a476f) SHA1(a8c7f1f0dd3e53141aed6d927eb88a3ceebb81e4) )
3684   ROM_LOAD( "a1002.u6",    0x1000000, 0x0800000, CRC(62e33d38) SHA1(96163d583e25073594f8413ce263e56b66bd69a1) )
3685   ROM_LOAD( "a1003.u8",    0x1800000, 0x0800000, CRC(b2c4945a) SHA1(7b18287a2db56db3651cfd4deb607af53522fefd) )
3686   ROM_LOAD( "a1004.u10",   0x2000000, 0x0400000, CRC(9fd3f5fd) SHA1(057531f91062be51589c6cf8f4170089b9be6380) )
3687
3688   ROM_REGION( 0x1000000, "gfx4", 0 ) /* Sprite Masks + Colour Indexes */
3689   ROM_LOAD( "b1000.u9",    0x0000000, 0x0800000,  CRC(c5961f6f) SHA1(a68060b10edbd084cbde79d2ed1c9084777beb10) )
3690   ROM_LOAD( "b1001.u11",   0x0800000, 0x0800000,  CRC(0b7e1c06) SHA1(545e15e0087f8621d593fecd8b4013f7ca311686) )
3691
3692   ROM_REGION( 0x1000000, "ics", 0 ) /* Samples - (8 bit mono 11025Hz) - */
3693   ROM_LOAD( "pgm_m01s.rom", 0x000000, 0x200000, CRC(45ae7159) SHA1(d3ed3ff3464557fd0df6b069b2e431528b0ebfa8) ) // (BIOS)
3694   ROM_LOAD( "m1000.u5",    0x400000, 0x800000, CRC(ed407ae8) SHA1(a6e9c09b39c13e8fb7fbc89fa9f823cbeb66e901) )
3695   ROM_LOAD( "m1001.u7",    0xc00000, 0x400000, CRC(662d2d48) SHA1(2fcc3099d9c04456cae3b13035fb28eaf709e7d8) )
3696ROM_END
3697
35253698/*
35263699
35273700Demon Front
r4425r4426
36843857GAME( 1997, drgw2c,   drgw2,      drgw2, pgm,      drgw2c,     ROT0,   "IGS", "Zhong Guo Long II (ver. 100C, China)", GAME_IMPERFECT_SOUND )
36853858GAME( 1999, kov,      pgm,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour / Sangoku Senki (ver. 117)", GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */
36863859GAME( 1999, kov115,   kov,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour / Sangoku Senki (ver. 115)", GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */
3687GAME( 1999, kovj,     kov,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour / Sangoku Senki (ver. 100, Japanese Board)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */
3860GAME( 1999, kovj,     kov,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour / Sangoku Senki (ver. 100, Japanese Board)", GAME_IMPERFECT_SOUND ) /* ver # provided by protection? */
3861GAME( 1999, kovplus,  kov,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour Plus / Sangoku Senki Plus (ver. 119)", GAME_IMPERFECT_SOUND )
3862GAME( 1999, kovplusa, kov,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour Plus / Sangoku Senki Plus (alt ver. 119)", GAME_IMPERFECT_SOUND )
36883863GAME( 1999, photoy2k, pgm,        pgm, photoy2k,    djlzz,      ROT0,   "IGS", "Photo Y2K", GAME_IMPERFECT_SOUND ) /* region provided by protection device */
3689GAME( 1999, raf102j,  photoy2k,   pgm, photoy2k,    djlzz,      ROT0,   "IGS", "Real and Fake / Photo Y2K (ver. 102, Japan Board)", GAME_IMPERFECT_SOUND ) /* region provided by protection device */
3864GAME( 1999, raf102j,  photoy2k,   pgm, photoy2k,    djlzz,      ROT0,   "IGS", "Real and Fake / Photo Y2K (ver. 102, Japanese Board)", GAME_IMPERFECT_SOUND ) /* region provided by protection device */
3865GAME( 2000, kov2,     pgm,       kov2, sango,    kov2,       ROT0,   "IGS", "Knights of Valour 2 (ver. 100)", GAME_IMPERFECT_SOUND )
3866GAME( 2000, kov2106,  kov2,      kov2, sango,    kov2,       ROT0,   "IGS", "Knights of Valour 2 (ver. 106)", GAME_IMPERFECT_SOUND )
3867GAME( 2001, martmast, pgm,       kov2, sango,    martmast,   ROT0,   "IGS", "Martial Masters (ver. 102)", GAME_IMPERFECT_SOUND )
3868GAME( 2001, martmasc, martmast,  kov2, sango,    martmast,   ROT0,   "IGS", "Martial Masters (ver. 101, Chinese Board)", GAME_IMPERFECT_SOUND )
36903869
36913870/* Playable but maybe imperfect protection emulation */
36923871GAME( 1997, drgw2,    pgm,        drgw2, pgm,      drgw2,      ROT0,   "IGS", "Dragon World II (ver. 110X, Export)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
36933872GAME( 1997, drgw2j,   drgw2,      drgw2, pgm,      drgw2j,     ROT0,   "IGS", "Chuugokuryuu II (ver. 100J, Japan)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3694GAME( 1999, kovplus,  kov,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour Plus / Sangoku Senki Plus (ver. 119)", GAME_IMPERFECT_SOUND )
3695GAME( 1999, kovplusa, kov,        pgm, sango,    kov,        ROT0,   "IGS", "Knights of Valour Plus / Sangoku Senki Plus (alt ver. 119)", GAME_IMPERFECT_SOUND )
3696GAME( 1998, killbldt, killbld, killbld,killbld,    killbld,    ROT0,   "IGS", "The Killing Blade (Chinese Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) // it's playable, but there are some things unclear about the protection
3697GAME( 1999, puzlstar, pgm,        pgm, sango,    pstar,      ROT0,   "IGS", "Puzzle Star", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )  // not playable past first few rounds
3873GAME( 1998, killbldt, killbld, killbld,killbld,    killbld,    ROT0,   "IGS", "The Killing Blade (Chinese Board)", GAME_IMPERFECT_SOUND ) // it's playable, but there are some things unclear about the protection
3874GAME( 1999, puzlstar, pgm,        pgm, sango,    pstar,      ROT0,   "IGS", "Puzzle Star", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )  // not playable past first few rounds
3875GAME( 1999, olds100a, olds,       olds, olds,    olds,   ROT0,   "IGS", "Oriental Legend Super / Special (alt ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING  ) // grashes on some bosses, high score table etc.
36983876
36993877
37003878/* not working */
37013879GAME( 1998, drgw3,    pgm,        pgm, sango,    dw3,        ROT0,   "IGS", "Dragon World 3", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
37023880GAME( 1998, drgw3k,   drgw3,      pgm, sango,    dw3,        ROT0,   "IGS", "Dragon World 3 (Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3703GAME( 1999, kovsh,    kov,      kovsh, sango,    kovsh,      ROT0,   "IGS", "Knights of Valour Superheroes / Sangoku Senki Superheroes (ver. 322)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3704
3881GAME( 1999, kovsh,    kov,      kovsh, sango,    kovsh,      ROT0,   "IGS", "Knights of Valour Superheroes / Sangoku Senki Superheroes (ver. 104)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
37053882GAME( 1998, killbld,  pgm,     killbld,killbld,  killbld,    ROT0,   "IGS", "The Killing Blade", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3706GAME( 1999, olds,     pgm,        olds, olds,    olds,   ROT0,   "IGS", "Oriental Legend Super / Special (Korea 101)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3707GAME( 1999, olds100,  olds,       olds, olds,    olds,   ROT0,   "IGS", "Oriental Legend Super / Special (100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3708GAME( 1999, olds100a, olds,       olds, olds,    olds,   ROT0,   "IGS", "Oriental Legend Super / Special (100 alt)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3709GAME( 2000, kov2,     pgm,       kov2, sango,    kov2,       ROT0,   "IGS", "Knights of Valour 2", GAME_IMPERFECT_SOUND )
3710GAME( 2000, kov2106,  kov2,      kov2, sango,    kov2,       ROT0,   "IGS", "Knights of Valour 2 (106)", GAME_IMPERFECT_SOUND )
3711GAME( 2000, kov2p,    kov2,      kov2, sango,    kov2,       ROT0,   "IGS", "Knights of Valour 2 Plus - Nine Dragons", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3883GAME( 1999, olds,     pgm,        olds, olds,    olds,   ROT0,   "IGS", "Oriental Legend Super / Special (ver. 101, Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3884GAME( 1999, olds100,  olds,       olds, olds,    olds,   ROT0,   "IGS", "Oriental Legend Super / Special (ver. 100)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
37123885GAME( 2001, ddp2,     pgm,        pgm, ddp2,     ddp2,       ROT270, "IGS", "Bee Storm - DoDonPachi II", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
37133886GAME( 2001, puzzli2,  pgm,        pgm, sango,    puzzli2,    ROT0,   "IGS", "Puzzli 2 Super", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3714GAME( 2001, martmast, pgm,       kov2, sango,    martmast,        ROT0,   "IGS", "Martial Masters", GAME_IMPERFECT_SOUND )
37153887GAME( 2001, theglad,  pgm,        pgm, sango,    pgm,        ROT0,   "IGS", "The Gladiator", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3716GAME( 2002, dmnfrnt,  pgm,        pgm, sango,    pgm,        ROT0,   "IGS", "Demon Front (V102)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3717GAME( 2002, dmnfrnta, dmnfrnt,    pgm, sango,    pgm,        ROT0,   "IGS", "Demon Front (V105)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3888GAME( 2002, dmnfrnt,  pgm,        pgm, sango,    pgm,        ROT0,   "IGS", "Demon Front (ver. 102)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3889GAME( 2002, dmnfrnta, dmnfrnt,    pgm, sango,    pgm,        ROT0,   "IGS", "Demon Front (ver. 105)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
3890GAME( 2000, kov2p,    kov2,      kov2, sango,    kov2p,      ROT0,   "IGS", "Knights of Valour 2 Plus - Nine Dragons (ver. M204XX)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_SOUND ) // works if you hack the kov2 ARM rom
3891GAME( 2000, kov2p205, kov2,      kov2, sango,    kov2p,      ROT0,   "IGS", "Knights of Valour 2 Plus - Nine Dragons (ver. M205XX)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_SOUND ) // works if you hack the kov2 ARM rom
src/mame/drivers/kinst.c
r4425r4426
691691   ROM_LOAD16_BYTE( "u36-l1", 0xe00000, 0x80000, CRC(0577bb60) SHA1(cc78070cc41701e9a91fde5cfbdc7e1e83354854) )
692692
693693   DISK_REGION( "ide" )
694   DISK_IMAGE( "kinst", 0, MD5(6d4c2f152c9a18ab3a9b05b8804306a8) SHA1(a37a2c5e52ea936a715210d237874dd573bb002f) )
694   DISK_IMAGE( "kinst", 0, SHA1(81d833236e994528d1482979261401b198d1ca53) )
695695ROM_END
696696
697697
r4425r4426
710710   ROM_LOAD16_BYTE( "u36-l1", 0xe00000, 0x80000, CRC(0577bb60) SHA1(cc78070cc41701e9a91fde5cfbdc7e1e83354854) )
711711
712712   DISK_REGION( "ide" )
713   DISK_IMAGE( "kinst", 0, MD5(6d4c2f152c9a18ab3a9b05b8804306a8) SHA1(a37a2c5e52ea936a715210d237874dd573bb002f) )
713   DISK_IMAGE( "kinst", 0, SHA1(81d833236e994528d1482979261401b198d1ca53) )
714714ROM_END
715715
716716
r4425r4426
729729   ROM_LOAD16_BYTE( "u36-l1", 0xe00000, 0x80000, CRC(0577bb60) SHA1(cc78070cc41701e9a91fde5cfbdc7e1e83354854) )
730730
731731   DISK_REGION( "ide" )
732   DISK_IMAGE( "kinst", 0, MD5(6d4c2f152c9a18ab3a9b05b8804306a8) SHA1(a37a2c5e52ea936a715210d237874dd573bb002f) )
732   DISK_IMAGE( "kinst", 0, SHA1(81d833236e994528d1482979261401b198d1ca53) )
733733ROM_END
734734
735735
r4425r4426
748748   ROM_LOAD16_BYTE( "u36-l1", 0xe00000, 0x80000, CRC(0577bb60) SHA1(cc78070cc41701e9a91fde5cfbdc7e1e83354854) )
749749
750750   DISK_REGION( "ide" )
751   DISK_IMAGE( "kinst", 0, MD5(6d4c2f152c9a18ab3a9b05b8804306a8) SHA1(a37a2c5e52ea936a715210d237874dd573bb002f) )
751   DISK_IMAGE( "kinst", 0, SHA1(81d833236e994528d1482979261401b198d1ca53) )
752752ROM_END
753753
754754
r4425r4426
767767   ROM_LOAD16_BYTE( "ki2_l1.u36", 0xe00000, 0x80000, CRC(8920acbb) SHA1(0fca72c40067034939b984b4bf32972a5a6c26af) )
768768
769769   DISK_REGION( "ide" )
770   DISK_IMAGE( "kinst2", 0, MD5(2563b089b316f2c8636d78af661ac656) SHA1(ab0242233d2eaf9d907abe246a54e09a8a2561a5) )
770   DISK_IMAGE( "kinst2", 0, SHA1(e7c9291b4648eae0012ea0cc230731ed4987d1d5) )
771771ROM_END
772772
773773
r4425r4426
786786   ROM_LOAD16_BYTE( "ki2_l1.u36", 0xe00000, 0x80000, CRC(8920acbb) SHA1(0fca72c40067034939b984b4bf32972a5a6c26af) )
787787
788788   DISK_REGION( "ide" )
789   DISK_IMAGE( "kinst2", 0, MD5(2563b089b316f2c8636d78af661ac656) SHA1(ab0242233d2eaf9d907abe246a54e09a8a2561a5) )
789   DISK_IMAGE( "kinst2", 0, SHA1(e7c9291b4648eae0012ea0cc230731ed4987d1d5) )
790790ROM_END
791791
792792
r4425r4426
805805   ROM_LOAD16_BYTE( "ki2_l1.u36", 0xe00000, 0x80000, CRC(8920acbb) SHA1(0fca72c40067034939b984b4bf32972a5a6c26af) )
806806
807807   DISK_REGION( "ide" )
808   DISK_IMAGE( "kinst2", 0, MD5(2563b089b316f2c8636d78af661ac656) SHA1(ab0242233d2eaf9d907abe246a54e09a8a2561a5) )
808   DISK_IMAGE( "kinst2", 0, SHA1(e7c9291b4648eae0012ea0cc230731ed4987d1d5) )
809809ROM_END
810810
811811
r4425r4426
824824   ROM_LOAD16_BYTE( "ki2_l1.u36", 0xe00000, 0x80000, CRC(8920acbb) SHA1(0fca72c40067034939b984b4bf32972a5a6c26af) )
825825
826826   DISK_REGION( "ide" )
827   DISK_IMAGE( "kinst2", 0, MD5(2563b089b316f2c8636d78af661ac656) SHA1(ab0242233d2eaf9d907abe246a54e09a8a2561a5) )
827   DISK_IMAGE( "kinst2", 0, SHA1(e7c9291b4648eae0012ea0cc230731ed4987d1d5) )
828828ROM_END
829829
830830
r4425r4426
843843   ROM_LOAD16_BYTE( "ki2_l1.u36", 0xe00000, 0x80000, CRC(8920acbb) SHA1(0fca72c40067034939b984b4bf32972a5a6c26af) )
844844
845845   DISK_REGION( "ide" )
846   DISK_IMAGE( "kinst2", 0, MD5(2563b089b316f2c8636d78af661ac656) SHA1(ab0242233d2eaf9d907abe246a54e09a8a2561a5) )
846   DISK_IMAGE( "kinst2", 0, SHA1(e7c9291b4648eae0012ea0cc230731ed4987d1d5) )
847847ROM_END
848848
849849
r4425r4426
862862   ROM_LOAD16_BYTE( "ki2_l1.u36", 0xe00000, 0x80000, CRC(8920acbb) SHA1(0fca72c40067034939b984b4bf32972a5a6c26af) )
863863
864864   DISK_REGION( "ide" )
865   DISK_IMAGE( "kinst2", 0, MD5(2563b089b316f2c8636d78af661ac656) SHA1(ab0242233d2eaf9d907abe246a54e09a8a2561a5) )
865   DISK_IMAGE( "kinst2", 0, SHA1(e7c9291b4648eae0012ea0cc230731ed4987d1d5) )
866866ROM_END
867867
868868
src/mame/drivers/suprgolf.c
r4425r4426
1919#include "sound/2203intf.h"
2020
2121static tilemap *suprgolf_tilemap;
22
22static UINT8 *suprgolf_bg_vram;
23static UINT8 *suprgolf_bg_pen;
2324static int suprgolf_rom_bank;
25static UINT8 suprgolf_bg_bank;
26static UINT8 suprgolf_vreg;
2427
2528static TILE_GET_INFO( get_tile_info )
2629{
2730   int code = videoram[tile_index*2]+256*(videoram[tile_index*2+1]);
31   int color = videoram[tile_index*2+0x800] & 0x7f;
32
2833   SET_TILE_INFO(
2934      0,
3035      code,
31      0,
36      color,
3237      0);
3338}
3439
35#ifdef UNUSED_FUNCTION
3640static READ8_HANDLER( rom_bank_select_r )
3741{
3842    return suprgolf_rom_bank;
3943}
40#endif
4144
4245static WRITE8_HANDLER( rom_bank_select_w )
4346{
r4425r4426
4548
4649   suprgolf_rom_bank = data;
4750
51   //popmessage("%08x %02x",((data & 0x3f) * 0x4000),data);
52
4853   mame_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,cpu_get_previouspc(space->cpu));
4954   memory_set_bankptr(space->machine, 2, region_base + (data&0x3f ) * 0x4000);
5055}
r4425r4426
5358{
5459   UINT8 *region_base = memory_region(space->machine, "user2");
5560   mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,cpu_get_previouspc(space->cpu));
56   memory_set_bankptr(space->machine, 1, region_base + (data&0x3f ) * 0x4000);
61//  if(data == 0) data = 1; //test hack
62   memory_set_bankptr(space->machine, 1, region_base + (data&0x0f ) * 0x4000);
5763}
5864
5965static MACHINE_RESET( suprgolf )
r4425r4426
6470static VIDEO_START( suprgolf )
6571{
6672   suprgolf_tilemap = tilemap_create( machine, get_tile_info,tilemap_scan_rows,8,8,32,32 );
73   paletteram = auto_malloc(0x1000);
74   suprgolf_bg_vram = auto_malloc(0x2000*0x20);
75   suprgolf_bg_pen = auto_malloc(0x2000*0x20);
76
77   tilemap_set_transparent_pen(suprgolf_tilemap,15);
6778}
6879
80/* TODO: fix this.*/
81static void bg_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,UINT8 starting_offs)
82{
83   int x,y,trans;
84   UINT32 count;
85
86   count = starting_offs<<16;
87   trans = starting_offs;
88
89   for(y=0;y<256;y++)
90   {
91      for(x=0;x<512;x+=2)
92      {
93         UINT16 color;
94
95         color = ((suprgolf_bg_pen[count] & 0xff)<<4) | ((suprgolf_bg_vram[count] & 0xf0)>>4);
96         //color+= ((suprgolf_bg_pen[count+0x10000])<<4);
97         //if((x)<video_screen_get_visible_area(machine)->max_x && ((y)+0)<video_screen_get_visible_area(machine)->max_y)
98         if(x+1 < 256)
99         {
100            if(trans)
101            {
102               if((suprgolf_bg_vram[count] & 0xf0) != 0xf0)
103                  *BITMAP_ADDR32(bitmap, y, x+1) = machine->pens[(color & 0x7ff)];
104            }
105            else
106               *BITMAP_ADDR32(bitmap, y, x+1) = machine->pens[(color & 0x7ff)];
107         }
108
109         color = ((suprgolf_bg_pen[count] & 0xff)<<4) | (suprgolf_bg_vram[count] & 0x0f);
110         //color+= ((suprgolf_bg_pen[count+0x10000])<<4);
111
112         //if((x+1)<video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y)
113         if(x < 256)
114         {
115            if(trans)
116            {
117               if((suprgolf_bg_vram[count] & 0x0f) != 0x0f)
118                  *BITMAP_ADDR32(bitmap, y, x) = machine->pens[(color & 0x7ff)];
119            }
120            else
121               *BITMAP_ADDR32(bitmap, y, x) = machine->pens[(color & 0x7ff)];
122         }
123
124         count++;
125      }
126   }
127}
128
69129static VIDEO_UPDATE( suprgolf )
70130{
71   tilemap_mark_all_tiles_dirty(suprgolf_tilemap);
72   tilemap_draw(bitmap,cliprect,suprgolf_tilemap,TILEMAP_DRAW_OPAQUE,0);
131   bg_draw(screen->machine,bitmap,cliprect,0);
132   //bg_draw(screen->machine,bitmap,cliprect,1);
133   bg_draw(screen->machine,bitmap,cliprect,2); //this probably should be putted over the fg tilemap too.
134
135   tilemap_draw(bitmap,cliprect,suprgolf_tilemap,0,0);
73136   return 0;
74137}
75138
139static UINT8 palette_switch;
76140
77// vidram is banked?
141static READ8_HANDLER( suprgolf_videoram_r )
142{
143   if(palette_switch)
144      return paletteram[offset];
145   else
146      return videoram[offset];
147}
78148
149static WRITE8_HANDLER( suprgolf_videoram_w )
150{
151   if(palette_switch)
152   {
153      int r,g,b,datax;
154      paletteram[offset] = data;
155      offset>>=1;
156      datax=paletteram[offset*2]+256*paletteram[offset*2+1];
157
158      b=(datax & 0x8000) ? 0 : ((datax)&0x001f)>>0;
159      g=(datax & 0x8000) ? 0 : ((datax)&0x03e0)>>5;
160      r=(datax & 0x8000) ? 0 : ((datax)&0x7c00)>>10;
161
162      palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
163   }
164   else
165   {
166      videoram[offset] = data;
167      tilemap_mark_tile_dirty(suprgolf_tilemap, (offset & 0x7fe) >> 1);
168   }
169}
170
171static READ8_HANDLER( suprgolf_vregs_r )
172{
173   return suprgolf_vreg;
174}
175
176static WRITE8_HANDLER( suprgolf_vregs_w )
177{
178   //bits 0,1,2 and probably 3 controls the background vram banking
179   suprgolf_vreg = data;
180   palette_switch = (data & 0x80);
181   suprgolf_bg_bank = (data & 0x1f);
182
183   if(data & 0x20) //TODO: understand the proper condition
184      cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
185}
186
187static UINT8 pen;
188
189static READ8_HANDLER( suprgolf_bg_vram_r )
190{
191   return suprgolf_bg_vram[offset+suprgolf_bg_bank*0x2000];
192}
193
194static WRITE8_HANDLER( suprgolf_bg_vram_w )
195{
196   suprgolf_bg_vram[offset+suprgolf_bg_bank*0x2000] = data;
197   suprgolf_bg_pen[offset+suprgolf_bg_bank*0x2000] = data ? pen : 0;
198}
199
200static WRITE8_HANDLER( suprgolf_pen_w )
201{
202   pen = data;
203}
204
79205static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
80206   AM_RANGE(0x0000, 0x3fff) AM_ROM
81   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
207   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
82208   AM_RANGE(0x4000, 0x4000) AM_WRITE( rom2_bank_select_w )
83
84   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK2)
85
86   AM_RANGE(0xc000, 0xcfff) AM_RAM
87   AM_RANGE(0xd000, 0xdfff) AM_RAM
88   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&videoram)
89   AM_RANGE(0xe800, 0xefff) AM_RAM
90//  AM_RANGE(0xf000, 0xffff) AM_RAM
209   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(2)
210   AM_RANGE(0xc000, 0xdfff) AM_READWRITE( suprgolf_bg_vram_r, suprgolf_bg_vram_w ) // banked background vram
211   AM_RANGE(0xe000, 0xefff) AM_READWRITE( suprgolf_videoram_r, suprgolf_videoram_w ) AM_BASE(&videoram) //foreground vram + paletteram
212   AM_RANGE(0xf000, 0xf000) AM_WRITE( suprgolf_pen_w )
91213   AM_RANGE(0xf800, 0xffff) AM_RAM
92214ADDRESS_MAP_END
93215
94static READ8_HANDLER( suprgolf_random )
95{
96   return mame_rand(space->machine);
97}
98
99216static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
100217   ADDRESS_MAP_GLOBAL_MASK(0xff)
101218   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
102219   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
103220   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") // ??
104221   AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM")
105   AM_RANGE(0x05, 0x05) AM_READ_PORT("IN4") AM_WRITE(rom_bank_select_w)
106   AM_RANGE(0x06, 0x06) AM_READ(suprgolf_random) // game locks up or crashes? if this doesn't return right values?
222   AM_RANGE(0x05, 0x05) AM_READ(rom_bank_select_r) AM_WRITE(rom_bank_select_w)
223   AM_RANGE(0x06, 0x06) AM_READWRITE( suprgolf_vregs_r,suprgolf_vregs_w ) // game locks up or crashes? if this doesn't return right values?
107224
108225   AM_RANGE(0x08, 0x09) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
109226 ADDRESS_MAP_END
110227
111228static INPUT_PORTS_START( suprgolf )
112229   PORT_START("P1")
113   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
114   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
115   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
116   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
230   PORT_DIPNAME( 0x01, 0x01, "0" ) //USED!
231   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
232   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
233   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
234   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
235   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
236   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
237   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
239   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
240   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
241   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
117242   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)       /* D.L */
118243   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)       /* D.R */
119244   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)         /* CNT */
120245   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)         /* SEL */
121246
122247   PORT_START("P2")
123   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
248   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) //USED!
124249   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
125250   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
126251   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
r4425r4426
196321   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
197322
198323   PORT_START("DSW0")
199   PORT_DIPNAME( 0x01, 0x01, "DSW0" )
200   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
201   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
202   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
203   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
204   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
324   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) )
325   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
326   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
327   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
328   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
205329   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
206330   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
207331   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
208   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
209   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
210   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
211   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
212   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
213   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
214   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
215   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
216   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
332   PORT_DIPNAME( 0x08, 0x08, "Tutorial" )
333   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
334   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
335   PORT_DIPNAME( 0x30, 0x30, "Number of Balls" )
336   PORT_DIPSETTING(    0x00, "1" )
337   PORT_DIPSETTING(    0x10, "2" )
338   PORT_DIPSETTING(    0x30, "3" )
339   PORT_DIPSETTING(    0x20, "4" )
217340   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
218341   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
219342   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
220   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
221   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
343   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
344   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
345   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
223346
224347   PORT_START("DSW1")
225348   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
r4425r4426
278401   8,8,
279402   RGN_FRAC(1,1),
280403   4,
281 { 0, 1, 2, 3 },
282   { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4 },
283   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
284   8*8*4
404   { 0, 1, 2, 3 },
405   { 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4 },
406   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
407   8*8*4
285408};
286409
287410static GFXDECODE_START( suprgolf )
288   GFXDECODE_ENTRY( "gfx1", 0, gfxlayout,   0, 32 )
411   GFXDECODE_ENTRY( "gfx1", 0, gfxlayout,   0, 0x80 )
289412GFXDECODE_END
290413
291414static MACHINE_DRIVER_START( suprgolf )
292
293415   /* basic machine hardware */
294416   MDRV_CPU_ADD("maincpu", Z80,4000000)
295417   MDRV_CPU_PROGRAM_MAP(main_map,0)
r4425r4426
305427   MDRV_SCREEN_ADD("screen", RASTER)
306428   MDRV_SCREEN_REFRESH_RATE(60)
307429   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
308   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
430   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
309431   MDRV_SCREEN_SIZE(256, 256)
310432   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 191)
311433
312434   MDRV_GFXDECODE(suprgolf)
313   MDRV_PALETTE_LENGTH(512)
435   MDRV_PALETTE_LENGTH(0x1000)
314436
315437   /* sound hardware */
316438   MDRV_SPEAKER_STANDARD_MONO("mono")
r4425r4426
383505   ROM_LOAD( "cg12.6k",0x00000, 0x10000, CRC(5707b3d5) SHA1(9102a40fefb6426f2cd9d92d66fdc77e078e3f4c) )
384506ROM_END
385507
386GAME( 19??, suprgolf, 0, suprgolf,  suprgolf,  0, ROT0, "Nasco/Face?", "Super Crown Golf", GAME_NOT_WORKING )
508GAME( 1989?, suprgolf, 0, suprgolf,  suprgolf,  0, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_NOT_WORKING )
387509
src/mame/drivers/konamigq.c
r4425r4426
516516   ROM_LOAD( "420b03.27p",   0x0000000, 0x080000, CRC(aab391b1) SHA1(bf9dc7c0c8168c22a4be266fe6a66d3738df916b) )
517517
518518   DISK_REGION( "disk" )
519   DISK_IMAGE( "420uaa04", 0, MD5(179464886f58a2e14b284e3813227a86) SHA1(18fe867c44982bacf0d3ff8453487cd06425a6b7) )
519   DISK_IMAGE( "420uaa04", 0, SHA1(67cb1418fc0de2a89fc61847dc9efb9f1bebb347) )
520520ROM_END
521521
522522GAME( 1995, cryptklr, 0, konamigq, konamigq, konamigq, ROT0, "Konami", "Crypt Killer (GQ420 UAA)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/cps3.c
r4425r4426
25832583   ROM_LOAD( "sfiii_usa.29f400.u2", 0x000000, 0x080000, CRC(fb172a8e) SHA1(48ebf59910f246835f7dc0c588da30f7a908072f) )
25842584
25852585   DISK_REGION( "cdrom" )
2586   DISK_IMAGE_READONLY( "sf3000", 0, MD5(cdc5c5423bd8c053de7cdd927dc60da7) SHA1(cc72c9eb2096f4d51f2cf6df18f29fd79d05067c) )
2586   DISK_IMAGE_READONLY( "sf3000", 0, SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
25872587ROM_END
25882588
25892589ROM_START( sfiiij )
r4425r4426
25912591   ROM_LOAD( "sfiii_japan.29f400.u2", 0x000000, 0x080000, CRC(74205250) SHA1(c3e83ace7121d32da729162662ec6b5285a31211) )
25922592
25932593   DISK_REGION( "cdrom" )
2594   DISK_IMAGE_READONLY( "sf3000", 0, MD5(cdc5c5423bd8c053de7cdd927dc60da7) SHA1(cc72c9eb2096f4d51f2cf6df18f29fd79d05067c) )
2594   DISK_IMAGE_READONLY( "sf3000", 0, SHA1(606e62cc5f46275e366e7dbb412dbaeb7e54cd0c) )
25952595ROM_END
25962596
25972597ROM_START( sfiii2 )
r4425r4426
25992599   ROM_LOAD( "sfiii2_usa.29f400.u2", 0x000000, 0x080000, CRC(75dd72e0) SHA1(5a12d6ea6734df5de00ecee6f9ef470749d2f242) )
26002600
26012601   DISK_REGION( "cdrom" )
2602   DISK_IMAGE_READONLY( "3ga000", 0, MD5(941c7e8d0838db9880ea7bf169ad310d) SHA1(76e9fdef020c4b85a10aa8828a63e67c7dca22bd) )
2602   DISK_IMAGE_READONLY( "3ga000", 0, SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
26032603ROM_END
26042604
26052605ROM_START( sfiii2j )
r4425r4426
26072607   ROM_LOAD( "sfiii2_japan.29f400.u2", 0x000000, 0x080000, CRC(faea0a3e) SHA1(a03cd63bcf52e4d57f7a598c8bc8e243694624ec) )
26082608
26092609   DISK_REGION( "cdrom" )
2610   DISK_IMAGE_READONLY( "3ga000", 0, MD5(941c7e8d0838db9880ea7bf169ad310d) SHA1(76e9fdef020c4b85a10aa8828a63e67c7dca22bd) )
2610   DISK_IMAGE_READONLY( "3ga000", 0, SHA1(4e162885b0b3265a56e0265037bcf247e820f027) )
26112611ROM_END
26122612
26132613ROM_START( sfiii3 )
r4425r4426
26152615   ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
26162616
26172617   DISK_REGION( "cdrom" )
2618   DISK_IMAGE_READONLY( "cap-33s-2", 0, SHA1(24e78b8c66fb1573ffd642ee51607f3b53ed40b7) MD5(cf63f3dbcc2653b95709133fe79c7225) )
2618   DISK_IMAGE_READONLY( "cap-33s-2", 0, SHA1(41b0e246db91cbfc3f8f0f62d981734feb4b4ab5) )
26192619ROM_END
26202620
26212621ROM_START( sfiii3a )
r4425r4426
26232623   ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
26242624
26252625   DISK_REGION( "cdrom" )
2626   DISK_IMAGE_READONLY( "33s000", 0, MD5(f159ad85cc94ced3ddb9ef5e92173a9f) SHA1(47c7ae0f2dc47c7d28bdf66d378a3aaba4c99c75) )
2626   DISK_IMAGE_READONLY( "33s000", 0, SHA1(2f4a9006a31903114f9f9dc09465ae253e565c51) )
26272627ROM_END
26282628
26292629ROM_START( redearth )
r4425r4426
26312631   ROM_LOAD( "warzard_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
26322632
26332633   DISK_REGION( "cdrom" )
2634   DISK_IMAGE_READONLY( "wzd000", 0, MD5(028ff12a4ce34118dd0091e87c8cdd08) SHA1(6d4e6b7fff4ff3f04e349479fa5a1cbe63e673b8) )
2634   DISK_IMAGE_READONLY( "wzd000", 0, SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
26352635ROM_END
26362636
26372637ROM_START( warzard )
r4425r4426
26392639   ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
26402640
26412641   DISK_REGION( "cdrom" )
2642   DISK_IMAGE_READONLY( "wzd000", 0, MD5(028ff12a4ce34118dd0091e87c8cdd08) SHA1(6d4e6b7fff4ff3f04e349479fa5a1cbe63e673b8) )
2642   DISK_IMAGE_READONLY( "wzd000", 0, SHA1(e5676752b08283dc4a98c3d7b759e8aa6dcd0679) )
26432643ROM_END
26442644
26452645ROM_START( jojo )
r4425r4426
26472647   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
26482648
26492649   DISK_REGION( "cdrom" )
2650   DISK_IMAGE_READONLY( "cap-jjk-160", 0, SHA1(74fb14d838d98c3e10baa08e6f7b2464d840dcf0) MD5(93cc16f11a88c8f5268cb96baebc0a13) )
2650   DISK_IMAGE_READONLY( "cap-jjk-160", 0, SHA1(0f5c09171409213e191a607ee89ca3a91fe9c96a) )
26512651ROM_END
26522652
26532653ROM_START( jojoa )
r4425r4426
26552655   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
26562656
26572657   DISK_REGION( "cdrom" )
2658   DISK_IMAGE_READONLY( "jjk000", 0, MD5(05440ecf90e836207a27a99c817a3328) SHA1(d5a11315ac21e573ffe78e63602ec2cb420f361f) )
2658   DISK_IMAGE_READONLY( "jjk000", 0, SHA1(09869f6d8c032b527e02d815749dc8fab1289e86) )
26592659ROM_END
26602660
26612661ROM_START( jojoba )
r4425r4426
26632663   ROM_LOAD( "jojoba_japan.29f400.u2",  0x000000, 0x080000,  CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
26642664
26652665   DISK_REGION( "cdrom" )
2666   DISK_IMAGE_READONLY( "jjm000", 0, MD5(bf6b90334bf1f6bd8dbfed737face2d6) SHA1(688520bb83ccbf4b31c3bfe26bd0cc8292a8c558) )
2666   DISK_IMAGE_READONLY( "jjm000", 0, SHA1(0678a0baeb853dcff1d230c14f0873cc9f143d7b) )
26672667ROM_END
26682668
26692669
src/mame/drivers/mlanding.c
r4425r4426
2727   8,8,
2828   RGN_FRAC(1,1),
2929   4,
30   { 0, 8, 16, 24 },
30   { 16, 24, 0, 8 },
3131   { 7, 6, 5, 4, 3, 2, 1, 0 },
3232   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
3333   32*8
src/mame/drivers/seattle.c
r4425r4426
25462546   ROM_LOAD( "wg3dh_12.u32", 0x000000, 0x80000, CRC(15e4cea2) SHA1(72c0db7dc53ce645ba27a5311b5ce803ad39f131) )
25472547
25482548   DISK_REGION( "ide" )   /* Hard Drive Version 1.3 (Guts 10/15/96, Main 10/15/96) */
2549   DISK_IMAGE( "wg3dh", 0, MD5(424dbda376e8c45ec873b79194bdb924) SHA1(c12875036487a9324734012e601d1f234d2e783e) )
2549   DISK_IMAGE( "wg3dh", 0, SHA1(4fc6f25d7f043d9bcf8743aa8df1d9be3cbc375b) )
25502550
25512551   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2115 data Version L1.1 */
25522552   ROM_LOAD16_BYTE( "soundl11.u95", 0x000000, 0x8000, CRC(c589458c) SHA1(0cf970a35910a74cdcf3bd8119bfc0c693e19b00) )
r4425r4426
25582558   ROM_LOAD( "mace10ce.u32", 0x000000, 0x80000, CRC(7a50b37e) SHA1(33788835f84a9443566c80bee9f20a1691490c6d) )
25592559
25602560   DISK_REGION( "ide" )   /* Hard Drive Version 1.0B 6/10/97 (Guts 7/2/97, Main 7/2/97) */
2561   DISK_IMAGE( "mace", 0, MD5(668f6216114fe4c7c265b3d13398e71e) SHA1(6761c9a3da1f0b6b82b146ff2debd04986b8f460) )
2561   DISK_IMAGE( "mace", 0, SHA1(96ec8d3ff5dd894e21aa81403bcdbeba44bb97ea) )
25622562
25632563   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2115 data Version L1.1, Labeled as Version 1.0 */
25642564   ROM_LOAD16_BYTE( "soundl11.u95", 0x000000, 0x8000, CRC(c589458c) SHA1(0cf970a35910a74cdcf3bd8119bfc0c693e19b00) )
r4425r4426
25702570   ROM_LOAD( "maceboot.u32", 0x000000, 0x80000, CRC(effe3ebc) SHA1(7af3ca3580d6276ffa7ab8b4c57274e15ee6bcbb) )
25712571
25722572   DISK_REGION( "ide" )   /* Hard Drive Version 1.0a (Guts 6/9/97, Main 5/12/97) */
2573   DISK_IMAGE( "macea", 0, BAD_DUMP MD5(276577faa5632eb23dc5a97c11c0a1b1) SHA1(e2cce4ff2e15267b7008422252bdf62b188cf743) )
2573   DISK_IMAGE( "macea", 0, BAD_DUMP SHA1(9bd4a60627915d71932cab24f89c48ea21f4c1cb) )
25742574
25752575   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2115 data Version L1.1 */
25762576   ROM_LOAD16_BYTE( "soundl11.u95", 0x000000, 0x8000, CRC(c589458c) SHA1(0cf970a35910a74cdcf3bd8119bfc0c693e19b00) )
r4425r4426
25912591   ROM_LOAD32_WORD( "sfrush.u49",  0x800002, 0x200000, CRC(dfb0a54c) SHA1(ed34f9485f7a7e5bb73bf5c6428b27548e12db12) )
25922592
25932593   DISK_REGION( "ide" )   /* Hard Drive Version L1.06 */
2594   DISK_IMAGE( "sfrush", 0, MD5(7a77addb141fc11fd5ca63850382e0d1) SHA1(0e5805e255e91f08c9802a04b42056d61ba5eb41) )
2594   DISK_IMAGE( "sfrush", 0, SHA1(e2db0270a707fb2115207f988d5751081d6b4994) )
25952595ROM_END
25962596
25972597
r4425r4426
26092609   ROM_LOAD32_WORD( "audio.u49",  0x800002, 0x200000, CRC(e6b684d3) SHA1(1f5bab7fae974cecc8756dd23e3c7aa2cf6e7dc7) )
26102610
26112611   DISK_REGION( "ide" )   /* Hard Drive Version 1.2 */
2612   DISK_IMAGE( "sfrushrk", 0, MD5(425c83a4fd389d820aceabf2c72e6107) SHA1(75aba7be869996ff522163466c97f88f78904fe0) )
2612   DISK_IMAGE( "sfrushrk", 0, SHA1(e763f26aca67ebc17fe8b8df4fba91d492cf7837) )
26132613ROM_END
26142614
26152615
r4425r4426
26182618   ROM_LOAD( "caspd1_2.u32", 0x000000, 0x80000, CRC(0a235e4e) SHA1(b352f10fad786260b58bd344b5002b6ea7aaf76d) )
26192619
26202620   DISK_REGION( "ide" )   /* Release version 2.1a (4/17/98) (Guts 1.25 4/17/98, Main 4/17/98) */
2621   DISK_IMAGE( "calspeed", 0, MD5(1b79ff4ecaa52693bdb19c720332dd59) SHA1(94af22d5797dbbaf6178fba1194257a603fda9ee) )
2621   DISK_IMAGE( "calspeed", 0, SHA1(08d411c591d4b8bbdd6437ea80d01c4cec8516f8) )
26222622
26232623   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2115 data Version 1.02 */
26242624   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
r4425r4426
26302630   ROM_LOAD( "caspd1_2.u32", 0x000000, 0x80000, CRC(0a235e4e) SHA1(b352f10fad786260b58bd344b5002b6ea7aaf76d) )
26312631
26322632   DISK_REGION( "ide" )   /* Release version 1.0r7a (3/4/98) (Guts 3/3/98, Main 1/19/98) */
2633   DISK_IMAGE( "calspeda", 0, MD5(dc8c919af86a1ab88a0b05ea2b6c74b3) SHA1(e6cbc8290af2df9704838a925cb43b6972b80d95) )
2633   DISK_IMAGE( "calspeda", 0, SHA1(6b1c3a7530195ef7309b06a651b01c8b3ece92c6) )
26342634
26352635   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2115 data Version 1.02 */
26362636   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
r4425r4426
26422642   ROM_LOAD( "vtrxboot.bin", 0x000000, 0x80000, CRC(ee487a6c) SHA1(fb9efda85047cf615f24f7276a9af9fd542f3354) )
26432643
26442644   DISK_REGION( "ide" )
2645   DISK_IMAGE( "vaportrx", 0, MD5(eb8dcf83fe8b7122481d24ad8fbc8a9a) SHA1(f6ddb8eb66d979d49799e39fa4d749636693a1b0) )
2645   DISK_IMAGE( "vaportrx", 0, SHA1(fe53ca7643d2ed2745086abb7f2243c69678cab1) )
26462646
26472647   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2115 data Version 1.02 */
26482648   ROM_LOAD16_BYTE( "vaportrx.snd", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
r4425r4426
26542654   ROM_LOAD( "vtrxboot.bin", 0x000000, 0x80000, CRC(ee487a6c) SHA1(fb9efda85047cf615f24f7276a9af9fd542f3354) )
26552655
26562656   DISK_REGION( "ide" ) /* Guts: Apr 10 1998 11:03:14  Main: Apr 10 1998 11:27:44 */
2657   DISK_IMAGE( "vaportrp", 0, MD5(fac4d37e049bc649696f4834044860e6) SHA1(75e2eaf81c69d2a337736dbead804ac339fd0675) )
2657   DISK_IMAGE( "vaportrp", 0, SHA1(6c86637c442ebd6994eee8c0ae0dce343c35dbe9) )
26582658
26592659   ROM_REGION16_LE( 0x10000, "dcs", 0 )   /* ADSP-2115 data Version 1.02 */
26602660   ROM_LOAD16_BYTE( "vaportrx.snd", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
r4425r4426
26692669   ROM_LOAD( "biofreak.u32", 0x000000, 0x80000, CRC(cefa00bb) SHA1(7e171610ede1e8a448fb8d175f9cb9e7d549de28) )
26702670
26712671   DISK_REGION( "ide" ) /* Build Date 12/11/97 */
2672   DISK_IMAGE( "biofreak", 0, MD5(f4663a3fd0ceed436756710b97d283e4) SHA1(88b87cb651b97eac117c9342127938e30dc8c138) )
2672   DISK_IMAGE( "biofreak", 0, SHA1(711241642f92ded8eaf20c418ea748989183fe10) )
26732673ROM_END
26742674
26752675
r4425r4426
26812681   ROM_LOAD( "blitz1_2.u32", 0x000000, 0x80000, CRC(38dbecf5) SHA1(7dd5a5b3baf83a7f8f877ff4cd3f5e8b5201b36f) )
26822682
26832683   DISK_REGION( "ide" )   /* Hard Drive Version 1.21 */
2684   DISK_IMAGE( "blitz", 0, MD5(9cec59456c4d239ba05c7802082489e4) SHA1(0f001488b3709d40cee5e278603df2bbae1116b8) )
2684   DISK_IMAGE( "blitz", 0, SHA1(9131c7888e89b3c172780156ed3fe1fe46f78b0a) )
26852685ROM_END
26862686
26872687
r4425r4426
26932693   ROM_LOAD( "blitz1_1.u32", 0x000000, 0x80000, CRC(8163ce02) SHA1(89b432d8879052f6c5534ee49599f667f50a010f) )
26942694
26952695   DISK_REGION( "ide" )   /* Hard Drive Version 1.21 */
2696   DISK_IMAGE( "blitz", 0, MD5(9cec59456c4d239ba05c7802082489e4) SHA1(0f001488b3709d40cee5e278603df2bbae1116b8) )
2696   DISK_IMAGE( "blitz", 0, SHA1(9131c7888e89b3c172780156ed3fe1fe46f78b0a) )
26972697ROM_END
26982698
26992699
r4425r4426
27052705   ROM_LOAD( "bltz9910.u32", 0x000000, 0x80000, CRC(777119b2) SHA1(40d255181c2f3a787919c339e83593fd506779a5) )
27062706
27072707   DISK_REGION( "ide" )   /* Hard Drive Version 1.30 */
2708   DISK_IMAGE( "blitz99", 0, MD5(4bb6caf8f985e90d99989eede5504188) SHA1(4675751875943b756c8db6997fd288938a7999bb) )
2708   DISK_IMAGE( "blitz99", 0, SHA1(19877e26ffce81dd525031e9e2b4f83ff982e2d9) )
27092709ROM_END
27102710
27112711
r4425r4426
27172717   ROM_LOAD( "bltz2k14.u32", 0x000000, 0x80000, CRC(ac4f0051) SHA1(b8125c17370db7bfd9b783230b4ef3d5b22a2025) )
27182718
27192719   DISK_REGION( "ide" )   /* Hard Drive Version 1.5 */
2720   DISK_IMAGE( "blitz2k", 0, MD5(7778a82f35c05ed797b315439843246c) SHA1(153a7df368833cd5f5a52c3fe17045c5549a0c17) )
2720   DISK_IMAGE( "blitz2k", 0, SHA1(e89b7fbd4b4a9854d47ae97493e0afffbd1f69e7) )
27212721ROM_END
27222722
27232723
r4425r4426
27292729   ROM_LOAD( "carnevil1_9.u32", 0x000000, 0x80000, CRC(82c07f2e) SHA1(fa51c58022ce251c53bad12fc6ffadb35adb8162) )
27302730
27312731   DISK_REGION( "ide" )   /* Hard Drive v1.0.3  Diagnostics v3.4 / Feb 1 1999 16:00:07 */
2732   DISK_IMAGE( "carnevil", 0, MD5(cba5ecd6c59b6fb56f574558f4f2b509) SHA1(ba32b7ef9721d730ce58bd753d47fb947b6ae9b6) )
2732   DISK_IMAGE( "carnevil", 0, SHA1(5cffb0de63ad36eb01c5951bab04d3f8a9e23e16) )
27332733ROM_END
27342734
27352735
r4425r4426
27412741   ROM_LOAD( "carnevil1_9.u32", 0x000000, 0x80000, CRC(82c07f2e) SHA1(fa51c58022ce251c53bad12fc6ffadb35adb8162) )
27422742
27432743   DISK_REGION( "ide" )   /* Hard Drive v1.0.1  Diagnostics v3.3 / Oct 20 1998 11:44:41 */
2744   DISK_IMAGE( "carnevi1", 0, BAD_DUMP MD5(6eafae86091c0a915cf8cfdc3d73adc2) SHA1(5e6524d4b97de141c38e301a17e8af15661cb5d6) )
2744   DISK_IMAGE( "carnevi1", 0, BAD_DUMP SHA1(94532727512280930a100fe473bf3a938fe2d44f) )
27452745ROM_END
27462746
27472747
r4425r4426
27532753   ROM_LOAD( "hyprdrve.u32", 0x000000, 0x80000, CRC(3e18cb80) SHA1(b18cc4253090ee1d65d72a7ec0c426ed08c4f238) )
27542754
27552755   DISK_REGION( "ide" )   /* Version 1.40  Oct 23 1998  15:16:00 */
2756   DISK_IMAGE( "hyprdriv", 0, MD5(480c43735b0b83eb10c0223283d4226c) SHA1(2e42fecbb8722c736cccdca7ed3b21fbc75e345a) )
2756   DISK_IMAGE( "hyprdriv", 0, SHA1(8cfa343797575b32f46cc24150024be48963a03e) )
27572757ROM_END
27582758
27592759
src/mame/drivers/cischeat.c
r4425r4426
931931   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM                  )   // ROM
932932   AM_RANGE(0x0e0000, 0x0fffff) AM_READ(SMH_RAM                  )   // RAM
933933   AM_RANGE(0x060004, 0x060005) AM_READ(soundlatch_word_r            )   // From Main CPU    (f1gpstar: 60000)
934   AM_RANGE(0x080002, 0x080003) AM_DEVREAD8("ym", ym2151_r, 0x00ff )
934   AM_RANGE(0x080000, 0x080003) AM_DEVREAD8("ym", ym2151_r, 0x00ff )
935935   AM_RANGE(0x0a0000, 0x0a0001) AM_DEVREAD8("oki1", okim6295_r, 0x00ff      )
936936   AM_RANGE(0x0c0000, 0x0c0001) AM_DEVREAD8("oki2", okim6295_r, 0x00ff      )
937937ADDRESS_MAP_END
src/mame/drivers/namcos22.c
r4425r4426
52645264GAME( 1996, victlapw, 0,        namcos22,  victlap,  victlap,  ROT0, "Namco", "Ace Driver: Victory Lap (Rev. ADV2, World)", GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52655265
52665266/* Super System22 games */
5267GAME( 1995, airco22b, 0,        namcos22s, airco22,  airco22,  ROT0, "Namco", "Air Combat 22 (Rev. ACS1 Ver.B)"           , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) /* fails DSP RAM test */
5267GAME( 1995, airco22b, 0,        namcos22s, airco22,  airco22,  ROT0, "Namco", "Air Combat 22 (Rev. ACS1 Ver.B, Japan)"           , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) /* fails DSP RAM test */
52685268GAME( 1995, alpinerd, 0,        namcos22s, alpiner,  alpiner,  ROT0, "Namco", "Alpine Racer (Rev. AR2 Ver.D)"             , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52695269GAME( 1995, alpinerc, alpinerd, namcos22s, alpiner,  alpiner,  ROT0, "Namco", "Alpine Racer (Rev. AR2 Ver.C)"             , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52705270GAME( 1995, cybrcycc, 0,        namcos22s, cybrcycc, cybrcyc,  ROT0, "Namco", "Cyber Cycles (Rev. CB2 Ver.C)"             , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/midvunit.c
r4425r4426
15051505   ROM_LOAD( "u41.rom", 0x000000, 0x20000, CRC(398c54cc) SHA1(6c4b5d6ec5c844dcbf181f9d86a9196a088ed2db) )
15061506
15071507   DISK_REGION( "ide" )
1508   DISK_IMAGE( "wargods", 0, MD5(9a41ae319a67fc626377b6d9ea34c860) SHA1(4b02f8f33027a0e7b2c750c10da1fe22222b3e1e) )
1508   DISK_IMAGE( "wargods", 0, SHA1(141063f95867fdcc4b15c844e510696604a70c6a) )
15091509ROM_END
15101510
15111511
src/mame/drivers/firebeat.c
r4425r4426
23022302   ROM_LOAD("gq977-ja", 0x00, 0xc0, BAD_DUMP CRC(55b5abdb) SHA1(d8da5bac005235480a1815bd0a79c3e8a63ebad1))
23032303
23042304   DISK_REGION( "scsi0" )
2305   DISK_IMAGE_READONLY( "977jaa01", 0, MD5(9abc766b72dab28db920f3d264fc2254) SHA1(05bce40c3b241cd1f634d6688ec179a86f57da9f) )
2305   DISK_IMAGE_READONLY( "977jaa01", 0, SHA1(59c03d8eb366167feef741d42d9d8b54bfeb3c1e) )
23062306
23072307   // TODO: the audio CD is not dumped
23082308ROM_END
r4425r4426
23172317   ROM_LOAD("gq974-ja", 0x00, 0xc0, BAD_DUMP CRC(4578f29b) SHA1(faaeaf6357c1e86e898e7017566cfd2fc7ee3d6f))
23182318
23192319   DISK_REGION( "scsi0" )
2320   DISK_IMAGE_READONLY( "974jac01", 0, SHA1(18179bf23519d5b0c82c72e8f47dfaa4d2c4a3e2) MD5(cb68cf69e55aa33429f149f474e2c96e) )
2320   DISK_IMAGE_READONLY( "974jac01", 0, SHA1(c6145d7090e44c87f71ba626620d2ae2596a75ca) )
23212321
23222322   DISK_REGION( "scsi1" )
2323   DISK_IMAGE_READONLY( "974jaa02", 1, SHA1(8d78a91d98967a232c4b98628e2db25df0a7f8bd) MD5(5cb0100791294559fedccc2a9a46fd86) )
2323   DISK_IMAGE_READONLY( "974jaa02", 1, SHA1(3b9946083239eb5687f66a49df24568bffa4fbbd) )
23242324ROM_END
23252325
23262326ROM_START( kbm2nd )
r4425r4426
23332333   ROM_LOAD("gca01-ja", 0x00, 0xc0, BAD_DUMP CRC(2bda339d) SHA1(031cb3f44e7a89cd62a9ba948f3d19d53a325abd))
23342334
23352335   DISK_REGION( "scsi0" )
2336   DISK_IMAGE_READONLY( "a01jaa01", 0, SHA1(87c21dc6b9fe8d9f696985cfd9dc14a23f0932fe) MD5(0eff2ca8ebef1fd8815d1d7cb0c2383a) )
2336   DISK_IMAGE_READONLY( "a01jaa01", 0, SHA1(37bc3879719b3d3c6bc8a5691abd7aa4aec87d45) )
23372337
23382338   DISK_REGION( "scsi1" )
2339   DISK_IMAGE_READONLY( "a01jaa02", 1, SHA1(fabfcc02f97c867c361df7b9539e6b77f369b73f) MD5(25679474e987d0dd83a0db2bad24bc14) )
2339   DISK_IMAGE_READONLY( "a01jaa02", 1, SHA1(a3fdeee0f85a7a9718c0fb1cc642ac22d3eff8db) )
23402340ROM_END
23412341
23422342ROM_START( kbm3rd )
r4425r4426
23492349   ROM_LOAD("gca12-ja", 0x00, 0xc0, BAD_DUMP CRC(cf01dc15) SHA1(da8d208233487ebe65a0a9826fc72f1f459baa26))
23502350
23512351   DISK_REGION( "scsi0" )
2352   DISK_IMAGE_READONLY( "a12jaa01", 0, MD5(130a11bd229d9c30bd6d9ffeaf94926e) SHA1(6b595b17260b0ca17d04d7911616d5ff88158f26) )
2352   DISK_IMAGE_READONLY( "a12jaa01", 0, SHA1(10f2284248e51b1adf0fde173df72ad97fe0e5c8) )
23532353
23542354   DISK_REGION( "scsi1" )
2355   DISK_IMAGE_READONLY( "a12jaa02", 1, MD5(10ff654cf3d9b833ecbe72a395e7bb60) SHA1(4adddc8e028111169889bfb99007238da5f4d330) )
2355   DISK_IMAGE_READONLY( "a12jaa02", 1, SHA1(1256ce9d71350d355a256f83c7b319f0e6e84525) )
23562356ROM_END
23572357
23582358ROM_START( popn7 )
r4425r4426
23682368   ROM_LOAD16_WORD_SWAP("a02jaa04.3q", 0x00000, 0x80000, CRC(8c6000dd) SHA1(94ab2a66879839411eac6c673b25143d15836683))
23692369
23702370   DISK_REGION( "scsi0" )
2371   DISK_IMAGE_READONLY( "b00jab01", 0, SHA1(7462586f67b5c3b015ac581ad0afc089fcd6f537) MD5(af9a249b23783d53ff27ea7dc7e6735c) )
2371   DISK_IMAGE_READONLY( "b00jab01", 0, SHA1(604fd460befcb5c53ae230155b83dec3a0b668d7) )
23722372
23732373   DISK_REGION( "scsi1" )
2374   DISK_IMAGE_READONLY( "b00jaa02", 1, SHA1(fea9439f14304d865830fb34f8781346d95a1df7) MD5(cf4c4f7c2321fcca6d86e8c144261752) )
2374   DISK_IMAGE_READONLY( "b00jaa02", 1, SHA1(9e226f6b377ea72514d58dd350578b7dad12a70a) )
23752375ROM_END
23762376
23772377ROM_START( ppd )
r4425r4426
23842384   ROM_LOAD("gq977-ko", 0x00, 0xc0, BAD_DUMP CRC(ee743323) SHA1(2042e45879795557ad3cc21b37962f6bf54da60d))
23852385
23862386   DISK_REGION( "scsi0" )
2387   DISK_IMAGE_READONLY( "977kaa01", 0, SHA1(7069c1e42bf994ccdfcf6ff0dda9c5de94f1cc65) MD5(f499cb458d823200dc96fe9cef5c08c8) )
2387   DISK_IMAGE_READONLY( "977kaa01", 0, SHA1(7af9f4949ffa10ea5fc18b6c88c2abc710df3cf9) )
23882388
23892389   DISK_REGION( "scsi1" )
2390   DISK_IMAGE_READONLY( "977kaa02", 1, SHA1(45d5cda77f789351260bbd6f9c47a5fa93998133) MD5(b58978a81931058fe28825b6147b1bed) )
2390   DISK_IMAGE_READONLY( "977kaa02", 1, SHA1(cfca3cbc41c6203c3f3b482a6be5f63d33a8a966) )
23912391ROM_END
23922392
23932393ROM_START( ppp11 )
r4425r4426
24002400   ROM_LOAD("gq977-ja", 0x00, 0xc0, BAD_DUMP CRC(55b5abdb) SHA1(d8da5bac005235480a1815bd0a79c3e8a63ebad1))
24012401
24022402   DISK_REGION( "scsi0" )
2403   DISK_IMAGE_READONLY( "gc977jaa01", 0, SHA1(aa43526971dad6502e4b9583d8f5c18d93ced820) MD5(161ab0096d8def5ef133eec872afc645) )
2403   DISK_IMAGE_READONLY( "gc977jaa01", 0, SHA1(6b93dd38029ea68f9572126e48d618edce68fbce) )
24042404
24052405   DISK_REGION( "scsi1" )
2406   DISK_IMAGE_READONLY( "gc977jaa02", 1, SHA1(4a0edf424e091c33db91b00edf7c7246754cc8bb) MD5(9cb7cb79d2f0a47e994cfb91847ca190) )
2406   DISK_IMAGE_READONLY( "gc977jaa02", 1, SHA1(b853a6f4edcaceb609fe2a3d6a18d4ac62bd3822) )
24072407ROM_END
24082408
24092409/*****************************************************************************/
src/mame/drivers/cubocd32.c
r4425r4426
292292   CD32_BIOS
293293
294294   DISK_REGION( "cdrom" )
295   DISK_IMAGE_READONLY( "cndypuzl", 0, SHA1(21093753a1875dc4fb97f23232ed3d8776b48c06) MD5(dcb6cdd7d81d5468c1290a3baf4265cb) )
295   DISK_IMAGE_READONLY( "cndypuzl", 0, SHA1(5f41ed3521b3e05d233ac1245b78cb0b118b2b90) )
296296ROM_END
297297
298298ROM_START( haremchl )
299299   CD32_BIOS
300300
301301   DISK_REGION( "cdrom" )
302   DISK_IMAGE_READONLY( "haremchl", 0, SHA1(4d5df2b64b376e8d0574100110f3471d3190765c) MD5(00adbd944c05747e9445446306f904be) )
302   DISK_IMAGE_READONLY( "haremchl", 0, SHA1(abbab347c0d7c5eef0465d0eee770754a452e874) )
303303ROM_END
304304
305305ROM_START( lsrquiz )
306306   CD32_BIOS
307307
308308   DISK_REGION( "cdrom" )
309   DISK_IMAGE_READONLY( "lsrquiz", 0, SHA1(4250c94ab77504104005229b28f24cfabe7c9e48) MD5(12a94f573fe5d218db510166b86fdda5) )
309   DISK_IMAGE_READONLY( "lsrquiz", 0, SHA1(41fb6cd0c9d36bd77e9c3db69d36801edc791e96) )
310310ROM_END
311311
312312ROM_START( lsrquiz2 )
313313   CD32_BIOS
314314
315315   DISK_REGION( "cdrom" )
316   DISK_IMAGE_READONLY( "lsrquiz2", 0, SHA1(ea92df0e53bf36bb86d99ad19fca21c6129e61d7) MD5(df63c32aca815f6c97889e08c10b77bc) )
316   DISK_IMAGE_READONLY( "lsrquiz2", 0, SHA1(78e261df1c548fa492e6cf37a9469640bb8816bf) )
317317ROM_END
318318
319319ROM_START( mgprem11 )
320320   CD32_BIOS
321321
322322   DISK_REGION( "cdrom" )
323   DISK_IMAGE_READONLY( "mgprem11", 0, SHA1(a8a32d10148ba968b57b8186fdf4d4cd378fb0d5) MD5(e0e4d00c6f981c19a1d20d5e7090b0db) )
323   DISK_IMAGE_READONLY( "mgprem11", 0, SHA1(7808db33d5949f6c86d12b32bc388c12377e7038) )
324324ROM_END
325325
326326ROM_START( lasstixx )
327327   CD32_BIOS
328328
329329   DISK_REGION( "cdrom" )
330   DISK_IMAGE_READONLY( "lasstixx", 0, SHA1(29c2525d43a696da54648caffac9952cec85fd37) MD5(6242dd8a3c0b15ef9eafb930b7a7e87f) )
330   DISK_IMAGE_READONLY( "lasstixx", 0, SHA1(b8f6138e1f1840c193e786c56dab03c512f3e21f) )
331331ROM_END
332332
333ROM_START( mgnumber )
334   CD32_BIOS
335
336   DISK_REGION( "cdrom" )
337   DISK_IMAGE_READONLY( "magicnumber", 0, SHA1(60e1fadc42694742d19cc0ac2b6e99e9e33faa3d) )
338ROM_END
339
333340/***************************************************************************************************/
334341
335342static DRIVER_INIT( cd32 )
r4425r4426
366373GAME( 1995, lsrquiz2, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Laser Quiz '2' Italy (v1.0)", GAME_NOT_WORKING|GAME_NO_SOUND )
367374GAME( 1996, mgprem11, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Magic Premium (v1.1)", GAME_NOT_WORKING|GAME_NO_SOUND )
368375GAME( 1995, lasstixx, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Laser Strixx", GAME_NOT_WORKING|GAME_NO_SOUND )
376GAME( 1995, mgnumber, cd32, cd32, cd32, cd32,      ROT0, "CD Express", "Magic Number", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/naomi.c
r4425r4426
664664
665665#define CPU_CLOCK (200000000)
666666static UINT32 *dc_sound_ram;
667
667static UINT64 *naomi_ram64;
668668                                             /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */
669669static const struct sh4_config sh4cpu_config = {  1,  0,  1,  0,  0,  0,  1,  1,  0, CPU_CLOCK };
670670
r4425r4426
751751   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known
752752   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
753753   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                                 // mirror of texture RAM 32 bit access
754   AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM
754   AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM AM_BASE(&naomi_ram64)
755755   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
756756   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
757757   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)                                 // another mirror of texture memory
r4425r4426
779779   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known
780780   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
781781   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                                 // mirror of texture RAM 32 bit access
782   AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM
782   AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM AM_BASE(&naomi_ram64)
783783   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
784784   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
785785   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)                                 // another mirror of texture memory
r4425r4426
896896   MDRV_SOUND_ADD("aica", AICA, 0)
897897   MDRV_SOUND_CONFIG(aica_config)
898898   MDRV_SOUND_ROUTE(0, "lspeaker", 2.0)
899   MDRV_SOUND_ROUTE(0, "rspeaker", 2.0)
899   MDRV_SOUND_ROUTE(1, "rspeaker", 2.0)
900900MACHINE_DRIVER_END
901901
902902/*
r4425r4426
27002700}
27012701#endif
27022702
2703extern void naomi_game_decrypt(UINT64 key, UINT8* region, int length);
2704
27052703/* All games have the regional titles at the start of the IC22 rom in the following order
27062704
27072705  JAPAN
r4425r4426
27642762   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
27652763
27662764   DISK_REGION( "gdrom" )
2767   DISK_IMAGE_READONLY( "gdl-0001", 0, SHA1(f525111e2762e5895fd0016a9bd41210c1125499) MD5(dcba598e76646a5a6b6e6da70552a7c5) )
2765   DISK_IMAGE_READONLY( "gdl-0001", 0, SHA1(615e19c22f32096f3aad557019a14313b60a4070) )
27682766
27692767   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
27702768   //PIC16C622A (317-5069-COM)
r4425r4426
27792777   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
27802778
27812779   DISK_REGION( "gdrom" )
2782   DISK_IMAGE_READONLY( "gdl-0002", 0, SHA1(6e7cb0df5feea41ae0b5eb72a92adcd8966595dc) MD5(6340b2527673a8cf387dcda52ecae0ca) )
2780   DISK_IMAGE_READONLY( "gdl-0002", 0, SHA1(af4669fdd7ce8e6ec4a170748d401e322a3d7ae8) )
27832781
27842782   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
27852783   //PIC16C622A (317-5072-COM)
r4425r4426
27932791   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
27942792
27952793   DISK_REGION( "gdrom" )
2796   DISK_IMAGE_READONLY( "gdl-0004", 0,  SHA1(8f8651527463aa01d40c280c0d9b03b7a0650a32) MD5(2d17eaf881c06bd95847e54878bc2ba9) )
2794   DISK_IMAGE_READONLY( "gdl-0004", 0,  SHA1(7a7fba0fbbc769c5120b08e6d692f1ac63a42225) )
27972795
27982796   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
27992797   //PIC16C622A (317-5076-JPN)
r4425r4426
28082806   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
28092807
28102808   DISK_REGION( "gdrom" )
2811   DISK_IMAGE_READONLY( "gdl-0006", 0, SHA1(b95bc07e61e57a62e276ba7fef0ae9a5c19667d9) MD5(90b1980605e7f53b38292ae32d547c8b) )
2809   DISK_IMAGE_READONLY( "gdl-0006", 0, SHA1(b28d6598711b5a9c744bbf07ad03fc60962d2e28) )
28122810
28132811   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
28142812   //PIC16C622A (317-5079-COM)
r4425r4426
28232821   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
28242822
28252823   DISK_REGION( "gdrom" )
2826   DISK_IMAGE_READONLY( "gdl-0007a", 0, SHA1(e8f199f2743a63765bcbcd533bbe5eed82f959a8) MD5(1f434e6f610987987d1d130e454f5c74) )
2824   DISK_IMAGE_READONLY( "gdl-0007a", 0, SHA1(d6da7a404e5f22df6d4bb049143391cf4505c492) )
28272825
28282826   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
28292827   //PIC16C622A (317-5078-COM)
r4425r4426
28372835   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
28382836
28392837   DISK_REGION( "gdrom" )
2840   DISK_IMAGE_READONLY( "gdl-0010", 0, SHA1(3b853be7208f523100690e12a661173d023af9c1) MD5(83f1877b979b0e5fd77ebfa1ddd9fd56) )
2838   DISK_IMAGE_READONLY( "gdl-0010", 0, SHA1(65dcc22dd9e9b70975096464ad8e31a4a73dc5fd) )
28412839
28422840   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
28432841   //PIC16C622A (317-5081-JPN)
r4425r4426
28522850   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
28532851
28542852   DISK_REGION( "gdrom" )
2855   DISK_IMAGE_READONLY( "gdl-0011", 0, SHA1(c08a19acb5641d2fd14b54cc149459c345dae013) MD5(25ab6d42bf07dd26e7033cf201322d9c) )
2853   DISK_IMAGE_READONLY( "gdl-0011", 0, SHA1(b7328eb2c588d55284bdcea0fe89bb8e629a8669) )
28562854
28572855   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
28582856   //PIC16C622A (317-5082-COM)
r4425r4426
28672865   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
28682866
28692867   DISK_REGION( "gdrom" )
2870   DISK_IMAGE_READONLY( "gdl-0014a", 0, SHA1(ee71e76f136b1a25855233a614d5c60a6a3e587d) MD5(1e5a028b0ae5cf3c5602cdc657fa2bc4) )
2868   DISK_IMAGE_READONLY( "gdl-0014a", 0, SHA1(f88d8203c8692f51c9492d5549a3ad7d9583dc6f) )
28712869
28722870   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
28732871   //PIC16C622A (317-5085-JPN)
r4425r4426
28822880   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
28832881
28842882   DISK_REGION( "gdrom" )
2885   DISK_IMAGE_READONLY( "gdl-0017", 0, SHA1(b6f3fbc81d9aea18551134b93ba3b612254bbc43) MD5(af4be08bf65cbddf2177ccf838c0df20) )
2883   DISK_IMAGE_READONLY( "gdl-0017", 0, SHA1(94a9319633388968611892e36691b45c94b4f83f) )
28862884
28872885   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
28882886   //PIC16C622A (317-5090-JPN)
r4425r4426
28962894   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
28972895
28982896   DISK_REGION( "gdrom" )
2899   DISK_IMAGE_READONLY( "gdl-0019a", 0, SHA1(50ec9bba5a7ba71f8543763cb139bab46dc487a5) MD5(b09c865e3e06e6e4467acf45b04e9caa) )
2897   DISK_IMAGE_READONLY( "gdl-0019a", 0, SHA1(d44906505ff698eda6feee6c2b9402e19f64e5d3) )
29002898
29012899   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
29022900   //PIC16C622A (317-5092-JPN)
r4425r4426
29102908   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
29112909
29122910   DISK_REGION( "gdrom" )
2913   DISK_IMAGE_READONLY( "gdl-0021", 0, SHA1(ca6a9f78b2f6b18be3fb926ebcd20c2e90923882) MD5(ba448900dd5cbc9f1f75f285f5d72231) )
2911   DISK_IMAGE_READONLY( "gdl-0021", 0, SHA1(f5036711a28a211e8d71400a8322db3172c5733f) )
29142912
29152913   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
29162914   //PIC16C622A (317-5095-JPN)
r4425r4426
29182916   ROM_LOAD("317-5095-jpn.data", 0x00, 0x50, CRC(6033ec89) SHA1(9e99a8ad43fa29296dbf2e13b3a3d4552130b4e8) )
29192917ROM_END
29202918
2919ROM_START( bdrdown )
2920   NAOMIGD_BIOS
29212921
2922   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
2923
2924   DISK_REGION( "gdrom" )
2925   DISK_IMAGE_READONLY( "gdl-0023a", 0, SHA1(caac915104d61f2122f5afe27da1ef5fa9cf9f9a) )
2926
2927   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2928   //PIC16C622A (317-5097-JPN)
2929   //(sticker 253-5509-5097J)
2930   ROM_LOAD("317-5097-jpn.data", 0x00, 0x50, CRC(e689d047) SHA1(7e3e298d9a8076af0254faeb0eb89fbfce94718d) )
2931ROM_END
2932
2933ROM_START( psyvar2 )
2934   NAOMIGD_BIOS
2935
2936   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
2937
2938   DISK_REGION( "gdrom" )
2939   DISK_IMAGE_READONLY( "gdl-0024", 0,  SHA1(d346762036fb1c40a261a434b50e63459f306f14) )
2940
2941   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2942   //PIC16C621A (317-5100-JPN)
2943   //(sticker 253-5509-5100J)
2944   ROM_LOAD("317-5100-jpn.data", 0x00, 0x50, CRC(94316f0f) SHA1(e1ec2b4225105dbaa1e59e8a05027e73f7b725a9) )
2945ROM_END
2946
2947
2948
2949ROM_START( trizeal )
2950   NAOMIGD_BIOS
2951
2952   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
2953
2954   DISK_REGION( "gdrom" )
2955   DISK_IMAGE_READONLY( "gdl-0026", 0, SHA1(e4c1e51292a7923b25bfc61d38fe386bf596002a) )
2956
2957
2958   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2959   //PIC16C621A (317-5103-JPN)
2960   //(sticker 253-5509-5103J)
2961   ROM_LOAD("317-5103-jpn.data", 0x00, 0x50,  CRC(3affbf82) SHA1(268746e86e7546f4bab54bdd268f7b58f10c1aaf) )
2962ROM_END
2963
29222964ROM_START( meltybld )
29232965   NAOMIGD_BIOS
29242966
29252967   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
29262968
29272969   DISK_REGION( "gdrom" )
2928   DISK_IMAGE_READONLY( "gdl-0028c", 0, SHA1(bbe95fd6bb39a33e979a0d9d8a63c0f2df1e9e96) MD5(b3318abacfea682605aaa24c756f225d) )
2970   DISK_IMAGE_READONLY( "gdl-0028c", 0, SHA1(66de09738551e351784cc9695a58b35fdf6b6c4b) )
29292971
29302972   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
29312973   //PIC16C622A (317-5104-JPN)
r4425r4426
29412983   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
29422984
29432985   DISK_REGION( "gdrom" )
2944   DISK_IMAGE_READONLY( "gdl-0030a", 0,  SHA1(bb9727f69f7e5452e09b151c1198d006a81aeb0e) MD5(12885cd794d8a5a839699aef4769b2dd) )
2986   DISK_IMAGE_READONLY( "gdl-0030a", 0,  SHA1(1f7ade47e37a0026451b5baf3ba746400de8d156) )
29452987
29462988   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
29472989   //PIC16C622A (317-5107-JPN)
r4425r4426
29492991   ROM_LOAD("317-5107-jpn.data", 0x00, 0x50, CRC(7b607409) SHA1(a9946a0637453e4813bef18060d4420355cff800) )
29502992ROM_END
29512993
2994ROM_START( senkoo )
2995   NAOMIGD_BIOS
29522996
2997   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
29532998
2999   DISK_REGION( "gdrom" )
3000   DISK_IMAGE_READONLY( "gdl-0030", 0,  SHA1(c7f25c05f47a490c5da9369c588b6136e93c280e) )
3001
3002   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3003   //PIC16C621A (317-5107-JPN)
3004   //(sticker 253-5509-5107J)
3005   ROM_LOAD("317-5107-jpn.data", 0x00, 0x50, CRC(7b607409) SHA1(a9946a0637453e4813bef18060d4420355cff800) )
3006ROM_END
3007
3008
29543009ROM_START( ss2005 )
29553010   NAOMIGD_BIOS
29563011
29573012   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
29583013
29593014   DISK_REGION( "gdrom" )
2960   DISK_IMAGE_READONLY( "gdl-0031a", 0, SHA1(09a47ce506b9696d7bdf4d7c95aa3182cc0d9efa) MD5(1a83930f2083397868172745d3ab2926) )
3015   DISK_IMAGE_READONLY( "gdl-0031a", 0, SHA1(6091525845fc2042ed43cae5a1b60c603e16cf97) )
29613016
29623017
29633018   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
r4425r4426
29673022ROM_END
29683023
29693024
3025ROM_START( ggxxsla )
3026   NAOMIGD_BIOS
29703027
3028   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3029
3030   DISK_REGION( "gdrom" )
3031   DISK_IMAGE_READONLY( "gdl-0033a", 0, SHA1(29de69ae97a9099b1bbe936dfa965bb4a3195f68) )
3032
3033   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3034   //PIC16C621A (317-5111-JPN)
3035   //(sticker 253-5509-5111J)
3036   ROM_LOAD("317-5111-jpn.data", 0x00, 0x50, CRC(a517c70d) SHA1(5f9798941355fb9abce511508c860653d6369e72) )
3037ROM_END
3038
3039
3040ROM_START( undefeat )
3041   NAOMIGD_BIOS
3042
3043   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3044
3045   DISK_REGION( "gdrom" )
3046   DISK_IMAGE_READONLY( "gdl-0035", 0, SHA1(91da482a6a082e48bee5b3bd20d9c92d23936965) )
3047
3048
3049   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3050   //PIC16C622A (317-5117-JPN)
3051   //(sticker 253-5509-5117J)
3052   ROM_LOAD("317-5117-jpn.data", 0x00, 0x50,  CRC(f90f6d3b) SHA1(a18f803a8e951c375a3a55e4b0e74b698ae93f92) )
3053ROM_END
3054
3055
3056
3057ROM_START( trgheart )
3058   NAOMIGD_BIOS
3059
3060   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3061
3062   DISK_REGION( "gdrom" )
3063   DISK_IMAGE_READONLY( "gdl-0036a", 0, SHA1(91f1e19136997cb1e2edfb1ad342b9427d1d3bfb) )
3064
3065
3066   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3067   //PIC16C622A (317-5121-JPN)
3068   //(sticker 253-5509-5121J)
3069   ROM_LOAD("317-5121-jpn.data", 0x00, 0x50, CRC(a417b20f) SHA1(af6ed7ebf95948bff3e8df915b229189b8de1e46) )
3070ROM_END
3071
3072ROM_START( jingystm )
3073   NAOMIGD_BIOS
3074
3075   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3076
3077   DISK_REGION( "gdrom" )
3078   DISK_IMAGE_READONLY( "gdl-0037", 0, SHA1(99ffe2987e3002b3871daf276d2be45f2e9c6e74) )
3079
3080
3081   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3082   //PIC16C622A (317-5122-JPN)
3083   //(sticker 253-5509-5122J)
3084   ROM_LOAD("317-5122-jpn.data", 0x00, 0x50, CRC(0b85b7e4) SHA1(f4e419682ddc4b98a330e5ae543f9276c9bde030) )
3085ROM_END
3086
3087
3088
3089
29713090ROM_START( sprtjam )
29723091   NAOMIGD_BIOS
29733092
29743093   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
29753094
29763095   DISK_REGION( "gdrom" )
2977   DISK_IMAGE_READONLY( "gds-0003", 0, SHA1(bfabb0da1d4f0422e0b62d8a7bb67dbcdb0d5954) MD5(3a8d3cbc4067f9b5f50be9b9abdc689b) )
3096   DISK_IMAGE_READONLY( "gds-0003", 0, SHA1(caaba214c1faca78b3370bcd4190eb2853d7f825) )
29783097
29793098   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
29803099   //PIC16C622A (317-0300-COM)
r4425r4426
29893108   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
29903109
29913110   DISK_REGION( "gdrom" )
2992   DISK_IMAGE_READONLY( "gds-0004", 0, SHA1(ec1758f5ae359bcb3c66c7ce9ebcb7443c4fd967) MD5(f5228f26e661ab0cb67414f51fe1a5bc) )
3111   DISK_IMAGE_READONLY( "gds-0004", 0, SHA1(3cce788393ed194ba9b603f9896ff893691d6b00) )
29933112
29943113   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
29953114   //PIC16C622A (317-0302-COM)
r4425r4426
30043123   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
30053124
30063125   DISK_REGION( "gdrom" )
3007   DISK_IMAGE_READONLY( "gds-0005", 0, SHA1(ca6e7ed2e161acad8600898e1b83aded9bb31d3b) MD5(a8a05ce6ab7d9ea67e015cd4853a5b80) )
3126   DISK_IMAGE_READONLY( "gds-0005", 0, SHA1(d1c3fb2350e4a89372373e7f629c42b741af29b3) )
30083127
30093128   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
30103129   //PIC16C622A (317-0303-COM)
r4425r4426
30193138   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
30203139
30213140   DISK_REGION( "gdrom" )
3022   DISK_IMAGE_READONLY( "gds-0009", 0, SHA1(d58a42586c65dcb44282bf930631ea8b663c6aa7) MD5(e553e1811f28b67fd57fa8e34d978d87) )
3141   DISK_IMAGE_READONLY( "gds-0009", 0, SHA1(d502155ddaf881c2c9505528004b9904aa32a59c) )
30233142
30243143   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
30253144   //PIC16C622A (317-0308-COM)
r4425r4426
30333152   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
30343153
30353154   DISK_REGION( "gdrom" )
3036   DISK_IMAGE_READONLY( "gds-0010", 0,  SHA1(8ce36c9710a8d55e8c19d7f218500b7074b66dec) MD5(bfb8c5ead5ac9e2a82bca9114390a99f) )
3155   DISK_IMAGE_READONLY( "gds-0010", 0,  SHA1(c3135ede3a8bdadab91aed49abacbfbde8037069) )
30373156
30383157   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
30393158   //PIC16C622A (317-0309-COM)
r4425r4426
30413160   ROM_LOAD("317-0309-com.data", 0x00, 0x50, CRC(8792c550) SHA1(e8d6d91583d1673d8d3fa9ccb0ab1097c5c5ad08) )
30423161ROM_END
30433162
3163ROM_START( vtennisg )
3164   NAOMIGD_BIOS
30443165
3166   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3167
3168   DISK_REGION( "gdrom" )
3169   DISK_IMAGE_READONLY( "gds-0011", 0,  SHA1(b778403d73c8cdd13383691c9be2094ddfc1ba84) )
3170
3171   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3172   //PIC16C621A (317-0312-COM)
3173   //(sticker 253-5508-0312)
3174   ROM_LOAD("317-0312-com.data", 0x00, 0x50, CRC(6b24f78f) SHA1(43f89815ec46cf014d941b4b9238da044b338b4c) )
3175ROM_END
3176
3177
30453178ROM_START( vathlete )
30463179   NAOMIGD_BIOS
30473180
30483181   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
30493182
30503183   DISK_REGION( "gdrom" )
3051   DISK_IMAGE_READONLY( "gds-0019", 0, SHA1(2167bbdde987c16949c5814ab7cff6eefd9f9326) MD5(67499591f2c61cda14fa581db9294315) )
3184   DISK_IMAGE_READONLY( "gds-0019", 0, SHA1(955d3c0cb991be3057138c562cff69c5ef887787) )
30523185
30533186   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
30543187   //PIC16C622A (317-0330-COM)
r4425r4426
30563189   ROM_LOAD("317-0330-com.data", 0x00, 0x50, CRC(f5e7f7d4) SHA1(3903337e82011d132993e4366475586866bd39b1) )
30573190ROM_END
30583191
3192/*
3193
3194Title   VIRTUA TENNIS 2 (POWER SMASH 2)
3195Media ID    D72C
3196Media Config    GD-ROM1/1
3197Regions J
3198Peripheral String   0000000
3199Product Number  GDS-0015A
3200Version V2.000
3201Release Date    20010827
3202Manufacturer ID
3203TOC DISC
3204Track   Start Sector    End Sector  Track Size
3205track01.bin 150 449 705600
3206track02.raw 600 2732    5016816
3207track03.bin 45150   549299  1185760800
3208
3209
3210PIC
3211
3212253-5508-0318
3213317-0318-EXP
3214*/
3215
3216ROM_START( vtennis2 )
3217   NAOMIGD_BIOS
3218
3219   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3220
3221   DISK_REGION( "gdrom" )
3222   DISK_IMAGE_READONLY( "gds-0015a", 0, SHA1(c6e9c9901bd4f075454b7f18baf08df81bc2f1ad) )
3223
3224   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3225   ROM_LOAD("317-0318-exp.data", 0x00, 0x50, CRC(7758ade6) SHA1(c62f35810bce466bfb0f55fd555066efd53e9bb6) )
3226ROM_END
3227
3228/*
3229Title   MONKEY_BALL
3230Media ID    43EB
3231Media Config    GD-ROM1/1
3232Regions J
3233Peripheral String   0000000
3234Product Number  GDS-0008
3235Version V1.008
3236Release Date    20010425
3237Manufacturer ID
3238Track   Start Sector    End Sector  Track Size
3239track01.bin 150 449 705600
3240track02.raw 600 2732    5016816
3241track03.bin 45150   549299  1185760800
3242
3243
3244PIC
3245
3246253-5508-0307
3247317-0307-COM
3248*/
3249
3250ROM_START( monkeyba )
3251   NAOMIGD_BIOS
3252
3253   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3254
3255   DISK_REGION( "gdrom" )
3256   DISK_IMAGE_READONLY( "gds-0008", 0, SHA1(2fadcd141bdbde77b2b335b270959a516af44d99) )
3257
3258   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3259   ROM_LOAD("317-0307-com.data", 0x00, 0x50, CRC(448bedc7) SHA1(092dbe5e28890d3ee40d62ca8cbf225c3ce90304) )
3260ROM_END
3261
3262ROM_START( luptype )
3263   NAOMIGD_BIOS
3264
3265   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3266
3267   DISK_REGION( "gdrom" )
3268   DISK_IMAGE_READONLY( "gds-0021a", 0,  SHA1(15c6f9434494a31693cbb8e33da36e0e8a8f7c62) )
3269
3270   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3271   //PIC16C622A (317-0332-JPN)
3272   //(sticker 253-5508-0332J)
3273   ROM_LOAD("317-0332-jpn.data", 0x00, 0x50, CRC(ab302661) SHA1(65164cf76d78b281772bfcbf5a733b0200e86e09) )
3274ROM_END
3275
3276/*
3277Title   THE_MAZE_OF_THE_KINGS
3278Media ID    E3D0
3279Media Config    GD-ROM1/1
3280Regions J
3281Peripheral String   0000000
3282Product Number  GDS-0022
3283Version V1.001
3284Release Date    20020306
3285Manufacturer ID
3286TOC DISC
3287Track   Start Sector    End Sector  Track Size
3288track01.bin 150 449 705600
3289track02.raw 600 2732    5016816
3290track03.bin 45150   549299  1185760800
3291
3292
3293PIC
3294317-0333-COM
3295253-5508-0333
3296
3297*/
3298ROM_START( mok )
3299   NAOMIGD_BIOS
3300
3301   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3302
3303   DISK_REGION( "gdrom" )
3304   DISK_IMAGE_READONLY( "gds-0022", 0, SHA1(70b41745225006e7876176cbd239edecd4c3f8b6) )
3305
3306   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3307   ROM_LOAD("317-0333-com.data", 0x00, 0x50, CRC(0c07970f) SHA1(8882dd2f8ed522790ea78eed80cfa9442f88f67b) )
3308ROM_END
3309
3310ROM_START( lupinsho )
3311   NAOMIGD_BIOS
3312
3313   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3314
3315   DISK_REGION( "gdrom" )
3316   DISK_IMAGE_READONLY( "gds-0018", 0, SHA1(0633a99a666f363ab30450a76b9753685d6b1f57) )
3317
3318   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3319   ROM_LOAD("317-0332-j.data", 0x00, 0x50, CRC(31f2b632) SHA1(bbf253bfe831308a7e7fde3a4a28e5bcd2fbb273) )
3320ROM_END
3321
3322/*
3323Title   CONFIDENTIAL MISSION
3324Media ID    FFCA
3325Media Config    GD-ROM1/1
3326Regions J
3327Peripheral String   0000000
3328Product Number  GDS-0001
3329Version V1.050
3330Release Date    20001011
3331Manufacturer ID SEGA ENTERPRISES
3332TOC DISC
3333Track   Start Sector    End Sector  Track Size
3334track01.bin 150 3788    8558928
3335track02.raw 3939    6071    5016816
3336track03.bin 45150   549299  1185760800
3337
3338
3339PIC
3340317-0298-COM
3341*/
3342
3343ROM_START( confmiss )
3344   NAOMIGD_BIOS
3345
3346   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3347
3348   DISK_REGION( "gdrom" )
3349   DISK_IMAGE_READONLY( "gds-0001", 0, SHA1(bd05f197ba8643577883dd25d9d5a74c91b27ca9) )
3350
3351   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3352   ROM_LOAD("317-0298-com.data", 0x00, 0x50, CRC(c989b336) SHA1(40075500888626cc2261133eec496b3e753631e5) )
3353ROM_END
3354
3355ROM_START( puyofev )
3356   NAOMIGD_BIOS
3357
3358   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3359
3360   DISK_REGION( "gdrom" )
3361   DISK_IMAGE_READONLY( "gds-0031", 0, SHA1(da2d421da9472b149619b6931bb2fe624be75fa2) )
3362
3363   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3364   //PIC16C621A (317-0375-COM)
3365   //(sticker 253-5508-0375)
3366   ROM_LOAD("317-0375-com.data", 0x00, 0x50, CRC(32bf1825) SHA1(42dfbc6777c154d8de6c6f7350da9ea737380220) )
3367ROM_END
3368
3369static READ64_HANDLER( naomigd_bios_idle_skip_r )
3370{
3371
3372   if (cpu_get_pc(space->cpu)==0xc04173c)
3373      cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(500));
3374      //cpu_spinuntil_int(space->cpu);
3375//  else
3376//      printf("%08x\n", cpu_get_pc(space->cpu));
3377
3378   return naomi_ram64[0x2ad238/8];
3379}
3380static DRIVER_INIT(naomigd)
3381{
3382   memory_install_read64_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc2ad238, 0xc2ad23f, 0, 0, naomigd_bios_idle_skip_r);
3383}
3384
3385static READ64_HANDLER( naomigd_ggxxsla_idle_skip_r )
3386{
3387   if (cpu_get_pc(space->cpu)==0x0c0c9adc)
3388      cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(500));
3389
3390   return naomi_ram64[0x1aae18/8];
3391}
3392
3393static DRIVER_INIT( ggxxsla )
3394{
3395   memory_install_read64_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc1aae18, 0xc1aae1f, 0, 0, naomigd_ggxxsla_idle_skip_r);
3396   DRIVER_INIT_CALL(naomigd);
3397}
3398
3399static READ64_HANDLER( naomigd_ggxx_idle_skip_r )
3400{
3401   if (cpu_get_pc(space->cpu)==0xc0b5c3c) // or 0xc0bab0c
3402      cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(500));
3403
3404   return naomi_ram64[0x1837b8/8];
3405}
3406
3407
3408static DRIVER_INIT( ggxx )
3409{
3410   memory_install_read64_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc1837b8, 0xc1837bf, 0, 0, naomigd_ggxx_idle_skip_r);
3411   DRIVER_INIT_CALL(naomigd);
3412}
3413
3414static READ64_HANDLER( naomigd_ggxxrl_idle_skip_r )
3415{
3416   if (cpu_get_pc(space->cpu)==0xc0b84bc) // or 0xc0bab0c
3417      cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(500));
3418
3419   //printf("%08x\n", cpu_get_pc(space->cpu));
3420
3421   return naomi_ram64[0x18d6c8/8];
3422}
3423
3424
3425static DRIVER_INIT( ggxxrl )
3426{
3427   memory_install_read64_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc18d6c8, 0xc18d6cf, 0, 0, naomigd_ggxxrl_idle_skip_r);
3428   DRIVER_INIT_CALL(naomigd);
3429}
3430
3431
30593432/* Naomi GD-Rom Sets */
3060GAME( 2001, naomigd,   0,        naomi,    naomi,    0,       ROT0, "Sega",            "Naomi GD-ROM Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
3433GAME( 2001, naomigd,   0,        naomi,    naomi, naomigd,       ROT0, "Sega",            "Naomi GD-ROM Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
30613434
30623435// GDL-xxxx (licensed games?)
3063GAME( 2001, gundmgd,   naomigd,  naomigd,  naomi,    0,   ROT0,   "Capcom",       "Mobile Suit Gundam: Federation VS Zeon (GDL-0001)", GAME_NO_SOUND|GAME_NOT_WORKING )
3064GAME( 2001, sfz3ugd,   naomigd,  naomigd,  naomi,    0,   ROT0,   "Capcom",       "Street Fighter Zero 3 Upper (GDL-0002)", GAME_NO_SOUND|GAME_NOT_WORKING )
3065GAME( 2001, cvsgd,     naomigd,  naomigd,  naomi,    0,   ROT0,   "Capcom",       "Capcom vs SNK Millenium Fight 2000 Pro (GDL-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3066GAME( 2001, gundmxgd,  naomigd,  naomigd,  naomi,    0,   ROT0,   "Capcom",       "Mobile Suit Gundam: Federation VS Zeon DX  (GDL-0006)", GAME_NO_SOUND|GAME_NOT_WORKING )
3067GAME( 2001, cvs2gd,    naomigd,  naomigd,  naomi,    0,     ROT0,   "Capcom",       "Capcom vs SNK 2 Millionaire Fighting 2001 (GDL-0007A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3068GAME( 2001, ikaruga,   naomigd,  naomigd,  naomi,    0,   ROT270, "Treasure",     "Ikaruga (GDL-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
3069GAME( 2002, ggxx,      naomigd,  naomigd,  naomi,    0,   ROT0,   "Arc System Works",       "Guilty Gear XX (GDL-0011)", GAME_NO_SOUND|GAME_NOT_WORKING )
3070GAME( 2002, chocomk,   naomigd,  naomigd,  naomi,    0,   ROT0,   "Ecole Software Corporation", "Musapey's Choco Marker (GDL-0014A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3071GAME( 2002, quizqgd,   naomigd,  naomigd,  naomi,    0,   ROT0,   "Amedio",       "Quiz Keitai Q mode (GDL-0017)", GAME_NO_SOUND|GAME_NOT_WORKING )
3072GAME( 2003, ggxxrl,    naomigd,  naomigd,  naomi,    0,   ROT0,   "Arc System Works",       "Guilty Gear XX #Reload (GDL-0019A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3073GAME( 2003, shikgam2,  naomigd,  naomigd,  naomi,    0,   ROT0,   "Alpha System", "Shikigami No Shiro II / The Castle of Shikigami II (GDL-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
3074GAME( 2004, meltybld,  naomigd,  naomigd,  naomi,    0,   ROT0,   "Ecole",        "Melty Blood Act Cadenza (GDL-0028C)", GAME_NO_SOUND|GAME_NOT_WORKING )
3075GAME( 2005, senko,     naomigd,  naomigd,  naomi,    0,   ROT0,   "Grev",         "Senko No Ronde (GDL-0030A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3076GAME( 2005, ss2005,    naomigd,  naomigd,  naomi,    0,   ROT0,   "Starfish",     "Super Shanghai 2005 (GDL-0031A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3436GAME( 2001, gundmgd,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",       "Mobile Suit Gundam: Federation VS Zeon (GDL-0001)", GAME_NO_SOUND|GAME_NOT_WORKING )
3437GAME( 2001, sfz3ugd,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",       "Street Fighter Zero 3 Upper (GDL-0002)", GAME_NO_SOUND|GAME_NOT_WORKING )
3438GAME( 2001, cvsgd,     naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",       "Capcom vs SNK Millenium Fight 2000 Pro (GDL-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3439GAME( 2001, gundmxgd,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",       "Mobile Suit Gundam: Federation VS Zeon DX  (GDL-0006)", GAME_NO_SOUND|GAME_NOT_WORKING )
3440GAME( 2001, cvs2gd,    naomigd,  naomigd,  naomi, naomigd,    ROT0,   "Capcom",       "Capcom vs SNK 2 Millionaire Fighting 2001 (GDL-0007A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3441GAME( 2001, ikaruga,   naomigd,  naomigd,  naomi, naomigd,   ROT270, "Treasure",     "Ikaruga (GDL-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
3442GAME( 2002, ggxx,      naomigd,  naomigd,  naomi, ggxx,      ROT0,   "Arc System Works",       "Guilty Gear XX (GDL-0011)", GAME_NO_SOUND|GAME_NOT_WORKING )
3443GAME( 2002, chocomk,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Ecole Software Corporation", "Musapey's Choco Marker (GDL-0014A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3444GAME( 2002, quizqgd,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Amedio",       "Quiz Keitai Q mode (GDL-0017)", GAME_NO_SOUND|GAME_NOT_WORKING )
3445GAME( 2003, ggxxrl,    naomigd,  naomigd,  naomi, ggxxrl,    ROT0,   "Arc System Works",       "Guilty Gear XX #Reload (GDL-0019A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3446GAME( 2003, shikgam2,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Alpha System", "Shikigami No Shiro II / The Castle of Shikigami II (GDL-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
3447GAME( 2004, bdrdown,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "G-Rev",        "Border Down (GDL-0023A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3448GAME( 2003, psyvar2,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "G-Rev",        "Psyvariar 2 - The Will To Fabricate (GDL-0024)", GAME_NO_SOUND|GAME_NOT_WORKING )
3449GAME( 2004, trizeal,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Taito",        "Trizeal (GDL-0026)", GAME_NO_SOUND|GAME_NOT_WORKING )
3450GAME( 2004, meltybld,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Ecole",        "Melty Blood Act Cadenza (GDL-0028C)", GAME_NO_SOUND|GAME_NOT_WORKING )
3451GAME( 2005, senko,     naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Grev",         "Senko No Ronde (Rev. A)(GDL-0030A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3452GAME( 2005, senkoo,    senko,    naomigd,  naomi, naomigd,   ROT0,   "Grev",         "Senko No Ronde (GDL-0030)", GAME_NO_SOUND|GAME_NOT_WORKING )
3453GAME( 2005, ss2005,    naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Starfish",     "Super Shanghai 2005 (GDL-0031A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3454GAME( 2005, ggxxsla,   naomigd,  naomigd,  naomi, ggxxsla,   ROT0,   "Arc System Works",       "Guilty Gear XX Slash (GDL-0033A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3455GAME( 2005, undefeat,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "GRev",         "Under Defeat (GDL-0035)", GAME_NO_SOUND|GAME_NOT_WORKING )
3456GAME( 2005, trgheart,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Warashi",      "Trigger Heart Exelica (GDL-0036A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3457GAME( 2005, jingystm,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Yuki Enterprise",      "Jingi Storm - The Arcade (GDL-0037)", GAME_NO_SOUND|GAME_NOT_WORKING )
30773458
3459
3460
30783461// GDS-xxxx (first party games?)
3079GAME( 2000, sprtjam,   naomigd,  naomigd,  naomi,    0,  ROT0, "Sega",          "Sports Jam (GDS-0003)", GAME_NO_SOUND|GAME_NOT_WORKING )
3080GAME( 2000, slashout,  naomigd,  naomigd,  naomi,    0,  ROT0, "Sega",          "Slashout (GDS-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3081GAME( 2001, spkrbtl,   naomigd,  naomigd,  naomi,    0,  ROT0, "Sega",          "Spikers Battle (GDS-0005)", GAME_NO_SOUND|GAME_NOT_WORKING )
3082GAME( 2001, dygolf,    naomigd,  naomigd,  naomi,    0,  ROT0, "Sega",          "Virtua Golf / Dynamic Golf (GDS-0009)", GAME_NO_SOUND|GAME_NOT_WORKING )
3083GAME( 2001, wsbbgd,    naomigd,  naomigd,  naomi,    0,  ROT0, "Sega",          "World Series Baseball / Super Major League (GDS-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
3084GAME( 2002, vathlete,  naomigd,  naomigd,  naomi,    0,  ROT0, "Sega",          "Virtua Athletics / Virtua Athlete (GDS-0019)", GAME_NO_SOUND|GAME_NOT_WORKING )
3462GAME( 2000, sprtjam,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Sports Jam (GDS-0003)", GAME_NO_SOUND|GAME_NOT_WORKING )
3463GAME( 2000, slashout,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Slashout (GDS-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3464GAME( 2001, spkrbtl,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Spikers Battle (GDS-0005)", GAME_NO_SOUND|GAME_NOT_WORKING )
3465GAME( 2001, dygolf,    naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Golf / Dynamic Golf (GDS-0009)", GAME_NO_SOUND|GAME_NOT_WORKING )
3466GAME( 2001, wsbbgd,    naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "World Series Baseball / Super Major League (GDS-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
3467GAME( 2001, vtennisg,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Tennis (GDS-0011)", GAME_NO_SOUND|GAME_NOT_WORKING )
3468GAME( 2002, vathlete,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Athletics / Virtua Athlete (GDS-0019)", GAME_NO_SOUND|GAME_NOT_WORKING )
3469GAME( 2001, vtennis2,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Tennis 2 (GDS-0015a)", GAME_NO_SOUND|GAME_NOT_WORKING ) // bad key
3470GAME( 2001, monkeyba,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Monkey Ball (GDS-0008)", GAME_NO_SOUND|GAME_NOT_WORKING )
3471GAME( 2002, luptype,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Lupin The Third - The Typing (GDS-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3472GAME( 2002, mok,       naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "The Maze of the Kings (GDS-0022)", GAME_NO_SOUND|GAME_NOT_WORKING )
3473GAME( 2001, lupinsho,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Lupin The Third - The Shooting (GDS-0018)", GAME_NO_SOUND|GAME_NOT_WORKING )
3474GAME( 2001, confmiss,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Confidential Mission (GDS-0001)", GAME_NO_SOUND|GAME_NOT_WORKING )
3475GAME( 2003, puyofev,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Puyo Puyo Fever (GDS-0031)", GAME_NO_SOUND|GAME_NOT_WORKING )
30853476
30863477/* Naomi 2 & Naomi 2 GD-ROM */
30873478
r4425r4426
31243515   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
31253516
31263517   DISK_REGION( "gdrom" )
3127   DISK_IMAGE_READONLY( "gds-0006", 0, SHA1(293b84c7f4547060f57598b796b6fc49513cc839) MD5(060d9fef55d8f0fc1986ecc991478942) )
3518   DISK_IMAGE_READONLY( "gds-0006", 0, SHA1(aca09a88506f5e462ad3fb33eac5478a2a010609) )
31283519
31293520   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
31303521   //PIC16C622A (317-0304-COM)
r4425r4426
31383529   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
31393530
31403531   DISK_REGION( "gdrom" )
3141   DISK_IMAGE_READONLY( "gds-0012", 0, SHA1(d68436ee72ea5db40e184b7ff38903a9cadb6df7) MD5(5a18300646a68f2994ed8c81abe9bdd8) )
3532   DISK_IMAGE_READONLY( "gds-0012", 0, SHA1(c34588f59c6091cd1c3ef235171dad8d5247e707) )
31423533
31433534   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
31443535   //PIC16C622A (317-0314-COM)
r4425r4426
31463537   ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) )
31473538ROM_END
31483539
3149   // this is actually Beach Spikers...
3540ROM_START( vf4evo )
3541   NAOMI2_BIOS
3542
3543   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3544
3545   DISK_REGION( "gdrom" )
3546   DISK_IMAGE_READONLY( "gds-0024b", 0, SHA1(a829169542f3bed76095ad6bfbbde7d494d04d72) )
3547
3548   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3549   //PIC16C622A (317-0338-JPN)
3550   //(sticker 253-5508-0338J)
3551   ROM_LOAD("317-0338-jpn.data", 0x00, 0x50, CRC(eeb2c9e9) SHA1(d30b5914c603219daea9923e1cf8da2be6096742) )
3552ROM_END
3553
3554ROM_START( initdv2j )
3555   NAOMI2_BIOS
3556
3557   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3558
3559   DISK_REGION( "gdrom" )
3560   DISK_IMAGE_READONLY( "gds-0026", 0, SHA1(253acede106b7fbf49e24458e7fda868720e9549) )
3561
3562   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3563   ROM_LOAD("gds-0026.rom", 0x00, 0x50, NO_DUMP) // file on GD-ROM is BFK.BIN , _NOT_ BEM.BIN which is for Initial D : Arcade Stage (Japan)
3564ROM_END
3565
3566ROM_START( vf4tuned ) // are there multiple files on this GD-ROM? it only compresses to 500 meg when the rom file is closer to half tha
3567   NAOMI2_BIOS
3568
3569   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3570
3571   DISK_REGION( "gdrom" )
3572   DISK_IMAGE_READONLY( "gds-0036f", 0, SHA1(ea35d6ecdf94e5c9a545952758da80f658755df0) )
3573
3574   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3575   //PIC16C622A (317-0387-COM)
3576   //(sticker 253-5508-0387)
3577   ROM_LOAD("317-0387-com.data", 0x00, 0x50, CRC(ab9f3851) SHA1(8b64dc6df176eb7adb48267709a27db221d5e3c3) )
3578ROM_END
3579
3580/*
3581
3582Title   BEACH SPIKERS
3583Media ID    0897
3584Media Config    GD-ROM1/1
3585Regions J
3586Peripheral String   0000000
3587Product Number  GDS-0014
3588Version V1.001
3589Release Date    20010613
3590Manufacturer ID
3591TOC DISC
3592Track   Start Sector    End Sector  Track Size
3593track01.bin 150 449 705600
3594track02.raw 600 2746    5049744
3595track03.bin 45150   549299  1185760800
3596
3597PIC
3598
3599253-5508-0317
3600317-0317-COM
3601
3602*/
3603
3604ROM_START( beachspi )
3605   NAOMI2_BIOS
3606//  NAOMIGD_BIOS
3607
3608   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3609
3610   DISK_REGION( "gdrom" )
3611   DISK_IMAGE_READONLY( "gds-0014", 0, SHA1(1ebb3695196c11a86276e034df2e1c8d7fa6b96f) )
3612
3613   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
31503614   //PIC16C622A (317-0317-COM)
31513615   //(sticker 253-5508-0317)
3152   //ROM_LOAD("317-0317-com.data", 0x00, 0x50, CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) )
3616   ROM_LOAD("317-0317-com.data", 0x00, 0x50, CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) )
3617ROM_END
31533618
3154
31553619ROM_START( initd )
31563620   NAOMI2_BIOS
3621//  NAOMIGD_BIOS
31573622
31583623   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
31593624
31603625   DISK_REGION( "gdrom" )
3161   DISK_IMAGE_READONLY( "gds-0020b", 0, SHA1(5f386183e856722fee4a6ddb0146350b73349181) MD5(b085005215e2766e0fc1e3bd16b2fd95) )
3626   DISK_IMAGE_READONLY( "gds-0020b", 0, SHA1(c0e901623ef4fcd97b7e4d29ae556e6f2e91b8ad) )
31623627
31633628   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
31643629   //PIC16C622A (317-0331-JPN)
r4425r4426
31663631   ROM_LOAD("317-0331-jpn.data", 0x00, 0x50, CRC(bb39742e) SHA1(b3100b18aeb80ebfd5312ba5c320e7e647710b55) )
31673632ROM_END
31683633
3634ROM_START( initdexp )
3635   NAOMI2_BIOS
3636//  NAOMIGD_BIOS
3637
3638   ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3639
3640   DISK_REGION( "gdrom" )
3641   DISK_IMAGE_READONLY( "gds-0025", 0, SHA1(8ea92cf6b493f21b9453832edad7cbc5e5b350c1) )
3642
3643   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)  // key supplied was bad
3644   ROM_LOAD("317-0343-com.data", 0x00, 0x50, CRC(e9d8fac0) SHA1(85f5bbffbd9d1f7162bae46ddd49e7870fe93662) )
3645ROM_END
3646
31693647GAME( 2001, naomi2,   0,        naomi,    naomi,    0, ROT0, "Sega",            "Naomi 2 Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
31703648
31713649//Naomi 2 Cart Games
r4425r4426
31743652// GDS-xxxx (first party games?)
31753653GAME( 2001, vstrik3, naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Virtua Striker 3 (GDS-0006)", GAME_NO_SOUND|GAME_NOT_WORKING )
31763654GAME( 2001, vf4,     naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Virtua Fighter 4 (GDS-0012)", GAME_NO_SOUND|GAME_NOT_WORKING )
3177GAME( 2002, initd,   naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Initial D Arcade Stage (GDS-0020b)", GAME_NO_SOUND|GAME_NOT_WORKING )
3655GAME( 2002, initd,   naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Initial D Arcade Stage (Japan) (GDS-0020b)", GAME_NO_SOUND|GAME_NOT_WORKING )
3656GAME( 2002, beachspi,naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Beach Spikers (GDS-0014)", GAME_NO_SOUND|GAME_NOT_WORKING )
3657GAME( 2002, initdexp,naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Initial D Arcade Stage (Export) (GDS-0025)", GAME_NO_SOUND|GAME_NOT_WORKING )
3658GAME( 2002, vf4evo,  naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Virtua Fighter 4 Evolution (GDS-0024B)", GAME_NO_SOUND|GAME_NOT_WORKING )
3659GAME( 2002, initdv2j,naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Initial D : Arcade Stage Ver. 2 (Japan) (GDS-0026)", GAME_NO_SOUND|GAME_NOT_WORKING )
3660GAME( 2004, vf4tuned,naomi2,  naomigd,    naomi,    0,  ROT0, "Sega",          "Virtua Fighter 4 Final Tuned (GDS-0036F)", GAME_NO_SOUND|GAME_NOT_WORKING )
31783661
31793662
31803663/* Atomiswave */
r4425r4426
31823665GAME( 2005, fotns,    awbios,   naomi,    naomi,    fotns, ROT0, "Arc System Works",           "Fist Of The North Star", GAME_NO_SOUND|GAME_NOT_WORKING )
31833666GAME( 2003, demofist, awbios,   naomi,    naomi,    demofist, ROT0, "Polygon Magic / Dimps",           "Demolish Fist", GAME_NO_SOUND|GAME_NOT_WORKING )
31843667
3668/*********************************************************************************************************************
3669**********************************************************************************************************************
3670*********************************************************************************************************************/
3671
3672// Triforce -- this is GameCube based, not Dreamcast/Naomi based, move out of here
3673// (currently here for testing the gd-rom stuff only)
3674#define TRIFORCE_BIOS \
3675   ROM_REGION( 0x200000, "maincpu", 0) \
3676   ROM_SYSTEM_BIOS( 0, "bios0", "Triforce Bios" ) \
3677   ROM_LOAD16_WORD_SWAP_BIOS( 0,  "triforce_bootrom.bin", 0x000000, 0x200000, CRC(d1883221) SHA1(c3cb7227e4dbc2af861e76d00cb59726105a2e4c) ) \
3678
3679ROM_START( triforce )
3680   TRIFORCE_BIOS
3681
3682   ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE)
3683ROM_END
3684
3685/*
3686
3687Title   VIRTUA STRIKER 4
3688Media ID    93B2
3689Media Config    GD-ROM1/1
3690Regions J
3691Peripheral String   0000000
3692Product Number  GDT-0015
3693Version V1.001
3694Release Date    20041202
3695Manufacturer ID
3696TOC DISC
3697Track   Start Sector    End Sector  Track Size
3698track01.bin 150 449 705600
3699track02.raw 600 1951    3179904
3700track03.bin 45150   549299  1185760800
3701
3702
3703PIC
3704255-5508-393E
3705317-0393-EXP
3706
3707*/
3708
3709ROM_START( vs4 )
3710   TRIFORCE_BIOS
3711   //NAOMIGD_BIOS
3712
3713   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3714
3715   DISK_REGION( "gdrom" )
3716   DISK_IMAGE_READONLY( "gdt-0015", 0, SHA1(1f83712b2b170d6edf4a27c15b6f763cc3cc4b71) )
3717
3718   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3719   ROM_LOAD("317-0393-exp.data", 0x00, 0x50, CRC(2dcfecd7) SHA1(d805168e1564051ae5c47876ade2c9843253c6b4) )
3720ROM_END
3721
3722/*
3723Title   VIRTUA_STRIKER_2002
3724Media ID    0DD8
3725Media Config    GD-ROM1/1
3726Regions J
3727Peripheral String   0000000
3728Product Number  GDT-0002
3729Version V1.005
3730Release Date    20020730
3731
3732
3733PIC
3734
3735253-5508-337E
3736317-0337-EXP
3737*/
3738
3739ROM_START( vs2002ex )
3740   TRIFORCE_BIOS
3741   //NAOMIGD_BIOS
3742
3743   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3744
3745   DISK_REGION( "gdrom" )
3746   DISK_IMAGE_READONLY( "gdt-0002", 0, SHA1(471e896d43167c93cc229cfc94ff7ac6de7cf9a4) )
3747
3748   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3749   ROM_LOAD("317-0337-exp.data", 0x00, 0x50, CRC(aa6be604) SHA1(fabc43ecfb7ddf1d5a87f10884852027d6f4773b) )
3750ROM_END
3751
3752GAME( 200?, triforce, 0,        naomigd,    naomi,    0, ROT0, "Sega",           "Triforce Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
3753GAME( 200?, vs4,      triforce, naomigd,    naomi,    0, ROT0, "Sega",           "Virtua Striker 4 (GDT-0015)", GAME_NO_SOUND|GAME_NOT_WORKING )
3754GAME( 2002, vs2002ex, triforce, naomigd,    naomi,    0, ROT0, "Sega",           "Virtua Striker 2002 (GDT-0002)", GAME_NO_SOUND|GAME_NOT_WORKING )
3755
3756
3757/*********************************************************************************************************************
3758**********************************************************************************************************************
3759*********************************************************************************************************************/
3760
3761// Chihiro -- this is XBox based, not Dreamcast/Naomi based, move out of here
3762// (currently here for testing the gd-rom stuff only)
3763#define CHIHIRO_BIOS \
3764   ROM_REGION( 0x200000, "maincpu", 0) \
3765   ROM_SYSTEM_BIOS( 0, "bios0", "Chihiro Bios" ) \
3766   ROM_LOAD16_WORD_SWAP_BIOS( 0,  "chihiro_bios.bin", 0x000000, 0x200000, NO_DUMP ) \
3767
3768ROM_START( chihiro )
3769   CHIHIRO_BIOS
3770
3771   ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE)
3772ROM_END
3773
3774/*
3775
3776Title   GHOST SQUAD
3777Media ID    004F
3778Media Config    GD-ROM1/1
3779Regions J
3780Peripheral String   0000000
3781Product Number  GDX-0012A
3782Version V2.000
3783Release Date    20041209
3784Manufacturer ID
3785
3786PIC
3787253-5508-0398
3788317-0398-COM
3789
3790*/
3791
3792ROM_START( ghostsqu )
3793   CHIHIRO_BIOS
3794
3795   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3796
3797   DISK_REGION( "gdrom" )
3798   DISK_IMAGE_READONLY( "gdx-0012a", 0,  SHA1(d7d78ce4992cb16ee5b4ac6ca7a37c46b07e8c14) )
3799
3800   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3801   ROM_LOAD("317-0398-com.data", 0x00, 0x50, CRC(8c5391a2) SHA1(e64cadeb30c94c3cd4002630cd79cc76c7bde2ed) )
3802ROM_END
3803
3804/*
3805
3806Title   VIRTUA COP 3
3807Media ID    C4AD
3808Media Config    GD-ROM1/1
3809Regions J
3810Peripheral String   0000000
3811Product Number  GDX-0003A
3812Version V2.004
3813Release Date    20030226
3814Manufacturer ID
3815TOC DISC
3816Track   Start Sector    End Sector  Track Size
3817track01.bin 150 599 1058400
3818track02.raw 750 2101    3179904
3819track03.bin 45150   549299  1185760800
3820
3821
3822PIC
3823255-5508-354
3824317-054-COM
3825
3826*/
3827
3828ROM_START( vcop3 )
3829   CHIHIRO_BIOS
3830
3831   ROM_REGION( 0x20000000, "user1", ROMREGION_ERASE) // allocate max size in init instead?
3832
3833   DISK_REGION( "gdrom" )
3834   DISK_IMAGE_READONLY( "gdx-0003a", 0,  SHA1(cdfec1d2ef02ae9e29cb1462f08904177bc4c9ea) )
3835
3836   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3837   ROM_LOAD("317-0354-com.data", 0x00, 0x50,  CRC(df7e3217) SHA1(9f0f4bf6b15f3b6eeea81eaa27b3d25bd94110da) )
3838ROM_END
3839
3840
3841GAME( 200?, chihiro,  0,       naomigd,    naomi,    0, ROT0, "Sega",           "Chihiro Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
3842GAME( 2005, ghostsqu, chihiro, naomigd,    naomi,    0, ROT0, "Sega",           "Ghost Squad (Ver. A?) (GDX-0012a)", GAME_NO_SOUND|GAME_NOT_WORKING )
3843GAME( 2003, vcop3,    chihiro, naomigd,    naomi,    0, ROT0, "Sega",           "Virtua Cop 3 (GDX-0003a)", GAME_NO_SOUND|GAME_NOT_WORKING )
3844
src/mame/drivers/stv.c
r4425r4426
4545
46460x00000000, 0x0007ffff  BIOS ROM
47470x00080000, 0x000fffff  Unused
480x00100000, 0x00100080  SMPC
480x00100000, 0x0010007f  SMPC
49490x00100080, 0x0017ffff  Unused
50500x00180000, 0x0018ffff  Back Up Ram
51510x00190000, 0x001fffff  Unused
r4425r4426
114114-Video emulation bugs: check stvvdp2.c file.
115115
116116(per-game issues)
117-stress: accesses the Sound Memory Expansion Area (0x05a00000-0x05afffff), unknown purpose;
117118-groovef: hangs soon after loaded,caused by two memory addresses in the Work RAM-H range.
118119 Kludged for now to work.
119120-smleague / finlarch: it randomly hangs / crashes,it works if you use a ridiculous MDRV_INTERLEAVE number,might need strict
r4425r4426
19901991   AM_RANGE(0x02000000, 0x04ffffff) AM_ROM AM_SHARE(7) AM_REGION("user1", 0) // cartridge
19911992   AM_RANGE(0x05800000, 0x0589ffff) AM_READWRITE(stvcd_r, stvcd_w)
19921993   /* Sound */
1993   AM_RANGE(0x05a00000, 0x05a7ffff) AM_READWRITE(stv_sh2_soundram_r, stv_sh2_soundram_w)
1994   AM_RANGE(0x05a00000, 0x05afffff) AM_READWRITE(stv_sh2_soundram_r, stv_sh2_soundram_w)
19941995   //AM_RANGE(0x05a80000, 0x05afffff) AM_READ(stv_sh2_random_r)
19951996   AM_RANGE(0x05b00000, 0x05b00fff) AM_DEVREADWRITE16("scsp", scsp_r, scsp_w, 0xffffffff)
19961997   /* VDP1 */
r4425r4426
20072008ADDRESS_MAP_END
20082009
20092010static ADDRESS_MAP_START( sound_mem, ADDRESS_SPACE_PROGRAM, 16 )
2010   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_BASE(&sound_ram)
2011   AM_RANGE(0x000000, 0x0fffff) AM_RAM AM_BASE(&sound_ram)
20112012   AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE("scsp", scsp_r, scsp_w)
20122013ADDRESS_MAP_END
20132014
r4425r4426
36423643   ROM_LOAD16_WORD_SWAP( "mpr18275.ic4",      0x0c00000, 0x0200000, NO_DUMP )
36433644
36443645   DISK_REGION( "cdrom" )
3645   DISK_IMAGE( "sfish2", 0, MD5(3c95f7e19c5475d0ffa0d89cc45a36e5) SHA1(d07e0aa09a0858b308cc2218996b2242885a2609) )
3646   DISK_IMAGE( "sfish2", 0, SHA1(a10073d83bbbe16e16f69ad48565821576557d61) )
36463647ROM_END
36473648
36483649ROM_START( sfish2j )
r4425r4426
36603661   ROM_LOAD16_WORD_SWAP( "mpr18274.ic3",      0x0800000, 0x0200000, NO_DUMP )
36613662
36623663   DISK_REGION( "cdrom" )
3663   DISK_IMAGE( "sfish2", 0, MD5(3c95f7e19c5475d0ffa0d89cc45a36e5) SHA1(d07e0aa09a0858b308cc2218996b2242885a2609) )
3664   DISK_IMAGE( "sfish2", 0, SHA1(a10073d83bbbe16e16f69ad48565821576557d61) )
36643665ROM_END
36653666
36663667
src/mame/drivers/queen.c
r4425r4426
77CPU main PCB is a standard EPIA
88ROMs    epia BIOS + solid state HD
99
101x VIA EPIA5000EAG (main PCB) with:
11VT8231 South Bridge
12VIA Eden Processor
13VIA EPIA Companion Chip VT1612A (Audio CODEC)
14VIA EPIA Companion Chip VT6103 (Networking)
15processor speed is 533MHz <- likely to be a Celeron or a Pentium III class CPU -AS
1016
11
12 ------- better component list should be added here!!
13
1417 it's a 2002 era PC at least based on the BIOS,
1518  almost certainly newer than the standard 'PENTIUM' CPU
1619
r4425r4426
3033}
3134
3235static ADDRESS_MAP_START( queen_map, ADDRESS_SPACE_PROGRAM, 32 )
36   AM_RANGE(0x00000000, 0x0009ffff) AM_RAM
37   AM_RANGE(0x000a0000, 0x000bffff) AM_RAM
38   AM_RANGE(0x000c0000, 0x000fffff) AM_ROM AM_REGION("bios", 0) AM_WRITENOP
39   AM_RANGE(0x00100000, 0x01ffffff) AM_RAM
40   AM_RANGE(0x10000000, 0x100001ff) AM_RAM
41   AM_RANGE(0x20000000, 0x200001ff) AM_RAM
42   AM_RANGE(0x30000000, 0x300001ff) AM_RAM
43   AM_RANGE(0x40000000, 0x400001ff) AM_RAM
44   AM_RANGE(0x50000000, 0x500001ff) AM_RAM
3345   AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("bios", 0)   /* System BIOS */
3446ADDRESS_MAP_END
3547
3648static ADDRESS_MAP_START(queen_io, ADDRESS_SPACE_IO, 32)
49   AM_RANGE(0x0000, 0x001f) AM_RAM//AM_DEVREADWRITE8("dma8237_1", dma8237_r, dma8237_w, 0xffffffff)
50   AM_RANGE(0x0020, 0x003f) AM_RAM//AM_DEVREADWRITE8("pic8259_1", pic8259_r, pic8259_w, 0xffffffff)
51   AM_RANGE(0x0040, 0x005f) AM_RAM//AM_DEVREADWRITE8("pit8254", pit8253_r, pit8253_w, 0xffffffff)
52   AM_RANGE(0x0060, 0x006f) AM_RAM//AM_READWRITE(kbdc8042_32le_r,          kbdc8042_32le_w)
53   AM_RANGE(0x0070, 0x007f) AM_RAM//AM_READWRITE(mc146818_port32le_r,      mc146818_port32le_w)
54   AM_RANGE(0x0080, 0x009f) AM_RAM//AM_READWRITE(at_page32_r,              at_page32_w)
55   AM_RANGE(0x00a0, 0x00bf) AM_RAM//AM_DEVREADWRITE8("pic8259_2", pic8259_r, pic8259_w, 0xffffffff)
56   AM_RANGE(0x00c0, 0x00df) AM_RAM//AM_DEVREADWRITE("dma8237_2", at32_dma8237_2_r, at32_dma8237_2_w)
57   AM_RANGE(0x00e8, 0x00eb) AM_NOP
58   AM_RANGE(0x01f0, 0x01f7) AM_RAM//AM_DEVREADWRITE("ide", ide_r, ide_w)
59   AM_RANGE(0x0300, 0x03af) AM_NOP
60   AM_RANGE(0x03b0, 0x03df) AM_NOP
61   AM_RANGE(0x0278, 0x027b) AM_WRITENOP//AM_WRITE(pnp_config_w)
62   AM_RANGE(0x03f0, 0x03ff) AM_RAM//AM_DEVREADWRITE("ide", fdc_r, fdc_w)
63   AM_RANGE(0x0a78, 0x0a7b) AM_WRITENOP//AM_WRITE(pnp_data_w)
64   AM_RANGE(0x0cf8, 0x0cff) AM_RAM//AM_DEVREADWRITE("pcibus", pci_32le_r,  pci_32le_w)
65   AM_RANGE(0x4004, 0x4007) AM_RAM // - todo: identify these two.
66   AM_RANGE(0x5000, 0x5007) AM_RAM // /
3767ADDRESS_MAP_END
3868
3969
r4425r4426
4272
4373
4474static MACHINE_DRIVER_START( queen )
45   MDRV_CPU_ADD("maincpu", PENTIUM, 400000000) // no idea
75   MDRV_CPU_ADD("maincpu", PENTIUM, 533000000) // Celeron or Pentium 3, 533 Mhz
4676   MDRV_CPU_PROGRAM_MAP(queen_map, 0)
4777   MDRV_CPU_IO_MAP(queen_io, 0)
4878
r4425r4426
6797   ROM_LOAD( "bios-original.bin", 0x00000, 0x40000, CRC(feb542d4) SHA1(3cc5d8aeb0e3b7d9ed33248a4f3dc507d29debd9) )
6898
6999   DISK_REGION( "ide" )
70   DISK_IMAGE( "pqiidediskonmodule", 0,SHA1(9134791a72c2218ddfd0e575e4c06743a02d0edc) MD5(fffff5010746e9e49b2f3d55ac9ffcb8) )
100   DISK_IMAGE( "pqiidediskonmodule", 0,SHA1(a56efcc711b1c5a2e63160b3088001a8c4fb56c2) )
71101ROM_END
72102
73103
74GAME( 2002?, queen,  0,    queen, queen,  0, ROT0, "STG?", "Queen?", GAME_NOT_WORKING|GAME_NO_SOUND )
104GAME( 2002?, queen,  0,    queen, queen,  0, ROT0, "STG", "Queen?", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/vamphalf.c
r4425r4426
99
1010
1111    Minigame Cool Collection   (c) 1999 SemiCom
12    Jumping Break              (c) 1999 F2 System
1213    Lup Lup Puzzle             (c) 1999 Omega System       (version 3.0 and 2.9)
1314    Puzzle Bang Bang           (c) 1999 Omega System       (version 2.8)
1415    Super Lup Lup Puzzle       (c) 1999 Omega System       (version 4.0)
16    Vamf 1/2                   (c) 1999 Danbi & F2 System  (Europe version)
1517    Vamp 1/2                   (c) 1999 Danbi & F2 System  (Korea version)
1618    Date Quiz Go Go Episode 2  (c) 2000 SemiCom
1719    Mission Craft              (c) 2000 Sun                (version 2.4)
r4425r4426
7779      eeprom_write_bit(data & 0x01);
7880      eeprom_set_cs_line((data & 0x04) ? CLEAR_LINE : ASSERT_LINE );
7981      eeprom_set_clock_line((data & 0x02) ? ASSERT_LINE : CLEAR_LINE );
82
83      // data & 8?
8084   }
8185}
8286
r4425r4426
107111   flipscreen = data & flip_bit;
108112}
109113
114
115static WRITE16_HANDLER( jmpbreak_flipscreen_w )
116{
117   flipscreen = data & 0x8000;
118}
119
120
110121static WRITE32_HANDLER( paletteram32_w )
111122{
112123   UINT16 paldata;
r4425r4426
278289   AM_RANGE(0x60a0, 0x60a3) AM_DEVWRITE("oki", finalgdr_oki_bank_w)
279290ADDRESS_MAP_END
280291
292static ADDRESS_MAP_START( jmpbreak_io, ADDRESS_SPACE_IO, 16 )
293   AM_RANGE(0x0c0, 0x0c3) AM_NOP // ?
294   AM_RANGE(0x100, 0x103) AM_WRITENOP // ?
295   AM_RANGE(0x240, 0x243) AM_READ_PORT("P1_P2")
296   AM_RANGE(0x280, 0x283) AM_WRITE(eeprom_w)
297   AM_RANGE(0x2c0, 0x2c3) AM_READ(eeprom_r)
298   AM_RANGE(0x440, 0x443) AM_DEVREADWRITE("oki", oki_r, oki_w)
299   AM_RANGE(0x540, 0x543) AM_READ_PORT("SYSTEM")
300   AM_RANGE(0x680, 0x683) AM_DEVWRITE8("ym", ym2151_register_port_w, 0x00ff)
301   AM_RANGE(0x684, 0x687) AM_DEVREADWRITE8("ym", ym2151_status_port_r, ym2151_data_port_w, 0x00ff)
302ADDRESS_MAP_END
281303
304
282305static ADDRESS_MAP_START( aoh_map, ADDRESS_SPACE_PROGRAM, 32 )
283306   AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_BASE(&wram32)
284307   AM_RANGE(0x40000000, 0x4003ffff) AM_RAM AM_BASE(&tiles32)
r4425r4426
357380
358381            fx = tiles[offs] & 0x8000;
359382            fy = tiles[offs] & 0x4000;
360
361383         }
362384         // 32bit version
363385         else
r4425r4426
669691static MACHINE_DRIVER_START( sound_ym_oki )
670692   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
671693
694   MDRV_SOUND_ADD("ym", YM2151, 28000000/8)
695   MDRV_SOUND_ROUTE(0, "lspeaker", 1.0)
696   MDRV_SOUND_ROUTE(1, "rspeaker", 1.0)
697
698   MDRV_SOUND_ADD("oki", OKIM6295, 28000000/16 )
699   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
700   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
701   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
702MACHINE_DRIVER_END
703
704static MACHINE_DRIVER_START( sound_suplup )
705   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
706
672707   MDRV_SOUND_ADD("ym", YM2151, 14318180/4)
673708   MDRV_SOUND_ROUTE(0, "lspeaker", 1.0)
674709   MDRV_SOUND_ROUTE(1, "rspeaker", 1.0)
r4425r4426
715750   MDRV_CPU_MODIFY("maincpu")
716751   MDRV_CPU_IO_MAP(suplup_io,0)
717752
753   MDRV_IMPORT_FROM(sound_suplup)
754MACHINE_DRIVER_END
755
756static MACHINE_DRIVER_START( jmpbreak )
757   MDRV_IMPORT_FROM(common)
758   MDRV_CPU_MODIFY("maincpu")
759   MDRV_CPU_IO_MAP(jmpbreak_io,0)
760
718761   MDRV_IMPORT_FROM(sound_ym_oki)
719762MACHINE_DRIVER_END
720763
r4425r4426
738781   MDRV_IMPORT_FROM(sound_ym_oki)
739782MACHINE_DRIVER_END
740783
741
742784static MACHINE_DRIVER_START( aoh )
743785   MDRV_CPU_ADD("maincpu", E132XN, 20000000*4)   /* 4x internal multiplier */
744786   MDRV_CPU_PROGRAM_MAP(aoh_map,0)
r4425r4426
815857E1-16T:        Hyperstone E1-16T CPU
816858QL2003-XPL84C: QuickLogic PLCC84 PLD
817859AD-65:         Compatible to OKI M6295
818KA12:          Compatible to Y3012 or Y3014
860KA12:          Compatible to Y3012
819861BS901          Compatible to YM2151
820862PROM1:         Main program
821863VROM1:         OKI samples
r4425r4426
854896   ROM_LOAD( "snd.vrom1", 0x00000, 0x40000, CRC(ee9e371e) SHA1(3ead5333121a77d76e4e40a0e0bf0dbc75f261eb) )
855897ROM_END
856898
857
858899/*
859900
860Mission Craft
861Sun, 2000
862
863PCB Layout
864----------
865
866SUN2000
867|---------------------------------------------|
868|       |------|  SND-ROM1     ROMH00  ROMH01 |
869|       |QDSP  |                              |
870|       |QS1001|                              |
871|DA1311A|------|  SND-ROM2                    |
872|       /------\                              |
873|       |QDSP  |               ROML00  ROML01 |
874|       |QS1000|                              |
875|  24MHz\------/                              |
876|                                 |---------| |
877|                                 | ACTEL   | |
878|J               62256            |A40MX04-F| |
879|A  *  PRG-ROM2  62256            |PL84     | |
880|M   PAL                          |         | |
881|M                    62256 62256 |---------| |
882|A                    62256 62256             |
883|             |-------|           |---------| |
884|             |GMS    |           | ACTEL   | |
885|  93C46      |30C2116|           |A40MX04-F| |
886|             |       | 62256     |PL84     | |
887|  HY5118164C |-------| 62256     |         | |
888|                                 |---------| |
889|SW2                                          |
890|SW1                                          |
891|   50MHz                              28MHz  |
892|---------------------------------------------|
893Notes:
894      GMS30C2116 - based on Hyperstone technology, clock running at 50.000MHz
895      QS1001A    - Wavetable audio chip, 1M ROM, manufactured by AdMOS (Now LG Semi.), SOP32
896      QS1000     - Wavetable audio chip manufactured by AdMOS (Now LG Semi.), QFP100
897                   provides Creative Waveblaster functionality and General Midi functions
898      SW1        - Used to enter test mode
899      SW2        - PCB Reset
900      *          - Empty socket for additional program ROM
901
902*/
903
904ROM_START( misncrft )
905   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
906   /* 0 - 0x80000 empty */
907   ROM_LOAD( "prg-rom2.bin", 0x80000, 0x80000, CRC(059ae8c1) SHA1(2c72fcf560166cb17cd8ad665beae302832d551c) )
908
909   ROM_REGION( 0x400000, "audiocpu", 0 )   /* i8052 code */
910   ROM_LOAD( "snd-rom2.us1", 0x00000, 0x20000, CRC(8821e5b9) SHA1(4b8df97bc61b48aa16ed411614fcd7ed939cac33) )
911
912   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE )
913   ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(748c5ae5) SHA1(28005f655920e18c82eccf05c0c449dac16ee36e) )
914   ROM_LOAD32_WORD( "romh00", 0x000002, 0x200000, CRC(f34ae697) SHA1(2282e3ef2d100f3eea0167b25b66b35a64ddb0f8) )
915   ROM_LOAD32_WORD( "roml01", 0x400000, 0x200000, CRC(e37ece7b) SHA1(744361bb73905bc0184e6938be640d3eda4b758d) )
916   ROM_LOAD32_WORD( "romh01", 0x400002, 0x200000, CRC(71fe4bc3) SHA1(08110b02707e835bf428d343d5112b153441e255) )
917
918   ROM_REGION( 0x80000, "sfx", 0 )
919   ROM_LOAD( "snd-rom1.u15", 0x00000, 0x80000, CRC(fb381da9) SHA1(2b1a5447ed856ab92e44d000f27a04d981e3ac52) )
920
921   ROM_REGION( 0x80000, "wavetable", 0 )
922   ROM_LOAD( "qs1001a.u17", 0x00000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) )
923ROM_END
924
925/*
926
927Cool Minigame Collection
928SemiCom, 1999
929
930PCB Layout
931----------
932
933F-E1-16-008
934|-------------------------------------------------------|
935|UPC1241            YM3012   VROM1                      |
936|      LM324  LM324 YM2151                              |
937|               MCM6206       M6295   ROML00    ROMU00  |
938|                                                       |
939|               MCM6206               ROML01    ROMU01  |
940|                                                       |
941|J              MCM6206               ROML02    ROMU02  |
942|A                                                      |
943|M              MCM6206               ROML03    ROMU03  |
944|M                                                      |
945|A              MCM6206                                 |
946|                                                       |
947|               MCM6206       QL2003    QL2003          |
948|                                                28MHz  |
949|               MCM6206                                 |
950|                                                       |
951|               MCM6206  E1-16T   GM71C1816     ROM1    |
952|                                                       |
953|              93C46                            ROM2    |
954|RESET  TEST          50MHz              PAL            |
955|-------------------------------------------------------|
956
957*/
958
959ROM_START( coolmini )
960   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
961   ROM_LOAD( "cm-rom1.040", 0x00000, 0x80000, CRC(9688fa98) SHA1(d5ebeb1407980072f689c3b3a5161263c7082e9a) )
962   ROM_LOAD( "cm-rom2.040", 0x80000, 0x80000, CRC(9d588fef) SHA1(7b6b0ba074c7fa0aecda2b55f411557b015522b6) )
963
964   ROM_REGION( 0x1000000, "gfx1", ROMREGION_DISPOSE )  /* 16x16x8 Sprites */
965   ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(4b141f31) SHA1(cf4885789b0df67d00f9f3659c445248c4e72446) )
966   ROM_LOAD32_WORD( "romu00", 0x000002, 0x200000, CRC(9b2fb12a) SHA1(8dce367c4c2cab6e84f586bd8dfea3ea0b6d7225) )
967   ROM_LOAD32_WORD( "roml01", 0x400000, 0x200000, CRC(1e3a04bb) SHA1(9eb84b6a0172a8868f440065c30b4519e0c3fe33) )
968   ROM_LOAD32_WORD( "romu01", 0x400002, 0x200000, CRC(06dd1a6c) SHA1(8c707d388848bc5826fbfc48c3035fdaf5018515) )
969   ROM_LOAD32_WORD( "roml02", 0x800000, 0x200000, CRC(1e8c12cb) SHA1(f57489e81eb1e476939148cfc8d03f3df03b2a84) )
970   ROM_LOAD32_WORD( "romu02", 0x800002, 0x200000, CRC(4551d4fc) SHA1(4ec102120ab99e324d9574bfce93837d8334da06) )
971   ROM_LOAD32_WORD( "roml03", 0xc00000, 0x200000, CRC(231650bf) SHA1(065f742a37d5476ec6f72f0bd8ba2cfbe626b872) )
972   ROM_LOAD32_WORD( "romu03", 0xc00002, 0x200000, CRC(273d5654) SHA1(0ae3d1c4c4862a8642dbebd7c955b29df29c4938) )
973
974   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
975   ROM_LOAD( "cm-vrom1.020", 0x00000, 0x40000, CRC(fcc28081) SHA1(44031df0ee28ca49df12bcb73c83299fac205e21) )
976ROM_END
977
978/*
979
980901Super Lup Lup Puzzle / Lup Lup Puzzle
981902Omega System, 1999
982903
r4425r4426
10841005   ROM_LOAD( "vrom1.bin", 0x00000, 0x40000, CRC(34a56987) SHA1(4d8983648a7f0acf43ff4c9c8aa6c8640ee2bbfe) )
10851006ROM_END
10861007
1008/*
10871009
1010Jumping Break
1011F2 System, 1999
1012
1013sequel to "Die Break" from the Bestri 3 game collection (see crospang.c)
1014
1015F-E1-16-002
1016+----------------------------------------------+
1017|     VR1                   M6295  VROM1 28MHz |
1018|                 YM3012                       |
1019|                 YM2151            MEM2       |
1020|                                   MEM3       |
1021|               CRAM1               MEM5       |
1022|               CRAM2               MEM7       |
1023|J                                             |
1024|A              MEM1U  +----------++----------+|
1025|M                     |          ||          ||
1026|M              MEM1L  |Quicklogic||Quicklogic||
1027|A                     | QL2003-  || QL2003-  ||
1028|                      | XPL84C   || XPL84C   ||
1029|                      |          ||          ||
1030|                      +----------++----------+|
1031|                                              |
1032| 93C46          DRAM1      ROM1 ROML00  ROMU00|
1033|P1 P2   50MHz   E1-16T     ROM2 ROML01  ROMU01|
1034|                                              |
1035+----------------------------------------------+
1036
1037Notes:
1038CPU: Hyperstone E1-16T @ 50.000MHz
1039
1040     DRAM1 - LG Semi GM71C18163 1M x16 EDO DRAM (SOJ44)
1041MEMx/CRAMx - NKK N341256SJ-15 32K x8 SRAM (SOJ28)
1042
1043Oki M6295 rebaged as AD-65
1044YM3012/YM2151 rebaged as KA12/BS901
1045
1046 P1 - Setup push button
1047 P2 - Reset push button
1048VR1 - Volume adjust pot
1049
1050ROMs:
1051    ROML00/01, ROMU00/01 - Macronix MX29F1610MC-12 SOP44 16MBit FlashROM
1052    VROM1                - AMD 27C020 2MBit DIP32 EPROM
1053    ROM1/2               - TMS 27C040 4MBit DIP32 EPROM
1054
1055*/
1056
1057ROM_START( jmpbreak )
1058   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
1059   ROM_LOAD( "rom1.bin", 0x00000, 0x80000, CRC(7e237f7d) SHA1(042e672be34644311eefc7b998bcdf6a9ea2c28a) )
1060   ROM_LOAD( "rom2.bin", 0x80000, 0x80000, CRC(c722f7be) SHA1(d8b3c6b5fd0942147e0a61169c3eb6334a3b5a40) )
1061
1062   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE ) /* 16x16x8 Sprites */
1063   ROM_LOAD32_WORD( "roml00.bin", 0x000000, 0x200000, CRC(4b99190a) SHA1(30af068f7d9f9f349db5696c19ab53ac33304271) )
1064   ROM_LOAD32_WORD( "romu00.bin", 0x000002, 0x200000, CRC(e93762f8) SHA1(cc589b59e3ab7aa7092e96a1ff8a9de8a499b257) )
1065   ROM_LOAD32_WORD( "roml01.bin", 0x400000, 0x200000, CRC(6796a104) SHA1(3f7352cd37f78c1b01f7df45344ee7800db110f9) )
1066   ROM_LOAD32_WORD( "romu01.bin", 0x400002, 0x200000, CRC(0cc907c8) SHA1(86029eca0870f3b7dd4f1ee8093ccb09077cc00b) )
1067
1068   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
1069   ROM_LOAD( "vrom1.bin", 0x00000, 0x40000, CRC(1b6e3671) SHA1(bd601460387b56c989785ae03d5bb3c6cdb30a50) )
1070ROM_END
1071
10881072/*
10891073
1074Cool Minigame Collection
1075SemiCom, 1999
1076
1077PCB Layout
1078----------
1079
1080F-E1-16-008
1081|-------------------------------------------------------|
1082|UPC1241            YM3012   VROM1                      |
1083|      LM324  LM324 YM2151                              |
1084|               MCM6206       M6295   ROML00    ROMU00  |
1085|                                                       |
1086|               MCM6206               ROML01    ROMU01  |
1087|                                                       |
1088|J              MCM6206               ROML02    ROMU02  |
1089|A                                                      |
1090|M              MCM6206               ROML03    ROMU03  |
1091|M                                                      |
1092|A              MCM6206                                 |
1093|                                                       |
1094|               MCM6206       QL2003    QL2003          |
1095|                                                28MHz  |
1096|               MCM6206                                 |
1097|                                                       |
1098|               MCM6206  E1-16T   GM71C1816     ROM1    |
1099|                                                       |
1100|              93C46                            ROM2    |
1101|RESET  TEST          50MHz              PAL            |
1102|-------------------------------------------------------|
1103
1104*/
1105
1106ROM_START( coolmini )
1107   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
1108   ROM_LOAD( "cm-rom1.040", 0x00000, 0x80000, CRC(9688fa98) SHA1(d5ebeb1407980072f689c3b3a5161263c7082e9a) )
1109   ROM_LOAD( "cm-rom2.040", 0x80000, 0x80000, CRC(9d588fef) SHA1(7b6b0ba074c7fa0aecda2b55f411557b015522b6) )
1110
1111   ROM_REGION( 0x1000000, "gfx1", ROMREGION_DISPOSE )  /* 16x16x8 Sprites */
1112   ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(4b141f31) SHA1(cf4885789b0df67d00f9f3659c445248c4e72446) )
1113   ROM_LOAD32_WORD( "romu00", 0x000002, 0x200000, CRC(9b2fb12a) SHA1(8dce367c4c2cab6e84f586bd8dfea3ea0b6d7225) )
1114   ROM_LOAD32_WORD( "roml01", 0x400000, 0x200000, CRC(1e3a04bb) SHA1(9eb84b6a0172a8868f440065c30b4519e0c3fe33) )
1115   ROM_LOAD32_WORD( "romu01", 0x400002, 0x200000, CRC(06dd1a6c) SHA1(8c707d388848bc5826fbfc48c3035fdaf5018515) )
1116   ROM_LOAD32_WORD( "roml02", 0x800000, 0x200000, CRC(1e8c12cb) SHA1(f57489e81eb1e476939148cfc8d03f3df03b2a84) )
1117   ROM_LOAD32_WORD( "romu02", 0x800002, 0x200000, CRC(4551d4fc) SHA1(4ec102120ab99e324d9574bfce93837d8334da06) )
1118   ROM_LOAD32_WORD( "roml03", 0xc00000, 0x200000, CRC(231650bf) SHA1(065f742a37d5476ec6f72f0bd8ba2cfbe626b872) )
1119   ROM_LOAD32_WORD( "romu03", 0xc00002, 0x200000, CRC(273d5654) SHA1(0ae3d1c4c4862a8642dbebd7c955b29df29c4938) )
1120
1121   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
1122   ROM_LOAD( "cm-vrom1.020", 0x00000, 0x40000, CRC(fcc28081) SHA1(44031df0ee28ca49df12bcb73c83299fac205e21) )
1123ROM_END
1124
1125/*
1126
1127Date Quiz Go Go Episode 2
1128SemiCom, 2000
1129
1130F-E1-16-010
1131
1132*/
1133
1134ROM_START( dquizgo2 )
1135   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
1136   ROM_LOAD( "rom1",         0x00000, 0x080000, CRC(81eef038) SHA1(9c925d1ef261ea85069925ccd1a5aeb939f55d5a) )
1137   ROM_LOAD( "rom2",         0x80000, 0x080000, CRC(e8789d8a) SHA1(1ee26c26cc7024c5df9d0da630b326021ece9f41) )
1138
1139   ROM_REGION( 0xc00000, "gfx1", ROMREGION_DISPOSE ) /* 16x16x8 Sprites */
1140   ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(de811dd7) SHA1(bf31e165440ed2e3cdddd2174521b15afd8b2e69) )
1141   ROM_LOAD32_WORD( "romu00", 0x000002, 0x200000, CRC(2bdbfc6b) SHA1(8e755574e3c9692bd8f82c7351fe3623a31ec136) )
1142   ROM_LOAD32_WORD( "roml01", 0x400000, 0x200000, CRC(f574a2a3) SHA1(c6a8aca75bd3a4e4109db5095f3a3edb9b1e6657) )
1143   ROM_LOAD32_WORD( "romu01", 0x400002, 0x200000, CRC(d05cf02f) SHA1(624316d4ee42c6257bc64747e4260a0d3950f9cd) )
1144   ROM_LOAD32_WORD( "roml02", 0x800000, 0x200000, CRC(43ca2cff) SHA1(02ad7cce42d917dbefdba2e4e8886fc883b1dc60) )
1145   ROM_LOAD32_WORD( "romu02", 0x800002, 0x200000, CRC(b8218222) SHA1(1e1aa60e0de9c02b841896512a1163dda280c845) )
1146   /* roml03 empty */
1147   /* romu03 empty */
1148
1149   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
1150   ROM_LOAD( "vrom1", 0x00000, 0x40000, CRC(24d5b55f) SHA1(cb4d3a22440831e37df0a7fe5433bea708d60f31) )
1151ROM_END
1152
1153/*
1154
10901155Wyvern Wings (c) 2001 SemiCom, Game Vision License
10911156
10921157   CPU: Hyperstone E1-32T
r4425r4426
11661231   ROM_LOAD( "qs1001a",  0x000000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) )
11671232ROM_END
11681233
1234/*
11691235
1236Mission Craft
1237Sun, 2000
1238
1239PCB Layout
1240----------
1241
1242SUN2000
1243|---------------------------------------------|
1244|       |------|  SND-ROM1     ROMH00  ROMH01 |
1245|       |QDSP  |                              |
1246|       |QS1001|                              |
1247|DA1311A|------|  SND-ROM2                    |
1248|       /------\                              |
1249|       |QDSP  |               ROML00  ROML01 |
1250|       |QS1000|                              |
1251|  24MHz\------/                              |
1252|                                 |---------| |
1253|                                 | ACTEL   | |
1254|J               62256            |A40MX04-F| |
1255|A  *  PRG-ROM2  62256            |PL84     | |
1256|M   PAL                          |         | |
1257|M                    62256 62256 |---------| |
1258|A                    62256 62256             |
1259|             |-------|           |---------| |
1260|             |GMS    |           | ACTEL   | |
1261|  93C46      |30C2116|           |A40MX04-F| |
1262|             |       | 62256     |PL84     | |
1263|  HY5118164C |-------| 62256     |         | |
1264|                                 |---------| |
1265|SW2                                          |
1266|SW1                                          |
1267|   50MHz                              28MHz  |
1268|---------------------------------------------|
1269Notes:
1270      GMS30C2116 - based on Hyperstone technology, clock running at 50.000MHz
1271      QS1001A    - Wavetable audio chip, 1M ROM, manufactured by AdMOS (Now LG Semi.), SOP32
1272      QS1000     - Wavetable audio chip manufactured by AdMOS (Now LG Semi.), QFP100
1273                   provides Creative Waveblaster functionality and General Midi functions
1274      SW1        - Used to enter test mode
1275      SW2        - PCB Reset
1276      *          - Empty socket for additional program ROM
1277
1278*/
1279
1280ROM_START( misncrft )
1281   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
1282   /* 0 - 0x80000 empty */
1283   ROM_LOAD( "prg-rom2.bin", 0x80000, 0x80000, CRC(059ae8c1) SHA1(2c72fcf560166cb17cd8ad665beae302832d551c) )
1284
1285   ROM_REGION( 0x400000, "audiocpu", 0 )   /* i8052 code */
1286   ROM_LOAD( "snd-rom2.us1", 0x00000, 0x20000, CRC(8821e5b9) SHA1(4b8df97bc61b48aa16ed411614fcd7ed939cac33) )
1287
1288   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE )
1289   ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(748c5ae5) SHA1(28005f655920e18c82eccf05c0c449dac16ee36e) )
1290   ROM_LOAD32_WORD( "romh00", 0x000002, 0x200000, CRC(f34ae697) SHA1(2282e3ef2d100f3eea0167b25b66b35a64ddb0f8) )
1291   ROM_LOAD32_WORD( "roml01", 0x400000, 0x200000, CRC(e37ece7b) SHA1(744361bb73905bc0184e6938be640d3eda4b758d) )
1292   ROM_LOAD32_WORD( "romh01", 0x400002, 0x200000, CRC(71fe4bc3) SHA1(08110b02707e835bf428d343d5112b153441e255) )
1293
1294   ROM_REGION( 0x80000, "sfx", 0 )
1295   ROM_LOAD( "snd-rom1.u15", 0x00000, 0x80000, CRC(fb381da9) SHA1(2b1a5447ed856ab92e44d000f27a04d981e3ac52) )
1296
1297   ROM_REGION( 0x80000, "wavetable", 0 )
1298   ROM_LOAD( "qs1001a.u17", 0x00000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) )
1299ROM_END
1300
11701301/*
11711302
11721303Final Godori (c) SemiCom
r4425r4426
12421373ROM_END
12431374
12441375/*
1245
1246Date Quiz Go Go Episode 2
1247SemiCom, 2000
1248
1249F-E1-16-010
1250
1251*/
1252
1253ROM_START( dquizgo2 )
1254   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
1255   ROM_LOAD( "rom1",         0x00000, 0x080000, CRC(81eef038) SHA1(9c925d1ef261ea85069925ccd1a5aeb939f55d5a) )
1256   ROM_LOAD( "rom2",         0x80000, 0x080000, CRC(e8789d8a) SHA1(1ee26c26cc7024c5df9d0da630b326021ece9f41) )
1257
1258   ROM_REGION( 0xc00000, "gfx1", ROMREGION_DISPOSE ) /* 16x16x8 Sprites */
1259   ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(de811dd7) SHA1(bf31e165440ed2e3cdddd2174521b15afd8b2e69) )
1260   ROM_LOAD32_WORD( "romu00", 0x000002, 0x200000, CRC(2bdbfc6b) SHA1(8e755574e3c9692bd8f82c7351fe3623a31ec136) )
1261   ROM_LOAD32_WORD( "roml01", 0x400000, 0x200000, CRC(f574a2a3) SHA1(c6a8aca75bd3a4e4109db5095f3a3edb9b1e6657) )
1262   ROM_LOAD32_WORD( "romu01", 0x400002, 0x200000, CRC(d05cf02f) SHA1(624316d4ee42c6257bc64747e4260a0d3950f9cd) )
1263   ROM_LOAD32_WORD( "roml02", 0x800000, 0x200000, CRC(43ca2cff) SHA1(02ad7cce42d917dbefdba2e4e8886fc883b1dc60) )
1264   ROM_LOAD32_WORD( "romu02", 0x800002, 0x200000, CRC(b8218222) SHA1(1e1aa60e0de9c02b841896512a1163dda280c845) )
1265   /* roml03 empty */
1266   /* romu03 empty */
1267
1268   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
1269   ROM_LOAD( "vrom1", 0x00000, 0x40000, CRC(24d5b55f) SHA1(cb4d3a22440831e37df0a7fe5433bea708d60f31) )
1270ROM_END
1271
1272/*
12731376Age Of Heroes - Silkroad 2
12741377Unico, 2001
12751378
r4425r4426
13471450   ROM_COPY( "user2", 0x060000, 0x0e0000, 0x020000)
13481451ROM_END
13491452
1350
1351
13521453static int irq_active(const address_space *space)
13531454{
13541455   UINT32 FCR = cpu_get_reg(space->cpu, 27);
r4425r4426
15161617   return wram32[0x28a09c/4];
15171618}
15181619
1620static READ16_HANDLER( jmpbreak_speedup_r )
1621{
1622   if(cpu_get_pc(space->cpu) == 0x983c)
1623   {
1624      if(irq_active(space))
1625         cpu_spinuntil_int(space->cpu);
1626      else
1627         cpu_eat_cycles(space->cpu, 50);
1628   }
1629
1630   return wram[(0x00906fc/2)+offset];
1631}
1632
15191633static DRIVER_INIT( vamphalf )
15201634{
15211635   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0004a840, 0x0004a843, 0, 0, vamphalf_speedup_r );
r4425r4426
16191733   /* no flipscreen */
16201734}
16211735
1736static DRIVER_INIT( jmpbreak )
1737{
1738   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00906fc, 0x00906ff, 0, 0, jmpbreak_speedup_r );
1739   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe0000000, 0xe0000003, 0, 0, jmpbreak_flipscreen_w );
1740
1741   palshift = 0;
1742}
1743
16221744GAME( 1999, coolmini, 0,        coolmini, common,   coolmini, ROT0,   "SemiCom",           "Cool Minigame Collection", 0 )
1623GAME( 1999, suplup,   0,        suplup,   common,   suplup,   ROT0,   "Omega System",      "Super Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 4.0 / 990518)" , 0)
1745GAME( 1999, jmpbreak, 0,        jmpbreak, common,   jmpbreak, ROT0,   "F2 System",         "Jumping Break" , 0 )
1746GAME( 1999, suplup,   0,        suplup,   common,   suplup,   ROT0,   "Omega System",      "Super Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 4.0 / 990518)" , 0 )
16241747GAME( 1999, luplup,   suplup,   suplup,   common,   luplup,   ROT0,   "Omega System",      "Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 3.0 / 990128)", 0 )
16251748GAME( 1999, luplup29, suplup,   suplup,   common,   luplup29, ROT0,   "Omega System",      "Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 2.9 / 990108)", 0 )
16261749GAME( 1999, puzlbang, suplup,   suplup,   common,   puzlbang, ROT0,   "Omega System",      "Puzzle Bang Bang (version 2.8 / 990106)", 0 )
r4425r4426
16301753GAME( 2000, misncrft, 0,        misncrft, common,   misncrft, ROT90,  "Sun",               "Mission Craft (version 2.4)", GAME_NO_SOUND )
16311754GAME( 2001, finalgdr, 0,        finalgdr, finalgdr, finalgdr, ROT0,   "SemiCom",           "Final Godori (Korea, version 2.20.5915)", 0 )
16321755GAME( 2001, wyvernwg, 0,        wyvernwg, common,   wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND )
1633GAME( 2001, aoh,      0,       aoh,      aoh,      aoh,      ROT0,   "Unico",             "Age Of Heroes - Silkroad 2 (v0.63 - 2001/02/07)", 0 )
1756GAME( 2001, aoh,      0,        aoh,      aoh,      aoh,      ROT0,   "Unico",             "Age Of Heroes - Silkroad 2 (v0.63 - 2001/02/07)", 0 )
src/mame/drivers/galaxia.c
r4425r4426
4343   /* configure the S2636 chips */
4444   s2636_0 = s2636_config(galaxia_s2636_0_ram, height, width,  3, -27);
4545   s2636_1 = s2636_config(galaxia_s2636_1_ram, height, width,  3, -27);
46   s2636_2 = s2636_config(galaxia_s2636_1_ram, height, width,  3, -27);
46   s2636_2 = s2636_config(galaxia_s2636_2_ram, height, width,  3, -27);
4747}
4848
4949static VIDEO_UPDATE( galaxia )
r4425r4426
124124   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(galaxia_video_r, galaxia_video_w)  AM_BASE(&galaxia_video)
125125   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
126126   AM_RANGE(0x2000, 0x33ff) AM_ROM
127   AM_RANGE(0x7214, 0x7214) AM_READ_PORT("IN0")
127128ADDRESS_MAP_END
128129
129
130130static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
131131   ADDRESS_MAP_GLOBAL_MASK(0xff)
132   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN0")
132   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN7")
133   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
134   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
135   AM_RANGE(0x05, 0x05) AM_READ_PORT("IN5")
136   AM_RANGE(0x06, 0x06) AM_READ_PORT("IN6")
137   AM_RANGE(0xac, 0xac) AM_READ_PORT("IN3")
133138ADDRESS_MAP_END
134139
140
141static ADDRESS_MAP_START( astrowar_mem, ADDRESS_SPACE_PROGRAM, 8 )
142   AM_RANGE(0x0000, 0x13ff) AM_ROM
143   AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM
144   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&galaxia_s2636_0_ram)
145   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&galaxia_s2636_1_ram)
146   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&galaxia_s2636_2_ram)
147   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(galaxia_video_r, galaxia_video_w)  AM_BASE(&galaxia_video)
148   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
149   AM_RANGE(0x2000, 0x33ff) AM_ROM
150ADDRESS_MAP_END
151
152static ADDRESS_MAP_START( astrowar_io, ADDRESS_SPACE_IO, 8 )
153   ADDRESS_MAP_GLOBAL_MASK(0xff)
154   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
155   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
156   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
157   AM_RANGE(0x06, 0x06) AM_READ_PORT("IN6")
158   AM_RANGE(0x07, 0x07) AM_READ_PORT("IN7")
159ADDRESS_MAP_END
160
135161static INPUT_PORTS_START( galaxia )
136162   PORT_START("IN0")
137   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
138   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
139   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
140   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
141   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
142   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
143   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
144   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
145   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
146   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
147   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
148   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
149   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
150   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
151   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
152   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
153   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
154   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
155   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
156   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
157   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
158   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
163   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
164   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
165   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
166   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
167   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
168   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
169   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
170
171   PORT_START("IN1")
172   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
173
174   PORT_START("IN2")
175   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
176   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
177   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
178   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
179   PORT_DIPNAME( 0x80, 0x80, "Freeze" )
159180   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
160181   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
182   PORT_BIT( 0x43, IP_ACTIVE_HIGH, IPT_UNKNOWN )
183
184   PORT_START("IN3")
185   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
186
187   PORT_START("IN5")
188   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
189
190   PORT_START("IN6")
191   PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
192   PORT_DIPSETTING(    0x00, "A 1C_1C B 2C_1C" )
193   PORT_DIPSETTING(    0x01, "A 1C_2C B 2C_1C" )
194   PORT_DIPSETTING(    0x02, "A 1C_3C B 2C_1C" )
195   PORT_DIPSETTING(    0x03, "A 1C_5C B 2C_1C" )
196   PORT_DIPSETTING(    0x04, "A 1C_1C B 1C_1C" )
197   PORT_DIPSETTING(    0x05, "A 1C_2C B 1C_1C" )
198   PORT_DIPSETTING(    0x06, "A 1C_3C B 1C_1C" )
199   PORT_DIPSETTING(    0x07, "A 1C_5C B 1C_1C" )
200   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) )
201   PORT_DIPSETTING(    0x00, "3" )
202   PORT_DIPSETTING(    0x08, "5" )
203   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
204
205   PORT_START("IN7")
206   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
161207INPUT_PORTS_END
162208
163209static const gfx_layout tiles8x8x1_layout =
r4425r4426
220266
221267static MACHINE_DRIVER_START( astrowar )
222268   MDRV_IMPORT_FROM( galaxia )
269   MDRV_CPU_MODIFY("maincpu")
270   MDRV_CPU_PROGRAM_MAP(astrowar_mem, 0)
271   MDRV_CPU_IO_MAP(astrowar_io, 0)
223272   MDRV_GFXDECODE(astrowar)
224273MACHINE_DRIVER_END
225274
src/mame/drivers/firefox.c
r4425r4426
755755   ROM_LOAD( "136026.119",     0x2c000,  0x4000, CRC(959471b1) SHA1(a032209a209f51d34360d5c7ad32ec62150158d2)) /* 1a */
756756
757757   DISK_REGION( "laserdisc" )
758   DISK_IMAGE_READONLY( "firefox", 0, SHA1(b500a834fa505e4c0649d8e5e6b7d40d4deef48d) MD5(73fb69fd20adf2800b28dc1ab58be2d4) )
758   DISK_IMAGE_READONLY( "firefox", 0, SHA1(3c4be40f55b44d0352b64c0861b6d1b650451ce7) )
759759ROM_END
760760
761761ROM_START( firefoxa )
r4425r4426
795795   ROM_LOAD( "136026.119",     0x2c000,  0x4000, CRC(959471b1) SHA1(a032209a209f51d34360d5c7ad32ec62150158d2)) /* 1a */
796796
797797   DISK_REGION( "laserdisc" )
798   DISK_IMAGE_READONLY( "firefox", 0, SHA1(b500a834fa505e4c0649d8e5e6b7d40d4deef48d) MD5(73fb69fd20adf2800b28dc1ab58be2d4) )
798   DISK_IMAGE_READONLY( "firefox", 0, SHA1(3c4be40f55b44d0352b64c0861b6d1b650451ce7) )
799799ROM_END
800800
801801
src/mame/drivers/caswin.c
r4425r4426
11/*******************************************************************************************
22
3Royal Casino (c) 1984 Dyna
34Casino Winner (c) 1985 Aristocrat
45
56driver by Chris Hardy & Angelo Salese
7original rcasino.c driver by Curt Coder
68
79TODO:
810-Cherry-type subgames appears to have wrong graphics alignment,maybe it's some fancy window
911 effect?
12-Add lamps support;
13-p1 & p2 inputs are tied to the same port...maybe they are mux-ed with the flip screen bit?
1014
15============================================================================================
16    ----------------------------------------
17    Casino Royal by Dyna Electronics CO. LTD
18    ----------------------------------------
19
20    Location    Device      File ID     Checksum
21    --------------------------------------------
22    18B          2764        RI-W1        C62D
23    16B          2764        RI-W2        AC85
24    15B          2732        RI-W3        70B7
25    11B          2732        RI-W4        0C21
26    9B           2764        RI-W5        EB59
27    8B           2764        RI-W6        C934
28    6B           2732        RI-W7        4130
29    9E         82S123      PROM1.BPR      0F29
30    8E         82S123      PROM2.BPR      0EE5
31
32    Notes: PCB No. D-2608208A1-2
33
34    Brief hardware overview
35    -----------------------
36
37    Main processor  - Z80
38    Sound           - AY-3-8910
39
40    ---
41
1142*******************************************************************************************/
1243
1344#include "driver.h"
r4425r4426
5384}
5485
5586/*These two are tested during the two cherry sub-games.I really don't know what is supposed to do...*/
56static WRITE8_HANDLER( scroll_w )
87static WRITE8_HANDLER( vvillage_scroll_w )
5788{
89   //...
5890}
5991
60/*---- --x- enable some weird effect*/
61static WRITE8_HANDLER( vregs_w )
92/*---- --x- window effect? */
93/*---- ---x flip screen */
94static WRITE8_HANDLER( vvillage_vregs_w )
6295{
96   flip_screen_set(space->machine, data & 1);
6397}
6498
6599/**********************
r4425r4426
73107   return mame_rand(space->machine);
74108}
75109
76static WRITE8_HANDLER( output_w )
110static WRITE8_HANDLER( vvillage_output_w )
77111{
78112   coin_counter_w(0,data & 1);
79113   coin_counter_w(1,data & 1);
114   // data & 4 payout counter
80115   coin_lockout_w(0,data & 0x20);
81116   coin_lockout_w(1,data & 0x20);
82117}
83118
84static WRITE8_HANDLER( lamps_w )
119static WRITE8_HANDLER( vvillage_lamps_w )
85120{
86121   /*
87122    ---x ---- lamp button 5
r4425r4426
90125    ---- --x- lamp button 2
91126    ---- ---x lamp button 1
92127    */
128   set_led_status(0, data & 0x01);
129   set_led_status(1, data & 0x02);
130   set_led_status(2, data & 0x04);
131   set_led_status(3, data & 0x08);
132   set_led_status(4, data & 0x10);
93133}
94134
95static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
135static ADDRESS_MAP_START( vvillage_mem, ADDRESS_SPACE_PROGRAM, 8 )
96136   AM_RANGE(0x0000, 0x7fff) AM_ROM
97   AM_RANGE(0xa000, 0xa000) AM_READ(vvillage_rng_r)
98   AM_RANGE(0xe000, 0xefff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) //maybe not all of it
99   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(&sc0_vram)
100   AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(sc0_attr_w) AM_BASE(&sc0_attr)
137   AM_RANGE(0xa000, 0xa000) AM_READ(vvillage_rng_r) //accessed by caswin only
138   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
139   AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(sc0_vram_w) AM_BASE(&sc0_vram)
140   AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(sc0_attr_w) AM_BASE(&sc0_attr)
101141ADDRESS_MAP_END
102142
103static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 )
143static ADDRESS_MAP_START( vvillage_io, ADDRESS_SPACE_IO, 8 )
104144   ADDRESS_MAP_GLOBAL_MASK(0xff)
105145   AM_RANGE(0x01,0x01) AM_DEVREAD("ay", ay8910_r)
106146   AM_RANGE(0x02,0x03) AM_DEVWRITE("ay", ay8910_data_address_w)
107147   AM_RANGE(0x10,0x10) AM_READ_PORT("IN0")
108148   AM_RANGE(0x11,0x11) AM_READ_PORT("IN1")
109   AM_RANGE(0x10,0x10) AM_WRITE(scroll_w)
110   AM_RANGE(0x11,0x11) AM_WRITE(vregs_w)
111   AM_RANGE(0x12,0x12) AM_WRITE(lamps_w)
112   AM_RANGE(0x13,0x13) AM_WRITE(output_w)
149   AM_RANGE(0x10,0x10) AM_WRITE(vvillage_scroll_w)
150   AM_RANGE(0x11,0x11) AM_WRITE(vvillage_vregs_w)
151   AM_RANGE(0x12,0x12) AM_WRITE(vvillage_lamps_w)
152   AM_RANGE(0x13,0x13) AM_WRITE(vvillage_output_w)
113153ADDRESS_MAP_END
114154
115155
r4425r4426
124164
125165   PORT_START("IN1")
126166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
127   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note Acceptor")// Note
128168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Payout") PORT_CODE(KEYCODE_7)
129   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
169   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )                        // Hopper Micro
170   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )                          // 1P FlipFlop
171   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )                          // 2P FlipFlop
172   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
130173
131174   PORT_START("DSW1")
132   PORT_DIPNAME( 0x01, 0x00, "Poker" )
133   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
134   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
135   PORT_DIPNAME( 0x02, 0x00, "Black Jack" )
136   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
137   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
138   PORT_DIPNAME( 0x04, 0x00, "Hi & Low" )
139   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
140   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
141   PORT_DIPNAME( 0x08, 0x00, "Five Line" )
142   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
143   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
144   PORT_DIPNAME( 0x10, 0x00, "Super Conti" )
145   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
146   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
147   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
175   PORT_DIPNAME( 0x01, 0x00, "Poker Available" ) PORT_DIPLOCATION("SW1:1")
176   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
177   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
178   PORT_DIPNAME( 0x02, 0x00, "Black Jack Available" ) PORT_DIPLOCATION("SW1:2")
179   PORT_DIPSETTING(    0x02, DEF_STR( No ) )
180   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
181   PORT_DIPNAME( 0x04, 0x00, "Hi & Low Available" ) PORT_DIPLOCATION("SW1:3")
182   PORT_DIPSETTING(    0x04, DEF_STR( No ) )
183   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
184   PORT_DIPNAME( 0x08, 0x00, "Five Line Available" ) PORT_DIPLOCATION("SW1:4")
185   PORT_DIPSETTING(    0x08, DEF_STR( No ) )
186   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
187   PORT_DIPNAME( 0x10, 0x00, "Super Conti Available" ) PORT_DIPLOCATION("SW1:5")
188   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
189   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
190   PORT_DIPNAME( 0x20, 0x20, "BlackJack, Even Rule" ) PORT_DIPLOCATION("SW1:6")
148191   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
149192   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
150   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
193   PORT_DIPNAME( 0x40, 0x40, "Poker, Royal Flush Rule" ) PORT_DIPLOCATION("SW1:7")
151194   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
152195   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
153   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
196   PORT_DIPNAME( 0x80, 0x80, "Poker, Jack or Better Rule") PORT_DIPLOCATION("SW1:8")
154197   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
155198   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
156199   PORT_START("DSW2")
157   PORT_DIPNAME( 0x01, 0x00, "Auto Hopper" )
158   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
159   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
160   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
161   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
162   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
163   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
200   PORT_DIPNAME( 0x01, 0x00, "Enable Hopper Payout" ) PORT_DIPLOCATION("SW2:1")
201   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
202   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
203   PORT_DIPNAME( 0x02, 0x00, "Enable Hopper Win Payout") PORT_DIPLOCATION("SW2:2")
204   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
205   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
206   PORT_DIPNAME( 0x04, 0x04, "Hi Lo, Royal Flush" ) PORT_DIPLOCATION("SW2:3")
164207   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
165208   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
166   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
167   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
169   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
209   PORT_DIPNAME( 0x08, 0x08, "Game Bet") PORT_DIPLOCATION("SW2:4")
210   PORT_DIPSETTING(    0x08, "Normal Game")
211   PORT_DIPSETTING(    0x00, "Double Game")
212   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5")
170213   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
171214   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
172   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
215   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6")
173216   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
174217   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
175   PORT_DIPNAME( 0x40, 0x40, "Show Dip-Switches Status" )
176   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
177   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
178   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) ) //analyzer
218   PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW2:7")
219   PORT_DIPNAME( 0x80, 0x80, "Analyzer" ) PORT_DIPLOCATION("SW2:8")
179220   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
180221   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
181222INPUT_PORTS_END
r4425r4426
235276static MACHINE_DRIVER_START( vvillage )
236277   /* basic machine hardware */
237278   MDRV_CPU_ADD("maincpu", Z80,4000000)       /* ? MHz */
238   MDRV_CPU_PROGRAM_MAP(readmem,0)
239   MDRV_CPU_IO_MAP(portmap,0)
279   MDRV_CPU_PROGRAM_MAP(vvillage_mem,0)
280   MDRV_CPU_IO_MAP(vvillage_io,0)
240281   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold )
241282
242283   /* video hardware */
r4425r4426
277318   ROM_LOAD( "clr2.bin", 0x20, 0x20, CRC(2b5c7826) SHA1(c0de392aebd6982e5846c12aeb2e871358be60d7) )
278319ROM_END
279320
321ROM_START( rcasino )
322   ROM_REGION( 0x10000, "maincpu", 0 )
323   ROM_LOAD( "ri-w1.18b", 0x0000, 0x2000, CRC(ed105d69) SHA1(951697e1050f72967f0710155aa8ff72db73fce1) )
324   ROM_LOAD( "ri-w2.16b", 0x2000, 0x2000, CRC(a1a80b33) SHA1(2f969713cae288de1985d7baa70cad50c4148970) )
325   ROM_LOAD( "ri-w3.15b", 0x4000, 0x1000, CRC(acf77a36) SHA1(599470e461a261130e942d174051648459f37a37) )
280326
281GAME( 1985, caswin, 0, vvillage, vvillage, 0, ROT270, "Aristocrat",  "Casino Winner", GAME_IMPERFECT_GRAPHICS )
327   ROM_REGION( 0x6000, "gfx1", 0 )
328   ROM_LOAD( "ri-w6.8b",  0x0000, 0x2000, CRC(b2dd4e1e) SHA1(323dcfb26653c17951db65ce2ced3325d35489e4) )
329   ROM_LOAD( "ri-w7.6b",  0x2000, 0x1000, CRC(8e0d3b9c) SHA1(c5211d834b0db488839a5c53d00435a0b59cd4ca) )
330   ROM_LOAD( "ri-w5.9b",  0x3000, 0x2000, CRC(81d20577) SHA1(50a1e0231400c106539ffa78deb3e0e6c8afc3f5) )
331   ROM_LOAD( "ri-w4.11b", 0x5000, 0x1000, CRC(7ca0e78c) SHA1(163cfd1f76ecbd14219146963d1abc4c09c0ac8c) )
332
333   ROM_REGION( 0x40, "proms", 0 )
334   ROM_LOAD( "prom1.9e",  0x0000, 0x0020, CRC(93312432) SHA1(3c7abc165e6bc7e0c56ca97d89b0b5e06323b82e) )
335   ROM_LOAD( "prom2.8e",  0x0020, 0x0020, CRC(2b5c7826) SHA1(c0de392aebd6982e5846c12aeb2e871358be60d7) )
336ROM_END
337
338GAME( 1984, rcasino, 0,        vvillage, vvillage, 0, ROT270, "Dyna Electronics", "Royal Casino", GAME_IMPERFECT_GRAPHICS )
339GAME( 1985, caswin,  rcasino,  vvillage, vvillage, 0, ROT270, "Aristocrat",  "Casino Winner", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/meritm.c
r4425r4426
13391339
13401340ROM_START( megat6 ) /* Dallas DS1204V security key at U5 labeled 9255-80 U5-B-RO1 C1998 MII */
13411341   ROM_REGION( 0x400000, "maincpu", 0 )
1342   ROM_LOAD( "9255-60-01_u32-r0",  0x000000, 0x100000, CRC(f8f7f48e) SHA1(1bebe1f8898c60b795a0f794ca9b79e03d2744e4) ) /* Location U32 */
1342   ROM_LOAD( "9255-80-01_u32-r0",  0x000000, 0x100000, CRC(f8f7f48e) SHA1(1bebe1f8898c60b795a0f794ca9b79e03d2744e4) ) /* Location U32 */
13431343   ROM_LOAD( "qs9255-08_u36-r0",   0x100000, 0x080000, CRC(800f5a1f) SHA1(4d3ee6fb896d6452aab1f279a3ee878284bd1acc) ) /* Location U36 */
13441344   ROM_RELOAD(                     0x180000, 0x080000 )
13451345   ROM_LOAD( "qs9255-08_u37-r0",   0x200000, 0x100000, CRC(5ba01949) SHA1(1598949ea18d07bbc78af0ddd279a687173c1229) ) /* Location U37 */
src/mame/drivers/namcos2.c
r4425r4426
49034903GAME( 1991, sgunnr2j, sgunner2, sgunner,  sgunner,  sgunner2, ROT0,   "Namco", "Steel Gunner 2 (Japan)", 0 )
49044904GAME( 1991, cosmogng, 0,        default,  default,  cosmogng, ROT90,  "Namco", "Cosmo Gang the Video (US)", 0 )
49054905GAME( 1991, cosmognj, cosmogng, default,  default,  cosmogng, ROT90,  "Namco", "Cosmo Gang the Video (Japan)", 0 )
4906GAME( 1992, bubbletr, 0,        gollygho, bubbletr, bubbletr, ROT180, "Namco", "Bubble Trouble",GAME_NOT_WORKING ) // incomplete dump
4906GAME( 1992, bubbletr, 0,        gollygho, bubbletr, bubbletr, ROT180, "Namco", "Bubble Trouble (Japan)",GAME_NOT_WORKING ) // incomplete dump
49074907GAMEL(1992, finalap3, 0,        finallap, finalap3, finalap3, ROT0,   "Namco", "Final Lap 3 (World)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS, layout_finallap  )
49084908GAMEL(1992, finalp3j, finalap3, finallap, finalap3, finalap3, ROT0,   "Namco", "Final Lap 3 (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS, layout_finallap  )
49094909GAME( 1992, luckywld, 0,        luckywld, luckywld, luckywld, ROT0,   "Namco", "Lucky & Wild", 0 )
src/mame/drivers/tx1.c
r4425r4426
1414
1515    Notes:
1616        * TX-1 tyre screech noises are not implemented yet.
17        * 'buggyboy' set is using ROMs from 'buggybjr' for testing purposes
18        until the original set can be dumped.
1917
2018****************************************************************************
2119
r4425r4426
4341#include "driver.h"
4442#include "cpu/z80/z80.h"
4543#include "cpu/i86/i86.h"
44#include "machine/8255ppi.h"
4645#include "sound/ay8910.h"
4746#include "rendlay.h"
4847#include "tx1.h"
r4425r4426
702701 *************************************/
703702
704703static MACHINE_DRIVER_START( tx1 )
705   MDRV_CPU_ADD("maincpu", I8086, CPU_MASTER_CLOCK / 3)
704   MDRV_CPU_ADD("main_cpu", I8086, CPU_MASTER_CLOCK / 3)
706705   MDRV_CPU_PROGRAM_MAP(tx1_main, 0)
707706//  MDRV_WATCHDOG_TIME_INIT(5)
708707
709   MDRV_CPU_ADD("math", I8086, CPU_MASTER_CLOCK / 3)
708   MDRV_CPU_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3)
710709   MDRV_CPU_PROGRAM_MAP(tx1_math, 0)
711710
712   MDRV_CPU_ADD("audiocpu", Z80, TX1_PIXEL_CLOCK / 2)
711   MDRV_CPU_ADD("audio_cpu", Z80, TX1_PIXEL_CLOCK / 2)
713712   MDRV_CPU_PROGRAM_MAP(tx1_sound_prg, 0)
714713   MDRV_CPU_IO_MAP(tx1_sound_io, 0)
715714   MDRV_CPU_PERIODIC_INT(irq0_line_hold, TX1_PIXEL_CLOCK / 4 / 2048 / 2)
716715
717716   MDRV_MACHINE_RESET(tx1)
718   MDRV_MACHINE_START(tx1)
719717   MDRV_NVRAM_HANDLER(generic_0fill)
720718
721719   MDRV_PPI8255_ADD("ppi8255", tx1_ppi8255_intf)
r4425r4426
756754
757755
758756static MACHINE_DRIVER_START( buggyboy )
759   MDRV_CPU_ADD("maincpu", I8086, CPU_MASTER_CLOCK / 3)
757   MDRV_CPU_ADD("main_cpu", I8086, CPU_MASTER_CLOCK / 3)
760758   MDRV_CPU_PROGRAM_MAP(buggyboy_main, 0)
761759//  MDRV_WATCHDOG_TIME_INIT(5)
762760
763   MDRV_CPU_ADD("math", I8086, CPU_MASTER_CLOCK / 3)
761   MDRV_CPU_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3)
764762   MDRV_CPU_PROGRAM_MAP(buggyboy_math, 0)
765763
766   MDRV_CPU_ADD("audiocpu", Z80, BUGGYBOY_ZCLK / 2)
764   MDRV_CPU_ADD("audio_cpu", Z80, BUGGYBOY_ZCLK / 2)
767765   MDRV_CPU_PROGRAM_MAP(buggyboy_sound_prg, 0)
768766   MDRV_CPU_PERIODIC_INT(z80_irq, BUGGYBOY_ZCLK / 2 / 4 / 2048)
769767   MDRV_CPU_IO_MAP(buggyboy_sound_io, 0)
770768
771769   MDRV_MACHINE_RESET(buggyboy)
772   MDRV_MACHINE_START(buggyboy)
773770   MDRV_NVRAM_HANDLER(generic_0fill)
774771
775772   MDRV_PPI8255_ADD("ppi8255", buggyboy_ppi8255_intf)
r4425r4426
792789   MDRV_PALETTE_INIT(buggyboy)
793790   MDRV_VIDEO_START(buggyboy)
794791   MDRV_VIDEO_UPDATE(buggyboy)
792   MDRV_VIDEO_EOF(buggyboy)
795793
796794   MDRV_SPEAKER_STANDARD_STEREO("frontleft", "frontright")
797795//  MDRV_SPEAKER_STANDARD_STEREO("rearleft", "rearright")
r4425r4426
811809
812810
813811static MACHINE_DRIVER_START( buggybjr )
814   MDRV_CPU_ADD("maincpu", I8086, CPU_MASTER_CLOCK / 3)
812   MDRV_CPU_ADD("main_cpu", I8086, CPU_MASTER_CLOCK / 3)
815813   MDRV_CPU_PROGRAM_MAP(buggybjr_main, 0)
816814//  MDRV_WATCHDOG_TIME_INIT(5)
817815
818   MDRV_CPU_ADD("math", I8086, CPU_MASTER_CLOCK / 3)
816   MDRV_CPU_ADD("math_cpu", I8086, CPU_MASTER_CLOCK / 3)
819817   MDRV_CPU_PROGRAM_MAP(buggyboy_math, 0)
820818
821   MDRV_CPU_ADD("audiocpu", Z80, BUGGYBOY_ZCLK / 2)
819   MDRV_CPU_ADD("audio_cpu", Z80, BUGGYBOY_ZCLK / 2)
822820   MDRV_CPU_PROGRAM_MAP(buggybjr_sound_prg, 0)
823821   MDRV_CPU_IO_MAP(buggyboy_sound_io, 0)
824822   MDRV_CPU_PERIODIC_INT(z80_irq, BUGGYBOY_ZCLK / 2 / 4 / 2048)
825823
826824   MDRV_MACHINE_RESET(buggybjr)
827   MDRV_MACHINE_START(buggybjr)
828825   MDRV_NVRAM_HANDLER(generic_0fill)
829826
830827   MDRV_SCREEN_ADD("screen", RASTER)
831828   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
832#if 0
829
833830   MDRV_SCREEN_RAW_PARAMS(BB_PIXEL_CLOCK, BB_HTOTAL, BB_HBEND, BB_HBSTART, BB_VTOTAL, BB_VBEND, BB_VBSTART)
834#else
835   MDRV_SCREEN_REFRESH_RATE(54.10)
836   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3072))
837   MDRV_SCREEN_SIZE(256, 256)
838   MDRV_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
839#endif
840831
841832   MDRV_PALETTE_LENGTH(256)
842833   MDRV_PALETTE_INIT(buggyboy)
r4425r4426
868859 *************************************/
869860
870861ROM_START( tx1 )
871   ROM_REGION( 0x100000, "maincpu", 0 )
862   ROM_REGION( 0x100000, "main_cpu", 0 )
872863   ROM_LOAD16_BYTE( "tx1_1c.ic22", 0xf0000, 0x4000, CRC(eedcee83) SHA1(7fa0590b142fb13c6562126a9bdd5a1e032880c7) )
873864   ROM_LOAD16_BYTE( "tx1_2c.ic29", 0xf0001, 0x4000, CRC(294bf5bf) SHA1(02b425caba8a187c58211bab27988205eb044558) )
874865   ROM_LOAD16_BYTE( "tx1_4c.ic54", 0xf8001, 0x4000, CRC(15bb8ef2) SHA1(83968f010ec555fcd0548a80562fb23a892b5afb) )
875866   ROM_LOAD16_BYTE( "tx1_3c.ic45", 0xf8000, 0x4000, CRC(21a8aa55) SHA1(21bc4adefb22a95fcd7a4e305bf0b05e2cb34129) )
876867
877   ROM_REGION( 0x100000, "math", 0 )
868   ROM_REGION( 0x100000, "math_cpu", 0 )
878869   ROM_LOAD16_BYTE( "tx1_9c.ic146", 0xfc000, 0x2000, CRC(b65eeea2) SHA1(b5f26e17520c598132b93c5cd7af7ebd03b10012) )
879870   ROM_RELOAD(                  0x4000, 0x2000 )
880871   ROM_RELOAD(                  0x8000, 0x2000 )
r4425r4426
884875   ROM_RELOAD(                  0x8001, 0x2000 )
885876   ROM_RELOAD(                  0xc001, 0x2000 )
886877
887   /* Sound */
888   ROM_REGION( 0x10000, "audiocpu", 0 )
878   ROM_REGION( 0x10000, "audio_cpu", 0 )
889879   ROM_LOAD( "8411-136027-157.11", 0x00000, 0x2000, CRC(10ae3075) SHA1(69c5f62f2473aba848383eed3cecf15e273d86ca) )
890880
891   /* 8x8 characters */
892   ROM_REGION( 0x20000, "gfx1", 0 )
881   ROM_REGION( 0x20000, "char_tiles", 0 )
893882   ROM_LOAD( "tx1_21a.ic204", 0x0000, 0x4000, CRC(cd3441ad) SHA1(8e6597b3177b8aaa34ed3373d85fc4b6231e1333) )
894883   ROM_LOAD( "tx1_20a.ic174", 0x4000, 0x4000, CRC(dbe595fc) SHA1(1ed2f775f0a1b46a2ffbc056eb4ef732ed546d3c) )
895884
896   /* 8x8 object chunks */
897   ROM_REGION( 0x40000, "gfx2", 0 )
885   ROM_REGION( 0x40000, "obj_tiles", 0 )
898886   ROM_LOAD( "tx1_16b.ic203", 0x0000, 0x4000, CRC(1141c965) SHA1(4b90c1428bcbd72d0449c064856a5596269b3fc6) )
899887   ROM_LOAD( "tx1_18b.ic258", 0x4000, 0x4000, NO_DUMP )
900888   ROM_LOAD( "tx1_15b.ic173", 0x8000, 0x4000, CRC(30d1a8d5) SHA1(b4c585b7b8a8920bb3949d643e9e10c17d4009a0) )
901889   ROM_LOAD( "tx1_17b.ic232", 0xc000, 0x4000, CRC(364bb354) SHA1(a26581ca1088b979285471e2c6595048df84d75e) )
902890
903   /* Road LUTs */
904891   ROM_REGION( 0x40000, "gfx3", 0 )
905892   ROM_LOAD( "tx1_5a.ic56", 0x0000, 0x2000, CRC(5635b8c1) SHA1(5cc9437a2ff0843f1917f2451852d4561c240b24) )
906893   ROM_LOAD( "tx1_6a.ic66", 0x2000, 0x2000, CRC(03d83cf8) SHA1(5c0cfc6bf02ad2b3f37e1ceb493f69eb9829ab1e) )
907894   ROM_LOAD( "tx1_7a.ic76", 0x4000, 0x2000, CRC(ad56013a) SHA1(ae3a91f58f30daff334754476db33ad1d12569fc) )
908895
909   /* Arithmetic Unit Function Data ROMs */
910   ROM_REGION( 0x10000, "user1", ROMREGION_LE )
896   ROM_REGION( 0x10000, "au_data", ROMREGION_LE )
911897   ROM_LOAD16_BYTE( "tx1_10b.ic184", 0x0000, 0x4000, CRC(acf754e8) SHA1(06779e18636f0799efdaa09396e9ccd59f426257) )
912898   ROM_LOAD16_BYTE( "tx1_11b.ic185", 0x0001, 0x4000, CRC(f89d3e20) SHA1(4b4cf679b7e3d63cded9989d2b667941f718ff57) )
913   ROM_LOAD16_BYTE( "xb02b.ic223", 0x8000, 0x200, CRC(22c77af6) SHA1(1be8585b95316b4fc5712cdaef699e676320cd4d) )
914   ROM_LOAD16_BYTE( "xb01b.ic213", 0x8001, 0x200, CRC(f6b8b70b) SHA1(b79374acf11d71db1e4ad3c494ac5f500a52677b) )
899   ROM_LOAD16_BYTE( "xb02b.ic223",   0x8000, 0x0200, CRC(22c77af6) SHA1(1be8585b95316b4fc5712cdaef699e676320cd4d) )
900   ROM_LOAD16_BYTE( "xb01b.ic213",   0x8001, 0x0200, CRC(f6b8b70b) SHA1(b79374acf11d71db1e4ad3c494ac5f500a52677b) )
915901
916   /* Object chunk sequence LUT */
917   ROM_REGION( 0x50000, "user2", 0 )
902   ROM_REGION( 0x50000, "obj_map", 0 )
918903   ROM_LOAD( "tx1_14b.ic106", 0x0000, 0x4000, CRC(68c63d6e) SHA1(110e02b99c44d31041be588bd14642e26890ecbd) )
919   ROM_LOAD( "tx1_13b.ic73", 0x4000, 0x4000, CRC(b0c581b2) SHA1(20926bc15e7c97045b219b828acfcdd99b8712a6) )
904   ROM_LOAD( "tx1_13b.ic73", 0x4000, 0x4000, CRC(b0c581b2) SHA1(20926bc15e7c97045b219b828acfcdd99b8712a6) )
920905
921   /* Object LUT */
922   /* Object palette LUT */
923906   ROM_REGION( 0x50000, "user3", 0 )
924   ROM_LOAD( "tx1_12b.ic48", 0x0000, 0x2000, CRC(4b3d7956) SHA1(fc2432dd69f3be7007d4fd6f7c86c7c19453b1ba) )
907   ROM_LOAD( "tx1_12b.ic48", 0x0000, 0x2000, CRC(4b3d7956) SHA1(fc2432dd69f3be7007d4fd6f7c86c7c19453b1ba) )
925908   ROM_LOAD( "tx1_19b.ic281", 0x2000, 0x4000, NO_DUMP )
926909
927910   ROM_REGION( 0x10000, "proms", 0 )
r4425r4426
963946
964947/* Some PROMs haven't been confirmed to be the same as the Tatsumi set (but are very likely identical) */
965948ROM_START( tx1a )
966   ROM_REGION( 0x100000, "maincpu", 0 )
949   ROM_REGION( 0x100000, "main_cpu", 0 )
967950   ROM_LOAD16_BYTE( "8412-136027-244.22", 0xf0000, 0x4000, CRC(2e9cefa2) SHA1(4ca04eae446e8df08ab793488a79217ed1a27875) )
968951   ROM_LOAD16_BYTE( "8412-136027-245.29", 0xf0001, 0x4000, CRC(ade7895c) SHA1(1c33a574cae46fddb4cadb85f5de17f02ae7a596) )
969952   ROM_LOAD16_BYTE( "8412-136027-250.54", 0xf8001, 0x4000, CRC(c8c9368f) SHA1(0972d54d506216eb2b204cf22ccdff9210fb7b10) )
970953   ROM_LOAD16_BYTE( "8412-136027-249.45", 0xf8000, 0x4000, CRC(9bcb82db) SHA1(d1528c9b9c4c2848bdba15e4632927476d544f40))
971954
972   ROM_REGION( 0x100000, "math", 0 )
955   ROM_REGION( 0x100000, "math_cpu", 0 )
973956   ROM_LOAD16_BYTE( "8411-136027-152.146", 0xfc000, 0x2000, CRC(b65eeea2) SHA1(b5f26e17520c598132b93c5cd7af7ebd03b10012) )
974957   ROM_RELOAD(                  0x4000, 0x2000 )
975958   ROM_RELOAD(                  0x8000, 0x2000 )
r4425r4426
979962   ROM_RELOAD(                  0x8001, 0x2000 )
980963   ROM_RELOAD(                  0xc001, 0x2000 )
981964
982   /* Sound */
983   ROM_REGION( 0x10000, "audiocpu", 0 )
965   ROM_REGION( 0x10000, "audio_cpu", 0 )
984966   ROM_LOAD( "8411-136027-157.11", 0x00000, 0x2000, CRC(10ae3075) SHA1(69c5f62f2473aba848383eed3cecf15e273d86ca) )
985967
986   /* 8x8 characters */
987   ROM_REGION( 0x20000, "gfx1", 0 )
968   ROM_REGION( 0x20000, "char_tiles", 0 )
988969   ROM_LOAD( "8411-136027-156.204", 0x0000, 0x4000, CRC(60f3c616) SHA1(59c4361891e4274e27e6279c919e8fd6803af7cf) )
989970   ROM_LOAD( "8411-136027-155.174", 0x4000, 0x4000, CRC(e59a6b72) SHA1(c10efa77ab421ac60b97227a8d547f50f8415670) )
990971
991   /* 8x8 object chunks */
992   ROM_REGION( 0x40000, "gfx2", 0 )
972   ROM_REGION( 0x40000, "obj_tiles", 0 )
993973   ROM_LOAD( "8411-136027-114.203", 0x0000, 0x4000, CRC(fc91328b) SHA1(e57fd2056b65d37cf2e1f0af56616c6555df3006) )
994974   ROM_LOAD( "8411-136027-116.258", 0x4000, 0x4000, CRC(5745f671) SHA1(6e471633cd6de9926b3361a84430c088e1f6a097) )
995975   ROM_LOAD( "8411-136027-115.173", 0x8000, 0x4000, CRC(720e5873) SHA1(151d9063c35b26f5876cf94bdf0c2665ec701bbd) )
996976   ROM_LOAD( "8411-136027-117.232", 0xc000, 0x4000, CRC(3c68d0bc) SHA1(2dbaf2a268b90214fd61c016ac945d4371057826) )
997977
998   /* Road LUTs */
999978   ROM_REGION( 0x40000, "gfx3", 0 )
1000979   ROM_LOAD( "8411-136027-146.56", 0x0000, 0x2000, CRC(5635b8c1) SHA1(5cc9437a2ff0843f1917f2451852d4561c240b24) )
1001980   ROM_LOAD( "8411-136027-147.66", 0x2000, 0x2000, CRC(03d83cf8) SHA1(5c0cfc6bf02ad2b3f37e1ceb493f69eb9829ab1e) )
1002981   ROM_LOAD( "8411-136027-148.76", 0x4000, 0x2000, CRC(ad56013a) SHA1(ae3a91f58f30daff334754476db33ad1d12569fc) )
1003982
1004   /* Arithmetic Unit Function Data ROMs */
1005   ROM_REGION( 0x10000, "user1", ROMREGION_LE )
983   ROM_REGION( 0x10000, "au_data", ROMREGION_LE )
1006984   ROM_LOAD16_BYTE( "8411-136027-153.184", 0x0000, 0x4000, CRC(acf754e8) SHA1(06779e18636f0799efdaa09396e9ccd59f426257) )
1007985   ROM_LOAD16_BYTE( "8411-136027-154.185", 0x0001, 0x4000, CRC(f89d3e20) SHA1(4b4cf679b7e3d63cded9989d2b667941f718ff57) )
1008   ROM_LOAD16_BYTE( "xb02b.ic223", 0x8000, 0x200, CRC(22c77af6) SHA1(1be8585b95316b4fc5712cdaef699e676320cd4d) )
1009   ROM_LOAD16_BYTE( "xb01b.ic213", 0x8001, 0x200, CRC(f6b8b70b) SHA1(b79374acf11d71db1e4ad3c494ac5f500a52677b) )
986   ROM_LOAD16_BYTE( "xb02b.ic223",         0x8000, 0x0200, CRC(22c77af6) SHA1(1be8585b95316b4fc5712cdaef699e676320cd4d) )
987   ROM_LOAD16_BYTE( "xb01b.ic213",         0x8001, 0x0200, CRC(f6b8b70b) SHA1(b79374acf11d71db1e4ad3c494ac5f500a52677b) )
1010988
1011   /* Object chunk sequence LUTs */
1012   ROM_REGION( 0x50000, "user2", 0 )
989   ROM_REGION( 0x50000, "obj_map", 0 )
1013990   ROM_LOAD( "8411-136027-119.106", 0x0000, 0x4000, CRC(88eec0fb) SHA1(81d7a69dc1a4b3b81d7f28d97a3f80697cdcc6eb) )
1014991   ROM_LOAD( "8411-136027-120.73",  0x4000, 0x4000, CRC(407cbe65) SHA1(e1c11b65f3c6abde6d55afeaffdb39cdd6d66377) )
1015992
1016   /* Object code and palette LUTs */
1017993   ROM_REGION( 0x50000, "user3", 0 )
1018994   ROM_LOAD( "8411-136027-113.48",  0x0000, 0x2000, CRC(4b3d7956) SHA1(fc2432dd69f3be7007d4fd6f7c86c7c19453b1ba) )
1019995   ROM_LOAD( "8411-136027-118.281", 0x2000, 0x4000, CRC(de418dc7) SHA1(1233e2f7499ec5a73a40ee336d3fe26c06187784) )
r4425r4426
10551031   ROM_LOAD( "xb12.ic50",  0x1700, 0x200, CRC(6b424cea) SHA1(83127326c20116b0a4be1126e163f9c6755e19dc) )
10561032ROM_END
10571033
1058/*
1059    Buggy Boy Junior/Speed Buggy (Upright)
1034ROM_START( buggyboy )
1035   ROM_REGION( 0x100000, "main_cpu", 0 )
1036   ROM_LOAD16_BYTE( "bug1a.230", 0x20000, 0x8000, CRC(92797c25) SHA1(8f7434abbd7f557d3202abb01b1e4899c82c67a5) )
1037   ROM_LOAD16_BYTE( "bug4a.173", 0x20001, 0x8000, CRC(40ce3930) SHA1(4bf62ebeea1549a13a21a32cb860717f064b186a) )
10601038
1061    The single monitor is the parent set at the moment, as the 3-monitor is incomplete
1039   ROM_LOAD16_BYTE( "bug2d.231", 0xf0000, 0x4000, CRC(f67bd593) SHA1(b6e3f9d5534b0addbba4aa4c813dda21a27cafa2) )
1040   ROM_LOAD16_BYTE( "bug5d.174", 0xf0001, 0x4000, CRC(d0dd6ffc) SHA1(377581ace86ea0f713aa7dc8f96f27cbcda1b2ea) )
10621041
1063    The game is comprised of three boards.
1064        - Sound Board (labeled TC043-1, top small board)
1065        - CPU Board (labeled TC041, middle board, uses 15.000 MHz xtal)
1066        - Video Board (labeled TC042, bottom board, uses 18.000 MHz xtal)
1067*/
1042   ROM_LOAD16_BYTE( "bug3b.232", 0xf8000, 0x4000, CRC(43cce3f0) SHA1(17de3728d809d386f6a7a330c8c8701975d4ebed) )
1043   ROM_LOAD16_BYTE( "bug6b.175", 0xf8001, 0x4000, CRC(8f000dfa) SHA1(5fd78a03a00f547bbb431839f78a8d10a4ba8e3e) )
10681044
1045   ROM_REGION( 0x100000, "math_cpu", 0 )
1046   ROM_LOAD16_BYTE( "bug8a.061", 0x4000, 0x2000, CRC(512291cd) SHA1(60f87133c86b88b982ba4680f96d0ac55970cb8d) )
1047   ROM_RELOAD(                  0x8000,  0x2000 )
1048   ROM_RELOAD(                  0xc000,  0x2000 )
1049   ROM_RELOAD(                  0xfc000, 0x2000 )
1050
1051   ROM_LOAD16_BYTE( "bug7a.060", 0x4001, 0x2000, CRC(d24dfdef) SHA1(37d05a8bf9567380523df01265afb9780e39ea2a) )
1052   ROM_RELOAD(                  0x8001,  0x2000 )
1053   ROM_RELOAD(                  0xc001,  0x2000 )
1054   ROM_RELOAD(                  0xfc001, 0x2000 )
1055
1056   ROM_REGION( 0x10000, "audio_cpu", 0 )
1057   ROM_LOAD( "bug35.11", 0x00000, 0x4000,  CRC(7aa16e9e) SHA1(ea54e56270f70351a62a78fa32027bb41ef9861e) )
1058
1059   ROM_REGION( 0x8000, "char_tiles", 0 )
1060   ROM_LOAD( "bug34a",     0x00000, 0x4000, CRC(8c64eb3c) SHA1(e0846f9a4811a0b6561d7a9aa7d50c23ced8d1d3) )
1061   ROM_LOAD( "bug33a.168", 0x04000, 0x4000, CRC(b500d683) SHA1(c9f92930c815a947fbd9a3846fd9580671da324f) )
1062
1063   ROM_REGION( 0x40000, "obj_tiles", 0 )
1064   ROM_LOAD( "bug26.275", 0x00000, 0x4000, CRC(fc6fce64) SHA1(4cea5796c26980455bdc0f8fcdb8e719caa8041f) )
1065   ROM_LOAD( "bug27.245", 0x04000, 0x4000, CRC(54b9a9dd) SHA1(4f4f29a459991501013cdfffd34b50eed1cde850) )
1066   ROM_LOAD( "bug19.274", 0x08000, 0x4000, CRC(3392c2ef) SHA1(a4aa4f24517da16495be073aa590cda81d9fca49) )
1067   ROM_LOAD( "bug20.244", 0x0c000, 0x4000, CRC(9ee4c236) SHA1(51155193e470a82deb5e3f1979ce112ada39b705) )
1068
1069   ROM_LOAD( "bug28.243", 0x10000, 0x4000, CRC(feef6c27) SHA1(61679d67a6ef85965078e3ddd11c178a1a55f223) )
1070   ROM_LOAD( "bug29.212", 0x14000, 0x4000, CRC(f570e00b) SHA1(ced4b9a4a324a4c92c08e088fa116469b2878f55) )
1071   ROM_LOAD( "bug21.242", 0x18000, 0x4000, CRC(088fef40) SHA1(a0c866c32857690915a33b0810219fb3cbf24f24) )
1072   ROM_LOAD( "bug22.211", 0x1c000, 0x4000, CRC(5ec02630) SHA1(75233de03461016d1bc7c4ece0502e16e53c3351) )
1073
1074   ROM_LOAD( "bug30.186", 0x20000, 0x4000, CRC(5c2ecabf) SHA1(5be25ddc1e2aac4579a39e405f8eac919f4917bd) )
1075   ROM_RELOAD(            0x34000, 0x4000 )
1076   ROM_LOAD( "bug32.158", 0x24000, 0x4000, CRC(125461f2) SHA1(9dd94344cfc7a17670d6f512ecd5947f198154c0) )
1077   ROM_RELOAD(            0x30000, 0x4000 )
1078   ROM_LOAD( "bug23.185", 0x28000, 0x4000, CRC(cafb4d4a) SHA1(aa24becdf354abca507dbd77fa18d05bea685285) )
1079   ROM_RELOAD(            0x3c000, 0x4000 )
1080   ROM_LOAD( "bug25.157", 0x2c000, 0x4000, CRC(80c4e045) SHA1(be3b537d3ed3ee74fc51059aa744dca4d63431f6) )
1081   ROM_RELOAD(            0x38000, 0x4000 )
1082
1083   ROM_REGION( 0x40000, "road", 0 )
1084   ROM_LOAD( "bug12.58", 0x0000, 0x2000, CRC(bd34d55c) SHA1(05a719a6eff5af3aaaa1e0ee783b18597582ed64) )
1085   ROM_LOAD( "bug11.57", 0x2000, 0x2000, CRC(a44d43eb) SHA1(c4d68c7e123506acaa6adc353579cac19ecb3a9d) )
1086   ROM_LOAD( "bb3.137",  0x4000, 0x0200, CRC(ad76f3fb) SHA1(bf96f903b32e009a2592df0f28cc3e20b039f4d4) )
1087   ROM_LOAD( "bb4.138",  0x4200, 0x0200, CRC(e4ca4ea0) SHA1(0c8dd6f87bddcc709de42e0c4a59be3c19c5aa8a) )
1088   ROM_LOAD( "bb5.139",  0x4400, 0x0200, CRC(e2577a9a) SHA1(6408f815a1357712473c54a8603137a58431781b) )
1089   ROM_LOAD( "bb6.94",   0x4600, 0x0200, CRC(ad43e02a) SHA1(c50a398020508f52ddf8d45881f211d17d096fa1) )
1090
1091   ROM_REGION( 0x10000, "au_data", ROMREGION_LE )
1092   ROM_LOAD16_BYTE( "bug9.170",  0x0000, 0x4000, CRC(7d84135b) SHA1(3c669c4e796e83672aceeb6de1aeea28f9f2fef0) )
1093   ROM_LOAD16_BYTE( "bug10.171", 0x0001, 0x4000, CRC(b518dd6f) SHA1(7cefa2f9438306c81dc83cd260928c835eb9b712) )
1094   ROM_LOAD16_BYTE( "bb1.245",   0x8000, 0x0200, CRC(0ddbd36d) SHA1(7a08901a350c315d46ab8d0aa881db384b9f37d2) )
1095   ROM_LOAD16_BYTE( "bb2.220",   0x8001, 0x0200, CRC(71d47de1) SHA1(2da9aeb3f2ebb1114631c8042a37c4f4c18e741b) )
1096
1097   ROM_REGION( 0x100000, "obj_map", 0 )
1098   ROM_LOAD( "bug16.210", 0x0000, 0x4000, CRC(8b64409e) SHA1(1fb4c6923e6a9e1f2a63a2c335b63e2bdc44b61f) )
1099   ROM_LOAD( "bug14.209", 0x4000, 0x4000, CRC(4e765282) SHA1(f7d69d39823a8b33bd0e5b1bd78a5d68a293e221) )
1100   ROM_LOAD( "bug17.182", 0x8000, 0x4000, CRC(a5d84df6) SHA1(4e33ef0bee383e0d47b0c679cd2a54edb7ca0e3e) )
1101   ROM_LOAD( "bug15.181", 0xc000, 0x4000, CRC(d519de10) SHA1(535d05e11af65be65f3d9924b0c48faf8dcfd1bf) )
1102
1103   ROM_REGION( 0x10000, "obj_luts", 0 )
1104   ROM_LOAD( "bug13.124", 0x0000, 0x2000, CRC(53604d7a) SHA1(bfa304cd885162ece7a5f54988d9880fc541eb3a) )
1105   ROM_LOAD( "bug18.156", 0x2000, 0x4000, CRC(e58321a6) SHA1(81be87d3c6046bb375c74362dc940f0269b39d1d) )
1106
1107   ROM_REGION( 0x10000, "proms", 0 )
1108   ROM_LOAD( "bb10.191", 0x000,  0x100, CRC(f2368398) SHA1(53f28dba11bb494d033bb279abf138975c84b20d) )
1109   ROM_LOAD( "bb11.192", 0x100,  0x100, CRC(bf77f624) SHA1(b042d293d2094dbabb32d628fd9addd832f084ef) )
1110   ROM_LOAD( "bb12.193", 0x200,  0x100, CRC(10a2e8d1) SHA1(51a8c51ecbbb7bd04ae46fb5598d2c8de8097581) )
1111   ROM_LOAD( "bb13.194", 0x300,  0x100, CRC(40d10dfa) SHA1(e40b4c424827937fec6df1a27b19b8dc09d3274a) )
1112
1113   ROM_LOAD( "bb10.104", 0x000,  0x100, CRC(f2368398) SHA1(53f28dba11bb494d033bb279abf138975c84b20d) )
1114   ROM_LOAD( "bb11.105", 0x100,  0x100, CRC(bf77f624) SHA1(b042d293d2094dbabb32d628fd9addd832f084ef) )
1115   ROM_LOAD( "bb12.106", 0x200,  0x100, CRC(10a2e8d1) SHA1(51a8c51ecbbb7bd04ae46fb5598d2c8de8097581) )
1116   ROM_LOAD( "bb13.107", 0x300,  0x100, CRC(40d10dfa) SHA1(e40b4c424827937fec6df1a27b19b8dc09d3274a) )
1117
1118   ROM_LOAD( "bb10.49",  0x000,  0x100, CRC(f2368398) SHA1(53f28dba11bb494d033bb279abf138975c84b20d) )
1119   ROM_LOAD( "bb11.50",  0x100,  0x100, CRC(bf77f624) SHA1(b042d293d2094dbabb32d628fd9addd832f084ef) )
1120   ROM_LOAD( "bb12.51",  0x200,  0x100, CRC(10a2e8d1) SHA1(51a8c51ecbbb7bd04ae46fb5598d2c8de8097581) )
1121   ROM_LOAD( "bb13.52",  0x300,  0x100, CRC(40d10dfa) SHA1(e40b4c424827937fec6df1a27b19b8dc09d3274a) )
1122
1123   ROM_LOAD( "bb14.199", 0x400,  0x100, CRC(0b821e0b) SHA1(b9401b9364fb99e15f562df91dcfdec1b989af2d) )
1124   ROM_LOAD( "bb14.197", 0x400,  0x100, CRC(0b821e0b) SHA1(b9401b9364fb99e15f562df91dcfdec1b989af2d) )
1125   ROM_LOAD( "bb14.137", 0x400,  0x100, CRC(0b821e0b) SHA1(b9401b9364fb99e15f562df91dcfdec1b989af2d) )
1126
1127   ROM_LOAD( "bb9.271",  0x500,  0x800, CRC(6fc807d1) SHA1(3442cbb21bbedf6291a3fe1747d479445f613d26) )
1128   ROM_LOAD( "bb9.238",  0xd00,  0x800, CRC(6fc807d1) SHA1(3442cbb21bbedf6291a3fe1747d479445f613d26) )
1129
1130   ROM_LOAD( "bb7.16",   0x1500, 0x100, CRC(b57b609f) SHA1(2dea375437c62cb4c64b21d5e6ddc09397b6ab35) )
1131   ROM_LOAD( "bb7.18",   0x1500, 0x100, CRC(b57b609f) SHA1(2dea375437c62cb4c64b21d5e6ddc09397b6ab35) )
1132   ROM_LOAD( "bb7.20",   0x1500, 0x100, CRC(b57b609f) SHA1(2dea375437c62cb4c64b21d5e6ddc09397b6ab35) )
1133
1134   ROM_LOAD( "bb8.152",  0x1600, 0x100, CRC(2330ff4f) SHA1(e86eb63ce47572bcbbf325f9bb749d10d96bf2e7) )
1135
1136   /* TODO: PALs */
1137ROM_END
1138
1139/*
1140    The game is comprised of three boards:
1141    - Sound Board (labeled TC043-1, top small board)
1142    - CPU Board (labeled TC041, middle board, uses 15.000 MHz xtal)
1143    - Video Board (labeled TC042, bottom board, uses 18.000 MHz xtal)
1144*/
10691145ROM_START( buggybjr )
1070   ROM_REGION( 0x100000, "maincpu", 0 )
1146   ROM_REGION( 0x100000, "main_cpu", 0 )
10711147   ROM_LOAD16_BYTE( "bug1a.214", 0x20000, 0x8000, CRC(92797c25) SHA1(8f7434abbd7f557d3202abb01b1e4899c82c67a5) )
10721148   ROM_LOAD16_BYTE( "bug4a.175", 0x20001, 0x8000, CRC(40ce3930) SHA1(4bf62ebeea1549a13a21a32cb860717f064b186a) )
10731149
10741150   ROM_LOAD16_BYTE( "bug2s.213", 0xf0000, 0x8000, CRC(abcc8ad2) SHA1(aeb695c3675d40a951fe8272cbf0f6673435dab8) )
10751151   ROM_LOAD16_BYTE( "bug5s.174", 0xf0001, 0x8000, CRC(5e352d8d) SHA1(350c206b5241d5628e673ce1108f728c8c4f980c) )
10761152
1077   ROM_REGION( 0x100000, "math", 0 )
1153   ROM_REGION( 0x100000, "math_cpu", 0 )
10781154   ROM_LOAD16_BYTE( "bug8s.26", 0x4000,  0x2000, CRC(efd66282) SHA1(8355422c0732c92951659930eb399129fe8d6230) )
10791155   ROM_RELOAD(                  0x8000,  0x2000 )
10801156   ROM_RELOAD(                  0xc000,  0x2000 )
r4425r4426
10851161   ROM_RELOAD(                  0xc001,  0x2000 )
10861162   ROM_RELOAD(                  0xfc001, 0x2000 )
10871163
1088    /* ROM's Located on the sound board */
1089   ROM_REGION( 0x10000, "audiocpu", 0 )
1164   ROM_REGION( 0x10000, "audio_cpu", 0 )
10901165   ROM_LOAD( "bug35s.21", 0x00000, 0x4000, CRC(65d9af57) SHA1(17b09404942d17e7254550c43b56ae96a8c55680) )
10911166
1092   /* 8x8 characters */
1093   ROM_REGION( 0x8000, "gfx1", 0 )
1167   ROM_REGION( 0x8000, "char_tiles", 0 )
10941168   ROM_LOAD( "bug34s.46", 0x00000, 0x4000, CRC(8ea8fec4) SHA1(75e67c9a59a86fcdedf2a70fafd303baa552aa18) )
10951169   ROM_LOAD( "bug33s.47", 0x04000, 0x4000, CRC(459c2b03) SHA1(ff62a86195042a349fbe799c638cf590fe9572bb) )
10961170
1097   /* 8x8 object chunks */
1098   ROM_REGION( 0x40000, "gfx2", 0 )
1171   ROM_REGION( 0x40000, "obj_tiles", 0 )
10991172   ROM_LOAD( "bug26s.147", 0x00000, 0x8000, CRC(14033710) SHA1(e05afeb557ce14055fa8b4f6d8805307feaa1660) )
11001173   ROM_LOAD( "bug19s.144", 0x08000, 0x8000, CRC(838e0697) SHA1(0e9aff2c4065d79350ddb55edff57a899c33ef1c) )
11011174   ROM_LOAD( "bug28s.146", 0x10000, 0x8000, CRC(8b47d227) SHA1(a3e57594ad0085e8b1bd327c580eb36237f3e3d2) )
r4425r4426
11031176   ROM_LOAD( "bug30s.145", 0x20000, 0x8000, CRC(11d8e2a8) SHA1(9bf198229a12d331e8e7352b7ee3f39f6891f517) )
11041177   ROM_LOAD( "bug23s.142", 0x28000, 0x8000, CRC(015db5d8) SHA1(39ef8b44f2eb9399fb1555cffa6763e06d59c181) )
11051178
1106   /* Road */
1107   ROM_REGION( 0x40000, "gfx6", 0 )
1108   ROM_LOAD( "bug11s.225", 0x0000, 0x4000, CRC(771af4e1) SHA1(a42b164dd0567c78c0d308ee48d63e5a284897bb) )
1109   ROM_LOAD( "bb3s", 0x4000, 0x200, CRC(2ab3d5ff) SHA1(9f8359cb4ba2e7d15dbb9dc21cd71c0902cd2153) )
1110   ROM_LOAD( "bb4s", 0x4200, 0x200, CRC(630f68a4) SHA1(d730f050353c688f81d090e33e00cd35e7b7b6fa) )
1111   ROM_LOAD( "bb5s", 0x4400, 0x200, CRC(65925c9e) SHA1(d1ff1cb9f83c09e52a96632945e4edfedc335fd4) )
1112   ROM_LOAD( "bb6.224", 0x4600, 0x200, CRC(ad43e02a) SHA1(c50a398020508f52ddf8d45881f211d17d096fa1) )
1179   ROM_REGION( 0x40000, "road", 0 )
1180   ROM_LOAD( "bug11s.225",0x0000, 0x4000, CRC(771af4e1) SHA1(a42b164dd0567c78c0d308ee48d63e5a284897bb) )
1181   ROM_LOAD( "bb3s.195",  0x4000, 0x0200, CRC(2ab3d5ff) SHA1(9f8359cb4ba2e7d15dbb9dc21cd71c0902cd2153) )
1182   ROM_LOAD( "bb4s.193",  0x4200, 0x0200, CRC(630f68a4) SHA1(d730f050353c688f81d090e33e00cd35e7b7b6fa) )
1183   ROM_LOAD( "bb5s.194",  0x4400, 0x0200, CRC(65925c9e) SHA1(d1ff1cb9f83c09e52a96632945e4edfedc335fd4) )
1184   ROM_LOAD( "bb6.224",   0x4600, 0x0200, CRC(ad43e02a) SHA1(c50a398020508f52ddf8d45881f211d17d096fa1) )
11131185
1114   /* Arithmetic Unit Function Data ROMs */
1115   ROM_REGION( 0x10000, "user1", ROMREGION_LE )
1186   ROM_REGION( 0x10000, "au_data", ROMREGION_LE )
11161187   ROM_LOAD16_BYTE( "bug9.138", 0x0000, 0x4000, CRC(7d84135b) SHA1(3c669c4e796e83672aceeb6de1aeea28f9f2fef0) )
11171188   ROM_LOAD16_BYTE( "bug10.95", 0x0001, 0x4000, CRC(b518dd6f) SHA1(7cefa2f9438306c81dc83cd260928c835eb9b712) )
11181189   ROM_LOAD16_BYTE( "bb1.163",  0x8000, 0x0200, CRC(0ddbd36d) SHA1(7a08901a350c315d46ab8d0aa881db384b9f37d2) )
11191190   ROM_LOAD16_BYTE( "bb2.162",  0x8001, 0x0200, CRC(71d47de1) SHA1(2da9aeb3f2ebb1114631c8042a37c4f4c18e741b) )
11201191
1121   /* Object chunk sequence LUT */
1122   ROM_REGION( 0x100000, "user2", 0 )
1192   ROM_REGION( 0x100000, "obj_map", 0 )
11231193   ROM_LOAD( "bug16s.139", 0x0000, 0x8000, CRC(1903a9ad) SHA1(526c404c15e3f04b4afb27dee66e9deb0a6b9704) )
11241194   ROM_LOAD( "bug17s.140", 0x8000, 0x8000, CRC(82cabdd4) SHA1(94324fcf83c373621fc40553473ae3cb552ab704) )
11251195
1126   /* Object LUT and palette LUT*/
1127   ROM_REGION( 0x10000, "user3", 0 )
1196   ROM_REGION( 0x10000, "obj_luts", 0 )
11281197   ROM_LOAD( "bug13.32",   0x0000, 0x2000, CRC(53604d7a) SHA1(bfa304cd885162ece7a5f54988d9880fc541eb3a) )
11291198   ROM_LOAD( "bug18s.141", 0x2000, 0x4000, CRC(67786327) SHA1(32cc1f5bc654497c968ddcd4af29720c6d659482) )
11301199
1131   /* PROMs located on the video board */
11321200   ROM_REGION( 0x10000, "proms", 0 )
11331201   /* RGBI */
11341202   ROM_LOAD( "bb10.41", 0x000, 0x100, CRC(f2368398) SHA1(53f28dba11bb494d033bb279abf138975c84b20d) )
r4425r4426
11721240ROM_END
11731241
11741242
1175ROM_START( buggyboy )
1176   ROM_REGION( 0x100000, "maincpu", 0 )
1177   ROM_LOAD16_BYTE( "bug1a.230", 0x20000, 0x8000, CRC(92797c25) SHA1(8f7434abbd7f557d3202abb01b1e4899c82c67a5) )
1178   ROM_LOAD16_BYTE( "bug4a.173", 0x20001, 0x8000, CRC(40ce3930) SHA1(4bf62ebeea1549a13a21a32cb860717f064b186a) )
1179
1180   ROM_LOAD16_BYTE( "bug2d.231", 0xf0000, 0x4000, CRC(f67bd593) SHA1(b6e3f9d5534b0addbba4aa4c813dda21a27cafa2) )
1181   ROM_LOAD16_BYTE( "bug5d.174", 0xf0001, 0x4000, CRC(d0dd6ffc) SHA1(377581ace86ea0f713aa7dc8f96f27cbcda1b2ea) )
1182
1183   ROM_LOAD16_BYTE( "bug3b.232", 0xf8000, 0x4000, CRC(43cce3f0) SHA1(17de3728d809d386f6a7a330c8c8701975d4ebed) )
1184   ROM_LOAD16_BYTE( "bug6b.175", 0xf8001, 0x4000, CRC(8f000dfa) SHA1(5fd78a03a00f547bbb431839f78a8d10a4ba8e3e) )
1185
1186   ROM_REGION( 0x100000, "math", 0 )
1187   ROM_LOAD16_BYTE( "bug8a.061", 0x4000, 0x2000, CRC(512291cd) SHA1(60f87133c86b88b982ba4680f96d0ac55970cb8d) )
1188   ROM_RELOAD(                  0x8000,  0x2000 )
1189   ROM_RELOAD(                  0xc000,  0x2000 )
1190   ROM_RELOAD(                  0xfc000, 0x2000 )
1191
1192   ROM_LOAD16_BYTE( "bug7a.060", 0x4001, 0x2000, CRC(d24dfdef) SHA1(37d05a8bf9567380523df01265afb9780e39ea2a) )
1193   ROM_RELOAD(                  0x8001,  0x2000 )
1194   ROM_RELOAD(                  0xc001,  0x2000 )
1195   ROM_RELOAD(                  0xfc001, 0x2000 )
1196
1197   ROM_REGION( 0x10000, "audiocpu", 0 )
1198   ROM_LOAD( "bug35.11", 0x00000, 0x4000,  CRC(7aa16e9e) SHA1(ea54e56270f70351a62a78fa32027bb41ef9861e) )
1199
1200   /* 8x8 characters */
1201   ROM_REGION( 0x8000, "gfx1", 0 )
1202   ROM_LOAD( "bug34s.46", 0x00000, 0x4000, CRC(8ea8fec4) SHA1(75e67c9a59a86fcdedf2a70fafd303baa552aa18) )
1203   ROM_LOAD( "bug33s.47", 0x04000, 0x4000, CRC(459c2b03) SHA1(ff62a86195042a349fbe799c638cf590fe9572bb) )
1204
1205   /* 8x8 object chunks */
1206   ROM_REGION( 0x40000, "gfx2", 0 )
1207   ROM_LOAD( "bug26s.147", 0x00000, 0x8000, CRC(14033710) SHA1(e05afeb557ce14055fa8b4f6d8805307feaa1660) )
1208   ROM_LOAD( "bug19s.144", 0x08000, 0x8000, CRC(838e0697) SHA1(0e9aff2c4065d79350ddb55edff57a899c33ef1c) )
1209   ROM_LOAD( "bug28s.146", 0x10000, 0x8000, CRC(8b47d227) SHA1(a3e57594ad0085e8b1bd327c580eb36237f3e3d2) )
1210   ROM_LOAD( "bug21s.143", 0x18000, 0x8000, CRC(876a5666) SHA1(db485cdf35f63c080c919ee86374f63e577092c3) )
1211   ROM_LOAD( "bug30s.145", 0x20000, 0x8000, CRC(11d8e2a8) SHA1(9bf198229a12d331e8e7352b7ee3f39f6891f517) )
1212   ROM_LOAD( "bug23s.142", 0x28000, 0x8000, CRC(015db5d8) SHA1(39ef8b44f2eb9399fb1555cffa6763e06d59c181) )
1213
1214   /* Road */
1215   ROM_REGION( 0x40000, "gfx6", 0 )
1216   ROM_LOAD( "bug11s.225", 0x0000, 0x4000, CRC(771af4e1) SHA1(a42b164dd0567c78c0d308ee48d63e5a284897bb) )
1217   ROM_LOAD( "bb3s", 0x4000, 0x200, CRC(2ab3d5ff) SHA1(9f8359cb4ba2e7d15dbb9dc21cd71c0902cd2153) )
1218   ROM_LOAD( "bb4s", 0x4200, 0x200, CRC(630f68a4) SHA1(d730f050353c688f81d090e33e00cd35e7b7b6fa) )
1219   ROM_LOAD( "bb5s", 0x4400, 0x200, CRC(65925c9e) SHA1(d1ff1cb9f83c09e52a96632945e4edfedc335fd4) )
1220   ROM_LOAD( "bb6.224", 0x4600, 0x200, CRC(ad43e02a) SHA1(c50a398020508f52ddf8d45881f211d17d096fa1) )
1221
1222   ROM_REGION( 0x10000, "user1", ROMREGION_LE )
1223   ROM_LOAD16_BYTE( "bug9.138", 0x0000, 0x4000, CRC(7d84135b) SHA1(3c669c4e796e83672aceeb6de1aeea28f9f2fef0) )
1224   ROM_LOAD16_BYTE( "bug10.95", 0x0001, 0x4000, CRC(b518dd6f) SHA1(7cefa2f9438306c81dc83cd260928c835eb9b712) )
1225   ROM_LOAD16_BYTE( "bb1.163",  0x8000, 0x0200, CRC(0ddbd36d) SHA1(7a08901a350c315d46ab8d0aa881db384b9f37d2) )
1226   ROM_LOAD16_BYTE( "bb2.162",  0x8001, 0x0200, CRC(71d47de1) SHA1(2da9aeb3f2ebb1114631c8042a37c4f4c18e741b) )
1227
1228   ROM_REGION( 0x100000, "user2", 0 )
1229   ROM_LOAD( "bug16s.139", 0x0000, 0x8000, CRC(1903a9ad) SHA1(526c404c15e3f04b4afb27dee66e9deb0a6b9704) )
1230   ROM_LOAD( "bug17s.140", 0x8000, 0x8000, CRC(82cabdd4) SHA1(94324fcf83c373621fc40553473ae3cb552ab704) )
1231
1232   ROM_REGION( 0x10000, "user3", 0 )
1233   ROM_LOAD( "bug13.32",   0x0000, 0x2000, CRC(53604d7a) SHA1(bfa304cd885162ece7a5f54988d9880fc541eb3a) )
1234   ROM_LOAD( "bug18s.141", 0x2000, 0x4000, CRC(67786327) SHA1(32cc1f5bc654497c968ddcd4af29720c6d659482) )
1235
1236   ROM_REGION( 0x10000, "proms", 0 )
1237   ROM_LOAD( "bb10.41", 0x000, 0x100, CRC(f2368398) SHA1(53f28dba11bb494d033bb279abf138975c84b20d) )
1238   ROM_LOAD( "bb11.40", 0x100, 0x100, CRC(bf77f624) SHA1(b042d293d2094dbabb32d628fd9addd832f084ef) )
1239   ROM_LOAD( "bb12.39", 0x200, 0x100, CRC(10a2e8d1) SHA1(51a8c51ecbbb7bd04ae46fb5598d2c8de8097581) )
1240   ROM_LOAD( "bb13.42", 0x300, 0x100, CRC(40d10dfa) SHA1(e40b4c424827937fec6df1a27b19b8dc09d3274a) )
1241   ROM_LOAD( "bb14.19", 0x400, 0x100, CRC(0b821e0b) SHA1(b9401b9364fb99e15f562df91dcfdec1b989af2d) )
1242
1243   ROM_LOAD( "bb9.190", 0x500, 0x800, CRC(6fc807d1) SHA1(3442cbb21bbedf6291a3fe1747d479445f613d26) )
1244   ROM_LOAD( "bb9.162", 0xd00, 0x800, CRC(6fc807d1) SHA1(3442cbb21bbedf6291a3fe1747d479445f613d26) )
1245   ROM_LOAD( "bb7.188", 0x1500,0x100, CRC(b57b609f) SHA1(2dea375437c62cb4c64b21d5e6ddc09397b6ab35) )
1246   ROM_LOAD( "bb8.31", 0x1600, 0x100, CRC(2330ff4f) SHA1(e86eb63ce47572bcbbf325f9bb749d10d96bf2e7) )
1247ROM_END
1248
1249
12501243/*************************************
12511244 *
12521245 *  Game driver(s)
r4425r4426
12551248
12561249GAMEL( 1983, tx1,      0,        tx1,      tx1,      0, ROT0, "Tatsumi", "TX-1",                                   GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND, layout_tx1 )
12571250GAMEL( 1983, tx1a,     tx1,      tx1,      tx1a,     0, ROT0, "Tatsumi", "TX-1 (Atari/Namco/Taito license)",       GAME_IMPERFECT_SOUND, layout_tx1 )
1258GAMEL( 1985, buggyboy, buggybjr, buggyboy, buggyboy, 0, ROT0, "Tatsumi", "Buggy Boy/Speed Buggy (Cockpit)",        GAME_NOT_WORKING, layout_buggyboy )
1259GAMEL( 1986, buggybjr, 0,        buggybjr, buggybjr, 0, ROT0, "Tatsumi", "Buggy Boy Junior/Speed Buggy (Upright)", 0, layout_buggybjr )
1251GAMEL( 1985, buggyboy, 0,        buggyboy, buggyboy, 0, ROT0, "Tatsumi", "Buggy Boy/Speed Buggy (cockpit)",        0, layout_buggyboy )
1252GAMEL( 1986, buggybjr, buggyboy, buggybjr, buggybjr, 0, ROT0, "Tatsumi", "Buggy Boy Junior/Speed Buggy (upright)", 0, layout_buggybjr )
src/mame/drivers/konamigv.c
r4425r4426
798798   ROM_REGION( 0x0000080, "user2", 0 ) /* default eeprom */
799799   ROM_LOAD( "susume.25c",   0x000000, 0x000080, CRC(52f17df7) SHA1(b8ad7787b0692713439d7d9bebfa0c801c806006) )
800800   DISK_REGION( "cdrom" )
801   DISK_IMAGE_READONLY( "gv027j1", 0, MD5(4443754686d399c3ad12349ac2565f94) SHA1(36676b7bd63e20ce6126280a3f7a3e3ea0a4b8c0) )
801   DISK_IMAGE_READONLY( "gv027j1", 0, SHA1(ad474c60ee68202324a31cc106f2054dc465f4b7) )
802802ROM_END
803803
804804ROM_START( hyperath )
r4425r4426
808808   ROM_LOAD( "hyperath.25c", 0x000000, 0x000080, CRC(20a8c435) SHA1(a0f203a999757fba68b391c525ac4b9684a57ba9) )
809809
810810   DISK_REGION( "cdrom" )
811   DISK_IMAGE_READONLY( "hyperath", 0, MD5(a777d62bc998768e53d3d764d96cd990) SHA1(dfe0a68258cf33ca09639a752611302b361698e8) )
811   DISK_IMAGE_READONLY( "hyperath", 0, SHA1(8638dcb27d53a30ea66c09349f6ff0b78910bf79) )
812812ROM_END
813813
814814ROM_START( pbball96 )
r4425r4426
818818   ROM_LOAD( "pbball96.25c", 0x000000, 0x000080, CRC(405a7fc9) SHA1(e2d978f49748ba3c4a425188abcd3d272ec23907) )
819819
820820   DISK_REGION( "cdrom" )
821   DISK_IMAGE_READONLY( "pbball96", 0, MD5(5962a38e2af6299659f53613956cd9ed) SHA1(a056138fc68bd1580b1de89b622b159150413a3f) )
821   DISK_IMAGE_READONLY( "pbball96", 0, SHA1(6d47624e86f97c0b8ea4ebb84cc5446aa4f11fcf) )
822822ROM_END
823823
824824ROM_START( weddingr )
r4425r4426
828828   ROM_LOAD( "weddingr.25c", 0x000000, 0x000080, CRC(b90509a0) SHA1(41510a0ceded81dcb26a70eba97636d38d3742c3) )
829829
830830   DISK_REGION( "cdrom" )
831   DISK_IMAGE_READONLY( "weddingr", 0, MD5(cacc28156b037e13098f3624ae92ab85) SHA1(e6481c367ad24aa285e51c01221a169b1b74b15f) )
831   DISK_IMAGE_READONLY( "weddingr", 0, SHA1(798686b410cb43b60d6ae91507d034db2db1b185) )
832832ROM_END
833833
834834ROM_START( simpbowl )
r4425r4426
838838   ROM_LOAD( "simpbowl.25c", 0x000000, 0x000080, CRC(2c61050c) SHA1(16ae7f81cbe841c429c5c7326cf83e87db1782bf) )
839839
840840   DISK_REGION( "cdrom" )
841   DISK_IMAGE_READONLY( "simpbowl", 0, MD5(47702fc060f3f1fbb2dba84ea3544a4a) SHA1(791ce11b0645fd5c3f5b30483bad879f26bb97db) )
841   DISK_IMAGE_READONLY( "simpbowl", 0, SHA1(476f100b6c420343e16a18575bbedf1f15fbd274) )
842842ROM_END
843843
844844ROM_START( btchamp )
r4425r4426
848848   ROM_LOAD( "btchmp.25c", 0x000000, 0x000080, CRC(6d02ea54) SHA1(d3babf481fd89db3aec17f589d0d3d999a2aa6e1) )
849849
850850   DISK_REGION( "cdrom" )
851   DISK_IMAGE_READONLY( "btchamp", 0, MD5(edc387207bc878b3a4044441e77d25f7) SHA1(e1a75a034d83cffa44268eb30653ba334cc6252d) )
851   DISK_IMAGE_READONLY( "btchamp", 0, SHA1(c9c858e9034826e1a12c3c003dd068a49a3577e1) )
852852ROM_END
853853
854854ROM_START( kdeadeye )
r4425r4426
858858   ROM_LOAD( "kdeadeye.25c", 0x000000, 0x000080, CRC(3935d2df) SHA1(cbb855c475269077803c380dbc3621e522efe51e) )
859859
860860   DISK_REGION( "cdrom" )
861   DISK_IMAGE_READONLY( "kdeadeye", 0, MD5(5109d61ab8791a6d622499b51e613a8c) SHA1(2b413a2a22e1959fb4f71b67ba51c6c8e0d58970) )
861   DISK_IMAGE_READONLY( "kdeadeye", 0, SHA1(55a86ad568069f3799125b47253d579793276fab) )
862862ROM_END
863863
864864ROM_START( nagano98 )
r4425r4426
868868   ROM_LOAD( "nagano98.25c",  0x000000, 0x000080, CRC(b64b7451) SHA1(a77a37e0cc580934d1e7e05d523bae0acd2c1480) )
869869
870870   DISK_REGION( "cdrom" )
871   DISK_IMAGE_READONLY( "nagano98", 0, MD5(cbedbd2953b70f214e72179b2cc0dcd8) SHA1(21d14864cdd34c6e052f3577f8d805dce49fcab6) )
871   DISK_IMAGE_READONLY( "nagano98", 0, SHA1(efe09a23dfbb957574b8989b5672af1ab5e27640) )
872872ROM_END
873873
874874ROM_START( tokimosh )
r4425r4426
878878        ROM_LOAD( "tokimosh.25c", 0x000000, 0x000080, CRC(e57b833f) SHA1(f18a0974a6be69dc179706643aab837ff61c2738) )
879879
880880   DISK_REGION( "cdrom" )
881   DISK_IMAGE_READONLY( "755jaa01", 0, MD5(221a0e871de10b50947c8fcd8820eafa) SHA1(d633937885b6f7c1615a9aa97f79cfc1f817c955) )
881   DISK_IMAGE_READONLY( "755jaa01", 0, SHA1(f7f1545658b430f60edccf448b2832dab9984b19) )
882882ROM_END
883883
884884ROM_START( tokimosp )
r4425r4426
888888   ROM_LOAD( "tokimosp.25c", 0x000000, 0x000080, CRC(af4cdd87) SHA1(97041e287e4c80066043967450779b81b62b2b8e) )
889889
890890   DISK_REGION( "cdrom" )
891   DISK_IMAGE_READONLY( "756jab01", 0, MD5(3c814208a8d9aafdb4989369f4222dba) SHA1(3766e0750484cd5d9da0c570aee4639300da5399) )
891   DISK_IMAGE_READONLY( "756jab01", 0, SHA1(ef76fc27e43f7e4cff16bf88458e7ee327c11ca3) )
892892ROM_END
893893
894894/* BIOS placeholder */
src/mame/drivers/ksys573.c
r4425r4426
30923092   ROM_FILL( 0x0000000, 0x1000000, 0xff )
30933093
30943094   DISK_REGION( "cdrom0" )
3095   DISK_IMAGE_READONLY( "765jaa02", 0, MD5(11693b1234458c238ed613ef37f71245) SHA1(d820f8166b7d5ffcf41e7a70c8c4c4d1c207c1bd) )
3095   DISK_IMAGE_READONLY( "765jaa02", 0, SHA1(4291711b1025733cb97f6da5dc3b03c189fcc37c) )
30963096ROM_END
30973097
30983098ROM_START( cr589fw )
r4425r4426
31033103   ROM_FILL( 0x0000000, 0x1000000, 0xff )
31043104
31053105   DISK_REGION( "cdrom0" )
3106   DISK_IMAGE_READONLY( "700b04", 0, MD5(4847e008189b7c700f2129ecb362b924) SHA1(13ac92eb242de48317924b9c725f9f693a263cf5) )
3106   DISK_IMAGE_READONLY( "700b04", 0, SHA1(2f65f62eb7ae202153a8544989675989ed33316f) )
31073107ROM_END
31083108
31093109ROM_START( cr589fwa )
r4425r4426
31143114   ROM_FILL( 0x0000000, 0x1000000, 0xff )
31153115
31163116   DISK_REGION( "cdrom0" )
3117   DISK_IMAGE_READONLY( "700a04", 0, MD5(211850ed73d05ccbf5951f1fe19a6767) SHA1(bf7865629775a34a8f8b628053e97f25b51ade2e) )
3117   DISK_IMAGE_READONLY( "700a04", 0, SHA1(554481f48eeb5daf8b4e7be2d66840d6c8454a52) )
31183118ROM_END
31193119
31203120ROM_START( darkhleg )
r4425r4426
31283128   ROM_FILL( 0x0000000, 0x1000000, 0xff )
31293129
31303130   DISK_REGION( "cdrom0" )
3131   DISK_IMAGE_READONLY( "706jaa02", 0, MD5(4f096051df039b0d104d4c0fff5dadb8) SHA1(4c8d976096c2da6d01804a44957daf9b50103c90) )
3131   DISK_IMAGE_READONLY( "706jaa02", 0, SHA1(58bd06855988250028086cba6b3670372b9d96a0) )
31323132ROM_END
31333133
31343134ROM_START( ddrextrm )
r4425r4426
31483148   ROM_LOAD( "gcc36ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
31493149
31503150   DISK_REGION( "cdrom0" )
3151   DISK_IMAGE_READONLY( "c36jaa02", 0, MD5(83fa51031d826d603c0371b18180aeda) SHA1(a1591cb4f1da7e460de57afb17a85592719243e0) )
3151   DISK_IMAGE_READONLY( "c36jaa02", 0, SHA1(edeb45fff0e66151b1ba2fd67542064ccddb031e) )
31523152ROM_END
31533153
31543154ROM_START( ddru )
r4425r4426
31623162   ROM_FILL( 0x0000000, 0x1000000, 0xff )
31633163
31643164   DISK_REGION( "cdrom0" )
3165   DISK_IMAGE_READONLY( "845uaa02", 0, MD5(32d52ee2b37559d7413788c87085f37c) SHA1(e82610e1a34fba144499f9ee892ac882d1e96853) )
3165   DISK_IMAGE_READONLY( "845uaa02", 0, SHA1(d3f9290d4dadb5e9b82ebe77abf7b99d1a89f716) )
31663166ROM_END
31673167
31683168ROM_START( ddrj )
r4425r4426
31763176   ROM_FILL( 0x0000000, 0x1000000, 0xff )
31773177
31783178   DISK_REGION( "cdrom0" )
3179   DISK_IMAGE_READONLY( "845jba02", 0, MD5(314f64301c3429312770ecdeb975d285) SHA1(8ebd9a68bbea3d9947a95d896347b0fea2145e4a) )
3179   DISK_IMAGE_READONLY( "845jba02", 0, SHA1(2d10378c89fe85682f262f0987f8366b9ea72f11) )
31803180ROM_END
31813181
31823182ROM_START( ddrja )
r4425r4426
31973197   ROM_LOAD( "gc845jaa.27h",  0xe00000, 0x200000, NO_DUMP )
31983198
31993199   DISK_REGION( "cdrom0" )
3200   DISK_IMAGE_READONLY( "845jaa02", 0, MD5(045237b7ba76f393f69dd95eae14b61a) SHA1(eb59d00300424be89817ce3f8d7e68b8cf0f7943) )
3200   DISK_IMAGE_READONLY( "845jaa02", 0, SHA1(37ca16be25bee39a5692dee2fa5f0fa0addfaaca) )
32013201
32023202   DISK_REGION( "cdrom1" )
32033203   DISK_IMAGE_READONLY( "845jaa01", 1, NO_DUMP ) // if this even exists
r4425r4426
32213221   ROM_LOAD( "gc845jab.27h",  0xe00000, 0x200000, NO_DUMP )
32223222
32233223   DISK_REGION( "cdrom0" )
3224   DISK_IMAGE_READONLY( "845jab02", 0, MD5(ebaaf265a1a7efae93cd745a67ea2cb2) SHA1(10ee3081065ebf5a814abbd30c8dee91b384a849) )
3224   DISK_IMAGE_READONLY( "845jab02", 0, SHA1(7bdcef37bf376c23153dfd1580de5666cc681335) )
32253225
32263226   DISK_REGION( "cdrom1" )
32273227   DISK_IMAGE_READONLY( "845jab01", 1, NO_DUMP ) // if this even exists
r4425r4426
32383238   ROM_FILL( 0x0000000, 0x1000000, 0xff )
32393239
32403240   DISK_REGION( "cdrom0" )
3241   DISK_IMAGE_READONLY( "845aaa02", 0, MD5(2ab58fc647d35673861788a78df2afba) SHA1(fe2d18cdab7a3088f7c876ce531d64a2f3ae9294) )
3241   DISK_IMAGE_READONLY( "845aaa02", 0, SHA1(839e2f8698a1561ac364998b8b3158ef0dee6998) )
32423242ROM_END
32433243
32443244ROM_START( ddr2m )
r4425r4426
32523252   ROM_FILL( 0x0000000, 0x1000000, 0xff )
32533253
32543254   DISK_REGION( "cdrom0" )
3255   DISK_IMAGE_READONLY( "895jaa02", 0, MD5(f83ea1459c51aba2e16830b775444db3) SHA1(f1d47440ec7ba902f0fc5cad241729613f24fce1) )
3255   DISK_IMAGE_READONLY( "895jaa02", 0, SHA1(cfe3a6f3ed62ba388b07045e29e22472d17dcfe4) )
32563256ROM_END
32573257
32583258ROM_START( ddr2mc )
r4425r4426
32663266   ROM_FILL( 0x0000000, 0x1000000, 0xff )
32673267
32683268   DISK_REGION( "cdrom0" )
3269   DISK_IMAGE_READONLY( "896jaa01", 0, MD5(3cab3bc6d9459360da8f6784dd861067) SHA1(cb99e52eac5223509e914648d9b5dec59ed242f8) )
3269   DISK_IMAGE_READONLY( "896jaa01", 0, SHA1(f802a0e2ba0147eb71c54d92af409c3010a5715f) )
32703270
32713271   DISK_REGION( "cdrom1" )
3272   DISK_IMAGE_READONLY( "895jaa02", 1, MD5(f83ea1459c51aba2e16830b775444db3) SHA1(f1d47440ec7ba902f0fc5cad241729613f24fce1) )
3272   DISK_IMAGE_READONLY( "895jaa02", 1, SHA1(cfe3a6f3ed62ba388b07045e29e22472d17dcfe4) )
32733273ROM_END
32743274
32753275ROM_START( ddr2mc2 )
r4425r4426
32833283   ROM_FILL( 0x0000000, 0x1000000, 0xff )
32843284
32853285   DISK_REGION( "cdrom0" )
3286   DISK_IMAGE_READONLY( "984jaa01", 0, MD5(945de47f526007f7c607c398b9b6275a) SHA1(da257e5a553a75439970393bdafc581f6971f946) )
3286   DISK_IMAGE_READONLY( "984jaa01", 0, SHA1(5505c28be27bfa9648060fd799bcf0c2c5f608ed) )
32873287
32883288   DISK_REGION( "cdrom1" )
3289   DISK_IMAGE_READONLY( "895jaa02", 1, MD5(f83ea1459c51aba2e16830b775444db3) SHA1(f1d47440ec7ba902f0fc5cad241729613f24fce1) )
3289   DISK_IMAGE_READONLY( "895jaa02", 1, SHA1(cfe3a6f3ed62ba388b07045e29e22472d17dcfe4) )
32903290ROM_END
32913291
32923292ROM_START( ddr2ml )
r4425r4426
33033303   ROM_FILL( 0x0000000, 0x2000000, 0xff )
33043304
33053305   DISK_REGION( "cdrom0" )
3306   DISK_IMAGE_READONLY( "885jaa02", 0, MD5(696e39fa7113f61181875bffca13a1b4) SHA1(ece1d34a3bdbe07b608429abe30802bc7327a94a) )
3306   DISK_IMAGE_READONLY( "885jaa02", 0, SHA1(5d187aea247eefc5c065566ab277acd8c942ba27) )
33073307ROM_END
33083308
33093309ROM_START( ddr3ma )
r4425r4426
33293329   ROM_LOAD( "gn887aa.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
33303330
33313331   DISK_REGION( "cdrom0" )
3332   DISK_IMAGE_READONLY( "887aaa02", 0, MD5(20a95a94413dfba836fd1b0d7923dbfc) SHA1(75500b4393519f1f9bce7c9bdfd45ef365a8672c) )
3332   DISK_IMAGE_READONLY( "887aaa02", 0, SHA1(c4136305b97123f5dfe3ecd34a10ddda0180da3d) )
33333333ROM_END
33343334
33353335ROM_START( ddr3mj )
r4425r4426
33553355   ROM_LOAD( "gn887ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
33563356
33573357   DISK_REGION( "cdrom0" )
3358   DISK_IMAGE_READONLY( "887jaa02", 0, MD5(c2241d1277a98d6a8cafd3aed0c9b9da) SHA1(04f639c3e72aa6dd546ea5b5b84fb3fcb10acc46) )
3358   DISK_IMAGE_READONLY( "887jaa02", 0, SHA1(2d1bf2a1566292dc869afaa6486f5ecd3973ff62) )
33593359ROM_END
33603360
33613361ROM_START( ddr3mk )
r4425r4426
33813381   ROM_LOAD( "gn887kb.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
33823382
33833383   DISK_REGION( "cdrom0" )
3384   DISK_IMAGE_READONLY( "887kba02", 0, MD5(3ebd603c800158697c968caf187a7cc6) SHA1(8feb5dcada45e6f6aa0695439dc718fafb978b4d) )
3384   DISK_IMAGE_READONLY( "887kba02", 0, SHA1(92a3844fab24f46c16dd96f9474d95fd001df603) )
33853385ROM_END
33863386
33873387ROM_START( ddr3mka )
r4425r4426
34073407   ROM_LOAD( "gn887ka.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
34083408
34093409   DISK_REGION( "cdrom0" )
3410   DISK_IMAGE_READONLY( "887kaa02", 0, MD5(9ecee52213411d4a518f4724c87ee9d3) SHA1(10af2af753c5a54d1d3ac40a9ccc3e0324183f4d) )
3410   DISK_IMAGE_READONLY( "887kaa02", 0, SHA1(a80930dd66c2e2326e8792f2e7cf9116d9cd752c) )
34113411ROM_END
34123412
34133413ROM_START( ddr3mp )
r4425r4426
34333433   ROM_LOAD( "gca22ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
34343434
34353435   DISK_REGION( "cdrom0" )
3436   DISK_IMAGE_READONLY( "a22jaa02", 0, MD5(b386ecc1d54e2ac73c16057af9220aa6) SHA1(cc4fba48dfff96f0ac85a438dab95e00891aeac5) )
3436   DISK_IMAGE_READONLY( "a22jaa02", 0, SHA1(2bf07d08f6acee562024b418b453d654fc40f8dd) )
34373437ROM_END
34383438
34393439ROM_START( ddr4m )
r4425r4426
34593459   ROM_LOAD( "gca33aa.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
34603460
34613461   DISK_REGION( "cdrom0" )
3462   DISK_IMAGE_READONLY( "a33aaa02", 0, BAD_DUMP MD5(d843cba35726f3b0af357f712b8870a4) SHA1(40456e772c39c339828dd4726766ef2e0981d3a1) )
3462   DISK_IMAGE_READONLY( "a33aaa02", 0, BAD_DUMP SHA1(cc7349cbee37bfb101480497e99f1f52acb4ffa1) )
34633463ROM_END
34643464
34653465ROM_START( ddr4mj )
r4425r4426
34853485   ROM_LOAD( "gca33ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
34863486
34873487   DISK_REGION( "cdrom0" )
3488   DISK_IMAGE_READONLY( "a33jaa02", 0, MD5(855456931374d1c99dfd44c52a0a3178) SHA1(ad7672bf30becc9030c4fa097cc60deecad6f36d) )
3488   DISK_IMAGE_READONLY( "a33jaa02", 0, SHA1(9d9fb5e65f1532f358e9c273c56d11389d11fd79) )
34893489ROM_END
34903490
34913491ROM_START( ddr4ms )
r4425r4426
35113511   ROM_LOAD( "gca33ab.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
35123512
35133513   DISK_REGION( "cdrom0" )
3514   DISK_IMAGE_READONLY( "a33aba02", 0, MD5(d843cba35726f3b0af357f712b8870a4) SHA1(40456e772c39c339828dd4726766ef2e0981d3a1) )
3514   DISK_IMAGE_READONLY( "a33aba02", 0, SHA1(cc7349cbee37bfb101480497e99f1f52acb4ffa1) )
35153515ROM_END
35163516
35173517ROM_START( ddr4msj )
r4425r4426
35373537   ROM_LOAD( "gca33jb.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
35383538
35393539   DISK_REGION( "cdrom0" )
3540   DISK_IMAGE_READONLY( "a33jba02", 0, BAD_DUMP MD5(855456931374d1c99dfd44c52a0a3178) SHA1(ad7672bf30becc9030c4fa097cc60deecad6f36d) )
3540   DISK_IMAGE_READONLY( "a33jba02", 0, BAD_DUMP SHA1(9d9fb5e65f1532f358e9c273c56d11389d11fd79) )
35413541ROM_END
35423542
35433543ROM_START( ddr4mp )
r4425r4426
35663566   ROM_LOAD( "gca34ja.22h",  0x000000, 0x002000, CRC(80575c1f) SHA1(a0594ca0f75bc7d49b645e835e9fa48a73c3c9c7) )
35673567
35683568   DISK_REGION( "cdrom0" )
3569   DISK_IMAGE_READONLY( "a34jaa02", 0, MD5(d8292d7f1e359d308b779e44fd0809ef) SHA1(23aadca5274bff5f130357701c1ab269943b387d) )
3569   DISK_IMAGE_READONLY( "a34jaa02", 0, SHA1(1d5f9eb633f054ddbf9fba55d53e4ee263ba91dd) )
35703570ROM_END
35713571
35723572ROM_START( ddr4mps )
r4425r4426
35953595   ROM_LOAD( "gca34jb.22h",  0x000000, 0x002000, CRC(bc6c8bd7) SHA1(10ceec5c7bc5ca9fca88f3c083a7d97012982079) )
35963596
35973597   DISK_REGION( "cdrom0" )
3598   DISK_IMAGE_READONLY( "a34jba02", 0, BAD_DUMP MD5(d8292d7f1e359d308b779e44fd0809ef) SHA1(23aadca5274bff5f130357701c1ab269943b387d) )
3598   DISK_IMAGE_READONLY( "a34jba02", 0, BAD_DUMP SHA1(1d5f9eb633f054ddbf9fba55d53e4ee263ba91dd) )
35993599ROM_END
36003600
36013601ROM_START( ddr5m )
r4425r4426
36153615   ROM_LOAD( "gca27ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
36163616
36173617   DISK_REGION( "cdrom0" )
3618   DISK_IMAGE_READONLY( "a27jaa02", 0, MD5(502ecebf4d2e931f6b75b6a22b7d620c) SHA1(2edb3a0160c2783db6b0ddfce0f7c9ebb35b481f) )
3618   DISK_IMAGE_READONLY( "a27jaa02", 0, SHA1(0324973c98b82b72b22d2f0cd43e1924b83be667) )
36193619ROM_END
36203620
36213621ROM_START( ddrbocd )
r4425r4426
36323632   ROM_FILL( 0x0000000, 0x2000000, 0xff )
36333633
36343634   DISK_REGION( "cdrom0" )
3635   DISK_IMAGE_READONLY( "892jaa01", 0, MD5(b29b63bafdd35f38662ff8daf5fc59f7) SHA1(c929c488d206e055e756ca506c3b1ff430a46aaa) )
3635   DISK_IMAGE_READONLY( "892jaa01", 0, SHA1(46ace0feef48a2a6643c3cb4ac9164ba0beeea94) )
36363636
36373637   DISK_REGION( "cdrom1" )
3638   DISK_IMAGE_READONLY( "895jaa02", 1, MD5(f83ea1459c51aba2e16830b775444db3) SHA1(f1d47440ec7ba902f0fc5cad241729613f24fce1) )
3638   DISK_IMAGE_READONLY( "895jaa02", 1, SHA1(cfe3a6f3ed62ba388b07045e29e22472d17dcfe4) )
36393639ROM_END
36403640
36413641ROM_START( ddrs2k )
r4425r4426
36583658   ROM_LOAD( "gc905aa.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
36593659
36603660   DISK_REGION( "cdrom0" )
3661   DISK_IMAGE_READONLY( "905aaa02", 0, MD5(8b753bae1b4cbd5c8b641eb723b660a1) SHA1(cfd40cee9380588dc2ced107ace2a7486d91944d) )
3661   DISK_IMAGE_READONLY( "905aaa02", 0, SHA1(1fc0f3fcc7d5d23711967023ff02c1fc76479024) )
36623662ROM_END
36633663
36643664ROM_START( ddrs2kj )
r4425r4426
36813681   ROM_LOAD( "gc905aa.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
36823682
36833683   DISK_REGION( "cdrom0" )
3684   DISK_IMAGE_READONLY( "905jaa02", 0, MD5(098496f8d9b5ac0357f093a62d6d59f0) SHA1(37f9aff936a51b3482ae4717227993106be8b476) )
3684   DISK_IMAGE_READONLY( "905jaa02", 0, SHA1(84931345611574afd53976a0807f4163348e3c15) )
36853685ROM_END
36863686
36873687ROM_START( ddrmax )
r4425r4426
37013701   ROM_LOAD( "gcb19ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
37023702
37033703   DISK_REGION( "cdrom0" )
3704   DISK_IMAGE_READONLY( "b19jaa02", 0, MD5(0f080892f7e5ad0d83e6db70e4cb80d7) SHA1(59361e85641f2deda88ccbc2cd1634523f1c1a3b) )
3704   DISK_IMAGE_READONLY( "b19jaa02", 0, SHA1(a156ebdef395747c64e1829237e4e7932ae251a8) )
37053705ROM_END
37063706
37073707ROM_START( ddrmax2 )
r4425r4426
37213721   ROM_LOAD( "gcb20ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
37223722
37233723   DISK_REGION( "cdrom0" )
3724   DISK_IMAGE_READONLY( "b20jaa02", 0, MD5(2d57e32a263b355391a94f45c145d0fe) SHA1(e43c34bd113ef20e579ce7c6248288a257a5ccde) )
3724   DISK_IMAGE_READONLY( "b20jaa02", 0, SHA1(3f378e922e3182f980d07d6b2b524e33c5a00549) )
37253725ROM_END
37263726
37273727ROM_START( ddrsbm )
r4425r4426
37383738   ROM_LOAD( "gq894ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
37393739
37403740   DISK_REGION( "cdrom0" )
3741   DISK_IMAGE_READONLY( "894jaa02", 0, MD5(05f3cd86796f41353528999ac3fbd26b) SHA1(5b65ac6bc2497b3ab99542f5acae3a64895f221d) )
3741   DISK_IMAGE_READONLY( "894jaa02", 0, SHA1(3b2e061996d12f0e7367a579208eb746d849e070) )
37423742ROM_END
37433743
37443744ROM_START( ddrusa )
r4425r4426
37553755   ROM_LOAD( "gka44ua.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
37563756
37573757   DISK_REGION( "cdrom0" )
3758   DISK_IMAGE_READONLY( "a44uaa02", 0, MD5(f9694956bab44593784fa728c6b53712) SHA1(e40b52ce3b1e90e3ec9190b83ba875c4ab1b0f2f) )
3758   DISK_IMAGE_READONLY( "a44uaa02", 0, SHA1(2cdbe1c62d16a2be65adb7e11331fce5c8e45504) )
37593759ROM_END
37603760
37613761ROM_START( drmn )
r4425r4426
37743774   ROM_LOAD( "gq881ja.22h",  0x000000, 0x002000, CRC(e834d5ec) SHA1(1c845811e43d7dfec657da288b5a38b8bc9c8366) )
37753775
37763776   DISK_REGION( "cdrom0" )
3777   DISK_IMAGE_READONLY( "881jad01", 0, MD5(8191ad7747f5ac87a40534f53a2a6cd4) SHA1(61bfd356d262f53f1ab55654aba2981fb8eb1420) ) // upgrade or bootleg?
3777   DISK_IMAGE_READONLY( "881jad01", 0, SHA1(7d9d47bef636dbaa8d578f34ea9489e349d3d6df) ) // upgrade or bootleg?
37783778
37793779   DISK_REGION( "cdrom1" )
37803780   DISK_IMAGE_READONLY( "881jaa02", 1, NO_DUMP )
r4425r4426
38003800   ROM_LOAD( "gn912ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
38013801
38023802   DISK_REGION( "cdrom0" )
3803   DISK_IMAGE_READONLY( "912jab", 0, BAD_DUMP MD5(60dadc836f00f22d50b5b634250aa624) SHA1(5316b2e2e89af7bc038a3febc91525edac91fe7e) )
3803   DISK_IMAGE_READONLY( "912jab", 0, BAD_DUMP SHA1(294d2b70d48f888704ad24e47ef9c122172941d5) )
38043804ROM_END
38053805
38063806ROM_START( drmn2mpu )
r4425r4426
38233823   ROM_LOAD( "gn912ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
38243824
38253825   DISK_REGION( "cdrom0" )
3826   DISK_IMAGE_READONLY( "912jab",  0, BAD_DUMP MD5(60dadc836f00f22d50b5b634250aa624) SHA1(5316b2e2e89af7bc038a3febc91525edac91fe7e) )
3826   DISK_IMAGE_READONLY( "912jab",  0, BAD_DUMP SHA1(294d2b70d48f888704ad24e47ef9c122172941d5) )
38273827
38283828   DISK_REGION( "cdrom1" )
3829   DISK_IMAGE_READONLY( "912za01", 1, BAD_DUMP MD5(1d3fa130a3a6c8433c276e609b373e4f) SHA1(121ca6df16084a01c88ef26167b13053c9adc7ce) )
3829   DISK_IMAGE_READONLY( "912za01", 1, BAD_DUMP SHA1(916c34b91a984f3f6e7248088b3b946e3d5682a6) )
38303830ROM_END
38313831
38323832ROM_START( drmn3m )
r4425r4426
38493849   ROM_LOAD( "gca23ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
38503850
38513851   DISK_REGION( "cdrom0" )
3852   DISK_IMAGE_READONLY( "a23jaa02", 0, MD5(3b6477be8e66e447cc3f94047c28a2a2) SHA1(4c607eb2b212785520d1c6dc21d013fe6f489741) )
3852   DISK_IMAGE_READONLY( "a23jaa02", 0, SHA1(89e365f61a4db889621d7d9d9917bcfa2c09704e) )
38533853ROM_END
38543854
38553855ROM_START( dmx )
r4425r4426
38663866   ROM_LOAD( "ge874ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
38673867
38683868   DISK_REGION( "cdrom0" )
3869   DISK_IMAGE_READONLY( "874jaa", 0, BAD_DUMP MD5(457f6e55aec68537ae47c6045de1ee26) SHA1(ff6332e032b1528691a87c5001bf808d6a8f5ef7) )
3869   DISK_IMAGE_READONLY( "874jaa", 0, BAD_DUMP SHA1(3338a784efdca4f8bdcc83d2c9a6bbe7f7046d5c) )
38703870ROM_END
38713871
38723872ROM_START( dmx2m )
r4425r4426
38833883   ROM_LOAD( "gca39ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
38843884
38853885   DISK_REGION( "cdrom0" )
3886   DISK_IMAGE_READONLY( "a39jaa02", 0, MD5(3106d45c868ad30e47f7873ea1dffc8a) SHA1(20df1b5636622d8c0e45623bd1af6bc1249fec65) )
3886   DISK_IMAGE_READONLY( "a39jaa02", 0, SHA1(3d021448df857c12f6d46a20e14ae0fc6d342dcc) )
38873887ROM_END
38883888
38893889ROM_START( dmx2majp )
r4425r4426
39023902   ROM_LOAD( "gca38ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
39033903
39043904   DISK_REGION( "cdrom0" )
3905   DISK_IMAGE_READONLY( "a38jaa02", 0, MD5(3c4070547d17605db68a3db333865eb0) SHA1(e9fe714bb0a5354b199b1fb7b33f366db502c03a) )
3905   DISK_IMAGE_READONLY( "a38jaa02", 0, SHA1(d26c481ef8a70bba75bcdf41f9ceb3a49c245986) )
39063906ROM_END
39073907
39083908ROM_START( dncfrks )
r4425r4426
39193919   ROM_LOAD( "gk874ka.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
39203920
39213921   DISK_REGION( "cdrom0" )
3922   DISK_IMAGE_READONLY( "874kaa", 0, BAD_DUMP MD5(5e02c8dba12f949ce99834e597d8d08d) SHA1(659281e1b63c5ff0616b27d7f87a4e7f1c493372) )
3922   DISK_IMAGE_READONLY( "874kaa", 0, BAD_DUMP SHA1(4d1e843417ea96635eeba0cef944e83fdb72565c) )
39233923ROM_END
39243924
39253925ROM_START( dsem )
r4425r4426
39363936   ROM_LOAD( "ge936ea.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
39373937
39383938   DISK_REGION( "cdrom0" )
3939   DISK_IMAGE_READONLY( "936eaa", 0, BAD_DUMP MD5(1b3fea5748aec4b8efdc0aa42a84a56a) SHA1(eb824ea9593ea4a84440ff1032055d85e6c9e025) )
3939   DISK_IMAGE_READONLY( "936eaa", 0, BAD_DUMP SHA1(7cacc15ae065d47af31f1008374ec8241dba0d55) )
39403940ROM_END
39413941
39423942ROM_START( dsem2 )
r4425r4426
39563956   ROM_LOAD( "gkc23ea.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
39573957
39583958   DISK_REGION( "cdrom0" )
3959   DISK_IMAGE_READONLY( "c23eaa02", 0, MD5(e7275ba9f53334ac528afaa278df7153) SHA1(661f0b53ab64fc746b8e3b7ff3dd32d2bed852ac) )
3959   DISK_IMAGE_READONLY( "c23eaa02", 0, SHA1(46868c97530db5be1b43ffa32744e3e12495c243) )
39603960ROM_END
39613961
39623962ROM_START( dsfdct )
r4425r4426
39823982   ROM_LOAD( "gc910jc.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
39833983
39843984   DISK_REGION( "cdrom0" )
3985   DISK_IMAGE_READONLY( "910jca02", 0, MD5(c909982a234dbd59388892bd627a466e) SHA1(687ce1d480eb13e78289171b6c56fd5b1e7d5d9e) )
3985   DISK_IMAGE_READONLY( "910jca02", 0, SHA1(0c868f3c9f696d291e8f27687e3ad83e453a4894) )
39863986ROM_END
39873987
39883988ROM_START( dsfdcta )
r4425r4426
40084008   ROM_LOAD( "gc910ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
40094009
40104010   DISK_REGION( "cdrom0" )
4011   DISK_IMAGE_READONLY( "910jaa02", 0, MD5(e5380280b5cbb10822391f74866f8bee) SHA1(3d17320f56be7edb1be6b1bd53269d452f71123d) )
4011   DISK_IMAGE_READONLY( "910jaa02", 0, SHA1(70851c383e3876c4a697a99706fbaae2dafcb0e0) )
40124012ROM_END
40134013
40144014ROM_START( dsftkd )
r4425r4426
40254025   ROM_LOAD( "gn884ja.u6",  0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
40264026
40274027   DISK_REGION( "cdrom0" )
4028   DISK_IMAGE_READONLY( "884jaa02", 0, MD5(d73444ab74efb8587c2bf455e3ec0d13) SHA1(92522380b92333b10d401fda4f81592073f3e601) )
4028   DISK_IMAGE_READONLY( "884jaa02", 0, SHA1(80f02fcb7ea5b6394a2a58f12b73d87a1826d7f4) )
40294029ROM_END
40304030
40314031ROM_START( dstage )
r4425r4426
40394039   ROM_FILL( 0x0000000, 0x1000000, 0xff )
40404040
40414041   DISK_REGION( "cdrom0" )
4042   DISK_IMAGE_READONLY( "845ea", 0, BAD_DUMP MD5(32d52ee2b37559d7413788c87085f37c) SHA1(e82610e1a34fba144499f9ee892ac882d1e96853) )
4042   DISK_IMAGE_READONLY( "845ea", 0, BAD_DUMP SHA1(d3f9290d4dadb5e9b82ebe77abf7b99d1a89f716) )
40434043ROM_END
40444044
40454045ROM_START( fbait2bc )
r4425r4426
40534053   ROM_FILL( 0x0000000, 0x1000000, 0xff )
40544054
40554055   DISK_REGION( "cdrom0" )
4056   DISK_IMAGE_READONLY( "865uab02", 0, MD5(5a253a58417539f9b0cb9726311f73d5) SHA1(86ccbaac30e9e2d7d0ad6ae65a4f53f606f50525) )
4056   DISK_IMAGE_READONLY( "865uab02", 0, SHA1(d14dc066d4c16fba1e9b31d5f042ad249c4b5137) )
40574057ROM_END
40584058
40594059ROM_START( fbaitbc )
r4425r4426
40674067   ROM_FILL( 0x0000000, 0x1000000, 0xff )
40684068
40694069   DISK_REGION( "cdrom0" )
4070   DISK_IMAGE_READONLY( "765uab02", 0, MD5(56d8a23bb592932631f8f81b9797fce6) SHA1(dda131b8655e3c4394e50749fe3a1e468f9df353) )
4070   DISK_IMAGE_READONLY( "765uab02", 0, SHA1(07b09e763e4b90108aa924b518221b16667a7133) )
40714071ROM_END
40724072
40734073ROM_START( fbaitmc )
r4425r4426
40814081   ROM_FILL( 0x0000000, 0x1000000, 0xff )
40824082
40834083   DISK_REGION( "cdrom0" )
4084   DISK_IMAGE_READONLY( "889ea", 0, BAD_DUMP MD5(43eae52edd38019f0836897ea8def527) SHA1(2e6937c265c222ac2cea50fbf32201ade425ee30) )
4084   DISK_IMAGE_READONLY( "889ea", 0, BAD_DUMP SHA1(0b567bf2f03ee8089e0b021ea502a53b3f6fe7ac) )
40854085ROM_END
40864086
40874087ROM_START( fbaitmca )
r4425r4426
40954095   ROM_FILL( 0x0000000, 0x1000000, 0xff )
40964096
40974097   DISK_REGION( "cdrom0" )
4098   DISK_IMAGE_READONLY( "889aa", 0, BAD_DUMP MD5(43eae52edd38019f0836897ea8def527) SHA1(2e6937c265c222ac2cea50fbf32201ade425ee30) )
4098   DISK_IMAGE_READONLY( "889aa", 0, BAD_DUMP SHA1(0b567bf2f03ee8089e0b021ea502a53b3f6fe7ac) )
40994099ROM_END
41004100
41014101ROM_START( fbaitmcj )
r4425r4426
41094109   ROM_FILL( 0x0000000, 0x1000000, 0xff )
41104110
41114111   DISK_REGION( "cdrom0" )
4112   DISK_IMAGE_READONLY( "889ja", 0, BAD_DUMP MD5(43eae52edd38019f0836897ea8def527) SHA1(2e6937c265c222ac2cea50fbf32201ade425ee30) )
4112   DISK_IMAGE_READONLY( "889ja", 0, BAD_DUMP SHA1(0b567bf2f03ee8089e0b021ea502a53b3f6fe7ac) )
41134113ROM_END
41144114
41154115ROM_START( fbaitmcu )
r4425r4426
41234123   ROM_FILL( 0x0000000, 0x1000000, 0xff )
41244124
41254125   DISK_REGION( "cdrom0" )
4126   DISK_IMAGE_READONLY( "889ua", 0, BAD_DUMP MD5(43eae52edd38019f0836897ea8def527) SHA1(2e6937c265c222ac2cea50fbf32201ade425ee30) )
4126   DISK_IMAGE_READONLY( "889ua", 0, BAD_DUMP SHA1(0b567bf2f03ee8089e0b021ea502a53b3f6fe7ac) )
41274127ROM_END
41284128
41294129ROM_START( gtrfrks )
r4425r4426
41374137   ROM_FILL( 0x0000000, 0x1000000, 0xff )
41384138
41394139   DISK_REGION( "cdrom0" )
4140   DISK_IMAGE_READONLY( "886ea", 0, BAD_DUMP MD5(b8b39a6e48867fdad640bd256273bdfc) SHA1(2277c6268b8327be8d7636d4812920e5d3b353cd) )
4140   DISK_IMAGE_READONLY( "886ea", 0, BAD_DUMP SHA1(c0118b5539902e75853403a4979869d18c3d1b86) )
41414141ROM_END
41424142
41434143ROM_START( gtrfrksu )
r4425r4426
41514151   ROM_FILL( 0x0000000, 0x1000000, 0xff )
41524152
41534153   DISK_REGION( "cdrom0" )
4154   DISK_IMAGE_READONLY( "886ua", 0, BAD_DUMP MD5(b8b39a6e48867fdad640bd256273bdfc) SHA1(2277c6268b8327be8d7636d4812920e5d3b353cd) )
4154   DISK_IMAGE_READONLY( "886ua", 0, BAD_DUMP SHA1(c0118b5539902e75853403a4979869d18c3d1b86) )
41554155ROM_END
41564156
41574157ROM_START( gtrfrksj )
r4425r4426
41654165   ROM_FILL( 0x0000000, 0x1000000, 0xff )
41664166
41674167   DISK_REGION( "cdrom0" )
4168   DISK_IMAGE_READONLY( "886ja", 0, BAD_DUMP MD5(b8b39a6e48867fdad640bd256273bdfc) SHA1(2277c6268b8327be8d7636d4812920e5d3b353cd) )
4168   DISK_IMAGE_READONLY( "886ja", 0, BAD_DUMP SHA1(c0118b5539902e75853403a4979869d18c3d1b86) )
41694169ROM_END
41704170
41714171ROM_START( gtrfrksa )
r4425r4426
41794179   ROM_FILL( 0x0000000, 0x1000000, 0xff )
41804180
41814181   DISK_REGION( "cdrom0" )
4182   DISK_IMAGE_READONLY( "886aa", 0, BAD_DUMP MD5(b8b39a6e48867fdad640bd256273bdfc) SHA1(2277c6268b8327be8d7636d4812920e5d3b353cd) )
4182   DISK_IMAGE_READONLY( "886aa", 0, BAD_DUMP SHA1(c0118b5539902e75853403a4979869d18c3d1b86) )
41834183ROM_END
41844184
41854185ROM_START( gtrfrk2m )
r4425r4426
41994199   ROM_LOAD( "gq883jad.u6",  0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
42004200
42014201   DISK_REGION( "cdrom0" )
4202   DISK_IMAGE_READONLY( "929jbb02", 0, BAD_DUMP MD5(dfe595184dd55046da6fe93bb14b83be) SHA1(c76d5c11422b2ef1750e92a1edac2812666aadae) )
4202   DISK_IMAGE_READONLY( "929jbb02", 0, BAD_DUMP SHA1(4f6bb0150ad6ed574dd7583ccd60604028663b2a) )
42034203ROM_END
42044204
42054205ROM_START( gtrfrk3m )
r4425r4426
42254225   ROM_LOAD( "ge949jab.u6",  0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
42264226
42274227   DISK_REGION( "cdrom0" )
4228   DISK_IMAGE_READONLY( "949jac01", 0, MD5(0f78f8e06edd3b8fa0abed22155d06d9) SHA1(3e43a5018aa88ed78c9e2fb50f65489a6c7de093) )
4228   DISK_IMAGE_READONLY( "949jac01", 0, SHA1(ff017dd5c0ecbdb8935d0d4656a45e9fab10ef82) )
42294229
42304230   DISK_REGION( "cdrom1" )
4231   DISK_IMAGE_READONLY( "949jab02", 1, MD5(331a7516a33d9cf9f04b8c9aa5de5fc1) SHA1(9aae90c6b0f5c31f47a420f876c0dbc81d43b756) )
4231   DISK_IMAGE_READONLY( "949jab02", 1, SHA1(ad629c9bafbdc4bf6c679918a5fae2bcfdb39332) )
42324232ROM_END
42334233
42344234ROM_START( gtfrk3ma )
r4425r4426
42544254   ROM_LOAD( "ge949jab.u6",  0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
42554255
42564256   DISK_REGION( "cdrom0" )
4257   DISK_IMAGE_READONLY( "949jab02", 0, MD5(331a7516a33d9cf9f04b8c9aa5de5fc1) SHA1(9aae90c6b0f5c31f47a420f876c0dbc81d43b756) )
4257   DISK_IMAGE_READONLY( "949jab02", 0, SHA1(ad629c9bafbdc4bf6c679918a5fae2bcfdb39332) )
42584258ROM_END
42594259
42604260ROM_START( gtfrk3mb )
r4425r4426
42744274   ROM_LOAD( "ge949jaa.u6",  0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
42754275
42764276   DISK_REGION( "cdrom0" )
4277   DISK_IMAGE_READONLY( "949jaz02", 0, MD5(22f7e1e61ea5f627e28c32f2209b5138) SHA1(62bd62cafb4bd4a1e393071f5e55d5ab57e3a880) )
4277   DISK_IMAGE_READONLY( "949jaz02", 0, SHA1(b0c786ba420a34fcbd16bc36a137f6ae87b7dfa8) )
42784278ROM_END
42794279
42804280ROM_START( gtrfrk4m )
r4425r4426
43004300   ROM_LOAD( "gea24ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
43014301
43024302   DISK_REGION( "cdrom0" )
4303   DISK_IMAGE_READONLY( "a24jaa02", 0, MD5(1e113d8f5601b0b4f38852894717e486) SHA1(f0748312663a9683fd5a115c16f135cb58b993b1) )
4303   DISK_IMAGE_READONLY( "a24jaa02", 0, SHA1(bc0303f5a6a19484cd35890cc9934ee0bcabb2ad) )
43044304ROM_END
43054305
43064306ROM_START( gtrfrk5m )
r4425r4426
43224322   ROM_LOAD( "gea26jaa.u6",    0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
43234323
43244324   DISK_REGION( "cdrom0" )
4325   DISK_IMAGE_READONLY( "a26jaa02", 0, MD5(885b18ce273770330aefa0276911c046) SHA1(635aee062df45c83b080612d29101fe70c14979d) )
4325   DISK_IMAGE_READONLY( "a26jaa02", 0, SHA1(9909e08abff780db6fd7a5fbcc57ffbe14ae08ce) )
43264326ROM_END
43274327
43284328ROM_START( gtrfrk6m )
r4425r4426
43424342   ROM_LOAD( "gcb06ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
43434343
43444344   DISK_REGION( "cdrom0" )
4345   DISK_IMAGE_READONLY( "b06jaa02", 0, MD5(8191da2660bb645fcfee9fb60baef242) SHA1(e8be8bdc0cbfb95a0a56ab89f39de3089d31f305) )
4345   DISK_IMAGE_READONLY( "b06jaa02", 0, SHA1(2ea53ef492da63183a28c54afde07fce323fe42e) )
43464346ROM_END
43474347
43484348ROM_START( gtrfrk7m )
r4425r4426
43644364   ROM_LOAD( "gcb17jaa.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
43654365
43664366   DISK_REGION( "cdrom0" )
4367   DISK_IMAGE_READONLY( "b17jaa02", 0, MD5(65b47fbf7d682e8dc8b2a3137aaab9b7) SHA1(bf8eb8f857c08595bb1c19f470ac689400ee0cab) )
4367   DISK_IMAGE_READONLY( "b17jaa02", 0, SHA1(d38dc22011b71b0e4167f1728a8794ea4b9c5396) )
43684368ROM_END
43694369
43704370ROM_START( gtfrk11m )
r4425r4426
43844384   ROM_LOAD( "gcd39ja.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
43854385
43864386   DISK_REGION( "cdrom0" )
4387   DISK_IMAGE_READONLY( "d39jaa02", 0, MD5(4730dd81132cdac6f0cb7cc4c9753329) SHA1(b9425ab6bc7305eac2fef9799b7d46b18462ea84) )
4387   DISK_IMAGE_READONLY( "d39jaa02", 0, SHA1(7a87ee331ba0301bb8724c398e6c77cfb9c172a7) )
43884388ROM_END
43894389
43904390ROM_START( konam80a )
r4425r4426
43984398   ROM_FILL( 0x0000000, 0x1000000, 0xff )
43994399
44004400   DISK_REGION( "cdrom0" )
4401   DISK_IMAGE_READONLY( "826aaa01", 0, BAD_DUMP MD5(456f683c5d47dd73cfb73ce80b8a7351) SHA1(452c94088ffefe42e61c978b48d425e7094a5af6) )
4401   DISK_IMAGE_READONLY( "826aaa01", 0, BAD_DUMP SHA1(be5f8b31fd18ba631fe98c2132c56abf20193419) )
44024402ROM_END
44034403
44044404ROM_START( konam80j )
r4425r4426
44124412   ROM_FILL( 0x0000000, 0x1000000, 0xff )
44134413
44144414   DISK_REGION( "cdrom0" )
4415   DISK_IMAGE_READONLY( "826jaa01", 0, MD5(456f683c5d47dd73cfb73ce80b8a7351) SHA1(452c94088ffefe42e61c978b48d425e7094a5af6) )
4415   DISK_IMAGE_READONLY( "826jaa01", 0, SHA1(be5f8b31fd18ba631fe98c2132c56abf20193419) )
44164416ROM_END
44174417
44184418ROM_START( konam80k )
r4425r4426
44264426   ROM_FILL( 0x0000000, 0x1000000, 0xff )
44274427
44284428   DISK_REGION( "cdrom0" )
4429   DISK_IMAGE_READONLY( "826kaa01", 0, BAD_DUMP MD5(456f683c5d47dd73cfb73ce80b8a7351) SHA1(452c94088ffefe42e61c978b48d425e7094a5af6) )
4429   DISK_IMAGE_READONLY( "826kaa01", 0, BAD_DUMP SHA1(be5f8b31fd18ba631fe98c2132c56abf20193419) )
44304430ROM_END
44314431
44324432ROM_START( konam80s )
r4425r4426
44404440   ROM_FILL( 0x0000000, 0x1000000, 0xff )
44414441
44424442   DISK_REGION( "cdrom0" )
4443   DISK_IMAGE_READONLY( "826eaa01", 0, BAD_DUMP MD5(456f683c5d47dd73cfb73ce80b8a7351) SHA1(452c94088ffefe42e61c978b48d425e7094a5af6) )
4443   DISK_IMAGE_READONLY( "826eaa01", 0, BAD_DUMP SHA1(be5f8b31fd18ba631fe98c2132c56abf20193419) )
44444444ROM_END
44454445
44464446ROM_START( konam80u )
r4425r4426
44544454   ROM_FILL( 0x0000000, 0x1000000, 0xff )
44554455
44564456   DISK_REGION( "cdrom0" )
4457   DISK_IMAGE_READONLY( "826uaa01", 0, MD5(456f683c5d47dd73cfb73ce80b8a7351) SHA1(452c94088ffefe42e61c978b48d425e7094a5af6) )
4457   DISK_IMAGE_READONLY( "826uaa01", 0, SHA1(be5f8b31fd18ba631fe98c2132c56abf20193419) )
44584458ROM_END
44594459
44604460ROM_START( pbballex )
r4425r4426
44684468   ROM_FILL( 0x0000000, 0x1000000, 0xff )
44694469
44704470   DISK_REGION( "cdrom0" )
4471   DISK_IMAGE_READONLY( "802jab02", 0, MD5(52bb53327ba48f87dcb030d5e50fe94f) SHA1(67ddce1ad7e436c18e08d5a8c77f3259dbf30572) )
4471   DISK_IMAGE_READONLY( "802jab02", 0, SHA1(bcc2b6c3515e2420eef9fdf8b28115368a428a92) )
44724472ROM_END
44734473
44744474ROM_START( pcnfrk3m )
r4425r4426
44914491   ROM_LOAD( "gca23ka.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
44924492
44934493   DISK_REGION( "cdrom0" )
4494   DISK_IMAGE_READONLY( "a23kaa02", 0, MD5(26a270851944d86d0b00db5a302de5ce) SHA1(5feaedf614c68932accc441f77c05c7bce67b2f3) )
4494   DISK_IMAGE_READONLY( "a23kaa02", 0, SHA1(5b853cc25eb583ed36d8cd402235b4f5c9ce065a) )
44954495ROM_END
44964496
44974497ROM_START( salarymc )
r4425r4426
45084508   ROM_LOAD( "gca18jaa.u6",  0x000000, 0x000008, CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
45094509
45104510   DISK_REGION( "cdrom0" )
4511   DISK_IMAGE_READONLY( "a18ja", 0, BAD_DUMP MD5(51d6cd5e34b6ee5601d8519a50be5cdc) SHA1(364a927a45ff83ee3cac66637359d6cfb44ea2fc) )
4511   DISK_IMAGE_READONLY( "a18ja", 0, BAD_DUMP SHA1(bb147b9a4871f1ddd108e3e503479221d87ec545) )
45124512ROM_END
45134513
45144514// System 573 BIOS (we're missing the later version that boots up with a pseudo-GUI)
src/mame/drivers/taitotz.c
r4425r4426
140140   ROM_LOAD( "e68-06.ic24", 0x3f4, 0x100, NO_DUMP )
141141
142142   DISK_REGION( "ide" )
143   DISK_IMAGE( "landhigh", 0, SHA1(c6b417a546db4b82870f49aaa66c8aba74195972) MD5(46e05e74f055548d1d981be152bacf9c) )
143   DISK_IMAGE( "landhigh", 0, SHA1(7cea4ea5c3899e6ac774a4eb12821f44541d9c9c) )
144144ROM_END
145145
146146GAME( 1999, landhigh, 0, taitotz, taitotz, 0, ROT0, "Taito", "Landing High Japan", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/taitogn.c
r0r4426
1/*
2
3GNET Motherboard
4Taito, 1998
5
6The Taito GNET System comprises the following main parts....
7- Sony ZN-2 Motherboard (Main CPU/GPU/SPU, RAM, BIOS, EEPROM & peripheral interfaces)
8- Taito FC PCB (Sound hardware & FLASHROMs for storage of PCMCIA cart contents)
9- Taito CD PCB (PCMCIA cart interface)
10
11Also available are...
12- Optional Communication Interface PCB
13- Optional Save PCB
14
15On power-up, the system checks for a PCMCIA cart. If the cart matches the contents of the flashROMs,
16the game boots immediately with no delay. If the cart doesn't match, it re-flashes the flashROMs with _some_
17of the information contained in the cart, which takes approximately 2-3 minutes. The game then resets
18and boots up.
19
20If no cart is present on power-up, the Taito GNET logo is displayed, then a message 'SYSTEM ERROR'
21Since the logo is shown on boot even without a cart, there must be another sub-BIOS for the initial booting,
22which I suspect is one of the flashROMs that is acting like a standard ROM and is not flashed at all.
23Upon inspecting the GNET top board, it appears flash.u30 is the sub-BIOS and perhaps U27 is something sound related.
24The flashROMs at U55, U56 & U29 appear to be the ones that are re-flashed when swapping game carts.
25
26PCB Layouts
27-----------
28(Standard ZN2 Motherboard)
29
30ZN-2 COH-3000 (sticker says COH-3002T denoting Taito GNET BIOS version)
31|--------------------------------------------------------|
32|  LA4705             |---------------------------|      |
33|                     |---------------------------|      |
34|    AKM_AK4310VM      AT28C16                           |
35|  VOL                                                   |
36|       S301           COH3002T.353                      |
37|                                                        |
38|                                                        |
39|J                                                       |
40|                                                        |
41|A              814260    CXD2925Q     EPM7064           |
42|                                                        |
43|M                                     67.73MHz          |
44|                                                        |
45|M                                                       |
46|            S551    KM4132G271BQ-8                      |
47|A                                                       |
48|                                CXD8654Q    CXD8661R    |
49|                    KM4132G271BQ-8                      |
50|CN505  CN506                   53.693MHz    100MHz      |
51|            CAT702                                      |
52|                                                        |
53|CN504  CN503                                            |
54|                                                        |
55|            MC44200FT                                   |
56|  NEC_78081G503        KM416V1204BT-L5  KM416V1204BT-L5 |
57|                                                        |
58|CN651  CN652                 *                 *        |
59|                CN654                                   |
60|--------------------------------------------------------|
61Notes:
62      CN506 - Connector for optional 3rd player controls
63      CN505 - Connector for optional 4th player controls
64      CN503 - Connector for optional 15kHz external video output (R,G,B,Sync, GND)
65      CN504 - Connector for optional 2nd speaker (for stereo output)
66      CN652 - Connector for optional trackball
67      CN651 - Connector for optional analog controls
68      CN654 - Connector for optional memory card
69      S301  - Slide switch for stereo or mono sound output
70      S551  - Dip switch (4 position, defaults all OFF)
71
72      COH3002T.353   - GNET BIOS 4MBit MaskROM type M534002 (SOP40)
73      AT28C16        - Atmel AT28C16 2K x8 EEPROM
74      814260-70      - 256K x16 (4MBit) DRAM
75      KM4132G271BQ-8 - 128K x 32Bit x 2 Banks SGRAM
76      KM416V1204BT-L5- 1M x16 EDO DRAM
77      EPM7064        - Altera EPM7064QC100 CPLD (QFP100)
78      CAT702         - Protection chip labelled 'TT10' (DIP20)
79      *              - Unpopulated position for additional KM416V1204BT-L5 RAMs
80
81
82FC PCB  K91X0721B  M43X0337B
83|--------------------------------------------|
84|   |---------------------------|            |
85|   |---------------------------|            |
86| NJM2100  NJM2100                           |
87| MB87078                                    |
88| *MB3773     XC95108         DIP40   CAT702 |
89| *ADM708AR                                  |
90| *UPD6379GR                                 |
91|             FLASH.U30                      |
92|                                            |
93| DIP24                                      |
94|                  *RF5C296                  |
95| -------CD-PCB------- _                     |
96| |                   | |                    |
97| |                   | |                    |
98| |                   | |                    |
99| |                   | |                    |
100| |                   | |                    |
101| |                   | |                    |
102| |                   | |                    |
103| |                   |-|                    |
104| --------------------                       |
105|          M66220FP   FLASH.U55   FLASH16.U29|
106|      FLASH.U27             FLASH.U56       |
107|*LC321664                                   |
108| TMS57002DPHA                *ZSG-2         |
109|           LH52B256      25MHz              |
110|   MN1020012A                               |
111|--------------------------------------------|
112Notes:
113      DIP40           - Unpopulated socket for 8MBit DIP40 EPROM type AM27C800
114      DIP24           - Unpopulated position for FM1208 DIP24 IC
115      FLASH.U30       - Intel TE28F160 16MBit FLASHROM (TSOP56)
116      FLASH.U29/55/56 - Intel TE28F160 16MBit FLASHROM (TSOP56)
117      FLASH.U27       - Intel E28F400 4MBit FLASHROM (TSOP48)
118      LH52B256        - Sharp 32K x8 SRAM (SOP28)
119      LC321664        - Sanyo 64K x16 EDO DRAM (SOP40)
120      XC95108         - XILINX XC95108 CPLD labelled 'E65-01' (QFP100)
121      MN1020012A      - Panasonic MN1020012A Sound CPU (QFP128)
122      ZSG-2           - Zoom Corp ZSG-2 Sound DSP (QFP100)
123      TMS57002DPHA    - Texas Instruments TMS57002DPHA Sound DSP (QFP80)
124      RF5C296         - Ricoh RF5C296 PCMCIA controller (TQFP144)
125      M66220FP        - 256 x8bit Mail-Box (Inter-MPU data transfer)
126      CAT702          - Protection chip labelled 'TT16' (DIP20)
127      CD PCB          - A PCMCIA cart slot connector mounted onto a small daughterboard
128      *               - These parts located under the PCB
129
130*/
131
132#include "driver.h"
133#include "cpu/mips/psx.h"
134#include "includes/psx.h"
135#include "machine/at28c16.h"
136#include "machine/intelfsh.h"
137#include "machine/znsec.h"
138#include "machine/idectrl.h"
139#include "sound/psx.h"
140
141
142static unsigned char cis[512];
143static int locked;
144
145// rf5c296 is very inaccurate at that point, it hardcodes the gnet config
146
147static unsigned char rf5c296_reg = 0;
148
149static void rf5c296_reg_w(ATTR_UNUSED running_machine *machine, UINT8 reg, UINT8 data)
150{
151   //  fprintf(stderr, "rf5c296_reg_w %02x, %02x (%s)\n", reg, data, cpuexec_describe_context(machine));
152}
153
154static UINT8 rf5c296_reg_r(ATTR_UNUSED running_machine *machine, UINT8 reg)
155{
156   //  fprintf(stderr, "rf5c296_reg_r %02x (%s)\n", reg, cpuexec_describe_context(machine));
157   return 0x00;
158}
159
160static WRITE32_HANDLER(rf5c296_io_w)
161{
162   if(offset < 2) {
163      ide_controller32_pcmcia_w(devtag_get_device(space->machine, "card"), offset, data, mem_mask);
164      return;
165   }
166
167   if(offset == 0x3e0/4) {
168      if(ACCESSING_BITS_0_7)
169         rf5c296_reg = data;
170      if(ACCESSING_BITS_8_15)
171         rf5c296_reg_w(space->machine, rf5c296_reg, data >> 8);
172   }
173}
174
175static READ32_HANDLER(rf5c296_io_r)
176{
177   if(offset < 2)
178      return ide_controller32_pcmcia_r(devtag_get_device(space->machine, "card"), offset, mem_mask);
179
180   offset *= 4;
181
182   if(offset == 0x3e0/4) {
183      UINT32 res = 0xffff0000;
184      if(ACCESSING_BITS_0_7)
185         res |= rf5c296_reg;
186      if(ACCESSING_BITS_8_15)
187         res |= rf5c296_reg_r(space->machine, rf5c296_reg) << 8;
188      return res;
189   }
190
191   return 0xffffffff;
192}
193
194// Hardcoded to reach the pcmcia CIS
195
196static READ32_HANDLER(rf5c296_mem_r)
197{
198   if(offset < 0x80)
199      return (cis[offset*2+1] << 16) | cis[offset*2];
200
201   switch(offset) {
202   case 0x080: return 0x00800041;
203   case 0x081: return 0x0000002e;
204   case 0x100: return locked ? 0x00010000 : 0;
205   default:
206      return 0;
207   }
208}
209
210static WRITE32_HANDLER(rf5c296_mem_w)
211{
212   if(offset >= 0x140 && offset <= 0x144) {
213      UINT8 key[5];
214      int pos = (offset - 0x140)*2;
215      UINT8 v, k;
216      if(ACCESSING_BITS_16_23) {
217         v = data >> 16;
218         pos++;
219      } else
220         v = data;
221      chd_get_metadata(get_disk_handle("card"), HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0);
222      k = pos < 5 ? key[pos] : 0;
223      if(v == k)
224         locked &= ~(1 << pos);
225      else
226         locked |= 1 << pos;
227   }
228}
229
230
231// Flash handling
232
233static UINT32 gen_flash_r(running_machine *machine, int chip, offs_t offset, UINT32 mem_mask)
234{
235   UINT32 res = 0;
236   offset *= 2;
237   if(ACCESSING_BITS_0_15)
238      res |= intelflash_read(chip, offset);
239   if(ACCESSING_BITS_16_31)
240      res |= intelflash_read(chip, offset+1) << 16;
241   return res;
242}
243
244static void gen_flash_w(running_machine *machine, int chip, offs_t offset, UINT32 data, UINT32 mem_mask)
245{
246   offset *= 2;
247   if(ACCESSING_BITS_0_15)
248      intelflash_write(chip, offset, data);
249   if(ACCESSING_BITS_16_31)
250       intelflash_write(chip, offset+1, data >> 16);
251}
252
253
254static READ32_HANDLER(flash_subbios_r)
255{
256   return gen_flash_r(space->machine, 0, offset, mem_mask);
257}
258
259static WRITE32_HANDLER(flash_subbios_w)
260{
261   gen_flash_w(space->machine, 0, offset, data, mem_mask);
262}
263
264static READ32_HANDLER(flash_mn102_r)
265{
266   return gen_flash_r(space->machine, 1, offset, mem_mask);
267}
268
269static WRITE32_HANDLER(flash_mn102_w)
270{
271   gen_flash_w(space->machine, 1, offset, data, mem_mask);
272}
273
274static READ32_HANDLER(flash_s1_r)
275{
276   return gen_flash_r(space->machine, 2, offset, mem_mask);
277}
278
279static WRITE32_HANDLER(flash_s1_w)
280{
281   gen_flash_w(space->machine, 2, offset, data, mem_mask);
282}
283
284static READ32_HANDLER(flash_s2_r)
285{
286   return gen_flash_r(space->machine, 3, offset, mem_mask);
287}
288
289static WRITE32_HANDLER(flash_s2_w)
290{
291   gen_flash_w(space->machine, 3, offset, data, mem_mask);
292}
293
294static READ32_HANDLER(flash_s3_r)
295{
296   return gen_flash_r(space->machine, 4, offset, mem_mask);
297}
298
299static WRITE32_HANDLER(flash_s3_w)
300{
301   gen_flash_w(space->machine, 4, offset, data, mem_mask);
302}
303
304
305
306static void install_handlers(running_machine *machine, int mode)
307{
308   const address_space *a = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
309   if(mode == 0) {
310      // Mode 0 has access to the subbios, the mn102 flash and the rf5c296 mem zone
311      memory_install_readwrite32_handler(a, 0x1f000000, 0x1f1fffff, 0, 0, flash_subbios_r, flash_subbios_w);
312      memory_install_readwrite32_handler(a, 0x1f200000, 0x1f2fffff, 0, 0, rf5c296_mem_r, rf5c296_mem_w);
313      memory_install_readwrite32_handler(a, 0x1f300000, 0x1f37ffff, 0, 0, flash_mn102_r, flash_mn102_w);
314      memory_install_readwrite32_handler(a, 0x1f380000, 0x1f5fffff, 0, 0, SMH_NOP, SMH_NOP);
315
316   } else {
317      // Mode 1 has access to the 3 samples flashes
318      memory_install_readwrite32_handler(a, 0x1f000000, 0x1f1fffff, 0, 0, flash_s1_r, flash_s1_w);
319      memory_install_readwrite32_handler(a, 0x1f200000, 0x1f3fffff, 0, 0, flash_s2_r, flash_s2_w);
320      memory_install_readwrite32_handler(a, 0x1f400000, 0x1f5fffff, 0, 0, flash_s3_r, flash_s3_w);
321   }
322}
323
324// Misc. controls
325
326static UINT32 control = 0, control2 = 0, control3;
327
328static READ32_HANDLER(control_r)
329{
330   //      fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, cpuexec_describe_context(space->machine));
331   return control;
332}
333
334static WRITE32_HANDLER(control_w)
335{
336   // 20 = watchdog
337   // 04 = select bank
338
339   // According to the rom code, bits 1-0 may be part of the bank
340   // selection too, but they're always 0.
341
342   UINT32 p = control;
343   COMBINE_DATA(&control);
344
345#if 0
346   if((p ^ control) & ~0x20)
347      fprintf(stderr, "control = %c%c.%c %c%c%c%c (%s)\n",
348            control & 0x80 ? '1' : '0',
349            control & 0x40 ? '1' : '0',
350            control & 0x10 ? '1' : '0',
351            control & 0x08 ? '1' : '0',
352            control & 0x04 ? 'f' : '-',
353            control & 0x02 ? '1' : '0',
354            control & 0x01 ? '1' : '0',
355            cpuexec_describe_context(space->machine));
356#endif
357
358   if((p ^ control) & 0x04)
359      install_handlers(space->machine, control & 4 ? 1 : 0);
360}
361
362static WRITE32_HANDLER(control2_w)
363{
364   COMBINE_DATA(&control2);
365}
366
367static READ32_HANDLER(control3_r)
368{
369   return control3;
370}
371
372static WRITE32_HANDLER(control3_w)
373{
374   COMBINE_DATA(&control3);
375
376   // card reset, maybe
377   if(control3 & 2) {
378      devtag_reset(space->machine, "card");
379      locked = 0x1ff;
380   }
381}
382
383static READ32_HANDLER(gn_1fb70000_r)
384{
385   // (1328) 1348 tests mask 0002, 8 times.
386   // Called by 1434, exit at 143c
387   // f -> 4/1
388   // end with 4x1 -> ok
389   // end with 4x0 -> configid error
390   // so returning 2 always works, strange.
391
392   return 2;
393}
394
395static WRITE32_HANDLER(gn_1fb70000_w)
396{
397   // Writes 0 or 1 all the time, it *may* have somthing to do with
398   // i/o port width, but then maybe not
399}
400
401static READ32_HANDLER(hack1_r)
402{
403   static int v = 0;
404   v = v ^ 8;
405   // Probably something to do with sound
406   return v;
407}
408
409
410
411// Lifted from zn.c
412
413static const UINT8 tt10[ 8 ] = { 0x80, 0x20, 0x38, 0x08, 0xf1, 0x03, 0xfe, 0xfc };
414static const UINT8 tt16[ 8 ] = { 0xc0, 0x04, 0xf9, 0xe1, 0x60, 0x70, 0xf2, 0x02 };
415
416static UINT32 m_n_znsecsel;
417static UINT32 m_b_znsecport;
418static int m_n_dip_bit;
419static int m_b_lastclock;
420static emu_timer *dip_timer;
421
422static READ32_HANDLER( znsecsel_r )
423{
424   return m_n_znsecsel;
425}
426
427static void sio_znsec0_handler( running_machine *machine, int n_data )
428{
429   if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
430        {
431         if( m_b_lastclock )
432            psx_sio_input( machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 0, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
433         m_b_lastclock = 0;
434        }
435   else
436        {
437         m_b_lastclock = 1;
438        }
439}
440
441static void sio_znsec1_handler( running_machine *machine, int n_data )
442{
443   if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
444        {
445         if( m_b_lastclock )
446            psx_sio_input( machine, 0, PSX_SIO_IN_DATA, ( znsec_step( 1, ( n_data & PSX_SIO_OUT_DATA ) != 0 ) != 0 ) * PSX_SIO_IN_DATA );
447         m_b_lastclock = 0;
448        }
449   else
450        {
451         m_b_lastclock = 1;
452        }
453}
454
455static void sio_pad_handler( running_machine *machine, int n_data )
456{
457   if( ( n_data & PSX_SIO_OUT_DTR ) != 0 )
458        {
459         m_b_znsecport = 1;
460        }
461   else
462        {
463         m_b_znsecport = 0;
464        }
465
466   psx_sio_input( machine, 0, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR );
467}
468
469static void sio_dip_handler( running_machine *machine, int n_data )
470{
471   if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
472   {
473      if( m_b_lastclock )
474      {
475         int bit = ( ( input_port_read(machine, "DSW") >> m_n_dip_bit ) & 1 );
476         psx_sio_input( machine, 0, PSX_SIO_IN_DATA, bit * PSX_SIO_IN_DATA );
477         m_n_dip_bit++;
478         m_n_dip_bit &= 7;
479      }
480      m_b_lastclock = 0;
481   }
482   else
483   {
484      m_b_lastclock = 1;
485   }
486}
487
488static WRITE32_HANDLER( znsecsel_w )
489{
490   COMBINE_DATA( &m_n_znsecsel );
491
492   if( ( m_n_znsecsel & 0x80 ) == 0 )
493        {
494         psx_sio_install_handler( 0, sio_pad_handler );
495         psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
496        }
497   else if( ( m_n_znsecsel & 0x08 ) == 0 )
498        {
499         znsec_start( 1 );
500         psx_sio_install_handler( 0, sio_znsec1_handler );
501         psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
502        }
503   else if( ( m_n_znsecsel & 0x04 ) == 0 )
504        {
505         znsec_start( 0 );
506         psx_sio_install_handler( 0, sio_znsec0_handler );
507         psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
508        }
509   else
510        {
511         m_n_dip_bit = 0;
512         m_b_lastclock = 1;
513
514         psx_sio_install_handler( 0, sio_dip_handler );
515         psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
516
517         timer_adjust_oneshot( dip_timer, cpu_clocks_to_attotime( space->cpu, 100 ), 1 );
518        }
519}
520
521static TIMER_CALLBACK( dip_timer_fired )
522{
523   psx_sio_input( machine, 0, PSX_SIO_IN_DSR, param * PSX_SIO_IN_DSR );
524
525   if( param )
526   {
527      timer_adjust_oneshot( dip_timer, cpu_clocks_to_attotime( machine->cpu[0], 50 ), 0 );
528   }
529}
530
531
532static READ32_HANDLER( boardconfig_r )
533{
534   /*
535    ------00 mem=4M
536    ------01 mem=4M
537    ------10 mem=8M
538    ------11 mem=16M
539    -----0-- smem=hM
540    -----1-- smem=2M
541    ----0--- vmem=1M
542    ----1--- vmem=2M
543    000----- rev=-2
544    001----- rev=-1
545    010----- rev=0
546    011----- rev=1
547    100----- rev=2
548    101----- rev=3
549    110----- rev=4
550    111----- rev=5
551    */
552
553   return 64|32|8;
554}
555
556
557static UINT32 coin_info;
558
559static WRITE32_HANDLER( coin_w )
560{
561   /* 0x01=counter
562       0x02=coin lock 1
563       0x08=??
564       0x20=coin lock 2
565       0x80=??
566    */
567   COMBINE_DATA (&coin_info);
568}
569
570static READ32_HANDLER( coin_r )
571{
572   return coin_info;
573}
574
575/* mahjong panel handler (for Usagi & Mahjong Oh) */
576static READ32_HANDLER( gnet_mahjong_panel_r )
577{
578   static UINT32 mux_data;
579
580   mux_data = coin_info;
581   mux_data &= 0xcc;
582
583   switch(mux_data)
584   {
585      case 0x04: return input_port_read(space->machine, "KEY0");
586      case 0x08: return input_port_read(space->machine, "KEY1");
587      case 0x40: return input_port_read(space->machine, "KEY2");
588      case 0x80: return input_port_read(space->machine, "KEY3");
589   }
590
591   /* mux disabled */
592   return input_port_read(space->machine, "P4");
593}
594
595// Init and reset
596
597static NVRAM_HANDLER( coh3002t )
598{
599   nvram_handler_intelflash(machine, 0, file, read_or_write);
600   nvram_handler_intelflash(machine, 1, file, read_or_write);
601   nvram_handler_intelflash(machine, 2, file, read_or_write);
602   nvram_handler_intelflash(machine, 3, file, read_or_write);
603   nvram_handler_intelflash(machine, 4, file, read_or_write);
604
605   if(!file) {
606      // Only the subbios needs to preexist for the board to work
607      memcpy(intelflash_getmemptr(0), memory_region(machine, "subbios"), 0x200000);
608   }
609}
610
611static DRIVER_INIT( coh3002t )
612{
613   // Sub-bios (u30)
614   intelflash_init(machine, 0, FLASH_INTEL_TE28F160, 0);
615
616   // mn102 program flash (u27)
617   intelflash_init(machine, 1, FLASH_INTEL_E28F400, 0);
618
619   // Samples (u29, u55, u56)
620   intelflash_init(machine, 2, FLASH_INTEL_TE28F160, 0);
621   intelflash_init(machine, 3, FLASH_INTEL_TE28F160, 0);
622   intelflash_init(machine, 4, FLASH_INTEL_TE28F160, 0);
623
624   psx_driver_init(machine);
625   znsec_init(0, tt10);
626   znsec_init(1, tt16);
627   psx_sio_install_handler(0, sio_pad_handler);
628   dip_timer = timer_alloc(machine,  dip_timer_fired, NULL );
629
630   memset(cis, 0xff, 512);
631   chd_get_metadata(get_disk_handle("card"), PCMCIA_CIS_METADATA_TAG, 0, cis, 512, 0, 0, 0);
632}
633
634static DRIVER_INIT( coh3002t_mp )
635{
636   DRIVER_INIT_CALL(coh3002t);
637   memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1fa10100, 0x1fa10103, 0, 0, gnet_mahjong_panel_r );
638}
639
640static MACHINE_RESET( coh3002t )
641{
642   m_b_lastclock = 1;
643   locked = 0x1ff;
644   install_handlers(machine, 0);
645   control = 0;
646   psx_machine_init(machine);
647   devtag_reset(machine, "card");
648}
649
650static ADDRESS_MAP_START( zn_map, ADDRESS_SPACE_PROGRAM, 32 )
651   AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE(1) AM_BASE(&g_p_n_psxram) AM_SIZE(&g_n_psxramsize) /*
652 ram */
653   AM_RANGE(0x00400000, 0x007fffff) AM_RAM AM_SHARE(1) /* ram mirror */
654   AM_RANGE(0x1f000000, 0x1f1fffff) AM_READWRITE(flash_s1_r, flash_s1_w)
655   AM_RANGE(0x1f200000, 0x1f3fffff) AM_READWRITE(flash_s2_r, flash_s2_w)
656   AM_RANGE(0x1f400000, 0x1f5fffff) AM_READWRITE(flash_s3_r, flash_s3_w)
657   AM_RANGE(0x1f800000, 0x1f8003ff) AM_RAM /* scratchpad */
658   AM_RANGE(0x1f801000, 0x1f80100f) AM_RAM /* ?? */
659   AM_RANGE(0x1f801014, 0x1f801017) AM_DEVREADWRITE("spu", psx_spu_delay_r, psx_spu_delay_w)
660   AM_RANGE(0x1f801020, 0x1f801023) AM_READWRITE(psx_com_delay_r, psx_com_delay_w)
661   AM_RANGE(0x1f801040, 0x1f80105f) AM_READWRITE(psx_sio_r, psx_sio_w)
662   AM_RANGE(0x1f801070, 0x1f801077) AM_READWRITE(psx_irq_r, psx_irq_w)
663   AM_RANGE(0x1f801080, 0x1f8010ff) AM_READWRITE(psx_dma_r, psx_dma_w)
664   AM_RANGE(0x1f801100, 0x1f80112f) AM_READWRITE(psx_counter_r, psx_counter_w)
665   AM_RANGE(0x1f801810, 0x1f801817) AM_READWRITE(psx_gpu_r, psx_gpu_w)
666   AM_RANGE(0x1f801820, 0x1f801827) AM_READWRITE(psx_mdec_r, psx_mdec_w)
667   AM_RANGE(0x1f801c00, 0x1f801dff) AM_DEVREADWRITE("spu", psx_spu_r, psx_spu_w)
668   AM_RANGE(0x1fa00000, 0x1fa00003) AM_READ_PORT("P1")
669   AM_RANGE(0x1fa00100, 0x1fa00103) AM_READ_PORT("P2")
670   AM_RANGE(0x1fa00200, 0x1fa00203) AM_READ_PORT("SERVICE")
671   AM_RANGE(0x1fa00300, 0x1fa00303) AM_READ_PORT("SYSTEM")
672   AM_RANGE(0x1fa10000, 0x1fa10003) AM_READ_PORT("P3")
673   AM_RANGE(0x1fa10100, 0x1fa10103) AM_READ_PORT("P4")
674   AM_RANGE(0x1fa10200, 0x1fa10203) AM_READ(boardconfig_r)
675   AM_RANGE(0x1fa10300, 0x1fa10303) AM_READWRITE(znsecsel_r, znsecsel_w)
676   AM_RANGE(0x1fa20000, 0x1fa20003) AM_READWRITE(coin_r, coin_w)
677   AM_RANGE(0x1fa30000, 0x1fa30003) AM_READWRITE(control3_r, control3_w)
678   AM_RANGE(0x1fa51c00, 0x1fa51dff) AM_DEVREADWRITE("spu", psx_spu_r, psx_spu_w) // systematic read at spu_address + 250000, result dropped, maybe other accesses
679   AM_RANGE(0x1fa60000, 0x1fa60003) AM_READ(hack1_r)
680   AM_RANGE(0x1faf0000, 0x1faf07ff) AM_DEVREADWRITE8("at28c16", at28c16_r, at28c16_w, 0xffffffff) /* eeprom */
681   AM_RANGE(0x1fb00000, 0x1fb0ffff) AM_READWRITE(rf5c296_io_r, rf5c296_io_w)
682   AM_RANGE(0x1fb40000, 0x1fb40003) AM_READWRITE(control_r, control_w)
683   AM_RANGE(0x1fb60000, 0x1fb60003) AM_WRITE(control2_w)
684   AM_RANGE(0x1fb70000, 0x1fb70003) AM_READWRITE(gn_1fb70000_r, gn_1fb70000_w)
685   AM_RANGE(0x1fbe0000, 0x1fbe01ff) AM_RAM // 256 bytes com zone with the mn102, low bytes of words only, with additional comm at 1fb80000
686   AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_SHARE(2) AM_REGION("mainbios", 0) /* bios */
687   AM_RANGE(0x80000000, 0x803fffff) AM_RAM AM_SHARE(1) /* ram mirror */
688   AM_RANGE(0x80400000, 0x807fffff) AM_RAM AM_SHARE(1) /* ram mirror */
689   AM_RANGE(0x9fc00000, 0x9fc7ffff) AM_ROM AM_SHARE(2) /* bios mirror */
690   AM_RANGE(0xa0000000, 0xa03fffff) AM_RAM AM_SHARE(1) /* ram mirror */
691   AM_RANGE(0xbfc00000, 0xbfc7ffff) AM_WRITENOP AM_ROM AM_SHARE(2) /* bios mirror */
692   AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP
693ADDRESS_MAP_END
694
695
696static void psx_spu_irq(const device_config *device, UINT32 data)
697{
698   psx_irq_set(device->machine, data);
699}
700
701static const psx_spu_interface psxspu_interface =
702{
703   &g_p_n_psxram,
704   psx_spu_irq,
705   psx_dma_install_read_handler,
706   psx_dma_install_write_handler
707};
708
709static MACHINE_DRIVER_START( coh3002t )
710   /* basic machine hardware */
711   MDRV_CPU_ADD( "maincpu", PSXCPU, XTAL_100MHz )
712   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
713   MDRV_CPU_VBLANK_INT("screen", psx_vblank)
714
715   /* video hardware */
716   MDRV_SCREEN_ADD("screen", RASTER)
717   MDRV_SCREEN_REFRESH_RATE( 60 )
718   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
719   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
720   MDRV_SCREEN_SIZE( 1024, 1024 )
721   MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 )
722
723   MDRV_PALETTE_LENGTH( 65536 )
724
725   MDRV_PALETTE_INIT( psx )
726   MDRV_VIDEO_START( psx_type2 )
727   MDRV_VIDEO_UPDATE( psx )
728
729   /* sound hardware */
730   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
731
732   MDRV_SOUND_ADD( "spu", PSXSPU, 0 )
733   MDRV_SOUND_CONFIG( psxspu_interface )
734   MDRV_SOUND_ROUTE(0, "lspeaker", 0.35)
735   MDRV_SOUND_ROUTE(1, "rspeaker", 0.35)
736
737   MDRV_MACHINE_RESET( coh3002t )
738
739   MDRV_AT28C16_ADD( "at28c16", 0 )
740   MDRV_IDE_CONTROLLER_ADD( "card", 0 )
741   MDRV_NVRAM_HANDLER( coh3002t )
742MACHINE_DRIVER_END
743
744static INPUT_PORTS_START( coh3002t )
745   PORT_START("P1")
746   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
747   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
748   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
749   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
750   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
751   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
752   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
753   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
754
755   PORT_START("P2")
756   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
757   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
758   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
759   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
760   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
761   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
762   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
763   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
764
765   PORT_START("SERVICE")
766   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
767   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
768   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
769   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
770
771   PORT_START("SYSTEM")
772   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
773   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
774   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
775   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 )
776   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
777   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
778   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
779   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4 )
780
781   PORT_START("P3")
782   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
783   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
784   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
785   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
786   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
787   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
788   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
789   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
790
791   PORT_START("P4")
792   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
793   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
794   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
795   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
796   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
797   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
798   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
799   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
800
801   PORT_START("DSW")
802   PORT_DIPNAME( 0x01, 0x01, "Freeze" )
803   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
804   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
805   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Service_Mode ) )
806   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
807   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
808   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
809   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
810   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
811   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
812   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
813   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
814INPUT_PORTS_END
815
816/* input port define for the mahjong panel (standard type) */
817static INPUT_PORTS_START( coh3002t_mp )
818   PORT_INCLUDE( coh3002t )
819
820   PORT_START("KEY0")
821   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
822   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
823   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
824   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
825   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
826   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
827   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
828
829   PORT_START("KEY1")
830   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
831   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
832   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
833   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
834   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
835   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //rate button
836   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
837
838   PORT_START("KEY2")
839   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
840   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
841   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
842   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
843   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
844   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
845   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
846
847   PORT_START("KEY3")
848   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
849   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
850   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
851   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
852   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
853INPUT_PORTS_END
854
855
856//    ROM_LOAD( "flashv2.u30",    0x000000, 0x200000, CRC(f624ebf8) SHA1(be84ef1b083f819f3ab13c983c52bca97bb908ef) )
857
858#define TAITOGNET_BIOS \
859   ROM_REGION32_LE( 0x080000, "mainbios", 0 ) \
860   ROM_LOAD( "coh-3002t.353", 0x000000, 0x080000, CRC(03967fa7) SHA1(0e17fec2286e4e25deb23d40e41ce0986f373d49) ) \
861\
862   ROM_REGION32_LE( 0x200000, "subbios", 0 ) \
863    ROM_LOAD( "flash.u30",     0x000000, 0x200000, CRC(c48c8236) SHA1(c6dad60266ce2ff635696bc0d91903c543273559) ) \
864   ROM_REGION32_LE( 0x80000,  "soundcpu", 0) \
865   ROM_FILL( 0, 0x80000, 0xff) \
866   ROM_REGION32_LE( 0x600000, "samples", 0) \
867   ROM_FILL( 0, 0x600000, 0xff)
868
869ROM_START( taitogn )
870   TAITOGNET_BIOS
871ROM_END
872
873/* Taito */
874
875ROM_START(raycris)
876   TAITOGNET_BIOS
877
878   DISK_REGION( "card" )
879   DISK_IMAGE( "raycris", 0, SHA1(015cb0e6c4421cc38809de28c4793b4491386aee))
880ROM_END
881
882
883ROM_START(gobyrc)
884   TAITOGNET_BIOS
885
886   DISK_REGION( "card" )
887   DISK_IMAGE( "gobyrc", 0, SHA1(0bee1f495fc8b033fd56aad9260ae94abb35eb58))
888ROM_END
889
890ROM_START(rcdego)
891   TAITOGNET_BIOS
892
893   DISK_REGION( "card" )
894   DISK_IMAGE( "rcdego", 0, SHA1(9e177f2a3954cfea0c8c5a288e116324d10f5dd1))
895ROM_END
896
897ROM_START(chaoshea)
898   TAITOGNET_BIOS
899
900   DISK_REGION( "card" )
901   DISK_IMAGE( "chaoshea", 0, SHA1(2f211ac08675ea8ec33c7659a13951db94eaa627))
902ROM_END
903
904
905ROM_START(flipmaze)
906   TAITOGNET_BIOS
907
908   DISK_REGION( "card" )
909   DISK_IMAGE( "flipmaze", 0, SHA1(423b6c06f4f2d9a608ce20b61a3ac11687d22c40) )
910ROM_END
911
912
913ROM_START(spuzbobl)
914   TAITOGNET_BIOS
915
916   DISK_REGION( "card" )
917   DISK_IMAGE( "spuzbobl", 0, SHA1(1b1c72fb7e5656021485fefaef8f2ba48e2b4ea8))
918ROM_END
919
920
921ROM_START(soutenry)
922   TAITOGNET_BIOS
923
924   DISK_REGION( "card" )
925   DISK_IMAGE( "soutenry", 0, SHA1(9204d0be833d29f37b8cd3fbdf09da69b622254b))
926ROM_END
927
928ROM_START(shanghss)
929   TAITOGNET_BIOS
930
931   DISK_REGION( "card" )
932   DISK_IMAGE( "shanghss", 0, SHA1(7964f71ec5c81d2120d83b63a82f97fbad5a8e6d))
933ROM_END
934
935ROM_START(sianniv)
936   TAITOGNET_BIOS
937
938   DISK_REGION( "card" )
939   DISK_IMAGE( "sianniv", 0, SHA1(1e08b813190a9e1baf29bc16884172d6c8da7ae3))
940ROM_END
941
942
943/* Success */
944
945ROM_START(psyvaria)
946   TAITOGNET_BIOS
947
948   DISK_REGION( "card" )
949   DISK_IMAGE( "psyvaria", 0,  SHA1(a80e164c09d795085b65659d1df60710530549c3))
950ROM_END
951
952ROM_START(psyvarrv)
953   TAITOGNET_BIOS
954
955   DISK_REGION( "card" )
956   DISK_IMAGE( "psyvarrv", 0, SHA1(c12f0d5cbb6ec7f906e3dcdc3047c22de36457a5))
957ROM_END
958
959
960ROM_START(zokuoten)
961   TAITOGNET_BIOS
962
963   DISK_REGION( "card" )
964   DISK_IMAGE( "zokuoten", 0, SHA1(5ce13db00518f96af64935176c71ec68d2a51938))
965ROM_END
966
967/* Takumi */
968
969ROM_START(nightrai)
970   TAITOGNET_BIOS
971
972   DISK_REGION( "card" )
973   DISK_IMAGE( "nightrai", 0, SHA1(7a4d62018fd19ccbdec12b6d24052d49f8a8359e))
974ROM_END
975
976/* Warashi */
977
978ROM_START(usagi)
979   TAITOGNET_BIOS
980
981   DISK_REGION( "card" )
982   DISK_IMAGE( "usagi", 0, SHA1(edf9dd271957f6cb06feed238ae21100514bef8e))
983ROM_END
984
985ROM_START(mahjngoh)
986   TAITOGNET_BIOS
987
988   DISK_REGION( "card" )
989   DISK_IMAGE( "mahjngoh", 0, SHA1(3ef1110d15582d7c0187438d7ad61765dd121cff))
990ROM_END
991
992/* Triangle Service */
993
994ROM_START(xiistag)
995   TAITOGNET_BIOS
996
997   DISK_REGION( "card" )
998   DISK_IMAGE( "xiistag", 0, SHA1(8e0b2ee88edf0b45b3b4063d65eae236c12ee8ff))
999ROM_END
1000
1001
1002/* A dummy driver, so that the bios can be debugged, and to serve as */
1003/* parent for the coh-3002t.353 file, so that we do not have to include */
1004/* it in every zip file */
1005GAME( 1997, taitogn,  0, coh3002t, coh3002t, coh3002t, ROT0, "Sony/Taito", "Taito GNET", GAME_IS_BIOS_ROOT )
1006
1007GAME( 1998, raycris,  taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Taito", "Ray Crisis (V2.03J)", 0 )
1008GAME( 199?, gobyrc, taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Taito", "Go By RC (V2.03O)", GAME_NOT_WORKING ) // custom inputs need calibrating
1009GAME( 199?, rcdego, gobyrc,  coh3002t, coh3002t, coh3002t, ROT0, "Taito", "RC De Go (V2.03J)", GAME_NOT_WORKING ) // custom inputs need calibrating
1010GAME( 1998, chaoshea, taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Taito", "Chaos Heat (V2.08J)", 0 )
1011GAME( 1998, flipmaze, taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Taito/Moss", "Flip Maze (V2.04J)", 0 )
1012GAME( 1999, spuzbobl, taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Taito", "Super Puzzle Bobble (V2.05O)", 0 )
1013GAME( 2000, soutenry, taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Taito", "Soutenryu (V2.07J)", 0 )
1014GAME( 2000, shanghss, taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Taito", "Shanghai Shoryu Sairin (V2.03J)", 0 )
1015GAME( 2003, sianniv,  taitogn, coh3002t, coh3002t, coh3002t, ROT270, "Taito", "Space Invaders Anniversary (V2.02J)", GAME_NOT_WORKING ) // IRQ at the wrong time
1016
1017GAME( 2000, psyvaria, taitogn, coh3002t, coh3002t, coh3002t, ROT270, "Success", "Psyvariar -Medium Unit- (V2.04J)", 0 )
1018GAME( 2000, psyvarrv, taitogn, coh3002t, coh3002t, coh3002t, ROT270, "Success", "Psyvariar -Revision- (V2.04J)", 0 )
1019GAME( 2000, zokuoten, taitogn, coh3002t, coh3002t, coh3002t, ROT0,   "Success", "Zoku Otenamihaiken (V2.03J)", 0 )
1020
1021GAME( 199?, usagi,    taitogn, coh3002t, coh3002t_mp, coh3002t_mp, ROT0, "Warashi/Mahjong Kobo/Taito", "Usagi (V2.02J)", 0 )
1022GAME( 1999, mahjngoh, taitogn, coh3002t, coh3002t_mp, coh3002t_mp, ROT0, "Warashi/Mahjong Kobo/Taito", "Mahjong Oh (V2.06J)", 0 )
1023
1024GAME( 2001, nightrai, taitogn, coh3002t, coh3002t, coh3002t, ROT0, "Takumi", "Night Raid (V2.03J)", GAME_NOT_WORKING ) // no background / enemy sprites
1025
1026GAME( 2002, xiistag,  taitogn, coh3002t, coh3002t, coh3002t, ROT270, "Triangle Service", "XII Stag (V2.01J)", 0 )
src/mame/drivers/cojag.c
r4425r4426
11781178   ROM_LOAD32_BYTE( "3k.bin", 0x00003, 0x80000, CRC(94f50c14) SHA1(a54552e3ac5c4f481ba4f2fc7d724534576fe76c) )
11791179
11801180   DISK_REGION( "ide" )
1181   DISK_IMAGE( "area51t", 0, MD5(60d051da941d76aafd47c862e3b6e209) SHA1(fee528eef8a256f87af299499ecf5817218f5202) )
1181   DISK_IMAGE( "area51t", 0, SHA1(d2865cc7b1bb08a4393a72013a90e18d8a8f9860) )
11821182ROM_END
11831183
11841184ROM_START( area51a ) /* 68020 based, Area51 Atari Games License  Date: Oct 25, 1995 */
r4425r4426
11891189   ROM_LOAD32_BYTE( "3k", 0x00003, 0x80000, CRC(729eb1b7) SHA1(21864b4281b1ad17b2903e3aa294e4be74161e80) )
11901190
11911191   DISK_REGION( "ide" )
1192   DISK_IMAGE( "area51", 0, MD5(130b330eff59403f8fc3433ff501852b) SHA1(9ea749404c9a5d44f407cdb8803293ec0d61410d) )
1192   DISK_IMAGE( "area51", 0, SHA1(3b303bc37e206a6d7339352c869f050d04186f11) )
11931193ROM_END
11941194
11951195ROM_START( area51 ) /* R3000 based, labeled as "Area51 2-C"  Date: Nov 11 1996 */
r4425r4426
12001200   ROM_LOAD32_BYTE( "a51_2-c.ll", 0x00003, 0x80000, CRC(471b15d2) SHA1(4b5f45ee140b03a6be61475cae1c2dbef0f07457) )
12011201
12021202   DISK_REGION( "ide" )
1203   DISK_IMAGE( "area51", 0, MD5(130b330eff59403f8fc3433ff501852b) SHA1(9ea749404c9a5d44f407cdb8803293ec0d61410d) )
1203   DISK_IMAGE( "area51", 0, SHA1(3b303bc37e206a6d7339352c869f050d04186f11) )
12041204ROM_END
12051205
12061206ROM_START( maxforce ) /* R3000 based, labeled as "Maximum Force 5-23-97 v1.05" */
r4425r4426
12111211   ROM_LOAD32_BYTE( "maxf_105.ll", 0x00003, 0x80000, CRC(16d0768d) SHA1(665a6d7602a7f2f5b1f332b0220b1533143d56b1) )
12121212
12131213   DISK_REGION( "ide" )
1214   DISK_IMAGE( "maxforce", 0, MD5(b0a214c7b3f8ba9d592396332fc974c9) SHA1(59d77280afdb2d1f801ee81786aa7d3166ec2695) )
1214   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
12151215ROM_END
12161216
12171217
r4425r4426
12231223   ROM_LOAD32_BYTE( "maxf_102.ll", 0x00003, 0x80000, CRC(e491be7f) SHA1(cbe281c099a4aa87067752d68cf2bb0ab3900531) )
12241224
12251225   DISK_REGION( "ide" )
1226   DISK_IMAGE( "maxforce", 0, MD5(b0a214c7b3f8ba9d592396332fc974c9) SHA1(59d77280afdb2d1f801ee81786aa7d3166ec2695) )
1226   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
12271227ROM_END
12281228
12291229
r4425r4426
12381238   ROM_LOAD( "28c16.17z", 0x000, 0x800, CRC(1cdd9088) SHA1(4f01f02ff95f31ced87a3cdd7f171afd92551266) )
12391239
12401240   DISK_REGION( "ide" )
1241   DISK_IMAGE( "maxforce", 0, MD5(b0a214c7b3f8ba9d592396332fc974c9) SHA1(59d77280afdb2d1f801ee81786aa7d3166ec2695) )
1241   DISK_IMAGE( "maxforce", 0, SHA1(d54e7a8f3866bb2a1d28ae637e7c92ffa4dbe558) )
12421242ROM_END
12431243
12441244
r4425r4426
12501250   ROM_LOAD32_BYTE( "area51mx.3k", 0x00003, 0x80000, CRC(0e78f308) SHA1(adc4c8e441eb8fe525d0a6220eb3a2a8791a7289) )
12511251
12521252   DISK_REGION( "ide" )
1253   DISK_IMAGE( "area51mx", 0, MD5(fce1a0954759fa22e50747959716823d) SHA1(7e629045eb5baa8cd522273befffbf8520828938) )
1253   DISK_IMAGE( "area51mx", 0, SHA1(5ff10f4e87094d4449eabf3de7549564ca568c7e) )
12541254ROM_END
12551255
12561256
r4425r4426
12621262   ROM_LOAD32_BYTE( "a51mxr3k.ll", 0x00003, 0x80000, CRC(ece9e5ae) SHA1(7e44402726f5afa6d1670b27aa43ad13d21c4ad9) )
12631263
12641264   DISK_REGION( "ide" )
1265   DISK_IMAGE( "area51mx", 0, MD5(fce1a0954759fa22e50747959716823d) SHA1(7e629045eb5baa8cd522273befffbf8520828938) )
1265   DISK_IMAGE( "area51mx", 0, SHA1(5ff10f4e87094d4449eabf3de7549564ca568c7e) )
12661266ROM_END
12671267
12681268
r4425r4426
12741274   ROM_LOAD32_BYTE( "ll", 0x00003, 0x80000, CRC(ba8753eb) SHA1(0322e0e37d814a38d08ba191b1a97fb1a55fe461) )
12751275
12761276   DISK_REGION( "ide" )
1277   DISK_IMAGE( "vcircle", 0, MD5(fc316bd92363573d60083514223c6816) SHA1(f1d3e3d081d10ec42d07cd695d52b44812264983) )
1277   DISK_IMAGE( "vcircle", 0, SHA1(bfa79c4cacdc9c2cd6362f62a23056b3e35a2034) )
12781278ROM_END
12791279
12801280
src/mame/drivers/pzletime.c
r4425r4426
66    driver by Angelo Salese and Pierpaolo Prazzoli
77    dump and info provided by Yoshi
88
9    To initialize the eeprom, keep Service button pressed at boot.
10
911    Notes:
10    - Is the brightness effect right or there's a different video effect?
11    - In the service menu, where you can configure game options, and when you have to
12      choose the Game Mode, you can't see what is selected, becase the 2 halves of the
13      palette used by txt tilemap have the same data. Is it a real game bug?
12    - Text tilemap flickering could be a bit slower / faster
13    - Brightness effect could be a bit darker / lighter
1414
1515*****************************************************************************************/
1616
r4425r4426
4040   tileno = txt_videoram[tile_index] & 0x0fff;
4141   colour = txt_videoram[tile_index] & 0xf000;
4242   colour = colour >> 12;
43
4344   SET_TILE_INFO(0,tileno,colour,0);
45
46   tileinfo->category = (colour & 8) ? 1 : 0;
4447}
4548
4649static VIDEO_START( pzletime )
r4425r4426
105108   }
106109
107110   tilemap_draw(bitmap,cliprect,txt_tilemap,0,0);
111   if((video_screen_get_frame_number(screen) % 16) != 0)
112      tilemap_draw(bitmap,cliprect,txt_tilemap,1,0);
108113
109114   return 0;
110115}
src/mame/drivers/neodrvr.c
r4425r4426
314314  -- some may be missing, there have been multiple CRCs reported for the same
315315     revision in some cases
316316
317 The 'japan-hotel' BIOS is a dump of an MVS which could be found in some japanese
318 hotels. it is a custom MVS mobo which uses MVS carts but it hasn't jamma
319 connector and it's similar to a console with a coin mechanism, so it's a sort
320 of little coin op console installed in hotels.
321
317322 ****/
318323
319324#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
320325      ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(bios+1)) /* Note '+1' */
321326
322327#define NEOGEO_BIOS \
323   ROM_REGION16_BE( 0x20000, "mainbios", 0 )                                        \
328   ROM_REGION16_BE( 0x80000, "mainbios", 0 )                                        \
324329   ROM_SYSTEM_BIOS( 0, "euro",       "Europe MVS (Ver. 2)" ) \
325   ROM_LOAD16_WORD_SWAP_BIOS( 0, "sp-s2.sp1",    0x00000, 0x020000, CRC(9036d879) SHA1(4f5ed7105b7128794654ce82b51723e16e389543) ) /* Europe, 1 Slot, has also been found on a 4 Slot (the old hacks were designed for this one) */ \
330   ROM_LOAD16_WORD_SWAP_BIOS( 0, "sp-s2.sp1",    0x00000, 0x020000, CRC(9036d879) SHA1(4f5ed7105b7128794654ce82b51723e16e389543) ) /* Europe, 1 Slot, has also been found on 2 Slot and 4 Slot (the old hacks were designed for this one) */ \
326331   ROM_SYSTEM_BIOS( 1, "euro-s1",    "Europe MVS (Ver. 1)" ) \
327332   ROM_LOAD16_WORD_SWAP_BIOS( 1, "sp-s.sp1",     0x00000, 0x020000, CRC(c7f2fa45) SHA1(09576ff20b4d6b365e78e6a5698ea450262697cd) ) /* Europe, 4 Slot */ \
328333   ROM_SYSTEM_BIOS( 2, "us",         "US MVS (Ver. 2?)" ) \
r4425r4426
334339   ROM_SYSTEM_BIOS( 5, "japan",      "Japan MVS (Ver. 3)" ) \
335340   ROM_LOAD16_WORD_SWAP_BIOS( 5, "vs-bios.rom",  0x00000, 0x020000, CRC(f0e8f27d) SHA1(ecf01eda815909f1facec62abf3594eaa8d11075) ) /* Japan, Ver 6 VS Bios */ \
336341   ROM_SYSTEM_BIOS( 6, "japan-s2",   "Japan MVS (Ver. 2)" ) \
337   ROM_LOAD16_WORD_SWAP_BIOS( 6, "sp-j2.rom",    0x00000, 0x020000, CRC(acede59c) SHA1(b6f97acd282fd7e94d9426078a90f059b5e9dd91) ) /* Japan, Older */ \
342   ROM_LOAD16_WORD_SWAP_BIOS( 6, "sp-j2.sp1",    0x00000, 0x020000, CRC(acede59c) SHA1(b6f97acd282fd7e94d9426078a90f059b5e9dd91) ) /* Japan, Older */ \
338343   ROM_SYSTEM_BIOS( 7, "japan-s1",   "Japan MVS (Ver. 1)" ) \
339   ROM_LOAD16_WORD_SWAP_BIOS( 7, "sp1.jipan.1024",0x00000, 0x020000,  CRC(9fb0abe4) SHA1(18a987ce2229df79a8cf6a84f968f0e42ce4e59d) ) /* Japan, Older */ \
340   ROM_SYSTEM_BIOS( 8, "uni-bios_2_3","Universe Bios (Hack, Ver. 2.3)" ) \
341   ROM_LOAD16_WORD_SWAP_BIOS( 8, "uni-bios_2_3.rom",  0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \
342   ROM_SYSTEM_BIOS( 9, "uni-bios_2_3o","Universe Bios (Hack, Ver. 2.3, older?)" ) \
343   ROM_LOAD16_WORD_SWAP_BIOS( 9, "uni-bios_2_3o.rom",  0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \
344   ROM_SYSTEM_BIOS( 10, "uni-bios_2_2","Universe Bios (Hack, Ver. 2.2)" ) \
345   ROM_LOAD16_WORD_SWAP_BIOS( 10, "uni-bios_2_2.rom",  0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \
346   ROM_SYSTEM_BIOS( 11, "uni-bios_2_1","Universe Bios (Hack, Ver. 2.1)" ) \
347   ROM_LOAD16_WORD_SWAP_BIOS( 11, "uni-bios_2_1.rom",  0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \
348   ROM_SYSTEM_BIOS( 12, "uni-bios_2_0","Universe Bios (Hack, Ver. 2.0)" ) \
349   ROM_LOAD16_WORD_SWAP_BIOS( 12, "uni-bios_2_0.rom",  0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \
350   ROM_SYSTEM_BIOS( 13, "uni-bios_1_3","Universe Bios (Hack, Ver. 1.3)" ) \
351   ROM_LOAD16_WORD_SWAP_BIOS( 13, "uni-bios_1_3.rom",  0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \
352   ROM_SYSTEM_BIOS( 14, "uni-bios_1_2","Universe Bios (Hack, Ver. 1.2)" ) \
353   ROM_LOAD16_WORD_SWAP_BIOS( 14, "uni-bios_1_2.rom",  0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \
354   ROM_SYSTEM_BIOS( 15, "uni-bios_1_2o","Universe Bios (Hack, Ver. 1.2, older)" ) \
355   ROM_LOAD16_WORD_SWAP_BIOS( 15, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \
356   ROM_SYSTEM_BIOS( 16, "uni-bios_1_1","Universe Bios (Hack, Ver. 1.1)" ) \
357   ROM_LOAD16_WORD_SWAP_BIOS( 16, "uni-bios_1_1.rom",  0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \
358   ROM_SYSTEM_BIOS( 17, "uni-bios_1_0","Universe Bios (Hack, Ver. 1.0)" ) \
359   ROM_LOAD16_WORD_SWAP_BIOS( 17, "uni-bios_1_0.rom",  0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */ \
360//  ROM_SYSTEM_BIOS( 18, "debug",      "Debug MVS (Hack?)" )
361//  ROM_LOAD16_WORD_SWAP_BIOS( 18, "neodebug.rom", 0x00000, 0x020000, CRC(698ebb7d) SHA1(081c49aa8cc7dad5939833dc1b18338321ea0a07) ) /* Debug (Development) Bios */
362//  ROM_SYSTEM_BIOS(19, "asia-aes",   "Asia AES" )
363//  ROM_LOAD16_WORD_SWAP_BIOS(19, "neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */
364//  ROM_SYSTEM_BIOS(20, "jap-aes",   "Japan AES" )
365//  ROM_LOAD16_WORD_SWAP_BIOS(20, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */
344   ROM_LOAD16_WORD_SWAP_BIOS( 7, "sp1.jipan.1024",0x00000, 0x020000, CRC(9fb0abe4) SHA1(18a987ce2229df79a8cf6a84f968f0e42ce4e59d) ) /* Japan, Older */ \
345   ROM_SYSTEM_BIOS( 8, "mv1c",   "NEO-MVH MV1C" ) \
346   ROM_LOAD16_WORD_SWAP_BIOS( 8, "sp-45.sp1",0x00000, 0x080000, CRC(03cc9f6a) SHA1(cdf1f49e3ff2bac528c21ed28449cf35b7957dc1) ) /* MV1C; redump required */ \
347   ROM_SYSTEM_BIOS( 9, "japan-hotel", "Custom Japanese Hotel" ) \
348   ROM_LOAD16_WORD_SWAP_BIOS( 9, "sp-1v1_3db8c.bin",0x00000, 0x020000, CRC(162f0ebe) SHA1(fe1c6dd3dfcf97d960065b1bb46c1e11cb7bf271)  ) /* 'rare MVS found in japanese hotels' shows v1.3 in test mode */ \
349   ROM_SYSTEM_BIOS( 10, "uni-bios_2_3","Universe Bios (Hack, Ver. 2.3)" ) \
350   ROM_LOAD16_WORD_SWAP_BIOS( 10, "uni-bios_2_3.rom",  0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0) ) /* Universe Bios v2.3 (hack) */ \
351   ROM_SYSTEM_BIOS( 11, "uni-bios_2_3o","Universe Bios (Hack, Ver. 2.3, older?)" ) \
352   ROM_LOAD16_WORD_SWAP_BIOS( 11, "uni-bios_2_3o.rom",  0x00000, 0x020000, CRC(601720ae) SHA1(1b8a72c720cdb5ee3f1d735bbcf447b09204b8d9) ) /* Universe Bios v2.3 (hack) alt version, withdrawn? */ \
353   ROM_SYSTEM_BIOS( 12, "uni-bios_2_2","Universe Bios (Hack, Ver. 2.2)" ) \
354   ROM_LOAD16_WORD_SWAP_BIOS( 12, "uni-bios_2_2.rom",  0x00000, 0x020000, CRC(2d50996a) SHA1(5241a4fb0c63b1a23fd1da8efa9c9a9bd3b4279c) ) /* Universe Bios v2.2 (hack) */ \
355   ROM_SYSTEM_BIOS( 13, "uni-bios_2_1","Universe Bios (Hack, Ver. 2.1)" ) \
356   ROM_LOAD16_WORD_SWAP_BIOS( 13, "uni-bios_2_1.rom",  0x00000, 0x020000, CRC(8dabf76b) SHA1(c23732c4491d966cf0373c65c83c7a4e88f0082c) ) /* Universe Bios v2.1 (hack) */ \
357   ROM_SYSTEM_BIOS( 14, "uni-bios_2_0","Universe Bios (Hack, Ver. 2.0)" ) \
358   ROM_LOAD16_WORD_SWAP_BIOS( 14, "uni-bios_2_0.rom",  0x00000, 0x020000, CRC(0c12c2ad) SHA1(37bcd4d30f3892078b46841d895a6eff16dc921e) ) /* Universe Bios v2.0 (hack) */ \
359   ROM_SYSTEM_BIOS( 15, "uni-bios_1_3","Universe Bios (Hack, Ver. 1.3)" ) \
360   ROM_LOAD16_WORD_SWAP_BIOS( 15, "uni-bios_1_3.rom",  0x00000, 0x020000, CRC(b24b44a0) SHA1(eca8851d30557b97c309a0d9f4a9d20e5b14af4e) ) /* Universe Bios v1.3 (hack) */ \
361   ROM_SYSTEM_BIOS( 16, "uni-bios_1_2","Universe Bios (Hack, Ver. 1.2)" ) \
362   ROM_LOAD16_WORD_SWAP_BIOS( 16, "uni-bios_1_2.rom",  0x00000, 0x020000, CRC(4fa698e9) SHA1(682e13ec1c42beaa2d04473967840c88fd52c75a) ) /* Universe Bios v1.2 (hack) */ \
363   ROM_SYSTEM_BIOS( 17, "uni-bios_1_2o","Universe Bios (Hack, Ver. 1.2, older)" ) \
364   ROM_LOAD16_WORD_SWAP_BIOS( 17, "uni-bios_1_2o.rom", 0x00000, 0x020000, CRC(e19d3ce9) SHA1(af88ef837f44a3af2d7144bb46a37c8512b67770) ) /* Universe Bios v1.2 (hack) alt version */ \
365   ROM_SYSTEM_BIOS( 18, "uni-bios_1_1","Universe Bios (Hack, Ver. 1.1)" ) \
366   ROM_LOAD16_WORD_SWAP_BIOS( 18, "uni-bios_1_1.rom",  0x00000, 0x020000, CRC(5dda0d84) SHA1(4153d533c02926a2577e49c32657214781ff29b7) ) /* Universe Bios v1.1 (hack) */ \
367   ROM_SYSTEM_BIOS( 19, "uni-bios_1_0","Universe Bios (Hack, Ver. 1.0)" ) \
368   ROM_LOAD16_WORD_SWAP_BIOS( 19, "uni-bios_1_0.rom",  0x00000, 0x020000, CRC(0ce453a0) SHA1(3b4c0cd26c176fc6b26c3a2f95143dd478f6abf9) ) /* Universe Bios v1.0 (hack) */ \
369//  ROM_SYSTEM_BIOS( 20, "debug",      "Debug MVS (Hack?)" )
370//  ROM_LOAD16_WORD_SWAP_BIOS( 20, "neodebug.rom", 0x00000, 0x020000, CRC(698ebb7d) SHA1(081c49aa8cc7dad5939833dc1b18338321ea0a07) ) /* Debug (Development) Bios */
371//  ROM_SYSTEM_BIOS(21, "asia-aes",   "Asia AES" )
372//  ROM_LOAD16_WORD_SWAP_BIOS(21, "neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07) ) /* AES Console (Asia?) Bios */
373//  ROM_SYSTEM_BIOS(22, "jap-aes",   "Japan AES" )
374//  ROM_LOAD16_WORD_SWAP_BIOS(22, "neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c) ) /* AES Console (Japan) Bios */
366375
367376
368377/* note you'll have to modify the last for lines of each block to use the extra bios roms,
r4425r4426
796805   ROM_LOAD16_BYTE( "004-c4.bin", 0x100001, 0x80000, CRC(7e81cb29) SHA1(5036f04df30cf6903bd1a8cc06ff6f015c24a74b) ) /* Plane 2,3 */
797806ROM_END
798807
799ROM_START( maglord )
808ROM_START( maglord )  /* MVS VERSION */
800809   ROM_REGION( 0x100000, "maincpu", 0 )
801   ROM_LOAD16_WORD_SWAP( "005-p1.bin", 0x000000, 0x080000, CRC(bd0a492d) SHA1(d043d3710cf2b0d2b3798008e65e4c7c3ead1af3) )
810   ROM_LOAD16_WORD_SWAP( "005-pg1.bin", 0x000000, 0x080000, CRC(599043c5) SHA1(43f234b0f89b72b4c6050c40d9daa5c4e96b94ce) )
802811
803812   NEO_SFIX_128K( "005-s1.bin", CRC(1c5369a2) SHA1(db0dba0a7dced6c9ca929c5abda491b05d84199c) )
804813
r4425r4426
821830   ROM_LOAD16_BYTE( "005-c6.bin", 0x200001, 0x80000, CRC(ab7ac142) SHA1(e6ad2843947d35d8e913d2666f87946c1ba7944f) ) /* Plane 2,3 */
822831ROM_END
823832
824ROM_START( maglordh )
833ROM_START( maglordh ) /* AES VERSION */
825834   ROM_REGION( 0x100000, "maincpu", 0 )
826   ROM_LOAD16_WORD_SWAP( "005-p1h.bin", 0x000000, 0x080000, CRC(599043c5) SHA1(43f234b0f89b72b4c6050c40d9daa5c4e96b94ce) )
835   ROM_LOAD16_WORD_SWAP( "005-p1.bin", 0x000000, 0x080000, CRC(bd0a492d) SHA1(d043d3710cf2b0d2b3798008e65e4c7c3ead1af3) )
827836
828837   NEO_SFIX_128K( "005-s1.bin", CRC(1c5369a2) SHA1(db0dba0a7dced6c9ca929c5abda491b05d84199c) )
829838
r4425r4426
945954   ROM_LOAD16_BYTE( "009-c6.bin", 0x200001, 0x80000, CRC(2eca8b19) SHA1(16764ef10e404325ba0a1a2ad3a4c0af287be21f) ) /* Plane 2,3 */
946955ROM_END
947956
948ROM_START( ncombath ) /* MBS AND AES VERSION */
957ROM_START( ncombath ) /* MVS AND AES VERSION */
949958   ROM_REGION( 0x100000, "maincpu", 0 )
950959   ROM_LOAD16_WORD_SWAP( "009-pg1.bin", 0x000000, 0x080000, CRC(8e9f0add) SHA1(d0b908a86a58f2537eea73a431038f1cd74a5a2f) )
951960
r4425r4426
976985
977986   NEO_SFIX_128K( "010-s1.bin", CRC(79a35264) SHA1(c2819a82adbe1f5e489496e0e03477863a5b7665) )
978987
979   NEO_BIOS_AUDIO_64K( "010-m1.bin", BAD_DUMP CRC(47980d3a) SHA1(afd7be531d2ba69400dff5927202446873266c06) )
988   NEO_BIOS_AUDIO_128K( "010-m1.bin", CRC(8be3a078) SHA1(054ec6a061fcc88df1ecbb0a01611a31f37a7709) )
980989
981990   ROM_REGION( 0x200000, "ym", 0 )
982991   ROM_LOAD( "010-v11.bin", 0x000000, 0x080000, CRC(90224d22) SHA1(5443ee6f90d80d43194cb4b4f0e08851a59e7784) )
r4425r4426
13311340
13321341   NEO_SFIX_128K( "025-s1.bin", CRC(a402202b) SHA1(75c44e1af459af155f5b892fd18706268dd5e602) )
13331342
1334   NEO_BIOS_AUDIO_128K( "025-m1.bin", BAD_DUMP CRC(9927034c) SHA1(205665361c5b2ab4f01ec480dd3c9b69db858d09) )
1343   NEO_BIOS_AUDIO_128K( "025-m1.bin", CRC(9927034c) SHA1(205665361c5b2ab4f01ec480dd3c9b69db858d09) )
13351344
13361345   ROM_REGION( 0x200000, "ym", 0 )
13371346   ROM_LOAD( "025-v1.bin", 0x000000, 0x100000, CRC(4558558a) SHA1(a4b277703ed67225c652be0d618daeca65a27b88) )
r4425r4426
30733082
30743083   ROM_REGION( 0x600000, "ym", 0 )
30753084   ROM_LOAD( "090-v1.bin", 0x000000, 0x200000, CRC(30cf2709) SHA1(d1845033f16de2470afd3858ee0efb45176d9ed7) )
3076   ROM_LOAD( "090-v2.bin", 0x200000, 0x200000, CRC(b6527edd) SHA1(2bcf5bfa6e117cf4a3728a5e5f5771313c93f22a) )
3085   ROM_LOAD( "064-v2.bin", 0x200000, 0x200000, CRC(b6527edd) SHA1(2bcf5bfa6e117cf4a3728a5e5f5771313c93f22a) )
30773086   ROM_LOAD( "090-v3.bin", 0x400000, 0x200000, CRC(1908a7ce) SHA1(78f31bcfea33eb94752bbf5226c481baec1af5ac) )
30783087
30793088   NO_DELTAT_REGION
r4425r4426
30813090   ROM_REGION( 0x1c00000, "sprites", ROMREGION_DISPOSE )
30823091   ROM_LOAD16_BYTE( "090-c1.bin", 0x0000000, 0x400000, CRC(cd30ed9b) SHA1(839c20f7ff31251acc875ae402b5d267e55510c7) ) /* Plane 0,1 */
30833092   ROM_LOAD16_BYTE( "090-c2.bin", 0x0000001, 0x400000, CRC(10eed5ee) SHA1(12131b1c8c017ea77a98c044b392a5db6aad0143) ) /* Plane 2,3 */
3084   ROM_LOAD16_BYTE( "090-c3.bin", 0x0800000, 0x200000, CRC(436d1b31) SHA1(059776d77b91377ed0bcfc278802d659c917fc0f) ) /* Plane 0,1 */
3085   ROM_LOAD16_BYTE( "090-c4.bin", 0x0800001, 0x200000, CRC(f9c8dd26) SHA1(25a9eea1d49b21b4a988beb32c25bf2f7796f227) ) /* Plane 2,3 */
3093   ROM_LOAD16_BYTE( "064-c3.bin", 0x0800000, 0x200000, CRC(436d1b31) SHA1(059776d77b91377ed0bcfc278802d659c917fc0f) ) /* Plane 0,1 */
3094   ROM_LOAD16_BYTE( "064-c4.bin", 0x0800001, 0x200000, CRC(f9c8dd26) SHA1(25a9eea1d49b21b4a988beb32c25bf2f7796f227) ) /* Plane 2,3 */
30863095   /* 0c00000-0ffffff empty */
3087   ROM_LOAD16_BYTE( "090-c5.bin", 0x1000000, 0x200000, CRC(8e34a9f4) SHA1(67b839b426ef3fad0a85d951fdd44c0a45c55226) ) /* Plane 0,1 */
3088   ROM_LOAD16_BYTE( "090-c6.bin", 0x1000001, 0x200000, CRC(a43e4766) SHA1(54f282f2b1ff2934cca7acbb4386a2b99a29df3a) ) /* Plane 2,3 */
3096   ROM_LOAD16_BYTE( "064-c5.bin", 0x1000000, 0x200000, CRC(8e34a9f4) SHA1(67b839b426ef3fad0a85d951fdd44c0a45c55226) ) /* Plane 0,1 */
3097   ROM_LOAD16_BYTE( "064-c6.bin", 0x1000001, 0x200000, CRC(a43e4766) SHA1(54f282f2b1ff2934cca7acbb4386a2b99a29df3a) ) /* Plane 2,3 */
30893098   /* 1400000-17fffff empty */
3090   ROM_LOAD16_BYTE( "090-c7.bin", 0x1800000, 0x200000, CRC(59d97215) SHA1(85a960dc7f364df13ee0c2f99a4c53aefb081486) ) /* Plane 0,1 */
3091   ROM_LOAD16_BYTE( "090-c8.bin", 0x1800001, 0x200000, CRC(fc092367) SHA1(69ff4ae909dd857de3ca8645d63f8b4bde117448) ) /* Plane 2,3 */
3099   ROM_LOAD16_BYTE( "064-c7.bin", 0x1800000, 0x200000, CRC(59d97215) SHA1(85a960dc7f364df13ee0c2f99a4c53aefb081486) ) /* Plane 0,1 */
3100   ROM_LOAD16_BYTE( "064-c8.bin", 0x1800001, 0x200000, CRC(fc092367) SHA1(69ff4ae909dd857de3ca8645d63f8b4bde117448) ) /* Plane 2,3 */
30923101ROM_END
30933102
30943103ROM_START( kabukikl )
r4425r4426
51765185
51775186ROM_START( kof2001 ) /* MVS VERSION */
51785187   ROM_REGION( 0x500000, "maincpu", 0 )
5179   ROM_LOAD16_WORD_SWAP( "262-p1.bin", 0x000000, 0x100000, CRC(9381750d) SHA1(dcfecd69e563ff52fe07d23c5372d0f748b07819) )
5180   ROM_LOAD16_WORD_SWAP( "262-p2.bin", 0x100000, 0x400000, CRC(8e0d8329) SHA1(10dcc1baf0aaf1fc84c4d856bca6bcff85aed2bc) )
5188   ROM_LOAD16_WORD_SWAP( "262-p1-08-e0.bin", 0x000000, 0x100000, CRC(9381750d) SHA1(dcfecd69e563ff52fe07d23c5372d0f748b07819) )
5189   ROM_LOAD16_WORD_SWAP( "262-p2-08-e0.bin", 0x100000, 0x400000, CRC(8e0d8329) SHA1(10dcc1baf0aaf1fc84c4d856bca6bcff85aed2bc) )
5190   /* The first/early production run sets have proms with above labels. Some later? sets found have eproms instead of proms */
51815191
51825192   ROM_Y_ZOOM
51835193
src/mame/drivers/djmain.c
r4425r4426
992992static MACHINE_START( djmain )
993993{
994994   const device_config *ide = devtag_get_device(machine, "ide");
995   UINT8 *region = memory_region(machine, "shared");
996995
997996   if (ide != NULL && ide_master_password != NULL)
998997      ide_set_master_password(ide, ide_master_password);
r4425r4426
1000999      ide_set_user_password(ide, ide_user_password);
10011000
10021001   state_save_register_global(machine, sndram_bank);
1003   state_save_register_global_pointer(machine, region, 0x80000 * 32);
10041002   state_save_register_global(machine, pending_vb_int);
10051003   state_save_register_global(machine, v_ctrl);
10061004   state_save_register_global_array(machine, obj_regs);
r4425r4426
10991097   ROM_LOAD16_BYTE( "753jaa10.27d", 0x100001, 0x80000, CRC(391F4BFD) SHA1(791c9889ea3ce639bbfb87934a1cad9aa3c9ccde) )
11001098
11011099   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1102   DISK_IMAGE( "753jaa11", 0, MD5(d56ec7b9877d1f26d7fc1cabed404947) SHA1(71d200d1bd3f1f3a01f4daa78dc9abcca8b8a1fb) )   /* ver 1.00 JA */
1100   DISK_IMAGE( "753jaa11", 0, SHA1(2e70cf31a853322f29f99b6f292c187a2cf33015) )   /* ver 1.00 JA */
11031101   // There is an alternate image
11041102   //DISK_IMAGE( "753jaa11", 0, MD5(260c9b72f4a03055e3abad61c6225324) SHA1(2cc3e149744516bf2353a2b47d33bc9d2072b6c4) ) /* ver 1.00 JA */
1103
1104   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
11051105ROM_END
11061106
11071107ROM_START( bm2ndmix )
r4425r4426
11221122   ROM_LOAD16_BYTE( "853jaa10.27d", 0x100001, 0x80000, CRC(9CB92D98) SHA1(6ace4492ba0b5a8f94a9e7b4f7126b31c6254637) )
11231123
11241124   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1125   DISK_IMAGE( "853jaa11", 0, MD5(37281741b748bea7dfa711a956649d1e) SHA1(03d6cc5aea5920163fbaba34c4f838ca605a87e3) )   /* ver 1.10 JA */
1125   DISK_IMAGE( "853jaa11", 0, SHA1(9683ff8462491252b6eb2e5b3aa6496884c01506) )   /* ver 1.10 JA */
1126
1127   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
11261128ROM_END
11271129
11281130ROM_START( bm2ndmxa )
r4425r4426
11431145   ROM_LOAD16_BYTE( "853jaa10.27d", 0x100001, 0x80000, CRC(9CB92D98) SHA1(6ace4492ba0b5a8f94a9e7b4f7126b31c6254637) )
11441146
11451147   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1146   DISK_IMAGE( "853jaa11", 0, MD5(37281741b748bea7dfa711a956649d1e) SHA1(03d6cc5aea5920163fbaba34c4f838ca605a87e3) )   /* ver 1.10 JA */
1148   DISK_IMAGE( "853jaa11", 0, SHA1(9683ff8462491252b6eb2e5b3aa6496884c01506) )   /* ver 1.10 JA */
1149
1150   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
11471151ROM_END
11481152
11491153ROM_START( bm3rdmix )
r4425r4426
11631167   ROM_LOAD16_BYTE( "825jaa09.25d", 0x100000, 0x80000, CRC(D3E65669) SHA1(51abf452da60794fa47c05d11c08b203dde563ff) )
11641168   ROM_LOAD16_BYTE( "825jaa10.27d", 0x100001, 0x80000, CRC(44D184F3) SHA1(28f3ec33a29164a6531f53db071272ccf015f66d) )
11651169
1170   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1171   DISK_IMAGE( "825jaa11", 0, SHA1(048919977232bbce046406a7212586cf39b77cf2) )   /* ver 1.00 JA */
11661172
1167   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1168   DISK_IMAGE( "825jaa11", 0, SHA1(dc10d8d281dd8153aeb620228e397aba0bbac198) MD5(3276e3ed57f1a6d9a18365054b0439ba) )   /* ver 1.00 JA */
1173   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
11691174ROM_END
11701175
11711176ROM_START( bmcompmx )
r4425r4426
11861191   ROM_LOAD16_BYTE( "858jaa10.27d", 0x100001, 0x80000, CRC(00B124EE) SHA1(435d28a327c2707833a8ddfe841104df65ffa3f8) )
11871192
11881193   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1189   DISK_IMAGE( "858jaa11", 0, MD5(6c573b432c5d8b5a4fb857b0fab26cb8) SHA1(05a3f2359d089f47dcaa28ee7bc65a23efecda94) )   /* ver 1.00 JA */
1194   DISK_IMAGE( "858jaa11", 0, SHA1(bc590472046336a1000f29901fe3fd7b29747e47) )   /* ver 1.00 JA */
1195
1196   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
11901197ROM_END
11911198
11921199ROM_START( hmcompmx )
r4425r4426
12071214   ROM_LOAD16_BYTE( "858uaa10.27d", 0x100001, 0x80000, CRC(20AA7145) SHA1(eeff87eb9a9864985d751f45e843ee6e73db8cfd) )
12081215
12091216   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1210   DISK_IMAGE( "858jaa11", 0, MD5(6c573b432c5d8b5a4fb857b0fab26cb8) SHA1(05a3f2359d089f47dcaa28ee7bc65a23efecda94) )   /* ver 1.00 JA */
1217   DISK_IMAGE( "858jaa11", 0, SHA1(bc590472046336a1000f29901fe3fd7b29747e47) )   /* ver 1.00 JA */
1218
1219   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
12111220ROM_END
12121221
12131222ROM_START( bm4thmix )
r4425r4426
12281237   ROM_LOAD16_BYTE( "847jab10.27d", 0x100001, 0x80000, CRC(C78516F5) SHA1(1adf5805c808dc55de14a9a9b20c3d2cf7bf414d) )
12291238
12301239   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1231   DISK_IMAGE( "847jaa11", 0, MD5(47cb5c1b856aa11cf38f0c7ea4a7d1c3) SHA1(374d5d5340d4a8818577f9ae81021651d6ee3429) )   /* ver 1.00 JA */
1240   DISK_IMAGE( "847jaa11", 0, SHA1(8cad631531b5616d6a4b0a99d988f4b525932dc7) )   /* ver 1.00 JA */
1241
1242   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
12321243ROM_END
12331244
12341245ROM_START( bm5thmix )
r4425r4426
12491260   ROM_LOAD16_BYTE( "981jaa10.27d", 0x100001, 0x80000, CRC(06BEE0E4) SHA1(6eea8614cb01e7079393b9976b6fd6a52c14e3c0) )
12501261
12511262   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1252   DISK_IMAGE( "981jaa11", 0, MD5(0058bbdcb5db054adff1c4148ef4211e) SHA1(bee71c31978ac186e5e933adcf0220a70496ca6c) )   /* ver 1.00 JA */
1263   DISK_IMAGE( "981jaa11", 0, SHA1(dc7353fa436d96ae174a58d3a38ca9928a63727f) )   /* ver 1.00 JA */
1264
1265   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
12531266ROM_END
12541267
12551268ROM_START( bmclubmx )
r4425r4426
12731286   DISK_IMAGE( "993jaa11.chd", 0, NO_DUMP )
12741287   // this image has not been verified
12751288   //  DISK_IMAGE( "993jaa11.chd", 0, MD5(e26eb62d7cf3357585f5066da6063143) )  /* ver 1.00 JA */
1289
1290   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
12761291ROM_END
12771292
12781293ROM_START( bmcompm2 )
r4425r4426
12931308   ROM_LOAD16_BYTE( "988jaa10.27d", 0x100001, 0x80000, CRC(248BF0EE) SHA1(d89205ed57e771401bfc2c24043d200ecbd0b7fc) )
12941309
12951310   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1296   DISK_IMAGE( "988jaa11", 0, MD5(e7d1bcc21a56db62c47f3293fbdf80d9) SHA1(00a2e258d66585002413a999afb695a3f3fe30cb) )   /* ver 1.00 JA */
1311   DISK_IMAGE( "988jaa11", 0, SHA1(12a0988c631dd3331e54b8417a9659402afe168b) )   /* ver 1.00 JA */
1312
1313   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
12971314ROM_END
12981315
12991316ROM_START( hmcompm2 )
r4425r4426
13141331   ROM_LOAD16_BYTE( "988uaa10.27d", 0x100001, 0x80000, CRC(DAB0F3C9) SHA1(6fd899e753e32f60262c54ab8553c686c7ef28de) )
13151332
13161333   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1317   DISK_IMAGE( "988jaa11", 0, MD5(e7d1bcc21a56db62c47f3293fbdf80d9) SHA1(00a2e258d66585002413a999afb695a3f3fe30cb) )   /* ver 1.00 JA */
1334   DISK_IMAGE( "988jaa11", 0, SHA1(12a0988c631dd3331e54b8417a9659402afe168b) )   /* ver 1.00 JA */
1335
1336   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
13181337ROM_END
13191338
13201339ROM_START( bmdct )
r4425r4426
13351354   ROM_LOAD16_BYTE( "995jaa10.27d", 0x100001, 0x80000, CRC(F9E4E9F2) SHA1(fe91badf6b0baeea690d75399d8c66fabcf6d352) )
13361355
13371356   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1338   DISK_IMAGE( "995jaa11", 0, MD5(8f5936d2b0b0914b5c88f5432c6cac21) SHA1(deed0fca533f3e56e04f9967f3f76145ca106f06) )   /* ver 1.00 JA */
1357   DISK_IMAGE( "995jaa11", 0, SHA1(8fec3c4d97f64f48b9867230a97cda4347496075) )   /* ver 1.00 JA */
1358
1359   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
13391360ROM_END
13401361
13411362ROM_START( bmcorerm )
r4425r4426
13561377   ROM_LOAD16_BYTE( "a05jaa10.27d", 0x100001, 0x80000, CRC(99D75C36) SHA1(9599420863aa0a9492d3caeb03f8ac5fd4c3cdb2) )
13571378
13581379   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1359   DISK_IMAGE( "a05jaa11", 0, MD5(bf63321a1bb167f35f1a1111c02874b6) SHA1(95f8e5d29cc9f9af2b1c9397a26217f685f9d5a7) )   /* ver 1.00 JA */
1380   DISK_IMAGE( "a05jaa11", 0, SHA1(7ebc41cc3e9a0a922b49201b34e29201522eb726) )   /* ver 1.00 JA */
1381
1382   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
13601383ROM_END
13611384
13621385ROM_START( bm6thmix )
r4425r4426
13771400   ROM_LOAD16_BYTE( "a21jaa10.27d", 0x100001, 0x80000, CRC(1AC33595) SHA1(3173bb8dc420487c4d427e779444a98aad37d51e) )
13781401
13791402   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1380   DISK_IMAGE( "a21jaa11", 0, MD5(d7a02bd5db4f6fbefaceb1781d35d7a6) SHA1(9e9fb8000cfb53686d94060d7391fb2950265510) )   /* ver 1.00 JA */
1403   DISK_IMAGE( "a21jaa11", 0, SHA1(ed0a07212a360e75934fc22c56265842cf0829b6) )   /* ver 1.00 JA */
1404
1405   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
13811406ROM_END
13821407
13831408ROM_START( bm7thmix )
r4425r4426
13981423   ROM_LOAD16_BYTE( "b07jaa10.27d", 0x100001, 0x80000, CRC(6B75BA9C) SHA1(aee922adc3bc0296ae6e08e461b20a9e5e72a2df) )
13991424
14001425   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1401   DISK_IMAGE( "b07jaa11", 0, MD5(8ee59f074ee79eb7a435a54b6745387c) SHA1(91957d353d2978ce46c5232dd182c056206eb722) )   /* ver 1.00 JA */
1426   DISK_IMAGE( "b07jaa11", 0, SHA1(e4925494f0a801abb4d3aa6524c379eb445d8dff) )   /* ver 1.00 JA */
14021427   // this image has not been verified
14031428   //DISK_IMAGE( "b07jab11.chd", 0, MD5(0e9440787ca69567792095085e2a3619) )    /* ver 1.00 JA */
1429
1430   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
14041431ROM_END
14051432
14061433ROM_START( bmfinal )
r4425r4426
14211448   ROM_LOAD16_BYTE( "c01jaa10.27d", 0x100001, 0x80000, CRC(C9927749) SHA1(c2644877bda483e241381265e723ea8ab8357761) )
14221449
14231450   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
1424   DISK_IMAGE( "c01jaa11", 0, MD5(ab47c58c0eda12c591d20013e16525f0) SHA1(f7e19e590005201d859f9a4ced8edf7fe88099f6) )   /* ver 1.00 JA */
1451   DISK_IMAGE( "c01jaa11", 0, SHA1(0a53c4412a72a886f5fb98c12c529d056d625244) )   /* ver 1.00 JA */
14251452   // this image has not been verified
14261453   //DISK_IMAGE( "c01jaa11", 0, MD5(8bb7e6b6bc63cac8a4f2997307c25748) )    /* ver 1.00 JA */
1454
1455   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
14271456ROM_END
14281457
14291458#if 0
r4425r4426
14471476
14481477   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
14491478   DISK_IMAGE( "825jab11", 0, MD5(f4360da10a932ba90e93469df7426d1d) SHA1(1) )  /* ver 1.01 JA */
1479
1480   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
14501481ROM_END
14511482
14521483ROM_START( popn1 )
r4425r4426
14681499
14691500   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
14701501   DISK_IMAGE( "803jaa11.chd", 0, MD5(54a8ac87857d81740621c622e27736d7) )   /* ver 1.00 JA */
1502
1503   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
14711504ROM_END
14721505
14731506ROM_START( popn2 )
r4425r4426
14891522
14901523   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
14911524   DISK_IMAGE( "831jaa11.chd", 0, NO_DUMP )
1525
1526   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
14921527ROM_END
14931528
14941529ROM_START( popn3 )
r4425r4426
15101545
15111546   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
15121547   DISK_IMAGE( "980jaa11.chd", 0, MD5(6e5cc17a6bc75cac0256192cc700215c) )   /* ver 1.00 JA */
1548
1549   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
15131550ROM_END
15141551
15151552ROM_START( popnstex )
r4425r4426
15311568
15321569   DISK_REGION( "ide" )         /* IDE HARD DRIVE */
15331570   DISK_IMAGE( "970jba11.chd", 0, MD5(1616905838fdb2b521d53499c6c2a7a4) )   /* ver 1.00 JA */
1571
1572   ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 )      /* K054539 RAM */
15341573ROM_END
15351574#endif
15361575
r4425r4426
15421581
15431582static DRIVER_INIT( beatmania )
15441583{
1545   memory_region_alloc(machine, "shared", 0x80000 * 32, 0);
1546
15471584   ide_master_password = NULL;
15481585   ide_user_password = NULL;
15491586}
src/mame/drivers/segas16a.c
r4425r4426
964964INPUT_PORTS_END
965965
966966
967static INPUT_PORTS_START( system16a_2button )
968   PORT_INCLUDE( system16a_generic )
969
970   PORT_MODIFY("P1")
971   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
972
973   PORT_MODIFY("P2")
974   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
975INPUT_PORTS_END
976
977
978static INPUT_PORTS_START( system16a_1button )
979   PORT_INCLUDE( system16a_generic )
980
981   PORT_MODIFY("P1")
982   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
983   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
984   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
985
986   PORT_MODIFY("P2")
987   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_COCKTAIL
988   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
989   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_COCKTAIL
990INPUT_PORTS_END
991
992
993
994967/*************************************
995968 *
996969 *  Game-specific port definitions
r4425r4426
10841057INPUT_PORTS_END
10851058
10861059static INPUT_PORTS_START( afighter )
1087   PORT_INCLUDE( system16a_2button )
1060   PORT_INCLUDE( system16a_generic )
10881061
10891062   PORT_MODIFY("DSW2")
10901063   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
r4425r4426
11131086
11141087
11151088static INPUT_PORTS_START( alexkidd )
1116   PORT_INCLUDE( system16a_2button )
1089   PORT_INCLUDE( system16a_generic )
11171090
11181091   PORT_MODIFY("DSW2")
11191092   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Continues ) ) PORT_DIPLOCATION("SW2:1")
r4425r4426
11411114
11421115
11431116static INPUT_PORTS_START( aliensyn )
1144   PORT_INCLUDE( system16a_1button )
1117   PORT_INCLUDE( system16a_generic )
11451118
11461119   PORT_MODIFY("DSW2")
11471120   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
r4425r4426
11661139
11671140
11681141static INPUT_PORTS_START( aliensy1 )
1169   PORT_INCLUDE( system16a_1button )
1142   PORT_INCLUDE( system16a_generic )
11701143
11711144   PORT_MODIFY("DSW2")
11721145   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
r4425r4426
12011174
12021175
12031176static INPUT_PORTS_START( fantzone )
1204   PORT_INCLUDE( system16a_2button )
1177   PORT_INCLUDE( system16a_generic )
12051178
12061179   PORT_MODIFY("DSW2")
12071180   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1")
r4425r4426
14411414
14421415
14431416static INPUT_PORTS_START( quart2 )
1444   PORT_INCLUDE( system16a_2button )
1417   PORT_INCLUDE( system16a_generic )
14451418
14461419   PORT_MODIFY("DSW2")
14471420   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
r4425r4426
16051578
16061579
16071580static INPUT_PORTS_START( tetris )
1608   PORT_INCLUDE( system16a_1button )
1581   PORT_INCLUDE( system16a_generic )
16091582
16101583   PORT_MODIFY("P1")
16111584   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
r4425r4426
16291602
16301603
16311604static INPUT_PORTS_START( timescan )
1632   PORT_INCLUDE( system16a_2button )
1605   PORT_INCLUDE( system16a_generic )
16331606
16341607   PORT_MODIFY("P1")
16351608   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
r4425r4426
16951668
16961669
16971670static INPUT_PORTS_START( wb3 )
1698   PORT_INCLUDE( system16a_2button )
1671   PORT_INCLUDE( system16a_generic )
16991672
17001673   PORT_MODIFY("DSW2")
17011674   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
src/mame/drivers/neogeo.c
r4425r4426
2121          Zsolt Vasvari
2222
2323
24    Neogeo Motherboard (info - courtesy of Guru):
24    The arcade version of the Neo-Geo system is called Multi Video System (MVS).
25    It is a cartridge based system.
26    MVS hardware was produced in 1 / 2 / 4 and 6 Slot versions.
2527
28    Known hardware (incomplete):
29    ============================
30
31    1 Slot: MV1 / MV1A / MV1B (MV1B CHX) / MV1C / MV1F (MV1FT / MV1FS) / MV1FZ
32    2 Slot: MV2F / MV2F-01
33    4 Slot: MV4F / MV4FS
34    6 Slot: MV6F
35
36
37    Neo-Geo Motherboard (info - courtesy of Guru):
38
2639          NEO-MVH MV1
2740          |---------------------------------------------------------------------|
2841          |       4558                                                          |
r4425r4426
5568          |---------------------------------------------------------------------|
5669
5770
58    Known issues/to-do's:
71    MVS cart pinout
72    ===============
5973
74    kindly submitted by Apollo69 (apollo69@columbus.rr.com)
75    =================================================================
76                CTRG1                            CTRG2
77    =================================================================
78         GND = 01A | 01B = GND            GND = 01A | 01B = GND
79         GND = 02A | 02B = GND            GND = 02A | 02B = GND
80          P0 = 03A | 03B = P1             GND = 03A | 03B = GND
81          P2 = 04A | 04B = P3             GND = 04A | 04B = GND
82          P4 = 05A | 05B = P5              D0 = 05A | 05B = A1
83          P6 = 06A | 06B = P7              D1 = 06A | 06B = A2
84          P8 = 07A | 07B = P9              D2 = 07A | 07B = A3
85         P10 = 08A | 08B = P11             D3 = 08A | 08B = A4
86         P12 = 09A | 09B = P13             D4 = 09A | 09B = A5
87         P14 = 10A | 10B = P15             D5 = 10A | 10B = A6
88         P16 = 11A | 11B = P17             D6 = 11A | 11B = A7
89         P18 = 12A | 12B = P19             D7 = 12A | 12B = A8
90         P20 = 13A | 13B = P21             D8 = 13A | 13B = A9
91         P22 = 14A | 14B = P23             D9 = 14A | 14B = A10
92       PCK1B = 15A | 15B = 24M            D10 = 15A | 15B = A11
93       PCK2B = 16A | 16B = 12M            D11 = 16A | 16B = A12
94         2H1 = 17A | 17B = 8M             D12 = 17A | 17B = A13
95         CA4 = 18A | 18B = RESET          D13 = 18A | 18B = A14
96         CR0 = 19A | 19B = CR1            D14 = 19A | 19B = A15
97         CR2 = 20A | 20B = CR3            D15 = 20A | 20B = A16
98         CR4 = 21A | 21B = CR5            R/W = 21A | 21B = A17
99         CR6 = 22A | 22B = CR7             AS = 22A | 22B = A18
100         CR8 = 23A | 23B = CR9         ROMOEU = 23A | 23B = A19
101        CR10 = 24A | 24B = CR11        ROMOEL = 24A | 24B = 68KCLKB
102        CR12 = 25A | 25B = CR13       PORTOEU = 25A | 25B = ROMWAIT
103        CR14 = 26A | 26B = CR15       PORTOEL = 26A | 26B = PWAIT0
104        CR16 = 27A | 27B = CR17       PORTWEU = 27A | 27B = PWAIT1
105        CR18 = 28A | 28B = CR19       PORTWEL = 28A | 28B = PDTACT
106         VCC = 29A | 29B = VCC            VCC = 29A | 29B = VCC
107         VCC = 30A | 30B = VCC            VCC = 30A | 30B = VCC
108         VCC = 31A | 31B = VCC            VCC = 31A | 31B = VCC
109         VCC = 32A | 32B = VCC            VCC = 32A | 32B = VCC
110        CR20 = 33A | 33B = CR21      PORTADRS = 33A | 33B = 4MB
111        CR22 = 34A | 34B = CR23            NC = 34A | 34B = ROMOE
112        CR24 = 35A | 35B = CR25            NC = 35A | 35B = RESET
113        CR26 = 36A | 36B = CR27            NC = 36A | 36B = NC
114        CR28 = 37A | 37B = CR29            NC = 37A | 37B = NC
115        CR30 = 38A | 38B = CR31            NC = 38A | 38B = NC
116          NC = 39A | 39B = FIX00           NC = 39A | 39B = NC
117          NC = 40A | 40B = FIX01           NC = 40A | 40B = NC
118          NC = 41A | 41B = FIX02           NC = 41A | 41B = SDPAD0
119     SYSTEMB = 42A | 42B = FIX03      SYSTEMB = 42A | 42B = SDPAD1
120        SDA0 = 43A | 43B = FIX04        SDPA8 = 43A | 43B = SDPAD2
121        SDA1 = 44A | 44B = FIX05        SDPA9 = 44A | 44B = SDPAD3
122        SDA2 = 45A | 45B = FIX06       SDPA10 = 45A | 45B = SDPAD4
123        SDA3 = 46A | 46B = FIX07       SDPA11 = 46A | 46B = SDPAD5
124        SDA4 = 47A | 47B = SDRD0       SDPMPX = 47A | 47B = SDPAD6
125        SDA5 = 48A | 48B = SDRD1        SDPOE = 48A | 48B = SDPAD7
126        SDA6 = 49A | 49B = SDROM        SDRA8 = 49A | 49B = SDRA00
127        SDA7 = 50A | 50B = SDMRD        SDRA9 = 50A | 50B = SDRA01
128        SDA8 = 51A | 51B = SDDO        SDRA20 = 51A | 51B = SDRA02
129        SDA9 = 52A | 52B = SDD1        SDRA21 = 52A | 52B = SDRA03
130       SDA10 = 53A | 53B = SDD2        SDRA22 = 53A | 53B = SDRA04
131       SDA11 = 54A | 54B = SDD3        SDRA23 = 54A | 54B = SDRA05
132       SDA12 = 55A | 55B = SDD4        SDRMPX = 55A | 55B = SDRA06
133       SDA13 = 56A | 56B = SDD5         SDROE = 56A | 56B = SDRA07
134       SDA14 = 57A | 57B = SDD6           GND = 57A | 57B = GND
135       SDA15 = 58A | 58B = SDD7           GND = 58A | 58B = GND
136         GND = 59A | 59B = GND            GND = 59A | 59B = GND
137         GND = 60A | 60B = GND            GND = 60A | 60B = GND
138
139    CTRG1 (CHA)  = Contains gfx data ('C' - rom), text layer data ('S' - rom) and sound driver ('M' - rom)
140    CTRG2 (PROG) = Contains sample data ('V' - rom) and program code ('P' - rom)
141
142NOTE: On CTRG2-B, The "A" lines start at "A1". If you trace this on an
143    actual cart, you will see that this is actually "A0" (A0 - A18).
144
145    These are from a very hard to read copy of the schematics, so
146    I hope that I got the pin names correct.
147
148    Apollo69 10/19/99
149
150
151    Known driver issues/to-do's:
152    ============================
153
60154        * Fatal Fury 3 crashes during the ending - this doesn't occur if
61155          the language is set to Japanese, maybe the English endings
62156          are incomplete / buggy?
src/mame/drivers/gottlieb.c
r4425r4426
23792379   ROM_LOAD( "mach3fg0.bin", 0x6000, 0x2000, CRC(0bae12a5) SHA1(7bc0b82ccab0e4498a7a2a9dc85f03125f25826e) )
23802380
23812381   DISK_REGION( "laserdisc" )
2382   DISK_IMAGE_READONLY( "mach3", 0, MD5(591ba5ad458a051249eb4fcfa79e7c19) SHA1(8e4ef0110832a7b7bf6dbeceb395682c1e7f8ed6) )
2382   DISK_IMAGE_READONLY( "mach3", 0, SHA1(d0f72bded7feff5c360f8749d6c27650a6964847) )
23832383ROM_END
23842384
23852385
r4425r4426
24332433   ROM_LOAD( "usvs.fg0",     0xc000, 0x4000, CRC(7734e53f) SHA1(c1307596ba098c98e741f3c00686b514587e1d0a) )
24342434
24352435   DISK_REGION( "laserdisc" )
2436   DISK_IMAGE_READONLY( "usvsthem", 0, MD5(e19bd2f819de35222a41ef676a8add98) SHA1(2018dd0dce6df51a83c9300f04c43c114341d52a) )
2436   DISK_IMAGE_READONLY( "usvsthem", 0, SHA1(c52530319dc70486f5ced95c121f1cab872e66d8) )
24372437ROM_END
24382438
24392439
src/mame/drivers/psattack.c
r4425r4426
199199   ROM_LOAD("16c711.bin",  0x0000, 0x4010, CRC(b316693f) SHA1(eba1f75043bd415268eedfdb95c475e73c14ff86) ) // converted to binary
200200
201201   DISK_REGION( "cfcard" )
202   DISK_IMAGE_READONLY( "psattack", 0, SHA1(5faa2525b159d3107d516e1d73a24bf689ffac92) MD5(880d79cffca06cd71e7e29746dd83970) )
202   DISK_IMAGE_READONLY( "psattack", 0, SHA1(c2ed467c73d46aacff7a740e2e5aada4be204750) )
203203ROM_END
204204
205205
src/mame/drivers/hng64.c
r4425r4426
15021502
15031503static MACHINE_DRIVER_START( hng64 )
15041504   /* basic machine hardware */
1505   MDRV_CPU_ADD("maincpu", R4600BE, MASTER_CLOCK)     // actually R4300
1505   MDRV_CPU_ADD("maincpu", VR4300BE, MASTER_CLOCK)     // actually R4300
15061506   MDRV_CPU_CONFIG(config)
15071507   MDRV_CPU_PROGRAM_MAP(hng_map, 0)
15081508   MDRV_CPU_VBLANK_INT_HACK(irq_start,3)
src/mame/drivers/gyruss.c
r4425r4426
416416      {0,0,0,0,0,0},  /* no node capacitors      */
417417      0, 200,
418418      CAP_U(0.1),
419      0,
419      CAP_U(1),       /* DC - Removal, not in schematics */
420420      0, 1};
421421
422422static const discrete_mixer_desc konami_left_mixer_desc =
r4425r4426
426426   {0,0,0,0,0,0},  /* no node capacitors      */
427427   0, 200,
428428   CAP_U(0.1),
429   0,
429   CAP_U(1),       /* DC - Removal, not in schematics */
430430   0, 1};
431431
432432static DISCRETE_SOUND_START( gyruss_sound )
r4425r4426
496496   /* left channel */
497497   DISCRETE_MIXER5(NODE_51, 1, NODE_34, NODE_35, NODE_36, NODE_42, NODE_16, &konami_left_mixer_desc)
498498
499   DISCRETE_OUTPUT(NODE_50, 8.0)
500   DISCRETE_OUTPUT(NODE_51, 8.0)
499   DISCRETE_OUTPUT(NODE_50, 11.0)
500   DISCRETE_OUTPUT(NODE_51, 11.0)
501501
502502DISCRETE_SOUND_END
503503
src/mame/drivers/gamecstl.c
r4425r4426
743743   ROM_LOAD("cga.chr",     0x00000, 0x01000, CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd))
744744
745745   DISK_REGION( "ide" )
746   DISK_IMAGE( "gamecstl", 0, MD5(501ddbebb530b8fd67eb64a4a2de3e35) SHA1(2477468ef1c1d4529057064a319ebfe9fd8facd7) )
746   DISK_IMAGE( "gamecstl", 0, SHA1(b431af3c42c48ba07972d77a3d24e60ee1e4359e) )
747747ROM_END
748748
749749ROM_START(gamecst2)
r4425r4426
754754   ROM_LOAD("cga.chr",     0x00000, 0x01000, CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd))
755755
756756   DISK_REGION( "ide" )
757   DISK_IMAGE( "gamecst2", 0, MD5(ef880a411521e0c6e10f715ad9dd796e) SHA1(8243d7d2eacedf358334821c9401c1b945524a69) )
757   DISK_IMAGE( "gamecst2", 0, SHA1(14e1b311cb474801c7bdda3164a0c220fb102159) )
758758ROM_END
759759
760760/*****************************************************************************/
src/mame/drivers/segas16b.c
r4425r4426
18941894INPUT_PORTS_END
18951895
18961896
1897static INPUT_PORTS_START( system16b_2button )
1898   PORT_INCLUDE( system16b_generic )
1899
1900   PORT_MODIFY("P1")
1901   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1902
1903   PORT_MODIFY("P2")
1904   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1905INPUT_PORTS_END
1906
1907
1908static INPUT_PORTS_START( system16b_1button )
1909   PORT_INCLUDE( system16b_generic )
1910
1911   PORT_MODIFY("P1")
1912   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1913   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
1914   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1915
1916   PORT_MODIFY("P2")
1917   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_COCKTAIL
1918   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1919   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_COCKTAIL
1920INPUT_PORTS_END
1921
1922
19231897#ifdef UNUSED_DEFINITION
19241898static INPUT_PORTS_START( generic )
19251899   PORT_INCLUDE( system16b_generic )
r4425r4426
20201994INPUT_PORTS_END
20211995
20221996static INPUT_PORTS_START( aliensyn )
2023   PORT_INCLUDE( system16b_1button )
1997   PORT_INCLUDE( system16b_generic )
20241998
20251999   PORT_MODIFY("DSW2")
20262000   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
r4425r4426
21832157
21842158
21852159static INPUT_PORTS_START( cotton )
2186   PORT_INCLUDE( system16b_2button )
2160   PORT_INCLUDE( system16b_generic )
21872161
21882162   PORT_MODIFY("DSW2")
21892163   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )PORT_DIPLOCATION("SW2:1")
r4425r4426
22032177
22042178
22052179static INPUT_PORTS_START( ddux )
2206   PORT_INCLUDE( system16b_2button )
2180   PORT_INCLUDE( system16b_generic )
22072181
22082182   PORT_MODIFY("DSW2")
22092183   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
r4425r4426
23992373
24002374
24012375static INPUT_PORTS_START( fpoint )
2402   PORT_INCLUDE( system16b_1button )
2376   PORT_INCLUDE( system16b_generic )
24032377
24042378   PORT_MODIFY("DSW2")
24052379   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
r4425r4426
26362610
26372611
26382612static INPUT_PORTS_START( riotcity )
2639   PORT_INCLUDE( system16b_2button )
2613   PORT_INCLUDE( system16b_generic )
26402614
26412615   PORT_MODIFY("DSW2")
26422616   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" ) PORT_DIPLOCATION("SW2:1")
r4425r4426
28412815
28422816
28432817static INPUT_PORTS_START( sonicbom )
2844   PORT_INCLUDE( system16b_2button )
2818   PORT_INCLUDE( system16b_generic )
28452819
28462820   PORT_MODIFY("DSW2")
28472821   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2,3")
r4425r4426
28702844
28712845
28722846static INPUT_PORTS_START( tetris )
2873   PORT_INCLUDE( system16b_1button )
2847   PORT_INCLUDE( system16b_generic )
28742848
28752849   PORT_MODIFY("P1")
28762850   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
r4425r4426
28942868
28952869
28962870static INPUT_PORTS_START( timescan )
2897   PORT_INCLUDE( system16b_2button )
2871   PORT_INCLUDE( system16b_generic )
28982872
28992873   PORT_MODIFY("P1")
29002874   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
r4425r4426
29602934
29612935
29622936static INPUT_PORTS_START( toryumon )
2963   PORT_INCLUDE( system16b_1button )
2937   PORT_INCLUDE( system16b_generic )
29642938
29652939   PORT_MODIFY("DSW2")
29662940   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1")
r4425r4426
30102984
30112985
30122986static INPUT_PORTS_START( wb3 )
3013   PORT_INCLUDE( system16b_2button )
2987   PORT_INCLUDE( system16b_generic )
30142988
30152989   PORT_MODIFY("DSW2")
30162990   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
r4425r4426
30353009
30363010
30373011static INPUT_PORTS_START( wrestwar )
3038   PORT_INCLUDE( system16b_2button )
3012   PORT_INCLUDE( system16b_generic )
30393013
30403014   PORT_MODIFY("DSW2")
30413015   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
src/mame/drivers/konamim2.c
r4425r4426
11671167   ROM_LOAD( "93c46.7k",  0x000000, 0x000080, CRC(66d02984) SHA1(d07c57d198c611b6ff67a783c20a3d038ba34cd1) )
11681168
11691169   DISK_REGION( "cdrom" )
1170   DISK_IMAGE( "623jaa02", 0, MD5(6071c1b70c190fa7c50676eb5308e024) SHA1(a7dc6086d0244b5472f61b41992623c7a9dc2e9c))
1170   DISK_IMAGE( "623jaa02", 0, SHA1(cd542931cdac95d05344d34421e223dd6e371bb5))
11711171ROM_END
11721172
11731173ROM_START(btltryst)
r4425r4426
11751175   ROM_LOAD16_WORD("636a01.8q", 0x000000, 0x200000, CRC(7b1dc738) SHA1(32ae8e7ddd38fcc70b4410275a2cc5e9a0d7d33b))
11761176
11771177   DISK_REGION( "cdrom" )
1178   DISK_IMAGE( "btltryst", 0, MD5(4286d25a896d1450705f742cccd26ef2) SHA1(becc606b8480f6a09365b611565d83cfdc82b0b3))
1178   DISK_IMAGE( "btltryst", 0, SHA1(c76326b0a0fcfe696a2ca019170d3abde40e773e))
11791179ROM_END
11801180
11811181ROM_START(heatof11)
r4425r4426
11861186   ROM_LOAD( "dallas.5e",  0x000000, 0x002000, CRC(8611ff09) SHA1(6410236947d99c552c4a1f7dd5fd8c7a5ae4cba1) )
11871187
11881188   DISK_REGION( "cdrom" )
1189   DISK_IMAGE( "heatof11", 0, MD5(1eef9f191439f13d1a867629226b0230) SHA1(87599d03aecadf5d119d05173bdef2940bcce515))
1189   DISK_IMAGE( "heatof11", 0, SHA1(5a0a2782cd8676d3f6dfad4e0f805b309e230d8b))
11901190ROM_END
11911191
11921192ROM_START(evilngt)
r4425r4426
12051205   ROM_LOAD( "m48t58y.u1",  0x000000, 0x001000, CRC(169bb8f4) SHA1(55c0bafab5d309fe69156489186e232aa87ca0dd) )
12061206
12071207   DISK_REGION( "cdrom" )
1208   DISK_IMAGE( "810eaa02", 0, MD5(250a1b9cc2a25aed6c27321dd8f4f8a2) SHA1(d2f48a389f8091e03ada81c255231c7957d1aee3))
1208   DISK_IMAGE( "810eaa02", 0, SHA1(c407bad498cb87788ce332dbef5e8c6e19c1fd16))
12091209ROM_END
12101210
12111211ROM_START(totlvice)
r4425r4426
12161216   ROM_LOAD( "639jaa02.bin",  0x000000, 0x100000, CRC(c6163818) SHA1(b6f8f2d808b98610becc0a5be5443ece3908df0b) )
12171217
12181218   DISK_REGION( "cdrom" )
1219   DISK_IMAGE( "639jad01", 0, MD5(bc3156be374e7a99040763bf0cea7ad3) SHA1(c4503d9954c72dd8f70521f313f0338528116c26))
1219   DISK_IMAGE( "639jad01", 0, SHA1(39d41d5a9d1c40636d174c8bb8172b1121e313f8))
12201220ROM_END
12211221
12221222static DRIVER_INIT( m2 )
src/mame/drivers/comebaby.c
r4425r4426
101101   ROM_LOAD("comeonbaby.pcbios", 0x000000, 0x10000, NO_DUMP )
102102
103103   DISK_REGION( "disks" )
104   DISK_IMAGE( "comebaby", 0, SHA1(e187db3d99f7a2b0f1c33727ad6716e695ac250e) MD5(ed1c8e13a34bbf348493d2848d351849) )
104   DISK_IMAGE( "comebaby", 0, SHA1(ea57919319c0b6a1d4abd7822cff028855bf082f) )
105105ROM_END
106106
107107
src/mame/drivers/hvyunit.c
r4425r4426
209209            {
210210               mcu_ram.attract_timer++;
211211               popmessage("%d",mcu_ram.attract_timer);
212               if(mcu_ram.attract_timer > 200 && mcu_ram.program_flow == 1) { res = 25;/*input_port_read(space->machine, "TEST");*/ mcu_ram.attract_timer = 0; mcu_ram.program_flow = 1; }
212               if(mcu_ram.attract_timer > 200 && mcu_ram.program_flow == 1) { res = 0;/*input_port_read(space->machine, "TEST");*/ mcu_ram.attract_timer = 0; mcu_ram.program_flow = 0; }
213213            }
214214            if(mcu_ram.program_flow == 3)
215215               res = 4;
r4425r4426
355355static ADDRESS_MAP_START(main_io, ADDRESS_SPACE_IO, 8 )
356356   ADDRESS_MAP_GLOBAL_MASK(0xff)
357357   AM_RANGE(0x00, 0x00) AM_WRITE(main_bankswitch_w)
358   AM_RANGE(0x01, 0x01) AM_WRITE(main_bankswitch_w)
358359   AM_RANGE(0x02, 0x02) AM_WRITE(trigger_nmi_on_sub_cpu)
359360ADDRESS_MAP_END
360361
src/mame/drivers/cubeqst.c
r4425r4426
665665   ROM_LOAD( "fill_board_82s129.14p", 0x400, 0x100, CRC(6b572b73) SHA1(4a065cb05c12ce34e5598341e0de0cc571b2d387) )
666666
667667   DISK_REGION( "laserdisc" )
668   DISK_IMAGE_READONLY_OPTIONAL( "cubeqst", 0, SHA1(5266a0a43963628464fac1719e1cefec627042a4) MD5(d2e6010f9b9d36ba50664096ec331f8d) )
668   DISK_IMAGE_READONLY_OPTIONAL( "cubeqst", 0, SHA1(d0e24bb5d0ae424e0816110ec7d6b21189044d57) )
669669ROM_END
670670
671671/*************************************
src/tools/src2html.c
r4425r4426
202202int main(int argc, char *argv[])
203203{
204204   astring *srcdir = NULL, *dstdir = NULL, *tempfilename = NULL, *tempheader = NULL, *tempfooter = NULL;
205   core_file *tempfile;
206205   int unadorned = 0;
206   UINT32 bufsize;
207   void *buffer;
207208   int result;
208209   int argnum;
209210
r4425r4426
249250      goto usage;
250251
251252   /* read the template file into an astring */
252   if (core_fopen(astring_c(tempfilename), OPEN_FLAG_READ, &tempfile) == FILERR_NONE)
253   if (core_fload(astring_c(tempfilename), &buffer, &bufsize) == FILERR_NONE)
253254   {
254      UINT64 filesize = core_fsize(tempfile);
255      void *buffer = malloc(filesize);
256      if (buffer != NULL)
257      {
258         core_fread(tempfile, buffer, filesize);
259         tempheader = astring_dupch(buffer, filesize);
260         free(buffer);
261      }
262      core_fclose(tempfile);
255      tempheader = astring_dupch(buffer, bufsize);
256      free(buffer);
263257   }
264258
265259   /* verify the template */
src/tools/regrep.c
r4425r4426
222222int main(int argc, char *argv[])
223223{
224224   astring *dirname = NULL, *tempfilename = NULL, *tempheader = NULL, *tempfooter = NULL;
225   core_file *tempfile;
225   UINT32 bufsize;
226   void *buffer;
226227   int listnum;
227228    int result;
228229
r4425r4426
237238    list_count = argc - 3;
238239
239240   /* read the template file into an astring */
240   if (core_fopen(astring_c(tempfilename), OPEN_FLAG_READ, &tempfile) == FILERR_NONE)
241   if (core_fload(astring_c(tempfilename), &buffer, &bufsize) == FILERR_NONE)
241242   {
242      UINT64 filesize = core_fsize(tempfile);
243      void *buffer = malloc(filesize);
244      if (buffer != NULL)
245      {
246         core_fread(tempfile, buffer, filesize);
247         tempheader = astring_dupch(buffer, filesize);
248         free(buffer);
249      }
250      core_fclose(tempfile);
243      tempheader = astring_dupch(buffer, bufsize);
244      free(buffer);
251245   }
252246
253247   /* verify the template */
src/tools/chdman.c
r4425r4426
6969
7070static chd_error chdman_compress_file(chd_file *chd, const char *rawfile, UINT32 offset);
7171static chd_error chdman_compress_chd(chd_file *chd, chd_file *source, UINT32 totalhunks);
72static chd_error chdman_clone_metadata(chd_file *source, chd_file *dest);
7273
7374
7475
r4425r4426
150151{
151152   printf("usage: chdman -info input.chd\n");
152153   printf("   or: chdman -createraw inputhd.raw output.chd [inputoffs [hunksize]]\n");
153   printf("   or: chdman -createhd inputhd.raw output.chd [inputoffs [cylinders heads sectors [sectorsize [hunksize]]]]\n");
154   printf("   or: chdman -createhd inputhd.raw output.chd [ident.bin] [inputoffs [cylinders heads sectors [sectorsize [hunksize]]]]\n");
154155   printf("   or: chdman -createblankhd output.chd cylinders heads sectors [sectorsize [hunksize]]\n");
155156   printf("   or: chdman -createcd input.toc output.chd\n");
156157   printf("   or: chdman -createav input.avi output.chd [firstframe [numframes]]\n");
r4425r4426
166167   printf("   or: chdman -diff parent.chd compare.chd diff.chd\n");
167168   printf("   or: chdman -setchs inout.chd cylinders heads sectors\n");
168169   printf("   or: chdman -fixavdata inout.chd\n");
170   printf("   or: chdman -addmetabin inout.chd tag [index] sourcefile\n");
171   printf("   or: chdman -addmetatext inout.chd tag [index] sourcefile\n");
169172   return 1;
170173}
171174
r4425r4426
241244
242245
243246/*-------------------------------------------------
247    get_chs_from_ident - extract chs from an ident
248    information, validate it with the file size
249
250    Note: limited to IDE for now
251-------------------------------------------------*/
252
253static chd_error get_chs_from_ident(const char *filename, int offset, const UINT8 *ident, UINT32 identsize, UINT32 *cylinders, UINT32 *heads, UINT32 *sectors, UINT32 *bps)
254{
255   UINT64 filesize, expected_size;
256
257   filesize = get_file_size(filename);
258   if (filesize <= offset)
259   {
260      fprintf(stderr, "Invalid file '%s'\n", filename);
261      return CHDERR_INVALID_FILE;
262   }
263
264   if (filesize % 512 != 0)
265   {
266      fprintf(stderr, "Can't validate CHS values because data size is not divisible by the sector size\n");
267      return CHDERR_INVALID_FILE;
268   }
269
270   if (identsize < 14)
271   {
272      fprintf(stderr, "Error: the ident metadata is too short to include geometry information\n");
273      return CHDERR_INVALID_FILE;
274   }
275
276   *bps = 512;
277   *cylinders = ((unsigned char)ident[ 2]) | (((unsigned char )ident[ 3]) << 8);
278   *heads     = ((unsigned char)ident[ 6]) | (((unsigned char )ident[ 7]) << 8);
279   *sectors   = ((unsigned char)ident[12]) | (((unsigned char )ident[13]) << 8);
280
281   expected_size = (UINT64)*cylinders * (UINT64)*heads * (UINT64)*sectors * 512;
282   if (expected_size != filesize - offset)
283   {
284      fprintf(stderr, "Error: Mismatch between the ident CHS data (%u/%u/%u, %u sectors) and the file size (%u sectors)\n",
285            *cylinders, *heads, *sectors, *cylinders * *heads * *sectors,
286            (UINT32)((filesize-offset)/512));
287      return CHDERR_INVALID_FILE;
288   }
289   return CHDERR_NONE;
290}
291
292
293/*-------------------------------------------------
244294    do_createhd - create a new compressed hard
245295    disk image from a raw file
246296-------------------------------------------------*/
r4425r4426
249299{
250300   UINT32 guess_cylinders = 0, guess_heads = 0, guess_sectors = 0, guess_sectorsize = 0;
251301   UINT32 cylinders, heads, sectors, sectorsize, hunksize, totalsectors, offset;
252   const char *inputfile, *outputfile;
302   const char *inputfile, *outputfile = NULL;
303   chd_error err = CHDERR_NONE;
304   UINT32 identdatasize = 0;
305   UINT8 *identdata = NULL;
253306   chd_file *chd = NULL;
254307   char metadata[256];
255   chd_error err;
256308
309   /* if a file is provided for argument 4 (ident filename), then shift the remaining arguments down */
310   if (argc >= 5)
311   {
312      char *scan;
313
314      /* if there are any non-digits in the 'offset', then treat it as a ident file */
315      for (scan = argv[4]; *scan != 0; scan++)
316         if (!isdigit(*scan))
317            break;
318      if (*scan != 0)
319      {
320         /* attempt to load the file */
321         file_error filerr = core_fload(argv[4], (void **)&identdata, &identdatasize);
322         if (filerr != FILERR_NONE)
323         {
324            fprintf(stderr, "Error opening ident file '%s'\n", argv[4]);
325            return 1;
326         }
327
328         /* shift the remaining arguments down */
329         if (argc > 5)
330            memmove(&argv[4], &argv[5], (argc - 5) * sizeof(argv[0]));
331         argc--;
332      }
333   }
334
257335   /* require 4-5, or 8-10 args total */
258336   if (argc != 4 && argc != 5 && argc != 8 && argc != 9 && argc != 10)
259337      return usage();
r4425r4426
266344   /* if less than 8 parameters, we need to guess the CHS values */
267345   if (argc < 8)
268346   {
269      err = guess_chs(inputfile, offset, IDE_SECTOR_SIZE, &guess_cylinders, &guess_heads, &guess_sectors, &guess_sectorsize);
347      if (identdata != NULL)
348         err = get_chs_from_ident(inputfile, offset, identdata, identdatasize, &guess_cylinders, &guess_heads, &guess_sectors, &guess_sectorsize);
349      else
350         err = guess_chs(inputfile, offset, IDE_SECTOR_SIZE, &guess_cylinders, &guess_heads, &guess_sectors, &guess_sectorsize);
270351      if (err != CHDERR_NONE)
271352         goto cleanup;
272353   }
r4425r4426
309390
310391   /* write the metadata */
311392   sprintf(metadata, HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize);
312   err = chd_set_metadata(chd, HARD_DISK_METADATA_TAG, 0, metadata, strlen(metadata) + 1, 0);
393   err = chd_set_metadata(chd, HARD_DISK_METADATA_TAG, 0, metadata, strlen(metadata) + 1, CHD_MDFLAGS_CHECKSUM);
313394   if (err != CHDERR_NONE)
314395   {
315396      fprintf(stderr, "Error adding hard disk metadata: %s\n", chd_error_string(err));
316397      goto cleanup;
317398   }
318399
400   /* write the ident if present */
401   if (identdata != NULL)
402   {
403      err = chd_set_metadata(chd, HARD_DISK_IDENT_METADATA_TAG, 0, identdata, identdatasize, CHD_MDFLAGS_CHECKSUM);
404      if (err != CHDERR_NONE)
405      {
406         fprintf(stderr, "Error adding hard disk metadata: %s\n", chd_error_string(err));
407         goto cleanup;
408      }
409   }
410
319411   /* compress the hard drive */
320412   err = chdman_compress_file(chd, inputfile, offset);
321413   if (err != CHDERR_NONE)
r4425r4426
327419      chd_close(chd);
328420   if (err != CHDERR_NONE)
329421      osd_rmfile(outputfile);
422   if (identdata != NULL)
423      free(identdata);
330424   return (err != CHDERR_NONE);
331425}
332426
r4425r4426
474568   }
475569
476570   /* write the metadata */
477   for (i = 0; i < toc.numtrks; i++)
571   err = cdrom_write_metadata(chd, &toc);
572   if (err != CHDERR_NONE)
478573   {
479      char metadata[256];
480      sprintf(metadata, CDROM_TRACK_METADATA_FORMAT, i + 1, cdrom_get_type_string(&toc.tracks[i]),
481            cdrom_get_subtype_string(&toc.tracks[i]), toc.tracks[i].frames);
482
483      err = chd_set_metadata(chd, CDROM_TRACK_METADATA_TAG, i, metadata, strlen(metadata) + 1, 0);
484      if (err != CHDERR_NONE)
485      {
486         fprintf(stderr, "Error adding CD-ROM metadata: %s\n", chd_error_string(err));
487         goto cleanup;
488      }
574      fprintf(stderr, "Error adding CD-ROM metadata: %s\n", chd_error_string(err));
575      goto cleanup;
489576   }
490577
491578   /* begin state for writing */
r4425r4426
902989
903990   /* write the metadata */
904991   sprintf(metadata, AV_METADATA_FORMAT, fps_times_1million / 1000000, fps_times_1million % 1000000, width, height, interlaced, channels, rate);
905   err = chd_set_metadata(chd, AV_METADATA_TAG, 0, metadata, strlen(metadata) + 1, 0);
992   err = chd_set_metadata(chd, AV_METADATA_TAG, 0, metadata, strlen(metadata) + 1, CHD_MDFLAGS_CHECKSUM);
906993   if (err != CHDERR_NONE)
907994   {
908995      fprintf(stderr, "Error adding AV metadata: %s\n", chd_error_string(err));
r4425r4426
9591046   /* write the final metadata */
9601047   if (ldframedata != NULL)
9611048   {
962      err = chd_set_metadata(chd, AV_LD_METADATA_TAG, 0, ldframedata, numframes * VBI_PACKED_BYTES, 0);
1049      err = chd_set_metadata(chd, AV_LD_METADATA_TAG, 0, ldframedata, numframes * VBI_PACKED_BYTES, CHD_MDFLAGS_CHECKSUM);
9631050      if (err != CHDERR_NONE)
9641051      {
9651052         fprintf(stderr, "Error adding AVLD metadata: %s\n", chd_error_string(err));
r4425r4426
10481135
10491136   /* write the metadata */
10501137   sprintf(metadata, HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize);
1051   err = chd_set_metadata(chd, HARD_DISK_METADATA_TAG, 0, metadata, strlen(metadata) + 1, 0);
1138   err = chd_set_metadata(chd, HARD_DISK_METADATA_TAG, 0, metadata, strlen(metadata) + 1, CHD_MDFLAGS_CHECKSUM);
10521139   if (err != CHDERR_NONE)
10531140   {
10541141      fprintf(stderr, "Error adding hard disk metadata: %s\n", chd_error_string(err));
r4425r4426
12361323         err = CHDERR_WRITE_ERROR;
12371324         goto cleanup;
12381325      }
1326      bytesremaining -= byteswritten;
12391327   }
12401328   progress(TRUE, "Extraction complete!                    \n");
12411329
r4425r4426
16361724
16371725static int do_verify(int argc, char *argv[], int param)
16381726{
1639   UINT8 actualmd5[CHD_MD5_BYTES], actualsha1[CHD_SHA1_BYTES];
1727   chd_verify_result verify;
16401728   const char *inputfile;
16411729   chd_file *chd = NULL;
16421730   chd_header header;
r4425r4426
16811769
16821770      /* finish it */
16831771      if (err == CHDERR_NONE)
1684         err = chd_verify_finish(chd, actualmd5, actualsha1);
1772         err = chd_verify_finish(chd, &verify);
16851773   }
16861774
16871775   /* handle errors */
r4425r4426
16951783   }
16961784
16971785   /* verify the MD5 */
1698   if (memcmp(header.md5, actualmd5, sizeof(header.md5)) == 0)
1699      printf("MD5 verification successful!\n");
1700   else
1786   if (header.version <= 3)
17011787   {
1702      fprintf(stderr, "Error: MD5 in header = ");
1703      for (i = 0; i < CHD_MD5_BYTES; i++)
1704         fprintf(stderr, "%02x", header.md5[i]);
1705      fprintf(stderr, "\n");
1706      fprintf(stderr, "          actual MD5 = ");
1707      for (i = 0; i < CHD_MD5_BYTES; i++)
1708         fprintf(stderr, "%02x", actualmd5[i]);
1709      fprintf(stderr, "\n");
1788      if (memcmp(header.md5, verify.md5, sizeof(header.md5)) == 0)
1789         printf("MD5 verification successful!\n");
1790      else
1791      {
1792         fprintf(stderr, "Error: MD5 in header = ");
1793         for (i = 0; i < CHD_MD5_BYTES; i++)
1794            fprintf(stderr, "%02x", header.md5[i]);
1795         fprintf(stderr, "\n");
1796         fprintf(stderr, "          actual MD5 = ");
1797         for (i = 0; i < CHD_MD5_BYTES; i++)
1798            fprintf(stderr, "%02x", verify.md5[i]);
1799         fprintf(stderr, "\n");
17101800
1711      /* fix it */
1712      if (param)
1713      {
1714         memcpy(header.md5, actualmd5, sizeof(header.md5));
1715         fixed = TRUE;
1801         /* fix it */
1802         if (param)
1803         {
1804            memcpy(header.md5, verify.md5, sizeof(header.md5));
1805            fixed = TRUE;
1806         }
17161807      }
17171808   }
17181809
17191810   /* verify the SHA1 */
17201811   if (header.version >= 3)
17211812   {
1722      if (memcmp(header.sha1, actualsha1, sizeof(header.sha1)) == 0)
1813      if (memcmp(header.sha1, verify.sha1, sizeof(header.sha1)) == 0)
17231814         printf("SHA1 verification successful!\n");
17241815      else
17251816      {
r4425r4426
17291820         fprintf(stderr, "\n");
17301821         fprintf(stderr, "          actual SHA1 = ");
17311822         for (i = 0; i < CHD_SHA1_BYTES; i++)
1732            fprintf(stderr, "%02x", actualsha1[i]);
1823            fprintf(stderr, "%02x", verify.sha1[i]);
17331824         fprintf(stderr, "\n");
17341825
17351826         /* fix it */
17361827         if (param)
17371828         {
1738            memcpy(header.sha1, actualsha1, sizeof(header.sha1));
1829            memcpy(header.sha1, verify.sha1, sizeof(header.sha1));
17391830            fixed = TRUE;
17401831         }
1832
1833         /* verify the raw SHA1 */
1834         if (header.version >= 4)
1835         {
1836            if (memcmp(header.rawsha1, verify.rawsha1, sizeof(header.rawsha1)) != 0)
1837            {
1838               fprintf(stderr, "Error: raw SHA1 in header = ");
1839               for (i = 0; i < CHD_SHA1_BYTES; i++)
1840                  fprintf(stderr, "%02x", header.rawsha1[i]);
1841               fprintf(stderr, "\n");
1842               fprintf(stderr, "          actual raw SHA1 = ");
1843               for (i = 0; i < CHD_SHA1_BYTES; i++)
1844                  fprintf(stderr, "%02x", verify.rawsha1[i]);
1845               fprintf(stderr, "\n");
1846
1847               /* fix it */
1848               if (param)
1849               {
1850                  memcpy(header.rawsha1, verify.rawsha1, sizeof(header.rawsha1));
1851                  fixed = TRUE;
1852               }
1853            }
1854         }
17411855      }
17421856   }
17431857
r4425r4426
19672081      }
19682082
19692083      /* write new metadata */
1970      err = chd_set_metadata(chd, AV_LD_METADATA_TAG, 0, vbidata, header.totalhunks * VBI_PACKED_BYTES, 0);
2084      err = chd_set_metadata(chd, AV_LD_METADATA_TAG, 0, vbidata, header.totalhunks * VBI_PACKED_BYTES, CHD_MDFLAGS_CHECKSUM);
19712085      if (err != CHDERR_NONE)
19722086      {
19732087         fprintf(stderr, "Error adding AVLD metadata: %s\n", chd_error_string(err));
r4425r4426
20362150   printf("Hunk Size:    %d bytes\n", header.hunkbytes);
20372151   printf("Total Hunks:  %d\n", header.totalhunks);
20382152   printf("Logical size: %s bytes\n", big_int_string(header.logicalbytes));
2039   if (!(header.flags & CHDFLAGS_IS_WRITEABLE))
2153   if (!(header.flags & CHDFLAGS_IS_WRITEABLE) && header.version <= 3)
20402154      printf("MD5:          %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
20412155            header.md5[0], header.md5[1], header.md5[2], header.md5[3],
20422156            header.md5[4], header.md5[5], header.md5[6], header.md5[7],
r4425r4426
20492163            header.sha1[8], header.sha1[9], header.sha1[10], header.sha1[11],
20502164            header.sha1[12], header.sha1[13], header.sha1[14], header.sha1[15],
20512165            header.sha1[16], header.sha1[17], header.sha1[18], header.sha1[19]);
2166   if (!(header.flags & CHDFLAGS_IS_WRITEABLE) && header.version >= 4)
2167   {
2168      printf("Raw SHA1:     %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
2169            header.rawsha1[0], header.rawsha1[1], header.rawsha1[2], header.rawsha1[3],
2170            header.rawsha1[4], header.rawsha1[5], header.rawsha1[6], header.rawsha1[7],
2171            header.rawsha1[8], header.rawsha1[9], header.rawsha1[10], header.rawsha1[11],
2172            header.rawsha1[12], header.rawsha1[13], header.rawsha1[14], header.rawsha1[15],
2173            header.rawsha1[16], header.rawsha1[17], header.rawsha1[18], header.rawsha1[19]);
2174   }
20522175   if (header.flags & CHDFLAGS_HAS_PARENT)
20532176   {
20542177      printf("Parent MD5:   %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
r4425r4426
23122435   }
23132436
23142437   /* clone the metadata from the input file (which should have inherited from the parent) */
2315   err = chd_clone_metadata(inputchd, outputchd);
2438   err = chdman_clone_metadata(inputchd, outputchd);
23162439   if (err != CHDERR_NONE)
23172440   {
23182441      fprintf(stderr, "Error cloning metadata: %s\n", chd_error_string(err));
r4425r4426
24942617
24952618   /* write our own */
24962619   sprintf(metadata, HARD_DISK_METADATA_FORMAT, cyls, hds, secs, oldsecsize);
2497   err = chd_set_metadata(chd, HARD_DISK_METADATA_TAG, 0, metadata, strlen(metadata) + 1, 0);
2620   err = chd_set_metadata(chd, HARD_DISK_METADATA_TAG, 0, metadata, strlen(metadata) + 1, CHD_MDFLAGS_CHECKSUM);
24982621   if (err != CHDERR_NONE)
24992622   {
25002623      fprintf(stderr, "Error writing new metadata to CHD file: %s\n", chd_error_string(err));
r4425r4426
25412664
25422665
25432666/*-------------------------------------------------
2667    do_addmeta - add metadata to a CHD from a
2668    file
2669-------------------------------------------------*/
2670
2671static int do_addmeta(int argc, char *argv[], int param)
2672{
2673   const char *inoutfile, *srcfile, *tagstring;
2674   UINT8 was_readonly = FALSE;
2675   UINT8 *metadata = NULL;
2676   chd_file *chd = NULL;
2677   chd_header header;
2678   file_error filerr;
2679   UINT32 metalength;
2680   UINT32 metaindex;
2681   UINT32 metatag;
2682   chd_error err;
2683
2684   /* require 5 or 6 args total */
2685   if (argc != 5 && argc != 6)
2686      return usage();
2687
2688   /* extract the data */
2689   inoutfile = argv[2];
2690   tagstring = argv[3];
2691   if (argc == 5)
2692   {
2693      metaindex = 0;
2694      srcfile = argv[4];
2695   }
2696   else
2697   {
2698      metaindex = atoi(argv[4]);
2699      srcfile = argv[5];
2700   }
2701
2702   /* verify the tag */
2703   if (strlen(tagstring) > 4)
2704   {
2705      fprintf(stderr, "Invalid tag '%s'; must be 4 characters or less\n", tagstring);
2706      return CHDERR_INVALID_PARAMETER;
2707   }
2708   metatag = ((tagstring[0] == 0) ? ' ' : tagstring[0]) << 24;
2709   metatag |= ((tagstring[1] == 0) ? ' ' : tagstring[1]) << 16;
2710   metatag |= ((tagstring[2] == 0) ? ' ' : tagstring[2]) << 8;
2711   metatag |= ((tagstring[3] == 0) ? ' ' : tagstring[3]) << 0;
2712
2713   /* print some info */
2714   printf("Input file:   %s\n", inoutfile);
2715   printf("Tag:          '%c%c%c%c'\n", (metatag >> 24) & 0xff, (metatag >> 16) & 0xff, (metatag >> 8) & 0xff, metatag & 0xff);
2716   printf("Index:        %d\n", metaindex);
2717   printf("Source file:  %s\n", srcfile);
2718
2719   /* open the file read-only and get the header */
2720   err = chd_open(inoutfile, CHD_OPEN_READ, NULL, &chd);
2721   if (err != CHDERR_NONE)
2722   {
2723      fprintf(stderr, "Error opening CHD file '%s' read-only: %s\n", inoutfile, chd_error_string(err));
2724      goto cleanup;
2725   }
2726   header = *chd_get_header(chd);
2727   chd_close(chd);
2728   chd = NULL;
2729
2730   /* if the drive is not writeable, note that, and make it so */
2731   if (!(header.flags & CHDFLAGS_IS_WRITEABLE))
2732   {
2733      was_readonly = TRUE;
2734      header.flags |= CHDFLAGS_IS_WRITEABLE;
2735
2736      /* write the new header */
2737      err = chd_set_header(inoutfile, &header);
2738      if (err != CHDERR_NONE)
2739      {
2740         fprintf(stderr, "Error making CHD file writeable: %s\n", chd_error_string(err));
2741         goto cleanup;
2742      }
2743   }
2744
2745   /* open the file read/write */
2746   err = chd_open(inoutfile, CHD_OPEN_READWRITE, NULL, &chd);
2747   if (err != CHDERR_NONE)
2748   {
2749      fprintf(stderr, "Error opening CHD file '%s' read/write: %s\n", inoutfile, chd_error_string(err));
2750      goto cleanup;
2751   }
2752
2753   /* attempt to open the source file */
2754   filerr = core_fload(srcfile, (void **)&metadata, &metalength);
2755   if (filerr != FILERR_NONE)
2756   {
2757      fprintf(stderr, "Error opening source file '%s'\n", srcfile);
2758      err = CHDERR_FILE_NOT_FOUND;
2759      goto cleanup;
2760   }
2761
2762   /* if it's text, strip any trailing Ctrl-Z and CR/LF and add a trailing NULL */
2763   if (param)
2764   {
2765      metadata = realloc(metadata, metalength + 1);
2766      if (metadata == NULL)
2767      {
2768         fprintf(stderr, "Out of memory preparing metadata\n");
2769         err = CHDERR_OUT_OF_MEMORY;
2770         goto cleanup;
2771      }
2772      metadata[metalength++] = 0;
2773      while (metalength > 0 && (metadata[metalength - 2] == 0x0a || metadata[metalength - 2] == 0x0d || metadata[metalength - 2] == 0x1a))
2774         metadata[--metalength] = 0;
2775   }
2776
2777   /* write the new metadata */
2778   err = chd_set_metadata(chd, metatag, metaindex, metadata, metalength, CHD_MDFLAGS_CHECKSUM);
2779   if (err != CHDERR_NONE)
2780   {
2781      fprintf(stderr, "Error writing new metadata to CHD file: %s\n", chd_error_string(err));
2782      goto cleanup;
2783   }
2784   header = *chd_get_header(chd);
2785
2786   /* close the file */
2787   chd_close(chd);
2788   chd = NULL;
2789
2790   /* restore the read-only state */
2791   if (was_readonly)
2792   {
2793      header.flags &= ~CHDFLAGS_IS_WRITEABLE;
2794      err = chd_set_header(inoutfile, &header);
2795      if (err != CHDERR_NONE)
2796         fprintf(stderr, "Error writing new header to CHD file: %s\n", chd_error_string(err));
2797   }
2798   if (err == CHDERR_NONE)
2799      printf("Metadata added successfully as %s\n", param ? "text" : "binary");
2800
2801cleanup:
2802   if (metadata != NULL)
2803      free(metadata);
2804   if (chd != NULL)
2805      chd_close(chd);
2806   if (err != CHDERR_NONE && was_readonly)
2807   {
2808      header.flags &= ~CHDFLAGS_IS_WRITEABLE;
2809      chd_set_header(inoutfile, &header);
2810   }
2811   return (err != CHDERR_NONE);
2812}
2813
2814
2815/*-------------------------------------------------
25442816    chdman_compress_file - compress a regular
25452817    file via the compression interfaces
25462818-------------------------------------------------*/
r4425r4426
27132985   if (verifyerr == CHDERR_NONE && source_offset >= source_header->logicalbytes)
27142986   {
27152987      static const UINT8 empty_checksum[CHD_SHA1_BYTES] = { 0 };
2716      UINT8 md5[CHD_MD5_BYTES];
2717      UINT8 sha1[CHD_SHA1_BYTES];
2988      chd_verify_result verify;
27182989      int i;
27192990
27202991      /* get the final values */
2721      err = chd_verify_finish(source, md5, sha1);
2992      err = chd_verify_finish(source, &verify);
27222993
27232994      /* check the MD5 */
27242995      if (memcmp(source_header->md5, empty_checksum, CHD_MD5_BYTES) != 0)
27252996      {
2726         if (memcmp(source_header->md5, md5, CHD_MD5_BYTES) != 0)
2997         if (memcmp(source_header->md5, verify.md5, CHD_MD5_BYTES) != 0)
27272998         {
27282999            progress(TRUE, "WARNING: expected input MD5 = ");
27293000            for (i = 0; i < CHD_MD5_BYTES; i++)
r4425r4426
27323003
27333004            progress(TRUE, "                 actual MD5 = ");
27343005            for (i = 0; i < CHD_MD5_BYTES; i++)
2735               progress(TRUE, "%02x", md5[i]);
3006               progress(TRUE, "%02x", verify.md5[i]);
27363007            progress(TRUE, "\n");
27373008         }
27383009         else
r4425r4426
27423013      /* check the SHA1 */
27433014      if (memcmp(source_header->sha1, empty_checksum, CHD_SHA1_BYTES) != 0)
27443015      {
2745         if (memcmp(source_header->sha1, sha1, CHD_SHA1_BYTES) != 0)
3016         if (memcmp(source_header->sha1, verify.sha1, CHD_SHA1_BYTES) != 0)
27463017         {
27473018            progress(TRUE, "WARNING: expected input SHA1 = ");
27483019            for (i = 0; i < CHD_SHA1_BYTES; i++)
r4425r4426
27513022
27523023            progress(TRUE, "                 actual SHA1 = ");
27533024            for (i = 0; i < CHD_SHA1_BYTES; i++)
2754               progress(TRUE, "%02x", sha1[i]);
3025               progress(TRUE, "%02x", verify.sha1[i]);
27553026            progress(TRUE, "\n");
27563027         }
27573028         else
r4425r4426
27773048
27783049
27793050/*-------------------------------------------------
3051    chdman_clone_metadata - clone the metadata from
3052    one CHD to a second
3053-------------------------------------------------*/
3054
3055static chd_error chdman_clone_metadata(chd_file *source, chd_file *dest)
3056{
3057   const chd_header *header = chd_get_header(source);
3058   UINT8 metabuffer[MAX(4096, sizeof(cdrom_toc))];
3059   UINT32 metatag, metasize, metaindex;
3060   UINT8 metaflags;
3061   chd_error err;
3062
3063   /* clone the metadata */
3064   for (metaindex = 0; ; metaindex++)
3065   {
3066      /* fetch the next piece of metadata */
3067      err = chd_get_metadata(source, CHDMETATAG_WILDCARD, metaindex, metabuffer, sizeof(metabuffer), &metasize, &metatag, &metaflags);
3068      if (err != CHDERR_NONE)
3069      {
3070         if (err == CHDERR_METADATA_NOT_FOUND)
3071            err = CHDERR_NONE;
3072         break;
3073      }
3074
3075      /* promote certain bits of metadata to checksummed for older CHDs */
3076      if (header->version <= 3)
3077      {
3078         if (metatag == HARD_DISK_METADATA_TAG || metatag == CDROM_OLD_METADATA_TAG ||
3079             metatag == CDROM_TRACK_METADATA_TAG || metatag == AV_METADATA_TAG ||
3080             metatag == AV_LD_METADATA_TAG)
3081         {
3082            metaflags |= CHD_MDFLAGS_CHECKSUM;
3083         }
3084
3085         /* convert old-style CD-ROM data to newer */
3086         if (metatag == CDROM_OLD_METADATA_TAG)
3087         {
3088            cdrom_toc *toc = (cdrom_toc *)metabuffer;
3089            err = cdrom_parse_metadata(source, toc);
3090            if (err == CHDERR_NONE)
3091               err = cdrom_write_metadata(dest, toc);
3092            if (err == CHDERR_NONE)
3093               continue;
3094         }
3095      }
3096
3097      /* if that fit, just write it back from the temporary buffer */
3098      if (metasize <= sizeof(metabuffer))
3099      {
3100         /* write it to the target */
3101         err = chd_set_metadata(dest, metatag, CHD_METAINDEX_APPEND, metabuffer, metasize, metaflags);
3102         if (err != CHDERR_NONE)
3103            break;
3104      }
3105
3106      /* otherwise, allocate a bigger temporary buffer */
3107      else
3108      {
3109         UINT8 *allocbuffer = (UINT8 *)malloc(metasize);
3110         if (allocbuffer == NULL)
3111         {
3112            err = CHDERR_OUT_OF_MEMORY;
3113            break;
3114         }
3115
3116         /* re-read the whole thing */
3117         err = chd_get_metadata(source, CHDMETATAG_WILDCARD, metaindex, allocbuffer, metasize, &metasize, &metatag, &metaflags);
3118         if (err != CHDERR_NONE)
3119         {
3120            free(allocbuffer);
3121            break;
3122         }
3123
3124         /* write it to the target */
3125         err = chd_set_metadata(dest, metatag, CHD_METAINDEX_APPEND, allocbuffer, metasize, metaflags);
3126         free(allocbuffer);
3127         if (err != CHDERR_NONE)
3128            break;
3129      }
3130   }
3131   return err;
3132}
3133
3134
3135/*-------------------------------------------------
27803136    main - entry point
27813137-------------------------------------------------*/
27823138
r4425r4426
28063162      { "-merge",         do_merge_update_chomp, OPERATION_MERGE },
28073163      { "-diff",         do_diff, 0 },
28083164      { "-setchs",      do_setchs, 0 },
2809      { "-fixavdata",      do_fixavdata, 0 }
3165      { "-fixavdata",      do_fixavdata, 0 },
3166      { "-addmetatext",   do_addmeta, TRUE },
3167      { "-addmetabin",    do_addmeta, FALSE },
28103168   };
28113169   extern char build_version[];
28123170   int i;
src/osd/osdcomm.h
r4425r4426
4949#define ATTR_PURE            __attribute__((pure))
5050#define ATTR_CONST            __attribute__((const))
5151#define ATTR_FORCE_INLINE      __attribute__((always_inline))
52#define ATTR_NONNULL         __attribute__((nonnull(1)))
52#define ATTR_NONNULL(...)      __attribute__((nonnull(__VA_ARGS__)))
5353#define UNEXPECTED(exp)         __builtin_expect((exp), 0)
5454#define RESTRICT            __restrict__
5555#define SETJMP_GNUC_PROTECT()   (void)__builtin_return_address(1)
5656#ifndef TYPES_COMPATIBLE
57#define TYPES_COMPATIBLE(a,b)   __builtin_types_compatible_p(a, b)
57#define TYPES_COMPATIBLE(a,b)   __builtin_types_compatible_p(typeof(a), b)
5858#endif
5959#else
6060#define ATTR_UNUSED
r4425r4426
6464#define ATTR_PURE
6565#define ATTR_CONST
6666#define ATTR_FORCE_INLINE
67#define ATTR_NONNULL
67#define ATTR_NONNULL(...)
6868#define UNEXPECTED(exp)         (exp)
6969#define RESTRICT
7070#define SETJMP_GNUC_PROTECT()   do {} while (0)
src/osd/windows/windows.mak
r4425r4426
132132endif
133133
134134# disable function pointer warnings in C++ which are evil to work around
135CPPONLYFLAGS += /wd4191
135CPPONLYFLAGS += /wd4191 /wd4060 /wd4065 /wd4640
136136
137137# explicitly set the entry point for UNICODE builds
138138ifdef UNICODE
src/emu/config.c
r4425r4426
9292   config_type **ptype;
9393
9494   /* allocate a new type */
95   newtype = auto_malloc(sizeof(*newtype));
95   newtype = (config_type *)auto_malloc(sizeof(*newtype));
9696   newtype->next = NULL;
9797   newtype->name = nodename;
9898   newtype->load = load;
src/emu/debug/debugcpu.c
r4425r4426
158158   int regnum;
159159
160160   /* allocate and reset globals */
161   machine->debugcpu_data = global = auto_malloc(sizeof(*global));
161   machine->debugcpu_data = global = (debugcpu_private *)auto_malloc(sizeof(*global));
162162   memset(global, 0, sizeof(*global));
163163   global->execution_state = EXECUTION_STATE_STOPPED;
164164   global->bpindex = 1;
r4425r4426
190190      cpu_debug_data *info;
191191
192192      /* allocate some information */
193      info = auto_malloc(sizeof(*info));
193      info = (cpu_debug_data *)auto_malloc(sizeof(*info));
194194      memset(info, 0, sizeof(*info));
195195      classheader->debug = info;
196196
r4425r4426
983983   assert_always(device != NULL, "debug_cpu_breakpoint_set() called with invalid cpu!");
984984
985985   /* allocate breakpoint */
986   bp = malloc_or_die(sizeof(*bp));
986   bp = (debug_cpu_breakpoint *)malloc_or_die(sizeof(*bp));
987987   bp->index = global->bpindex++;
988988   bp->enabled = TRUE;
989989   bp->address = address;
r4425r4426
991991   bp->action = NULL;
992992   if (action != NULL)
993993   {
994      bp->action = malloc_or_die(strlen(action) + 1);
994      bp->action = (char *)malloc_or_die(strlen(action) + 1);
995995      strcpy(bp->action, action);
996996   }
997997
r4425r4426
10871087{
10881088   debugcpu_private *global = space->machine->debugcpu_data;
10891089   cpu_debug_data *info = cpu_get_debug_data(space->cpu);
1090   debug_cpu_watchpoint *wp = malloc_or_die(sizeof(*wp));
1090   debug_cpu_watchpoint *wp = (debug_cpu_watchpoint *)malloc_or_die(sizeof(*wp));
10911091
10921092   /* fill in the structure */
10931093   wp->index = global->wpindex++;
r4425r4426
10991099   wp->action = NULL;
11001100   if (action != NULL)
11011101   {
1102      wp->action = malloc_or_die(strlen(action) + 1);
1102      wp->action = (char *)malloc_or_die(strlen(action) + 1);
11031103      strcpy(wp->action, action);
11041104   }
11051105
r4425r4426
12451245   info->trace.trace_over_target = ~0;
12461246   if (action != NULL)
12471247   {
1248      info->trace.action = malloc_or_die(strlen(action) + 1);
1248      info->trace.action = (char *)malloc_or_die(strlen(action) + 1);
12491249      strcpy(info->trace.action, action);
12501250   }
12511251
r4425r4426
13131313   if (numspots > 0)
13141314   {
13151315      /* allocate memory for hotspots */
1316      info->hotspots = malloc_or_die(sizeof(*info->hotspots) * numspots);
1316      info->hotspots = (debug_hotspot_entry *)malloc_or_die(sizeof(*info->hotspots) * numspots);
13171317      memset(info->hotspots, 0xff, sizeof(*info->hotspots) * numspots);
13181318
13191319      /* fill in the info */
r4425r4426
24292429
24302430static UINT64 expression_read_memory(void *param, const char *name, int space, UINT32 address, int size)
24312431{
2432   running_machine *machine = param;
2432   running_machine *machine = (running_machine *)param;
24332433   const device_config *cpu = NULL;
24342434
24352435   switch (space)
r4425r4426
25322532
25332533         /* get the base of memory, aligned to the address minus the lowbits */
25342534         if (opcode & 1)
2535            base = memory_decrypted_read_ptr(space, address & ~lowmask);
2535            base = (UINT8 *)memory_decrypted_read_ptr(space, address & ~lowmask);
25362536         else
2537            base = memory_get_read_ptr(space, address & ~lowmask);
2537            base = (UINT8 *)memory_get_read_ptr(space, address & ~lowmask);
25382538
25392539         /* if we have a valid base, return the appropriate byte */
25402540         if (base != NULL)
r4425r4426
26342634
26352635static void expression_write_memory(void *param, const char *name, int space, UINT32 address, int size, UINT64 data)
26362636{
2637   running_machine *machine = param;
2637   running_machine *machine = (running_machine *)param;
26382638   const device_config *cpu = NULL;
26392639
26402640   switch (space)
r4425r4426
27432743
27442744         /* get the base of memory, aligned to the address minus the lowbits */
27452745         if (opcode & 1)
2746            base = memory_decrypted_read_ptr(space, address & ~lowmask);
2746            base = (UINT8 *)memory_decrypted_read_ptr(space, address & ~lowmask);
27472747         else
2748            base = memory_get_read_ptr(space, address & ~lowmask);
2748            base = (UINT8 *)memory_get_read_ptr(space, address & ~lowmask);
27492749
27502750         /* if we have a valid base, write the appropriate byte */
27512751         if (base != NULL)
r4425r4426
28662866
28672867static EXPRERR expression_validate(void *param, const char *name, int space)
28682868{
2869   running_machine *machine = param;
2869   running_machine *machine = (running_machine *)param;
28702870   const device_config *cpu = NULL;
28712871
28722872   switch (space)
r4425r4426
29282928
29292929static UINT64 get_wpaddr(void *globalref, void *ref)
29302930{
2931   running_machine *machine = globalref;
2931   running_machine *machine = (running_machine *)globalref;
29322932   return machine->debugcpu_data->wpaddr;
29332933}
29342934
r4425r4426
29402940
29412941static UINT64 get_wpdata(void *globalref, void *ref)
29422942{
2943   running_machine *machine = globalref;
2943   running_machine *machine = (running_machine *)globalref;
29442944   return machine->debugcpu_data->wpdata;
29452945}
29462946
r4425r4426
29522952
29532953static UINT64 get_cpunum(void *globalref, void *ref)
29542954{
2955   running_machine *machine = globalref;
2955   running_machine *machine = (running_machine *)globalref;
29562956   return cpu_get_index(machine->debugcpu_data->visiblecpu);
29572957}
29582958
r4425r4426
29852985
29862986static UINT64 get_beamx(void *globalref, void *ref)
29872987{
2988   const device_config *screen = ref;
2988   const device_config *screen = (const device_config *)ref;
29892989   return (screen != NULL) ? video_screen_get_hpos(screen) : 0;
29902990}
29912991
r4425r4426
29962996
29972997static UINT64 get_beamy(void *globalref, void *ref)
29982998{
2999   const device_config *screen = ref;
2999   const device_config *screen = (const device_config *)ref;
30003000   return (screen != NULL) ? video_screen_get_vpos(screen) : 0;
30013001}
30023002
r4425r4426
30073007
30083008static UINT64 get_frame(void *globalref, void *ref)
30093009{
3010   const device_config *screen = ref;
3010   const device_config *screen = (const device_config *)ref;
30113011   return (screen != NULL) ? video_screen_get_frame_number(screen) : 0;
30123012}
30133013
r4425r4426
30193019
30203020static UINT64 get_current_pc(void *globalref, void *ref)
30213021{
3022   const device_config *device = globalref;
3022   const device_config *device = (const device_config *)globalref;
30233023   return cpu_get_pc(device);
30243024}
30253025
r4425r4426
30313031
30323032static UINT64 get_cycles(void *globalref, void *ref)
30333033{
3034   const device_config *device = globalref;
3034   const device_config *device = (const device_config *)globalref;
30353035   return *cpu_get_icount_ptr(device);
30363036}
30373037
r4425r4426
30433043
30443044static UINT64 get_logunmap(void *globalref, void *ref)
30453045{
3046   const address_space *space = ref;
3046   const address_space *space = (const address_space *)ref;
30473047   return (space != NULL) ? memory_get_log_unmap(space) : TRUE;
30483048}
30493049
r4425r4426
30553055
30563056static void set_logunmap(void *globalref, void *ref, UINT64 value)
30573057{
3058   const address_space *space = ref;
3058   const address_space *space = (const address_space *)ref;
30593059   if (space != NULL)
30603060      memory_set_log_unmap(space, value ? 1 : 0);
30613061}
r4425r4426
30683068
30693069static UINT64 get_cpu_reg(void *globalref, void *ref)
30703070{
3071   const device_config *device = globalref;
3071   const device_config *device = (const device_config *)globalref;
30723072   return cpu_get_reg(device, (FPTR)ref);
30733073}
30743074
r4425r4426
30803080
30813081static void set_cpu_reg(void *globalref, void *ref, UINT64 value)
30823082{
3083   const device_config *device = globalref;
3083   const device_config *device = (const device_config *)globalref;
30843084   cpu_set_reg(device, (FPTR)ref, value);
30853085}
src/emu/debug/debugvw.c
r4425r4426
342342   debugvw_private *global;
343343
344344   /* allocate memory for our globals */
345   global = machine->debugvw_data = auto_malloc(sizeof(*machine->debugvw_data));
345   global = machine->debugvw_data = (debugvw_private *)auto_malloc(sizeof(*machine->debugvw_data));
346346   memset(global, 0, sizeof(*global));
347347
348348   /* register for some manual cleanup */
r4425r4426
387387   assert(type >= 0 && type < ARRAY_LENGTH(callback_table));
388388
389389   /* allocate memory for the view */
390   view = malloc(sizeof(*view));
390   view = (debug_view *)malloc(sizeof(*view));
391391   if (view == NULL)
392392      return NULL;
393393   memset(view, 0, sizeof(*view));
r4425r4426
405405
406406   /* allocate memory for the buffer */
407407   view->viewdata_size = view->visible.y * view->visible.x;
408   view->viewdata = malloc(sizeof(view->viewdata[0]) * view->viewdata_size);
408   view->viewdata = (debug_view_char *)malloc(sizeof(view->viewdata[0]) * view->viewdata_size);
409409   if (view->viewdata == NULL)
410410   {
411411      free(view);
r4425r4426
499499         if (size > view->viewdata_size)
500500         {
501501            view->viewdata_size = size;
502            view->viewdata = realloc(view->viewdata, sizeof(view->viewdata[0]) * view->viewdata_size);
502            view->viewdata = (debug_view_char *)realloc(view->viewdata, sizeof(view->viewdata[0]) * view->viewdata_size);
503503         }
504504
505505         /* update the view */
r4425r4426
908908   debug_view_textbuf *textdata;
909909
910910   /* allocate memory */
911   textdata = malloc(sizeof(*textdata));
911   textdata = (debug_view_textbuf *)malloc(sizeof(*textdata));
912912   if (textdata == NULL)
913913      return FALSE;
914914   memset(textdata, 0, sizeof(*textdata));
r4425r4426
930930
931931static void textbuf_view_free(debug_view *view)
932932{
933   debug_view_textbuf *textdata = view->extra_data;
933   debug_view_textbuf *textdata = (debug_view_textbuf *)view->extra_data;
934934
935935   /* free any memory we callocated */
936936   if (textdata != NULL)
r4425r4426
946946
947947static void textbuf_view_update(debug_view *view)
948948{
949   debug_view_textbuf *textdata = view->extra_data;
949   debug_view_textbuf *textdata = (debug_view_textbuf *)view->extra_data;
950950   debug_view_char *dest = view->viewdata;
951951   UINT32 curseq = 0, row;
952952
r4425r4426
10141014
10151015static void textbuf_view_notify(debug_view *view, view_notification type)
10161016{
1017   debug_view_textbuf *textdata = view->extra_data;
1017   debug_view_textbuf *textdata = (debug_view_textbuf *)view->extra_data;
10181018
10191019   if (type == VIEW_NOTIFY_VISIBLE_CHANGED)
10201020   {
r4425r4426
10531053
10541054      /* determine the string and allocate a subview large enough */
10551055      astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu));
1056      subview = auto_malloc(sizeof(*subview) + astring_len(tempstring));
1056      subview = (registers_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
10571057      memset(subview, 0, sizeof(*subview));
10581058
10591059      /* populate the subview */
r4425r4426
10871087      return FALSE;
10881088
10891089   /* allocate memory */
1090   regdata = malloc(sizeof(*regdata));
1090   regdata = (debug_view_registers *)malloc(sizeof(*regdata));
10911091   if (regdata == NULL)
10921092      return FALSE;
10931093   memset(regdata, 0, sizeof(*regdata));
r4425r4426
11081108
11091109static void registers_view_free(debug_view *view)
11101110{
1111   debug_view_registers *regdata = view->extra_data;
1111   debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
11121112
11131113   /* free any memory we callocated */
11141114   if (regdata != NULL)
r4425r4426
11241124
11251125static void registers_view_add_register(debug_view *view, int regnum, const char *str)
11261126{
1127   debug_view_registers *regdata = view->extra_data;
1127   debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
11281128   int tagstart, taglen, valstart, vallen;
11291129   const char *colon;
11301130
r4425r4426
11831183
11841184static void registers_view_recompute(debug_view *view)
11851185{
1186   debug_view_registers *regdata = view->extra_data;
1186   debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
11871187   int regnum, maxtaglen, maxvallen;
11881188   const cpu_state_table *table;
11891189
r4425r4426
12961296static void registers_view_update(debug_view *view)
12971297{
12981298   const device_config *screen = view->machine->primary_screen;
1299   debug_view_registers *regdata = view->extra_data;
1299   debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
13001300   debug_view_char *dest = view->viewdata;
13011301   UINT64 total_cycles;
13021302   UINT32 row, i;
r4425r4426
14341434
14351435int registers_view_get_subview(debug_view *view)
14361436{
1437   debug_view_registers *regdata = view->extra_data;
1437   debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
14381438   const registers_subview_item *subview;
14391439   int index = 0;
14401440
r4425r4426
14601460void registers_view_set_subview(debug_view *view, int index)
14611461{
14621462   const registers_subview_item *subview = registers_view_get_subview_by_index(view->machine->debugvw_data->registers_subviews, index);
1463   debug_view_registers *regdata = view->extra_data;
1463   debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
14641464
14651465   assert(view->type == DVT_REGISTERS);
14661466   assert(subview != NULL);
r4425r4426
15061506
15071507         /* determine the string and allocate a subview large enough */
15081508         astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu));
1509         subview = auto_malloc(sizeof(*subview) + astring_len(tempstring));
1509         subview = (disasm_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
15101510         memset(subview, 0, sizeof(*subview));
15111511
15121512         /* populate the subview */
r4425r4426
15431543      return FALSE;
15441544
15451545   /* allocate disasm */
1546   dasmdata = malloc(sizeof(*dasmdata));
1546   dasmdata = (debug_view_disasm *)malloc(sizeof(*dasmdata));
15471547   if (dasmdata == NULL)
15481548      return FALSE;
15491549   memset(dasmdata, 0, sizeof(*dasmdata));
r4425r4426
15801580
15811581static void disasm_view_free(debug_view *view)
15821582{
1583   debug_view_disasm *dasmdata = view->extra_data;
1583   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
15841584
15851585   /* free any disasm we callocated */
15861586   if (dasmdata != NULL)
r4425r4426
16151615
16161616static void disasm_view_char(debug_view *view, int chval)
16171617{
1618   debug_view_disasm *dasmdata = view->extra_data;
1618   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
16191619   debug_view_xy origcursor = view->cursor;
16201620   UINT8 end_buffer = 3;
16211621   INT32 temp;
r4425r4426
18241824
18251825static int disasm_view_recompute(debug_view *view, offs_t pc, int startline, int lines)
18261826{
1827   debug_view_disasm *dasmdata = view->extra_data;
1827   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
18281828   const address_space *space = dasmdata->space;
18291829   int minbytes, maxbytes, maxbytes_clamped;
18301830   int changed = FALSE;
r4425r4426
18641864      /* allocate address array */
18651865      if (dasmdata->byteaddress != NULL)
18661866         free(dasmdata->byteaddress);
1867      dasmdata->byteaddress = malloc_or_die(sizeof(dasmdata->byteaddress[0]) * dasmdata->allocated.y);
1867      dasmdata->byteaddress = (offs_t *)malloc_or_die(sizeof(dasmdata->byteaddress[0]) * dasmdata->allocated.y);
18681868
18691869      /* allocate disassembly buffer */
18701870      if (dasmdata->dasm != NULL)
18711871         free(dasmdata->dasm);
1872      dasmdata->dasm = malloc_or_die(sizeof(dasmdata->dasm[0]) * dasmdata->allocated.x * dasmdata->allocated.y);
1872      dasmdata->dasm = (char *)malloc_or_die(sizeof(dasmdata->dasm[0]) * dasmdata->allocated.x * dasmdata->allocated.y);
18731873   }
18741874
18751875   /* iterate over lines */
r4425r4426
19551955
19561956static void disasm_view_update(debug_view *view)
19571957{
1958   debug_view_disasm *dasmdata = view->extra_data;
1958   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
19591959   const address_space *space = dasmdata->space;
19601960   debug_view_char *dest = view->viewdata;
19611961   int recomputed_this_time = FALSE;
r4425r4426
21632163
21642164int disasm_view_get_subview(debug_view *view)
21652165{
2166   debug_view_disasm *dasmdata = view->extra_data;
2166   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
21672167   const disasm_subview_item *subview;
21682168   int index = 0;
21692169
r4425r4426
21882188
21892189const char *disasm_view_get_expression(debug_view *view)
21902190{
2191   debug_view_disasm *dasmdata = view->extra_data;
2191   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
21922192   assert(view->type == DVT_DISASSEMBLY);
21932193   debug_view_begin_update(view);
21942194   debug_view_end_update(view);
r4425r4426
22032203
22042204disasm_right_column disasm_view_get_right_column(debug_view *view)
22052205{
2206   debug_view_disasm *dasmdata = view->extra_data;
2206   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
22072207   assert(view->type == DVT_DISASSEMBLY);
22082208   debug_view_begin_update(view);
22092209   debug_view_end_update(view);
r4425r4426
22192219
22202220UINT32 disasm_view_get_backward_steps(debug_view *view)
22212221{
2222   debug_view_disasm *dasmdata = view->extra_data;
2222   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
22232223   assert(view->type == DVT_DISASSEMBLY);
22242224   debug_view_begin_update(view);
22252225   debug_view_end_update(view);
r4425r4426
22352235
22362236UINT32 disasm_view_get_disasm_width(debug_view *view)
22372237{
2238   debug_view_disasm *dasmdata = view->extra_data;
2238   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
22392239   assert(view->type == DVT_DISASSEMBLY);
22402240   debug_view_begin_update(view);
22412241   debug_view_end_update(view);
r4425r4426
22512251
22522252offs_t disasm_view_get_selected_address(debug_view *view)
22532253{
2254   debug_view_disasm *dasmdata = view->extra_data;
2254   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
22552255   assert(view->type == DVT_DISASSEMBLY);
22562256   debug_view_begin_update(view);
22572257   debug_view_end_update(view);
r4425r4426
22672267void disasm_view_set_subview(debug_view *view, int index)
22682268{
22692269   const disasm_subview_item *subview = disasm_view_get_subview_by_index(view->machine->debugvw_data->disasm_subviews, index);
2270   debug_view_disasm *dasmdata = view->extra_data;
2270   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
22712271
22722272   assert(view->type == DVT_DISASSEMBLY);
22732273   assert(subview != NULL);
r4425r4426
22952295
22962296void disasm_view_set_expression(debug_view *view, const char *expression)
22972297{
2298   debug_view_disasm *dasmdata = view->extra_data;
2298   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
22992299
23002300   assert(view->type == DVT_DISASSEMBLY);
23012301   assert(expression != NULL);
r4425r4426
23142314
23152315void disasm_view_set_right_column(debug_view *view, disasm_right_column contents)
23162316{
2317   debug_view_disasm *dasmdata = view->extra_data;
2317   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
23182318
23192319   assert(view->type == DVT_DISASSEMBLY);
23202320   assert(contents == DASM_RIGHTCOL_RAW || contents == DASM_RIGHTCOL_ENCRYPTED || contents == DASM_RIGHTCOL_COMMENTS);
r4425r4426
23372337
23382338void disasm_view_set_backward_steps(debug_view *view, UINT32 steps)
23392339{
2340   debug_view_disasm *dasmdata = view->extra_data;
2340   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
23412341
23422342   assert(view->type == DVT_DISASSEMBLY);
23432343
r4425r4426
23592359
23602360void disasm_view_set_disasm_width(debug_view *view, UINT32 width)
23612361{
2362   debug_view_disasm *dasmdata = view->extra_data;
2362   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
23632363
23642364   assert(view->type == DVT_DISASSEMBLY);
23652365
r4425r4426
23812381
23822382void disasm_view_set_selected_address(debug_view *view, offs_t address)
23832383{
2384   debug_view_disasm *dasmdata = view->extra_data;
2384   debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
23852385   offs_t byteaddress = memory_address_to_byte(dasmdata->space, address) & dasmdata->space->logbytemask;
23862386   int line;
23872387
r4425r4426
24292429
24302430            /* determine the string and allocate a subview large enough */
24312431            astring_printf(tempstring, "CPU '%s' (%s) %s memory", cpu->tag, cpu_get_name(cpu), space->name);
2432            subview = auto_malloc(sizeof(*subview) + astring_len(tempstring));
2432            subview = (memory_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
24332433            memset(subview, 0, sizeof(*subview));
24342434
24352435            /* populate the subview */
r4425r4426
24592459
24602460         /* determine the string and allocate a subview large enough */
24612461         astring_printf(tempstring, "Region '%s'", rgntag);
2462         subview = auto_malloc(sizeof(*subview) + astring_len(tempstring));
2462         subview = (memory_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
24632463         memset(subview, 0, sizeof(*subview));
24642464
24652465         /* populate the subview */
r4425r4426
24972497
24982498         /* determine the string and allocate a subview large enough */
24992499         astring_printf(tempstring, "%s", strrchr(name, '/') + 1);
2500         subview = auto_malloc(sizeof(*subview) + astring_len(tempstring));
2500         subview = (memory_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
25012501         memset(subview, 0, sizeof(*subview));
25022502
25032503         /* populate the subview */
r4425r4426
25362536      return FALSE;
25372537
25382538   /* allocate memory */
2539   memdata = malloc(sizeof(*memdata));
2539   memdata = (debug_view_memory *)malloc(sizeof(*memdata));
25402540   if (memdata == NULL)
25412541      return FALSE;
25422542   memset(memdata, 0, sizeof(*memdata));
r4425r4426
25702570
25712571static void memory_view_free(debug_view *view)
25722572{
2573   debug_view_memory *memdata = view->extra_data;
2573   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
25742574
25752575   /* free any memory we allocated */
25762576   if (memdata != NULL)
r4425r4426
26082608
26092609static void memory_view_update(debug_view *view)
26102610{
2611   debug_view_memory *memdata = view->extra_data;
2611   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
26122612   const address_space *space = memdata->desc->space;
26132613   const memory_view_pos *posdata;
26142614   UINT32 row;
r4425r4426
27042704static void memory_view_char(debug_view *view, int chval)
27052705{
27062706   static const char hexvals[] = "0123456789abcdef";
2707   debug_view_memory *memdata = view->extra_data;
2707   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
27082708   offs_t address;
27092709   char *hexchar;
27102710   int ismapped;
r4425r4426
27772777         break;
27782778
27792779      default:
2780         hexchar = strchr(hexvals, tolower(chval));
2780         hexchar = (char *)strchr(hexvals, tolower(chval));
27812781         if (hexchar == NULL)
27822782            break;
27832783         ismapped = memory_view_read(memdata, memdata->bytes_per_chunk, address, &data);
r4425r4426
28242824
28252825static void memory_view_recompute(debug_view *view)
28262826{
2827   debug_view_memory *memdata = view->extra_data;
2827   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
28282828   const address_space *space = memdata->desc->space;
28292829   offs_t cursoraddr;
28302830   UINT8 cursorshift;
r4425r4426
29042904
29052905static int memory_view_needs_recompute(debug_view *view)
29062906{
2907   debug_view_memory *memdata = view->extra_data;
2907   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
29082908   const address_space *space = memdata->desc->space;
29092909   int recompute = view->recompute;
29102910
r4425r4426
29312931
29322932static void memory_view_get_cursor_pos(debug_view *view, offs_t *address, UINT8 *shift)
29332933{
2934   debug_view_memory *memdata = view->extra_data;
2934   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
29352935   const memory_view_pos *posdata = &memory_pos_table[memdata->bytes_per_chunk];
29362936   int xposition, chunknum, chunkoffs;
29372937
r4425r4426
29672967
29682968static void memory_view_set_cursor_pos(debug_view *view, offs_t address, UINT8 shift)
29692969{
2970   debug_view_memory *memdata = view->extra_data;
2970   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
29712971   const memory_view_pos *posdata = &memory_pos_table[memdata->bytes_per_chunk];
29722972   int chunknum;
29732973
r4425r4426
31313131
31323132int memory_view_get_subview(debug_view *view)
31333133{
3134   debug_view_memory *memdata = view->extra_data;
3134   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
31353135
31363136   assert(view->type == DVT_MEMORY);
31373137   debug_view_begin_update(view);
r4425r4426
31483148
31493149const char *memory_view_get_expression(debug_view *view)
31503150{
3151   debug_view_memory *memdata = view->extra_data;
3151   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
31523152   assert(view->type == DVT_MEMORY);
31533153   debug_view_begin_update(view);
31543154   debug_view_end_update(view);
r4425r4426
31633163
31643164UINT8 memory_view_get_bytes_per_chunk(debug_view *view)
31653165{
3166   debug_view_memory *memdata = view->extra_data;
3166   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
31673167   assert(view->type == DVT_MEMORY);
31683168   debug_view_begin_update(view);
31693169   debug_view_end_update(view);
r4425r4426
31783178
31793179UINT32 memory_view_get_chunks_per_row(debug_view *view)
31803180{
3181   debug_view_memory *memdata = view->extra_data;
3181   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
31823182   assert(view->type == DVT_MEMORY);
31833183   debug_view_begin_update(view);
31843184   debug_view_end_update(view);
r4425r4426
31933193
31943194UINT8 memory_view_get_reverse(debug_view *view)
31953195{
3196   debug_view_memory *memdata = view->extra_data;
3196   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
31973197   assert(view->type == DVT_MEMORY);
31983198   debug_view_begin_update(view);
31993199   debug_view_end_update(view);
r4425r4426
32093209
32103210UINT8 memory_view_get_ascii(debug_view *view)
32113211{
3212   debug_view_memory *memdata = view->extra_data;
3212   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
32133213   assert(view->type == DVT_MEMORY);
32143214   debug_view_begin_update(view);
32153215   debug_view_end_update(view);
r4425r4426
32253225
32263226UINT8 memory_view_get_physical(debug_view *view)
32273227{
3228   debug_view_memory *memdata = view->extra_data;
3228   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
32293229   assert(view->type == DVT_MEMORY);
32303230   debug_view_begin_update(view);
32313231   debug_view_end_update(view);
r4425r4426
32413241void memory_view_set_subview(debug_view *view, int index)
32423242{
32433243   const memory_subview_item *subview = memory_view_get_subview_by_index(view->machine->debugvw_data->memory_subviews, index);
3244   debug_view_memory *memdata = view->extra_data;
3244   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
32453245
32463246   assert(view->type == DVT_MEMORY);
32473247   assert(subview != NULL);
r4425r4426
32713271
32723272void memory_view_set_expression(debug_view *view, const char *expression)
32733273{
3274   debug_view_memory *memdata = view->extra_data;
3274   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
32753275
32763276   assert(view->type == DVT_MEMORY);
32773277   assert(expression != NULL);
r4425r4426
32903290
32913291void memory_view_set_bytes_per_chunk(debug_view *view, UINT8 chunkbytes)
32923292{
3293   debug_view_memory *memdata = view->extra_data;
3293   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
32943294
32953295   assert(view->type == DVT_MEMORY);
32963296   assert(chunkbytes < ARRAY_LENGTH(memory_pos_table) && memory_pos_table[chunkbytes].spacing != 0);
r4425r4426
33253325
33263326void memory_view_set_chunks_per_row(debug_view *view, UINT32 rowchunks)
33273327{
3328   debug_view_memory *memdata = view->extra_data;
3328   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
33293329
33303330   assert(view->type == DVT_MEMORY);
33313331
r4425r4426
33543354
33553355void memory_view_set_reverse(debug_view *view, UINT8 reverse)
33563356{
3357   debug_view_memory *memdata = view->extra_data;
3357   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
33583358
33593359   assert(view->type == DVT_MEMORY);
33603360
r4425r4426
33813381
33823382void memory_view_set_ascii(debug_view *view, UINT8 ascii)
33833383{
3384   debug_view_memory *memdata = view->extra_data;
3384   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
33853385
33863386   assert(view->type == DVT_MEMORY);
33873387
r4425r4426
34083408
34093409void memory_view_set_physical(debug_view *view, UINT8 physical)
34103410{
3411   debug_view_memory *memdata = view->extra_data;
3411   debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
34123412
34133413   assert(view->type == DVT_MEMORY);
34143414
src/emu/debug/debugcmd.c
r4425r4426
322322
323323static UINT64 global_get(void *globalref, void *ref)
324324{
325   global_entry *global = ref;
325   global_entry *global = (global_entry *)ref;
326326   switch (global->size)
327327   {
328328      case 1:      return *(UINT8 *)global->base;
r4425r4426
340340
341341static void global_set(void *globalref, void *ref, UINT64 value)
342342{
343   global_entry *global = ref;
343   global_entry *global = (global_entry *)ref;
344344   switch (global->size)
345345   {
346346      case 1:      *(UINT8 *)global->base = value;   break;
src/emu/debug/textbuf.c
r4425r4426
8888   text_buffer *text;
8989
9090   /* allocate memory for the text buffer object */
91   text = malloc(sizeof(*text));
91   text = (text_buffer *)malloc(sizeof(*text));
9292   if (!text)
9393      return NULL;
9494
9595   /* allocate memory for the buffer itself */
96   text->buffer = malloc(bytes);
96   text->buffer = (char *)malloc(bytes);
9797   if (!text->buffer)
9898   {
9999      free(text);
r4425r4426
101101   }
102102
103103   /* allocate memory for the lines array */
104   text->lineoffs = malloc(lines * sizeof(text->lineoffs[0]));
104   text->lineoffs = (INT32 *)malloc(lines * sizeof(text->lineoffs[0]));
105105   if (!text->lineoffs)
106106   {
107107      free(text->buffer);
src/emu/debug/debugcon.c
r4425r4426
404404   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
405405   assert_always((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
406406
407   cmd = auto_malloc(sizeof(*cmd));
407   cmd = (debug_command *)auto_malloc(sizeof(*cmd));
408408   memset(cmd, 0, sizeof(*cmd));
409409
410410   /* fill in the command */
src/emu/debug/express.c
r4425r4426
304304   /* to be an lval, the token must be a valid read/write symbol or a memory token */
305305   if (token->type == TOK_SYMBOL)
306306   {
307      symbol_entry *symbol = token->value.p;
307      symbol_entry *symbol = (symbol_entry *)token->value.p;
308308      if (symbol == NULL || symbol->type != SMT_REGISTER || symbol->info.reg.setter == NULL)
309309         return MAKE_EXPRERR_NOT_LVAL(token->offset);
310310   }
r4425r4426
332332   /* symbol tokens get resolved down to number tokens */
333333   if (token->type == TOK_SYMBOL)
334334   {
335      symbol_entry *symbol = token->value.p;
335      symbol_entry *symbol = (symbol_entry *)token->value.p;
336336      if (symbol == NULL || (symbol->type != SMT_REGISTER && symbol->type != SMT_VALUE))
337337         return MAKE_EXPRERR_NOT_RVAL(token->offset);
338338      token->type = TOK_NUMBER;
r4425r4426
371371{
372372   if (token->type == TOK_SYMBOL)
373373   {
374      symbol_entry *symbol = token->value.p;
374      symbol_entry *symbol = (symbol_entry *)token->value.p;
375375      if (symbol != NULL && symbol->type == SMT_REGISTER)
376376         return (*symbol->info.reg.getter)(symbol->table->globalref, symbol->ref);
377377   }
r4425r4426
396396{
397397   if (token->type == TOK_SYMBOL)
398398   {
399      symbol_entry *symbol = token->value.p;
399      symbol_entry *symbol = (symbol_entry *)token->value.p;
400400      if (symbol != NULL && symbol->type == SMT_REGISTER && symbol->info.reg.setter)
401401         (*symbol->info.reg.setter)(symbol->table->globalref, symbol->ref, value);
402402   }
r4425r4426
618618   expr->table = table;
619619
620620   /* make a copy of the original string */
621   expr->original_string = malloc(strlen(stringstart) + 1);
621   expr->original_string = (char *)malloc(strlen(stringstart) + 1);
622622   if (!expr->original_string)
623623      return MAKE_EXPRERR_OUT_OF_MEMORY(0);
624624   strcpy(expr->original_string, stringstart);
r4425r4426
12141214      /* if it is a function symbol, break out of the loop */
12151215      if (peek->type == TOK_SYMBOL)
12161216      {
1217         symbol = peek->value.p;
1217         symbol = (symbol_entry *)peek->value.p;
12181218         if (symbol != NULL && symbol->type == SMT_FUNCTION)
12191219         {
12201220            pop_token(expr, &t1);
r4425r4426
16661666   expression_string *expstring;
16671667
16681668   /* allocate memory */
1669   expstring = malloc(sizeof(expression_string) + length);
1669   expstring = (expression_string *)malloc(sizeof(expression_string) + length);
16701670   if (expstring == NULL)
16711671      return NULL;
16721672
r4425r4426
18001800      goto cleanup;
18011801
18021802   /* allocate memory for the result */
1803   *result = malloc(sizeof(temp_expression));
1803   *result = (parsed_expression *)malloc(sizeof(temp_expression));
18041804   if (!*result)
18051805   {
18061806      exprerr = MAKE_EXPRERR_OUT_OF_MEMORY(0);
r4425r4426
19201920   symbol_table *table;
19211921
19221922   /* allocate memory for the table */
1923   table = malloc(sizeof(*table));
1923   table = (symbol_table *)malloc(sizeof(*table));
19241924   if (!table)
19251925      return NULL;
19261926
r4425r4426
19801980   }
19811981
19821982   /* otherwise, allocate a new entry */
1983   symbol = malloc(sizeof(*symbol));
1983   symbol = (internal_symbol_entry *)malloc(sizeof(*symbol));
19841984   if (!symbol)
19851985      return 0;
19861986   memset(symbol, 0, sizeof(*symbol));
19871987
19881988   /* allocate space for a copy of the string */
1989   newstring = malloc(strlen(name) + 1);
1989   newstring = (char *)malloc(strlen(name) + 1);
19901990   if (!newstring)
19911991   {
19921992      free(symbol);
src/emu/cpu/m6805/m6805.c
r4425r4426
6666   int      nmi_state;
6767} m6805_Regs;
6868
69INLINE m6805_Regs *get_safe_token(const device_config *device)
70{
71   assert(device != NULL);
72   assert(device->token != NULL);
73   assert(device->type == CPU);
74   assert(cpu_get_type(device) == CPU_M6805 ||
75         cpu_get_type(device) == CPU_M68705 ||
76         cpu_get_type(device) == CPU_HD63705);
77   return (m6805_Regs *)device->token;
78}
79
6980/****************************************************************************/
7081/* Read a byte from given memory location                                   */
7182/****************************************************************************/
r4425r4426
452463
453464static CPU_INIT( m6805 )
454465{
455   m6805_Regs *cpustate = device->token;
466   m6805_Regs *cpustate = get_safe_token(device);
456467
457468   state_register(cpustate, "m6805", device);
458469   cpustate->irq_callback = irqcallback;
r4425r4426
462473
463474static CPU_RESET( m6805 )
464475{
465   m6805_Regs *cpustate = device->token;
476   m6805_Regs *cpustate = get_safe_token(device);
466477
467478   cpu_irq_callback save_irqcallback = cpustate->irq_callback;
468479   memset(cpustate, 0, sizeof(m6805_Regs));
r4425r4426
509520static CPU_EXECUTE( m6805 )
510521{
511522   UINT8 ireg;
512   m6805_Regs *cpustate = device->token;
523   m6805_Regs *cpustate = get_safe_token(device);
513524
514525   S = SP_ADJUST( S );      /* Taken from CPU_SET_CONTEXT when pointer'afying */
515526   cpustate->iCount = cycles;
r4425r4426
809820#if (HAS_M68705)
810821static CPU_INIT( m68705 )
811822{
812   m6805_Regs *cpustate = device->token;
823   m6805_Regs *cpustate = get_safe_token(device);
813824   state_register(cpustate, "m68705", device);
814825   cpustate->irq_callback = irqcallback;
815826   cpustate->device = device;
r4425r4426
817828
818829static CPU_RESET( m68705 )
819830{
820   m6805_Regs *cpustate = device->token;
831   m6805_Regs *cpustate = get_safe_token(device);
821832   CPU_RESET_CALL(m6805);
822833
823834   /* Overide default 6805 type */
r4425r4426
840851#if (HAS_HD63705)
841852static CPU_INIT( hd63705 )
842853{
843   m6805_Regs *cpustate = device->token;
854   m6805_Regs *cpustate = get_safe_token(device);
844855   state_register(cpustate, "hd63705", device);
845856   cpustate->irq_callback = irqcallback;
846857   cpustate->device = device;
r4425r4426
848859
849860static CPU_RESET( hd63705 )
850861{
851   m6805_Regs *cpustate = device->token;
862   m6805_Regs *cpustate = get_safe_token(device);
852863   CPU_RESET_CALL(m6805);
853864
854865   /* Overide default 6805 types */
r4425r4426
886897
887898static CPU_SET_INFO( m6805 )
888899{
889   m6805_Regs *cpustate = device->token;
900   m6805_Regs *cpustate = get_safe_token(device);
890901
891902   switch (state)
892903   {
r4425r4426
911922
912923CPU_GET_INFO( m6805 )
913924{
914   m6805_Regs *cpustate = (device != NULL) ? device->token : NULL;
925   m6805_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
915926
916927   switch (state)
917928   {
r4425r4426
9931004 **************************************************************************/
9941005static CPU_SET_INFO( m68705 )
9951006{
996   m6805_Regs *cpustate = device->token;
1007   m6805_Regs *cpustate = get_safe_token(device);
9971008
9981009   switch(state)
9991010   {
r4425r4426
10061017
10071018CPU_GET_INFO( m68705 )
10081019{
1009   m6805_Regs *cpustate = (device != NULL) ? device->token : NULL;
1020   m6805_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
10101021
10111022   switch (state)
10121023   {
r4425r4426
10341045
10351046static CPU_SET_INFO( hd63705 )
10361047{
1037   m6805_Regs *cpustate = device->token;
1048   m6805_Regs *cpustate = get_safe_token(device);
10381049
10391050   switch (state)
10401051   {
r4425r4426
10551066
10561067CPU_GET_INFO( hd63705 )
10571068{
1058   m6805_Regs *cpustate = (device != NULL) ? device->token : NULL;
1069   m6805_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
10591070
10601071   switch (state)
10611072   {
src/emu/cpu/v30mz/v30mz.c
r4425r4426
9292   UINT16 e16;
9393};
9494
95INLINE v30mz_state *get_safe_token(const device_config *device)
96{
97   assert(device != NULL);
98   assert(device->token != NULL);
99   assert(device->type == CPU);
100   assert(cpu_get_type(device) == CPU_V30MZ);
101   return (v30mz_state *)device->token;
102}
103
95104/***************************************************************************/
96105/* cpu state                                                               */
97106/***************************************************************************/
r4425r4426
113122
114123static CPU_RESET( nec )
115124{
116   v30mz_state *cpustate = device->token;
125   v30mz_state *cpustate = get_safe_token(device);
117126    unsigned int i,j,c;
118127    static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH };
119128   cpu_irq_callback save_irqcallback;
r4425r4426
915924
916925static void nec_init(const device_config *device, cpu_irq_callback irqcallback, int type)
917926{
918   v30mz_state *cpustate = device->token;
927   v30mz_state *cpustate = get_safe_token(device);
919928
920929   state_save_register_device_item_array(device, 0, cpustate->regs.w);
921930   state_save_register_device_item_array(device, 0, cpustate->sregs);
r4425r4426
945954static CPU_INIT( v30mz ) { nec_init(device, irqcallback, 3); }
946955static CPU_EXECUTE( v30mz )
947956{
948   v30mz_state *cpustate = device->token;
957   v30mz_state *cpustate = get_safe_token(device);
949958
950959   cpustate->icount=cycles;
951960
r4425r4426
977986
978987static CPU_SET_INFO( nec )
979988{
980   v30mz_state *cpustate = device->token;
989   v30mz_state *cpustate = get_safe_token(device);
981990   switch (state)
982991   {
983992      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
10331042
10341043CPU_GET_INFO( v30mz )
10351044{
1036   v30mz_state *cpustate = (device != NULL) ? device->token : NULL;
1045   v30mz_state *cpustate = (device != NULL && device != NULL) ? get_safe_token(device) : NULL;
10371046   int flags;
10381047
10391048   switch (state)
src/emu/cpu/lh5801/lh5801.c
r4425r4426
6767   int icount;
6868};
6969
70INLINE lh5801_state *get_safe_token(const device_config *device)
71{
72   assert(device != NULL);
73   assert(device->token != NULL);
74   assert(device->type == CPU);
75   assert(cpu_get_type(device) == CPU_LH5801);
76   return (lh5801_state *)device->token;
77}
78
7079#define P cpustate->p.w.l
7180#define S cpustate->s.w.l
7281#define U cpustate->u.w.l
r4425r4426
92101
93102static CPU_INIT( lh5801 )
94103{
95   lh5801_state *cpustate = device->token;
104   lh5801_state *cpustate = get_safe_token(device);
96105
97106   memset(cpustate, 0, sizeof(*cpustate));
98107   cpustate->config = (const lh5801_cpu_core *) device->static_config;
r4425r4426
102111
103112static CPU_RESET( lh5801 )
104113{
105   lh5801_state *cpustate = device->token;
114   lh5801_state *cpustate = get_safe_token(device);
106115
107116   P = (memory_read_byte(cpustate->program, 0xfffe)<<8) | memory_read_byte(cpustate->program, 0xffff);
108117
r4425r4426
111120
112121static CPU_EXECUTE( lh5801 )
113122{
114   lh5801_state *cpustate = device->token;
123   lh5801_state *cpustate = get_safe_token(device);
115124
116125   cpustate->icount = cycles;
117126
r4425r4426
144153
145154static CPU_SET_INFO( lh5801 )
146155{
147   lh5801_state *cpustate = device->token;
156   lh5801_state *cpustate = get_safe_token(device);
148157   switch (state)
149158   {
150159      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
174183
175184CPU_GET_INFO( lh5801 )
176185{
177   lh5801_state *cpustate = (device != NULL) ? device->token : NULL;
186   lh5801_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
178187
179188   switch (state)
180189   {
src/emu/cpu/m6809/m6809.c
r4425r4426
110110   UINT8   nmi_state;
111111};
112112
113INLINE m68_state_t *get_safe_token(const device_config *device)
114{
115   assert(device != NULL);
116   assert(device->token != NULL);
117   assert(device->type == CPU);
118   assert(cpu_get_type(device) == CPU_M6809 ||
119         cpu_get_type(device) == CPU_M6809E);
120   return (m68_state_t *)device->token;
121}
122
113123static void check_irq_lines( m68_state_t *m68_state );
114124static void IIError(m68_state_t *m68_state);
115125
r4425r4426
366376      0
367377   };
368378
369   const m6809_config *configdata = device->static_config ? device->static_config : &default_config;
370   m68_state_t *m68_state = device->token;
379   const m6809_config *configdata = device->static_config ? (const m6809_config *)device->static_config : &default_config;
380   m68_state_t *m68_state = get_safe_token(device);
371381
372382   m68_state->config = configdata;
373383   m68_state->irq_callback = irqcallback;
r4425r4426
397407/****************************************************************************/
398408static CPU_RESET( m6809 )
399409{
400   m68_state_t *m68_state = device->token;
410   m68_state_t *m68_state = get_safe_token(device);
401411
402412   m68_state->int_state = 0;
403413   m68_state->nmi_state = CLEAR_LINE;
r4425r4426
475485/* execute instructions on this CPU until icount expires */
476486static CPU_EXECUTE( m6809 )   /* NS 970908 */
477487{
478   m68_state_t *m68_state = device->token;
488   m68_state_t *m68_state = get_safe_token(device);
479489
480490    m68_state->icount = cycles - m68_state->extra_cycles;
481491   m68_state->extra_cycles = 0;
r4425r4426
10601070
10611071static CPU_SET_INFO( m6809 )
10621072{
1063   m68_state_t *m68_state = device->token;
1073   m68_state_t *m68_state = get_safe_token(device);
10641074
10651075   switch (state)
10661076   {
r4425r4426
10911101
10921102CPU_GET_INFO( m6809 )
10931103{
1094   m68_state_t *m68_state = (device != NULL) ? device->token : NULL;
1104   m68_state_t *m68_state = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
10951105
10961106   switch (state)
10971107   {
src/emu/cpu/m6809/6809dasm.c
r4425r4426
368368   const UINT8 *operandarray;
369369   unsigned int ea, flags;
370370   int numoperands, offset, indirect;
371   const m6809_config *configdata = device ? device->static_config : NULL;
371   const m6809_config *configdata = device ? (const m6809_config *)device->static_config : NULL;
372372   int encrypt_only_first_byte = configdata ? configdata->encrypt_only_first_byte : 0;
373373
374374   int i, p = 0, page = 0, opcode_found = FALSE;
src/emu/cpu/h83002/h8_16.c
r4425r4426
205205
206206static CPU_INIT(h8)
207207{
208   h83xx_state *h8 = device->token;
208   h83xx_state *h8 = get_safe_token(device);
209209
210210   h8->h8iflag = 1;
211211   h8->irq_cb = irqcallback;
r4425r4426
236236
237237static CPU_INIT(h8_3007)
238238{
239   h83xx_state *h8 = device->token;
239   h83xx_state *h8 = get_safe_token(device);
240240
241241   CPU_INIT_CALL(h8);
242242   h8_3007_itu_init(h8);
r4425r4426
244244
245245static CPU_RESET(h8)
246246{
247   h83xx_state *h8 = device->token;
247   h83xx_state *h8 = get_safe_token(device);
248248
249249   h8->h8err = 0;
250250   h8->pc = h8_mem_read32(h8, 0) & 0xffffff;
r4425r4426
361361
362362static CPU_SET_INFO( h8 )
363363{
364   h83xx_state *h8 = device->token;
364   h83xx_state *h8 = get_safe_token(device);
365365
366366   switch(state) {
367367   case CPUINFO_INT_PC:                  h8->pc = info->i;                         break;
r4425r4426
538538
539539CPU_GET_INFO( h8_3002 )
540540{
541   h83xx_state *h8 = (device != NULL) ? device->token : NULL;
541   h83xx_state *h8 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
542542
543543   switch(state) {
544544   // Interface functions and variables
src/emu/cpu/h83002/h8priv.h
r4425r4426
4343};
4444extern h83xx_state h8;
4545
46INLINE h83xx_state *get_safe_token(const device_config *device)
47{
48   assert(device != NULL);
49   assert(device->token != NULL);
50   assert(device->type == CPU);
51   assert(cpu_get_type(device) == CPU_H83002 ||
52         cpu_get_type(device) == CPU_H83007 ||
53         cpu_get_type(device) == CPU_H83044 ||
54         cpu_get_type(device) == CPU_H83334);
55   return (h83xx_state *)device->token;
56}
4657
4758UINT8 h8_register_read8(h83xx_state *h8, UINT32 address);
4859UINT8 h8_3007_register_read8(h83xx_state *h8, UINT32 address);
src/emu/cpu/h83002/h8_8.c
r4425r4426
213213
214214static CPU_INIT(h8bit)
215215{
216   h83xx_state *h8 = device->token;
216   h83xx_state *h8 = get_safe_token(device);
217217
218218   h8->h8iflag = 1;
219219
r4425r4426
243243
244244static CPU_RESET(h8bit)
245245{
246   h83xx_state *h8 = device->token;
246   h83xx_state *h8 = get_safe_token(device);
247247
248248   h8->h8err = 0;
249249   h8->pc = h8_mem_read16(h8, 0);
r4425r4426
351351
352352static CPU_SET_INFO( h8 )
353353{
354   h83xx_state *h8 = device->token;
354   h83xx_state *h8 = get_safe_token(device);
355355
356356   switch(state) {
357357   case CPUINFO_INT_PC:                     h8->pc = info->i;                         break;
r4425r4426
513513
514514CPU_GET_INFO( h8_3334 )
515515{
516   h83xx_state *h8 = (device != NULL) ? device->token : NULL;
516   h83xx_state *h8 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
517517
518518   switch(state) {
519519   // Interface functions and variables
src/emu/cpu/h83002/h8ops.h
r4425r4426
107107
108108static CPU_EXECUTE(h8)
109109{
110   h83xx_state *h8 = device->token;
110   h83xx_state *h8 = get_safe_token(device);
111111   UINT16 opcode=0;
112112
113113   h8->cyccnt = cycles;
r4425r4426
26312631   {
26322632      // overflow !
26332633      h8->h8vflag = 1;
2634      res = 0x80;
2634      res = (INT8)0x80;
26352635   }
26362636   else
26372637   {
r4425r4426
26652665   {
26662666      // overflow !
26672667      h8->h8vflag = 1;
2668      res = 0x8000;
2668      res = (INT16)0x8000;
26692669   }
26702670   else
26712671   {
src/emu/cpu/m68000/m68kcpu.h
r4425r4426
564564   int  initial_cycles;
565565   int  remaining_cycles;                     /* Number of clocks remaining */
566566   UINT32 tracing;
567   UINT32 address_space;
568567
569568   jmp_buf aerr_trap;
570569   UINT32    aerr_address;
src/emu/cpu/m68000/m68kmake.c
r4425r4426
808808 */
809809static int DECL_SPEC compare_nof_true_bits(const void* aptr, const void* bptr)
810810{
811   const opcode_struct *a = aptr, *b = bptr;
811   const opcode_struct *a = (const opcode_struct *)aptr, *b = (const opcode_struct *)bptr;
812812   if(a->bits != b->bits)
813813      return a->bits - b->bits;
814814   if(a->op_mask != b->op_mask)
r4425r4426
863863static void generate_opcode_handler(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* opinfo, int ea_mode)
864864{
865865   char str[MAX_LINE_LENGTH+1];
866   opcode_struct* op = malloc(sizeof(opcode_struct));
866   opcode_struct* op = (opcode_struct *)malloc(sizeof(opcode_struct));
867867
868868   /* Set the opcode structure and write the tables, prototypes, etc */
869869   set_opcode_struct(opinfo, op, ea_mode);
r4425r4426
956956   char replnot[20];
957957   int i;
958958   int old_length = replace->length;
959   opcode_struct* op = malloc(sizeof(opcode_struct));
959   opcode_struct* op = (opcode_struct *)malloc(sizeof(opcode_struct));
960960
961961   *op = *op_in;
962962
r4425r4426
995995   char oper_spec_proc[MAX_LINE_LENGTH+1];
996996   char oper_spec_ea[MAX_LINE_LENGTH+1];
997997   opcode_struct* opinfo;
998   replace_struct* replace = malloc(sizeof(replace_struct));
999   body_struct* body = malloc(sizeof(body_struct));
998   replace_struct* replace = (replace_struct*)malloc(sizeof(replace_struct));
999   body_struct* body = (body_struct*)malloc(sizeof(body_struct));
10001000
10011001   for(;;)
10021002   {
r4425r4426
12131213/* ============================= MAIN FUNCTION ============================ */
12141214/* ======================================================================== */
12151215
1216int main(int argc, char **argv)
1216int main(int argc, char *argv[])
12171217{
12181218   /* File stuff */
12191219   char output_path[M68K_MAX_DIR] = "";
src/emu/cpu/m68000/m68kcpu.c
r4425r4426
474474
475475
476476
477INLINE m68ki_cpu_core *get_safe_token(const device_config *device)
478{
479   assert(device != NULL);
480   assert(device->token != NULL);
481   assert(device->type == CPU);
482   assert(cpu_get_type(device) == CPU_M68000 ||
483         cpu_get_type(device) == CPU_M68008 ||
484         cpu_get_type(device) == CPU_M68010 ||
485         cpu_get_type(device) == CPU_M68EC020 ||
486         cpu_get_type(device) == CPU_M68020 ||
487         cpu_get_type(device) == CPU_M68040);
488   return (m68ki_cpu_core *)device->token;
489}
490
477491/* ======================================================================== */
478492/* ================================= API ================================== */
479493/* ======================================================================== */
r4425r4426
504518
505519static void m68k_presave(running_machine *machine, void *param)
506520{
507   m68ki_cpu_core *m68k = param;
521   m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
508522   m68k->save_sr = m68ki_get_sr(m68k);
509523   m68k->save_stopped = (m68k->stopped & STOP_LEVEL_STOP) != 0;
510524   m68k->save_halted  = (m68k->stopped & STOP_LEVEL_HALT) != 0;
r4425r4426
512526
513527static void m68k_postload(running_machine *machine, void *param)
514528{
515   m68ki_cpu_core *m68k = param;
529   m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
516530   m68ki_set_sr_noint_nosp(m68k, m68k->save_sr);
517531   m68k->stopped = m68k->save_stopped ? STOP_LEVEL_STOP : 0
518532              | m68k->save_halted  ? STOP_LEVEL_HALT : 0;
r4425r4426
523537/* Execute some instructions until we use up cycles clock cycles */
524538static CPU_EXECUTE( m68k )
525539{
526   m68ki_cpu_core *m68k = device->token;
540   m68ki_cpu_core *m68k = get_safe_token(device);
527541
528542   /* Set our pool of clock cycles available */
529543   m68k->remaining_cycles = cycles;
r4425r4426
572586static CPU_INIT( m68k )
573587{
574588   static UINT32 emulation_initialized = 0;
575   m68ki_cpu_core *m68k = device->token;
589   m68ki_cpu_core *m68k = get_safe_token(device);
576590
577591   m68k->device = device;
578592   m68k->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
614628/* Pulse the RESET line on the CPU */
615629static CPU_RESET( m68k )
616630{
617   m68ki_cpu_core *m68k = device->token;
631   m68ki_cpu_core *m68k = get_safe_token(device);
618632
619633   /* Clear all stop levels and eat up all remaining cycles */
620634   m68k->stopped = 0;
r4425r4426
650664
651665static CPU_DISASSEMBLE( m68k )
652666{
653   m68ki_cpu_core *m68k = device->token;
667   m68ki_cpu_core *m68k = get_safe_token(device);
654668   return m68k_disassemble_raw(buffer, pc, oprom, opram, m68k->dasm_type);
655669}
656670
r4425r4426
662676
663677static CPU_IMPORT_STATE( m68k )
664678{
665   m68ki_cpu_core *m68k = device->token;
679   m68ki_cpu_core *m68k = get_safe_token(device);
666680
667681   switch (entry->index)
668682   {
r4425r4426
700714
701715static CPU_EXPORT_STATE( m68k )
702716{
703   m68ki_cpu_core *m68k = device->token;
717   m68ki_cpu_core *m68k = get_safe_token(device);
704718
705719   switch (entry->index)
706720   {
r4425r4426
728742
729743static CPU_SET_INFO( m68k )
730744{
731   m68ki_cpu_core *m68k = device->token;
745   m68ki_cpu_core *m68k = get_safe_token(device);
732746   switch (state)
733747   {
734748      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
754768
755769static CPU_GET_INFO( m68k )
756770{
757   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
771   m68ki_cpu_core *m68k = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
758772   int sr;
759773
760774   switch (state)
r4425r4426
832846
833847void m68k_set_encrypted_opcode_range(const device_config *device, offs_t start, offs_t end)
834848{
835   m68ki_cpu_core *m68k = device->token;
849   m68ki_cpu_core *m68k = get_safe_token(device);
836850   m68k->encrypted_start = start;
837851   m68k->encrypted_end = end;
838852}
r4425r4426
866880
867881static UINT16 read_immediate_16(const address_space *space, offs_t address)
868882{
869   m68ki_cpu_core *m68k = space->cpu->token;
883   m68ki_cpu_core *m68k = get_safe_token(space->cpu);
870884   return memory_decrypted_read_word(space, (address) ^ m68k->memory.opcode_xor);
871885}
872886
r4425r4426
972986
973987static CPU_INIT( m68000 )
974988{
975   m68ki_cpu_core *m68k = device->token;
989   m68ki_cpu_core *m68k = get_safe_token(device);
976990
977991   CPU_INIT_CALL(m68k);
978992
r4425r4426
10151029
10161030static CPU_INIT( m68008 )
10171031{
1018   m68ki_cpu_core *m68k = device->token;
1032   m68ki_cpu_core *m68k = get_safe_token(device);
10191033
10201034   CPU_INIT_CALL(m68k);
10211035
r4425r4426
10621076
10631077static CPU_INIT( m68010 )
10641078{
1065   m68ki_cpu_core *m68k = device->token;
1079   m68ki_cpu_core *m68k = get_safe_token(device);
10661080
10671081   CPU_INIT_CALL(m68k);
10681082
r4425r4426
11051119
11061120static CPU_INIT( m68020 )
11071121{
1108   m68ki_cpu_core *m68k = device->token;
1122   m68ki_cpu_core *m68k = get_safe_token(device);
11091123
11101124   CPU_INIT_CALL(m68k);
11111125
r4425r4426
11291143
11301144CPU_GET_INFO( m68020 )
11311145{
1132   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
1146   m68ki_cpu_core *m68k = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
11331147   int sr;
11341148
11351149   switch (state)
r4425r4426
11801194
11811195static CPU_INIT( m68ec020 )
11821196{
1183   m68ki_cpu_core *m68k = device->token;
1197   m68ki_cpu_core *m68k = get_safe_token(device);
11841198
11851199   CPU_INIT_CALL(m68k);
11861200
r4425r4426
12251239
12261240static CPU_INIT( m68040 )
12271241{
1228   m68ki_cpu_core *m68k = device->token;
1242   m68ki_cpu_core *m68k = get_safe_token(device);
12291243
12301244   CPU_INIT_CALL(m68k);
12311245
r4425r4426
12491263
12501264CPU_GET_INFO( m68040 )
12511265{
1252   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
1266   m68ki_cpu_core *m68k = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
12531267   int sr;
12541268
12551269   switch (state)
src/emu/cpu/ccpu/ccpu.c
r4425r4426
4949};
5050
5151
52INLINE ccpu_state *get_safe_token(const device_config *device)
53{
54   assert(device != NULL);
55   assert(device->token != NULL);
56   assert(device->type == CPU);
57   assert(cpu_get_type(device) == CPU_CCPU);
58   return (ccpu_state *)device->token;
59}
5260
61
5362/***************************************************************************
5463    MACROS
5564***************************************************************************/
r4425r4426
98107{
99108   /* this routine is called when there is no external input */
100109   /* and the JMI jumper is present */
101   ccpu_state *cpustate = device->token;
110   ccpu_state *cpustate = get_safe_token(device);
102111   return TEST_MI(cpustate);
103112}
104113
105114
106115void ccpu_wdt_timer_trigger(const device_config *device)
107116{
108   ccpu_state *cpustate = device->token;
117   ccpu_state *cpustate = get_safe_token(device);
109118   cpustate->waiting = FALSE;
110119   cpustate->watchdog++;
111120   if (cpustate->watchdog >= 3)
r4425r4426
115124
116125static CPU_INIT( ccpu )
117126{
118   const ccpu_config *configdata = device->static_config;
119   ccpu_state *cpustate = device->token;
127   const ccpu_config *configdata = (const ccpu_config *)device->static_config;
128   ccpu_state *cpustate = get_safe_token(device);
120129
121130   /* copy input params */
122131   cpustate->external_input = configdata->external_input ? configdata->external_input : read_jmi;
r4425r4426
150159
151160static CPU_RESET( ccpu )
152161{
153   ccpu_state *cpustate = device->token;
162   ccpu_state *cpustate = get_safe_token(device);
154163
155164   /* zero registers */
156165   cpustate->PC = 0;
r4425r4426
184193
185194static CPU_EXECUTE( ccpu )
186195{
187   ccpu_state *cpustate = device->token;
196   ccpu_state *cpustate = get_safe_token(device);
188197
189198   if (cpustate->waiting)
190199      return cycles;
r4425r4426
686695
687696static CPU_SET_INFO( ccpu )
688697{
689   ccpu_state *cpustate = device->token;
698   ccpu_state *cpustate = get_safe_token(device);
690699
691700   switch (state)
692701   {
r4425r4426
721730
722731CPU_GET_INFO( ccpu )
723732{
724   ccpu_state *cpustate = (device != NULL) ? device->token : NULL;
733   ccpu_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
725734
726735   switch (state)
727736   {
src/emu/cpu/tms34010/tms34010.c
r4425r4426
8282   cpu_state_table      state;
8383};
8484
85INLINE tms34010_state *get_safe_token(const device_config *device)
86{
87   assert(device != NULL);
88   assert(device->token != NULL);
89   assert(device->type == CPU);
90   assert(cpu_get_type(device) == CPU_TMS34010 ||
91         cpu_get_type(device) == CPU_TMS34020);
92   return (tms34010_state *)device->token;
93}
94
8595#include "34010ops.h"
8696
8797
r4425r4426
673683
674684static CPU_INIT( tms34010 )
675685{
676   const tms34010_config *configdata = device->static_config ? device->static_config : &default_config;
677   tms34010_state *tms = device->token;
686   const tms34010_config *configdata = device->static_config ? (const tms34010_config *)device->static_config : &default_config;
687   tms34010_state *tms = get_safe_token(device);
678688
679689   tms->external_host_access = FALSE;
680690
r4425r4426
694704   timer_adjust_oneshot(tms->scantimer, attotime_zero, 0);
695705
696706   /* allocate the shiftreg */
697   tms->shiftreg = auto_malloc(SHIFTREG_SIZE);
707   tms->shiftreg = (UINT16 *)auto_malloc(SHIFTREG_SIZE);
698708
699709   state_save_register_device_item(device, 0, tms->pc);
700710   state_save_register_device_item(device, 0, tms->st);
r4425r4426
713723static CPU_RESET( tms34010 )
714724{
715725   /* zap the state and copy in the config pointer */
716   tms34010_state *tms = device->token;
726   tms34010_state *tms = get_safe_token(device);
717727   const tms34010_config *config = tms->config;
718728   const device_config *screen = tms->screen;
719729   UINT16 *shiftreg = tms->shiftreg;
r4425r4426
746756
747757static CPU_RESET( tms34020 )
748758{
749   tms34010_state *tms = device->token;
759   tms34010_state *tms = get_safe_token(device);
750760   CPU_RESET_CALL(tms34010);
751761   tms->is_34020 = 1;
752762}
r4425r4426
759769
760770static CPU_EXIT( tms34010 )
761771{
762   tms34010_state *tms = device->token;
772   tms34010_state *tms = get_safe_token(device);
763773   tms->shiftreg = NULL;
764774}
765775
r4425r4426
800810
801811static TIMER_CALLBACK( internal_interrupt_callback )
802812{
803   tms34010_state *tms = ptr;
813   tms34010_state *tms = (tms34010_state *)ptr;
804814   int type = param;
805815
806816   /* call through to the CPU to generate the int */
r4425r4426
819829
820830static CPU_EXECUTE( tms34010 )
821831{
822   tms34010_state *tms = device->token;
832   tms34010_state *tms = get_safe_token(device);
823833
824834   /* Get out if CPU is halted. Absolutely no interrupts must be taken!!! */
825835   if (IOREG(tms, REG_HSTCTLH) & 0x8000)
r4425r4426
948958
949959static TIMER_CALLBACK( scanline_callback )
950960{
951   tms34010_state *tms = ptr;
961   tms34010_state *tms = (tms34010_state *)ptr;
952962   const rectangle *current_visarea;
953963   int vsblnk, veblnk, vtotal;
954964   int vcount = param;
r4425r4426
10881098
10891099void tms34010_get_display_params(const device_config *cpu, tms34010_display_params *params)
10901100{
1091   tms34010_state *tms = cpu->token;
1101   tms34010_state *tms = get_safe_token(cpu);
10921102
10931103   params->enabled = ((SMART_IOREG(tms, DPYCTL) & 0x8000) != 0);
10941104   params->vcount = SMART_IOREG(tms, VCOUNT);
r4425r4426
11341144      cpu_type type = cpu_get_type(cpu);
11351145      if (type == CPU_TMS34010 || type == CPU_TMS34020)
11361146      {
1137         tms = cpu->token;
1147         tms = get_safe_token(cpu);
11381148         if (tms->config != NULL && tms->config->scanline_callback != NULL && tms->screen == screen)
11391149            break;
11401150         tms = NULL;
r4425r4426
11981208
11991209WRITE16_HANDLER( tms34010_io_register_w )
12001210{
1201   tms34010_state *tms = space->cpu->token;
1211   tms34010_state *tms = get_safe_token(space->cpu);
12021212   int oldreg, newreg;
12031213
12041214   /* Set register */
r4425r4426
13411351
13421352WRITE16_HANDLER( tms34020_io_register_w )
13431353{
1344   tms34010_state *tms = space->cpu->token;
1354   tms34010_state *tms = get_safe_token(space->cpu);
13451355   int oldreg, newreg;
13461356
13471357   /* Set register */
r4425r4426
15041514
15051515READ16_HANDLER( tms34010_io_register_r )
15061516{
1507   tms34010_state *tms = space->cpu->token;
1517   tms34010_state *tms = get_safe_token(space->cpu);
15081518   int result, total;
15091519
15101520//  if (LOG_CONTROL_REGS)
r4425r4426
15471557
15481558READ16_HANDLER( tms34020_io_register_r )
15491559{
1550   tms34010_state *tms = space->cpu->token;
1560   tms34010_state *tms = get_safe_token(space->cpu);
15511561   int result, total;
15521562
15531563//  if (LOG_CONTROL_REGS)
r4425r4426
15891599
15901600static STATE_POSTLOAD( tms34010_state_postload )
15911601{
1592   tms34010_state *tms = param;
1602   tms34010_state *tms = (tms34010_state *)param;
15931603   set_raster_op(tms);
15941604   set_pixel_function(tms);
15951605}
r4425r4426
16021612void tms34010_host_w(const device_config *cpu, int reg, int data)
16031613{
16041614   const address_space *space;
1605   tms34010_state *tms = cpu->token;
1615   tms34010_state *tms = get_safe_token(cpu);
16061616   unsigned int addr;
16071617
16081618   switch (reg)
r4425r4426
16571667
16581668int tms34010_host_r(const device_config *cpu, int reg)
16591669{
1660   tms34010_state *tms = cpu->token;
1670   tms34010_state *tms = get_safe_token(cpu);
16611671   unsigned int addr;
16621672   int result = 0;
16631673
r4425r4426
17141724
17151725static CPU_SET_INFO( tms34010 )
17161726{
1717   tms34010_state *tms = device->token;
1727   tms34010_state *tms = get_safe_token(device);
17181728
17191729   switch (state)
17201730   {
r4425r4426
17321742
17331743CPU_GET_INFO( tms34010 )
17341744{
1735   tms34010_state *tms = (device != NULL) ? device->token : NULL;
1745   tms34010_state *tms = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
17361746
17371747   switch (state)
17381748   {
src/emu/cpu/tms34010/34010gfx.c
r4425r4426
203203/* Shift register handling */
204204static void shiftreg_w(const address_space *space, offs_t offset,UINT16 data)
205205{
206   tms34010_state *tms = space->cpu->token;
206   tms34010_state *tms = get_safe_token(space->cpu);
207207   if (tms->config->from_shiftreg)
208208      (*tms->config->from_shiftreg)(space, (UINT32)(offset << 3) & ~15, &tms->shiftreg[0]);
209209   else
r4425r4426
212212
213213static UINT16 shiftreg_r(const address_space *space, offs_t offset)
214214{
215   tms34010_state *tms = space->cpu->token;
215   tms34010_state *tms = get_safe_token(space->cpu);
216216   if (tms->config->to_shiftreg)
217217      (*tms->config->to_shiftreg)(space, (UINT32)(offset << 3) & ~15, &tms->shiftreg[0]);
218218   else
r4425r4426
222222
223223static UINT16 dummy_shiftreg_r(const address_space *space, offs_t offset)
224224{
225   tms34010_state *tms = space->cpu->token;
225   tms34010_state *tms = get_safe_token(space->cpu);
226226   return tms->shiftreg[0];
227227}
228228
src/emu/cpu/tms32031/32031ops.c
r4425r4426
6767    FORWARD DECLARATIONS
6868***************************************************************************/
6969
70void (*const tms32031ops[])(tms32031_state *tms, UINT32 op);
70extern void (*const tms32031ops[])(tms32031_state *tms, UINT32 op);
7171
7272
7373
src/emu/cpu/tms32031/tms32031.c
r4425r4426
122122   const address_space *program;
123123};
124124
125INLINE tms32031_state *get_safe_token(const device_config *device)
126{
127   assert(device != NULL);
128   assert(device->token != NULL);
129   assert(device->type == CPU);
130   assert(cpu_get_type(device) == CPU_TMS32031);
131   return (tms32031_state *)device->token;
132}
125133
126134
135
127136/***************************************************************************
128137    FUNCTION PROTOTYPES
129138***************************************************************************/
r4425r4426
358367
359368static CPU_INIT( tms32031 )
360369{
361   const tms32031_config *configdata = device->static_config;
362   tms32031_state *tms = device->token;
370   const tms32031_config *configdata = (const tms32031_config *)device->static_config;
371   tms32031_state *tms = get_safe_token(device);
363372   int i;
364373
365374   tms->irq_callback = irqcallback;
r4425r4426
388397
389398static CPU_RESET( tms32031 )
390399{
391   tms32031_state *tms = device->token;
400   tms32031_state *tms = get_safe_token(device);
392401
393402   /* if we have a config struct, get the boot ROM address */
394403   if (tms->bootoffset)
r4425r4426
416425
417426static CPU_RESET( tms32032 )
418427{
419   tms32031_state *tms = device->token;
428   tms32031_state *tms = get_safe_token(device);
420429   CPU_RESET_CALL(tms32031);
421430   tms->is_32032 = TRUE;
422431}
r4425r4426
452461
453462static CPU_EXECUTE( tms32031 )
454463{
455   tms32031_state *tms = device->token;
464   tms32031_state *tms = get_safe_token(device);
456465
457466   /* check IRQs up front */
458467   tms->icount = cycles;
r4425r4426
612621
613622static CPU_SET_INFO( tms32031 )
614623{
615   tms32031_state *tms = device->token;
624   tms32031_state *tms = get_safe_token(device);
616625   switch (state)
617626   {
618627      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
691700
692701CPU_GET_INFO( tms32031 )
693702{
694   tms32031_state *tms = (device != NULL) ? device->token : NULL;
703   tms32031_state *tms = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
695704   float ftemp;
696705
697706   switch (state)
src/emu/cpu/mcs48/mcs48.c
r4425r4426
269269    INLINE FUNCTIONS
270270***************************************************************************/
271271
272INLINE mcs48_state *get_safe_token(const device_config *device)
273{
274   assert(device != NULL);
275   assert(device->token != NULL);
276   assert(device->type == CPU);
277   assert(cpu_get_type(device) == CPU_I8035 ||
278         cpu_get_type(device) == CPU_I8048 ||
279         cpu_get_type(device) == CPU_I8648 ||
280         cpu_get_type(device) == CPU_I8748 ||
281         cpu_get_type(device) == CPU_I8039 ||
282         cpu_get_type(device) == CPU_I8049 ||
283         cpu_get_type(device) == CPU_I8749 ||
284         cpu_get_type(device) == CPU_I8040 ||
285         cpu_get_type(device) == CPU_I8050 ||
286         cpu_get_type(device) == CPU_I8041 ||
287         cpu_get_type(device) == CPU_I8741 ||
288         cpu_get_type(device) == CPU_I8042 ||
289         cpu_get_type(device) == CPU_I8242 ||
290         cpu_get_type(device) == CPU_I8742 ||
291         cpu_get_type(device) == CPU_MB8884 ||
292         cpu_get_type(device) == CPU_N7751 ||
293         cpu_get_type(device) == CPU_M58715);
294   return (mcs48_state *)device->token;
295}
296
297
272298/*-------------------------------------------------
273299    opcode_fetch - fetch an opcode byte
274300-------------------------------------------------*/
r4425r4426
297323
298324INLINE void update_regptr(mcs48_state *cpustate)
299325{
300   cpustate->regptr = memory_get_write_ptr(cpustate->data, (cpustate->psw & B_FLAG) ? 24 : 0);
326   cpustate->regptr = (UINT8 *)memory_get_write_ptr(cpustate->data, (cpustate->psw & B_FLAG) ? 24 : 0);
301327}
302328
303329
r4425r4426
869895
870896static void mcs48_init(const device_config *device, cpu_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize)
871897{
872   mcs48_state *cpustate = device->token;
898   mcs48_state *cpustate = get_safe_token(device);
873899
874900   /* External access line
875901     * EA=1 : read from external rom
r4425r4426
9971023
9981024static CPU_RESET( mcs48 )
9991025{
1000   mcs48_state *cpustate = device->token;
1026   mcs48_state *cpustate = get_safe_token(device);
10011027
10021028   /* confirmed from reset description */
10031029   cpustate->pc = 0;
r4425r4426
11191145
11201146static CPU_EXECUTE( mcs48 )
11211147{
1122   mcs48_state *cpustate = device->token;
1148   mcs48_state *cpustate = get_safe_token(device);
11231149   int curcycles;
11241150
11251151   update_regptr(cpustate);
r4425r4426
11681194
11691195UINT8 upi41_master_r(const device_config *device, UINT8 a0)
11701196{
1171   mcs48_state *cpustate = device->token;
1197   mcs48_state *cpustate = get_safe_token(device);
11721198
11731199   /* if just reading the status, return it */
11741200   if ((a0 & 1) != 0)
r4425r4426
11921218
11931219static TIMER_CALLBACK( master_callback )
11941220{
1195   const device_config *device = ptr;
1196   mcs48_state *cpustate = device->token;
1221   const device_config *device = (const device_config *)ptr;
1222   mcs48_state *cpustate = get_safe_token(device);
11971223   UINT8 a0 = (param >> 8) & 1;
11981224   UINT8 data = param;
11991225
r4425r4426
12641290
12651291static CPU_IMPORT_STATE( mcs48 )
12661292{
1267   mcs48_state *cpustate = device->token;
1293   mcs48_state *cpustate = get_safe_token(device);
12681294
12691295   switch (entry->index)
12701296   {
r4425r4426
12931319
12941320static CPU_EXPORT_STATE( mcs48 )
12951321{
1296   mcs48_state *cpustate = device->token;
1322   mcs48_state *cpustate = get_safe_token(device);
12971323
12981324   switch (entry->index)
12991325   {
r4425r4426
13221348
13231349static CPU_SET_INFO( mcs48 )
13241350{
1325   mcs48_state *cpustate = device->token;
1351   mcs48_state *cpustate = get_safe_token(device);
13261352
13271353   switch (state)
13281354   {
r4425r4426
13401366
13411367static CPU_GET_INFO( mcs48 )
13421368{
1343   mcs48_state *cpustate = (device != NULL) ? device->token : NULL;
1369   mcs48_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
13441370
13451371   switch (state)
13461372   {
src/emu/cpu/m37710/m37710.c
r4425r4426
5353
5454#include "debugger.h"
5555#include "cpuexec.h"
56#include "m37710.h"
5657#include "m37710cm.h"
5758
5859#define M37710_DEBUG   (0)   // enables verbose logging for peripherals, etc.
r4425r4426
260261
261262static TIMER_CALLBACK( m37710_timer_cb )
262263{
263   m37710i_cpu_struct *cpustate = ptr;
264   m37710i_cpu_struct *cpustate = (m37710i_cpu_struct *)ptr;
264265   int which = param;
265266   int curirq = M37710_LINE_TIMERA0 - which;
266267
r4425r4426
763764
764765static CPU_RESET( m37710 )
765766{
766   m37710i_cpu_struct *cpustate = device->token;
767   m37710i_cpu_struct *cpustate = get_safe_token(device);
767768
768769   /* Start the CPU */
769770   CPU_STOPPED = 0;
r4425r4426
811812/* Execute some instructions */
812813static CPU_EXECUTE( m37710 )
813814{
814   m37710i_cpu_struct *m37710 = device->token;
815   m37710i_cpu_struct *m37710 = get_safe_token(device);
815816
816817   m37710i_update_irqs(m37710);
817818
r4425r4426
869870
870871static CPU_DISASSEMBLE( m37710 )
871872{
872   m37710i_cpu_struct *cpustate = device->token;
873   m37710i_cpu_struct *cpustate = get_safe_token(device);
873874
874875   return m7700_disassemble(buffer, (pc&0xffff), pc>>16, oprom, FLAG_M, FLAG_X);
875876}
r4425r4426
887888
888889static CPU_INIT( m37710 )
889890{
890   m37710i_cpu_struct *cpustate = device->token;
891   m37710i_cpu_struct *cpustate = get_safe_token(device);
891892   int i;
892893
893894   memset(cpustate, 0, sizeof(cpustate));
r4425r4426
963964
964965static CPU_SET_INFO( m37710 )
965966{
966   m37710i_cpu_struct *cpustate = device->token;
967   m37710i_cpu_struct *cpustate = get_safe_token(device);
967968
968969   switch (state)
969970   {
r4425r4426
10121013
10131014CPU_GET_INFO( m37710 )
10141015{
1015   m37710i_cpu_struct *cpustate = (device != NULL) ? device->token : NULL;
1016   m37710i_cpu_struct *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
10161017
10171018   switch (state)
10181019   {
src/emu/cpu/m37710/m37710cm.h
r4425r4426
129129   emu_timer *timers[8];
130130};
131131
132INLINE m37710i_cpu_struct *get_safe_token(const device_config *device)
133{
134   assert(device != NULL);
135   assert(device->token != NULL);
136   assert(device->type == CPU);
137   assert(cpu_get_type(device) == CPU_M37710 ||
138         cpu_get_type(device) == CPU_M37702);
139   return (m37710i_cpu_struct *)device->token;
140}
132141
133142extern uint m37710i_adc_tbl[];
134143extern uint m37710i_sbc_tbl[];
src/emu/cpu/cpu.mak
r4425r4426
885885# MIPS R4000 (MIPS III/IV) series
886886#-------------------------------------------------
887887
888CPUDEFS += -DHAS_VR4300=$(if $(filter VR4300,$(CPUS)),1,0)
888889CPUDEFS += -DHAS_R4600=$(if $(filter R4600,$(CPUS)),1,0)
889890CPUDEFS += -DHAS_R4650=$(if $(filter R4650,$(CPUS)),1,0)
890891CPUDEFS += -DHAS_R4700=$(if $(filter R4700,$(CPUS)),1,0)
r4425r4426
892893CPUDEFS += -DHAS_QED5271=$(if $(filter QED5271,$(CPUS)),1,0)
893894CPUDEFS += -DHAS_RM7000=$(if $(filter RM7000,$(CPUS)),1,0)
894895
895ifneq ($(filter R4600 R4650 R4700 R5000 QED5271 RM7000,$(CPUS)),)
896ifneq ($(filter VR4300 R4600 R4650 R4700 R5000 QED5271 RM7000,$(CPUS)),)
896897OBJDIRS += $(CPUOBJ)/mips
897898CPUOBJS += $(CPUOBJ)/mips/mips3com.o $(CPUOBJ)/mips/mips3fe.o $(CPUOBJ)/mips/mips3drc.o $(DRCOBJ)
898899DBGOBJS += $(CPUOBJ)/mips/mips3dsm.o
src/emu/cpu/sharc/sharc.c
r4425r4426
183183                  ((UINT64)(cpustate->internal_ram[((pc-0x20000) * 3) + 1]) << 16) | \
184184                  ((UINT64)(cpustate->internal_ram[((pc-0x20000) * 3) + 2]) << 0)
185185
186INLINE SHARC_REGS *get_safe_token(const device_config *device)
187{
188   assert(device != NULL);
189   assert(device->token != NULL);
190   assert(device->type == CPU);
191   assert(cpu_get_type(device) == CPU_ADSP21062);
192   return (SHARC_REGS *)device->token;
193}
194
186195INLINE void CHANGE_PC(SHARC_REGS *cpustate, UINT32 newpc)
187196{
188197   cpustate->pc = newpc;
r4425r4426
363372
364373void sharc_external_iop_write(const device_config *device, UINT32 address, UINT32 data)
365374{
366   SHARC_REGS *cpustate = device->token;
375   SHARC_REGS *cpustate = get_safe_token(device);
367376   if (address == 0x1c)
368377   {
369378      if (data != 0)
r4425r4426
380389
381390void sharc_external_dma_write(const device_config *device, UINT32 address, UINT64 data)
382391{
383   SHARC_REGS *cpustate = device->token;
392   SHARC_REGS *cpustate = get_safe_token(device);
384393   switch ((cpustate->dma[6].control >> 6) & 0x3)
385394   {
386395      case 2:         // 16/48 packing
r4425r4426
423432
424433static CPU_INIT( sharc )
425434{
426   SHARC_REGS *cpustate = device->token;
427   const sharc_config *cfg = device->static_config;
435   SHARC_REGS *cpustate = get_safe_token(device);
436   const sharc_config *cfg = (const sharc_config *)device->static_config;
428437   int saveindex;
429438
430439   cpustate->boot_mode = cfg->boot_mode;
r4425r4426
436445
437446   build_opcode_table();
438447
439   cpustate->internal_ram = auto_malloc(2 * 0x10000 * sizeof(UINT16));      // 2x 128KB
448   cpustate->internal_ram = (UINT16 *)auto_malloc(2 * 0x10000 * sizeof(UINT16));      // 2x 128KB
440449   cpustate->internal_ram_block0 = &cpustate->internal_ram[0];
441450   cpustate->internal_ram_block1 = &cpustate->internal_ram[0x20000/2];
442451
r4425r4426
558567
559568static CPU_RESET( sharc )
560569{
561   SHARC_REGS *cpustate = device->token;
570   SHARC_REGS *cpustate = get_safe_token(device);
562571   memset(cpustate->internal_ram, 0, 2 * 0x10000 * sizeof(UINT16));
563572
564573   switch(cpustate->boot_mode)
r4425r4426
614623
615624void sharc_set_flag_input(const device_config *device, int flag_num, int state)
616625{
617   SHARC_REGS *cpustate = device->token;
626   SHARC_REGS *cpustate = get_safe_token(device);
618627   if (flag_num >= 0 && flag_num < 4)
619628   {
620629      // Check if flag is set to input in MODE2 (bit == 0)
r4425r4426
674683
675684static CPU_EXECUTE( sharc )
676685{
677   SHARC_REGS *cpustate = device->token;
686   SHARC_REGS *cpustate = get_safe_token(device);
678687   cpustate->icount = cycles;
679688
680689   if (cpustate->idle && cpustate->irq_active == 0)
r4425r4426
853862
854863static CPU_SET_INFO( sharc )
855864{
856   SHARC_REGS *cpustate = device->token;
865   SHARC_REGS *cpustate = get_safe_token(device);
857866
858867   switch (state)
859868   {
r4425r4426
954963{
955964   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 2)
956965   {
957      sharc_set_irq_line(device->token, state-CPUINFO_INT_INPUT_STATE, info->i);
966      sharc_set_irq_line(get_safe_token(device), state-CPUINFO_INT_INPUT_STATE, info->i);
958967      return;
959968   }
960969   else if (state >= CPUINFO_INT_INPUT_STATE + SHARC_INPUT_FLAG0 && state <= CPUINFO_INT_INPUT_STATE + SHARC_INPUT_FLAG3)
r4425r4426
972981
973982static CPU_READ( sharc )
974983{
975   SHARC_REGS *cpustate = device->token;
984   SHARC_REGS *cpustate = get_safe_token(device);
976985   if (space == ADDRESS_SPACE_PROGRAM)
977986   {
978987      int address = offset >> 3;
r4425r4426
10351044
10361045static CPU_READOP( sharc )
10371046{
1038   SHARC_REGS *cpustate = device->token;
1047   SHARC_REGS *cpustate = get_safe_token(device);
10391048   UINT64 mask = (size < 8) ? (((UINT64)1 << (8 * size)) - 1) : ~(UINT64)0;
10401049   int shift = 8 * (offset & 7);
10411050   offset >>= 3;
r4425r4426
10651074
10661075static CPU_GET_INFO( sharc )
10671076{
1068   SHARC_REGS *cpustate = (device != NULL) ? device->token : NULL;
1077   SHARC_REGS *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
10691078
10701079   switch(state)
10711080   {
src/emu/cpu/tms57002/tms57002.c
r4425r4426
106106   int unsupported_inst_warning;
107107} tms57002_t;
108108
109INLINE tms57002_t *get_safe_token(const device_config *device)
110{
111   assert(device != NULL);
112   assert(device->token != NULL);
113   assert(device->type == CPU);
114   assert(cpu_get_type(device) == CPU_TMS57002);
115   return (tms57002_t *)device->token;
116}
117
109118static void tms57002_cache_flush(tms57002_t *s);
110119
111120static const char *tms57002_get_memadr(UINT32 opcode, char type)
r4425r4426
191200
192201WRITE8_DEVICE_HANDLER(tms57002_pload_w)
193202{
194   tms57002_t *s = device->token;
203   tms57002_t *s = get_safe_token(device);
195204   UINT8 olds = s->sti;
196205
197206   if(data)
r4425r4426
205214
206215WRITE8_DEVICE_HANDLER(tms57002_cload_w)
207216{
208   tms57002_t *s = device->token;
217   tms57002_t *s = get_safe_token(device);
209218   UINT8 olds = s->sti;
210219   if(data)
211220      s->sti &= ~IN_CLOAD;
r4425r4426
217226
218227static CPU_RESET(tms57002)
219228{
220   tms57002_t *s = device->token;
229   tms57002_t *s = get_safe_token(device);
221230
222231   s->sti = (s->sti & ~(SU_MASK|S_READ|S_WRITE|S_BRANCH|S_HOST)) | (SU_ST0|S_IDLE);
223232   s->pc = 0;
r4425r4426
240249
241250WRITE8_DEVICE_HANDLER(tms57002_data_w)
242251{
243   tms57002_t *s = device->token;
252   tms57002_t *s = get_safe_token(device);
244253
245254   switch(s->sti & (IN_PLOAD|IN_CLOAD)) {
246255   case 0:
r4425r4426
297306
298307READ8_DEVICE_HANDLER(tms57002_data_r)
299308{
300   tms57002_t *s = device->token;
309   tms57002_t *s = get_safe_token(device);
301310   UINT8 res;
302311   if(!(s->sti & S_HOST))
303312      return 0xff;
r4425r4426
319328
320329READ8_DEVICE_HANDLER(tms57002_dready_r)
321330{
322   tms57002_t *s = device->token;
331   tms57002_t *s = get_safe_token(device);
323332   return s->sti & S_HOST ? 0 : 1;
324333}
325334
326335void tms57002_sync(const device_config *device)
327336{
328   tms57002_t *s = device->token;
337   tms57002_t *s = get_safe_token(device);
329338
330339   if(s->sti & (IN_PLOAD | IN_CLOAD))
331340      return;
r4425r4426
13451354
13461355static CPU_EXECUTE(tms57002)
13471356{
1348   tms57002_t *s = device->token;
1357   tms57002_t *s = get_safe_token(device);
13491358   int initial_cycles = cycles;
13501359   int ipc = -1;
13511360
r4425r4426
14091418
14101419static CPU_INIT(tms57002)
14111420{
1412   tms57002_t *s = device->token;
1421   tms57002_t *s = get_safe_token(device);
14131422   tms57002_cache_flush(s);
14141423   s->sti = S_IDLE;
14151424   s->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
14271436
14281437CPU_GET_INFO(tms57002)
14291438{
1430   tms57002_t *s = (device != NULL) ? device->token : NULL;
1439   tms57002_t *s = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
14311440
14321441   switch(state) {
14331442   case CPUINFO_INT_CONTEXT_SIZE:            info->i = sizeof(tms57002_t); break;
src/emu/cpu/tms57002/tmsmake.c
r4425r4426
101101  char *r;
102102  int len = strlen(src);
103103  int pos = dest ? strlen(dest) : 0;
104  r = realloc(dest, pos+len+2);
104  r = (char *)realloc(dest, pos+len+2);
105105  memcpy(r + pos, src, len);
106106  r[pos+len] = '\n';
107107  r[pos+len+1] = 0;
r4425r4426
928928  clear_cat(cat3, 0x80);
929929}
930930
931int main(int argc, char **argv)
931int main(int argc, char *argv[])
932932{
933933  if(argc != 3) {
934934    fprintf(stderr, "Usage:\n%s tmsinstr.lst tms57002.inc\n", argv[0]);
src/emu/cpu/z180/z180.c
r4425r4426
124124   int icount;
125125};
126126
127INLINE z180_state *get_safe_token(const device_config *device)
128{
129   assert(device != NULL);
130   assert(device->token != NULL);
131   assert(device->type == CPU);
132   assert(cpu_get_type(device) == CPU_Z180);
133   return (z180_state *)device->token;
134}
135
127136static void set_irq_line(z180_state *cpustate, int irqline, int state);
128137
129138#define CF   0x01
r4425r4426
20042013
20052014static CPU_INIT( z180 )
20062015{
2007   z180_state *cpustate = device->token;
2016   z180_state *cpustate = get_safe_token(device);
20082017   cpustate->daisy = NULL;
20092018   if (device->static_config)
2010      cpustate->daisy = z80daisy_init(device, device->static_config);
2019      cpustate->daisy = z80daisy_init(device, (const z80_daisy_chain *)device->static_config);
20112020   cpustate->irq_callback = irqcallback;
20122021   cpustate->device = device;
20132022   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
20502059 ****************************************************************************/
20512060static CPU_RESET( z180 )
20522061{
2053   z180_state *cpustate = device->token;
2062   z180_state *cpustate = get_safe_token(device);
20542063   z80_daisy_state *save_daisy;
20552064   cpu_irq_callback save_irqcallback;
20562065   cpu_state_table save_table;
r4425r4426
23032312 ****************************************************************************/
23042313static CPU_EXECUTE( z180 )
23052314{
2306   z180_state *cpustate = device->token;
2315   z180_state *cpustate = get_safe_token(device);
23072316   int old_icount = cycles;
23082317   cpustate->icount = cycles;
23092318
r4425r4426
23942403 ****************************************************************************/
23952404static CPU_BURN( z180 )
23962405{
2397   z180_state *cpustate = device->token;
2406   z180_state *cpustate = get_safe_token(device);
23982407   if( cycles > 0 )
23992408   {
24002409      /* NOP takes 3 cycles per instruction */
r4425r4426
24342443{
24352444   if (space == ADDRESS_SPACE_PROGRAM)
24362445   {
2437      z180_state *cpustate = device->token;
2446      z180_state *cpustate = get_safe_token(device);
24382447      *address = MMU_REMAP_ADDR(cpustate, *address);
24392448   }
24402449   return TRUE;
r4425r4426
24472456
24482457static CPU_IMPORT_STATE( z180 )
24492458{
2450   z180_state *cpustate = device->token;
2459   z180_state *cpustate = get_safe_token(device);
24512460
24522461   switch (entry->index)
24532462   {
r4425r4426
24752484
24762485static CPU_EXPORT_STATE( z180 )
24772486{
2478   z180_state *cpustate = device->token;
2487   z180_state *cpustate = get_safe_token(device);
24792488
24802489   switch (entry->index)
24812490   {
r4425r4426
25002509
25012510static CPU_SET_INFO( z180 )
25022511{
2503   z180_state *cpustate = device->token;
2512   z180_state *cpustate = get_safe_token(device);
25042513   switch (state)
25052514   {
25062515      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
25082517      case CPUINFO_INT_INPUT_STATE + Z180_INT0:      set_irq_line(cpustate, Z180_INT0, info->i);         break;
25092518
25102519      /* --- the following bits of info are set as pointers to data or functions --- */
2511      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op:       cc[Z180_TABLE_op] = info->p;            break;
2512      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb:       cc[Z180_TABLE_cb] = info->p;            break;
2513      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed:       cc[Z180_TABLE_ed] = info->p;            break;
2514      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy:       cc[Z180_TABLE_xy] = info->p;            break;
2515      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb:    cc[Z180_TABLE_xycb] = info->p;            break;
2516      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex:       cc[Z180_TABLE_ex] = info->p;            break;
2520      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op:       cc[Z180_TABLE_op] = (const UINT8 *)info->p;            break;
2521      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb:       cc[Z180_TABLE_cb] = (const UINT8 *)info->p;            break;
2522      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed:       cc[Z180_TABLE_ed] = (const UINT8 *)info->p;            break;
2523      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xy:       cc[Z180_TABLE_xy] = (const UINT8 *)info->p;            break;
2524      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_xycb:    cc[Z180_TABLE_xycb] = (const UINT8 *)info->p;            break;
2525      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ex:       cc[Z180_TABLE_ex] = (const UINT8 *)info->p;            break;
25172526   }
25182527}
25192528
r4425r4426
25242533
25252534CPU_GET_INFO( z180 )
25262535{
2527   z180_state *cpustate = (device != NULL) ? device->token : NULL;
2536   z180_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
25282537   switch (state)
25292538   {
25302539      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/z180/z180ops.h
r4425r4426
7171#define RM(cs,addr)   memory_read_byte_8le((cs)->program, MMU_REMAP_ADDR(cs,addr))
7272UINT8 z180_readmem(const device_config *device, offs_t offset)
7373{
74   z180_state *cpustate = device->token;
74   z180_state *cpustate = get_safe_token(device);
7575   return RM(cpustate, offset);
7676}
7777
r4425r4426
8181#define WM(cs,addr,value) memory_write_byte_8le((cs)->program, MMU_REMAP_ADDR(cs,addr),value)
8282void z180_writemem(const device_config *device, offs_t offset, UINT8 data)
8383{
84   z180_state *cpustate = device->token;
84   z180_state *cpustate = get_safe_token(device);
8585   WM(cpustate, offset, data);
8686}
8787
src/emu/cpu/drcfe.c
r4425r4426
9797   if (desc != NULL)
9898      drcfe->desc_free_list = desc->next;
9999   else
100      desc = malloc_or_die(sizeof(*desc));
100      desc = (opcode_desc *)malloc_or_die(sizeof(*desc));
101101   return desc;
102102}
103103
r4425r4426
128128   drcfe_state *drcfe;
129129
130130   /* allocate some memory to hold the state */
131   drcfe = malloc_or_die(sizeof(*drcfe));
131   drcfe = (drcfe_state *)malloc_or_die(sizeof(*drcfe));
132132   memset(drcfe, 0, sizeof(*drcfe));
133133
134134   /* allocate the description array */
135   drcfe->desc_array = malloc_or_die((config->window_end + config->window_start + 2) * sizeof(*drcfe->desc_array));
135   drcfe->desc_array = (opcode_desc **)malloc_or_die((config->window_end + config->window_start + 2) * sizeof(*drcfe->desc_array));
136136   memset(drcfe->desc_array, 0, (config->window_end + config->window_start + 2) * sizeof(*drcfe->desc_array));
137137
138138   /* copy in configuration information */
src/emu/cpu/i86/i86.c
r4425r4426
6969   UINT16 eo; /* HJB 12/13/98 effective offset of the address (before segment is added) */
7070};
7171
72INLINE i8086_state *get_safe_token(const device_config *device)
73{
74   assert(device != NULL);
75   assert(device->token != NULL);
76   assert(device->type == CPU);
77   assert(cpu_get_type(device) == CPU_I8086 ||
78         cpu_get_type(device) == CPU_I8088 ||
79         cpu_get_type(device) == CPU_I80186);
80   return (i8086_state *)device->token;
81}
7282
7383/***************************************************************************
7484    CPU STATE DESCRIPTION
r4425r4426
151161/***************************************************************************/
152162static void i8086_state_register(const device_config *device)
153163{
154   i8086_state *cpustate = device->token;
164   i8086_state *cpustate = get_safe_token(device);
155165   state_save_register_device_item_array(device, 0, cpustate->regs.w);
156166   state_save_register_device_item(device, 0, cpustate->pc);
157167   state_save_register_device_item(device, 0, cpustate->prevpc);
r4425r4426
178188
179189static CPU_INIT( i8086 )
180190{
181   i8086_state *cpustate = device->token;
191   i8086_state *cpustate = get_safe_token(device);
182192   unsigned int i, j, c;
183193   static const BREGS reg_name[8] = {AL, CL, DL, BL, AH, CH, DH, BH};
184194   for (i = 0; i < 256; i++)
r4425r4426
219229#if (HAS_I8088||HAS_I80188)
220230static CPU_INIT( i8088 )
221231{
222   i8086_state *cpustate = device->token;
232   i8086_state *cpustate = get_safe_token(device);
223233   CPU_INIT_CALL(i8086);
224234   configure_memory_8bit(cpustate);
225235}
r4425r4426
227237
228238static CPU_RESET( i8086 )
229239{
230   i8086_state *cpustate = device->token;
240   i8086_state *cpustate = get_safe_token(device);
231241   cpu_irq_callback save_irqcallback;
232242    memory_interface save_mem;
233243    cpu_state_table save_state;
r4425r4426
286296
287297static CPU_EXECUTE( i8086 )
288298{
289   i8086_state *cpustate = device->token;
299   i8086_state *cpustate = get_safe_token(device);
290300
291301   /* copy over the cycle counts if they're not correct */
292302   if (timing.id != 8086)
r4425r4426
342352
343353static CPU_EXECUTE( i80186 )
344354{
345   i8086_state *cpustate = device->token;
355   i8086_state *cpustate = get_safe_token(device);
346356
347357   /* copy over the cycle counts if they're not correct */
348358   if (timing.id != 80186)
r4425r4426
382392
383393static CPU_IMPORT_STATE( i8086 )
384394{
385   i8086_state *cpustate = device->token;
395   i8086_state *cpustate = get_safe_token(device);
386396
387397   switch (entry->index)
388398   {
r4425r4426
436446
437447static CPU_EXPORT_STATE( i8086 )
438448{
439   i8086_state *cpustate = device->token;
449   i8086_state *cpustate = get_safe_token(device);
440450
441451   switch (entry->index)
442452   {
r4425r4426
461471
462472static CPU_EXPORT_STRING( i8086 )
463473{
464   i8086_state *cpustate = device->token;
474   i8086_state *cpustate = get_safe_token(device);
465475
466476   switch (entry->index)
467477   {
r4425r4426
486496
487497static CPU_SET_INFO( i8086 )
488498{
489   i8086_state *cpustate = device->token;
499   i8086_state *cpustate = get_safe_token(device);
490500
491501   switch (state)
492502   {
r4425r4426
505515
506516CPU_GET_INFO( i8086 )
507517{
508   i8086_state *cpustate = (device != NULL) ? device->token : NULL;
518   i8086_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
509519
510520   switch (state)
511521   {
src/emu/cpu/i86/i286.c
r4425r4426
7878   UINT16 eo; /* HJB 12/13/98 effective offset of the address (before segment is added) */
7979};
8080
81INLINE i80286_state *get_safe_token(const device_config *device)
82{
83   assert(device != NULL);
84   assert(device->token != NULL);
85   assert(device->type == CPU);
86   assert(cpu_get_type(device) == CPU_I80286);
87   return (i80286_state *)device->token;
88}
89
8190#define INT_IRQ 0x01
8291#define NMI_IRQ 0x02
8392
r4425r4426
138147
139148static CPU_RESET( i80286 )
140149{
141   i80286_state *cpustate = device->token;
150   i80286_state *cpustate = get_safe_token(device);
142151   static int urinit=1;
143152
144153   /* in my docu not all registers are initialized! */
r4425r4426
194203
195204static CPU_EXECUTE( i80286 )
196205{
197   i80286_state *cpustate = device->token;
206   i80286_state *cpustate = get_safe_token(device);
198207
199208   /* copy over the cycle counts if they're not correct */
200209   if (timing.id != 80286)
r4425r4426
233242
234243static CPU_INIT( i80286 )
235244{
236   i80286_state *cpustate = device->token;
245   i80286_state *cpustate = get_safe_token(device);
237246
238247   state_save_register_device_item_array(device, 0, cpustate->regs.w);
239248   state_save_register_device_item(device, 0, cpustate->amask);
r4425r4426
295304
296305static CPU_SET_INFO( i80286 )
297306{
298   i80286_state *cpustate = device->token;
307   i80286_state *cpustate = get_safe_token(device);
299308
300309   switch (state)
301310   {
r4425r4426
368377
369378CPU_GET_INFO( i80286 )
370379{
371   i80286_state *cpustate = (device != NULL) ? device->token : NULL;
380   i80286_state *cpustate = (device != NULL) ? get_safe_token(device) : NULL;
372381
373382   switch (state)
374383   {
src/emu/cpu/cubeqcpu/cubeqcpu.c
r4425r4426
221221} cquestlin_state;
222222
223223/***************************************************************************
224    STATE ACCESSORS
225***************************************************************************/
226
227INLINE cquestsnd_state *get_safe_token_snd(const device_config *device)
228{
229   assert(device != NULL);
230   assert(device->token != NULL);
231   assert(device->type == CPU);
232   assert(cpu_get_type(device) == CPU_CQUESTSND);
233   return (cquestsnd_state *)device->token;
234}
235
236INLINE cquestrot_state *get_safe_token_rot(const device_config *device)
237{
238   assert(device != NULL);
239   assert(device->token != NULL);
240   assert(device->type == CPU);
241   assert(cpu_get_type(device) == CPU_CQUESTROT);
242   return (cquestrot_state *)device->token;
243}
244
245INLINE cquestlin_state *get_safe_token_lin(const device_config *device)
246{
247   assert(device != NULL);
248   assert(device->token != NULL);
249   assert(device->type == CPU);
250   assert(cpu_get_type(device) == CPU_CQUESTLIN);
251   return (cquestlin_state *)device->token;
252}
253
254/***************************************************************************
224255    MEMORY ACCESSORS FOR 68000
225256***************************************************************************/
226257
227258WRITE16_DEVICE_HANDLER( cubeqcpu_sndram_w )
228259{
229   cquestsnd_state *cpustate = device->token;
260   cquestsnd_state *cpustate = get_safe_token_snd(device);
230261   COMBINE_DATA(&cpustate->sram[offset]);
231262}
232263
233264READ16_DEVICE_HANDLER( cubeqcpu_sndram_r )
234265{
235   cquestsnd_state *cpustate = device->token;
266   cquestsnd_state *cpustate = get_safe_token_snd(device);
236267   return cpustate->sram[offset];
237268}
238269
239270
240271WRITE16_DEVICE_HANDLER( cubeqcpu_rotram_w )
241272{
242   cquestrot_state *cpustate = device->token;
273   cquestrot_state *cpustate = get_safe_token_rot(device);
243274   COMBINE_DATA(&cpustate->dram[offset]);
244275}
245276
246277READ16_DEVICE_HANDLER( cubeqcpu_rotram_r )
247278{
248   cquestrot_state *cpustate = device->token;
279   cquestrot_state *cpustate = get_safe_token_rot(device);
249280   return cpustate->dram[offset];
250281}
251282
r4425r4426
260291
261292static void cquestsnd_state_register(const device_config *device)
262293{
263   cquestsnd_state *cpustate = device->token;
294   cquestsnd_state *cpustate = get_safe_token_snd(device);
264295   state_save_register_device_item_array(device, 0, cpustate->ram);
265296   state_save_register_device_item(device, 0, cpustate->q);
266297   state_save_register_device_item(device, 0, cpustate->f);
r4425r4426
283314
284315static CPU_INIT( cquestsnd )
285316{
286   cquestsnd_state *cpustate = device->token;
317   cquestsnd_state *cpustate = get_safe_token_snd(device);
287318   cubeqst_snd_config* _config = (cubeqst_snd_config*)device->static_config;
288319
289320   memset(cpustate, 0, sizeof(*cpustate));
r4425r4426
295326   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
296327
297328   /* Allocate RAM shared with 68000 */
298   cpustate->sram = auto_malloc(4096);
329   cpustate->sram = (UINT16 *)auto_malloc(4096);
299330
300331   cquestsnd_state_register(device);
301332}
r4425r4426
303334
304335static CPU_RESET( cquestsnd )
305336{
306   cquestsnd_state *cpustate = device->token;
337   cquestsnd_state *cpustate = get_safe_token_snd(device);
307338   cpustate->pc = 0;
308339}
309340
r4425r4426
324355
325356static void cquestrot_state_register(const device_config *device)
326357{
327   cquestrot_state *cpustate = device->token;
358   cquestrot_state *cpustate = get_safe_token_rot(device);
328359   state_save_register_device_item_array(device, 0, cpustate->ram);
329360   state_save_register_device_item(device, 0, cpustate->q);
330361   state_save_register_device_item(device, 0, cpustate->f);
r4425r4426
356387
357388static CPU_INIT( cquestrot )
358389{
359   const cubeqst_rot_config *rotconfig = device->static_config;
360   cquestrot_state *cpustate = device->token;
390   const cubeqst_rot_config *rotconfig = (const cubeqst_rot_config *)device->static_config;
391   cquestrot_state *cpustate = get_safe_token_rot(device);
361392   memset(cpustate, 0, sizeof(*cpustate));
362393
363394   /* Allocate RAM */
364   cpustate->dram = auto_malloc(16384 * sizeof(UINT16));  /* Shared with 68000 */
365   cpustate->sram = auto_malloc(2048 * sizeof(UINT16));   /* Private */
395   cpustate->dram = (UINT16 *)auto_malloc(16384 * sizeof(UINT16));  /* Shared with 68000 */
396   cpustate->sram = (UINT16 *)auto_malloc(2048 * sizeof(UINT16));   /* Private */
366397
367398   cpustate->device = device;
368399   cpustate->lindevice = cputag_get_cpu(device->machine, rotconfig->lin_cpu_tag);
r4425r4426
374405
375406static CPU_RESET( cquestrot )
376407{
377   cquestrot_state *cpustate = device->token;
408   cquestrot_state *cpustate = get_safe_token_rot(device);
378409   cpustate->pc = 0;
379410   cpustate->wc = 0;
380411   cpustate->prev_dred = 1;
r4425r4426
402433
403434static void cquestlin_state_register(const device_config *device)
404435{
405   cquestlin_state *cpustate = device->token;
436   cquestlin_state *cpustate = get_safe_token_lin(device);
406437
407438   state_save_register_device_item_array(device, 0, cpustate->ram);
408439   state_save_register_device_item(device, 0, cpustate->q);
r4425r4426
439470
440471static CPU_INIT( cquestlin )
441472{
442   const cubeqst_lin_config *linconfig = device->static_config;
443   cquestlin_state *cpustate = device->token;
473   const cubeqst_lin_config *linconfig = (const cubeqst_lin_config *)device->static_config;
474   cquestlin_state *cpustate = get_safe_token_lin(device);
444475   memset(cpustate, 0, sizeof(*cpustate));
445476
446477   /* Allocate RAM */
447   cpustate->sram = auto_malloc(4096 * sizeof(UINT16));      /* Shared with rotate CPU */
448   cpustate->ptr_ram = auto_malloc(1024);                    /* Pointer RAM */
449   cpustate->e_stack = auto_malloc(32768 * sizeof(UINT32));  /* Stack DRAM: 32kx20 */
450   cpustate->o_stack = auto_malloc(32768 * sizeof(UINT32));  /* Stack DRAM: 32kx20 */
478   cpustate->sram = (UINT16 *)auto_malloc(4096 * sizeof(UINT16));      /* Shared with rotate CPU */
479   cpustate->ptr_ram = (UINT8 *)auto_malloc(1024);                    /* Pointer RAM */
480   cpustate->e_stack = (UINT32 *)auto_malloc(32768 * sizeof(UINT32));  /* Stack DRAM: 32kx20 */
481   cpustate->o_stack = (UINT32 *)auto_malloc(32768 * sizeof(UINT32));  /* Stack DRAM: 32kx20 */
451482
452483   cpustate->device = device;
453484   cpustate->rotdevice = cputag_get_cpu(device->machine, linconfig->rot_cpu_tag);
r4425r4426
459490
460491static CPU_RESET( cquestlin )
461492{
462   cquestlin_state *cpustate = device->token;
493   cquestlin_state *cpustate = get_safe_token_lin(device);
463494   cpustate->clkcnt = 0;
464495   cpustate->pc[FOREGROUND] = 0;
465496   cpustate->pc[BACKGROUND] = 0x80;
r4425r4426
502533
503534static CPU_EXECUTE( cquestsnd )
504535{
505   cquestsnd_state *cpustate = device->token;
536   cquestsnd_state *cpustate = get_safe_token_snd(device);
506537   int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
507538
508539   cpustate->icount = cycles;
r4425r4426
837868
838869static CPU_EXECUTE( cquestrot )
839870{
840   cquestrot_state *cpustate = device->token;
841   cquestlin_state *lincpustate = cpustate->lindevice->token;
871   cquestrot_state *cpustate = get_safe_token_rot(device);
872   cquestlin_state *lincpustate = get_safe_token_lin(cpustate->lindevice);
842873   int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
843874
844875   cpustate->icount = cycles;
r4425r4426
13181349
13191350void cubeqcpu_swap_line_banks(const device_config *device)
13201351{
1321   cquestlin_state *cpustate = device->token;
1352   cquestlin_state *cpustate = get_safe_token_lin(device);
13221353   cpustate->field = cpustate->field ^ 1;
13231354}
13241355
13251356
13261357void cubeqcpu_clear_stack(const device_config *device)
13271358{
1328   cquestlin_state *cpustate = device->token;
1359   cquestlin_state *cpustate = get_safe_token_lin(device);
13291360   memset(&cpustate->ptr_ram[cpustate->field * 256], 0, 256);
13301361}
13311362
13321363UINT8 cubeqcpu_get_ptr_ram_val(const device_config *device, int i)
13331364{
1334   cquestlin_state *cpustate = device->token;
1365   cquestlin_state *cpustate = get_safe_token_lin(device);
13351366   return cpustate->ptr_ram[(VISIBLE_FIELD * 256) + i];
13361367}
13371368
13381369UINT32* cubeqcpu_get_stack_ram(const device_config *device)
13391370{
1340   cquestlin_state *cpustate = device->token;
1371   cquestlin_state *cpustate = get_safe_token_lin(device);
13411372   if (VISIBLE_FIELD == ODD_FIELD)
13421373      return cpustate->o_stack;
13431374   else
r4425r4426
13491380{
13501381#define LINE_PC ((cpustate->pc[prog] & 0x7f) | ((prog == BACKGROUND) ? 0x80 : 0))
13511382
1352   cquestlin_state *cpustate = device->token;
1353   cquestrot_state *rotcpustate = cpustate->rotdevice->token;
1383   cquestlin_state *cpustate = get_safe_token_lin(device);
1384   cquestrot_state *rotcpustate = get_safe_token_rot(cpustate->rotdevice);
13541385   int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
13551386   UINT32   *stack_ram;
13561387   UINT8   *ptr_ram;
r4425r4426
18151846
18161847static CPU_SET_INFO( cquestsnd )
18171848{
1818   cquestsnd_state *cpustate = device->token;
1849   cquestsnd_state *cpustate = get_safe_token_snd(device);
18191850   switch (state)
18201851   {
18211852      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
18511882
18521883CPU_GET_INFO( cquestsnd )
18531884{
1854   cquestsnd_state *cpustate = (device != NULL) ? device->token : NULL;
1885   cquestsnd_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token_snd(device) : NULL;
18551886   switch (state)
18561887   {
18571888      /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
19281959
19291960static CPU_SET_INFO( cquestrot )
19301961{
1931   cquestrot_state *cpustate = device->token;
1962   cquestrot_state *cpustate = get_safe_token_rot(device);
19321963   switch (state)
19331964   {
19341965      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
19692000
19702001CPU_GET_INFO( cquestrot )
19712002{
1972   cquestrot_state *cpustate = (device != NULL) ? device->token : NULL;
2003   cquestrot_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token_rot(device) : NULL;
19732004   switch (state)
19742005   {
19752006      /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
20532084
20542085static CPU_SET_INFO( cquestlin )
20552086{
2056   cquestlin_state *cpustate = device->token;
2087   cquestlin_state *cpustate = get_safe_token_lin(device);
20572088   switch (state)
20582089   {
20592090      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
20872118
20882119CPU_GET_INFO( cquestlin )
20892120{
2090   cquestlin_state *cpustate = (device != NULL) ? device->token : NULL;
2121   cquestlin_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token_lin(device) : NULL;
20912122   switch (state)
20922123   {
20932124      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/drcuml.c
r4425r4426
545545   int opnum;
546546
547547   /* allocate state */
548   drcuml = drccache_memory_alloc(cache, sizeof(*drcuml));
548   drcuml = (drcuml_state *)drccache_memory_alloc(cache, sizeof(*drcuml));
549549   if (drcuml == NULL)
550550      return NULL;
551551   memset(drcuml, 0, sizeof(*drcuml));
r4425r4426
686686   if (bestblock == NULL)
687687   {
688688      /* allocate the block structure itself */
689      bestblock = malloc(sizeof(*bestblock));
689      bestblock = (drcuml_block *)malloc(sizeof(*bestblock));
690690      if (bestblock == NULL)
691691         fatalerror("Out of memory allocating block in drcuml_block_begin");
692692      memset(bestblock, 0, sizeof(*bestblock));
r4425r4426
695695      bestblock->drcuml = drcuml;
696696      bestblock->next = drcuml->blocklist;
697697      bestblock->maxinst = maxinst * 3 / 2;
698      bestblock->inst = malloc(sizeof(drcuml_instruction) * bestblock->maxinst);
698      bestblock->inst = (drcuml_instruction *)malloc(sizeof(drcuml_instruction) * bestblock->maxinst);
699699      if (bestblock->inst == NULL)
700700         fatalerror("Out of memory allocating instruction array in drcuml_block_begin");
701701
r4425r4426
728728      fatalerror("Overran maxinst in drcuml_block_append");
729729
730730   /* fill in the instruction */
731   inst->opcode = (UINT8)op;
731   inst->opcode = (drcuml_opcode)(UINT8)op;
732732   inst->size = size;
733733   inst->condition = condition;
734734   inst->flags = 0;
r4425r4426
755755      fatalerror("Overran maxinst in drcuml_block_append");
756756
757757   /* fill in the instruction */
758   inst->opcode = (UINT8)op;
758   inst->opcode = (drcuml_opcode)(UINT8)op;
759759   inst->size = size;
760760   inst->condition = condition;
761761   inst->flags = 0;
r4425r4426
784784      fatalerror("Overran maxinst in drcuml_block_append");
785785
786786   /* fill in the instruction */
787   inst->opcode = (UINT8)op;
787   inst->opcode = (drcuml_opcode)(UINT8)op;
788788   inst->size = size;
789789   inst->condition = condition;
790790   inst->flags = 0;
r4425r4426
815815      fatalerror("Overran maxinst in drcuml_block_append");
816816
817817   /* fill in the instruction */
818   inst->opcode = (UINT8)op;
818   inst->opcode = (drcuml_opcode)(UINT8)op;
819819   inst->size = size;
820820   inst->condition = condition;
821821   inst->flags = 0;
r4425r4426
848848      fatalerror("Overran maxinst in drcuml_block_append");
849849
850850   /* fill in the instruction */
851   inst->opcode = (UINT8)op;
851   inst->opcode = (drcuml_opcode)(UINT8)op;
852852   inst->size = size;
853853   inst->condition = condition;
854854   inst->flags = 0;
r4425r4426
952952   char *string;
953953
954954   /* allocate space for a copy of the string */
955   string = drccache_memory_alloc(drcuml->cache, strlen(name) + 1);
955   string = (char *)drccache_memory_alloc(drcuml->cache, strlen(name) + 1);
956956   if (string == NULL)
957957      return NULL;
958958   strcpy(string, name);
959959
960960   /* allocate a new handle info */
961   handle = drccache_memory_alloc_near(drcuml->cache, sizeof(*handle));
961   handle = (drcuml_codehandle *)drccache_memory_alloc_near(drcuml->cache, sizeof(*handle));
962962   if (handle == NULL)
963963   {
964964      drccache_memory_free(drcuml->cache, string, strlen(name) + 1);
r4425r4426
10361036   drcuml_symbol *symbol;
10371037
10381038   /* allocate memory to hold the symbol */
1039   symbol = malloc(sizeof(*symbol) + strlen(name));
1039   symbol = (drcuml_symbol *)malloc(sizeof(*symbol) + strlen(name));
10401040   if (symbol == NULL)
10411041      fatalerror("Out of memory allocating symbol in drcuml_symbol_add");
10421042
r4425r4426
10601060
10611061const char *drcuml_symbol_find(drcuml_state *drcuml, void *base, UINT32 *offset)
10621062{
1063   drccodeptr search = base;
1063   drccodeptr search = (drccodeptr)base;
10641064   drcuml_symbol *symbol;
10651065
10661066   /* simple linear search */
r4425r4426
11211121   va_end(va);
11221122
11231123   /* allocate space in the cache to hold the comment */
1124   comment = drccache_memory_alloc_temporary(block->drcuml->cache, strlen(buffer) + 1);
1124   comment = (char *)drccache_memory_alloc_temporary(block->drcuml->cache, strlen(buffer) + 1);
11251125   if (comment == NULL)
11261126      return;
11271127   strcpy(comment, buffer);
r4425r4426
21772177   int numparams;
21782178
21792179   /* allocate memory for parameters */
2180   parammem = drccache_memory_alloc_near(drcuml->cache, sizeof(UINT64) * (ARRAY_LENGTH(test->param) + 1));
2180   parammem = (UINT64 *)drccache_memory_alloc_near(drcuml->cache, sizeof(UINT64) * (ARRAY_LENGTH(test->param) + 1));
21812181
21822182   /* flush the cache */
21832183   drcuml_reset(drcuml);
src/emu/cpu/upd7810/7810dasm.c
r4425r4426
53695369   UINT32 flags = 0;
53705370
53715371   t = dasmXX[op].token;
5372   a = dasmXX[op].args;
5372   a = (const char *)dasmXX[op].args;
53735373
53745374   /* 0 token means prefix opcode (use table from args) */
53755375   if (0 == t)
r4425r4426
53785378
53795379      op2 = oprom[idx++];
53805380      t = p_dasm[op2].token;
5381      a = p_dasm[op2].args;
5381      a = (const char *)p_dasm[op2].args;
53825382   }
53835383
53845384   buffer += sprintf(buffer, "%-8.8s", token[t]);
src/emu/cpu/upd7810/upd7810.c
r4425r4426
502502   int icount;
503503};
504504
505INLINE upd7810_state *get_safe_token(const device_config *device)
506{
507   assert(device != NULL);
508   assert(device->token != NULL);
509   assert(device->type == CPU);
510   assert(cpu_get_type(device) == CPU_UPD7810 ||
511         cpu_get_type(device) == CPU_UPD7807 ||
512         cpu_get_type(device) == CPU_UPD7801 ||
513         cpu_get_type(device) == CPU_UPD78C05 ||
514         cpu_get_type(device) == CPU_UPD78C06);
515   return (upd7810_state *)device->token;
516}
517
505518#define CY   0x01
506519#define F1   0x02
507520#define L0   0x04
r4425r4426
16211634
16221635static CPU_INIT( upd7810 )
16231636{
1624   upd7810_state *cpustate = device->token;
1637   upd7810_state *cpustate = get_safe_token(device);
16251638
16261639   cpustate->config = *(const UPD7810_CONFIG*) device->static_config;
16271640   cpustate->irq_callback = irqcallback;
r4425r4426
16981711
16991712static CPU_RESET( upd7810 )
17001713{
1701   upd7810_state *cpustate = device->token;
1714   upd7810_state *cpustate = get_safe_token(device);
17021715   UPD7810_CONFIG save_config;
17031716   cpu_irq_callback save_irqcallback;
17041717
r4425r4426
17431756
17441757static CPU_RESET( upd7807 )
17451758{
1746   upd7810_state *cpustate = device->token;
1759   upd7810_state *cpustate = get_safe_token(device);
17471760   CPU_RESET_CALL(upd7810);
17481761   cpustate->opXX = opXX_7807;
17491762}
17501763
17511764static CPU_RESET( upd7801 )
17521765{
1753   upd7810_state *cpustate = device->token;
1766   upd7810_state *cpustate = get_safe_token(device);
17541767   CPU_RESET_CALL(upd7810);
17551768   cpustate->op48 = op48_7801;
17561769   cpustate->op4C = op4C_7801;
r4425r4426
17641777
17651778static CPU_RESET( upd78c05 )
17661779{
1767   upd7810_state *cpustate = device->token;
1780   upd7810_state *cpustate = get_safe_token(device);
17681781   CPU_RESET_CALL(upd7810);
17691782   cpustate->op48 = op48_78c05;
17701783   cpustate->op4C = op4C_78c05;
r4425r4426
17841797
17851798static CPU_RESET( upd78c06 )
17861799{
1787   upd7810_state *cpustate = device->token;
1800   upd7810_state *cpustate = get_safe_token(device);
17881801   CPU_RESET_CALL(upd78c05);
17891802   cpustate->op48 = op48_78c06;
17901803   cpustate->op4C = op4C_78c06;
r4425r4426
18021815
18031816static CPU_EXECUTE( upd7810 )
18041817{
1805   upd7810_state *cpustate = device->token;
1818   upd7810_state *cpustate = get_safe_token(device);
18061819   cpustate->icount = cycles;
18071820
18081821   do
r4425r4426
19271940
19281941static CPU_SET_INFO( upd7810 )
19291942{
1930   upd7810_state *cpustate = device->token;
1943   upd7810_state *cpustate = get_safe_token(device);
19311944   switch (state)
19321945   {
19331946      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
20012014
20022015CPU_GET_INFO( upd7810 )
20032016{
2004   upd7810_state *cpustate = (device != NULL) ? device->token : NULL;
2017   upd7810_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
20052018   switch (state)
20062019   {
20072020      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/x86log.c
r4425r4426
4242
4343
4444/* data ranges */
45typedef struct _data_range data_range;
46struct _data_range
45typedef struct _data_range_t data_range_t;
46struct _data_range_t
4747{
4848   x86code *      base;
4949   x86code *      end;
r4425r4426
5757   astring *      filename;                  /* name of the file */
5858   FILE *         file;                     /* file we are logging to */
5959
60   data_range       data_range[MAX_DATA_RANGES];   /* list of data ranges */
60   data_range_t   data_range[MAX_DATA_RANGES];   /* list of data ranges */
6161   int            data_range_count;            /* number of data ranges */
6262
6363   log_comment    comment_list[MAX_COMMENTS];      /* list of comments */
r4425r4426
9191   x86log_context *log;
9292
9393   /* allocate the log */
94   log = malloc_or_die(sizeof(*log));
94   log = (x86log_context *)malloc_or_die(sizeof(*log));
9595   memset(log, 0, sizeof(*log));
9696
9797   /* allocate the filename */
r4425r4426
161161
162162void x86log_mark_as_data(x86log_context *log, x86code *base, x86code *end, int size)
163163{
164   data_range *data;
164   data_range_t *data;
165165
166166   assert(log->data_range_count < MAX_DATA_RANGES);
167167   assert(end >= base);
r4425r4426
191191{
192192   const log_comment *lastcomment = &log->comment_list[log->comment_count];
193193   const log_comment *curcomment = &log->comment_list[0];
194   const data_range *lastdata = &log->data_range[log->data_range_count];
195   const data_range *curdata = &log->data_range[0];
194   const data_range_t *lastdata = &log->data_range[log->data_range_count];
195   const data_range_t *curdata = &log->data_range[0];
196196   x86code *cur = start;
197197
198198   /* print the optional label */
src/emu/cpu/sc61860/sc61860.c
r4425r4426
5959    int icount;
6060};
6161
62INLINE sc61860_state *get_safe_token(const device_config *device)
63{
64   assert(device != NULL);
65   assert(device->token != NULL);
66   assert(device->type == CPU);
67   assert(cpu_get_type(device) == CPU_SC61860);
68   return (sc61860_state *)device->token;
69}
70
6271UINT8 *sc61860_internal_ram(const device_config *device)
6372{
64   sc61860_state *cpustate = device->token;
73   sc61860_state *cpustate = get_safe_token(device);
6574   return cpustate->ram;
6675}
6776
6877static TIMER_CALLBACK(sc61860_2ms_tick)
6978{
70   sc61860_state *cpustate = ptr;
79   sc61860_state *cpustate = (sc61860_state *)ptr;
7180   if (--cpustate->timer.count == 0)
7281   {
7382      cpustate->timer.count = 128;
r4425r4426
8493
8594static CPU_RESET( sc61860 )
8695{
87   sc61860_state *cpustate = device->token;
96   sc61860_state *cpustate = get_safe_token(device);
8897   cpustate->timer.t2ms=0;
8998   cpustate->timer.t512ms=0;
9099   cpustate->timer.count=256;
r4425r4426
93102
94103static CPU_INIT( sc61860 )
95104{
96   sc61860_state *cpustate = device->token;
105   sc61860_state *cpustate = get_safe_token(device);
97106   cpustate->config = (sc61860_cpu_core *) device->static_config;
98107   timer_pulse(device->machine, ATTOTIME_IN_HZ(500), cpustate, 0, sc61860_2ms_tick);
99108   cpustate->device = device;
r4425r4426
102111
103112static CPU_EXECUTE( sc61860 )
104113{
105   sc61860_state *cpustate = device->token;
114   sc61860_state *cpustate = get_safe_token(device);
106115
107116   cpustate->icount = cycles;
108117
r4425r4426
140149
141150static CPU_SET_INFO( sc61860 )
142151{
143   sc61860_state *cpustate = device->token;
152   sc61860_state *cpustate = get_safe_token(device);
144153   switch (state)
145154   {
146155
r4425r4426
164173
165174CPU_GET_INFO( sc61860 )
166175{
167   sc61860_state *cpustate = (device != NULL) ? device->token : NULL;
176   sc61860_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
168177   switch (state)
169178   {
170179      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/v60/v60.c
r4425r4426
110110   UINT8             moddim;
111111};
112112
113INLINE v60_state *get_safe_token(const device_config *device)
114{
115   assert(device != NULL);
116   assert(device->token != NULL);
117   assert(device->type == CPU);
118   assert(cpu_get_type(device) == CPU_V60 ||
119         cpu_get_type(device) == CPU_V70);
120   return (v60_state *)device->token;
121}
122
113123/*
114124 * Prevent warnings on NetBSD.  All identifiers beginning with an underscore
115125 * followed by an uppercase letter are reserved by the C standard (ISO / IEC
r4425r4426
324334
325335static void base_init(const device_config *device, cpu_irq_callback irqcallback)
326336{
327   v60_state *cpustate = device->token;
337   v60_state *cpustate = get_safe_token(device);
328338
329339   cpustate->stall_io = 0;
330340   cpustate->irq_cb = irqcallback;
r4425r4426
344354
345355static CPU_INIT( v60 )
346356{
347   v60_state *cpustate = device->token;
357   v60_state *cpustate = get_safe_token(device);
348358
349359   base_init(device, irqcallback);
350360   // Set cpustate->PIR (Processor ID) for NEC cpustate-> LSB is reserved to NEC,
r4425r4426
358368
359369static CPU_INIT( v70 )
360370{
361   v60_state *cpustate = device->token;
371   v60_state *cpustate = get_safe_token(device);
362372
363373   base_init(device, irqcallback);
364374   // Set cpustate->PIR (Processor ID) for NEC v70. LSB is reserved to NEC,
r4425r4426
372382
373383static CPU_RESET( v60 )
374384{
375   v60_state *cpustate = device->token;
385   v60_state *cpustate = get_safe_token(device);
376386
377387   cpustate->PSW   = 0x10000000;
378388   cpustate->PC   = cpustate->info.start_pc;
r4425r4426
393403
394404void v60_stall(const device_config *device)
395405{
396   v60_state *cpustate = device->token;
406   v60_state *cpustate = get_safe_token(device);
397407   cpustate->stall_io = 1;
398408}
399409
r4425r4426
450460
451461static CPU_EXECUTE( v60 )
452462{
453   v60_state *cpustate = device->token;
463   v60_state *cpustate = get_safe_token(device);
454464
455465   cpustate->icount = cycles;
456466   if (cpustate->irq_line != CLEAR_LINE)
r4425r4426
482492
483493static CPU_SET_INFO( v60 )
484494{
485   v60_state *cpustate = device->token;
495   v60_state *cpustate = get_safe_token(device);
486496
487497   switch (state)
488498   {
r4425r4426
562572
563573CPU_GET_INFO( v60 )
564574{
565   v60_state *cpustate = (device != NULL) ? device->token : NULL;
575   v60_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
566576
567577   switch (state)
568578   {
src/emu/cpu/drcuml.h
r4425r4426
4242   DRCUML_PTYPE_MAX
4343};
4444typedef enum _drcuml_ptype drcuml_ptype;
45DECLARE_ENUM_OPERATORS(drcuml_ptype)
4546
4647
4748/* these define the registers for the UML */
src/emu/cpu/dsp56k/dsp56mem.c
r4425r4426
612612/* They represent the host side of the dsp56k's host interface */
613613void dsp56k_host_interface_write(device_config* device, UINT8 offset, UINT8 data)
614614{
615   dsp56k_core* cpustate = device->token;
615   dsp56k_core* cpustate = get_safe_token(device);
616616
617617   /* Not exactly correct since the bootstrap hack doesn't need this to be true */
618618   /*
r4425r4426
708708
709709UINT8 dsp56k_host_interface_read(device_config* device, UINT8 offset)
710710{
711   dsp56k_core* cpustate = device->token;
711   dsp56k_core* cpustate = get_safe_token(device);
712712
713713   /* Not exactly correct since the bootstrap hack doesn't need this to be true */
714714   /*
r4425r4426
936936/* MISC*/
937937UINT16 dsp56k_get_peripheral_memory(device_config* device, UINT16 addr)
938938{
939   // TODO // THIS COMES BACK dsp56k_core* cpustate = device->token;
939   // TODO // THIS COMES BACK dsp56k_core* cpustate = get_safe_token(device);
940940   return dsp56k_peripheral_ram[A2O(addr)];
941941}
src/emu/cpu/dsp56k/dsp56ops.c
r4425r4426
18741874      if (absS &  U64(0x0000000080000000))
18751875         absS |= U64(0xffffffff80000000);
18761876   }
1877   absS = abs(absS);
1877   absS = (absS < 0) ? -absS : absS;
18781878
18791879   /* Sign extend and get absolute value of the destination */
18801880   if (D.addr == &A || D.addr == &B)
r4425r4426
18891889      if (absS &  U64(0x0000000080000000))
18901890         absS |= U64(0xffffffff80000000);
18911891   }
1892   absD = abs(absD);
1892   absD = (absD < 0) ? -absD : absD;
18931893
18941894   /* Compare */
18951895   absResult = absD - absS;
src/emu/cpu/dsp56k/dsp56def.h
r4425r4426
393393/* Port C Dtaa Register (PCD) */
394394static void PCD_set(dsp56k_core* cpustate, UINT16 value);
395395
396
397INLINE dsp56k_core *get_safe_token(const device_config *device)
398{
399   assert(device != NULL);
400   assert(device->token != NULL);
401   assert(device->type == CPU);
402   assert(cpu_get_type(device) == CPU_DSP56156);
403   return (dsp56k_core *)device->token;
404}
src/emu/cpu/dsp56k/dsp56k.c
r4425r4426
7474{
7575   if (address >= (0x0000<<1) && address <= (0x07ff<<1))
7676   {
77      direct->raw = direct->decrypted = (void*)(dsp56k_program_ram - (0x0000<<1));
77      direct->raw = direct->decrypted = (UINT8 *)(dsp56k_program_ram - (0x0000<<1));
7878      return ~0;
7979   }
8080
r4425r4426
166166***************************************************************************/
167167static CPU_INIT( dsp56k )
168168{
169   dsp56k_core* cpustate = device->token;
169   dsp56k_core* cpustate = get_safe_token(device);
170170
171171   // Call specific module inits
172172   pcu_init(cpustate);
r4425r4426
228228
229229static CPU_RESET( dsp56k )
230230{
231   dsp56k_core* cpustate = device->token;
231   dsp56k_core* cpustate = get_safe_token(device);
232232   logerror("Dsp56k reset\n");
233233
234234   cpustate->interrupt_cycles = 0;
r4425r4426
266266
267267static CPU_EXECUTE( dsp56k )
268268{
269   dsp56k_core* cpustate = device->token;
269   dsp56k_core* cpustate = get_safe_token(device);
270270
271271   /* If reset line is asserted, do nothing */
272272   if (cpustate->reset_state)
r4425r4426
320320
321321static CPU_SET_INFO( dsp56k )
322322{
323   dsp56k_core* cpustate = device->token;
323   dsp56k_core* cpustate = get_safe_token(device);
324324
325325   switch (state)
326326   {
r4425r4426
388388
389389CPU_GET_INFO( dsp56k )
390390{
391   dsp56k_core* cpustate = (device != NULL) ? device->token : NULL;
391   dsp56k_core* cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
392392
393393   switch (state)
394394   {
src/emu/cpu/spc700/spc700.c
r4425r4426
9797   int spc_int32;
9898} spc700i_cpu;
9999
100INLINE spc700i_cpu *get_safe_token(const device_config *device)
101{
102   assert(device != NULL);
103   assert(device->token != NULL);
104   assert(device->type == CPU);
105   assert(cpu_get_type(device) == CPU_SPC700);
106   return (spc700i_cpu *)device->token;
107}
108
100109/* ======================================================================== */
101110/* ==================== ARCHITECTURE-DEPENDANT DEFINES ==================== */
102111/* ======================================================================== */
r4425r4426
12391248
12401249static CPU_INIT( spc700 )
12411250{
1242   spc700i_cpu *cpustate = device->token;
1251   spc700i_cpu *cpustate = get_safe_token(device);
12431252
12441253   INT_ACK = irqcallback;
12451254   cpustate->device = device;
r4425r4426
12491258
12501259static CPU_RESET( spc700 )
12511260{
1252   spc700i_cpu *cpustate = device->token;
1261   spc700i_cpu *cpustate = get_safe_token(device);
12531262
12541263   CPU_STOPPED = 0;
12551264#if !SPC700_OPTIMIZE_SNES
r4425r4426
13071316/* Execute instructions for <clocks> cycles */
13081317static CPU_EXECUTE( spc700 )
13091318{
1310   spc700i_cpu *cpustate = device->token;
1319   spc700i_cpu *cpustate = get_safe_token(device);
13111320
13121321   CLOCKS = CPU_STOPPED ? 0 : cycles;
13131322   while(CLOCKS > 0)
r4425r4426
15861595
15871596static CPU_SET_INFO( spc700 )
15881597{
1589   spc700i_cpu *cpustate = device->token;
1598   spc700i_cpu *cpustate = get_safe_token(device);
15901599
15911600   switch (state)
15921601   {
r4425r4426
16131622
16141623CPU_GET_INFO( spc700 )
16151624{
1616   spc700i_cpu *cpustate = (device != NULL) ? device->token : NULL;
1625   spc700i_cpu *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
16171626   uint p = 0;
16181627
16191628   if (cpustate != NULL)
src/emu/cpu/hd6309/hd6309.c
r4425r4426
150150   UINT8 const *index_cycle;
151151};
152152
153INLINE m68_state_t *get_safe_token(const device_config *device)
154{
155   assert(device != NULL);
156   assert(device->token != NULL);
157   assert(device->type == CPU);
158   assert(cpu_get_type(device) == CPU_HD6309);
159   return (m68_state_t *)device->token;
160}
161
153162static void check_irq_lines( m68_state_t *m68_state );
154163static void IIError(m68_state_t *m68_state);
155164static void DZError(m68_state_t *m68_state);
r4425r4426
496505
497506static STATE_POSTLOAD( hd6309_postload )
498507{
499   const device_config *device = param;
500   m68_state_t *m68_state = device->token;
508   const device_config *device = (const device_config *)param;
509   m68_state_t *m68_state = get_safe_token(device);
501510
502511   UpdateState(m68_state);
503512}
r4425r4426
508517/****************************************************************************/
509518static CPU_INIT( hd6309 )
510519{
511   m68_state_t *m68_state = device->token;
520   m68_state_t *m68_state = get_safe_token(device);
512521
513522   m68_state->irq_callback = irqcallback;
514523   m68_state->device = device;
r4425r4426
543552/****************************************************************************/
544553static CPU_RESET( hd6309 )
545554{
546   m68_state_t *m68_state = device->token;
555   m68_state_t *m68_state = get_safe_token(device);
547556
548557   m68_state->int_state = 0;
549558   m68_state->nmi_state = CLEAR_LINE;
r4425r4426
627636/* execute instructions on this CPU until icount expires */
628637static CPU_EXECUTE( hd6309 )   /* NS 970908 */
629638{
630   m68_state_t *m68_state = device->token;
639   m68_state_t *m68_state = get_safe_token(device);
631640
632641   m68_state->icount = cycles - m68_state->extra_cycles;
633642   m68_state->extra_cycles = 0;
r4425r4426
12141223
12151224static CPU_SET_INFO( hd6309 )
12161225{
1217   m68_state_t *m68_state = device->token;
1226   m68_state_t *m68_state = get_safe_token(device);
12181227
12191228   switch (state)
12201229   {
r4425r4426
12491258
12501259CPU_GET_INFO( hd6309 )
12511260{
1252   m68_state_t *m68_state = (device != NULL) ? device->token : NULL;
1261   m68_state_t *m68_state = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
12531262
12541263   switch (state)
12551264   {
src/emu/cpu/ssp1601/ssp1601.c
r4425r4426
5555   const address_space *io;
5656};
5757
58INLINE ssp1601_state_t *get_safe_token(const device_config *device)
59{
60   assert(device != NULL);
61   assert(device->token != NULL);
62   assert(device->type == CPU);
63   assert(cpu_get_type(device) == CPU_SSP1601);
64   return (ssp1601_state_t *)device->token;
65}
5866
5967
6068
r4425r4426
502510
503511static CPU_INIT( ssp1601 )
504512{
505   ssp1601_state_t *ssp1601_state = device->token;
513   ssp1601_state_t *ssp1601_state = get_safe_token(device);
506514
507515   state_save_register_device_item(device, 0, rX);
508516   state_save_register_device_item(device, 0, rY);
r4425r4426
532540
533541static CPU_RESET( ssp1601 )
534542{
535   ssp1601_state_t *ssp1601_state = device->token;
543   ssp1601_state_t *ssp1601_state = get_safe_token(device);
536544
537545   rPC = 0x400;
538546   rSTACK = 0; // ? using ascending stack
r4425r4426
542550
543551static CPU_EXECUTE( ssp1601 )
544552{
545   ssp1601_state_t *ssp1601_state = device->token;
553   ssp1601_state_t *ssp1601_state = get_safe_token(device);
546554
547555   ssp1601_state->g_cycles = cycles;
548556
r4425r4426
758766
759767static CPU_DISASSEMBLE( ssp1601 )
760768{
761   //ssp1601_state_t *ssp1601_state = device->token;
769   //ssp1601_state_t *ssp1601_state = get_safe_token(device);
762770
763771   return dasm_ssp1601(buffer, pc, oprom);
764772}
r4425r4426
767775
768776static CPU_SET_INFO( ssp1601 )
769777{
770   ssp1601_state_t *ssp1601_state = device->token;
778   ssp1601_state_t *ssp1601_state = get_safe_token(device);
771779
772780   switch (state)
773781   {
r4425r4426
808816
809817CPU_GET_INFO( ssp1601 )
810818{
811   ssp1601_state_t *ssp1601_state = (device != NULL) ? device->token : NULL;
819   ssp1601_state_t *ssp1601_state = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
812820
813821   switch (state)
814822   {
src/emu/cpu/tlcs90/tlcs90.c
r4425r4426
1010#include "cpuexec.h"
1111#include "tlcs90.h"
1212
13typedef enum               {   UNKNOWN,   NOP,   EX,      EXX,   LD,      LDW,   LDA,   LDI,   LDIR,   LDD,   LDDR,   CPI,   CPIR,   CPD,   CPDR,   PUSH,   POP,   JP,      JR,      CALL,   CALLR,      RET,   RETI,   HALT,   DI,      EI,      SWI,   DAA,   CPL,   NEG,   LDAR,   RCF,   SCF,   CCF,   TSET,   BIT,   SET,   RES,   INC,   DEC,   INCX,   DECX,   INCW,   DECW,   ADD,   ADC,   SUB,   SBC,   AND,   XOR,   OR,      CP,      RLC,   RRC,   RL,      RR,      SLA,   SRA,   SLL,   SRL,   RLD,   RRD,   DJNZ,   MUL,   DIV      }   e_op;
13typedef enum               {   UNKNOWN,   NOP,   EX,      EXX,   LD,      LDW,   LDA,   LDI,   LDIR,   LDD,   LDDR,   CPI,   CPIR,   CPD,   CPDR,   PUSH,   POP,   JP,      JR,      CALL,   CALLR,      RET,   RETI,   HALT,   DI,      EI,      SWI,   DAA,   CPL,   NEG,   LDAR,   RCF,   SCF,   CCF,   TSET,   BIT,   SET,   RES,   INC,   DEC,   INCX,   DECX,   INCW,   DECW,   ADD,   ADC,   SUB,   SBC,   AND,   XOR,   OR,      CP,      RLC,   RRC,   RL,      RR,      SLA,   SRA,   SLL,   SRL,   RLD,   RRD,   DJNZ,   MUL,   DIV      }   _e_op;
14typedef UINT8 e_op;
1415static const char *const op_names[] =   {   "??",      "nop",   "ex",   "exx",   "ld",   "ldw",   "lda",   "ldi",   "ldir",   "ldd",   "lddr",   "cpi",   "cpir",   "cpd",   "cpdr",   "push",   "pop",   "jp",   "jr",   "call",   "callr",   "ret",   "reti",   "halt",   "di",   "ei",   "swi",   "daa",   "cpl",   "neg",   "ldar",   "rcf",   "scf",   "ccf",   "tset",   "bit",   "set",   "res",   "inc",   "dec",   "incx",   "decx",   "incw",   "decw",   "add",   "adc",   "sub",   "sbc",   "and",   "xor",   "or",   "cp",   "rlc",   "rrc",   "rl",   "rr",   "sla",   "sra",   "sll",   "srl",   "rld",   "rrd",   "djnz",   "mul",   "div"   };
1516
1617typedef enum   {
r4425r4426
5960
6061}   t90_Regs;
6162
63INLINE t90_Regs *get_safe_token(const device_config *device)
64{
65   assert(device != NULL);
66   assert(device->token != NULL);
67   assert(device->type == CPU);
68   assert(cpu_get_type(device) == CPU_TMP90840 ||
69         cpu_get_type(device) == CPU_TMP90841 ||
70         cpu_get_type(device) == CPU_TMP91640 ||
71         cpu_get_type(device) == CPU_TMP91641);
72   return (t90_Regs *)device->token;
73}
74
6275enum   {
6376      T90_B,   T90_C,   T90_D,   T90_E,   T90_H,   T90_L,   T90_A,
6477      T90_BC,   T90_DE,   T90_HL,   T90_XX,   T90_IX,   T90_IY,   T90_SP,
r4425r4426
9971010
9981011CPU_DISASSEMBLE( t90 )
9991012{
1000   t90_Regs *cpustate = device->token;
1013   t90_Regs *cpustate = get_safe_token(device);
10011014   int len;
10021015
10031016   cpustate->addr = pc;
r4425r4426
12681281*************************************************************************************************************/
12691282
12701283typedef enum   {   INTSWI = 0,   INTNMI,   INTWD,   INT0,   INTT0,   INTT1,   INTT2,   INTT3,   INTT4,   INT1,   INTT5,   INT2,   INTRX,   INTTX,   INTMAX   }   e_irq;
1284DECLARE_ENUM_OPERATORS(e_irq)
12711285
12721286INLINE void leave_halt(t90_Regs *cpustate)
12731287{
r4425r4426
13261340
13271341static CPU_EXECUTE( t90 )
13281342{
1329   t90_Regs *cpustate = device->token;
1343   t90_Regs *cpustate = get_safe_token(device);
13301344   UINT8    a8,b8;
13311345   UINT16   a16,b16;
13321346   unsigned a32;
r4425r4426
19681982
19691983static CPU_RESET( t90 )
19701984{
1971   t90_Regs *cpustate = device->token;
1985   t90_Regs *cpustate = get_safe_token(device);
19721986   cpustate->irq_state = 0;
19731987   cpustate->irq_mask = 0;
19741988   cpustate->pc.d = 0x0000;
r4425r4426
19882002
19892003static CPU_BURN( t90 )
19902004{
1991   t90_Regs *cpustate = device->token;
2005   t90_Regs *cpustate = get_safe_token(device);
19922006   cpustate->icount -= 4 * ((cycles + 3) / 4);
19932007}
19942008
r4425r4426
22662280
22672281static READ8_HANDLER( t90_internal_registers_r )
22682282{
2269   t90_Regs *cpustate = space->cpu->token;
2283   t90_Regs *cpustate = get_safe_token(space->cpu);
22702284
22712285   #define RIO      memory_read_byte_8le( cpustate->io, T90_IOBASE+offset )
22722286
r4425r4426
23782392
23792393static TIMER_CALLBACK( t90_timer_callback )
23802394{
2381   t90_Regs *cpustate = ptr;
2395   t90_Regs *cpustate = (t90_Regs *)ptr;
23822396   int is16bit;
23832397   int i = param;
23842398
r4425r4426
24502464{
24512465//  logerror("CPU Timer 4 fired! value = %d\n", (unsigned)cpustate->timer_value[4]);
24522466
2453   t90_Regs *cpustate = ptr;
2467   t90_Regs *cpustate = (t90_Regs *)ptr;
24542468   cpustate->timer4_value++;
24552469
24562470   // Match
r4425r4426
24802494{
24812495   #define WIO      memory_write_byte_8le( cpustate->io, T90_IOBASE+offset, data )
24822496
2483   t90_Regs *cpustate = space->cpu->token;
2497   t90_Regs *cpustate = get_safe_token(space->cpu);
24842498   UINT8 out_mask;
24852499   UINT8 old = cpustate->internal_registers[offset];
24862500   switch ( T90_IOBASE + offset )
r4425r4426
26172631
26182632static CPU_INIT( t90 )
26192633{
2620   t90_Regs *cpustate = device->token;
2634   t90_Regs *cpustate = get_safe_token(device);
26212635   int i, p;
26222636
26232637//  state_save_register_device_item(device, 0, Z80.prvpc.w.l);
r4425r4426
26912705
26922706static CPU_SET_INFO( t90 )
26932707{
2694   t90_Regs *cpustate = device->token;
2708   t90_Regs *cpustate = get_safe_token(device);
26952709
26962710   switch (state)
26972711   {
r4425r4426
27242738
27252739CPU_GET_INFO( tmp90840 )
27262740{
2727   t90_Regs *cpustate = (device != NULL) ? device->token : NULL;
2741   t90_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
27282742
27292743   switch (state)
27302744   {
src/emu/cpu/s2650/s2650.c
r4425r4426
4646   const address_space *io;
4747};
4848
49INLINE s2650_regs *get_safe_token(const device_config *device)
50{
51   assert(device != NULL);
52   assert(device->token != NULL);
53   assert(device->type == CPU);
54   assert(cpu_get_type(device) == CPU_S2650);
55   return (s2650_regs *)device->token;
56}
57
4958/* condition code changes for a byte */
5059static const UINT8 ccc[0x200] = {
5160   0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
r4425r4426
759768
760769static CPU_INIT( s2650 )
761770{
762   s2650_regs *s2650c = device->token;
771   s2650_regs *s2650c = get_safe_token(device);
763772
764773   s2650c->irq_callback = irqcallback;
765774   s2650c->device = device;
r4425r4426
782791
783792static CPU_RESET( s2650 )
784793{
785   s2650_regs *s2650c = device->token;
794   s2650_regs *s2650c = get_safe_token(device);
786795
787796   s2650c->ppc = 0;
788797   s2650c->page = 0,
r4425r4426
851860
852861static CPU_EXECUTE( s2650 )
853862{
854   s2650_regs *s2650c = device->token;
863   s2650_regs *s2650c = get_safe_token(device);
855864
856865   s2650c->icount = cycles;
857866   do
r4425r4426
14701479
14711480static CPU_SET_INFO( s2650 )
14721481{
1473   s2650_regs *s2650c = device->token;
1482   s2650_regs *s2650c = get_safe_token(device);
14741483
14751484   switch (state)
14761485   {
r4425r4426
15071516
15081517CPU_GET_INFO( s2650 )
15091518{
1510   s2650_regs *s2650c = device ? device->token : NULL;
1519   s2650_regs *s2650c = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
15111520   switch (state)
15121521   {
15131522      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/cdp1802/cdp1802.c
r4425r4426
99#define CDP1802_CYCLES_DMA         8
1010#define CDP1802_CYCLES_INTERRUPT   8
1111
12typedef enum _cdp1802_cpu_state cdp1802_cpu_state;
1312enum _cdp1802_cpu_state
1413{
1514   CDP1802_STATE_0_FETCH,
r4425r4426
2019   CDP1802_STATE_2_DMA_OUT,
2120   CDP1802_STATE_3_INT
2221};
22typedef enum _cdp1802_cpu_state cdp1802_cpu_state;
2323
2424typedef struct _cdp1802_state cdp1802_state;
2525struct _cdp1802_state
r4425r4426
110110   state_array               /* array of entries */
111111};
112112
113INLINE cdp1802_state *get_safe_token(const device_config *device)
114{
115   assert(device != NULL);
116   assert(device->token != NULL);
117   assert(device->type == CPU);
118   assert(cpu_get_type(device) == CPU_CDP1802);
119   return (cdp1802_state *)device->token;
120}
121
113122#define OPCODE_R(addr)      memory_decrypted_read_byte(cpustate->program, addr)
114123#define RAM_R(addr)         memory_read_byte_8be(cpustate->program, addr)
115124#define RAM_W(addr, data)   memory_write_byte_8be(cpustate->program, addr, data)
r4425r4426
211220
212221static void cdp1802_sample_ef(const device_config *device)
213222{
214   cdp1802_state *cpustate = device->token;
223   cdp1802_state *cpustate = get_safe_token(device);
215224
216225   if (cpustate->intf->ef_r)
217226   {
r4425r4426
225234
226235static void cdp1802_output_state_code(const device_config *device)
227236{
228   cdp1802_state *cpustate = device->token;
237   cdp1802_state *cpustate = get_safe_token(device);
229238
230239   if (cpustate->intf->sc_w)
231240   {
r4425r4426
259268
260269static void cdp1802_run(const device_config *device)
261270{
262   cdp1802_state *cpustate = device->token;
271   cdp1802_state *cpustate = get_safe_token(device);
263272
264273   cdp1802_output_state_code(device);
265274
r4425r4426
872881
873882static CPU_EXECUTE( cdp1802 )
874883{
875   cdp1802_state *cpustate = device->token;
884   cdp1802_state *cpustate = get_safe_token(device);
876885
877886   cpustate->icount = cycles;
878887
r4425r4426
933942
934943static CPU_RESET( cdp1802 )
935944{
936   cdp1802_state *cpustate = device->token;
945   cdp1802_state *cpustate = get_safe_token(device);
937946
938947   cpustate->mode = CDP1802_MODE_RESET;
939948}
940949
941950static CPU_INIT( cdp1802 )
942951{
943   cdp1802_state *cpustate = device->token;
952   cdp1802_state *cpustate = get_safe_token(device);
944953   int i;
945954
946955   cpustate->intf = (cdp1802_interface *) device->static_config;
r4425r4426
10051014
10061015static CPU_IMPORT_STATE( cdp1802 )
10071016{
1008   cdp1802_state *cpustate = device->token;
1017   cdp1802_state *cpustate = get_safe_token(device);
10091018
10101019   switch (entry->index)
10111020   {
r4425r4426
10211030
10221031static CPU_EXPORT_STATE( cdp1802 )
10231032{
1024   cdp1802_state *cpustate = device->token;
1033   cdp1802_state *cpustate = get_safe_token(device);
10251034
10261035   switch (entry->index)
10271036   {
r4425r4426
10411050
10421051static CPU_SET_INFO( cdp1802 )
10431052{
1044   cdp1802_state *cpustate = device->token;
1053   cdp1802_state *cpustate = get_safe_token(device);
10451054
10461055   switch (state)
10471056   {
r4425r4426
10571066
10581067CPU_GET_INFO( cdp1802 )
10591068{
1060   cdp1802_state *cpustate = (device != NULL) ? device->token : NULL;
1069   cdp1802_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
10611070
10621071   switch (state)
10631072   {
src/emu/cpu/cdp1802/cdp1802.h
r4425r4426
3434   EF4 = 0x08
3535};
3636
37typedef enum _cdp1802_control_mode cdp1802_control_mode;
3837enum _cdp1802_control_mode
3938{
4039   CDP1802_MODE_LOAD,
r4425r4426
4241   CDP1802_MODE_PAUSE,
4342   CDP1802_MODE_RUN
4443};
44typedef enum _cdp1802_control_mode cdp1802_control_mode;
4545
46typedef enum _cdp1802_state_code cdp1802_state_code;
4746enum _cdp1802_state_code
4847{
4948   CDP1802_STATE_CODE_S0_FETCH,
r4425r4426
5150   CDP1802_STATE_CODE_S2_DMA,
5251   CDP1802_STATE_CODE_S3_INTERRUPT
5352};
53typedef enum _cdp1802_state_code cdp1802_state_code;
5454
5555enum
5656{
src/emu/cpu/se3208/se3208.c
r4425r4426
5757#define INST(a) static void a(se3208_state_t *se3208_state, UINT16 Opcode)
5858static _OP *OpTable=NULL;
5959
60INLINE se3208_state_t *get_safe_token(const device_config *device)
61{
62   assert(device != NULL);
63   assert(device->token != NULL);
64   assert(device->type == CPU);
65   assert(cpu_get_type(device) == CPU_SE3208);
66   return (se3208_state_t *)device->token;
67}
68
6069INLINE UINT32 read_dword_unaligned(const address_space *space, UINT32 address)
6170{
6271   if (address & 3)
r4425r4426
16961705{
16971706   int i;
16981707   if(!OpTable)
1699      OpTable=malloc_or_die(sizeof(_OP)*0x10000);
1708      OpTable=(_OP *)malloc_or_die(sizeof(_OP)*0x10000);
17001709   for(i=0;i<0x10000;++i)
17011710      OpTable[i]=DecodeOp(i);
17021711}
17031712
17041713static CPU_RESET( se3208 )
17051714{
1706   se3208_state_t *se3208_state = device->token;
1715   se3208_state_t *se3208_state = get_safe_token(device);
17071716
17081717   cpu_irq_callback save_irqcallback = se3208_state->irq_callback;
17091718   memset(se3208_state,0,sizeof(se3208_state_t));
r4425r4426
17461755
17471756static CPU_EXECUTE( se3208 )
17481757{
1749   se3208_state_t *se3208_state = device->token;
1758   se3208_state_t *se3208_state = get_safe_token(device);
17501759
17511760   se3208_state->icount=cycles;
17521761   do
r4425r4426
17761785
17771786static CPU_INIT( se3208 )
17781787{
1779   se3208_state_t *se3208_state = device->token;
1788   se3208_state_t *se3208_state = get_safe_token(device);
17801789
17811790   BuildTable();
17821791
r4425r4426
18031812
18041813static CPU_SET_INFO( se3208 )
18051814{
1806   se3208_state_t *se3208_state = device->token;
1815   se3208_state_t *se3208_state = get_safe_token(device);
18071816
18081817   switch (state)
18091818   {
r4425r4426
18311840
18321841CPU_GET_INFO( se3208 )
18331842{
1834   se3208_state_t *se3208_state = (device != NULL) ? device->token : NULL;
1843   se3208_state_t *se3208_state = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
18351844
18361845   switch (state)
18371846   {
src/emu/cpu/e132xs/32xsdasm.c
r4425r4426
514514               lim = op & 0xfff;
515515            }
516516
517            sprintf(buffer, "XM%x %s, %s, $%x", (UINT8)(float) pow(2, xcode), dest, source, lim);
517            sprintf(buffer, "XM%x %s, %s, $%x", (UINT8)(float) pow(2.0, xcode), dest, source, lim);
518518
519519         }
520520         else
521521         {
522            sprintf(buffer, "XX%x %s, %s, 0", (UINT8)(float) pow(2, (xcode - 4)), dest, source);
522            sprintf(buffer, "XX%x %s, %s, 0", (UINT8)(float) pow(2.0, (xcode - 4)), dest, source);
523523         }
524524
525525         break;
src/emu/cpu/e132xs/e132xs.c
r4425r4426
429429
430430#endif
431431
432INLINE hyperstone_state *get_safe_token(const device_config *device)
433{
434   assert(device != NULL);
435   assert(device->token != NULL);
436   assert(device->type == CPU);
437   assert(cpu_get_type(device) == CPU_E116T ||
438         cpu_get_type(device) == CPU_E116XT ||
439         cpu_get_type(device) == CPU_E116XS ||
440         cpu_get_type(device) == CPU_E116XSR ||
441         cpu_get_type(device) == CPU_E132N ||
442         cpu_get_type(device) == CPU_E132T ||
443         cpu_get_type(device) == CPU_E132XN ||
444         cpu_get_type(device) == CPU_E132XT ||
445         cpu_get_type(device) == CPU_E132XS ||
446         cpu_get_type(device) == CPU_E132XSR ||
447         cpu_get_type(device) == CPU_GMS30C2116 ||
448         cpu_get_type(device) == CPU_GMS30C2132 ||
449         cpu_get_type(device) == CPU_GMS30C2216 ||
450         cpu_get_type(device) == CPU_GMS30C2232);
451   return (hyperstone_state *)device->token;
452}
453
432454/* Return the entry point for a determinated trap */
433455static UINT32 get_trap_addr(hyperstone_state *cpustate, UINT8 trapno)
434456{
r4425r4426
631653
632654static TIMER_CALLBACK( e132xs_timer_callback )
633655{
634   const device_config *device = ptr;
635   hyperstone_state *cpustate = device->token;
656   const device_config *device = (const device_config *)ptr;
657   hyperstone_state *cpustate = get_safe_token(device);
636658   int update = param;
637659
638660   /* update the values if necessary */
r4425r4426
15231545
15241546static void hyperstone_init(const device_config *device, cpu_irq_callback irqcallback, int scale_mask)
15251547{
1526   hyperstone_state *cpustate = device->token;
1548   hyperstone_state *cpustate = get_safe_token(device);
15271549
15281550   state_save_register_device_item_array(device, 0, cpustate->global_regs);
15291551   state_save_register_device_item_array(device, 0, cpustate->local_regs);
r4425r4426
15461568#if (HAS_E116T || HAS_E116XT || HAS_E116XS || HAS_E116XSR || HAS_GMS30C2116 || HAS_GMS30C2216)
15471569static void e116_init(const device_config *device, cpu_irq_callback irqcallback, int scale_mask)
15481570{
1549   hyperstone_state *cpustate = device->token;
1571   hyperstone_state *cpustate = get_safe_token(device);
15501572   hyperstone_init(device, irqcallback, scale_mask);
15511573   cpustate->opcodexor = 0;
15521574}
r4425r4426
15971619#if (HAS_E132N || HAS_E132T || HAS_E132XN || HAS_E132XT || HAS_E132XS || HAS_E132XSR || HAS_GMS30C2132 || HAS_GMS30C2232)
15981620static void e132_init(const device_config *device, cpu_irq_callback irqcallback, int scale_mask)
15991621{
1600   hyperstone_state *cpustate = device->token;
1622   hyperstone_state *cpustate = get_safe_token(device);
16011623   hyperstone_init(device, irqcallback, scale_mask);
16021624   cpustate->opcodexor = WORD_XOR_BE(0);
16031625}
r4425r4426
16611683
16621684static CPU_RESET( hyperstone )
16631685{
1664   hyperstone_state *cpustate = device->token;
1686   hyperstone_state *cpustate = get_safe_token(device);
16651687
16661688   //TODO: Add different reset initializations for BCR, MCR, FCR, TPR
16671689
r4425r4426
17121734
17131735static CPU_DISASSEMBLE( hyperstone )
17141736{
1715   hyperstone_state *cpustate = device->token;
1737   hyperstone_state *cpustate = get_safe_token(device);
17161738   return dasm_hyperstone( buffer, pc, oprom, GET_H, GET_FP );
17171739}
17181740
r4425r4426
46834705
46844706static CPU_EXECUTE( hyperstone )
46854707{
4686   hyperstone_state *cpustate = device->token;
4708   hyperstone_state *cpustate = get_safe_token(device);
46874709
46884710   cpustate->icount = cycles;
46894711
r4425r4426
47334755
47344756static CPU_SET_INFO( hyperstone )
47354757{
4736   hyperstone_state *cpustate = device->token;
4758   hyperstone_state *cpustate = get_safe_token(device);
47374759   switch (state)
47384760   {
47394761      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
48704892
48714893static CPU_GET_INFO( hyperstone )
48724894{
4873   hyperstone_state *cpustate = (device != NULL) ? device->token : NULL;
4895   hyperstone_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
48744896   switch (state)
48754897   {
48764898      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/i860/i860dec.c
r4425r4426
44404440
44414441static CPU_EXECUTE( i860 )
44424442{
4443   i860_state_t *cpustate = device->token;
4443   i860_state_t *cpustate = get_safe_token(device);
44444444
44454445   /* Check if the data bus is held by another device, and bail if so.
44464446       Also check for reset.  */
src/emu/cpu/i860/i860.c
r4425r4426
2727
2828static CPU_INIT( i860 )
2929{
30   i860_state_t *cpustate = device->token;
30   i860_state_t *cpustate = get_safe_token(device);
3131   cpustate->device = device;
3232   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
3333   reset_i860(cpustate);
r4425r4426
4343
4444static CPU_RESET( i860 )
4545{
46   i860_state_t *cpustate = device->token;
46   i860_state_t *cpustate = get_safe_token(device);
4747   reset_i860(cpustate);
4848}
4949
r4425r4426
8181
8282static CPU_SET_INFO( i860 )
8383{
84   i860_state_t *cpustate = device->token;
84   i860_state_t *cpustate = get_safe_token(device);
8585
8686   switch(state)
8787   {
r4425r4426
175175
176176CPU_GET_INFO( i860 )
177177{
178   i860_state_t *cpustate = (device != NULL) ? device->token : NULL;
178   i860_state_t *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
179179
180180   switch (state)
181181   {
src/emu/cpu/i860/i860.h
r4425r4426
1919#define __I860_H__
2020
2121#include "cpuintrf.h"
22#include "debugger.h"
2223
2324/***************************************************************************
2425    REGISTER ENUMERATION
r4425r4426
177178
178179} i860_state_t;
179180
181INLINE i860_state_t *get_safe_token(const device_config *device)
182{
183   assert(device != NULL);
184   assert(device->token != NULL);
185   assert(device->type == CPU);
186   assert(cpu_get_type(device) == CPU_I860);
187   return (i860_state_t *)device->token;
188}
180189
190
181191/***************************************************************************
182192    PUBLIC FUNCTIONS
183193***************************************************************************/
src/emu/cpu/mcs51/mcs51.c
r4425r4426
644644    INLINE FUNCTIONS
645645***************************************************************************/
646646
647INLINE mcs51_state_t *get_safe_token(const device_config *device)
648{
649   assert(device != NULL);
650   assert(device->token != NULL);
651   assert(device->type == CPU);
652   assert(cpu_get_type(device) == CPU_I8031 ||
653         cpu_get_type(device) == CPU_I8032 ||
654         cpu_get_type(device) == CPU_I8051 ||
655         cpu_get_type(device) == CPU_I8751 ||
656         cpu_get_type(device) == CPU_I8052 ||
657         cpu_get_type(device) == CPU_I8752 ||
658         cpu_get_type(device) == CPU_I80C31 ||
659         cpu_get_type(device) == CPU_I80C32 ||
660         cpu_get_type(device) == CPU_I80C51 ||
661         cpu_get_type(device) == CPU_I80C52 ||
662         cpu_get_type(device) == CPU_I87C51 ||
663         cpu_get_type(device) == CPU_I87C52 ||
664         cpu_get_type(device) == CPU_AT89C4051 ||
665         cpu_get_type(device) == CPU_DS5002FP);
666   return (mcs51_state_t *)device->token;
667}
668
647669INLINE void clear_current_irq(mcs51_state_t *mcs51_state)
648670{
649671   if (mcs51_state->cur_irq_prio >= 0)
r4425r4426
665687
666688INLINE void update_ptrs(mcs51_state_t *mcs51_state)
667689{
668   mcs51_state->internal_ram = memory_get_write_ptr(mcs51_state->data, 0x00);
669   mcs51_state->sfr_ram = memory_get_write_ptr(mcs51_state->data, 0x100);
690   mcs51_state->internal_ram = (UINT8 *)memory_get_write_ptr(mcs51_state->data, 0x00);
691   mcs51_state->sfr_ram = (UINT8 *)memory_get_write_ptr(mcs51_state->data, 0x100);
670692}
671693
672694
r4425r4426
12591281
12601282void i8051_set_serial_tx_callback(const device_config *device, mcs51_serial_tx_func tx_func)
12611283{
1262   mcs51_state_t *mcs51_state = device->token;
1284   mcs51_state_t *mcs51_state = get_safe_token(device);
12631285   mcs51_state->serial_tx_callback = tx_func;
12641286}
12651287
12661288void i8051_set_serial_rx_callback(const device_config *device, mcs51_serial_rx_func rx_func)
12671289{
1268   mcs51_state_t *mcs51_state = device->token;
1290   mcs51_state_t *mcs51_state = get_safe_token(device);
12691291   mcs51_state->serial_rx_callback = rx_func;
12701292}
12711293
r4425r4426
18941916/* Execute cycles - returns number of cycles actually run */
18951917static CPU_EXECUTE( mcs51 )
18961918{
1897   mcs51_state_t *mcs51_state = device->token;
1919   mcs51_state_t *mcs51_state = get_safe_token(device);
18981920   UINT8 op;
18991921
19001922   update_ptrs(mcs51_state);
r4425r4426
20452067
20462068static CPU_INIT( mcs51 )
20472069{
2048   mcs51_state_t *mcs51_state = device->token;
2070   mcs51_state_t *mcs51_state = get_safe_token(device);
20492071
20502072   mcs51_state->irq_callback = irqcallback;
20512073   mcs51_state->device = device;
r4425r4426
20812103
20822104static CPU_INIT( i80c51 )
20832105{
2084   mcs51_state_t *mcs51_state = device->token;
2106   mcs51_state_t *mcs51_state = get_safe_token(device);
20852107   CPU_INIT_CALL(mcs51);
20862108   mcs51_state->features |= FEATURE_CMOS;
20872109}
r4425r4426
20892111/* Reset registers to the initial values */
20902112static CPU_RESET( mcs51 )
20912113{
2092   mcs51_state_t *mcs51_state = device->token;
2114   mcs51_state_t *mcs51_state = get_safe_token(device);
20932115
20942116   update_ptrs(mcs51_state);
20952117
r4425r4426
22142236
22152237static CPU_INIT( i8052 )
22162238{
2217   mcs51_state_t *mcs51_state = device->token;
2239   mcs51_state_t *mcs51_state = get_safe_token(device);
22182240   CPU_INIT_CALL(mcs51);
22192241
22202242   mcs51_state->ram_mask = 0xFF;           /* 256 bytes of ram */
r4425r4426
22672289
22682290static CPU_INIT( i80c52 )
22692291{
2270   mcs51_state_t *mcs51_state = device->token;
2292   mcs51_state_t *mcs51_state = get_safe_token(device);
22712293   CPU_INIT_CALL(i8052);
22722294
22732295   mcs51_state->features |= (FEATURE_I80C52 | FEATURE_CMOS);
r4425r4426
22772299
22782300static CPU_INIT( i80c31 )
22792301{
2280   mcs51_state_t *mcs51_state = device->token;
2302   mcs51_state_t *mcs51_state = get_safe_token(device);
22812303   CPU_INIT_CALL(i8052);
22822304
22832305   mcs51_state->ram_mask = 0x7F;           /* 128 bytes of ram */
r4425r4426
23592381{
23602382   /* default configuration */
23612383   static const ds5002fp_config default_config = { 0x00, 0x00, 0x00 };
2362   const ds5002fp_config *sconfig = device->static_config ? device->static_config : &default_config;
2363   mcs51_state_t *mcs51_state = device->token;
2384   const ds5002fp_config *sconfig = device->static_config ? (const ds5002fp_config *)device->static_config : &default_config;
2385   mcs51_state_t *mcs51_state = get_safe_token(device);
23642386
23652387   CPU_INIT_CALL( mcs51 );
23662388
r4425r4426
24042426
24052427static CPU_SET_INFO( mcs51 )
24062428{
2407   mcs51_state_t *mcs51_state = device->token;
2429   mcs51_state_t *mcs51_state = get_safe_token(device);
24082430
24092431   switch (state)
24102432   {
r4425r4426
24462468
24472469static CPU_GET_INFO( mcs51 )
24482470{
2449   mcs51_state_t *mcs51_state = (device != NULL) ? device->token : NULL;
2471   mcs51_state_t *mcs51_state = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
24502472
24512473   switch (state)
24522474   {
src/emu/cpu/i386/i386priv.h
r4425r4426
33#ifndef __I386_H__
44#define __I386_H__
55
6#include "i386.h"
67#include "cpuintrf.h"
78
89#define I386OP(XX)      i386_##XX
r4425r4426
280281   UINT8 *cycle_table_rm;
281282};
282283
284INLINE i386_state *get_safe_token(const device_config *device)
285{
286   assert(device != NULL);
287   assert(device->token != NULL);
288   assert(device->type == CPU);
289   assert(cpu_get_type(device) == CPU_I386 ||
290         cpu_get_type(device) == CPU_I486 ||
291         cpu_get_type(device) == CPU_PENTIUM ||
292         cpu_get_type(device) == CPU_MEDIAGX);
293   return (i386_state *)device->token;
294}
283295
284296extern int i386_parity_table[256];
285297
src/emu/cpu/i386/i386.c
r4425r4426
396396   int i, j;
397397   for (j=0; j < X86_NUM_CPUS; j++)
398398   {
399      cycle_table_rm[j] = auto_malloc(sizeof(UINT8) * CYCLES_NUM_OPCODES);
400      cycle_table_pm[j] = auto_malloc(sizeof(UINT8) * CYCLES_NUM_OPCODES);
399      cycle_table_rm[j] = (UINT8 *)auto_malloc(sizeof(UINT8) * CYCLES_NUM_OPCODES);
400      cycle_table_pm[j] = (UINT8 *)auto_malloc(sizeof(UINT8) * CYCLES_NUM_OPCODES);
401401
402402      for (i=0; i < sizeof(x86_cycle_table)/sizeof(X86_CYCLE_TABLE); i++)
403403      {
r4425r4426
445445
446446static UINT64 i386_debug_segbase(void *globalref, void *ref, UINT32 params, const UINT64 *param)
447447{
448   const device_config *device = ref;
449   i386_state *cpustate = device->token;
448   const device_config *device = (const device_config *)ref;
449   i386_state *cpustate = get_safe_token(device);
450450   UINT32 result;
451451   I386_SREG seg;
452452
r4425r4426
466466
467467static UINT64 i386_debug_seglimit(void *globalref, void *ref, UINT32 params, const UINT64 *param)
468468{
469   const device_config *device = ref;
470   i386_state *cpustate = device->token;
469   const device_config *device = (const device_config *)ref;
470   i386_state *cpustate = get_safe_token(device);
471471   UINT32 result = 0;
472472   I386_SREG seg;
473473
r4425r4426
491491
492492static STATE_POSTLOAD( i386_postload )
493493{
494   const device_config *device = param;
495   i386_state *cpustate = device->token;
494   const device_config *device = (const device_config *)param;
495   i386_state *cpustate = get_safe_token(device);
496496   int i;
497497   for (i = 0; i < 6; i++)
498498      i386_load_segment_descriptor(cpustate,i);
r4425r4426
505505   static const int regs8[8] = {AL,CL,DL,BL,AH,CH,DH,BH};
506506   static const int regs16[8] = {AX,CX,DX,BX,SP,BP,SI,DI};
507507   static const int regs32[8] = {EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI};
508   i386_state *cpustate = device->token;
508   i386_state *cpustate = get_safe_token(device);
509509
510510   build_cycle_table();
511511
r4425r4426
622622
623623static CPU_RESET( i386 )
624624{
625   i386_state *cpustate = device->token;
625   i386_state *cpustate = get_safe_token(device);
626626   cpu_irq_callback save_irqcallback;
627627
628628   save_irqcallback = cpustate->irq_callback;
r4425r4426
692692
693693static CPU_EXECUTE( i386 )
694694{
695   i386_state *cpustate = device->token;
695   i386_state *cpustate = get_safe_token(device);
696696
697697   cpustate->cycles = cycles;
698698   cpustate->base_cycles = cycles;
r4425r4426
726726
727727static CPU_TRANSLATE( i386 )
728728{
729   i386_state *cpustate = device->token;
729   i386_state *cpustate = get_safe_token(device);
730730   int result = 1;
731731   if (space == ADDRESS_SPACE_PROGRAM)
732732   {
r4425r4426
739739
740740static CPU_DISASSEMBLE( i386 )
741741{
742   i386_state *cpustate = device->token;
742   i386_state *cpustate = get_safe_token(device);
743743   return i386_dasm_one(buffer, pc, oprom, cpustate->sreg[CS].d ? 32 : 16);
744744}
745745
746746static CPU_SET_INFO( i386 )
747747{
748   i386_state *cpustate = device->token;
748   i386_state *cpustate = get_safe_token(device);
749749
750750   if (state == CPUINFO_INT_INPUT_STATE+INPUT_LINE_A20)
751751   {
r4425r4426
846846
847847CPU_GET_INFO( i386 )
848848{
849   i386_state *cpustate = (device != NULL) ? device->token : NULL;
849   i386_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
850850
851851   switch (state)
852852   {
r4425r4426
10711071
10721072static CPU_RESET( i486 )
10731073{
1074   i386_state *cpustate = device->token;
1074   i386_state *cpustate = get_safe_token(device);
10751075   cpu_irq_callback save_irqcallback;
10761076
10771077   save_irqcallback = cpustate->irq_callback;
r4425r4426
11151115
11161116static CPU_SET_INFO( i486 )
11171117{
1118   i386_state *cpustate = device->token;
1118   i386_state *cpustate = get_safe_token(device);
11191119   switch (state)
11201120   {
11211121      case CPUINFO_INT_REGISTER + X87_CTRL:         cpustate->fpu_control_word = info->i;         break;
r4425r4426
11351135
11361136CPU_GET_INFO( i486 )
11371137{
1138   i386_state *cpustate = (device != NULL) ? device->token : NULL;
1138   i386_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
11391139   switch (state)
11401140   {
11411141      case CPUINFO_FCT_SET_INFO:                     info->setinfo = CPU_SET_INFO_NAME(i486);break;
r4425r4426
11841184
11851185static CPU_RESET( pentium )
11861186{
1187   i386_state *cpustate = device->token;
1187   i386_state *cpustate = get_safe_token(device);
11881188   cpu_irq_callback save_irqcallback;
11891189
11901190   save_irqcallback = cpustate->irq_callback;
r4425r4426
12481248
12491249static CPU_SET_INFO( pentium )
12501250{
1251   i386_state *cpustate = device->token;
1251   i386_state *cpustate = get_safe_token(device);
12521252   switch (state)
12531253   {
12541254      case CPUINFO_INT_REGISTER + X87_CTRL:         cpustate->fpu_control_word = info->i;         break;
r4425r4426
12681268
12691269CPU_GET_INFO( pentium )
12701270{
1271   i386_state *cpustate = (device != NULL) ? device->token : NULL;
1271   i386_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
12721272   switch (state)
12731273   {
12741274      case CPUINFO_FCT_SET_INFO:                     info->setinfo = CPU_SET_INFO_NAME(pentium);   break;
r4425r4426
13171317
13181318static CPU_RESET( mediagx )
13191319{
1320   i386_state *cpustate = device->token;
1320   i386_state *cpustate = get_safe_token(device);
13211321   cpu_irq_callback save_irqcallback;
13221322
13231323   save_irqcallback = cpustate->irq_callback;
r4425r4426
13811381
13821382static CPU_SET_INFO( mediagx )
13831383{
1384   i386_state *cpustate = device->token;
1384   i386_state *cpustate = get_safe_token(device);
13851385   switch (state)
13861386   {
13871387      case CPUINFO_INT_REGISTER + X87_CTRL:         cpustate->fpu_control_word = info->i;         break;
r4425r4426
14011401
14021402CPU_GET_INFO( mediagx )
14031403{
1404   i386_state *cpustate = (device != NULL) ? device->token : NULL;
1404   i386_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
14051405   switch (state)
14061406   {
14071407      case CPUINFO_FCT_SET_INFO:                     info->setinfo = CPU_SET_INFO_NAME(mediagx);   break;
src/emu/cpu/mc68hc11/mc68hc11.c
r4425r4426
6363   int internal_ram_size;
6464};
6565
66INLINE hc11_state *get_safe_token(const device_config *device)
67{
68   assert(device != NULL);
69   assert(device->token != NULL);
70   assert(device->type == CPU);
71   assert(cpu_get_type(device) == CPU_MC68HC11);
72   return (hc11_state *)device->token;
73}
74
6675#define HC11OP(XX)      hc11_##XX
6776
6877/*****************************************************************************/
r4425r4426
316325
317326static CPU_INIT( hc11 )
318327{
319   hc11_state *cpustate = device->token;
328   hc11_state *cpustate = get_safe_token(device);
320329   int i;
321330
322331   /* clear the opcode tables */
r4425r4426
347356   }
348357
349358   cpustate->internal_ram_size = 1280;      /* FIXME: this is for MC68HC11M0 */
350   cpustate->internal_ram = auto_malloc(cpustate->internal_ram_size);
359   cpustate->internal_ram = (UINT8 *)auto_malloc(cpustate->internal_ram_size);
351360
352361   cpustate->reg_position = 0;
353362   cpustate->ram_position = 0x100;
r4425r4426
359368
360369static CPU_RESET( hc11 )
361370{
362   hc11_state *cpustate = device->token;
371   hc11_state *cpustate = get_safe_token(device);
363372   cpustate->pc = READ16(cpustate, 0xfffe);
364373}
365374
r4425r4426
370379
371380static CPU_EXECUTE( hc11 )
372381{
373   hc11_state *cpustate = device->token;
382   hc11_state *cpustate = get_safe_token(device);
374383
375384   cpustate->icount = cycles;
376385
r4425r4426
392401
393402static CPU_SET_INFO( mc68hc11 )
394403{
395   hc11_state *cpustate = device->token;
404   hc11_state *cpustate = get_safe_token(device);
396405
397406   switch (state)
398407   {
r4425r4426
409418
410419CPU_GET_INFO( mc68hc11 )
411420{
412   hc11_state *cpustate = (device != NULL) ? device->token : NULL;
421   hc11_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
413422
414423   switch(state)
415424   {
src/emu/cpu/adsp2100/adsp2100.c
r4425r4426
420420static void check_irqs(adsp2100_state *adsp);
421421
422422
423
423424/***************************************************************************
425    STATE ACCESSORS
426***************************************************************************/
427
428INLINE adsp2100_state *get_safe_token(const device_config *device)
429{
430   assert(device != NULL);
431   assert(device->token != NULL);
432   assert(device->type == CPU);
433   assert(cpu_get_type(device) == CPU_ADSP2100 ||
434         cpu_get_type(device) == CPU_ADSP2101 ||
435         cpu_get_type(device) == CPU_ADSP2104 ||
436         cpu_get_type(device) == CPU_ADSP2105 ||
437         cpu_get_type(device) == CPU_ADSP2115 ||
438         cpu_get_type(device) == CPU_ADSP2181);
439   return (adsp2100_state *)device->token;
440}
441
442
443
444/***************************************************************************
424445    MEMORY ACCESSORS
425446***************************************************************************/
426447
r4425r4426
672693
673694static adsp2100_state *adsp21xx_init(const device_config *device, cpu_irq_callback irqcallback, int chiptype)
674695{
675   const adsp21xx_config *config = device->static_config;
676   adsp2100_state *adsp = device->token;
696   const adsp21xx_config *config = (const adsp21xx_config *)device->static_config;
697   adsp2100_state *adsp = get_safe_token(device);
677698
678699   /* create the tables */
679700   if (!create_tables())
r4425r4426
828849
829850static CPU_RESET( adsp21xx )
830851{
831   adsp2100_state *adsp = device->token;
852   adsp2100_state *adsp = get_safe_token(device);
832853   int irq;
833854
834855   /* ensure that zero is zero */
r4425r4426
10301051static CPU_EXECUTE( adsp21xx )
10311052{
10321053   int check_debugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
1033   adsp2100_state *adsp = device->token;
1054   adsp2100_state *adsp = get_safe_token(device);
10341055
10351056   check_irqs(adsp);
10361057
r4425r4426
17851806
17861807static CPU_IMPORT_STATE( adsp21xx )
17871808{
1788   adsp2100_state *adsp = device->token;
1809   adsp2100_state *adsp = get_safe_token(device);
17891810   switch (entry->index)
17901811   {
17911812      case ADSP2100_MSTAT:
r4425r4426
18371858
18381859static CPU_SET_INFO( adsp21xx )
18391860{
1840   adsp2100_state *adsp = device->token;
1861   adsp2100_state *adsp = get_safe_token(device);
18411862   switch (state)
18421863   {
18431864      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
18641885
18651886static CPU_GET_INFO( adsp21xx )
18661887{
1867   adsp2100_state *adsp = (device != NULL) ? device->token : NULL;
1888   adsp2100_state *adsp = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
18681889   switch (state)
18691890   {
18701891      /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
21522173
21532174void adsp2181_idma_addr_w(const device_config *device, UINT16 data)
21542175{
2155   adsp2100_state *adsp = device->token;
2176   adsp2100_state *adsp = get_safe_token(device);
21562177   adsp->idma_addr = data;
21572178   adsp->idma_offs = 0;
21582179}
21592180
21602181UINT16 adsp2181_idma_addr_r(const device_config *device)
21612182{
2162   adsp2100_state *adsp = device->token;
2183   adsp2100_state *adsp = get_safe_token(device);
21632184   return adsp->idma_addr;
21642185}
21652186
21662187void adsp2181_idma_data_w(const device_config *device, UINT16 data)
21672188{
2168   adsp2100_state *adsp = device->token;
2189   adsp2100_state *adsp = get_safe_token(device);
21692190
21702191   /* program memory? */
21712192   if (!(adsp->idma_addr & 0x4000))
r4425r4426
21922213
21932214UINT16 adsp2181_idma_data_r(const device_config *device)
21942215{
2195   adsp2100_state *adsp = device->token;
2216   adsp2100_state *adsp = get_safe_token(device);
21962217   UINT16 result = 0xffff;
21972218
21982219   /* program memory? */
src/emu/cpu/dsp32/dsp32.c
r4425r4426
197197
198198
199199/***************************************************************************
200    STATE ACCESSORS
201***************************************************************************/
202
203INLINE dsp32_state *get_safe_token(const device_config *device)
204{
205   assert(device != NULL);
206   assert(device->token != NULL);
207   assert(device->type == CPU);
208   assert(cpu_get_type(device) == CPU_DSP32C);
209   return (dsp32_state *)device->token;
210}
211
212
213
214/***************************************************************************
200215    MEMORY ACCESSORS
201216***************************************************************************/
202217
r4425r4426
296311
297312static CPU_INIT( dsp32c )
298313{
299   const dsp32_config *configdata = device->static_config;
300   dsp32_state *cpustate = device->token;
314   const dsp32_config *configdata = (const dsp32_config *)device->static_config;
315   dsp32_state *cpustate = get_safe_token(device);
301316
302317   /* copy in config data */
303318   if (configdata != NULL)
r4425r4426
310325
311326static CPU_RESET( dsp32c )
312327{
313   dsp32_state *cpustate = device->token;
328   dsp32_state *cpustate = get_safe_token(device);
314329
315330   /* reset goes to 0 */
316331   cpustate->PC = 0;
r4425r4426
354369
355370static CPU_EXECUTE( dsp32c )
356371{
357   dsp32_state *cpustate = device->token;
372   dsp32_state *cpustate = get_safe_token(device);
358373
359374   /* skip if halted */
360375   if ((cpustate->pcr & PCR_RESET) == 0)
r4425r4426
496511
497512void dsp32c_pio_w(const device_config *device, int reg, int data)
498513{
499   dsp32_state *cpustate = device->token;
514   dsp32_state *cpustate = get_safe_token(device);
500515   UINT16 mask;
501516   UINT8 mode;
502517
r4425r4426
575590
576591int dsp32c_pio_r(const device_config *device, int reg)
577592{
578   dsp32_state *cpustate = device->token;
593   dsp32_state *cpustate = get_safe_token(device);
579594   UINT16 mask, result = 0xffff;
580595   UINT8 mode, shift = 0;
581596
r4425r4426
648663
649664static CPU_SET_INFO( dsp32c )
650665{
651   dsp32_state *cpustate = device->token;
666   dsp32_state *cpustate = get_safe_token(device);
652667   switch (state)
653668   {
654669      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
720735
721736CPU_GET_INFO( dsp32c )
722737{
723   dsp32_state *cpustate = (device != NULL) ? device->token : NULL;
738   dsp32_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
724739   switch (state)
725740   {
726741      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/drcbex64.c
r4425r4426
697697   int spacenum;
698698
699699   /* allocate space in the cache for our state */
700   drcbe = drccache_memory_alloc_near(cache, sizeof(*drcbe));
700   drcbe = (drcbe_state *)drccache_memory_alloc_near(cache, sizeof(*drcbe));
701701   if (drcbe == NULL)
702702      return NULL;
703703   memset(drcbe, 0, sizeof(*drcbe));
r4425r4426
718718
719719   /* build up necessary arrays */
720720   memcpy(drcbe->ssecontrol, sse_control, sizeof(drcbe->ssecontrol));
721   drcbe->absmask32 = drccache_memory_alloc_near(cache, 16*2 + 15);
722   drcbe->absmask32 = (void *)(((FPTR)drcbe->absmask32 + 15) & ~15);
721   drcbe->absmask32 = (UINT32 *)drccache_memory_alloc_near(cache, 16*2 + 15);
722   drcbe->absmask32 = (UINT32 *)(((FPTR)drcbe->absmask32 + 15) & ~15);
723723   drcbe->absmask32[0] = drcbe->absmask32[1] = drcbe->absmask32[2] = drcbe->absmask32[3] = 0x7fffffff;
724724   drcbe->absmask64 = (UINT64 *)&drcbe->absmask32[4];
725725   drcbe->absmask64[0] = drcbe->absmask64[1] = U64(0x7fffffffffffffff);
r4425r4426
28852885
28862886static void fixup_label(void *parameter, drccodeptr labelcodeptr)
28872887{
2888   drccodeptr src = parameter;
2888   drccodeptr src = (drccodeptr)parameter;
28892889
28902890   /* find the end of the instruction */
28912891   if (src[0] == 0xe3)
r4425r4426
29162916static void fixup_exception(drccodeptr *codeptr, void *param1, void *param2, void *param3)
29172917{
29182918   drcuml_parameter handp, exp;
2919   drcbe_state *drcbe = param1;
2920   drccodeptr src = param2;
2921   const drcuml_instruction *inst = param3;
2919   drcbe_state *drcbe = (drcbe_state *)param1;
2920   drccodeptr src = (drccodeptr)param2;
2921   const drcuml_instruction *inst = (const drcuml_instruction *)param3;
29222922   drccodeptr dst = *codeptr;
29232923   drccodeptr *targetptr;
29242924
src/emu/cpu/drcbec.c
r4425r4426
310310   int spacenum;
311311
312312   /* allocate space in the cache for our state */
313   drcbe_state *drcbe = drccache_memory_alloc(cache, sizeof(*drcbe));
313   drcbe_state *drcbe = (drcbe_state *)drccache_memory_alloc(cache, sizeof(*drcbe));
314314   if (drcbe == NULL)
315315      return NULL;
316316   memset(drcbe, 0, sizeof(*drcbe));
r4425r4426
474474
475475            /* pre-expand opcodes that encode size in them */
476476            if (opcode == DRCUML_OP_LOAD)
477               opcode = DRCUML_OP_LOAD1 + (inst->param[3].value & 3);
477               opcode = (drcuml_opcode)(DRCUML_OP_LOAD1 + (inst->param[3].value & 3));
478478            if (opcode == DRCUML_OP_LOADS)
479               opcode = DRCUML_OP_LOADS1 + (inst->param[3].value & 3);
479               opcode = (drcuml_opcode)(DRCUML_OP_LOADS1 + (inst->param[3].value & 3));
480480            if (opcode == DRCUML_OP_STORE)
481               opcode = DRCUML_OP_STORE1 + (inst->param[3].value & 3);
481               opcode = (drcuml_opcode)(DRCUML_OP_STORE1 + (inst->param[3].value & 3));
482482            if (opcode == DRCUML_OP_READ)
483               opcode = DRCUML_OP_READ1 + (inst->param[2].value & 3);
483               opcode = (drcuml_opcode)(DRCUML_OP_READ1 + (inst->param[2].value & 3));
484484            if (opcode == DRCUML_OP_READM)
485               opcode = DRCUML_OP_READM1 + (inst->param[3].value & 3);
485               opcode = (drcuml_opcode)(DRCUML_OP_READM1 + (inst->param[3].value & 3));
486486            if (opcode == DRCUML_OP_WRITE)
487               opcode = DRCUML_OP_WRITE1 + (inst->param[2].value & 3);
487               opcode = (drcuml_opcode)(DRCUML_OP_WRITE1 + (inst->param[2].value & 3));
488488            if (opcode == DRCUML_OP_WRITEM)
489               opcode = DRCUML_OP_WRITEM1 + (inst->param[3].value & 3);
489               opcode = (drcuml_opcode)(DRCUML_OP_WRITEM1 + (inst->param[3].value & 3));
490490            if (opcode == DRCUML_OP_SEXT)
491               opcode = DRCUML_OP_SEXT1 + (inst->param[2].value & 3);
491               opcode = (drcuml_opcode)(DRCUML_OP_SEXT1 + (inst->param[2].value & 3));
492492            if (opcode == DRCUML_OP_FTOINT)
493               opcode = DRCUML_OP_FTOI4T + 5 * ((inst->param[2].value & 3) - 2) + inst->param[3].value;
493               opcode = (drcuml_opcode)(DRCUML_OP_FTOI4T + 5 * ((inst->param[2].value & 3) - 2) + inst->param[3].value);
494494            if (opcode == DRCUML_OP_FFRINT)
495               opcode = DRCUML_OP_FFRI4 + ((inst->param[2].value & 3) - 2);
495               opcode = (drcuml_opcode)(DRCUML_OP_FFRI4 + ((inst->param[2].value & 3) - 2));
496496            if (opcode == DRCUML_OP_FFRFLT)
497               opcode = DRCUML_OP_FFRFS + ((inst->param[2].value & 3) - 2);
497               opcode = (drcuml_opcode)(DRCUML_OP_FFRFS + ((inst->param[2].value & 3) - 2));
498498
499499            /* count how many bytes of immediates we need */
500500            immedbytes = 0;
r4425r4426
19551955
19561956static void fixup_label(void *parameter, drccodeptr labelcodeptr)
19571957{
1958   drcbec_instruction *dst = parameter;
1958   drcbec_instruction *dst = (drcbec_instruction *)parameter;
19591959   dst->inst = (drcbec_instruction *)labelcodeptr;
19601960}
19611961
src/emu/cpu/rsp/rsp.c
r4425r4426
6363   int icount;
6464};
6565
66INLINE rsp_state *get_safe_token(const device_config *device)
67{
68   assert(device != NULL);
69   assert(device->token != NULL);
70   assert(device->type == CPU);
71   assert(cpu_get_type(device) == CPU_RSP);
72   return (rsp_state *)device->token;
73}
6674
6775
6876#define RSREG      ((op >> 21) & 0x1f)
r4425r4426
343351
344352static CPU_INIT( rsp )
345353{
346   rsp_state *cpustate = device->token;
354   rsp_state *cpustate = get_safe_token(device);
347355    int regIdx;
348356    int accumIdx;
349   cpustate->config = device->static_config;
357   cpustate->config = (const rsp_config *)device->static_config;
350358
351359   if (LOG_INSTRUCTION_EXECUTION)
352360      cpustate->exec_output = fopen("rsp_execute.txt", "wt");
r4425r4426
387395
388396static CPU_EXIT( rsp )
389397{
390   rsp_state *cpustate = device->token;
398   rsp_state *cpustate = get_safe_token(device);
391399
392400#if SAVE_DISASM
393401   {
r4425r4426
435443
436444static CPU_RESET( rsp )
437445{
438   rsp_state *cpustate = device->token;
446   rsp_state *cpustate = get_safe_token(device);
439447   cpustate->nextpc = ~0;
440448}
441449
r4425r4426
25282536                  i = 0;
25292537               }
25302538            }
2531            sqr = (INT32)(0x7fffffff / sqrt(sqr));
2539            sqr = (INT32)(0x7fffffff / sqrt((double)sqr));
25322540            for (i = 31; i > 0; i--)
25332541            {
25342542               if (sqr & (1 << i))
r4425r4426
25852593
25862594static CPU_EXECUTE( rsp )
25872595{
2588   rsp_state *cpustate = device->token;
2596   rsp_state *cpustate = get_safe_token(device);
25892597   UINT32 op;
25902598
25912599   cpustate->icount = cycles;
r4425r4426
28692877
28702878static CPU_SET_INFO( rsp )
28712879{
2872   rsp_state *cpustate = device->token;
2880   rsp_state *cpustate = get_safe_token(device);
28732881
28742882   switch (state)
28752883   {
r4425r4426
29172925
29182926CPU_GET_INFO( rsp )
29192927{
2920   rsp_state *cpustate = (device != NULL) ? device->token : NULL;
2928   rsp_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
29212929
29222930   switch(state)
29232931   {
src/emu/cpu/cop400/cop400.c
r4425r4426
148148   emu_timer *microbus_timer;
149149};
150150
151typedef void (*cop400_opcode_func) (cop400_state *cpustate, UINT8 opcode);
152
151153struct _cop400_opcode_map {
152154   unsigned cycles;
153   void (*function) (cop400_state *cpustate, UINT8 opcode);
155   cop400_opcode_func function;
154156};
155157
156158/***************************************************************************
r4425r4426
252254    INLINE FUNCTIONS
253255***************************************************************************/
254256
257INLINE cop400_state *get_safe_token(const device_config *device)
258{
259   assert(device != NULL);
260   assert(device->token != NULL);
261   assert(device->type == CPU);
262   assert(cpu_get_type(device) == CPU_COP401 ||
263         cpu_get_type(device) == CPU_COP410 ||
264         cpu_get_type(device) == CPU_COP411 ||
265         cpu_get_type(device) == CPU_COP402 ||
266         cpu_get_type(device) == CPU_COP420 ||
267         cpu_get_type(device) == CPU_COP421 ||
268         cpu_get_type(device) == CPU_COP422 ||
269         cpu_get_type(device) == CPU_COP404 ||
270         cpu_get_type(device) == CPU_COP424 ||
271         cpu_get_type(device) == CPU_COP425 ||
272         cpu_get_type(device) == CPU_COP426 ||
273         cpu_get_type(device) == CPU_COP444 ||
274         cpu_get_type(device) == CPU_COP445);
275   return (cop400_state *)device->token;
276}
277
255278INLINE void PUSH(cop400_state *cpustate, UINT16 data)
256279{
257280   if (cpustate->state_table.subtypemask != COP410_FEATURE)
r4425r4426
712735
713736static TIMER_CALLBACK( serial_tick )
714737{
715   cop400_state *cpustate = ptr;
738   cop400_state *cpustate = (cop400_state *)ptr;
716739
717740   if (BIT(EN, 0))
718741   {
r4425r4426
787810
788811static TIMER_CALLBACK( counter_tick )
789812{
790   cop400_state *cpustate = ptr;
813   cop400_state *cpustate = (cop400_state *)ptr;
791814
792815   T++;
793816
r4425r4426
805828
806829static TIMER_CALLBACK( inil_tick )
807830{
808   cop400_state *cpustate = ptr;
831   cop400_state *cpustate = (cop400_state *)ptr;
809832   UINT8 in;
810833   int i;
811834
r4425r4426
824847
825848static TIMER_CALLBACK( microbus_tick )
826849{
827   cop400_state *cpustate = ptr;
850   cop400_state *cpustate = (cop400_state *)ptr;
828851   UINT8 in;
829852
830853   in = IN_IN();
r4425r4426
858881
859882static void cop400_init(const device_config *device, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, int has_counter, int has_inil)
860883{
861   cop400_state *cpustate = device->token;
884   cop400_state *cpustate = get_safe_token(device);
862885
863886   cpustate->intf = (cop400_interface *) device->static_config;
864887
r4425r4426
939962
940963static void cop410_init_opcodes(const device_config *device)
941964{
942   cop400_state *cpustate = device->token;
965   cop400_state *cpustate = get_safe_token(device);
943966   int i;
944967
945968   /* set up the state table */
r4425r4426
970993
971994static void cop420_init_opcodes(const device_config *device)
972995{
973   cop400_state *cpustate = device->token;
996   cop400_state *cpustate = get_safe_token(device);
974997   int i;
975998
976999   /* set up the state table */
r4425r4426
10051028
10061029static void cop444_init_opcodes(const device_config *device)
10071030{
1008   cop400_state *cpustate = device->token;
1031   cop400_state *cpustate = get_safe_token(device);
10091032   int i;
10101033
10111034   /* set up the state table */
r4425r4426
10981121
10991122static CPU_RESET( cop400 )
11001123{
1101   cop400_state *cpustate = device->token;
1124   cop400_state *cpustate = get_safe_token(device);
11021125
11031126   PC = 0;
11041127   A = 0;
r4425r4426
11221145
11231146static CPU_EXECUTE( cop400 )
11241147{
1125   cop400_state *cpustate = device->token;
1148   cop400_state *cpustate = get_safe_token(device);
11261149
11271150   UINT8 opcode;
11281151
r4425r4426
11851208
11861209         if (BIT(EN, 1) && BIT(IL, 1))
11871210         {
1188            void *function = cpustate->opcode_map[ROM(PC)].function;
1211            cop400_opcode_func function = cpustate->opcode_map[ROM(PC)].function;
11891212
11901213            if ((function != jp) &&   (function != jmp) && (function != jsr))
11911214            {
r4425r4426
12101233
12111234         if (cpustate->skip)
12121235         {
1213            void *function = cpustate->opcode_map[ROM(PC)].function;
1236            cop400_opcode_func function = cpustate->opcode_map[ROM(PC)].function;
12141237
12151238            opcode = ROM(PC);
12161239
r4425r4426
13361359
13371360static CPU_GET_INFO( cop400 )
13381361{
1339   cop400_state *cpustate = (device != NULL) ? device->token : NULL;
1362   cop400_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
13401363
13411364   switch (state)
13421365   {
r4425r4426
13911414
13921415CPU_GET_INFO( cop410 )
13931416{
1394   cop400_state *cpustate = (device != NULL) ? device->token : NULL;
1417   cop400_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
13951418
13961419   switch (state)
13971420   {
r4425r4426
14541477
14551478CPU_GET_INFO( cop420 )
14561479{
1457   cop400_state *cpustate = (device != NULL) ? device->token : NULL;
1480   cop400_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
14581481
14591482   switch (state)
14601483   {
r4425r4426
15351558
15361559CPU_GET_INFO( cop444 )
15371560{
1538   cop400_state *cpustate = (device != NULL) ? device->token : NULL;
1561   cop400_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
15391562
15401563   switch (state)
15411564   {
src/emu/cpu/cop400/cop400.h
r4425r4426
7373};
7474
7575/* CKI bonding options */
76typedef enum _cop400_cki_bond cop400_cki_bond;
7776enum _cop400_cki_bond {
7877   COP400_CKI_DIVISOR_4 = 4,
7978   COP400_CKI_DIVISOR_8 = 8,
8079   COP400_CKI_DIVISOR_16 = 16,
8180   COP400_CKI_DIVISOR_32 = 32
8281};
82typedef enum _cop400_cki_bond cop400_cki_bond;
8383
8484/* CKO bonding options */
85typedef enum _cop400_cko_bond cop400_cko_bond;
8685enum _cop400_cko_bond {
8786   COP400_CKO_OSCILLATOR_OUTPUT = 0,
8887   COP400_CKO_RAM_POWER_SUPPLY,
r4425r4426
9089   COP400_CKO_SYNC_INPUT,
9190   COP400_CKO_GENERAL_PURPOSE_INPUT
9291};
92typedef enum _cop400_cko_bond cop400_cko_bond;
9393
9494/* microbus bonding options */
95typedef enum _cop400_microbus cop400_microbus;
9695enum _cop400_microbus {
9796   COP400_MICROBUS_DISABLED = 0,
9897   COP400_MICROBUS_ENABLED
9998};
99typedef enum _cop400_microbus cop400_microbus;
100100
101101/* interface */
102102typedef struct _cop400_interface cop400_interface;
src/emu/cpu/m6502/6502dasm.c
r4425r4426
6666};
6767
6868enum opcodes {
69   adc,  and, asl,  bcc,  bcs,  beq,  bit,  bmi,
69   adc,  and_,asl,  bcc,  bcs,  beq,  bit,  bmi,
7070   bne,  bpl, m6502_brk,  bvc,  bvs,  clc,  cld,  cli,
7171   clv,  cmp, cpx,  cpy,  dec,  dex,  dey,  eor,
7272   inc,  inx, iny,  jmp,  jsr,  lda,  ldx,  ldy,
r4425r4426
148148   {nop,zpx},{ora,zpx},{asl,zpx},{slo,zpx},
149149   {clc,imp},{ora,aby},{nop,imp},{slo,aby},
150150   {nop,abx},{ora,abx},{asl,abx},{slo,abx},
151   {jsr,adr},{and,idx},{kil,non},{rla,idx},/* 20 */
152   {bit,zpg},{and,zpg},{rol,zpg},{rla,zpg},
153   {plp,imp},{and,imm},{rol,acc},{anc,imm},
154   {bit,aba},{and,aba},{rol,aba},{rla,aba},
155   {bmi,rel},{and,idy},{kil,non},{rla,idy},/* 30 */
156   {nop,zpx},{and,zpx},{rol,zpx},{rla,zpx},
157   {sec,imp},{and,aby},{nop,imp},{rla,aby},
158   {nop,abx},{and,abx},{rol,abx},{rla,abx},
151   {jsr,adr},{and_,idx},{kil,non},{rla,idx},/* 20 */
152   {bit,zpg},{and_,zpg},{rol,zpg},{rla,zpg},
153   {plp,imp},{and_,imm},{rol,acc},{anc,imm},
154   {bit,aba},{and_,aba},{rol,aba},{rla,aba},
155   {bmi,rel},{and_,idy},{kil,non},{rla,idy},/* 30 */
156   {nop,zpx},{and_,zpx},{rol,zpx},{rla,zpx},
157   {sec,imp},{and_,aby},{nop,imp},{rla,aby},
158   {nop,abx},{and_,abx},{rol,abx},{rla,abx},
159159   {rti,imp},{eor,idx},{kil,non},{sre,idx},/* 40 */
160160   {nop,zpg},{eor,zpg},{lsr,zpg},{sre,zpg},
161161   {pha,imp},{eor,imm},{lsr,acc},{asr,imm},
r4425r4426
215215   {trb,zpg},{ora,zpx},{asl,zpx},{rmb,zpg},
216216   {clc,imp},{ora,aby},{ina,imp},{ill,non},
217217   {trb,aba},{ora,abx},{asl,abx},{bbr,zpb},
218   {jsr,adr},{and,idx},{ill,non},{ill,non},/* 20 */
219   {bit,zpg},{and,zpg},{rol,zpg},{rmb,zpg},
220   {plp,imp},{and,imm},{rol,acc},{ill,non},
221   {bit,aba},{and,aba},{rol,aba},{bbr,zpb},
222   {bmi,rel},{and,idy},{and,zpi},{ill,non},/* 30 */
223   {bit,zpx},{and,zpx},{rol,zpx},{rmb,zpg},
224   {sec,imp},{and,aby},{dea,imp},{ill,non},
225   {bit,abx},{and,abx},{rol,abx},{bbr,zpb},
218   {jsr,adr},{and_,idx},{ill,non},{ill,non},/* 20 */
219   {bit,zpg},{and_,zpg},{rol,zpg},{rmb,zpg},
220   {plp,imp},{and_,imm},{rol,acc},{ill,non},
221   {bit,aba},{and_,aba},{rol,aba},{bbr,zpb},
222   {bmi,rel},{and_,idy},{and_,zpi},{ill,non},/* 30 */
223   {bit,zpx},{and_,zpx},{rol,zpx},{rmb,zpg},
224   {sec,imp},{and_,aby},{dea,imp},{ill,non},
225   {bit,abx},{and_,abx},{rol,abx},{bbr,zpb},
226226   {rti,imp},{eor,idx},{ill,non},{ill,non},/* 40 */
227227   {ill,non},{eor,zpg},{lsr,zpg},{rmb,zpg},
228228   {pha,imp},{eor,imm},{lsr,acc},{ill,non},
r4425r4426
283283   {trb,zpg},{ora,zpx},{asl,zpx},{rmb,zpg},
284284   {clc,imp},{ora,aby},{ina,imp},{ill,non},
285285   {trb,aba},{ora,abx},{asl,abx},{bbr,zpb},
286   {jsr,adr},{and,idx},{ill,non},{ill,non},/* 20 */
287   {bit,zpg},{and,zpg},{rol,zpg},{rmb,zpg},
288   {plp,imp},{and,imm},{rol,acc},{ill,non},
289   {bit,aba},{and,aba},{rol,aba},{bbr,zpb},
290   {bmi,rel},{and,idy},{and,zpi},{ill,non},/* 30 */
291   {bit,zpx},{and,zpx},{rol,zpx},{rmb,zpg},
292   {sec,imp},{and,aby},{dea,imp},{ill,non},
293   {bit,abx},{and,abx},{rol,abx},{bbr,zpb},
286   {jsr,adr},{and_,idx},{ill,non},{ill,non},/* 20 */
287   {bit,zpg},{and_,zpg},{rol,zpg},{rmb,zpg},
288   {plp,imp},{and_,imm},{rol,acc},{ill,non},
289   {bit,aba},{and_,aba},{rol,aba},{bbr,zpb},
290   {bmi,rel},{and_,idy},{and_,zpi},{ill,non},/* 30 */
291   {bit,zpx},{and_,zpx},{rol,zpx},{rmb,zpg},
292   {sec,imp},{and_,aby},{dea,imp},{ill,non},
293   {bit,abx},{and_,abx},{rol,abx},{bbr,zpb},
294294   {rti,imp},{eor,idx},{ill,non},{ill,non},/* 40 */
295295   {ill,non},{eor,zpg},{lsr,zpg},{rmb,zpg},
296296   {pha,imp},{eor,imm},{lsr,acc},{ill,non},
r4425r4426
351351   {trb,zpg},{ora,zpx},{asl,zpx},{rmb,zpg},
352352   {clc,imp},{ora,aby},{ina,imp},{inz,imp},
353353   {trb,aba},{ora,abx},{asl,abx},{bbr,zpb},
354   {jsr,adr},{and,idx},{jsr,ind},{jsr,iax},/* 20 */
355   {bit,zpg},{and,zpg},{rol,zpg},{rmb,zpg},
356   {plp,imp},{and,imm},{rol,acc},{tys,imp},
357   {bit,aba},{and,aba},{rol,aba},{bbr,zpb},
358   {bmi,rel},{and,idz},{and,zpi},{bmi,rw2},/* 30 */
359   {bit,zpx},{and,zpx},{rol,zpx},{rmb,zpg},
360   {sec,imp},{and,aby},{dea,imp},{dez,imp},
361   {bit,abx},{and,abx},{rol,abx},{bbr,zpb},
354   {jsr,adr},{and_,idx},{jsr,ind},{jsr,iax},/* 20 */
355   {bit,zpg},{and_,zpg},{rol,zpg},{rmb,zpg},
356   {plp,imp},{and_,imm},{rol,acc},{tys,imp},
357   {bit,aba},{and_,aba},{rol,aba},{bbr,zpb},
358   {bmi,rel},{and_,idz},{and_,zpi},{bmi,rw2},/* 30 */
359   {bit,zpx},{and_,zpx},{rol,zpx},{rmb,zpg},
360   {sec,imp},{and_,aby},{dea,imp},{dez,imp},
361   {bit,abx},{and_,abx},{rol,abx},{bbr,zpb},
362362   {rti,imp},{eor,idx},{neg,imp},{asr2,imp},/* 40 */
363363   {asr2,zpg},{eor,zpg},{lsr,zpg},{rmb,zpg},
364364   {pha,imp},{eor,imm},{lsr,acc},{taz,imp},
r4425r4426
421421   {trb,zpg},{ora,zpx},{asl,zpx},{rmb,zpg},
422422   {clc,imp},{ora,aby},{ina,imp},{inz,imp},
423423   {trb,aba},{ora,abx},{asl,abx},{bbr,zpb},
424   {jsr,adr},{and,idx},{jsr,ind},{jsr,iax},/* 20 */
425   {bit,zpg},{and,zpg},{rol,zpg},{rmb,zpg},
426   {plp,imp},{and,imm},{rol,acc},{tys,imp},
427   {bit,aba},{and,aba},{rol,aba},{bbr,zpb},
428   {bmi,rel},{and,idz},{and,zpi},{bmi,rw2},/* 30 */
429   {bit,zpx},{and,zpx},{rol,zpx},{rmb,zpg},
430   {sec,imp},{and,aby},{dea,imp},{dez,imp},
431   {bit,abx},{and,abx},{rol,abx},{bbr,zpb},
424   {jsr,adr},{and_,idx},{jsr,ind},{jsr,iax},/* 20 */
425   {bit,zpg},{and_,zpg},{rol,zpg},{rmb,zpg},
426   {plp,imp},{and_,imm},{rol,acc},{tys,imp},
427   {bit,aba},{and_,aba},{rol,aba},{bbr,zpb},
428   {bmi,rel},{and_,idz},{and_,zpi},{bmi,rw2},/* 30 */
429   {bit,zpx},{and_,zpx},{rol,zpx},{rmb,zpg},
430   {sec,imp},{and_,aby},{dea,imp},{dez,imp},
431   {bit,abx},{and_,abx},{rol,abx},{bbr,zpb},
432432   {rti,imp},{eor,idx},{neg,imp},{asr2,imp},/* 40 */
433433   {asr2,zpg},{eor,zpg},{lsr,zpg},{rmb,zpg},
434434   {pha,imp},{eor,imm},{lsr,acc},{taz,imp},
r4425r4426
491491   {ill,non},{ora,zpx},{asl,zpx},{ill,non},
492492   {clc,imp},{ora,aby},{ill,non},{ill,non},
493493   {ill,non},{ora,abx},{asl,abx},{ill,non},
494   {jsr,adr},{and,idx},{ill,non},{u23,zpg},/* 20 */
495   {bit,zpg},{and,zpg},{rol,zpg},{ill,non},
496   {plp,imp},{and,imm},{rol,acc},{ill,non},
497   {bit,aba},{and,aba},{rol,aba},{ill,non},
498   {bmi,rel},{and,idy},{ill,non},{ill,non},/* 30 */
499   {ill,non},{and,zpx},{rol,zpx},{ill,non},
500   {sec,imp},{and,aby},{ill,non},{ill,non},
501   {ill,non},{and,abx},{rol,abx},{u3F,zpg},
494   {jsr,adr},{and_,idx},{ill,non},{u23,zpg},/* 20 */
495   {bit,zpg},{and_,zpg},{rol,zpg},{ill,non},
496   {plp,imp},{and_,imm},{rol,acc},{ill,non},
497   {bit,aba},{and_,aba},{rol,aba},{ill,non},
498   {bmi,rel},{and_,idy},{ill,non},{ill,non},/* 30 */
499   {ill,non},{and_,zpx},{rol,zpx},{ill,non},
500   {sec,imp},{and_,aby},{ill,non},{ill,non},
501   {ill,non},{and_,abx},{rol,abx},{u3F,zpg},
502502   {rti,imp},{eor,idx},{ill,non},{ill,non},/* 40 */
503503   {ill,non},{eor,zpg},{lsr,zpg},{ill,non},
504504   {pha,imp},{eor,imm},{lsr,acc},{u4B,zpg},
src/emu/cpu/m6502/m4510.c
r4425r4426
155155   m6510_port_write_func port_write;
156156};
157157
158INLINE m4510_Regs *get_safe_token(const device_config *device)
159{
160   assert(device != NULL);
161   assert(device->token != NULL);
162   assert(device->type == CPU);
163   assert(cpu_get_type(device) == CPU_M4510);
164   return (m4510_Regs *)device->token;
165}
166
158167/***************************************************************
159168 * include the opcode macros, functions and tables
160169 ***************************************************************/
r4425r4426
176185
177186static UINT8 default_rdmem_id(const address_space *space, offs_t address)
178187{
179   m4510_Regs *cpustate = space->cpu->token;
188   m4510_Regs *cpustate = get_safe_token(space->cpu);
180189   return memory_read_byte_8le(space, M4510_MEM(address));
181190}
182191static void default_wrmem_id(const address_space *space, offs_t address, UINT8 data)
183192{
184   m4510_Regs *cpustate = space->cpu->token;
193   m4510_Regs *cpustate = get_safe_token(space->cpu);
185194   memory_write_byte_8le(space, M4510_MEM(address), data);
186195}
187196
188197static CPU_INIT( m4510 )
189198{
190   m4510_Regs *cpustate = device->token;
199   m4510_Regs *cpustate = get_safe_token(device);
191200
192201   cpustate->interrupt_inhibit = 0;
193202   cpustate->rdmem_id = default_rdmem_id;
r4425r4426
199208
200209static CPU_RESET( m4510 )
201210{
202   m4510_Regs *cpustate = device->token;
211   m4510_Regs *cpustate = get_safe_token(device);
203212
204213   cpustate->insn = insn4510;
205214
r4425r4426
253262
254263static CPU_EXECUTE( m4510 )
255264{
256   m4510_Regs *cpustate = device->token;
265   m4510_Regs *cpustate = get_safe_token(device);
257266
258267   cpustate->icount = cycles;
259268
r4425r4426
334343static READ8_HANDLER( m4510_read_0000 )
335344{
336345   UINT8 result = 0x00;
337   m4510_Regs *cpustate = space->cpu->token;
346   m4510_Regs *cpustate = get_safe_token(space->cpu);
338347
339348   switch(offset)
340349   {
r4425r4426
352361
353362static WRITE8_HANDLER( m4510_write_0000 )
354363{
355   m4510_Regs *cpustate = space->cpu->token;
364   m4510_Regs *cpustate = get_safe_token(space->cpu);
356365
357366   switch(offset)
358367   {
r4425r4426
374383
375384static CPU_TRANSLATE( m4510 )
376385{
377   m4510_Regs *cpustate = device->token;
386   m4510_Regs *cpustate = get_safe_token(device);
378387
379388   if (space == ADDRESS_SPACE_PROGRAM)
380389      *address = M4510_MEM(*address);
r4425r4426
387396
388397static CPU_SET_INFO( m4510 )
389398{
390   m4510_Regs *cpustate = device->token;
399   m4510_Regs *cpustate = get_safe_token(device);
391400
392401   switch (state)
393402   {
r4425r4426
434443
435444CPU_GET_INFO( m4510 )
436445{
437   m4510_Regs *cpustate = (device != NULL) ? device->token : NULL;
446   m4510_Regs *cpustate = (device != NULL && device != NULL) ? get_safe_token(device) : NULL;
438447
439448   switch (state)
440449   {
src/emu/cpu/m6502/m6502.c
r4425r4426
9191
9292};
9393
94INLINE m6502_Regs *get_safe_token(const device_config *device)
95{
96   assert(device != NULL);
97   assert(device->token != NULL);
98   assert(device->type == CPU);
99   assert(cpu_get_type(device) == CPU_M6502 ||
100         cpu_get_type(device) == CPU_M6510 ||
101         cpu_get_type(device) == CPU_M6510T ||
102         cpu_get_type(device) == CPU_M7501 ||
103         cpu_get_type(device) == CPU_M8502 ||
104         cpu_get_type(device) == CPU_N2A03 ||
105         cpu_get_type(device) == CPU_M65C02 ||
106         cpu_get_type(device) == CPU_M65SC02 ||
107         cpu_get_type(device) == CPU_DECO16);
108   return (m6502_Regs *)device->token;
109}
94110
95111static UINT8 default_rdmem_id(const address_space *space, offs_t offset) { return memory_read_byte_8le(space, offset); }
96112static void default_wdmem_id(const address_space *space, offs_t offset, UINT8 data) { memory_write_byte_8le(space, offset, data); }
r4425r4426
132148
133149static void m6502_common_init(const device_config *device, cpu_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type)
134150{
135   m6502_Regs *cpustate = device->token;
151   m6502_Regs *cpustate = get_safe_token(device);
136152
137153   cpustate->irq_callback = irqcallback;
138154   cpustate->device = device;
r4425r4426
170186
171187static CPU_RESET( m6502 )
172188{
173   m6502_Regs *cpustate = device->token;
189   m6502_Regs *cpustate = get_safe_token(device);
174190   /* wipe out the rest of the m6502 structure */
175191   /* read the reset vector into PC */
176192   PCL = RDMEM(M6502_RST_VEC);
r4425r4426
210226
211227static CPU_EXECUTE( m6502 )
212228{
213   m6502_Regs *cpustate = device->token;
229   m6502_Regs *cpustate = get_safe_token(device);
214230
215231   cpustate->icount = cycles;
216232
r4425r4426
322338   from the PSG core when such an occasion arises. */
323339void n2a03_irq(const device_config *device)
324340{
325   m6502_Regs *cpustate = device->token;
341   m6502_Regs *cpustate = get_safe_token(device);
326342
327343   m6502_take_irq(cpustate);
328344}
r4425r4426
341357
342358static CPU_RESET( m6510 )
343359{
344   m6502_Regs *cpustate = device->token;
360   m6502_Regs *cpustate = get_safe_token(device);
345361
346362   CPU_RESET_CALL(m6502);
347363   cpustate->port = 0xff;
r4425r4426
355371
356372static READ8_HANDLER( m6510_read_0000 )
357373{
358   m6502_Regs *cpustate = space->cpu->token;
374   m6502_Regs *cpustate = get_safe_token(space->cpu);
359375   UINT8 result = 0x00;
360376
361377   switch(offset)
r4425r4426
374390
375391static WRITE8_HANDLER( m6510_write_0000 )
376392{
377   m6502_Regs *cpustate = space->cpu->token;
393   m6502_Regs *cpustate = get_safe_token(space->cpu);
378394
379395   switch(offset)
380396   {
r4425r4426
409425
410426static CPU_RESET( m65c02 )
411427{
412   m6502_Regs *cpustate = device->token;
428   m6502_Regs *cpustate = get_safe_token(device);
413429
414430   CPU_RESET_CALL(m6502);
415431   P &=~F_D;
r4425r4426
436452
437453static CPU_EXECUTE( m65c02 )
438454{
439   m6502_Regs *cpustate = device->token;
455   m6502_Regs *cpustate = get_safe_token(device);
440456
441457   cpustate->icount = cycles;
442458
r4425r4426
521537
522538static CPU_INIT( deco16 )
523539{
524   m6502_Regs *cpustate = device->token;
540   m6502_Regs *cpustate = get_safe_token(device);
525541   m6502_common_init(device, irqcallback, SUBTYPE_DECO16, insndeco16, "deco16");
526542   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
527543}
r4425r4426
529545
530546static CPU_RESET( deco16 )
531547{
532   m6502_Regs *cpustate = device->token;
548   m6502_Regs *cpustate = get_safe_token(device);
533549
534550   CPU_RESET_CALL(m6502);
535551   cpustate->subtype = SUBTYPE_DECO16;
r4425r4426
606622
607623static CPU_EXECUTE( deco16 )
608624{
609   m6502_Regs *cpustate = device->token;
625   m6502_Regs *cpustate = get_safe_token(device);
610626
611627   cpustate->icount = cycles;
612628
r4425r4426
659675
660676static CPU_SET_INFO( m6502 )
661677{
662   m6502_Regs *cpustate = device->token;
678   m6502_Regs *cpustate = get_safe_token(device);
663679
664680   switch (state)
665681   {
r4425r4426
693709
694710CPU_GET_INFO( m6502 )
695711{
696   m6502_Regs *cpustate = (device != NULL) ? device->token : NULL;
712   m6502_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
697713
698714   switch (state)
699715   {
r4425r4426
808824
809825static CPU_SET_INFO( m6510 )
810826{
811   m6502_Regs *cpustate = device->token;
827   m6502_Regs *cpustate = get_safe_token(device);
812828
813829   switch (state)
814830   {
r4425r4426
822838
823839CPU_GET_INFO( m6510 )
824840{
825   m6502_Regs *cpustate = (device != NULL) ? device->token : NULL;
841   m6502_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
826842
827843   switch (state)
828844   {
r4425r4426
908924
909925static CPU_SET_INFO( m65c02 )
910926{
911   m6502_Regs *cpustate = device->token;
927   m6502_Regs *cpustate = get_safe_token(device);
912928
913929   switch (state)
914930   {
r4425r4426
972988
973989static CPU_SET_INFO( deco16 )
974990{
975   m6502_Regs *cpustate = device->token;
991   m6502_Regs *cpustate = get_safe_token(device);
976992
977993   switch (state)
978994   {
src/emu/cpu/m6502/m6509.c
r4425r4426
8686   m6502_write_indexed_func wrmem_id;               /* writemem callback for indexed instructions */
8787};
8888
89INLINE m6509_Regs *get_safe_token(const device_config *device)
90{
91   assert(device != NULL);
92   assert(device->token != NULL);
93   assert(device->type == CPU);
94   assert(cpu_get_type(device) == CPU_M6509);
95   return (m6509_Regs *)device->token;
96}
8997
9098/***************************************************************
9199 * include the opcode macros, functions and tables
r4425r4426
132140
133141static CPU_INIT( m6509 )
134142{
135   m6509_Regs *cpustate = device->token;
143   m6509_Regs *cpustate = get_safe_token(device);
136144
137145   cpustate->rdmem_id = default_rdmem_id;
138146   cpustate->wrmem_id = default_wdmem_id;
r4425r4426
143151
144152static CPU_RESET( m6509 )
145153{
146   m6509_Regs *cpustate = device->token;
154   m6509_Regs *cpustate = get_safe_token(device);
147155
148156   cpustate->insn = insn6509;
149157
r4425r4426
190198
191199static CPU_EXECUTE( m6509 )
192200{
193   m6509_Regs *cpustate = device->token;
201   m6509_Regs *cpustate = get_safe_token(device);
194202
195203   cpustate->icount = cycles;
196204
r4425r4426
280288
281289static CPU_SET_INFO( m6509 )
282290{
283   m6509_Regs *cpustate = device->token;
291   m6509_Regs *cpustate = get_safe_token(device);
284292
285293   switch (state)
286294   {
r4425r4426
316324
317325CPU_GET_INFO( m6509 )
318326{
319   m6509_Regs *cpustate = (device != NULL) ? device->token : NULL;
327   m6509_Regs *cpustate = (device != NULL && device != NULL) ? get_safe_token(device) : NULL;
320328
321329   switch (state)
322330   {
src/emu/cpu/m6502/m65ce02.c
r4425r4426
8080   m6502_write_indexed_func wrmem_id;               /* writemem callback for indexed instructions */
8181};
8282
83INLINE m65ce02_Regs *get_safe_token(const device_config *device)
84{
85   assert(device != NULL);
86   assert(device->token != NULL);
87   assert(device->type == CPU);
88   assert(cpu_get_type(device) == CPU_M65CE02);
89   return (m65ce02_Regs *)device->token;
90}
91
8392/***************************************************************
8493 * include the opcode macros, functions and tables
8594 ***************************************************************/
r4425r4426
91100
92101static CPU_INIT( m65ce02 )
93102{
94   m65ce02_Regs *cpustate = device->token;
103   m65ce02_Regs *cpustate = get_safe_token(device);
95104
96105   cpustate->rdmem_id = default_rdmem_id;
97106   cpustate->wrmem_id = default_wdmem_id;
r4425r4426
102111
103112static CPU_RESET( m65ce02 )
104113{
105   m65ce02_Regs *cpustate = device->token;
114   m65ce02_Regs *cpustate = get_safe_token(device);
106115
107116   cpustate->insn = insn65ce02;
108117
r4425r4426
148157
149158static CPU_EXECUTE( m65ce02 )
150159{
151   m65ce02_Regs *cpustate = device->token;
160   m65ce02_Regs *cpustate = get_safe_token(device);
152161
153162   cpustate->icount = cycles;
154163
r4425r4426
227236
228237static CPU_SET_INFO( m65ce02 )
229238{
230   m65ce02_Regs *cpustate = device->token;
239   m65ce02_Regs *cpustate = get_safe_token(device);
231240
232241   switch( state )
233242    {
r4425r4426
260269
261270CPU_GET_INFO( m65ce02 )
262271{
263   m65ce02_Regs *cpustate = (device != NULL) ? device->token : NULL;
272   m65ce02_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
264273
265274   switch( state )
266275   {
src/emu/cpu/jaguar/jaguar.c
r4425r4426
245245    INLINE FUNCTIONS
246246***************************************************************************/
247247
248INLINE jaguar_state *get_safe_token(const device_config *device)
249{
250   assert(device != NULL);
251   assert(device->token != NULL);
252   assert(device->type == CPU);
253   assert(cpu_get_type(device) == CPU_JAGUARGPU ||
254         cpu_get_type(device) == CPU_JAGUARDSP);
255   return (jaguar_state *)device->token;
256}
257
248258INLINE void update_register_banks(jaguar_state *jaguar)
249259{
250260   UINT32 temp;
r4425r4426
357367   }
358368
359369   /* fill in the mirror table */
360   mirror_table = malloc_or_die(65536 * sizeof(mirror_table[0]));
370   mirror_table = (UINT16 *)malloc_or_die(65536 * sizeof(mirror_table[0]));
361371   for (i = 0; i < 65536; i++)
362372      mirror_table[i] = ((i >> 15) & 0x0001) | ((i >> 13) & 0x0002) |
363373                        ((i >> 11) & 0x0004) | ((i >> 9)  & 0x0008) |
r4425r4426
369379                        ((i << 13) & 0x4000) | ((i << 15) & 0x8000);
370380
371381   /* fill in the condition table */
372   condition_table = malloc_or_die(32 * 8 * sizeof(condition_table[0]));
382   condition_table = (UINT8 *)malloc_or_die(32 * 8 * sizeof(condition_table[0]));
373383   for (i = 0; i < 8; i++)
374384      for (j = 0; j < 32; j++)
375385      {
r4425r4426
389399
390400static STATE_POSTLOAD( jaguar_postload )
391401{
392   const device_config *device = param;
393   jaguar_state *jaguar = device->token;
402   const device_config *device = (const device_config *)param;
403   jaguar_state *jaguar = get_safe_token(device);
394404
395405   update_register_banks(jaguar);
396406   check_irqs(jaguar);
r4425r4426
399409
400410static void init_common(int isdsp, const device_config *device, cpu_irq_callback irqcallback)
401411{
402   const jaguar_cpu_config *configdata = device->static_config;
403   jaguar_state *jaguar = device->token;
412   const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->static_config;
413   jaguar_state *jaguar = get_safe_token(device);
404414
405415   init_tables();
406416
r4425r4426
435445
436446static CPU_RESET( jaguar )
437447{
438   jaguar_state *jaguar = device->token;
448   jaguar_state *jaguar = get_safe_token(device);
439449
440450   jaguar->b0 = jaguar->r;
441451   jaguar->b1 = jaguar->a;
r4425r4426
464474
465475static CPU_EXECUTE( jaguargpu )
466476{
467   jaguar_state *jaguar = device->token;
477   jaguar_state *jaguar = get_safe_token(device);
468478
469479   /* if we're halted, we shouldn't be here */
470480   if (!(jaguar->ctrl[G_CTRL] & 1))
r4425r4426
505515
506516static CPU_EXECUTE( jaguardsp )
507517{
508   jaguar_state *jaguar = device->token;
518   jaguar_state *jaguar = get_safe_token(device);
509519
510520   /* if we're halted, we shouldn't be here */
511521   if (!(jaguar->ctrl[G_CTRL] & 1))
r4425r4426
12481258
12491259UINT32 jaguargpu_ctrl_r(const device_config *device, offs_t offset)
12501260{
1251   jaguar_state *jaguar = device->token;
1261   jaguar_state *jaguar = get_safe_token(device);
12521262
12531263   if (LOG_GPU_IO) logerror("GPU read register @ F021%02X\n", offset * 4);
12541264
r4425r4426
12581268
12591269void jaguargpu_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask)
12601270{
1261   jaguar_state *jaguar = device->token;
1271   jaguar_state *jaguar = get_safe_token(device);
12621272   UINT32 oldval, newval;
12631273
12641274   if (LOG_GPU_IO && offset != G_HIDATA)
r4425r4426
13441354
13451355UINT32 jaguardsp_ctrl_r(const device_config *device, offs_t offset)
13461356{
1347   jaguar_state *jaguar = device->token;
1357   jaguar_state *jaguar = get_safe_token(device);
13481358
13491359   if (LOG_DSP_IO && offset != D_FLAGS)
13501360      logerror("DSP read register @ F1A1%02X\n", offset * 4);
r4425r4426
13561366
13571367void jaguardsp_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask)
13581368{
1359   jaguar_state *jaguar = device->token;
1369   jaguar_state *jaguar = get_safe_token(device);
13601370   UINT32 oldval, newval;
13611371
13621372   if (LOG_DSP_IO && offset != D_FLAGS)
r4425r4426
14431453
14441454static CPU_SET_INFO( jaguargpu )
14451455{
1446   jaguar_state *jaguar = device->token;
1456   jaguar_state *jaguar = get_safe_token(device);
14471457   switch (state)
14481458   {
14491459      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
15011511
15021512CPU_GET_INFO( jaguargpu )
15031513{
1504   jaguar_state *jaguar = (device != NULL) ? device->token : NULL;
1514   jaguar_state *jaguar = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
15051515   switch (state)
15061516   {
15071517      /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
16401650
16411651static CPU_SET_INFO( jaguardsp )
16421652{
1643   jaguar_state *jaguar = device->token;
1653   jaguar_state *jaguar = get_safe_token(device);
16441654   switch (state)
16451655   {
16461656      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
16541664
16551665CPU_GET_INFO( jaguardsp )
16561666{
1657   jaguar_state *jaguar = (device != NULL) ? device->token : NULL;
1667   jaguar_state *jaguar = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
16581668   switch (state)
16591669   {
16601670      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/i8085/i8085.c
r4425r4426
244244    INLINE FUNCTIONS
245245***************************************************************************/
246246
247INLINE i8085_state *get_safe_token(const device_config *device)
248{
249   assert(device != NULL);
250   assert(device->token != NULL);
251   assert(device->type == CPU);
252   assert(cpu_get_type(device) == CPU_8080 ||
253         cpu_get_type(device) == CPU_8085A);
254   return (i8085_state *)device->token;
255}
256
247257INLINE void set_sod(i8085_state *cpustate, int state)
248258{
249259   if (state != 0 && cpustate->sod_state == 0)
r4425r4426
14591469
14601470static CPU_EXECUTE( i808x )
14611471{
1462   i8085_state *cpustate = device->token;
1472   i8085_state *cpustate = get_safe_token(device);
14631473
14641474   cpustate->icount = cycles;
14651475
r4425r4426
15161526
15171527static void init_808x_common(const device_config *device, cpu_irq_callback irqcallback, int type)
15181528{
1519   i8085_state *cpustate = device->token;
1529   i8085_state *cpustate = get_safe_token(device);
15201530
15211531   init_tables();
15221532
r4425r4426
15691579
15701580static CPU_RESET( i808x )
15711581{
1572   i8085_state *cpustate = device->token;
1582   i8085_state *cpustate = get_safe_token(device);
15731583
15741584   cpustate->PC.d = 0;
15751585   cpustate->HALT = 0;
r4425r4426
15901600
15911601static CPU_IMPORT_STATE( i808x )
15921602{
1593   i8085_state *cpustate = device->token;
1603   i8085_state *cpustate = get_safe_token(device);
15941604
15951605   switch (entry->index)
15961606   {
r4425r4426
16171627
16181628static CPU_EXPORT_STATE( i808x )
16191629{
1620   i8085_state *cpustate = device->token;
1630   i8085_state *cpustate = get_safe_token(device);
16211631
16221632   switch (entry->index)
16231633   {
r4425r4426
16711681
16721682static CPU_SET_INFO( i808x )
16731683{
1674   i8085_state *cpustate = device->token;
1684   i8085_state *cpustate = get_safe_token(device);
16751685   switch (state)
16761686   {
16771687      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
16931703
16941704CPU_GET_INFO( i8085 )
16951705{
1696   i8085_state *cpustate = (device != NULL) ? device->token : NULL;
1706   i8085_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
16971707   switch (state)
16981708   {
16991709      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/drccache.c
r4425r4426
107107
108108   /* build a local structure first */
109109   memset(&cache, 0, sizeof(cache));
110   cache.near = osd_alloc_executable(bytes);
110   cache.near = (drccodeptr)osd_alloc_executable(bytes);
111111   cache.neartop = cache.near;
112112   cache.base = cache.near + NEAR_CACHE_SIZE;
113113   cache.top = cache.base;
r4425r4426
115115   cache.size = bytes;
116116
117117   /* now allocate the cache structure itself from that */
118   cacheptr = drccache_memory_alloc(&cache, sizeof(cache));
118   cacheptr = (drccache *)drccache_memory_alloc(&cache, sizeof(cache));
119119   *cacheptr = cache;
120120
121121   /* return the allocated result */
r4425r4426
237237   }
238238
239239   /* if no space, we just fail */
240   ptr = ALIGN_PTR_DOWN(cache->end - bytes);
240   ptr = (drccodeptr)ALIGN_PTR_DOWN(cache->end - bytes);
241241   if (cache->top > ptr)
242242      return NULL;
243243
r4425r4426
272272   }
273273
274274   /* if no space, we just fail */
275   ptr = ALIGN_PTR_UP(cache->neartop);
275   ptr = (drccodeptr)ALIGN_PTR_UP(cache->neartop);
276276   if (ptr + bytes > cache->base)
277277      return NULL;
278278
r4425r4426
290290void drccache_memory_free(drccache *cache, void *memory, size_t bytes)
291291{
292292   free_link **linkptr;
293   free_link *link = memory;
293   free_link *link = (free_link *)memory;
294294
295295   assert(bytes < MAX_PERMANENT_ALLOC);
296296   assert(((drccodeptr)memory >= cache->near && (drccodeptr)memory < cache->base) || ((drccodeptr)memory >= cache->end && (drccodeptr)memory < cache->near + cache->size));
r4425r4426
324324      return NULL;
325325
326326   /* otherwise, update the cache top */
327   cache->top = ALIGN_PTR_UP(ptr + bytes);
327   cache->top = (drccodeptr)ALIGN_PTR_UP(ptr + bytes);
328328   return ptr;
329329}
330330
r4425r4426
383383   }
384384
385385   /* update the cache top */
386   cache->top = ALIGN_PTR_UP(cache->top);
386   cache->top = (drccodeptr)ALIGN_PTR_UP(cache->top);
387387   cache->codegen = NULL;
388388
389389   return result;
r4425r4426
402402   assert(cache->codegen != NULL);
403403
404404   /* pull an item from the free list */
405   oob = drccache_memory_alloc(cache, sizeof(*oob));
405   oob = (oob_handler *)drccache_memory_alloc(cache, sizeof(*oob));
406406   assert(oob != NULL);
407407
408408   /* fill it in */
src/emu/cpu/powerpc/ppcdrc.c
r4425r4426
435435    INLINE FUNCTIONS
436436***************************************************************************/
437437
438INLINE powerpc_state *get_safe_token(const device_config *device)
439{
440   assert(device != NULL);
441   assert(device->token != NULL);
442   assert(device->type == CPU);
443   assert(cpu_get_type(device) == CPU_PPC403GA ||
444         cpu_get_type(device) == CPU_PPC403GCX ||
445         cpu_get_type(device) == CPU_PPC601 ||
446         cpu_get_type(device) == CPU_PPC602 ||
447         cpu_get_type(device) == CPU_PPC603 ||
448         cpu_get_type(device) == CPU_PPC603E ||
449         cpu_get_type(device) == CPU_PPC603R ||
450         cpu_get_type(device) == CPU_PPC604 ||
451         cpu_get_type(device) == CPU_MPC8240);
452   return *(powerpc_state **)device->token;
453}
454
438455/*-------------------------------------------------
439456    alloc_handle - allocate a handle if not
440457    already allocated
r4425r4426
552569      fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(*ppc)));
553570
554571   /* allocate the core from the near cache */
555   *(powerpc_state **)device->token = ppc = drccache_memory_alloc_near(cache, sizeof(*ppc));
572   *(powerpc_state **)device->token = ppc = (powerpc_state *)drccache_memory_alloc_near(cache, sizeof(*ppc));
556573   memset(ppc, 0, sizeof(*ppc));
557574
558575   /* initialize the core */
559576   ppccom_init(ppc, flavor, cap, tb_divisor, device, irqcallback);
560577
561578   /* allocate the implementation-specific state from the full cache */
562   ppc->impstate = drccache_memory_alloc_near(cache, sizeof(*ppc->impstate));
579   ppc->impstate = (ppcimp_state *)drccache_memory_alloc_near(cache, sizeof(*ppc->impstate));
563580   memset(ppc->impstate, 0, sizeof(*ppc->impstate));
564581   ppc->impstate->cache = cache;
565582
r4425r4426
670687
671688static CPU_RESET( ppcdrc )
672689{
673   powerpc_state *ppc = *(powerpc_state **)device->token;
690   powerpc_state *ppc = get_safe_token(device);
674691
675692   /* reset the common code and mark the cache dirty */
676693   ppccom_reset(ppc);
r4425r4426
686703
687704static CPU_EXECUTE( ppcdrc )
688705{
689   powerpc_state *ppc = *(powerpc_state **)device->token;
706   powerpc_state *ppc = get_safe_token(device);
690707   drcuml_state *drcuml = ppc->impstate->drcuml;
691708   int execute_result;
692709
r4425r4426
723740
724741static CPU_EXIT( ppcdrc )
725742{
726   powerpc_state *ppc = *(powerpc_state **)device->token;
743   powerpc_state *ppc = get_safe_token(device);
727744   ppccom_exit(ppc);
728745
729746   /* clean up the DRC */
r4425r4426
740757
741758static CPU_TRANSLATE( ppcdrc )
742759{
743   powerpc_state *ppc = *(powerpc_state **)device->token;
760   powerpc_state *ppc = get_safe_token(device);
744761   return ppccom_translate_address(ppc, space, intention, address);
745762}
746763
r4425r4426
751768
752769static CPU_DISASSEMBLE( ppcdrc )
753770{
754   powerpc_state *ppc = *(powerpc_state **)device->token;
771   powerpc_state *ppc = get_safe_token(device);
755772   return ppccom_dasm(ppc, buffer, pc, oprom, opram);
756773}
757774
r4425r4426
763780
764781static CPU_SET_INFO( ppcdrc )
765782{
766   powerpc_state *ppc = *(powerpc_state **)device->token;
783   powerpc_state *ppc = get_safe_token(device);
767784
768785   /* --- everything is handled generically --- */
769786   ppccom_set_info(ppc, state, info);
r4425r4426
777794
778795static CPU_GET_INFO( ppcdrc )
779796{
780   powerpc_state *ppc = (device != NULL && device->token != NULL) ? *(powerpc_state **)device->token : NULL;
797   powerpc_state *ppc = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
781798   switch (state)
782799   {
783800      /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
808825
809826void ppcdrc_set_options(const device_config *device, UINT32 options)
810827{
811   powerpc_state *ppc = *(powerpc_state **)device->token;
828   powerpc_state *ppc = get_safe_token(device);
812829   ppc->impstate->drcoptions = options;
813830}
814831
r4425r4426
820837
821838void ppcdrc_add_fastram(const device_config *device, offs_t start, offs_t end, UINT8 readonly, void *base)
822839{
823   powerpc_state *ppc = *(powerpc_state **)device->token;
840   powerpc_state *ppc = get_safe_token(device);
824841   if (ppc->impstate->fastram_select < ARRAY_LENGTH(ppc->impstate->fastram))
825842   {
826843      ppc->impstate->fastram[ppc->impstate->fastram_select].start = start;
r4425r4426
838855
839856void ppcdrc_add_hotspot(const device_config *device, offs_t pc, UINT32 opcode, UINT32 cycles)
840857{
841   powerpc_state *ppc = *(powerpc_state **)device->token;
858   powerpc_state *ppc = get_safe_token(device);
842859   if (ppc->impstate->hotspot_select < ARRAY_LENGTH(ppc->impstate->hotspot))
843860   {
844861      ppc->impstate->hotspot[ppc->impstate->hotspot_select].pc = pc;
r4425r4426
10321049
10331050static void cfunc_printf_exception(void *param)
10341051{
1035   powerpc_state *ppc = param;
1052   powerpc_state *ppc = (powerpc_state *)param;
10361053   printf("Exception: type=%2d EPC=%08X MSR=%08X\n", ppc->param0, ppc->spr[SPROEA_SRR0], ppc->spr[SPROEA_SRR1]);
10371054   cfunc_printf_probe(ppc);
10381055}
r4425r4426
10451062
10461063static void cfunc_printf_debug(void *param)
10471064{
1048   powerpc_state *ppc = param;
1065   powerpc_state *ppc = (powerpc_state *)param;
10491066   printf(ppc->impstate->format, ppc->impstate->arg0, ppc->impstate->arg1);
10501067}
10511068
r4425r4426
10571074
10581075static void cfunc_printf_probe(void *param)
10591076{
1060   powerpc_state *ppc = param;
1077   powerpc_state *ppc = (powerpc_state *)param;
10611078   UINT32 pc = (UINT32)(FPTR)param;
10621079
10631080   printf(" PC=%08X\n", pc);
r4425r4426
10871104
10881105static void cfunc_unimplemented(void *param)
10891106{
1090   powerpc_state *ppc = param;
1107   powerpc_state *ppc = (powerpc_state *)param;
10911108   UINT32 opcode = ppc->impstate->arg0;
10921109   fatalerror("PC=%08X: Unimplemented op %08X", ppc->pc, opcode);
10931110}
r4425r4426
14591476   /* on exit, read result is in I0 */
14601477   /* routine trashes I0-I3 */
14611478   drcuml_state *drcuml = ppc->impstate->drcuml;
1462   int fastxor = BYTE8_XOR_BE(0) >> (cpu_get_databus_width(ppc->device, ADDRESS_SPACE_PROGRAM) < 64);
1479   int fastxor = BYTE8_XOR_BE(0) >> (int)(cpu_get_databus_width(ppc->device, ADDRESS_SPACE_PROGRAM) < 64);
14631480   drcuml_block *block;
14641481   jmp_buf errorbuf;
14651482   int translate_type;
r4425r4426
42374254
42384255static CPU_GET_INFO( ppcdrc4xx )
42394256{
4240   powerpc_state *ppc = (device != NULL && device->token != NULL) ? *(powerpc_state **)device->token : NULL;
4257   powerpc_state *ppc = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
42414258   CPU_GET_INFO_CALL(ppcdrc);
42424259   ppc4xx_get_info(ppc, state, info);
42434260}
r4425r4426
42504267
42514268static CPU_SET_INFO( ppcdrc4xx )
42524269{
4253   powerpc_state *ppc = *(powerpc_state **)device->token;
4270   powerpc_state *ppc = get_safe_token(device);
42544271   CPU_SET_INFO_CALL(ppcdrc);
42554272   ppc4xx_set_info(ppc, state, info);
42564273}
src/emu/cpu/powerpc/ppccom.c
r4425r4426
186186
187187void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, cpu_irq_callback irqcallback)
188188{
189   const powerpc_config *config = device->static_config;
189   const powerpc_config *config = (const powerpc_config *)device->static_config;
190190
191191   /* initialize based on the config */
192192   memset(ppc, 0, sizeof(*ppc));
r4425r4426
429429   for (hashnum = 0; hashnum < 2; hashnum++)
430430   {
431431      offs_t ptegaddr = hashbase | ((hash << 6) & hashmask);
432      UINT32 *ptegptr = memory_get_read_ptr(ppc->program, ptegaddr);
432      UINT32 *ptegptr = (UINT32 *)memory_get_read_ptr(ppc->program, ptegaddr);
433433
434434      /* should only have valid memory here, but make sure */
435435      if (ptegptr != NULL)
r4425r4426
12461246
12471247static TIMER_CALLBACK( decrementer_int_callback )
12481248{
1249   powerpc_state *ppc = ptr;
1249   powerpc_state *ppc = (powerpc_state *)ptr;
12501250   UINT64 cycles_until_next;
12511251
12521252   /* set the decrementer IRQ state */
r4425r4426
15061506
15071507static TIMER_CALLBACK( ppc4xx_fit_callback )
15081508{
1509   powerpc_state *ppc = ptr;
1509   powerpc_state *ppc = (powerpc_state *)ptr;
15101510
15111511   /* if this is a real callback and we are enabled, signal an interrupt */
15121512   if (param)
r4425r4426
15361536
15371537static TIMER_CALLBACK( ppc4xx_pit_callback )
15381538{
1539   powerpc_state *ppc = ptr;
1539   powerpc_state *ppc = (powerpc_state *)ptr;
15401540
15411541   /* if this is a real callback and we are enabled, signal an interrupt */
15421542   if (param)
r4425r4426
16471647
16481648static TIMER_CALLBACK( ppc4xx_spu_callback )
16491649{
1650   powerpc_state *ppc = ptr;
1650   powerpc_state *ppc = (powerpc_state *)ptr;
16511651
16521652   /* transmit enabled? */
16531653   if (ppc->spu.regs[SPU4XX_TX_COMMAND] & 0x80)
src/emu/cpu/powerpc/ppcfe.c
r4425r4426
129129
130130int ppcfe_describe(void *param, opcode_desc *desc, const opcode_desc *prev)
131131{
132   powerpc_state *ppc = param;
132   powerpc_state *ppc = (powerpc_state *)param;
133133   UINT32 op, opswitch;
134134   int regnum;
135135
src/emu/cpu/arm/arm.c
r4425r4426
247247
248248/***************************************************************************/
249249
250INLINE ARM_REGS *get_safe_token(const device_config *device)
251{
252   assert(device != NULL);
253   assert(device->token != NULL);
254   assert(device->type == CPU);
255   assert(cpu_get_type(device) == CPU_ARM);
256   return (ARM_REGS *)device->token;
257}
258
250259INLINE void cpu_write32( ARM_REGS* cpustate, int addr, UINT32 data )
251260{
252261   /* Unaligned writes are treated as normal writes */
r4425r4426
298307
299308static CPU_RESET( arm )
300309{
301   ARM_REGS *cpustate = device->token;
310   ARM_REGS *cpustate = get_safe_token(device);
302311
303312   cpu_irq_callback save_irqcallback = cpustate->irq_callback;
304313   memset(cpustate, 0, sizeof(ARM_REGS));
r4425r4426
319328{
320329   UINT32 pc;
321330   UINT32 insn;
322   ARM_REGS *cpustate = device->token;
331   ARM_REGS *cpustate = get_safe_token(device);
323332
324333   cpustate->icount = cycles;
325334   do
r4425r4426
491500
492501static CPU_INIT( arm )
493502{
494   ARM_REGS *cpustate = device->token;
503   ARM_REGS *cpustate = get_safe_token(device);
495504
496505   cpustate->irq_callback = irqcallback;
497506   cpustate->device = device;
r4425r4426
13921401
13931402static CPU_SET_INFO( arm )
13941403{
1395   ARM_REGS *cpustate = device->token;
1404   ARM_REGS *cpustate = get_safe_token(device);
13961405
13971406   switch (state)
13981407   {
r4425r4426
14421451
14431452CPU_GET_INFO( arm )
14441453{
1445   ARM_REGS *cpustate = (device != NULL) ? device->token : NULL;
1454   ARM_REGS *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
14461455
14471456   switch (state)
14481457   {
src/emu/cpu/lr35902/lr35902.c
r4425r4426
113113   lr35902_8BitRegs b;
114114};
115115
116INLINE lr35902_state *get_safe_token(const device_config *device)
117{
118   assert(device != NULL);
119   assert(device->token != NULL);
120   assert(device->type == CPU);
121   assert(cpu_get_type(device) == CPU_LR35902);
122   return (lr35902_state *)device->token;
123}
124
116125typedef int (*OpcodeEmulator) (lr35902_state *cpustate);
117126
118127#define IME     0x01
r4425r4426
180189
181190static CPU_INIT( lr35902 )
182191{
183   lr35902_state *cpustate = device->token;
192   lr35902_state *cpustate = get_safe_token(device);
184193
185194   cpustate->w.config = (const lr35902_cpu_core *) device->static_config;
186195   cpustate->w.irq_callback = irqcallback;
r4425r4426
195204/************************************************************/
196205static CPU_RESET( lr35902 )
197206{
198   lr35902_state *cpustate = device->token;
207   lr35902_state *cpustate = get_safe_token(device);
199208
200209   cpustate->w.AF = 0x0000;
201210   cpustate->w.BC = 0x0000;
r4425r4426
300309/************************************************************/
301310static CPU_EXECUTE( lr35902 )
302311{
303   lr35902_state *cpustate = device->token;
312   lr35902_state *cpustate = get_safe_token(device);
304313
305314   cpustate->w.icount = cycles;
306315
r4425r4426
336345
337346static CPU_BURN( lr35902 )
338347{
339   lr35902_state *cpustate = device->token;
348   lr35902_state *cpustate = get_safe_token(device);
340349
341350    if( cycles > 0 )
342351    {
r4425r4426
378387
379388static CPU_SET_INFO( lr35902 )
380389{
381   lr35902_state *cpustate = device->token;
390   lr35902_state *cpustate = get_safe_token(device);
382391
383392   switch (state)
384393   {
r4425r4426
406415
407416CPU_GET_INFO( lr35902 )
408417{
409   lr35902_state *cpustate = (device != NULL) ? device->token : NULL;
418   lr35902_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
410419
411420   switch (state)
412421   {
src/emu/cpu/z8000/z8000.c
r4425r4426
8686
8787#include "z8000cpu.h"
8888
89INLINE z8000_state *get_safe_token(const device_config *device)
90{
91   assert(device != NULL);
92   assert(device->token != NULL);
93   assert(device->type == CPU);
94   assert(cpu_get_type(device) == CPU_Z8000);
95   return (z8000_state *)device->token;
96}
97
8998/* opcode execution table */
9099Z8000_exec *z8000_exec = NULL;
91100
r4425r4426
335344
336345static CPU_INIT( z8000 )
337346{
338   z8000_state *cpustate = device->token;
347   z8000_state *cpustate = get_safe_token(device);
339348
340349   cpustate->irq_callback = irqcallback;
341350   cpustate->device = device;
r4425r4426
349358
350359static CPU_RESET( z8000 )
351360{
352   z8000_state *cpustate = device->token;
361   z8000_state *cpustate = get_safe_token(device);
353362
354363   cpu_irq_callback save_irqcallback = cpustate->irq_callback;
355364   memset(cpustate, 0, sizeof(*cpustate));
r4425r4426
368377
369378static CPU_EXECUTE( z8000 )
370379{
371   z8000_state *cpustate = device->token;
380   z8000_state *cpustate = get_safe_token(device);
372381
373382    cpustate->icount = cycles;
374383
r4425r4426
461470
462471static CPU_SET_INFO( z8000 )
463472{
464   z8000_state *cpustate = device->token;
473   z8000_state *cpustate = get_safe_token(device);
465474
466475   switch (state)
467476   {
r4425r4426
507516
508517CPU_GET_INFO( z8000 )
509518{
510   z8000_state *cpustate = (device != NULL) ? device->token : NULL;
519   z8000_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
511520
512521   switch (state)
513522   {
src/emu/cpu/vtlb.c
r4425r4426
6060   vtlb_state *vtlb;
6161
6262   /* allocate memory for the core structure */
63   vtlb = malloc_or_die(sizeof(*vtlb));
63   vtlb = (vtlb_state *)malloc_or_die(sizeof(*vtlb));
6464   memset(vtlb, 0, sizeof(*vtlb));
6565
6666   /* fill in CPU information */
r4425r4426
7878   assert(vtlb->addrwidth > vtlb->pageshift);
7979
8080   /* allocate the entry array */
81   vtlb->live = malloc_or_die(sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries));
81   vtlb->live = (offs_t *)malloc_or_die(sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries));
8282   memset(vtlb->live, 0, sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries));
8383   state_save_register_device_item_pointer(cpu, space, vtlb->live, fixed_entries + dynamic_entries);
8484
8585   /* allocate the lookup table */
86   vtlb->table = malloc_or_die(sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift));
86   vtlb->table = (vtlb_entry *)malloc_or_die(sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift));
8787   memset(vtlb->table, 0, sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift));
8888   state_save_register_device_item_pointer(cpu, space, vtlb->table, 1 << (vtlb->addrwidth - vtlb->pageshift));
8989
9090   /* allocate the fixed page count array */
9191   if (fixed_entries > 0)
9292   {
93      vtlb->fixedpages = malloc_or_die(sizeof(vtlb->fixedpages[0]) * fixed_entries);
93      vtlb->fixedpages = (int *)malloc_or_die(sizeof(vtlb->fixedpages[0]) * fixed_entries);
9494      memset(vtlb->fixedpages, 0, sizeof(vtlb->fixedpages[0]) * fixed_entries);
9595      state_save_register_device_item_pointer(cpu, space, vtlb->fixedpages, fixed_entries);
9696   }
src/emu/cpu/tms32010/tms32010.c
r4425r4426
9696   const   address_space *io;
9797};
9898
99INLINE tms32010_state *get_safe_token(const device_config *device)
100{
101   assert(device != NULL);
102   assert(device->token != NULL);
103   assert(device->type == CPU);
104   assert(cpu_get_type(device) == CPU_TMS32010);
105   return (tms32010_state *)device->token;
106}
99107
100108/* opcode table entry */
101109typedef struct _tms32010_opcode tms32010_opcode;
r4425r4426
377385   cpustate->ACC.d += cpustate->ALU.d;
378386   CALCULATE_ADD_OVERFLOW(cpustate, cpustate->ALU.d);
379387}
380static void and(tms32010_state *cpustate)
388static void and_(tms32010_state *cpustate)
381389{
382390   getdata(cpustate, 0,0);
383391   cpustate->ACC.d &= cpustate->ALU.d;
r4425r4426
583591{
584592   /* Nothing to do */
585593}
586static void or(tms32010_state *cpustate)
594static void or_(tms32010_state *cpustate)
587595{
588596   getdata(cpustate, 0,0);
589597   cpustate->ACC.w.l |= cpustate->ALU.w.l;
r4425r4426
690698   M_WRTROM(((cpustate->ACC.w.l & cpustate->addr_mask)),cpustate->ALU.w.l);
691699   cpustate->STACK[0] = cpustate->STACK[1];
692700}
693static void xor(tms32010_state *cpustate)
701static void xor_(tms32010_state *cpustate)
694702{
695703   getdata(cpustate, 0,0);
696704   cpustate->ACC.w.l ^= cpustate->ALU.w.l;
r4425r4426
735743/*60*/  {1, addh   },{1, adds      },{1, subh      },{1, subs      },{1, subc      },{1, zalh      },{1, zals      },{3, tblr      },
736744/*68*/  {1, larp_mar},{1, dmov      },{1, lt      },{1, ltd      },{1, lta      },{1, mpy      },{1, ldpk      },{1, ldp      },
737745/*70*/  {1, lark_ar0},{1, lark_ar1   },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },{0, illegal   },
738/*78*/  {1, xor      },{1, and      },{1, or      },{1, lst      },{1, sst      },{3, tblw      },{1, lack      },{0, opcodes_7F   },
746/*78*/  {1, xor_   },{1, and_      },{1, or_      },{1, lst      },{1, sst      },{3, tblw      },{1, lack      },{0, opcodes_7F   },
739747/*80*/  {1, mpyk   },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },
740748/*88*/  {1, mpyk   },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },
741749/*90*/  {1, mpyk   },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },{1, mpyk      },
r4425r4426
769777 ****************************************************************************/
770778static CPU_INIT( tms32010 )
771779{
772   tms32010_state *cpustate = device->token;
780   tms32010_state *cpustate = get_safe_token(device);
773781
774782   state_save_register_device_item(device, 0, cpustate->PC);
775783   state_save_register_device_item(device, 0, cpustate->PREVPC);
r4425r4426
803811 ****************************************************************************/
804812static CPU_RESET( tms32010 )
805813{
806   tms32010_state *cpustate = device->token;
814   tms32010_state *cpustate = get_safe_token(device);
807815
808816   cpustate->PC    = 0;
809817   cpustate->STR   = 0x7efe;   // OV cleared
r4425r4426
846854 ****************************************************************************/
847855static CPU_EXECUTE( tms32010 )
848856{
849   tms32010_state *cpustate = device->token;
857   tms32010_state *cpustate = get_safe_token(device);
850858   cpustate->icount = cycles;
851859
852860   do
r4425r4426
905913
906914static CPU_SET_INFO( tms32010 )
907915{
908   tms32010_state *cpustate = device->token;
916   tms32010_state *cpustate = get_safe_token(device);
909917
910918   switch (state)
911919   {
r4425r4426
935943
936944CPU_GET_INFO( tms32010 )
937945{
938   tms32010_state *cpustate = (device != NULL) ? device->token : NULL;
946   tms32010_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
939947
940948   switch (state)
941949   {
src/emu/cpu/sh2/sh2drc.c
r4425r4426
134134    INLINE FUNCTIONS
135135***************************************************************************/
136136
137INLINE SH2 *get_safe_token(const device_config *device)
138{
139   assert(device != NULL);
140   assert(device->token != NULL);
141   assert(device->type == CPU);
142   assert(cpu_get_type(device) == CPU_SH1 ||
143         cpu_get_type(device) == CPU_SH2);
144   return *(SH2 **)device->token;
145}
146
137147INLINE UINT16 RW(SH2 *sh2, offs_t A)
138148{
139149   if (A >= 0xe0000000)
r4425r4426
221231
222232static void cfunc_printf_probe(void *param)
223233{
224   SH2 *sh2 = param;
234   SH2 *sh2 = (SH2 *)param;
225235   UINT32 pc = sh2->pc;
226236
227237   printf(" PC=%08X          r0=%08X  r1=%08X  r2=%08X\n",
r4425r4426
261271
262272static void cfunc_unimplemented(void *param)
263273{
264   SH2 *sh2 = param;
274   SH2 *sh2 = (SH2 *)param;
265275   UINT16 opcode = sh2->arg0;
266276   fatalerror("PC=%08X: Unimplemented op %04X", sh2->pc, opcode);
267277}
r4425r4426
271281-------------------------------------------------*/
272282static void cfunc_checkirqs(void *param)
273283{
274   SH2 *sh2 = param;
284   SH2 *sh2 = (SH2 *)param;
275285   // if NMI is pending, evec etc are already set up
276286   if (sh2->pending_nmi)
277287   {
r4425r4426
289299-------------------------------------------------*/
290300static void cfunc_fastirq(void *param)
291301{
292   SH2 *sh2 = param;
302   SH2 *sh2 = (SH2 *)param;
293303   sh2_exception(sh2, "fastirq",sh2->irqline);
294304}
295305
r4425r4426
298308-------------------------------------------------*/
299309static void cfunc_MAC_W(void *param)
300310{
301   SH2 *sh2 = param;
311   SH2 *sh2 = (SH2 *)param;
302312   INT32 tempm, tempn, dest, src, ans;
303313   UINT32 templ;
304314   UINT16 opcode;
r4425r4426
381391-------------------------------------------------*/
382392static void cfunc_MAC_L(void *param)
383393{
384   SH2 *sh2 = param;
394   SH2 *sh2 = (SH2 *)param;
385395   UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
386396   UINT32 temp0, temp1, temp2, temp3;
387397   INT32 tempm, tempn, fnLmL;
r4425r4426
469479-------------------------------------------------*/
470480static void cfunc_DIV1(void *param)
471481{
472   SH2 *sh2 = param;
482   SH2 *sh2 = (SH2 *)param;
473483   UINT32 tmp0;
474484   UINT32 old_q;
475485   UINT16 opcode;
r4425r4426
574584-------------------------------------------------*/
575585static void cfunc_ADDV(void *param)
576586{
577   SH2 *sh2 = param;
587   SH2 *sh2 = (SH2 *)param;
578588   INT32 dest, src, ans;
579589   UINT16 opcode;
580590   int n, m;
r4425r4426
617627-------------------------------------------------*/
618628static void cfunc_SUBV(void *param)
619629{
620   SH2 *sh2 = param;
630   SH2 *sh2 = (SH2 *)param;
621631   INT32 dest, src, ans;
622632   UINT16 opcode;
623633   int n, m;
r4425r4426
669679      COMPILE_MAX_SEQUENCE,      /* maximum instructions to include in a sequence */
670680      sh2_describe         /* callback to describe a single instruction */
671681   };
672   SH2 *sh2 = *(SH2 **)device->token;
682   SH2 *sh2 = get_safe_token(device);
673683   drccache *cache;
674684   drcbe_info beinfo;
675685   UINT32 flags = 0;
r4425r4426
681691      fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(SH2)));
682692
683693   /* allocate the core memory */
684   *(SH2 **)device->token = sh2 = drccache_memory_alloc_near(cache, sizeof(SH2));
694   *(SH2 **)device->token = sh2 = (SH2 *)drccache_memory_alloc_near(cache, sizeof(SH2));
685695   memset(sh2, 0, sizeof(SH2));
686696
687697   /* initialize the common core parts */
r4425r4426
764774
765775static CPU_EXIT( sh2 )
766776{
767   SH2 *sh2 = *(SH2 **)device->token;
777   SH2 *sh2 = get_safe_token(device);
768778
769779   /* clean up the DRC */
770780   drcfe_exit(sh2->drcfe);
r4425r4426
779789
780790static CPU_RESET( sh2 )
781791{
782   SH2 *sh2 = *(SH2 **)device->token;
783   void *tsave, *tsaved0, *tsaved1;
792   SH2 *sh2 = get_safe_token(device);
793   emu_timer *tsave, *tsaved0, *tsaved1;
784794   UINT32 *m;
785795
786796   void (*f)(UINT32 data);
r4425r4426
833843
834844static CPU_RESET( sh1 )
835845{
836   SH2 *sh2 = *(SH2 **)device->token;
846   SH2 *sh2 = get_safe_token(device);
837847   CPU_RESET_CALL(sh2);
838848   sh2->cpu_type = CPU_TYPE_SH1;
839849}
r4425r4426
869879/* Execute cycles - returns number of cycles actually run */
870880static CPU_EXECUTE( sh2 )
871881{
872   SH2 *sh2 = *(SH2 **)device->token;
882   SH2 *sh2 = get_safe_token(device);
873883   drcuml_state *drcuml = sh2->drcuml;
874884   int execute_result;
875885
r4425r4426
31423152
31433153void sh2drc_set_options(const device_config *device, UINT32 options)
31443154{
3145   SH2 *sh2 = *(SH2 **)device->token;
3155   SH2 *sh2 = get_safe_token(device);
31463156   sh2->drcoptions = options;
31473157}
31483158
r4425r4426
31543164
31553165void sh2drc_add_pcflush(const device_config *device, offs_t address)
31563166{
3157   SH2 *sh2 = *(SH2 **)device->token;
3167   SH2 *sh2 = get_safe_token(device);
31583168
31593169   if (sh2->pcfsel < ARRAY_LENGTH(sh2->pcflushes))
31603170      sh2->pcflushes[sh2->pcfsel++] = address;
r4425r4426
31973207
31983208static CPU_SET_INFO( sh2 )
31993209{
3200   SH2 *sh2 = *(SH2 **)device->token;
3210   SH2 *sh2 = get_safe_token(device);
32013211   switch (state)
32023212   {
32033213      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
32563266
32573267CPU_GET_INFO( sh2 )
32583268{
3259   SH2 *sh2 = (device != NULL && device->token != NULL) ? *(SH2 **)device->token : NULL;
3269   SH2 *sh2 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
32603270   switch (state)
32613271   {
32623272      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/sh2/sh2comn.c
r4425r4426
108108
109109TIMER_CALLBACK( sh2_timer_callback )
110110{
111   SH2 *sh2 = ptr;
111   SH2 *sh2 = (SH2 *)ptr;
112112   UINT16 frc;
113113
114114   sh2_timer_resync(sh2);
r4425r4426
136136TIMER_CALLBACK( sh2_dmac_callback )
137137{
138138   int dma = param & 1;
139   SH2 *sh2 = ptr;
139   SH2 *sh2 = (SH2 *)ptr;
140140
141141   LOG(("SH2.%s: DMA %d complete\n", sh2->device->tag, dma));
142142   sh2->m[0x63+4*dma] |= 2;
r4425r4426
701701
702702void sh2_common_init(SH2 *sh2, const device_config *device, cpu_irq_callback irqcallback)
703703{
704   const sh2_cpu_core *conf = device->static_config;
704   const sh2_cpu_core *conf = (const sh2_cpu_core *)device->static_config;
705705
706706   sh2->timer = timer_alloc(device->machine, sh2_timer_callback, sh2);
707707   timer_adjust_oneshot(sh2->timer, attotime_never, 0);
r4425r4426
712712   sh2->dma_timer[1] = timer_alloc(device->machine, sh2_dmac_callback, sh2);
713713   timer_adjust_oneshot(sh2->dma_timer[1], attotime_never, 0);
714714
715   sh2->m = auto_malloc(0x200);
715   sh2->m = (UINT32 *)auto_malloc(0x200);
716716
717717   if(conf)
718718   {
src/emu/cpu/sm8500/sm8500.c
r4425r4426
5555   UINT8 internal_ram[0x500];
5656};
5757
58INLINE sm8500_state *get_safe_token(const device_config *device)
59{
60   assert(device != NULL);
61   assert(device->token != NULL);
62   assert(device->type == CPU);
63   assert(cpu_get_type(device) == CPU_SM8500);
64   return (sm8500_state *)device->token;
65}
66
5867static const UINT8 sm8500_b2w[8] = {
5968        0, 8, 2, 10, 4, 12, 6, 14
6069};
r4425r4426
8695
8796static CPU_INIT( sm8500 )
8897{
89   sm8500_state *cpustate = device->token;
98   sm8500_state *cpustate = get_safe_token(device);
9099
91100   cpustate->irq_callback = irqcallback;
92101   cpustate->device = device;
r4425r4426
103112
104113static CPU_RESET( sm8500 )
105114{
106   sm8500_state *cpustate = device->token;
115   sm8500_state *cpustate = get_safe_token(device);
107116
108117   cpustate->PC = 0x1020;
109118   cpustate->IE0 = 0;
r4425r4426
217226
218227static CPU_EXECUTE( sm8500 )
219228{
220   sm8500_state *cpustate = device->token;
229   sm8500_state *cpustate = get_safe_token(device);
221230   UINT8   op;
222231   UINT16 oldpc;
223232   int   mycycles;
r4425r4426
258267
259268static CPU_BURN( sm8500 )
260269{
261   sm8500_state *cpustate = device->token;
270   sm8500_state *cpustate = get_safe_token(device);
262271
263272   if ( cycles > 0 ) {
264273      /* burn a number of 4 cycles */
r4425r4426
381390
382391static CPU_SET_INFO( sm8500 )
383392{
384   sm8500_state *cpustate = device->token;
393   sm8500_state *cpustate = get_safe_token(device);
385394
386395   switch(state)
387396   {
r4425r4426
435444
436445CPU_GET_INFO( sm8500 )
437446{
438   sm8500_state *cpustate = (device != NULL) ? device->token : NULL;
447   sm8500_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
439448
440449   switch(state)
441450   {
src/emu/cpu/mb88xx/mb88xx.c
r4425r4426
6060    int icount;
6161};
6262
63INLINE mb88_state *get_safe_token(const device_config *device)
64{
65   assert(device != NULL);
66   assert(device->token != NULL);
67   assert(device->type == CPU);
68   assert(cpu_get_type(device) == CPU_MB88 ||
69         cpu_get_type(device) == CPU_MB8841 ||
70         cpu_get_type(device) == CPU_MB8842 ||
71         cpu_get_type(device) == CPU_MB8843 ||
72         cpu_get_type(device) == CPU_MB8844);
73   return (mb88_state *)device->token;
74}
75
6376/***************************************************************************
6477    MACROS
6578***************************************************************************/
r4425r4426
99112
100113static CPU_INIT( mb88 )
101114{
102   mb88_state *cpustate = device->token;
115   mb88_state *cpustate = get_safe_token(device);
103116
104117   if ( device->static_config )
105118   {
r4425r4426
138151
139152static CPU_RESET( mb88 )
140153{
141   mb88_state *cpustate = device->token;
154   mb88_state *cpustate = get_safe_token(device);
142155
143156   /* zero registers and flags */
144157   cpustate->PC = 0;
r4425r4426
216229
217230static CPU_EXECUTE( mb88 )
218231{
219   mb88_state *cpustate = device->token;
232   mb88_state *cpustate = get_safe_token(device);
220233
221234   cpustate->icount = cycles;
222235
r4425r4426
737750
738751static CPU_SET_INFO( mb88 )
739752{
740   mb88_state *cpustate = device->token;
753   mb88_state *cpustate = get_safe_token(device);
741754
742755   switch (state)
743756   {
r4425r4426
776789
777790CPU_GET_INFO( mb88 )
778791{
779   mb88_state *cpustate = (device != NULL) ? device->token : NULL;
792   mb88_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
780793
781794   switch (state)
782795   {
src/emu/cpu/sh4/sh4.c
r4425r4426
2727#include "sh4regs.h"
2828#include "sh4comn.h"
2929
30INLINE SH4 *get_safe_token(const device_config *device)
31{
32   assert(device != NULL);
33   assert(device->token != NULL);
34   assert(device->type == CPU);
35   assert(cpu_get_type(device) == CPU_SH4);
36   return (SH4 *)device->token;
37}
38
3039/* Called for unimplemented opcodes */
3140static void TODO(SH4 *sh4)
3241{
r4425r4426
32353244
32363245static CPU_RESET( sh4 )
32373246{
3238   SH4 *sh4 = device->token;
3239   void *tsaved[4];
3247   SH4 *sh4 = get_safe_token(device);
3248   emu_timer *tsaved[4];
32403249   emu_timer *tsave[5];
32413250   UINT32 *m;
32423251   int save_is_slave;
r4425r4426
33133322/* Execute cycles - returns number of cycles actually run */
33143323static CPU_EXECUTE( sh4 )
33153324{
3316   SH4 *sh4 = device->token;
3325   SH4 *sh4 = get_safe_token(device);
33173326   sh4->sh4_icount = cycles;
33183327
33193328   if (sh4->cpu_off)
r4425r4426
33743383
33753384static CPU_INIT( sh4 )
33763385{
3377   const struct sh4_config *conf = device->static_config;
3378   SH4 *sh4 = device->token;
3386   const struct sh4_config *conf = (const struct sh4_config *)device->static_config;
3387   SH4 *sh4 = get_safe_token(device);
33793388
33803389   sh4_common_init(device);
33813390
r4425r4426
34633472
34643473static CPU_SET_INFO( sh4 )
34653474{
3466   SH4 *sh4 = device->token;
3475   SH4 *sh4 = get_safe_token(device);
34673476
34683477   switch (state)
34693478   {
r4425r4426
36273636
36283637CPU_GET_INFO( sh4 )
36293638{
3630   SH4 *sh4 = (device != NULL) ? device->token : NULL;
3639   SH4 *sh4 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
36313640
36323641   switch (state)
36333642   {
src/emu/cpu/sh4/sh4comn.c
r4425r4426
3030static const UINT16 tcor[] = { TCOR0, TCOR1, TCOR2 };
3131static const UINT16 tcr[] = { TCR0, TCR1, TCR2 };
3232
33INLINE SH4 *get_safe_token(const device_config *device)
34{
35   assert(device != NULL);
36   assert(device->token != NULL);
37   assert(device->type == CPU);
38   assert(cpu_get_type(device) == CPU_SH4);
39   return (SH4 *)device->token;
40}
41
3342void sh4_change_register_bank(SH4 *sh4, int to)
3443{
3544int s;
r4425r4426
254263
255264static TIMER_CALLBACK( sh4_refresh_timer_callback )
256265{
257   SH4 *sh4 = ptr;
266   SH4 *sh4 = (SH4 *)ptr;
258267
259268   sh4->m[RTCNT] = 0;
260269   sh4_refresh_timer_recompute(sh4);
r4425r4426
365374
366375static TIMER_CALLBACK( sh4_rtc_timer_callback )
367376{
368   SH4 *sh4 = ptr;
377   SH4 *sh4 = (SH4 *)ptr;
369378
370379   timer_adjust_oneshot(sh4->rtc_timer, ATTOTIME_IN_HZ(128), 0);
371380   sh4->m[R64CNT] = (sh4->m[R64CNT]+1) & 0x7f;
r4425r4426
380389static TIMER_CALLBACK( sh4_timer_callback )
381390{
382391   static const UINT16 tuni[] = { SH4_INTC_TUNI0, SH4_INTC_TUNI1, SH4_INTC_TUNI2 };
383   SH4 *sh4 = ptr;
392   SH4 *sh4 = (SH4 *)ptr;
384393   int which = param;
385394   int idx = tcr[which];
386395
r4425r4426
393402
394403static TIMER_CALLBACK( sh4_dmac_callback )
395404{
396   SH4 *sh4 = ptr;
405   SH4 *sh4 = (SH4 *)ptr;
397406   int channel = param;
398407
399408   LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag, channel));
r4425r4426
623632
624633WRITE32_HANDLER( sh4_internal_w )
625634{
626   SH4 *sh4 = space->cpu->token;
635   SH4 *sh4 = get_safe_token(space->cpu);
627636   int a;
628637   UINT32 old = sh4->m[offset];
629638   COMBINE_DATA(sh4->m+offset);
r4425r4426
909918
910919READ32_HANDLER( sh4_internal_r )
911920{
912   SH4 *sh4 = space->cpu->token;
921   SH4 *sh4 = get_safe_token(space->cpu);
913922   //  logerror("sh4_internal_r:  Read %08x (%x) @ %08x\n", 0xfe000000+((offset & 0x3fc0) << 11)+((offset & 0x3f) << 2), offset, mem_mask);
914923   switch( offset )
915924   {
r4425r4426
958967
959968void sh4_set_frt_input(const device_config *device, int state)
960969{
961   SH4 *sh4 = device->token;
970   SH4 *sh4 = get_safe_token(device);
962971
963972   if(state == PULSE_LINE)
964973   {
r4425r4426
9941003
9951004void sh4_set_irln_input(const device_config *device, int value)
9961005{
997   SH4 *sh4 = device->token;
1006   SH4 *sh4 = get_safe_token(device);
9981007
9991008   if (sh4->irln == value)
10001009      return;
r4425r4426
11231132
11241133void sh4_common_init(const device_config *device)
11251134{
1126   SH4 *sh4 = device->token;
1135   SH4 *sh4 = get_safe_token(device);
11271136   int i;
11281137
11291138   for (i=0; i<3; i++)
r4425r4426
11451154   sh4->rtc_timer = timer_alloc(device->machine, sh4_rtc_timer_callback, sh4);
11461155   timer_adjust_oneshot(sh4->rtc_timer, attotime_never, 0);
11471156
1148   sh4->m = auto_malloc(16384*4);
1157   sh4->m = (UINT32 *)auto_malloc(16384*4);
11491158}
11501159
11511160void sh4_dma_ddt(SH4 *sh4, struct sh4_ddt_dma *s)
src/emu/cpu/tms32051/tms32051.c
r4425r4426
149149   int icount;
150150};
151151
152INLINE tms32051_state *get_safe_token(const device_config *device)
153{
154   assert(device != NULL);
155   assert(device->token != NULL);
156   assert(device->type == CPU);
157   assert(cpu_get_type(device) == CPU_TMS32051);
158   return (tms32051_state *)device->token;
159}
160
152161static void delay_slot(tms32051_state *cpustate, UINT16 startpc);
153162static void save_interrupt_context(tms32051_state *cpustate);
154163static void restore_interrupt_context(tms32051_state *cpustate);
r4425r4426
213222
214223static CPU_INIT( tms )
215224{
216   tms32051_state *cpustate = device->token;
225   tms32051_state *cpustate = get_safe_token(device);
217226
218227   cpustate->device = device;
219228   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
222231
223232static CPU_RESET( tms )
224233{
225   tms32051_state *cpustate = device->token;
234   tms32051_state *cpustate = get_safe_token(device);
226235   int i;
227236   UINT16 src, dst, length;
228237
r4425r4426
328337
329338static CPU_EXECUTE( tms )
330339{
331   tms32051_state *cpustate = device->token;
340   tms32051_state *cpustate = get_safe_token(device);
332341
333342   cpustate->icount = cycles;
334343
r4425r4426
396405
397406static READ16_HANDLER( cpuregs_r )
398407{
399   tms32051_state *cpustate = space->cpu->token;
408   tms32051_state *cpustate = get_safe_token(space->cpu);
400409
401410   switch (offset)
402411   {
r4425r4426
448457
449458static WRITE16_HANDLER( cpuregs_w )
450459{
451   tms32051_state *cpustate = space->cpu->token;
460   tms32051_state *cpustate = get_safe_token(space->cpu);
452461
453462   switch (offset)
454463   {
r4425r4426
542551
543552static CPU_SET_INFO( tms )
544553{
545   tms32051_state *cpustate = device->token;
554   tms32051_state *cpustate = get_safe_token(device);
546555
547556   switch (state)
548557   {
r4425r4426
553562
554563static CPU_READ( tms )
555564{
556   tms32051_state *cpustate = device->token;
565   tms32051_state *cpustate = get_safe_token(device);
557566   if (space == ADDRESS_SPACE_PROGRAM)
558567   {
559568      *value = (PM_READ16(cpustate, offset>>1) >> ((offset & 1) ? 0 : 8)) & 0xff;
r4425r4426
567576
568577static CPU_GET_INFO( tms )
569578{
570   tms32051_state *cpustate = (device != NULL) ? device->token : NULL;
579   tms32051_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
571580
572581   switch(state)
573582   {
r4425r4426
673682#if (HAS_TMS32051)
674683static CPU_SET_INFO( tms32051 )
675684{
676   tms32051_state *cpustate = device->token;
685   tms32051_state *cpustate = get_safe_token(device);
677686
678687   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
679688   {
src/emu/cpu/alph8201/alph8201.c
r4425r4426
223223#define LP1            lp1
224224#define LP2            lp2
225225
226INLINE alpha8201_state *get_safe_token(const device_config *device)
227{
228   assert(device != NULL);
229   assert(device->token != NULL);
230   assert(device->type == CPU);
231   assert(cpu_get_type(device) == CPU_ALPHA8201 ||
232         cpu_get_type(device) == CPU_ALPHA8301);
233   return (alpha8201_state *)device->token;
234}
235
226236/* Get next opcode argument and increment program counter */
227237INLINE unsigned M_RDMEM_OPCODE (alpha8201_state *cpustate)
228238{
r4425r4426
660670 ****************************************************************************/
661671static CPU_INIT( alpha8201 )
662672{
663   alpha8201_state *cpustate = device->token;
673   alpha8201_state *cpustate = get_safe_token(device);
664674
665675   cpustate->device = device;
666676   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
692702 ****************************************************************************/
693703static CPU_RESET( alpha8201 )
694704{
695   alpha8201_state *cpustate = device->token;
705   alpha8201_state *cpustate = get_safe_token(device);
696706   cpustate->PC     = 0;
697707   cpustate->regPtr = 0;
698708   cpustate->zf     = 0;
r4425r4426
725735
726736static int alpha8xxx_execute(const device_config *device,const s_opcode *op_map,int cycles)
727737{
728   alpha8201_state *cpustate = device->token;
738   alpha8201_state *cpustate = get_safe_token(device);
729739   unsigned opcode;
730740   UINT8 pcptr;
731741
r4425r4426
832842
833843static CPU_SET_INFO( alpha8201 )
834844{
835   alpha8201_state *cpustate = device->token;
845   alpha8201_state *cpustate = get_safe_token(device);
836846   switch (state)
837847   {
838848#if HANDLE_HALT_LINE
r4425r4426
876886/* 8201 and 8301 */
877887static CPU_GET_INFO( alpha8xxx )
878888{
879   alpha8201_state *cpustate = (device != NULL) ? device->token : NULL;
889   alpha8201_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
880890   switch (state)
881891   {
882892      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/apexc/apexc.c
r4425r4426
367367#define DELAY(n)   {cpustate->icount -= (n); cpustate->current_word = (cpustate->current_word + (n)) & 0x1f;}
368368
369369
370INLINE apexc_state *get_safe_token(const device_config *device)
371{
372   assert(device != NULL);
373   assert(device->token != NULL);
374   assert(device->type == CPU);
375   assert(cpu_get_type(device) == CPU_APEXC);
376   return (apexc_state *)device->token;
377}
378
379
370380/*
371381    word accessor functions
372382
r4425r4426
787797
788798static CPU_INIT( apexc )
789799{
790   apexc_state *cpustate = device->token;
800   apexc_state *cpustate = get_safe_token(device);
791801
792802   cpustate->device = device;
793803   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
796806
797807static CPU_RESET( apexc )
798808{
799   apexc_state *cpustate = device->token;
809   apexc_state *cpustate = get_safe_token(device);
800810
801811   /* mmmh...  I don't know what happens on reset with an actual APEXC. */
802812
r4425r4426
811821
812822static CPU_EXECUTE( apexc )
813823{
814   apexc_state *cpustate = device->token;
824   apexc_state *cpustate = get_safe_token(device);
815825
816826   cpustate->icount = cycles;
817827
r4425r4426
832842
833843static CPU_SET_INFO( apexc )
834844{
835   apexc_state *cpustate = device->token;
845   apexc_state *cpustate = get_safe_token(device);
836846
837847   switch (state)
838848   {
r4425r4426
867877
868878CPU_GET_INFO( apexc )
869879{
870   apexc_state *cpustate = (device != NULL) ? device->token : NULL;
880   apexc_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
871881
872882   switch (state)
873883   {
src/emu/cpu/g65816/g65816.c
r4425r4426
9090
9191#include "g65816.h"
9292
93INLINE g65816i_cpu_struct *get_safe_token(const device_config *device)
94{
95   assert(device != NULL);
96   assert(device->token != NULL);
97   assert(device->type == CPU);
98   assert(cpu_get_type(device) == CPU_G65816);
99   return (g65816i_cpu_struct *)device->token;
100}
101
93102/* Temporary Variables */
94103
95104static CPU_READOP( g65816 )
96105{
97   g65816i_cpu_struct *cpustate = device->token;
106   g65816i_cpu_struct *cpustate = get_safe_token(device);
98107
99108   *value = g65816_read_8_immediate(offset);
100109
r4425r4426
183192
184193static CPU_RESET( g65816 )
185194{
186   g65816i_cpu_struct *cpustate = device->token;
195   g65816i_cpu_struct *cpustate = get_safe_token(device);
187196
188197   /* Start the CPU */
189198   CPU_STOPPED = 0;
r4425r4426
234243/* Execute some instructions */
235244static CPU_EXECUTE( g65816 )
236245{
237   g65816i_cpu_struct *cpustate = device->token;
246   g65816i_cpu_struct *cpustate = get_safe_token(device);
238247
239248   return FTABLE_EXECUTE(cpustate, cycles);
240249}
r4425r4426
300309
301310static CPU_DISASSEMBLE( g65816 )
302311{
303   g65816i_cpu_struct *cpustate = device->token;
312   g65816i_cpu_struct *cpustate = get_safe_token(device);
304313
305314   return g65816_disassemble(buffer, (pc & 0x00ffff), (pc & 0xff0000) >> 16, oprom, FLAG_M, FLAG_X);
306315}
r4425r4426
318327
319328static CPU_INIT( g65816 )
320329{
321   g65816i_cpu_struct *cpustate = device->token;
330   g65816i_cpu_struct *cpustate = get_safe_token(device);
322331
323332   memset(cpustate, 0, sizeof(cpustate));
324333
r4425r4426
360369
361370static CPU_SET_INFO( g65816 )
362371{
363   g65816i_cpu_struct *cpustate = device->token;
372   g65816i_cpu_struct *cpustate = get_safe_token(device);
364373
365374   switch (state)
366375   {
r4425r4426
401410
402411CPU_GET_INFO( g65816 )
403412{
404   g65816i_cpu_struct *cpustate = (device != NULL) ? device->token : NULL;
413   g65816i_cpu_struct *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
405414
406415   switch (state)
407416   {
src/emu/cpu/nec/nec.c
r4425r4426
180180
181181};
182182
183INLINE nec_state_t *get_safe_token(const device_config *device)
184{
185   assert(device != NULL);
186   assert(device->token != NULL);
187   assert(device->type == CPU);
188   assert(cpu_get_type(device) == CPU_V20 ||
189         cpu_get_type(device) == CPU_V25 ||
190         cpu_get_type(device) == CPU_V30 ||
191         cpu_get_type(device) == CPU_V33 ||
192         cpu_get_type(device) == CPU_V35);
193   return (nec_state_t *)device->token;
194}
195
183196/* The interrupt number of a pending external interrupt pending NMI is 2.   */
184197/* For INTR interrupts, the level is caught on the bus during an INTA cycle */
185198
r4425r4426
267280
268281static CPU_RESET( nec )
269282{
270   nec_state_t *nec_state = device->token;
283   nec_state_t *nec_state = get_safe_token(device);
271284   unsigned int i,j,c;
272285    static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH };
273286
r4425r4426
10821095
10831096static CPU_DISASSEMBLE( nec )
10841097{
1085   nec_state_t *nec_state = device->token;
1098   nec_state_t *nec_state = get_safe_token(device);
10861099
10871100   return necv_dasm_one(buffer, pc, oprom, nec_state->config);
10881101}
10891102
10901103static void nec_init(const device_config *device, cpu_irq_callback irqcallback, int type)
10911104{
1092   const nec_config *config = device->static_config ? device->static_config : &default_config;
1093   nec_state_t *nec_state = device->token;
1105   const nec_config *config = device->static_config ? (const nec_config *)device->static_config : &default_config;
1106   nec_state_t *nec_state = get_safe_token(device);
10941107
10951108   nec_state->config = config;
10961109
r4425r4426
11791192
11801193static CPU_EXECUTE( necv )
11811194{
1182   nec_state_t *nec_state = device->token;
1195   nec_state_t *nec_state = get_safe_token(device);
11831196   int prev_ICount;
11841197
11851198   nec_state->icount=cycles;
r4425r4426
12101223#if (HAS_V20||HAS_V25)
12111224static CPU_INIT( v20 )
12121225{
1213   nec_state_t *nec_state = device->token;
1226   nec_state_t *nec_state = get_safe_token(device);
12141227
12151228   nec_init(device, irqcallback, 0);
12161229   configure_memory_8bit(nec_state);
r4425r4426
12231236#if (HAS_V30||HAS_V35)
12241237static CPU_INIT( v30 )
12251238{
1226   nec_state_t *nec_state = device->token;
1239   nec_state_t *nec_state = get_safe_token(device);
12271240
12281241   nec_init(device, irqcallback, 1);
12291242   configure_memory_16bit(nec_state);
r4425r4426
12371250#if (HAS_V33)
12381251static CPU_INIT( v33 )
12391252{
1240   nec_state_t *nec_state = device->token;
1253   nec_state_t *nec_state = get_safe_token(device);
12411254
12421255   nec_init(device, irqcallback, 2);
12431256   nec_state->chip_type=V33;
r4425r4426
12591272
12601273static CPU_SET_INFO( nec )
12611274{
1262   nec_state_t *nec_state = device->token;
1275   nec_state_t *nec_state = get_safe_token(device);
12631276
12641277   switch (state)
12651278   {
r4425r4426
13171330
13181331static CPU_GET_INFO( nec )
13191332{
1320   nec_state_t *nec_state = (device != NULL) ? device->token : NULL;
1333   nec_state_t *nec_state = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
13211334   int flags;
13221335
13231336   switch (state)
src/emu/cpu/mips/mips3com.h
r4425r4426
3737{
3838   /* MIPS III variants */
3939   MIPS3_TYPE_MIPS_III,
40   MIPS3_TYPE_VR4300,
4041   MIPS3_TYPE_R4600,
4142   MIPS3_TYPE_R4650,
4243   MIPS3_TYPE_R4700,
r4425r4426
103104#define SR_SR               0x00100000
104105#define SR_TS               0x00200000
105106#define SR_BEV               0x00400000
107#define SR_ITS               0x01000000   /* VR4300 only, Application Note doesn't give purpose */
106108#define SR_RE               0x02000000
107109#define SR_FR               0x04000000
108110#define SR_RP               0x08000000
src/emu/cpu/mips/mips3.h
r4425r4426
229229void mips3drc_add_fastram(const device_config *device, offs_t start, offs_t end, UINT8 readonly, void *base);
230230void mips3drc_add_hotspot(const device_config *device, offs_t pc, UINT32 opcode, UINT32 cycles);
231231
232#if (HAS_VR4300)
233CPU_GET_INFO( vr4300be );
234CPU_GET_INFO( vr4300le );
235#define CPU_VR4300BE CPU_GET_INFO_NAME( vr4300be )
236#define CPU_VR4300LE CPU_GET_INFO_NAME( vr4300le )
237CPU_GET_INFO( vr4310be );
238CPU_GET_INFO( vr4310le );
239#define CPU_VR4310BE CPU_GET_INFO_NAME( vr4310be )
240#define CPU_VR4310LE CPU_GET_INFO_NAME( vr4310le )
241#endif
232242
233243#if (HAS_R4600)
234244CPU_GET_INFO( r4600be );
src/emu/cpu/mips/r3000.c
r4425r4426
159159   size_t      dcache_size;
160160};
161161
162INLINE r3000_state *get_safe_token(const device_config *device)
163{
164   assert(device != NULL);
165   assert(device->token != NULL);
166   assert(device->type == CPU);
167   assert(cpu_get_type(device) == CPU_R3000BE ||
168         cpu_get_type(device) == CPU_R3000LE ||
169         cpu_get_type(device) == CPU_R3041BE ||
170         cpu_get_type(device) == CPU_R3041LE);
171   return (r3000_state *)device->token;
172}
162173
163174
164175/***************************************************************************
r4425r4426
286297
287298static CPU_INIT( r3000 )
288299{
289   const r3000_cpu_core *configdata = device->static_config;
290   r3000_state *r3000 = device->token;
300   const r3000_cpu_core *configdata = (const r3000_cpu_core *)device->static_config;
301   r3000_state *r3000 = get_safe_token(device);
291302
292303   /* allocate memory */
293   r3000->icache = auto_malloc(configdata->icache);
294   r3000->dcache = auto_malloc(configdata->dcache);
304   r3000->icache = (UINT32 *)auto_malloc(configdata->icache);
305   r3000->dcache = (UINT32 *)auto_malloc(configdata->dcache);
295306
296307   r3000->icache_size = configdata->icache;
297308   r3000->dcache_size = configdata->dcache;
r4425r4426
340351
341352static CPU_RESET( r3000be )
342353{
343   r3000_reset(device->token, 1);
354   r3000_reset(get_safe_token(device), 1);
344355}
345356
346357static CPU_RESET( r3000le )
347358{
348   r3000_reset(device->token, 0);
359   r3000_reset(get_safe_token(device), 0);
349360}
350361
351362
r4425r4426
677688
678689static CPU_EXECUTE( r3000 )
679690{
680   r3000_state *r3000 = device->token;
691   r3000_state *r3000 = get_safe_token(device);
681692
682693   /* count cycles and interrupt cycles */
683694   r3000->icount = cycles;
r4425r4426
902913
903914static UINT8 readcache_be(const address_space *space, offs_t offset)
904915{
905   r3000_state *r3000 = space->cpu->token;
916   r3000_state *r3000 = get_safe_token(space->cpu);
906917   offset &= 0x1fffffff;
907918   return (offset * 4 < r3000->cache_size) ? r3000->cache[BYTE4_XOR_BE(offset)] : 0xff;
908919}
909920
910921static UINT16 readcache_be_word(const address_space *space, offs_t offset)
911922{
912   r3000_state *r3000 = space->cpu->token;
923   r3000_state *r3000 = get_safe_token(space->cpu);
913924   offset &= 0x1fffffff;
914925   return (offset * 4 < r3000->cache_size) ? *(UINT16 *)&r3000->cache[WORD_XOR_BE(offset)] : 0xffff;
915926}
916927
917928static UINT32 readcache_be_dword(const address_space *space, offs_t offset)
918929{
919   r3000_state *r3000 = space->cpu->token;
930   r3000_state *r3000 = get_safe_token(space->cpu);
920931   offset &= 0x1fffffff;
921932   return (offset * 4 < r3000->cache_size) ? *(UINT32 *)&r3000->cache[offset] : 0xffffffff;
922933}
923934
924935static void writecache_be(const address_space *space, offs_t offset, UINT8 data)
925936{
926   r3000_state *r3000 = space->cpu->token;
937   r3000_state *r3000 = get_safe_token(space->cpu);
927938   offset &= 0x1fffffff;
928939   if (offset * 4 < r3000->cache_size) r3000->cache[BYTE4_XOR_BE(offset)] = data;
929940}
930941
931942static void writecache_be_word(const address_space *space, offs_t offset, UINT16 data)
932943{
933   r3000_state *r3000 = space->cpu->token;
944   r3000_state *r3000 = get_safe_token(space->cpu);
934945   offset &= 0x1fffffff;
935946   if (offset * 4 < r3000->cache_size) *(UINT16 *)&r3000->cache[WORD_XOR_BE(offset)] = data;
936947}
937948
938949static void writecache_be_dword(const address_space *space, offs_t offset, UINT32 data)
939950{
940   r3000_state *r3000 = space->cpu->token;
951   r3000_state *r3000 = get_safe_token(space->cpu);
941952   offset &= 0x1fffffff;
942953   if (offset * 4 < r3000->cache_size) *(UINT32 *)&r3000->cache[offset] = data;
943954}
944955
945956static UINT8 readcache_le(const address_space *space, offs_t offset)
946957{
947   r3000_state *r3000 = space->cpu->token;
958   r3000_state *r3000 = get_safe_token(space->cpu);
948959   offset &= 0x1fffffff;
949960   return (offset * 4 < r3000->cache_size) ? r3000->cache[BYTE4_XOR_LE(offset)] : 0xff;
950961}
951962
952963static UINT16 readcache_le_word(const address_space *space, offs_t offset)
953964{
954   r3000_state *r3000 = space->cpu->token;
965   r3000_state *r3000 = get_safe_token(space->cpu);
955966   offset &= 0x1fffffff;
956967   return (offset * 4 < r3000->cache_size) ? *(UINT16 *)&r3000->cache[WORD_XOR_LE(offset)] : 0xffff;
957968}
958969
959970static UINT32 readcache_le_dword(const address_space *space, offs_t offset)
960971{
961   r3000_state *r3000 = space->cpu->token;
972   r3000_state *r3000 = get_safe_token(space->cpu);
962973   offset &= 0x1fffffff;
963974   return (offset * 4 < r3000->cache_size) ? *(UINT32 *)&r3000->cache[offset] : 0xffffffff;
964975}
965976
966977static void writecache_le(const address_space *space, offs_t offset, UINT8 data)
967978{
968   r3000_state *r3000 = space->cpu->token;
979   r3000_state *r3000 = get_safe_token(space->cpu);
969980   offset &= 0x1fffffff;
970981   if (offset * 4 < r3000->cache_size) r3000->cache[BYTE4_XOR_LE(offset)] = data;
971982}
972983
973984static void writecache_le_word(const address_space *space, offs_t offset, UINT16 data)
974985{
975   r3000_state *r3000 = space->cpu->token;
986   r3000_state *r3000 = get_safe_token(space->cpu);
976987   offset &= 0x1fffffff;
977988   if (offset * 4 < r3000->cache_size) *(UINT16 *)&r3000->cache[WORD_XOR_LE(offset)] = data;
978989}
979990
980991static void writecache_le_dword(const address_space *space, offs_t offset, UINT32 data)
981992{
982   r3000_state *r3000 = space->cpu->token;
993   r3000_state *r3000 = get_safe_token(space->cpu);
983994   offset &= 0x1fffffff;
984995   if (offset * 4 < r3000->cache_size) *(UINT32 *)&r3000->cache[offset] = data;
985996}
r4425r4426
11091120
11101121static CPU_SET_INFO( r3000 )
11111122{
1112   r3000_state *r3000 = device->token;
1123   r3000_state *r3000 = get_safe_token(device);
11131124   switch (state)
11141125   {
11151126      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
11681179
11691180static CPU_GET_INFO( r3000 )
11701181{
1171   r3000_state *r3000 = (device != NULL) ? device->token : NULL;
1182   r3000_state *r3000 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
11721183   switch (state)
11731184   {
11741185      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/mips/mips3fe.c
r4425r4426
4141
4242int mips3fe_describe(void *param, opcode_desc *desc, const opcode_desc *prev)
4343{
44   mips3_state *mips = param;
44   mips3_state *mips = (mips3_state *)param;
4545   UINT32 op, opswitch;
4646
4747   /* compute the physical PC */
src/emu/cpu/mips/psx.c
r4425r4426
193193   UINT32 bad_word_address_mask;
194194};
195195
196INLINE psxcpu_state *get_safe_token(const device_config *device)
197{
198   assert(device != NULL);
199   assert(device->token != NULL);
200   assert(device->type == CPU);
201   assert(cpu_get_type(device) == CPU_PSXCPU);
202   return (psxcpu_state *)device->token;
203}
204
196205static const UINT32 mips_mtc0_writemask[]=
197206{
198207   0x00000000, /* !INDEX */
r4425r4426
12781287
12791288static READ32_HANDLER( psx_berr_r )
12801289{
1281   psxcpu_state *psxcpu = space->cpu->token;
1290   psxcpu_state *psxcpu = get_safe_token(space->cpu);
12821291
12831292   psxcpu->berr = 1;
12841293
r4425r4426
12871296
12881297static WRITE32_HANDLER( psx_berr_w )
12891298{
1290   psxcpu_state *psxcpu = space->cpu->token;
1299   psxcpu_state *psxcpu = get_safe_token(space->cpu);
12911300
12921301   psxcpu->berr = 1;
12931302}
12941303
12951304static void mips_update_scratchpad( const address_space *space )
12961305{
1297   psxcpu_state *psxcpu = space->cpu->token;
1306   psxcpu_state *psxcpu = get_safe_token(space->cpu);
12981307
12991308   if( ( psxcpu->biu & BIU_RAM ) == 0 )
13001309   {
r4425r4426
13021311   }
13031312   else if( ( psxcpu->biu & BIU_DS ) == 0 )
13041313   {
1305      memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, SMH_NOP );
1314      memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, (write32_space_func)SMH_NOP );
13061315   }
13071316   else
13081317   {
1309      memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32, SMH_BANK32 );
1318      memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, (read32_space_func)SMH_BANK32, (write32_space_func)SMH_BANK32 );
13101319
13111320      memory_set_bankptr(space->machine,  32, psxcpu->dcache );
13121321   }
r4425r4426
15901599
15911600static STATE_POSTLOAD( mips_postload )
15921601{
1593   psxcpu_state *psxcpu = param;
1602   psxcpu_state *psxcpu = (psxcpu_state *)param;
15941603
15951604   mips_update_memory_handlers( psxcpu );
15961605   mips_update_address_masks( psxcpu );
r4425r4426
15991608
16001609static void mips_state_register( const char *type, const device_config *device )
16011610{
1602   psxcpu_state *psxcpu = device->token;
1611   psxcpu_state *psxcpu = get_safe_token(device);
16031612
16041613   state_save_register_device_item( device, 0, psxcpu->op );
16051614   state_save_register_device_item( device, 0, psxcpu->pc );
r4425r4426
16231632
16241633static CPU_INIT( psxcpu )
16251634{
1626   psxcpu_state *psxcpu = device->token;
1635   psxcpu_state *psxcpu = get_safe_token(device);
16271636//  psxcpu->intf = (psxcpu_interface *) device->static_config;
16281637
16291638   psxcpu->irq_callback = irqcallback;
r4425r4426
16351644
16361645static CPU_RESET( psxcpu )
16371646{
1638   psxcpu_state *psxcpu = device->token;
1647   psxcpu_state *psxcpu = get_safe_token(device);
16391648
16401649   psxcpu->delayr = 0;
16411650   psxcpu->delayv = 0;
r4425r4426
18381847
18391848static CPU_EXECUTE( psxcpu )
18401849{
1841   psxcpu_state *psxcpu = device->token;
1850   psxcpu_state *psxcpu = get_safe_token(device);
18421851
18431852   psxcpu->icount = cycles;
18441853
r4425r4426
28962905
28972906static READ32_HANDLER( psx_biu_r )
28982907{
2899   psxcpu_state *psxcpu = space->cpu->token;
2908   psxcpu_state *psxcpu = get_safe_token(space->cpu);
29002909
29012910   return psxcpu->biu;
29022911}
29032912
29042913static WRITE32_HANDLER( psx_biu_w )
29052914{
2906   psxcpu_state *psxcpu = space->cpu->token;
2915   psxcpu_state *psxcpu = get_safe_token(space->cpu);
29072916   UINT32 old = psxcpu->biu;
29082917
29092918   COMBINE_DATA( &psxcpu->biu );
r4425r4426
29412950
29422951static CPU_DISASSEMBLE( psxcpu )
29432952{
2944   psxcpu_state *psxcpu = device->token;
2953   psxcpu_state *psxcpu = get_safe_token(device);
29452954   DasmPSXCPU_state state;
29462955
29472956   state.pc = psxcpu->pc;
r4425r4426
59605969
59615970static CPU_SET_INFO( psxcpu )
59625971{
5963   psxcpu_state *psxcpu = device->token;
5972   psxcpu_state *psxcpu = get_safe_token(device);
59645973   switch (state)
59655974   {
59665975      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
61026111
61036112CPU_GET_INFO( psxcpu )
61046113{
6105   psxcpu_state *psxcpu = (device != NULL) ? device->token : NULL;
6114   psxcpu_state *psxcpu = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
61066115   switch (state)
61076116   {
61086117      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/mips/mips3drc.c
r4425r4426
274274    INLINE FUNCTIONS
275275***************************************************************************/
276276
277INLINE mips3_state *get_safe_token(const device_config *device)
278{
279   assert(device != NULL);
280   assert(device->token != NULL);
281   assert(device->type == CPU);
282   assert(cpu_get_type(device) == CPU_VR4300BE ||
283         cpu_get_type(device) == CPU_VR4300LE ||
284         cpu_get_type(device) == CPU_VR4310BE ||
285         cpu_get_type(device) == CPU_VR4310LE ||
286         cpu_get_type(device) == CPU_R4600BE ||
287         cpu_get_type(device) == CPU_R4600LE ||
288         cpu_get_type(device) == CPU_R4650BE ||
289         cpu_get_type(device) == CPU_R4650LE ||
290         cpu_get_type(device) == CPU_R4700BE ||
291         cpu_get_type(device) == CPU_R4700LE ||
292         cpu_get_type(device) == CPU_R5000BE ||
293         cpu_get_type(device) == CPU_R5000LE ||
294         cpu_get_type(device) == CPU_QED5271BE ||
295         cpu_get_type(device) == CPU_QED5271LE ||
296         cpu_get_type(device) == CPU_RM7000BE ||
297         cpu_get_type(device) == CPU_RM7000LE);
298   return *(mips3_state **)device->token;
299}
300
301
277302/*-------------------------------------------------
278303    epc - compute the exception PC from a
279304    descriptor
r4425r4426
352377   int regnum;
353378
354379   /* allocate enough space for the cache and the core */
355   cache = drccache_alloc(CACHE_SIZE + sizeof(*mips3));
380   cache = (drccache *)drccache_alloc(CACHE_SIZE + sizeof(*mips3));
356381   if (cache == NULL)
357382      fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(*mips3)));
358383
359384   /* allocate the core memory */
360   *(mips3_state **)device->token = mips3 = drccache_memory_alloc_near(cache, sizeof(*mips3));
385   *(mips3_state **)device->token = mips3 = (mips3_state *)drccache_memory_alloc_near(cache, sizeof(*mips3));
361386   memset(mips3, 0, sizeof(*mips3));
362387
363388   /* initialize the core */
364389   mips3com_init(mips3, flavor, bigendian, device, irqcallback);
365390
366391   /* allocate the implementation-specific state from the full cache */
367   mips3->impstate = drccache_memory_alloc_near(cache, sizeof(*mips3->impstate));
392   mips3->impstate = (mips3imp_state *)drccache_memory_alloc_near(cache, sizeof(*mips3->impstate));
368393   memset(mips3->impstate, 0, sizeof(*mips3->impstate));
369394   mips3->impstate->cache = cache;
370395
r4425r4426
471496
472497static CPU_RESET( mips3 )
473498{
474   mips3_state *mips3 = *(mips3_state **)device->token;
499   mips3_state *mips3 = get_safe_token(device);
475500
476501   /* reset the common code and mark the cache dirty */
477502   mips3com_reset(mips3);
r4425r4426
487512
488513static CPU_EXECUTE( mips3 )
489514{
490   mips3_state *mips3 = *(mips3_state **)device->token;
515   mips3_state *mips3 = get_safe_token(device);
491516   drcuml_state *drcuml = mips3->impstate->drcuml;
492517   int execute_result;
493518
r4425r4426
524549
525550static CPU_EXIT( mips3 )
526551{
527   mips3_state *mips3 = *(mips3_state **)device->token;
552   mips3_state *mips3 = get_safe_token(device);
528553   mips3com_exit(mips3);
529554
530555   /* clean up the DRC */
r4425r4426
541566
542567static CPU_TRANSLATE( mips3 )
543568{
544   mips3_state *mips3 = *(mips3_state **)device->token;
569   mips3_state *mips3 = get_safe_token(device);
545570   return mips3com_translate_address(mips3, space, intention, address);
546571}
547572
r4425r4426
552577
553578static CPU_DISASSEMBLE( mips3 )
554579{
555   mips3_state *mips3 = *(mips3_state **)device->token;
580   mips3_state *mips3 = get_safe_token(device);
556581   return mips3com_dasm(mips3, buffer, pc, oprom, opram);
557582}
558583
r4425r4426
564589
565590static CPU_SET_INFO( mips3 )
566591{
567   mips3_state *mips3 = *(mips3_state **)device->token;
592   mips3_state *mips3 = get_safe_token(device);
568593
569594   /* --- everything is handled generically --- */
570595   mips3com_set_info(mips3, state, info);
r4425r4426
578603
579604static CPU_GET_INFO( mips3 )
580605{
581   mips3_state *mips3 = (device != NULL && device->token != NULL) ? *(mips3_state **)device->token : NULL;
606   mips3_state *mips3 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
582607   switch (state)
583608   {
584609      /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
609634
610635void mips3drc_set_options(const device_config *device, UINT32 options)
611636{
612   mips3_state *mips3 = *(mips3_state **)device->token;
637   mips3_state *mips3 = get_safe_token(device);
613638   mips3->impstate->drcoptions = options;
614639}
615640
r4425r4426
621646
622647void mips3drc_add_fastram(const device_config *device, offs_t start, offs_t end, UINT8 readonly, void *base)
623648{
624   mips3_state *mips3 = *(mips3_state **)device->token;
649   mips3_state *mips3 = get_safe_token(device);
625650   if (mips3->impstate->fastram_select < ARRAY_LENGTH(mips3->impstate->fastram))
626651   {
627652      mips3->impstate->fastram[mips3->impstate->fastram_select].start = start;
r4425r4426
639664
640665void mips3drc_add_hotspot(const device_config *device, offs_t pc, UINT32 opcode, UINT32 cycles)
641666{
642   mips3_state *mips3 = *(mips3_state **)device->token;
667   mips3_state *mips3 = get_safe_token(device);
643668   if (mips3->impstate->hotspot_select < ARRAY_LENGTH(mips3->impstate->hotspot))
644669   {
645670      mips3->impstate->hotspot[mips3->impstate->hotspot_select].pc = pc;
r4425r4426
822847
823848static void cfunc_get_cycles(void *param)
824849{
825   mips3_state *mips3 = param;
850   mips3_state *mips3 = (mips3_state *)param;
826851   mips3->impstate->numcycles = cpu_get_total_cycles(mips3->device);
827852}
828853
r4425r4426
834859
835860static void cfunc_printf_exception(void *param)
836861{
837   mips3_state *mips3 = param;
862   mips3_state *mips3 = (mips3_state *)param;
838863   printf("Exception: EPC=%08X Cause=%08X BadVAddr=%08X Jmp=%08X\n", (UINT32)mips3->cpr[0][COP0_EPC], (UINT32)mips3->cpr[0][COP0_Cause], (UINT32)mips3->cpr[0][COP0_BadVAddr], mips3->pc);
839864   cfunc_printf_probe(mips3);
840865}
r4425r4426
847872
848873static void cfunc_printf_debug(void *param)
849874{
850   mips3_state *mips3 = param;
875   mips3_state *mips3 = (mips3_state *)param;
851876   printf(mips3->impstate->format, mips3->impstate->arg0, mips3->impstate->arg1);
852877}
853878
r4425r4426
859884
860885static void cfunc_printf_probe(void *param)
861886{
862   mips3_state *mips3 = param;
887   mips3_state *mips3 = (mips3_state *)param;
863888
864889   printf(" PC=%08X          r1=%08X%08X  r2=%08X%08X  r3=%08X%08X\n",
865890      mips3->pc,
r4425r4426
914939
915940static void cfunc_unimplemented(void *param)
916941{
917   mips3_state *mips3 = param;
942   mips3_state *mips3 = (mips3_state *)param;
918943   UINT32 opcode = mips3->impstate->arg0;
919944   fatalerror("PC=%08X: Unimplemented op %08X (%02X,%02X)", mips3->pc, opcode, opcode >> 26, opcode & 0x3f);
920945}
r4425r4426
16721697   if (desc->targetpc == BRANCH_TARGET_DYNAMIC)
16731698      UML_MOV(block, MEM(&mips3->impstate->jmpdest), R32(RSREG));               // mov     [jmpdest],<rsreg>
16741699
1700   /* set the link if needed -- before the delay slot */
1701   if (linkreg != 0)
1702      UML_DMOV(block, R64(linkreg), IMM((INT32)(desc->pc + 8)));               // dmov    <linkreg>,desc->pc + 8
1703
16751704   /* compile the delay slot using temporary compiler state */
16761705   assert(desc->delay != NULL);
16771706   generate_sequence_instruction(mips3, block, &compiler_temp, desc->delay);      // <next instruction>
16781707
1679   /* set the link if needed -- after the delay slot */
1680   if (linkreg != 0)
1681      UML_DMOV(block, R64(linkreg), IMM((INT32)(desc->pc + 8)));               // dmov    <linkreg>,desc->pc + 8
1682
16831708   /* update the cycles and jump through the hash table to the target */
16841709   if (desc->targetpc != BRANCH_TARGET_DYNAMIC)
16851710   {
r4425r4426
36463671}
36473672
36483673
3674/***************************************************************************
3675    NEC VR4300 VARIANTS
3676***************************************************************************/
36493677
3678// NEC VR4300 series is MIPS III with 32-bit address bus and slightly custom COP0/TLB
3679#if (HAS_VR4300)
3680static CPU_INIT( vr4300be )
3681{
3682   mips3_init(MIPS3_TYPE_VR4300, TRUE, device, irqcallback);
3683}
3684
3685static CPU_INIT( vr4300le )
3686{
3687   mips3_init(MIPS3_TYPE_VR4300, FALSE, device, irqcallback);
3688}
3689
3690CPU_GET_INFO( vr4300be )
3691{
3692   switch (state)
3693   {
3694      /* --- the following bits of info are returned as 64-bit signed integers --- */
3695      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_BIG;               break;
3696
3697      /* --- the following bits of info are returned as pointers to data or functions --- */
3698      case CPUINFO_FCT_INIT:                     info->init = CPU_INIT_NAME(vr4300be);            break;
3699
3700      /* --- the following bits of info are returned as NULL-terminated strings --- */
3701      case CPUINFO_STR_NAME:                     strcpy(info->s, "VR4300 (big)");         break;
3702
3703      /* --- everything else is handled generically --- */
3704      default:                              CPU_GET_INFO_CALL(mips3);         break;
3705   }
3706}
3707
3708CPU_GET_INFO( vr4300le )
3709{
3710   switch (state)
3711   {
3712      /* --- the following bits of info are returned as 64-bit signed integers --- */
3713      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_LITTLE;               break;
3714
3715      /* --- the following bits of info are returned as pointers to data or functions --- */
3716      case CPUINFO_FCT_INIT:                     info->init = CPU_INIT_NAME(vr4300le);            break;
3717
3718      /* --- the following bits of info are returned as NULL-terminated strings --- */
3719      case CPUINFO_STR_NAME:                     strcpy(info->s, "VR4300 (little)");      break;
3720
3721      /* --- everything else is handled generically --- */
3722      default:                              CPU_GET_INFO_CALL(mips3);         break;
3723   }
3724}
3725
3726// VR4310 = VR4300 with different speed bin
3727CPU_GET_INFO( vr4310be )
3728{
3729   switch (state)
3730   {
3731      /* --- the following bits of info are returned as 64-bit signed integers --- */
3732      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_BIG;               break;
3733
3734      /* --- the following bits of info are returned as pointers to data or functions --- */
3735      case CPUINFO_FCT_INIT:                     info->init = CPU_INIT_NAME(vr4300be);            break;
3736
3737      /* --- the following bits of info are returned as NULL-terminated strings --- */
3738      case CPUINFO_STR_NAME:                     strcpy(info->s, "VR4310 (big)");         break;
3739
3740      /* --- everything else is handled generically --- */
3741      default:                              CPU_GET_INFO_CALL(mips3);         break;
3742   }
3743}
3744
3745CPU_GET_INFO( vr4310le )
3746{
3747   switch (state)
3748   {
3749      /* --- the following bits of info are returned as 64-bit signed integers --- */
3750      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_LITTLE;               break;
3751
3752      /* --- the following bits of info are returned as pointers to data or functions --- */
3753      case CPUINFO_FCT_INIT:                     info->init = CPU_INIT_NAME(vr4300le);            break;
3754
3755      /* --- the following bits of info are returned as NULL-terminated strings --- */
3756      case CPUINFO_STR_NAME:                     strcpy(info->s, "VR4310 (little)");      break;
3757
3758      /* --- everything else is handled generically --- */
3759      default:                              CPU_GET_INFO_CALL(mips3);         break;
3760   }
3761}
3762#endif
3763
3764
36503765/***************************************************************************
36513766    R4600 VARIANTS
36523767***************************************************************************/
src/emu/cpu/mips/mips3com.c
r4425r4426
7272
7373void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, const device_config *device, cpu_irq_callback irqcallback)
7474{
75   const mips3_config *config = device->static_config;
75   const mips3_config *config = (const mips3_config *)device->static_config;
7676   int tlbindex;
7777
7878   /* initialize based on the config */
r4425r4426
706706
707707static TIMER_CALLBACK( compare_int_callback )
708708{
709   const device_config *device = ptr;
709   const device_config *device = (const device_config *)ptr;
710710   cpu_set_input_line(device, MIPS3_IRQ5, ASSERT_LINE);
711711}
712712
r4425r4426
722722   UINT32 configreg = 0x00026030;
723723   int divisor;
724724
725   /* set the data cache size */
726        if (mips->icache_size <= 0x01000) configreg |= 0 << 6;
727   else if (mips->icache_size <= 0x02000) configreg |= 1 << 6;
728   else if (mips->icache_size <= 0x04000) configreg |= 2 << 6;
729   else if (mips->icache_size <= 0x08000) configreg |= 3 << 6;
730   else if (mips->icache_size <= 0x10000) configreg |= 4 << 6;
731   else if (mips->icache_size <= 0x20000) configreg |= 5 << 6;
732   else if (mips->icache_size <= 0x40000) configreg |= 6 << 6;
733   else                                   configreg |= 7 << 6;
725   // NEC VR series does not use a 100% compatible COP0/TLB implementation
726   if (mips->flavor == MIPS3_TYPE_VR4300)
727   {
728      /*
729            For VR43xx, Config is as follows:
730            bit 31 = always 0
731            bits 28-30 = EC
732            bits 24-27 = EP
733            bits 16-23 = always b0000010
734            bit 15 = endian indicator as standard MIPS III
735            bits 4-14 = always b11001000110
736            bit 3 = CU
737            bits 0-2 = K0 ("Coherency algorithm of kseg0")
738        */
734739
735   /* set the instruction cache size */
736        if (mips->icache_size <= 0x01000) configreg |= 0 << 9;
737   else if (mips->icache_size <= 0x02000) configreg |= 1 << 9;
738   else if (mips->icache_size <= 0x04000) configreg |= 2 << 9;
739   else if (mips->icache_size <= 0x08000) configreg |= 3 << 9;
740   else if (mips->icache_size <= 0x10000) configreg |= 4 << 9;
741   else if (mips->icache_size <= 0x20000) configreg |= 5 << 9;
742   else if (mips->icache_size <= 0x40000) configreg |= 6 << 9;
743   else                                   configreg |= 7 << 9;
740      configreg = 0x6460;
741   }
742   else
743   {
744      /* set the data cache size */
745          if (mips->icache_size <= 0x01000) configreg |= 0 << 6;
746      else if (mips->icache_size <= 0x02000) configreg |= 1 << 6;
747      else if (mips->icache_size <= 0x04000) configreg |= 2 << 6;
748      else if (mips->icache_size <= 0x08000) configreg |= 3 << 6;
749      else if (mips->icache_size <= 0x10000) configreg |= 4 << 6;
750      else if (mips->icache_size <= 0x20000) configreg |= 5 << 6;
751      else if (mips->icache_size <= 0x40000) configreg |= 6 << 6;
752      else                                   configreg |= 7 << 6;
744753
745   /* set the endianness bit */
746   if (mips->bigendian)
747      configreg |= 0x00008000;
754      /* set the instruction cache size */
755          if (mips->icache_size <= 0x01000) configreg |= 0 << 9;
756      else if (mips->icache_size <= 0x02000) configreg |= 1 << 9;
757      else if (mips->icache_size <= 0x04000) configreg |= 2 << 9;
758      else if (mips->icache_size <= 0x08000) configreg |= 3 << 9;
759      else if (mips->icache_size <= 0x10000) configreg |= 4 << 9;
760      else if (mips->icache_size <= 0x20000) configreg |= 5 << 9;
761      else if (mips->icache_size <= 0x40000) configreg |= 6 << 9;
762      else                                   configreg |= 7 << 9;
748763
749   /* set the system clock divider */
750   divisor = 2;
751   if (mips->system_clock != 0)
752   {
753      divisor = mips->cpu_clock / mips->system_clock;
754      if (mips->system_clock * divisor != mips->cpu_clock)
764
765      /* set the system clock divider */
766      divisor = 2;
767      if (mips->system_clock != 0)
755768      {
756         configreg |= 0x80000000;
757         divisor = mips->cpu_clock * 2 / mips->system_clock;
769         divisor = mips->cpu_clock / mips->system_clock;
770         if (mips->system_clock * divisor != mips->cpu_clock)
771         {
772            configreg |= 0x80000000;
773            divisor = mips->cpu_clock * 2 / mips->system_clock;
774         }
758775      }
776      configreg |= (((divisor < 2) ? 2 : (divisor > 8) ? 8 : divisor) - 2) << 28;
759777   }
760   configreg |= (((divisor < 2) ? 2 : (divisor > 8) ? 8 : divisor) - 2) << 28;
761778
779   /* set the endianness bit */
780   if (mips->bigendian)
781      configreg |= 0x00008000;
782
762783   return configreg;
763784}
764785
r4425r4426
772793{
773794   switch (mips->flavor)
774795   {
796      case MIPS3_TYPE_VR4300:
797         return 0x0b00;
798
775799      case MIPS3_TYPE_R4600:
776800      case MIPS3_TYPE_R4650:
777801         return 0x2000;
r4425r4426
830854   {
831855      UINT32 effvpn = vpn + count * which;
832856      UINT64 lo = entry->entry_lo[which];
833      UINT32 pfn = (lo >> 6) & 0x00ffffff;
857      UINT32 pfn;
834858      UINT32 flags = 0;
835859
860      if (mips->flavor == MIPS3_TYPE_VR4300)
861      {
862         pfn = (lo >> 6) & 0x000fffff;    // VR4300 and VR5432 have 4 fewer PFN bits
863      }
864      else
865      {
866         pfn = (lo >> 6) & 0x00ffffff;
867      }
868
836869      /* valid? */
837870      if ((lo & 2) != 0)
838871      {
src/emu/cpu/drcbeut.c
r4425r4426
9292   drchash_state *drchash;
9393
9494   /* allocate permanent state from the cache */
95   drchash = drccache_memory_alloc(cache, sizeof(*drchash) + modes * sizeof(drchash->base[0]));
95   drchash = (drchash_state *)drccache_memory_alloc(cache, sizeof(*drchash) + modes * sizeof(drchash->base[0]));
9696   if (drchash == NULL)
9797      return NULL;
9898   memset(drchash, 0, sizeof(*drchash) + modes * sizeof(drchash->base[0]));
r4425r4426
127127   int modenum, entry;
128128
129129   /* allocate an empty l2 hash table */
130   drchash->emptyl2 = drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr) << drchash->l2bits);
130   drchash->emptyl2 = (drccodeptr *)drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr) << drchash->l2bits);
131131   if (drchash->emptyl2 == NULL)
132132      return FALSE;
133133
r4425r4426
136136      drchash->emptyl2[entry] = drchash->nocodeptr;
137137
138138   /* allocate an empty l1 hash table */
139   drchash->emptyl1 = drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr *) << drchash->l1bits);
139   drchash->emptyl1 = (drccodeptr **)drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr *) << drchash->l1bits);
140140   if (drchash->emptyl1 == NULL)
141141      return FALSE;
142142
r4425r4426
245245   /* copy-on-write for the l1 hash table */
246246   if (drchash->base[mode] == drchash->emptyl1)
247247   {
248      drccodeptr **newtable = drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr *) << drchash->l1bits);
248      drccodeptr **newtable = (drccodeptr **)drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr *) << drchash->l1bits);
249249      if (newtable == NULL)
250250         return FALSE;
251251      memcpy(newtable, drchash->emptyl1, sizeof(drccodeptr *) << drchash->l1bits);
r4425r4426
255255   /* copy-on-write for the l2 hash table */
256256   if (drchash->base[mode][l1] == drchash->emptyl2)
257257   {
258      drccodeptr *newtable = drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr) << drchash->l2bits);
258      drccodeptr *newtable = (drccodeptr *)drccache_memory_alloc_temporary(drchash->cache, sizeof(drccodeptr) << drchash->l2bits);
259259      if (newtable == NULL)
260260         return FALSE;
261261      memcpy(newtable, drchash->emptyl2, sizeof(drccodeptr) << drchash->l2bits);
r4425r4426
284284   drcmap_state *drcmap;
285285
286286   /* allocate permanent state from the cache */
287   drcmap = drccache_memory_alloc(cache, sizeof(*drcmap));
287   drcmap = (drcmap_state *)drccache_memory_alloc(cache, sizeof(*drcmap));
288288   if (drcmap == NULL)
289289      return NULL;
290290   memset(drcmap, 0, sizeof(*drcmap));
r4425r4426
427427      return;
428428
429429   /* allocate a new entry and fill it in */
430   entry = drccache_memory_alloc(drcmap->cache, sizeof(*entry));
430   entry = (drcmap_entry *)drccache_memory_alloc(drcmap->cache, sizeof(*entry));
431431   entry->next = NULL;
432432   entry->codeptr = codebase;
433433   entry->mapvar = mapvar - DRCUML_MAPVAR_M0;
r4425r4426
542542   drclabel_list *list;
543543
544544   /* allocate permanent state from the cache */
545   list = drccache_memory_alloc(cache, sizeof(*list));
545   list = (drclabel_list *)drccache_memory_alloc(cache, sizeof(*list));
546546   if (list == NULL)
547547      return NULL;
548548   memset(list, 0, sizeof(*list));
r4425r4426
589589
590590   /* if no code pointer, request an OOB callback */
591591   if (curlabel->codeptr == NULL && fixup != NULL)
592      drccache_request_oob_codegen(list->cache, label_oob_callback, curlabel, fixup, param);
592      drccache_request_oob_codegen(list->cache, label_oob_callback, curlabel, (void *)fixup, param);
593593
594594   return curlabel->codeptr;
595595}
r4425r4426
655655   /* if none found, allocate */
656656   if (curlabel == NULL)
657657   {
658      curlabel = drccache_memory_alloc(list->cache, sizeof(*curlabel));
658      curlabel = (drclabel *)drccache_memory_alloc(list->cache, sizeof(*curlabel));
659659      curlabel->next = list->head;
660660      curlabel->label = label;
661661      curlabel->codeptr = NULL;
r4425r4426
673673
674674static void label_oob_callback(drccodeptr *codeptr, void *param1, void *param2, void *param3)
675675{
676   drclabel *label = param1;
677   drclabel_fixup_func callback = param2;
676   drclabel *label = (drclabel *)param1;
677   drclabel_fixup_func callback = (drclabel_fixup_func)param2;
678678
679679   (*callback)(param3, label->codeptr);
680680}
src/emu/cpu/tms7000/tms7000.c
r4425r4426
8686   UINT8      idle_state;   /* Set after the execution of an idle instruction */
8787};
8888
89INLINE tms7000_state *get_safe_token(const device_config *device)
90{
91   assert(device != NULL);
92   assert(device->token != NULL);
93   assert(device->type == CPU);
94   assert(cpu_get_type(device) == CPU_TMS7000 ||
95         cpu_get_type(device) == CPU_TMS7000_EXL);
96   return (tms7000_state *)device->token;
97}
98
8999#define pPC      cpustate->pc.w.l
90100#define PC      cpustate->pc
91101#define pSP      cpustate->sp
r4425r4426
153163
154164static CPU_INIT( tms7000 )
155165{
156   tms7000_state *cpustate = device->token;
166   tms7000_state *cpustate = get_safe_token(device);
157167
158168   cpustate->irq_callback = irqcallback;
159169   cpustate->device = device;
r4425r4426
185195
186196static CPU_RESET( tms7000 )
187197{
188   tms7000_state *cpustate = device->token;
198   tms7000_state *cpustate = get_safe_token(device);
189199
190200//  cpustate->architecture = (int)param;
191201
r4425r4426
229239
230240static CPU_SET_INFO( tms7000 )
231241{
232   tms7000_state *cpustate = device->token;
242   tms7000_state *cpustate = get_safe_token(device);
233243
234244    switch (state)
235245    {
r4425r4426
256266
257267CPU_GET_INFO( tms7000 )
258268{
259   tms7000_state *cpustate = (device != NULL) ? device->token : NULL;
269   tms7000_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
260270
261271    switch( state )
262272    {
r4425r4426
434444
435445static CPU_EXECUTE( tms7000 )
436446{
437   tms7000_state *cpustate = device->token;
447   tms7000_state *cpustate = get_safe_token(device);
438448   int op;
439449
440450   cpustate->icount = cycles;
r4425r4426
476486
477487static CPU_EXECUTE( tms7000_exl )
478488{
479   tms7000_state *cpustate = device->token;
489   tms7000_state *cpustate = get_safe_token(device);
480490   int op;
481491
482492   cpustate->icount = cycles;
r4425r4426
522532 ****************************************************************************/
523533void tms7000_A6EC1( const device_config *device )
524534{
525   tms7000_state *cpustate = device->token;
535   tms7000_state *cpustate = get_safe_token(device);
526536    if( (cpustate->pf[0x03] & 0x80) == 0x80 ) /* Is timer system active? */
527537    {
528538        if( (cpustate->pf[0x03] & 0x40) == 0x40) /* Is event counter the timer source? */
r4425r4426
532542
533543static void tms7000_service_timer1( const device_config *device )
534544{
535   tms7000_state *cpustate = device->token;
545   tms7000_state *cpustate = get_safe_token(device);
536546    if( --cpustate->t1_prescaler < 0 ) /* Decrement prescaler and check for underflow */
537547    {
538548        cpustate->t1_prescaler = cpustate->pf[3] & 0x1f; /* Reload prescaler (5 bit) */
r4425r4426
552562
553563static WRITE8_HANDLER( tms70x0_pf_w )   /* Perpherial file write */
554564{
555   tms7000_state *cpustate = space->cpu->token;
565   tms7000_state *cpustate = get_safe_token(space->cpu);
556566   UINT8   temp1, temp2, temp3;
557567
558568   switch( offset )
r4425r4426
621631
622632static READ8_HANDLER( tms70x0_pf_r )   /* Perpherial file read */
623633{
624   tms7000_state *cpustate = space->cpu->token;
634   tms7000_state *cpustate = get_safe_token(space->cpu);
625635   UINT8 result;
626636   UINT8   temp1, temp2, temp3;
627637
r4425r4426
714724}
715725
716726static WRITE8_HANDLER( tms7000_internal_w ) {
717   tms7000_state *cpustate = space->cpu->token;
727   tms7000_state *cpustate = get_safe_token(space->cpu);
718728   cpustate->rf[ offset ] = data;
719729}
720730
721731static READ8_HANDLER( tms7000_internal_r ) {
722   tms7000_state *cpustate = space->cpu->token;
732   tms7000_state *cpustate = get_safe_token(space->cpu);
723733   return cpustate->rf[ offset ];
724734}
src/emu/cpu/f8/f8.c
r4425r4426
6060   int     irq_request;
6161};
6262
63INLINE f8_Regs *get_safe_token(const device_config *device)
64{
65   assert(device != NULL);
66   assert(device->token != NULL);
67   assert(device->type == CPU);
68   assert(cpu_get_type(device) == CPU_F8);
69   return (f8_Regs *)device->token;
70}
71
6372/* timer shifter polynome values (will be used for timer interrupts) */
6473static UINT8 timer_shifter[256];
6574
r4425r4426
15331542
15341543static CPU_RESET( f8 )
15351544{
1536   f8_Regs *cpustate = device->token;
1545   f8_Regs *cpustate = get_safe_token(device);
15371546   UINT8 data;
15381547   int i;
15391548   cpu_irq_callback save_callback;
r4425r4426
15761585/* Execute cycles - returns number of cycles actually run */
15771586static CPU_EXECUTE( f8 )
15781587{
1579    f8_Regs *cpustate = device->token;
1588    f8_Regs *cpustate = get_safe_token(device);
15801589    cpustate->icount = cycles;
15811590
15821591    do
r4425r4426
18891898
18901899static CPU_INIT( f8 )
18911900{
1892   f8_Regs *cpustate = device->token;
1901   f8_Regs *cpustate = get_safe_token(device);
18931902   cpustate->irq_callback = irqcallback;
18941903   cpustate->device = device;
18951904   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
18981907
18991908static CPU_SET_INFO( f8 )
19001909{
1901   f8_Regs *cpustate = device->token;
1910   f8_Regs *cpustate = get_safe_token(device);
19021911   switch (state)
19031912   {
19041913   /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
19972006
19982007CPU_GET_INFO( f8 )
19992008{
2000   f8_Regs *cpustate = (device != NULL) ? device->token : NULL;
2009   f8_Regs *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
20012010
20022011   switch (state)
20032012   {
src/emu/cpu/z80/z80.c
r4425r4426
138138   UINT8 rtemp;
139139};
140140
141INLINE z80_state *get_safe_token(const device_config *device)
142{
143   assert(device != NULL);
144   assert(device->token != NULL);
145   assert(device->type == CPU);
146   assert(cpu_get_type(device) == CPU_Z80);
147   return (z80_state *)device->token;
148}
149
141150#define CF      0x01
142151#define NF      0x02
143152#define PF      0x04
r4425r4426
33223331 ****************************************************************************/
33233332static CPU_INIT( z80 )
33243333{
3325   z80_state *z80 = device->token;
3334   z80_state *z80 = get_safe_token(device);
33263335   int i, p;
33273336
33283337   /* setup cycle tables */
r4425r4426
34443453   /* Reset registers to their initial values */
34453454   memset(z80, 0, sizeof(*z80));
34463455   if (device->static_config != NULL)
3447      z80->daisy = z80daisy_init(device, device->static_config);
3456      z80->daisy = z80daisy_init(device, (const z80_daisy_chain *)device->static_config);
34483457   z80->irq_callback = irqcallback;
34493458   z80->device = device;
34503459   z80->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
34633472 ****************************************************************************/
34643473static CPU_RESET( z80 )
34653474{
3466   z80_state *z80 = device->token;
3475   z80_state *z80 = get_safe_token(device);
34673476
34683477   z80->PC = 0x0000;
34693478   z80->i = 0;
r4425r4426
34933502 ****************************************************************************/
34943503static CPU_EXECUTE( z80 )
34953504{
3496   z80_state *z80 = device->token;
3505   z80_state *z80 = get_safe_token(device);
34973506
34983507   z80->icount = cycles;
34993508
r4425r4426
35353544 ****************************************************************************/
35363545static CPU_BURN( z80 )
35373546{
3538   z80_state *z80 = device->token;
3547   z80_state *z80 = get_safe_token(device);
35393548
35403549   if( cycles > 0 )
35413550   {
r4425r4426
35773586
35783587static CPU_IMPORT_STATE( z80 )
35793588{
3580   z80_state *cpustate = device->token;
3589   z80_state *cpustate = get_safe_token(device);
35813590
35823591   switch (entry->index)
35833592   {
r4425r4426
35953604
35963605static CPU_EXPORT_STATE( z80 )
35973606{
3598   z80_state *cpustate = device->token;
3607   z80_state *cpustate = get_safe_token(device);
35993608
36003609   switch (entry->index)
36013610   {
r4425r4426
36163625
36173626static CPU_SET_INFO( z80 )
36183627{
3619   z80_state *z80 = device->token;
3628   z80_state *z80 = get_safe_token(device);
36203629   switch (state)
36213630   {
36223631      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
36243633      case CPUINFO_INT_INPUT_STATE + 0:               set_irq_line(z80, 0, info->i);      break;
36253634
36263635      /* --- the following bits of info are set as pointers to data or functions --- */
3627      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_op:   cc[Z80_TABLE_op] = info->p;         break;
3628      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_cb:   cc[Z80_TABLE_cb] = info->p;         break;
3629      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ed:   cc[Z80_TABLE_ed] = info->p;         break;
3630      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xy:   cc[Z80_TABLE_xy] = info->p;         break;
3631      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xycb:   cc[Z80_TABLE_xycb] = info->p;      break;
3632      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex:   cc[Z80_TABLE_ex] = info->p;         break;
3636      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_op:   cc[Z80_TABLE_op] = (const UINT8 *)info->p;         break;
3637      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_cb:   cc[Z80_TABLE_cb] = (const UINT8 *)info->p;         break;
3638      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ed:   cc[Z80_TABLE_ed] = (const UINT8 *)info->p;         break;
3639      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xy:   cc[Z80_TABLE_xy] = (const UINT8 *)info->p;         break;
3640      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_xycb:   cc[Z80_TABLE_xycb] = (const UINT8 *)info->p;      break;
3641      case CPUINFO_PTR_Z80_CYCLE_TABLE + Z80_TABLE_ex:   cc[Z80_TABLE_ex] = (const UINT8 *)info->p;         break;
36333642   }
36343643}
36353644
r4425r4426
36413650
36423651CPU_GET_INFO( z80 )
36433652{
3644   z80_state *z80 = (device != NULL) ? device->token : NULL;
3653   z80_state *z80 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
36453654   switch (state)
36463655   {
36473656      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/z80/z80daisy.c
r4425r4426
2929   /* create a linked list of devices */
3030   for ( ; daisy->devname != NULL; daisy++)
3131   {
32      *tailptr = auto_malloc(sizeof(**tailptr));
32      *tailptr = (z80_daisy_state *)auto_malloc(sizeof(**tailptr));
3333      (*tailptr)->next = NULL;
3434      (*tailptr)->device = devtag_get_device(cpudevice->machine, device_inherit_tag(tempstring, cpudevice->tag, daisy->devname));
3535      if ((*tailptr)->device == NULL)
src/emu/cpu/esrip/esrip.c
r4425r4426
118118} esrip_state;
119119
120120
121INLINE esrip_state *get_safe_token(const device_config *device)
122{
123   assert(device != NULL);
124   assert(device->token != NULL);
125   assert(device->type == CPU);
126   assert(cpu_get_type(device) == CPU_ESRIP);
127   return (esrip_state *)device->token;
128}
129
130
121131/***************************************************************************
122132    PUBLIC FUNCTIONS
123133***************************************************************************/
124134
125135UINT8 get_rip_status(const device_config *cpu)
126136{
127   esrip_state *cpustate = cpu->token;
137   esrip_state *cpustate = get_safe_token(cpu);
128138   return cpustate->status_out;
129139}
130140
r4425r4426
237247
238248static CPU_INIT( esrip )
239249{
240   esrip_state *cpustate = device->token;
250   esrip_state *cpustate = get_safe_token(device);
241251   esrip_config* _config = (esrip_config*)device->static_config;
242252
243253   memset(cpustate, 0, sizeof(cpustate));
r4425r4426
250260   cpustate->draw = _config->draw;
251261
252262   /* Allocate image pointer table RAM */
253   cpustate->ipt_ram = auto_malloc(IPT_RAM_SIZE);
263   cpustate->ipt_ram = (UINT16 *)auto_malloc(IPT_RAM_SIZE);
254264
255265   cpustate->device = device;
256266   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
257267
258268   /* Create the instruction decode lookup table */
259   cpustate->optable = auto_malloc(65536);
269   cpustate->optable = (UINT8 *)auto_malloc(65536);
260270   make_ops(cpustate);
261271
262272   /* Register stuff for state saving */
r4425r4426
307317
308318static CPU_RESET( esrip )
309319{
310   esrip_state *cpustate = device->token;
320   esrip_state *cpustate = get_safe_token(device);
311321
312322   cpustate->pc = 0;
313323
r4425r4426
16511661
16521662static CPU_EXECUTE( esrip )
16531663{
1654   esrip_state *cpustate = device->token;
1664   esrip_state *cpustate = get_safe_token(device);
16551665   int calldebugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
16561666   UINT8 status;
16571667
r4425r4426
19411951
19421952static CPU_SET_INFO( esrip )
19431953{
1944   esrip_state *cpustate = device->token;
1954   esrip_state *cpustate = get_safe_token(device);
19451955
19461956   switch (state)
19471957   {
r4425r4426
19601970
19611971CPU_GET_INFO( esrip )
19621972{
1963   esrip_state *cpustate = device->token;
1973   esrip_state *cpustate = (device->token != NULL) ? get_safe_token(device) : NULL;
19641974
19651975   switch (state)
19661976   {
src/emu/cpu/asap/asap.c
r4425r4426
262262
263263
264264/***************************************************************************
265    STATE ACCESSORS
266***************************************************************************/
267
268INLINE asap_state *get_safe_token(const device_config *device)
269{
270   assert(device != NULL);
271   assert(device->token != NULL);
272   assert(device->type == CPU);
273   assert(cpu_get_type(device) == CPU_ASAP);
274   return (asap_state *)device->token;
275}
276
277
278
279/***************************************************************************
265280    MEMORY ACCESSORS
266281***************************************************************************/
267282
r4425r4426
396411{
397412   /* allocate opcode table */
398413   if (!opcode)
399      opcode = auto_malloc(32 * 32 * 2 * sizeof(void *));
414      opcode = (void (**)(asap_state *))auto_malloc(32 * 32 * 2 * sizeof(void *));
400415
401416   /* fill opcode table */
402417   if (opcode)
r4425r4426
421436
422437static CPU_INIT( asap )
423438{
424   asap_state *asap = device->token;
439   asap_state *asap = get_safe_token(device);
425440   int i;
426441
427442   init_tables();
r4425r4426
434449
435450static CPU_RESET( asap )
436451{
437   asap_state *asap = device->token;
452   asap_state *asap = get_safe_token(device);
438453
439454   /* initialize the state */
440455   asap->src2val[REGBASE + 0] = 0;
r4425r4426
488503
489504static CPU_EXECUTE( asap )
490505{
491   asap_state *asap = device->token;
506   asap_state *asap = get_safe_token(device);
492507
493508   /* check for IRQs */
494509   asap->icount = cycles;
r4425r4426
16431658
16441659static CPU_SET_INFO( asap )
16451660{
1646   asap_state *asap = device->token;
1661   asap_state *asap = get_safe_token(device);
16471662
16481663   switch (state)
16491664   {
r4425r4426
16981713
16991714CPU_GET_INFO( asap )
17001715{
1701   asap_state *asap = (device != NULL) ? device->token : NULL;
1716   asap_state *asap = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
17021717
17031718   switch (state)
17041719   {
src/emu/cpu/tms9900/99xxcore.h
r4425r4426
511511   int extra_byte;   /* buffer holding the unused byte in a word read */
512512};
513513
514INLINE tms99xx_state *get_safe_token(const device_config *device)
515{
516   assert(device != NULL);
517   assert(device->token != NULL);
518   assert(device->type == CPU);
519   assert(cpu_get_type(device) == TMS99XX_GET_INFO);
520   return (tms99xx_state *)device->token;
521}
522
514523#if (TMS99XX_MODEL == TMS9995_ID)
515524static void reset_decrementer(tms99xx_state *cpustate);
516525#endif
r4425r4426
536545*/
537546READ8_HANDLER(tms9995_internal1_r)
538547{
539   tms99xx_state *cpustate = space->cpu->token;
548   tms99xx_state *cpustate = get_safe_token(space->cpu);
540549   return cpustate->RAM[offset];
541550}
542551
543552WRITE8_HANDLER(tms9995_internal1_w)
544553{
545   tms99xx_state *cpustate = space->cpu->token;
554   tms99xx_state *cpustate = get_safe_token(space->cpu);
546555   cpustate->RAM[offset]=data;
547556}
548557
r4425r4426
551560*/
552561READ8_HANDLER(tms9995_internal2_r)
553562{
554   tms99xx_state *cpustate = space->cpu->token;
563   tms99xx_state *cpustate = get_safe_token(space->cpu);
555564   return cpustate->RAM[offset+0xfc];
556565}
557566
558567WRITE8_HANDLER(tms9995_internal2_w)
559568{
560   tms99xx_state *cpustate = space->cpu->token;
569   tms99xx_state *cpustate = get_safe_token(space->cpu);
561570   cpustate->RAM[offset+0xfc]=data;
562571}
563572
r4425r4426
928937         /* read decrementer */
929938         if (cpustate->decrementer_enabled && !(cpustate->flag & 1))
930939            /* timer mode, timer enabled */
931            return ceil(cpu_attotime_to_clocks(cpustate->device, attotime_div(timer_timeleft(cpustate->timer), 16)));
940            return cpu_attotime_to_clocks(cpustate->device, attotime_div(timer_timeleft(cpustate->timer), 16));
932941         else
933942            /* event counter mode or timer mode, timer disabled */
934943            return cpustate->decrementer_count;
r4425r4426
9921001
9931002         if (cpustate->decrementer_enabled && !(cpustate->flag & 1))
9941003            /* timer mode, timer enabled */
995            value = ceil(cpu_attotime_to_clocks(cpustate->device, attotime_div(timer_timeleft(cpustate->timer), 16)));
1004            value = cpu_attotime_to_clocks(cpustate->device, attotime_div(timer_timeleft(cpustate->timer), 16));
9961005         else
9971006            /* event counter mode or timer mode, timer disabled */
9981007            value = cpustate->decrementer_count;
r4425r4426
10711080#if (TMS99XX_MODEL == TI990_10_ID)
10721081   READ8_HANDLER(ti990_10_mapper_cru_r)
10731082   {
1074      tms99xx_state *cpustate = space->cpu->token;
1083      tms99xx_state *cpustate = get_safe_token(space->cpu);
10751084      int reply = 0;
10761085
10771086      switch(cpustate->mapper_cru_read_register)
r4425r4426
11101119
11111120   WRITE8_HANDLER(ti990_10_mapper_cru_w)
11121121   {
1113      tms99xx_state *cpustate = space->cpu->token;
1122      tms99xx_state *cpustate = get_safe_token(space->cpu);
11141123      switch (offset)
11151124      {
11161125      case 0:
r4425r4426
11521161
11531162   READ8_HANDLER(ti990_10_eir_cru_r)
11541163      {
1155      tms99xx_state *cpustate = space->cpu->token;
1164      tms99xx_state *cpustate = get_safe_token(space->cpu);
11561165      return (offset == 1) ? (cpustate->error_interrupt_register & 0xff) : 0;
11571166      }
11581167
11591168   WRITE8_HANDLER(ti990_10_eir_cru_w)
11601169      {
1161      tms99xx_state *cpustate = space->cpu->token;
1170      tms99xx_state *cpustate = get_safe_token(space->cpu);
11621171      if (offset < 4)   /* does not work for EIR_MAPERR */
11631172      {
11641173         cpustate->error_interrupt_register &= ~ (1 << offset);
r4425r4426
12051214
12061215static void register_for_save_state(const device_config *device)
12071216{
1208   tms99xx_state *cpustate = device->token;
1217   tms99xx_state *cpustate = get_safe_token(device);
12091218   state_save_register_device_item(device, 0, cpustate->WP);
12101219   state_save_register_device_item(device, 0, cpustate->PC);
12111220   state_save_register_device_item(device, 0, cpustate->STATUS);
r4425r4426
12821291static CPU_INIT( tms99xx )
12831292{
12841293   const TMS99XX_RESET_PARAM *param = (const TMS99XX_RESET_PARAM *) device->static_config;
1285   tms99xx_state *cpustate = device->token;
1294   tms99xx_state *cpustate = get_safe_token(device);
12861295
12871296   register_for_save_state(device);
12881297
r4425r4426
13281337*/
13291338static CPU_RESET( tms99xx )
13301339{
1331   tms99xx_state *cpustate = device->token;
1340   tms99xx_state *cpustate = get_safe_token(device);
13321341
13331342   cpustate->STATUS = 0; /* TMS9980 and TMS9995 Data Books say so */
13341343   getstat(cpustate);
r4425r4426
13971406
13981407static CPU_EXECUTE( tms99xx )
13991408         {
1400   tms99xx_state *cpustate = device->token;
1409   tms99xx_state *cpustate = get_safe_token(device);
14011410   cpustate->icount = cycles;
14021411
14031412   cpustate->lds_flag = 0;
r4425r4426
17761785*/
17771786static TIMER_CALLBACK( decrementer_callback )
17781787{
1779   tms99xx_state *cpustate = ptr;
1788   tms99xx_state *cpustate = (tms99xx_state *)ptr;
17801789
17811790   /* request decrementer interrupt */
17821791   cpustate->int_latch |= 0x8;
r4425r4426
45764585
45774586static CPU_SET_INFO( tms99xx )
45784587{
4579   tms99xx_state *cpustate = device->token;
4588   tms99xx_state *cpustate = get_safe_token(device);
45804589   switch (state)
45814590   {
45824591      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
46584667
46594668void TMS99XX_GET_INFO(const device_config *device, UINT32 state, cpuinfo *info)
46604669{
4661   tms99xx_state *cpustate = (device != NULL) ? device->token : NULL;
4670   tms99xx_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
46624671   switch (state)
46634672   {
46644673      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/i960/i960.c
r4425r4426
3939   int icount;
4040};
4141
42INLINE i960_state_t *get_safe_token(const device_config *device)
43{
44   assert(device != NULL);
45   assert(device->token != NULL);
46   assert(device->type == CPU);
47   assert(cpu_get_type(device) == CPU_I960);
48   return (i960_state_t *)device->token;
49}
50
4251static void do_call(i960_state_t *i960, UINT32 adr, int type, UINT32 stack);
4352
4453INLINE UINT32 i960_read_dword_unaligned(i960_state_t *i960, UINT32 address)
r4425r4426
19461955
19471956static CPU_EXECUTE( i960 )
19481957{
1949   i960_state_t *i960 = device->token;
1958   i960_state_t *i960 = get_safe_token(device);
19501959   UINT32 opcode;
19511960
19521961   i960->icount = cycles;
r4425r4426
20352044
20362045static CPU_SET_INFO( i960 )
20372046{
2038   i960_state_t *i960 = device->token;
2047   i960_state_t *i960 = get_safe_token(device);
20392048
20402049   if(state >= CPUINFO_INT_REGISTER+I960_R0 && state <= CPUINFO_INT_REGISTER + I960_G15) {
20412050      i960->r[state - (CPUINFO_INT_REGISTER + I960_R0)] = info->i;
r4425r4426
20572066
20582067static CPU_INIT( i960 )
20592068{
2060   i960_state_t *i960 = device->token;
2069   i960_state_t *i960 = get_safe_token(device);
20612070
20622071   i960->irq_cb = irqcallback;
20632072   i960->device = device;
r4425r4426
20902099
20912100static CPU_RESET( i960 )
20922101{
2093   i960_state_t *i960 = device->token;
2102   i960_state_t *i960 = get_safe_token(device);
20942103
20952104   i960->SAT        = memory_read_dword_32le(i960->program, 0);
20962105   i960->PRCB       = memory_read_dword_32le(i960->program, 4);
r4425r4426
21112120
21122121CPU_GET_INFO( i960 )
21132122{
2114   i960_state_t *i960 = (device != NULL) ? device->token : NULL;
2123   i960_state_t *i960 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
21152124
21162125   if(state >= CPUINFO_INT_REGISTER+I960_R0 && state <= CPUINFO_INT_REGISTER + I960_G15) {
21172126      info->i = i960->r[state - (CPUINFO_INT_REGISTER + I960_R0)];
r4425r4426
22242233// on the real hardware (e.g. Model 2's interrupt control registers)
22252234void i960_noburst(const device_config *device)
22262235{
2227   i960_state_t *i960 = device->token;
2236   i960_state_t *i960 = get_safe_token(device);
22282237   i960->bursting = 0;
22292238}
22302239
22312240void i960_stall(const device_config *device)
22322241{
2233   i960_state_t *i960 = device->token;
2242   i960_state_t *i960 = get_safe_token(device);
22342243   i960->IP = i960->PIP;
22352244}
src/emu/cpu/v810/v810.c
r4425r4426
3636   int icount;
3737};
3838
39INLINE v810_state *get_safe_token(const device_config *device)
40{
41   assert(device != NULL);
42   assert(device->token != NULL);
43   assert(device->type == CPU);
44   assert(cpu_get_type(device) == CPU_V810);
45   return (v810_state *)device->token;
46}
47
3948#define R0 reg[0]
4049#define R1 reg[1]
4150#define R2 reg[2]
r4425r4426
987996
988997static CPU_INIT( v810 )
989998{
990   v810_state *cpustate = device->token;
999   v810_state *cpustate = get_safe_token(device);
9911000
9921001   cpustate->irq_line = CLEAR_LINE;
9931002   cpustate->nmi_line = CLEAR_LINE;
r4425r4426
10051014
10061015static CPU_RESET( v810 )
10071016{
1008   v810_state *cpustate = device->token;
1017   v810_state *cpustate = get_safe_token(device);
10091018   int i;
10101019   for(i=0;i<64;i++)   cpustate->reg[i]=0;
10111020   cpustate->PC = 0xfffffff0;
r4425r4426
10151024
10161025static CPU_EXECUTE( v810 )
10171026{
1018   v810_state *cpustate = device->token;
1027   v810_state *cpustate = get_safe_token(device);
10191028
10201029   cpustate->icount = cycles;
10211030   while(cpustate->icount>0)
r4425r4426
10421051
10431052static CPU_SET_INFO( v810 )
10441053{
1045   v810_state *cpustate = device->token;
1054   v810_state *cpustate = get_safe_token(device);
10461055
10471056   switch (state)
10481057   {
r4425r4426
11251134
11261135CPU_GET_INFO( v810 )
11271136{
1128   v810_state *cpustate = (device != NULL) ? device->token : NULL;
1137   v810_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
11291138
11301139   switch (state)
11311140   {
src/emu/cpu/tms32025/tms32025.c
r4425r4426
180180   UINT16 *datamap[0x200];
181181};
182182
183INLINE tms32025_state *get_safe_token(const device_config *device)
184{
185   assert(device != NULL);
186   assert(device->token != NULL);
187   assert(device->type == CPU);
188   assert(cpu_get_type(device) == CPU_TMS32025 ||
189         cpu_get_type(device) == CPU_TMS32026);
190   return (tms32025_state *)device->token;
191}
183192
184193/* opcode table entry */
185194typedef struct _tms32025_opcode tms32025_opcode;
r4425r4426
643652{
644653   cpustate->AR[ARP] += cpustate->opcode.b.l;
645654}
646static void and(tms32025_state *cpustate)
655static void and_(tms32025_state *cpustate)
647656{
648657   GETDATA(cpustate, 0, 0);
649658   cpustate->ACC.d &= cpustate->ALU.d;
r4425r4426
12231232      MODIFY_AR_ARP(cpustate);
12241233   }
12251234}
1226static void or(tms32025_state *cpustate)
1235static void or_(tms32025_state *cpustate)
12271236{
12281237   GETDATA(cpustate, 0, 0);
12291238   cpustate->ACC.w.l |= cpustate->ALU.w.l;
r4425r4426
15771586   PUSH_STACK(cpustate, cpustate->PC);
15781587   SET_PC(0x001E);      /* Trap vector */
15791588}
1580static void xor(tms32025_state *cpustate)
1589static void xor_(tms32025_state *cpustate)
15811590{
15821591   GETDATA(cpustate, 0, 0);
15831592   cpustate->ACC.w.l ^= cpustate->ALU.w.l;
r4425r4426
16261635/*30*/ {1*CLK, lar_ar0   },{1*CLK, lar_ar1   },{1*CLK, lar_ar2   },{1*CLK, lar_ar3   },{1*CLK, lar_ar4   },{1*CLK, lar_ar5   },{1*CLK, lar_ar6   },{1*CLK, lar_ar7   },
16271636/*38*/ {1*CLK, mpy      },{1*CLK, sqra      },{1*CLK, mpya      },{1*CLK, mpys      },{1*CLK, lt      },{1*CLK, lta      },{1*CLK, ltp      },{1*CLK, ltd      },
16281637/*40*/ {1*CLK, zalh      },{1*CLK, zals      },{1*CLK, lact      },{1*CLK, addc      },{1*CLK, subh      },{1*CLK, subs      },{1*CLK, subt      },{1*CLK, subc      },
1629/*48*/ {1*CLK, addh      },{1*CLK, adds      },{1*CLK, addt      },{1*CLK, rpt      },{1*CLK, xor      },{1*CLK, or      },{1*CLK, and      },{1*CLK, subb      },
1638/*48*/ {1*CLK, addh      },{1*CLK, adds      },{1*CLK, addt      },{1*CLK, rpt      },{1*CLK, xor_      },{1*CLK, or_      },{1*CLK, and_      },{1*CLK, subb      },
16301639/*50*/ {1*CLK, lst      },{1*CLK, lst1      },{1*CLK, ldp      },{1*CLK, lph      },{1*CLK, pshd      },{1*CLK, mar      },{1*CLK, dmov      },{1*CLK, bitt      },
16311640/*58*/ {3*CLK, tblr      },{2*CLK, tblw      },{1*CLK, sqrs      },{1*CLK, lts      },{2*CLK, macd      },{2*CLK, mac      },{2*CLK, bc      },{2*CLK, bnc      },
16321641/*60*/ {1*CLK, sacl      },{1*CLK, sacl      },{1*CLK, sacl      },{1*CLK, sacl      },{1*CLK, sacl      },{1*CLK, sacl      },{1*CLK, sacl      },{1*CLK, sacl      },
r4425r4426
16991708 ****************************************************************************/
17001709static CPU_INIT( tms32025 )
17011710{
1702   tms32025_state *cpustate = device->token;
1711   tms32025_state *cpustate = get_safe_token(device);
17031712
1704   cpustate->intRAM = auto_malloc(0x800*2);
1713   cpustate->intRAM = (UINT16 *)auto_malloc(0x800*2);
17051714   cpustate->irq_callback = irqcallback;
17061715   cpustate->device = device;
17071716   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
r4425r4426
17541763 ****************************************************************************/
17551764static CPU_RESET( tms32025 )
17561765{
1757   tms32025_state *cpustate = device->token;
1766   tms32025_state *cpustate = get_safe_token(device);
17581767
17591768   SET_PC(0);         /* Starting address on a reset */
17601769   cpustate->STR0 |= 0x0600;   /* INTM and unused bit set to 1 */
r4425r4426
17901799#if (HAS_TMS32026)
17911800static CPU_RESET( tms32026 )
17921801{
1793   tms32025_state *cpustate = device->token;
1802   tms32025_state *cpustate = get_safe_token(device);
17941803
17951804   CPU_RESET_CALL(tms32025);
17961805
r4425r4426
19411950 ****************************************************************************/
19421951static CPU_EXECUTE( tms32025 )
19431952{
1944   tms32025_state *cpustate = device->token;
1953   tms32025_state *cpustate = get_safe_token(device);
19451954   cpustate->icount = cycles;
19461955
19471956
r4425r4426
20972106 ****************************************************************************/
20982107static CPU_READOP( tms32025 )
20992108{
2100   tms32025_state *cpustate = device->token;
2109   tms32025_state *cpustate = get_safe_token(device);
21012110
21022111   void *ptr;
21032112
r4425r4426
21222131 ****************************************************************************/
21232132static CPU_READ( tms32025 )
21242133{
2125   tms32025_state *cpustate = device->token;
2134   tms32025_state *cpustate = get_safe_token(device);
21262135
21272136   void *ptr = NULL;
21282137   UINT64 temp = 0;
r4425r4426
21752184 ****************************************************************************/
21762185static CPU_WRITE( tms32025 )
21772186{
2178   tms32025_state *cpustate = device->token;
2187   tms32025_state *cpustate = get_safe_token(device);
21792188
21802189   void *ptr = NULL;
21812190
r4425r4426
22242233
22252234static CPU_SET_INFO( tms32025 )
22262235{
2227   tms32025_state *cpustate = device->token;
2236   tms32025_state *cpustate = get_safe_token(device);
22282237
22292238   switch (state)
22302239   {
r4425r4426
22802289
22812290CPU_GET_INFO( tms32025 )
22822291{
2283   tms32025_state *cpustate = (device != NULL) ? device->token : NULL;
2292   tms32025_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
22842293
22852294   switch (state)
22862295   {
src/emu/cpu/pic16c5x/pic16c5x.c
r4425r4426
104104   const   address_space *io;
105105};
106106
107INLINE pic16c5x_state *get_safe_token(const device_config *device)
108{
109   assert(device != NULL);
110   assert(device->token != NULL);
111   assert(device->type == CPU);
112   assert(cpu_get_type(device) == CPU_PIC16C54 ||
113         cpu_get_type(device) == CPU_PIC16C55 ||
114         cpu_get_type(device) == CPU_PIC16C56 ||
115         cpu_get_type(device) == CPU_PIC16C57 ||
116         cpu_get_type(device) == CPU_PIC16C58);
117   return (pic16c5x_state *)device->token;
118}
107119
108120/* opcode table entry */
109121typedef struct _pic16c5x_opcode pic16c5x_opcode;
r4425r4426
734746
735747static CPU_INIT( pic16c5x )
736748{
737   pic16c5x_state *cpustate = device->token;
749   pic16c5x_state *cpustate = get_safe_token(device);
738750
739751   state_save_register_device_item(device, 0, cpustate->W);
740752   state_save_register_device_item(device, 0, cpustate->ALU);
r4425r4426
805817
806818void pic16c5x_set_config(const device_config *cpu, int data)
807819{
808   pic16c5x_state *cpustate = cpu->token;
820   pic16c5x_state *cpustate = get_safe_token(cpu);
809821
810822   logerror("Writing %04x to the PIC16C5x config register\n",data);
811823   cpustate->temp_config = (data & 0xfff);
r4425r4426
889901
890902static CPU_EXECUTE( pic16c5x )
891903{
892   pic16c5x_state *cpustate = device->token;
904   pic16c5x_state *cpustate = get_safe_token(device);
893905   int T0_in;
894906   cpustate->icount = cycles;
895907
r4425r4426
964976
965977static CPU_SET_INFO( pic16c5x )
966978{
967   pic16c5x_state *cpustate = device->token;
979   pic16c5x_state *cpustate = get_safe_token(device);
968980
969981   switch (state)
970982   {
r4425r4426
9981010
9991011static CPU_GET_INFO( pic16c5x )
10001012{
1001   pic16c5x_state *cpustate = (device != NULL) ? device->token : NULL;
1013   pic16c5x_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
10021014
10031015   switch (state)
10041016   {
r4425r4426
11181130
11191131static CPU_RESET( pic16c54 )
11201132{
1121   pic16c5x_state *cpustate = device->token;
1133   pic16c5x_state *cpustate = get_safe_token(device);
11221134
11231135   cpustate->picmodel = 0x16C54;
11241136   cpustate->picRAMmask = 0x1f;
r4425r4426
11721184
11731185static CPU_RESET( pic16c55 )
11741186{
1175   pic16c5x_state *cpustate = device->token;
1187   pic16c5x_state *cpustate = get_safe_token(device);
11761188
11771189   cpustate->picmodel = 0x16C55;
11781190   cpustate->picRAMmask = 0x1f;
r4425r4426
12261238
12271239static CPU_RESET( pic16c56 )
12281240{
1229   pic16c5x_state *cpustate = device->token;
1241   pic16c5x_state *cpustate = get_safe_token(device);
12301242
12311243   cpustate->picmodel = 0x16C56;
12321244   cpustate->picRAMmask = 0x1f;
r4425r4426
12851297
12861298static CPU_RESET( pic16c57 )
12871299{
1288   pic16c5x_state *cpustate = device->token;
1300   pic16c5x_state *cpustate = get_safe_token(device);
12891301
12901302   cpustate->picmodel = 0x16C57;
12911303   cpustate->picRAMmask = 0x7f;
r4425r4426
13451357
13461358static CPU_RESET( pic16c58 )
13471359{
1348   pic16c5x_state *cpustate = device->token;
1360   pic16c5x_state *cpustate = get_safe_token(device);
13491361
13501362   cpustate->picmodel = 0x16C58;
13511363   cpustate->picRAMmask = 0x7f;
src/emu/cpu/pdp1/pdp1.c
r4425r4426
421421   int icount;
422422};
423423
424INLINE pdp1_state *get_safe_token(const device_config *device)
425{
426   assert(device != NULL);
427   assert(device->token != NULL);
428   assert(device->type == CPU);
429   assert(cpu_get_type(device) == CPU_PDP1);
430   return (pdp1_state *)device->token;
431}
432
424433static void execute_instruction(pdp1_state *cpustate);
425434static void null_iot (const device_config *device, int op2, int nac, int mb, int *io, int ac);
426435static void lem_eem_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac);
r4425r4426
529538
530539static CPU_INIT( pdp1 )
531540{
532   const pdp1_reset_param_t *param = device->static_config;
533   pdp1_state *cpustate = device->token;
541   const pdp1_reset_param_t *param = (const pdp1_reset_param_t *)device->static_config;
542   pdp1_state *cpustate = get_safe_token(device);
534543   int i;
535544
536545   /* clean-up */
r4425r4426
611620/* execute instructions on this CPU until icount expires */
612621static CPU_EXECUTE( pdp1 )
613622{
614   pdp1_state *cpustate = device->token;
623   pdp1_state *cpustate = get_safe_token(device);
615624
616625   cpustate->icount = cycles;
617626
r4425r4426
859868
860869static CPU_SET_INFO( pdp1 )
861870{
862   pdp1_state *cpustate = device->token;
871   pdp1_state *cpustate = get_safe_token(device);
863872
864873   switch (state)
865874   {
r4425r4426
927936
928937CPU_GET_INFO( pdp1 )
929938{
930   pdp1_state *cpustate = (device != NULL) ? device->token : NULL;
939   pdp1_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
931940
932941   switch (state)
933942   {
r4425r4426
16961705*/
16971706static void null_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac)
16981707{
1699   pdp1_state *cpustate = device->token;
1708   pdp1_state *cpustate = get_safe_token(device);
17001709   /* Note that the dummy IOT 0 is used to wait for the completion pulse
17011710    generated by the a pending IOT (IOT with completion pulse but no IO wait) */
17021711   if (LOG_IOT_EXTRA)
r4425r4426
17191728*/
17201729static void lem_eem_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac)
17211730{
1722   pdp1_state *cpustate = device->token;
1731   pdp1_state *cpustate = get_safe_token(device);
17231732   if (! cpustate->extend_support)   /* extend mode supported? */
17241733   {
17251734      if (LOG)
r4425r4426
17431752*/
17441753static void sbs_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac)
17451754{
1746   pdp1_state *cpustate = device->token;
1755   pdp1_state *cpustate = get_safe_token(device);
17471756   switch (op2)
17481757   {
17491758   case 054:   /* LSM */
r4425r4426
17871796*/
17881797static void type_20_sbs_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac)
17891798{
1790   pdp1_state *cpustate = device->token;
1799   pdp1_state *cpustate = get_safe_token(device);
17911800   int channel, mask;
17921801   if (! cpustate->type_20_sbs)   /* type 20 sequence break system supported? */
17931802   {
src/emu/cpu/pdp1/tx0.c
r4425r4426
6868   const address_space *program;
6969};
7070
71INLINE tx0_state *get_safe_token(const device_config *device)
72{
73   assert(device != NULL);
74   assert(device->token != NULL);
75   assert(device->type == CPU);
76   assert(cpu_get_type(device) == CPU_TX0_64KW ||
77         cpu_get_type(device) == CPU_TX0_8KW);
78   return (tx0_state *)device->token;
79}
7180
7281#define READ_TX0_18BIT(A) ((signed)memory_read_dword_32be(cpustate->program, (A)<<2))
7382#define WRITE_TX0_18BIT(A,V) (memory_write_dword_32be(cpustate->program, (A)<<2,(V)))
r4425r4426
120129
121130static void tx0_init_common(int is_64kw, const device_config *device, cpu_irq_callback irqcallback)
122131{
123   tx0_state *cpustate = device->token;
132   tx0_state *cpustate = get_safe_token(device);
124133
125134   /* clean-up */
126   cpustate->iface = device->static_config;
135   cpustate->iface = (const tx0_reset_param_t *)device->static_config;
127136
128137   cpustate->address_mask = is_64kw ? ADDRESS_MASK_64KW : ADDRESS_MASK_8KW;
129138   cpustate->ir_mask = is_64kw ? 03 : 037;
r4425r4426
144153
145154static CPU_RESET( tx0 )
146155{
147   tx0_state *cpustate = device->token;
156   tx0_state *cpustate = get_safe_token(device);
148157
149158   /* reset CPU flip-flops */
150159   pulse_reset(device);
r4425r4426
155164/* execute instructions on this CPU until icount expires */
156165static CPU_EXECUTE( tx0_64kw )
157166{
158   tx0_state *cpustate = device->token;
167   tx0_state *cpustate = get_safe_token(device);
159168
160169   cpustate->icount = cycles;
161170
r4425r4426
265274/* execute instructions on this CPU until icount expires */
266275static CPU_EXECUTE( tx0_8kw )
267276{
268   tx0_state *cpustate = device->token;
277   tx0_state *cpustate = get_safe_token(device);
269278
270279   cpustate->icount = cycles;
271280
r4425r4426
375384
376385static CPU_SET_INFO( tx0 )
377386{
378   tx0_state *cpustate = device->token;
387   tx0_state *cpustate = get_safe_token(device);
379388
380389   switch (state)
381390   {
r4425r4426
426435
427436CPU_GET_INFO( tx0_64kw )
428437{
429   tx0_state *cpustate = ( device != NULL ) ? device->token : NULL;
438   tx0_state *cpustate = ( device != NULL && device->token != NULL ) ? get_safe_token(device) : NULL;
430439
431440   switch (state)
432441   {
r4425r4426
552561
553562CPU_GET_INFO( tx0_8kw )
554563{
555   tx0_state *cpustate = ( device != NULL ) ? device->token : NULL;
564   tx0_state *cpustate = ( device != NULL && device->token != NULL ) ? get_safe_token(device) : NULL;
556565
557566   switch (state)
558567   {
r4425r4426
680689/* execute one instruction */
681690static void execute_instruction_64kw(const device_config *device)
682691{
683   tx0_state *cpustate = device->token;
692   tx0_state *cpustate = get_safe_token(device);
684693
685694   if (! cpustate->cycle)
686695   {
r4425r4426
779788         if ((MAR & 0000104) == 0000100)
780789            /* (1.1) PEN = Read the light pen flip-flops 1 and 2 into AC(0) and
781790                    AC(1). */
782            /*...*/;
791            /*...*/{ }
783792
784793         if ((MAR & 0000104) == 0000004)
785794            /* (1.1) TAC = Insert a one in each digital position of the AC
786795                    wherever there is a one in the corresponding digital position
787796                    of the TAC. */
788            /*...*/;
797            /*...*/ { }
789798
790799         if (MAR & 0000040)
791800            /* (1.2) COM = Complement every digit in the accumulator */
r4425r4426
797806
798807         if ((MAR & 0000003) == 3)
799808            /* (1.2) TBR = Store the contents of the TBR in the MBR. */
800            /*...*/;
809            /*...*/ { }
801810
802811         if ((MAR & 0000003) == 2)
803812            /* (1.3) LMB = Store the contents of the LR in the MBR. */
r4425r4426
871880/* execute one instruction */
872881static void execute_instruction_8kw(const device_config *device)
873882{
874   tx0_state *cpustate = device->token;
883   tx0_state *cpustate = get_safe_token(device);
875884
876885   if (! cpustate->cycle)
877886   {
r4425r4426
12771286*/
12781287static void pulse_reset(const device_config *device)
12791288{
1280   tx0_state *cpustate = device->token;
1289   tx0_state *cpustate = get_safe_token(device);
12811290
12821291   /* processor registers */
12831292   PC = 0;         /* ??? */
src/emu/cpu/mb86233/mb86233.c
r4425r4426
6262   UINT32         *Tables;
6363};
6464
65INLINE mb86233_state *get_safe_token(const device_config *device)
66{
67   assert(device != NULL);
68   assert(device->token != NULL);
69   assert(device->type == CPU);
70   assert(cpu_get_type(device) == CPU_MB86233);
71   return (mb86233_state *)device->token;
72}
73
6574/***************************************************************************
6675    MACROS
6776***************************************************************************/
r4425r4426
95104
96105static CPU_INIT( mb86233 )
97106{
98   mb86233_state *cpustate = device->token;
107   mb86233_state *cpustate = get_safe_token(device);
99108   mb86233_cpu_core * _config = (mb86233_cpu_core *)device->static_config;
100109   (void)irqcallback;
101110
r4425r4426
109118      cpustate->fifo_write_cb = _config->fifo_write_cb;
110119   }
111120
112   cpustate->RAM = auto_malloc(2 * 0x200 * sizeof(UINT32));      /* 2x 2KB */
121   cpustate->RAM = (UINT32 *)auto_malloc(2 * 0x200 * sizeof(UINT32));      /* 2x 2KB */
113122   memset( cpustate->RAM, 0, 2 * 0x200 * sizeof(UINT32) );
114123   cpustate->ARAM = &cpustate->RAM[0];
115124   cpustate->BRAM = &cpustate->RAM[0x200];
r4425r4426
120129
121130static CPU_RESET( mb86233 )
122131{
123   mb86233_state *cpustate = device->token;
132   mb86233_state *cpustate = get_safe_token(device);
124133
125134   /* zero registers and flags */
126135   cpustate->pc = 0;
r4425r4426
928937
929938static CPU_EXECUTE( mb86233 )
930939{
931   mb86233_state *cpustate = device->token;
940   mb86233_state *cpustate = get_safe_token(device);
932941
933942   cpustate->icount = cycles;
934943
r4425r4426
15681577
15691578static CPU_SET_INFO( mb86233 )
15701579{
1571   mb86233_state *cpustate = device->token;
1580   mb86233_state *cpustate = get_safe_token(device);
15721581
15731582   switch (state)
15741583   {
r4425r4426
16091618
16101619CPU_GET_INFO( mb86233 )
16111620{
1612   mb86233_state *cpustate = (device != NULL) ? device->token : NULL;
1621   mb86233_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
16131622
16141623   switch (state)
16151624   {
src/emu/cpu/t11/t11.c
r4425r4426
3737};
3838
3939
40INLINE t11_state *get_safe_token(const device_config *device)
41{
42   assert(device != NULL);
43   assert(device->token != NULL);
44   assert(device->type == CPU);
45   assert(cpu_get_type(device) == CPU_T11);
46   return (t11_state *)device->token;
47}
4048
49
50
4151/*************************************
4252 *
4353 *  Macro shortcuts
r4425r4426
248258      0xc000, 0x8000, 0x4000, 0x2000,
249259      0x1000, 0x0000, 0xf600, 0xf400
250260   };
251   const struct t11_setup *setup = device->static_config;
252   t11_state *cpustate = device->token;
261   const struct t11_setup *setup = (const struct t11_setup *)device->static_config;
262   t11_state *cpustate = get_safe_token(device);
253263
254264   cpustate->initial_pc = initial_pc[setup->mode >> 13];
255265   cpustate->irq_callback = irqcallback;
r4425r4426
281291
282292static CPU_RESET( t11 )
283293{
284   t11_state *cpustate = device->token;
294   t11_state *cpustate = get_safe_token(device);
285295
286296   /* initial SP is 376 octal, or 0xfe */
287297   cpustate->SP = 0x00fe;
r4425r4426
333343
334344static CPU_EXECUTE( t11 )
335345{
336   t11_state *cpustate = device->token;
346   t11_state *cpustate = get_safe_token(device);
337347
338348   cpustate->icount = cycles;
339349   t11_check_irqs(cpustate);
r4425r4426
370380
371381static CPU_SET_INFO( t11 )
372382{
373   t11_state *cpustate = device->token;
383   t11_state *cpustate = get_safe_token(device);
374384
375385   switch (state)
376386   {
r4425r4426
402412
403413CPU_GET_INFO( t11 )
404414{
405   t11_state *cpustate = (device != NULL) ? device->token : NULL;
415   t11_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
406416
407417   switch (state)
408418   {
src/emu/cpu/arm7/arm7core.c
r4425r4426
509509// CPU INIT
510510static void arm7_core_init(const char *cpuname, const device_config *device)
511511{
512    arm_state *cpustate = device->token;
512    arm_state *cpustate = get_safe_token(device);
513513
514514    state_save_register_device_item_array(device, 0, cpustate->sArmRegister);
515515    state_save_register_device_item(device, 0, cpustate->pendingIrq);
r4425r4426
523523// CPU RESET
524524static void arm7_core_reset(const device_config *device)
525525{
526    arm_state *cpustate = device->token;
526    arm_state *cpustate = get_safe_token(device);
527527
528528    cpu_irq_callback save_irqcallback = cpustate->irq_callback;
529529
src/emu/cpu/arm7/arm7.c
r4425r4426
6666#define ARM7REG(reg)        cpustate->sArmRegister[reg]
6767#define ARM7_ICOUNT         cpustate->iCount
6868
69INLINE arm_state *get_safe_token(const device_config *device)
70{
71   assert(device != NULL);
72   assert(device->token != NULL);
73   assert(device->type == CPU);
74   assert(cpu_get_type(device) == CPU_ARM7);
75   return (arm_state *)device->token;
76}
77
6978/* include the arm7 core */
7079#include "arm7core.c"
7180
r4425r4426
7483 **************************************************************************/
7584static CPU_INIT( arm7 )
7685{
77   arm_state *cpustate = device->token;
86   arm_state *cpustate = get_safe_token(device);
7887
7988   // must call core
8089   arm7_core_init("arm7", device);
r4425r4426
119128
120129static CPU_DISASSEMBLE( arm7 )
121130{
122    arm_state *cpustate = device->token;
131    arm_state *cpustate = get_safe_token(device);
123132
124133    if (T_IS_SET(GET_CPSR))
125134    {
r4425r4426
138147
139148static CPU_SET_INFO( arm7 )
140149{
141    arm_state *cpustate = device->token;
150    arm_state *cpustate = get_safe_token(device);
142151
143152    switch (state)
144153    {
r4425r4426
214223
215224CPU_GET_INFO( arm7 )
216225{
217    arm_state *cpustate = (device != NULL) ? device->token : NULL;
226    arm_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
218227
219228    switch (state)
220229    {
src/emu/cpu/arm7/arm7exec.c
r4425r4426
4343{
4444    UINT32 pc;
4545    UINT32 insn;
46    arm_state *cpustate = device->token;
46    arm_state *cpustate = get_safe_token(device);
4747
4848    ARM7_ICOUNT = cycles;
4949    do
src/emu/cpu/drcbex86.c
r4425r4426
538538   drcbe_state *drcbe;
539539
540540   /* allocate space in the cache for our state */
541   drcbe = drccache_memory_alloc(cache, sizeof(*drcbe));
541   drcbe = (drcbe_state *)drccache_memory_alloc(cache, sizeof(*drcbe));
542542   if (drcbe == NULL)
543543      return NULL;
544544   memset(drcbe, 0, sizeof(*drcbe));
r4425r4426
700700   emit_mov_m32_r32(dst, MBD(REG_ECX, offsetof(drcuml_machine_state, exp)), REG_EAX);   // mov    state->exp,eax
701701   for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.r); regnum++)
702702   {
703      int regoffsl = (int)&((drcuml_machine_state *)NULL)->r[regnum].w.l;
704      int regoffsh = (int)&((drcuml_machine_state *)NULL)->r[regnum].w.h;
703705      if (int_register_map[regnum] != 0)
704         emit_mov_m32_r32(dst, MBD(REG_ECX, offsetof(drcuml_machine_state, r[regnum].w.l)), int_register_map[regnum]);
706         emit_mov_m32_r32(dst, MBD(REG_ECX, regoffsl), int_register_map[regnum]);
705707      else
706708      {
707709         emit_mov_r32_m32(dst, REG_EAX, MABS(&drcbe->state.r[regnum].w.l));
708         emit_mov_m32_r32(dst, MBD(REG_ECX, offsetof(drcuml_machine_state, r[regnum].w.l)), REG_EAX);
710         emit_mov_m32_r32(dst, MBD(REG_ECX, regoffsl), REG_EAX);
709711      }
710712      emit_mov_r32_m32(dst, REG_EAX, MABS(&drcbe->state.r[regnum].w.h));
711      emit_mov_m32_r32(dst, MBD(REG_ECX, offsetof(drcuml_machine_state, r[regnum].w.h)), REG_EAX);
713      emit_mov_m32_r32(dst, MBD(REG_ECX, regoffsh), REG_EAX);
712714   }
713715   for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.f); regnum++)
714716   {
717      int regoffsl = (int)&((drcuml_machine_state *)NULL)->f[regnum].s.l;
718      int regoffsh = (int)&((drcuml_machine_state *)NULL)->f[regnum].s.h;
715719      emit_mov_r32_m32(dst, REG_EAX, MABS(&drcbe->state.f[regnum].s.l));
716      emit_mov_m32_r32(dst, MBD(REG_ECX, offsetof(drcuml_machine_state, f[regnum].s.l)), REG_EAX);
720      emit_mov_m32_r32(dst, MBD(REG_ECX, regoffsl), REG_EAX);
717721      emit_mov_r32_m32(dst, REG_EAX, MABS(&drcbe->state.f[regnum].s.h));
718      emit_mov_m32_r32(dst, MBD(REG_ECX, offsetof(drcuml_machine_state, f[regnum].s.h)), REG_EAX);
722      emit_mov_m32_r32(dst, MBD(REG_ECX, regoffsh), REG_EAX);
719723   }
720724   emit_ret(dst);                                                      // ret
721725   if (drcbe->log != NULL && !drcbe->logged_common)
r4425r4426
725729   drcbe->restore = *dst;
726730   for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.r); regnum++)
727731   {
732      int regoffsl = (int)&((drcuml_machine_state *)NULL)->r[regnum].w.l;
733      int regoffsh = (int)&((drcuml_machine_state *)NULL)->r[regnum].w.h;
728734      if (int_register_map[regnum] != 0)
729         emit_mov_r32_m32(dst, int_register_map[regnum], MBD(REG_ECX, offsetof(drcuml_machine_state, r[regnum].w.l)));
735         emit_mov_r32_m32(dst, int_register_map[regnum], MBD(REG_ECX, regoffsl));
730736      else
731737      {
732         emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, offsetof(drcuml_machine_state, r[regnum].w.l)));
738         emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, regoffsl));
733739         emit_mov_m32_r32(dst, MABS(&drcbe->state.r[regnum].w.l), REG_EAX);
734740      }
735      emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, offsetof(drcuml_machine_state, r[regnum].w.h)));
741      emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, regoffsh));
736742      emit_mov_m32_r32(dst, MABS(&drcbe->state.r[regnum].w.h), REG_EAX);
737743   }
738744   for (regnum = 0; regnum < ARRAY_LENGTH(drcbe->state.f); regnum++)
739745   {
740      emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, offsetof(drcuml_machine_state, f[regnum].s.l)));
746      int regoffsl = (int)&((drcuml_machine_state *)NULL)->f[regnum].s.l;
747      int regoffsh = (int)&((drcuml_machine_state *)NULL)->f[regnum].s.h;
748      emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, regoffsl));
741749      emit_mov_m32_r32(dst, MABS(&drcbe->state.f[regnum].s.l), REG_EAX);
742      emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, offsetof(drcuml_machine_state, f[regnum].s.h)));
750      emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, regoffsh));
743751      emit_mov_m32_r32(dst, MABS(&drcbe->state.f[regnum].s.h), REG_EAX);
744752   }
745753   emit_movzx_r32_m8(dst, REG_EAX, MBD(REG_ECX, offsetof(drcuml_machine_state, fmod)));// movzx eax,state->fmod
r4425r4426
30143022
30153023static void fixup_label(void *parameter, drccodeptr labelcodeptr)
30163024{
3017   drccodeptr src = parameter;
3025   drccodeptr src = (drccodeptr)parameter;
30183026
30193027   /* find the end of the instruction */
30203028   if (src[0] == 0xe3)
r4425r4426
30453053static void fixup_exception(drccodeptr *codeptr, void *param1, void *param2, void *param3)
30463054{
30473055   drcuml_parameter handp, exp;
3048   drcbe_state *drcbe = param1;
3049   drccodeptr src = param2;
3050   const drcuml_instruction *inst = param3;
3056   drcbe_state *drcbe = (drcbe_state *)param1;
3057   drccodeptr src = (drccodeptr)param2;
3058   const drcuml_instruction *inst = (const drcuml_instruction *)param3;
30513059   drccodeptr dst = *codeptr;
30523060   drccodeptr *targetptr;
30533061
src/emu/cpu/h6280/h6280ops.h
r4425r4426
2828#define S   cpustate->sp.b.l
2929
3030#define TRANSLATED(addr)   ((cpustate->mmr[(addr)>>13] << 13) | ((addr)&0x1fff))
31#define CHANGE_PC
3231#define H6280_CYCLES(cyc)                                 \
3332   {                                                \
3433      cpustate->ICount -= ((cyc) * cpustate->clocks_per_cycle);      \
src/emu/cpu/h6280/h6280.c
r4425r4426
116116/* include the macros */
117117#include "h6280ops.h"
118118
119INLINE h6280_Regs *get_safe_token(const device_config *device)
120{
121   assert(device != NULL);
122   assert(device->token != NULL);
123   assert(device->type == CPU);
124   assert(cpu_get_type(device) == CPU_H6280);
125   return (h6280_Regs *)device->token;
126}
127
119128/* include the opcode macros, functions and function pointer tables */
120129#include "tblh6280.c"
121130
122131/*****************************************************************************/
123132static CPU_INIT( h6280 )
124133{
125   h6280_Regs* cpustate = device->token;
134   h6280_Regs* cpustate = get_safe_token(device);
126135
127136   state_save_register_device_item(device, 0, cpustate->ppc.w.l);
128137   state_save_register_device_item(device, 0, cpustate->pc.w.l);
r4425r4426
159168
160169static CPU_RESET( h6280 )
161170{
162   h6280_Regs* cpustate = device->token;
171   h6280_Regs* cpustate = get_safe_token(device);
163172
164173   cpu_irq_callback save_irqcallback;
165174   int i;
r4425r4426
181190    /* read the reset vector into PC */
182191   PCL = RDMEM(cpustate, H6280_RESET_VEC);
183192   PCH = RDMEM(cpustate, (H6280_RESET_VEC+1));
184   CHANGE_PC;
185193
186194   /* CPU starts in low speed mode */
187195    cpustate->clocks_per_cycle = 4;
r4425r4426
206214static CPU_EXECUTE( h6280 )
207215{
208216   int in;
209   h6280_Regs* cpustate = device->token;
217   h6280_Regs* cpustate = get_safe_token(device);
210218
211219   cpustate->ICount = cycles;
212220
r4425r4426
217225   /* Execute instructions */
218226   do
219227    {
220       if ((cpustate->ppc.w.l ^ cpustate->pc.w.l) & 0xe000)
221          CHANGE_PC;
222228      cpustate->ppc = cpustate->pc;
223229
224230      debugger_instruction_hook(device, PCW);
r4425r4426
348354
349355static CPU_TRANSLATE( h6280 )
350356{
351   h6280_Regs* cpustate = device->token;
357   h6280_Regs* cpustate = get_safe_token(device);
352358
353359   if (space == ADDRESS_SPACE_PROGRAM)
354360      *address = TRANSLATED(*address);
r4425r4426
358364
359365UINT8 h6280io_get_buffer(const device_config *device)
360366{
361   h6280_Regs* cpustate = device->token;
367   h6280_Regs* cpustate = get_safe_token(device);
362368   return cpustate->io_buffer;
363369}
364370void h6280io_set_buffer(const device_config *device, UINT8 data)
365371{
366   h6280_Regs* cpustate = device->token;
372   h6280_Regs* cpustate = get_safe_token(device);
367373   cpustate->io_buffer=data;
368374}
369375
r4425r4426
376382
377383static CPU_SET_INFO( h6280 )
378384{
379   h6280_Regs* cpustate = device->token;
385   h6280_Regs* cpustate = get_safe_token(device);
380386
381387   switch (state)
382388   {
r4425r4426
419425
420426CPU_GET_INFO( h6280 )
421427{
422   h6280_Regs* cpustate = (device != NULL) ? device->token : NULL;
428   h6280_Regs* cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
423429
424430   switch (state)
425431   {
src/emu/cpu/m6800/6800dasm.c
r4425r4426
4747   oim,   ora,   orb,   psha,   pshb,   pshx,   pula,   pulb,
4848   pulx,   rol,   rola,   rolb,   ror,   rora,   rorb,   rti,
4949   rts,   sba,   sbca,   sbcb,   sec,   sev,   sta,   stb,
50   std,   sei,   sts,   stx,   suba,   subb,   subd,   swi,
50   _std,   sei,   sts,   stx,   suba,   subb,   subd,   swi,
5151   wai,   tab,   tap,   tba,   tim,   tpa,   tst,   tsta,
5252   tstb,   tsx,   txs,   asx1,   asx2,   xgdx,   addx,   adcx
5353};
r4425r4426
131131   {subb,imb,0},{cmpb,imb,0},{sbcb,imb,0},{addd,imw,1},/* c0 */
132132   {andb,imb,0},{bitb,imb,0},{ldb, imb,0},{stb, imb,0},
133133   {eorb,imb,0},{adcb,imb,0},{orb, imb,0},{addb,imb,0},
134   {ldd, imw,1},{std, imw,1},{ldx, imw,0},{stx, imw,0},
134   {ldd, imw,1},{_std,imw,1},{ldx, imw,0},{stx, imw,0},
135135   {subb,dir,0},{cmpb,dir,0},{sbcb,dir,0},{addd,dir,1},/* d0 */
136136   {andb,dir,0},{bitb,dir,0},{ldb, dir,0},{stb, dir,0},
137137   {eorb,dir,0},{adcb,dir,0},{orb, dir,0},{addb,dir,0},
138   {ldd, dir,1},{std, dir,1},{ldx, dir,0},{stx, dir,0},
138   {ldd, dir,1},{_std,dir,1},{ldx, dir,0},{stx, dir,0},
139139   {subb,idx,0},{cmpb,idx,0},{sbcb,idx,0},{addd,idx,1},/* e0 */
140140   {andb,idx,0},{bitb,idx,0},{ldb, idx,0},{stb, idx,0},
141141   {eorb,idx,0},{adcb,idx,0},{orb, idx,0},{addb,idx,0},
142   {ldd, idx,1},{std, idx,1},{ldx, idx,0},{stx, idx,0},
142   {ldd, idx,1},{_std,idx,1},{ldx, idx,0},{stx, idx,0},
143143   {subb,ext,0},{cmpb,ext,0},{sbcb,ext,0},{addd,ext,1},/* f0 */
144144   {andb,ext,0},{bitb,ext,0},{ldb, ext,0},{stb, ext,0},
145145   {eorb,ext,0},{adcb,ext,0},{orb, ext,0},{addb,ext,0},
146   {ldd, ext,1},{std, ext,1},{ldx, ext,0},{stx, ext,0},
146   {ldd, ext,1},{_std,ext,1},{ldx, ext,0},{stx, ext,0},
147147
148148   /* extra instruction $fc for NSC-8105 */
149149   {addx,ext,0},
src/emu/cpu/m6800/m6800.c
r4425r4426
152152
153153};
154154
155//static void *token; /* for READ8/WRITE8 handlers */
155INLINE m6800_state *get_safe_token(const device_config *device)
156{
157   assert(device != NULL);
158   assert(device->token != NULL);
159   assert(device->type == CPU);
160   assert(cpu_get_type(device) == CPU_M6800 ||
161         cpu_get_type(device) == CPU_M6801 ||
162         cpu_get_type(device) == CPU_M6802 ||
163         cpu_get_type(device) == CPU_M6803 ||
164         cpu_get_type(device) == CPU_M6808 ||
165         cpu_get_type(device) == CPU_HD63701 ||
166         cpu_get_type(device) == CPU_NSC8105);
167   return (m6800_state *)device->token;
168}
156169
157170#if 0
158171static void hd63701_trap_pc(m6800_state *cpustate);
r4425r4426
663676
664677static TIMER_CALLBACK(m6800_tx_tick)
665678{
666    m6800_state *cpustate = ptr;
679    m6800_state *cpustate = (m6800_state *)ptr;
667680
668681   if (cpustate->trcsr & M6800_TRCSR_TE)
669682   {
r4425r4426
737750
738751static TIMER_CALLBACK(m6800_rx_tick)
739752{
740    m6800_state *cpustate =ptr;
753    m6800_state *cpustate = (m6800_state *)ptr;
741754
742755   if (cpustate->trcsr & M6800_TRCSR_RE)
743756   {
r4425r4426
884897
885898static CPU_INIT( m6800 )
886899{
887   m6800_state *cpustate = device->token;
900   m6800_state *cpustate = get_safe_token(device);
888901
889902   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
890903   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
r4425r4426
900913
901914static CPU_RESET( m6800 )
902915{
903   m6800_state *cpustate = device->token;
916   m6800_state *cpustate = get_safe_token(device);
904917
905918   SEI;            /* IRQ disabled */
906919   PCD = RM16(cpustate,  0xfffe );
r4425r4426
12421255 ****************************************************************************/
12431256static CPU_EXECUTE( m6800 )
12441257{
1245   m6800_state *cpustate = device->token;
1258   m6800_state *cpustate = get_safe_token(device);
12461259   UINT8 ireg;
12471260   cpustate->icount = cycles;
12481261
r4425r4426
12761289#if (HAS_M6801)
12771290static CPU_INIT( m6801 )
12781291{
1279   m6800_state *cpustate = device->token;
1292   m6800_state *cpustate = get_safe_token(device);
12801293//  cpustate->subtype = SUBTYPE_M6801;
12811294   cpustate->insn = m6803_insn;
12821295   cpustate->cycles = cycles_6803;
r4425r4426
13011314#if (HAS_M6802)
13021315static CPU_INIT( m6802 )
13031316{
1304   m6800_state *cpustate = device->token;
1317   m6800_state *cpustate = get_safe_token(device);
13051318   //  cpustate->subtype   = SUBTYPE_M6802;
13061319   cpustate->insn = m6800_insn;
13071320   cpustate->cycles = cycles_6800;
r4425r4426
13221335#if (HAS_M6803)
13231336static CPU_INIT( m6803 )
13241337{
1325   m6800_state *cpustate = device->token;
1338   m6800_state *cpustate = get_safe_token(device);
13261339   //  cpustate->subtype = SUBTYPE_M6803;
13271340   cpustate->insn = m6803_insn;
13281341   cpustate->cycles = cycles_6803;
r4425r4426
16141627#if (HAS_M6803||HAS_M6801)
16151628static CPU_EXECUTE( m6803 )
16161629{
1617   m6800_state *cpustate = device->token;
1630   m6800_state *cpustate = get_safe_token(device);
16181631   UINT8 ireg;
16191632   cpustate->icount = cycles;
16201633
r4425r4426
16621675#if (HAS_M6808)
16631676static CPU_INIT( m6808 )
16641677{
1665   m6800_state *cpustate = device->token;
1678   m6800_state *cpustate = get_safe_token(device);
16661679   //  cpustate->subtype = SUBTYPE_M6808;
16671680   cpustate->insn = m6800_insn;
16681681   cpustate->cycles = cycles_6800;
r4425r4426
16841697
16851698static CPU_INIT( hd63701 )
16861699{
1687   m6800_state *cpustate = device->token;
1700   m6800_state *cpustate = get_safe_token(device);
16881701   //  cpustate->subtype = SUBTYPE_HD63701;
16891702   cpustate->insn = hd63701_insn;
16901703   cpustate->cycles = cycles_63701;
r4425r4426
19741987 ****************************************************************************/
19751988static CPU_EXECUTE( hd63701 )
19761989{
1977   m6800_state *cpustate = device->token;
1990   m6800_state *cpustate = get_safe_token(device);
19781991   UINT8 ireg;
19791992   cpustate->icount = cycles;
19801993
r4425r4426
20372050#if (HAS_NSC8105)
20382051static CPU_INIT( nsc8105 )
20392052{
2040   m6800_state *cpustate = device->token;
2053   m6800_state *cpustate = get_safe_token(device);
20412054   //  cpustate->subtype = SUBTYPE_NSC8105;
20422055   cpustate->device = device;
20432056
r4425r4426
23222335 ****************************************************************************/
23232336static CPU_EXECUTE( nsc8105 )
23242337{
2325   m6800_state *cpustate = device->token;
2338   m6800_state *cpustate = get_safe_token(device);
23262339   UINT8 ireg;
23272340   cpustate->icount = cycles;
23282341
r4425r4426
23562369
23572370static READ8_HANDLER( m6803_internal_registers_r )
23582371{
2359   m6800_state *cpustate = space->cpu->token;
2372   m6800_state *cpustate = get_safe_token(space->cpu);
23602373
23612374   switch (offset)
23622375   {
r4425r4426
24542467
24552468static WRITE8_HANDLER( m6803_internal_registers_w )
24562469{
2457   m6800_state *cpustate = space->cpu->token;
2470   m6800_state *cpustate = get_safe_token(space->cpu);
24582471
24592472   switch (offset)
24602473   {
r4425r4426
26502663
26512664static CPU_SET_INFO( m6800 )
26522665{
2653   m6800_state *cpustate = device->token;
2666   m6800_state *cpustate = get_safe_token(device);
26542667
26552668   switch (state)
26562669   {
r4425r4426
26782691
26792692CPU_GET_INFO( m6800 )
26802693{
2681   m6800_state *cpustate = device ? device->token : NULL;
2694   m6800_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
26822695   switch (state)
26832696   {
26842697      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/cp1610/cp1610.c
r4425r4426
5151   int icount;
5252};
5353
54INLINE cp1610_state *get_safe_token(const device_config *device)
55{
56   assert(device != NULL);
57   assert(device->token != NULL);
58   assert(device->type == CPU);
59   assert(cpu_get_type(device) == CPU_CP1610);
60   return (cp1610_state *)device->token;
61}
62
5463#define cp1610_readop(A) memory_read_word_16be(cpustate->program, (A)<<1)
5564#define cp1610_readmem16(A) memory_read_word_16be(cpustate->program, (A)<<1)
5665#define cp1610_writemem16(A,B) memory_write_word_16be(cpustate->program, (A)<<1,B)
r4425r4426
21652174/* Execute cycles - returns number of cycles actually run */
21662175static CPU_EXECUTE( cp1610 )
21672176{
2168   cp1610_state *cpustate = device->token;
2177   cp1610_state *cpustate = get_safe_token(device);
21692178   UINT16 opcode;
21702179
21712180   cpustate->icount = cycles;
r4425r4426
33793388
33803389static CPU_INIT( cp1610 )
33813390{
3382   cp1610_state *cpustate = device->token;
3391   cp1610_state *cpustate = get_safe_token(device);
33833392   cpustate->intr_enabled = 0;
33843393   cpustate->reset_pending = 0;
33853394   cpustate->intr_pending = 0;
r4425r4426
34133422
34143423static CPU_SET_INFO( cp1610 )
34153424{
3416   cp1610_state *cpustate = device->token;
3425   cp1610_state *cpustate = get_safe_token(device);
34173426   switch (state)
34183427   {
34193428   /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
34393448
34403449CPU_GET_INFO( cp1610 )
34413450{
3442   cp1610_state *cpustate = (device != NULL) ? device->token : NULL;
3451   cp1610_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
34433452   switch (state)
34443453   {
34453454   /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/cpu/saturn/saturn.c
r4425r4426
8686   int icount;
8787};
8888
89INLINE saturn_state *get_safe_token(const device_config *device)
90{
91   assert(device != NULL);
92   assert(device->token != NULL);
93   assert(device->type == CPU);
94   assert(cpu_get_type(device) == CPU_SATURN);
95   return (saturn_state *)device->token;
96}
97
8998/***************************************************************
9099 * include the opcode macros, functions and tables
91100 ***************************************************************/
r4425r4426
101110
102111static CPU_INIT( saturn )
103112{
104   saturn_state *cpustate = device->token;
113   saturn_state *cpustate = get_safe_token(device);
105114
106115   cpustate->config = (saturn_cpu_core *) device->static_config;
107116   cpustate->irq_callback = irqcallback;
r4425r4426
135144
136145static CPU_RESET( saturn )
137146{
138   saturn_state *cpustate = device->token;
147   saturn_state *cpustate = get_safe_token(device);
139148
140149   cpustate->pc=0;
141150   cpustate->sleeping = 0;
r4425r4426
159168
160169static CPU_EXECUTE( saturn )
161170{
162   saturn_state *cpustate = device->token;
171   saturn_state *cpustate = get_safe_token(device);
163172
164173   cpustate->icount = cycles;
165174
r4425r4426
238247
239248static CPU_SET_INFO( saturn )
240249{
241   saturn_state *cpustate = device->token;
250   saturn_state *cpustate = get_safe_token(device);
242251
243252   switch (state)
244253   {
r4425r4426
295304
296305CPU_GET_INFO( saturn )
297306{
298   saturn_state *cpustate = (device != NULL) ? device->token : NULL;
307   saturn_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
299308
300309   switch (state)
301310   {
src/emu/cpu/konami/konami.c
r4425r4426
6565   konami_set_lines_func setlines_callback;
6666};
6767
68INLINE konami_state *get_safe_token(const device_config *device)
69{
70   assert(device != NULL);
71   assert(device->token != NULL);
72   assert(device->type == CPU);
73   assert(cpu_get_type(device) == CPU_KONAMI);
74   return (konami_state *)device->token;
75}
76
6877/* flag bits in the cc register */
6978#define CC_C    0x01        /* Carry */
7079#define CC_V    0x02        /* Overflow */
r4425r4426
391400/****************************************************************************/
392401static CPU_INIT( konami )
393402{
394   konami_state *cpustate = device->token;
403   konami_state *cpustate = get_safe_token(device);
395404
396405   cpustate->irq_callback = irqcallback;
397406   cpustate->device = device;
r4425r4426
414423
415424static CPU_RESET( konami )
416425{
417   konami_state *cpustate = device->token;
426   konami_state *cpustate = get_safe_token(device);
418427
419428   cpustate->int_state = 0;
420429   cpustate->nmi_state = CLEAR_LINE;
r4425r4426
462471/* execute instructions on this CPU until icount expires */
463472static CPU_EXECUTE( konami )
464473{
465   konami_state *cpustate = device->token;
474   konami_state *cpustate = get_safe_token(device);
466475
467476   cpustate->icount = cycles;
468477   check_irq_lines(cpustate);
r4425r4426
501510
502511static CPU_SET_INFO( konami )
503512{
504   konami_state *cpustate = device->token;
513   konami_state *cpustate = get_safe_token(device);
505514   switch (state)
506515   {
507516      /* --- the following bits of info are set as 64-bit signed integers --- */
r4425r4426
534543
535544CPU_GET_INFO( konami )
536545{
537   konami_state *cpustate = (device != NULL) ? device->token : NULL;
546   konami_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
538547   switch (state)
539548   {
540549      /* --- the following bits of info are returned as 64-bit signed integers --- */
src/emu/streams.c
r4425r4426
218218   streams_private *strdata;
219219
220220   /* allocate memory for our private data */
221   strdata = auto_malloc(sizeof(*strdata));
221   strdata = (streams_private *)auto_malloc(sizeof(*strdata));
222222   memset(strdata, 0, sizeof(*strdata));
223223
224224   /* reset globals */
r4425r4426
343343   char statetag[30];
344344
345345   /* allocate memory */
346   stream = auto_malloc(sizeof(*stream));
346   stream = (sound_stream *)auto_malloc(sizeof(*stream));
347347   memset(stream, 0, sizeof(*stream));
348348
349349   VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream));
r4425r4426
365365   /* allocate space for the inputs */
366366   if (inputs > 0)
367367   {
368      stream->input = auto_malloc(inputs * sizeof(*stream->input));
368      stream->input = (stream_input *)auto_malloc(inputs * sizeof(*stream->input));
369369      memset(stream->input, 0, inputs * sizeof(*stream->input));
370      stream->input_array = auto_malloc(inputs * sizeof(*stream->input_array));
370      stream->input_array = (stream_sample_t **)auto_malloc(inputs * sizeof(*stream->input_array));
371371      memset(stream->input_array, 0, inputs * sizeof(*stream->input_array));
372372   }
373373
r4425r4426
382382   /* allocate space for the outputs */
383383   if (outputs > 0)
384384   {
385      stream->output = auto_malloc(outputs * sizeof(*stream->output));
385      stream->output = (stream_output *)auto_malloc(outputs * sizeof(*stream->output));
386386      memset(stream->output, 0, outputs * sizeof(*stream->output));
387      stream->output_array = auto_malloc(outputs * sizeof(*stream->output_array));
387      stream->output_array = (stream_sample_t **)auto_malloc(outputs * sizeof(*stream->output_array));
388388      memset(stream->output_array, 0, outputs * sizeof(*stream->output_array));
389389   }
390390
r4425r4426
698698static STATE_POSTLOAD( stream_postload )
699699{
700700   streams_private *strdata = machine->streams_data;
701   sound_stream *stream = param;
701   sound_stream *stream = (sound_stream *)param;
702702   int outputnum;
703703
704704   /* recompute the same rate information */
r4425r4426
737737      for (inputnum = 0; inputnum < stream->inputs; inputnum++)
738738      {
739739         stream_input *input = &stream->input[inputnum];
740         input->resample = auto_realloc(input->resample, stream->resample_bufalloc * sizeof(input->resample[0]));
740         input->resample = (stream_sample_t *)auto_realloc(input->resample, stream->resample_bufalloc * sizeof(input->resample[0]));
741741      }
742742   }
743743}
r4425r4426
767767      for (outputnum = 0; outputnum < stream->outputs; outputnum++)
768768      {
769769         stream_output *output = &stream->output[outputnum];
770         output->buffer = auto_realloc(output->buffer, stream->output_bufalloc * sizeof(output->buffer[0]));
770         output->buffer = (stream_sample_t *)auto_realloc(output->buffer, stream->output_bufalloc * sizeof(output->buffer[0]));
771771         memset(&output->buffer[oldsize], 0, (stream->output_bufalloc - oldsize) * sizeof(output->buffer[0]));
772772      }
773773   }
src/emu/uigfx.c
r4425r4426
379379   /* clamp within range */
380380   if (state->palette.which < 0)
381381      state->palette.which = 1;
382   if (state->palette.which > (machine->colortable != NULL))
383      state->palette.which = (machine->colortable != NULL);
382   if (state->palette.which > (int)(machine->colortable != NULL))
383      state->palette.which = (int)(machine->colortable != NULL);
384384
385385   /* cache some info in locals */
386386   total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->config->total_colors;
src/emu/hash.c
r4425r4426
459459
460460int hash_data_has_info(const char* data, unsigned int info)
461461{
462   char* res = strstr(data, info_strings[info]);
462   char* res = (char*)strstr(data, info_strings[info]);
463463
464464   if (!res)
465465      return 0;
src/emu/devcb.c
r4425r4426
3131static READ_LINE_DEVICE_HANDLER( trampoline_read8_to_read_line )
3232{
3333   const devcb_resolved_read_line *resolved = (const devcb_resolved_read_line *)device;
34   return ((*resolved->real.readdevice)(resolved->realtarget, 0) & 1) ? ASSERT_LINE : CLEAR_LINE;
34   return ((*resolved->real.readdevice)((const device_config *)resolved->realtarget, 0) & 1) ? ASSERT_LINE : CLEAR_LINE;
3535}
3636
3737void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_read_line *config, const device_config *device)
r4425r4426
9595static WRITE_LINE_DEVICE_HANDLER( trampoline_write8_to_write_line )
9696{
9797   const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device;
98   (*resolved->real.writedevice)(resolved->realtarget, 0, state);
98   (*resolved->real.writedevice)((const device_config *)resolved->realtarget, 0, state);
9999}
100100
101101static WRITE_LINE_DEVICE_HANDLER( trampoline_writecpu_to_write_line )
102102{
103103   const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device;
104   const device_config *cpu = resolved->realtarget;
104   const device_config *cpu = (const device_config *)resolved->realtarget;
105105   cpu_set_input_line(cpu, resolved->real.writeline, state ? ASSERT_LINE : CLEAR_LINE);
106106}
107107
r4425r4426
176176static READ8_DEVICE_HANDLER( trampoline_read_line_to_read8 )
177177{
178178   const devcb_resolved_read8 *resolved = (const devcb_resolved_read8 *)device;
179   return (*resolved->real.readline)(resolved->realtarget);
179   return (*resolved->real.readline)((const device_config *)resolved->realtarget);
180180}
181181
182182void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *config, const device_config *device)
r4425r4426
238238static WRITE8_DEVICE_HANDLER( trampoline_write_line_to_write8 )
239239{
240240   const devcb_resolved_write8 *resolved = (const devcb_resolved_write8 *)device;
241   (*resolved->real.writeline)(resolved->realtarget, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
241   (*resolved->real.writeline)((const device_config *)resolved->realtarget, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
242242}
243243
244244void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *config, const device_config *device)
src/emu/eigccx86.h
r4425r4426
504504-------------------------------------------------*/
505505
506506#define compare_exchange32 _compare_exchange32
507INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
507INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
508508_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
509509{
510510   register INT32 result;
r4425r4426
531531
532532#ifdef __x86_64__
533533#define compare_exchange64 _compare_exchange64
534INLINE INT64 ATTR_NONNULL ATTR_FORCE_INLINE
534INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE
535535_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
536536{
537537   register INT64 result;
r4425r4426
557557-------------------------------------------------*/
558558
559559#define atomic_exchange32 _atomic_exchange32
560INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
560INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
561561_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
562562{
563563   register INT32 result;
r4425r4426
580580-------------------------------------------------*/
581581
582582#define atomic_add32 _atomic_add32
583INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
583INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
584584_atomic_add32(INT32 volatile *ptr, INT32 delta)
585585{
586586   register INT32 result = delta;
r4425r4426
604604-------------------------------------------------*/
605605
606606#define atomic_increment32 _atomic_increment32
607INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
607INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
608608_atomic_increment32(INT32 volatile *ptr)
609609{
610610   register INT32 result = 1;
r4425r4426
628628-------------------------------------------------*/
629629
630630#define atomic_decrement32 _atomic_decrement32
631INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
631INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
632632_atomic_decrement32(INT32 volatile *ptr)
633633{
634634   register INT32 result = -1;
src/emu/video/resnet.c
r4425r4426
260260
261261   /* parse input parameters */
262262
263   o  = malloc_or_die( sizeof(double) * (1<<MAX_RES_PER_NET) *  MAX_NETS);
264   os = malloc_or_die( sizeof(double) * (1<<MAX_RES_PER_NET) *  MAX_NETS);
263   o  = (double *)malloc_or_die( sizeof(double) * (1<<MAX_RES_PER_NET) *  MAX_NETS);
264   os = (double *)malloc_or_die( sizeof(double) * (1<<MAX_RES_PER_NET) *  MAX_NETS);
265265
266266   networks_no = 0;
267267   for (n = 0; n < MAX_NETS; n++)
r4425r4426
700700   int i,j,k;
701701   rgb_t *rgb;
702702
703   rgb = malloc_or_die((rdi->end - rdi->start + 1)*sizeof(rgb_t));
703   rgb = (rgb_t *)malloc_or_die((rdi->end - rdi->start + 1)*sizeof(rgb_t));
704704   for (i=rdi->start; i<=rdi->end; i++)
705705   {
706706      UINT8 t[3] = {0,0,0};
src/emu/video/tms34061.c
r4425r4426
8484   tms34061.vrammask = tms34061.intf.vramsize - 1;
8585
8686   /* allocate memory for VRAM */
87   tms34061.vram = auto_malloc(tms34061.intf.vramsize + 256 * 2);
87   tms34061.vram = (UINT8 *)auto_malloc(tms34061.intf.vramsize + 256 * 2);
8888   memset(tms34061.vram, 0, tms34061.intf.vramsize + 256 * 2);
8989   /* not really a save state, just there for debugging purposes */
9090   state_save_register_global_pointer(machine, tms34061.vram, tms34061.intf.vramsize);
9191
9292   /* allocate memory for latch RAM */
93   tms34061.latchram = auto_malloc(tms34061.intf.vramsize + 256 * 2);
93   tms34061.latchram = (UINT8 *)auto_malloc(tms34061.intf.vramsize + 256 * 2);
9494   memset(tms34061.latchram, 0, tms34061.intf.vramsize + 256 * 2);
9595
9696   /* add some buffer space for VRAM and latch RAM */
src/emu/video/v9938.c
r4425r4426
164164   PALETTE_INIT_CALL(v9938);
165165
166166   /* set up YJK table */
167      pal_indYJK = auto_malloc(0x20000 * sizeof(UINT16));
167      pal_indYJK = (UINT16 *)auto_malloc(0x20000 * sizeof(UINT16));
168168
169169   LOG(("Building YJK table for V9958 screens, may take a while ... \n"));
170170   i = 0;
r4425r4426
494494   vdp->size_old = -1;
495495
496496   /* allocate VRAM */
497   vdp->vram = auto_malloc (0x20000);
497   vdp->vram = (UINT8 *)auto_malloc (0x20000);
498498   memset (vdp->vram, 0, 0x20000);
499499   if (vdp->vram_size < 0x20000)
500500   {
r4425r4426
505505   /* do we have expanded memory? */
506506   if (vdp->vram_size > 0x20000)
507507   {
508      vdp->vram_exp = auto_malloc (0x10000);
508      vdp->vram_exp = (UINT8 *)auto_malloc (0x10000);
509509      memset (vdp->vram_exp, 0, 0x10000);
510510   }
511511   else
src/emu/video/vector.c
r4425r4426
184184   vector_index = 0;
185185
186186   /* allocate memory for tables */
187   vector_list = auto_malloc (MAX_POINTS * sizeof (vector_list[0]));
187   vector_list = (point *)auto_malloc (MAX_POINTS * sizeof (vector_list[0]));
188188}
189189
190190
src/emu/video/voodoo.c
r4425r4426
460460   int pen;
461461
462462   /* allocate frame buffer RAM and set pointers */
463   f->ram = memory;
463   f->ram = (UINT8 *)memory;
464464   f->mask = fbmem - 1;
465465   f->rgboffs[0] = f->rgboffs[1] = f->rgboffs[2] = 0;
466466   f->auxoffs = ~0;
r4425r4426
546546static void init_tmu(voodoo_state *v, tmu_state *t, voodoo_reg *reg, void *memory, int tmem)
547547{
548548   /* allocate texture RAM */
549   t->ram = memory;
549   t->ram = (UINT8 *)memory;
550550   t->mask = tmem - 1;
551551   t->reg = reg;
552552   t->regdirty = TRUE;
r4425r4426
597597
598598static STATE_POSTLOAD( voodoo_postload )
599599{
600   voodoo_state *v = param;
600   voodoo_state *v = (voodoo_state *)param;
601601   int index, subindex;
602602
603603   v->fbi.clut_dirty = TRUE;
r4425r4426
955955
956956static TIMER_CALLBACK( vblank_off_callback )
957957{
958   voodoo_state *v = ptr;
958   voodoo_state *v = (voodoo_state *)ptr;
959959
960960   if (LOG_VBLANK_SWAP) logerror("--- vblank end\n");
961961
r4425r4426
971971
972972static TIMER_CALLBACK( vblank_callback )
973973{
974   voodoo_state *v = ptr;
974   voodoo_state *v = (voodoo_state *)ptr;
975975
976976   if (LOG_VBLANK_SWAP) logerror("--- vblank start\n");
977977
r4425r4426
19861986
19871987static TIMER_CALLBACK( stall_cpu_callback )
19881988{
1989   check_stalled_cpu(ptr, timer_get_time(machine));
1989   check_stalled_cpu((voodoo_state *)ptr, timer_get_time(machine));
19901990}
19911991
19921992
r4425r4426
44414441
44424442static DEVICE_START( voodoo )
44434443{
4444   const voodoo_config *config = device->inline_config;
4444   const voodoo_config *config = (const voodoo_config *)device->inline_config;
44454445   voodoo_state *v = get_safe_token(device);
44464446   const raster_info *info;
44474447   void *fbmem, *tmumem[2];
r4425r4426
44714471
44724472   /* create a multiprocessor work queue */
44734473   v->poly = poly_alloc(device->machine, 64, sizeof(poly_extra_data), 0);
4474   v->thread_stats = auto_malloc(sizeof(v->thread_stats[0]) * WORK_MAX_THREADS);
4474   v->thread_stats = (stats_block *)auto_malloc(sizeof(v->thread_stats[0]) * WORK_MAX_THREADS);
44754475
44764476   /* create a table of precomputed 1/n and log2(n) values */
44774477   /* n ranges from 1.0000 to 2.0000 */
r4425r4426
46614661
46624662DEVICE_GET_INFO( voodoo )
46634663{
4664   const voodoo_config *config = (device != NULL) ? device->inline_config : NULL;
4664   const voodoo_config *config = (device != NULL) ? (const voodoo_config *)device->inline_config : NULL;
46654665   switch (state)
46664666   {
46674667      /* --- the following bits of info are returned as 64-bit signed integers --- */
r4425r4426
47654765   /* iterate over blocks of extents */
47664766   for (y = sy; y < ey; y += ARRAY_LENGTH(extents))
47674767   {
4768      poly_extra_data *extra = poly_get_extra_data(v->poly);
4768      poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(v->poly);
47694769      int count = MIN(ey - y, ARRAY_LENGTH(extents));
47704770
47714771      extra->state = v;
r4425r4426
51065106
51075107static INT32 triangle_create_work_item(voodoo_state *v, UINT16 *drawbuf, int texcount)
51085108{
5109   poly_extra_data *extra = poly_get_extra_data(v->poly);
5109   poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(v->poly);
51105110   raster_info *info = find_rasterizer(v, texcount);
51115111   poly_vertex vert[3];
51125112
r4425r4426
53355335
53365336static void raster_fastfill(void *destbase, INT32 y, const poly_extent *extent, const void *extradata, int threadid)
53375337{
5338   const poly_extra_data *extra = extradata;
5338   const poly_extra_data *extra = (const poly_extra_data *)extradata;
53395339   voodoo_state *v = extra->state;
53405340   stats_block *stats = &v->thread_stats[threadid];
53415341   INT32 startx = extent->startx;
src/emu/video/s2636.c
r4425r4426
122122   s2636_t *s2636;
123123
124124   /* allocate the object that holds the state */
125   s2636 = auto_malloc(sizeof(*s2636));
125   s2636 = (s2636_t *)auto_malloc(sizeof(*s2636));
126126
127127   s2636->work_ram = work_ram;
128128   s2636->y_offset = y_offset;
src/emu/video/poly.c
r4425r4426
333333   poly_manager *poly;
334334
335335   /* allocate the manager itself */
336   poly = malloc_or_die(sizeof(*poly));
336   poly = (poly_manager *)malloc_or_die(sizeof(*poly));
337337   memset(poly, 0, sizeof(*poly));
338338   poly->flags = flags;
339339
r4425r4426
13141314   *itemsize = ((*itemsize + CACHE_LINE_SIZE - 1) / CACHE_LINE_SIZE) * CACHE_LINE_SIZE;
13151315
13161316   /* allocate the array */
1317   ptrarray = malloc_or_die(sizeof(*ptrarray) * itemcount);
1317   ptrarray = (void **)malloc_or_die(sizeof(*ptrarray) * itemcount);
13181318   memset(ptrarray, 0, sizeof(*ptrarray) * itemcount);
13191319
13201320   /* allocate the actual items */
r4425r4426
13521352{
13531353   while (1)
13541354   {
1355      work_unit *unit = param;
1355      work_unit *unit = (work_unit *)param;
13561356      polygon_info *polygon = unit->shared.polygon;
13571357      int count = unit->shared.count_next & 0xffff;
13581358      UINT32 orig_count_next;
r4425r4426
14221422
14231423static STATE_PRESAVE( poly_state_presave )
14241424{
1425   poly_manager *poly = param;
1425   poly_manager *poly = (poly_manager *)param;
14261426   poly_wait(poly, "pre-save");
14271427}
src/emu/video/mc6845.c
r4425r4426
148148
149149static STATE_POSTLOAD( mc6845_state_save_postload )
150150{
151   recompute_parameters(param, TRUE);
151   recompute_parameters((mc6845_t *)param, TRUE);
152152}
153153
154154
155155static TIMER_CALLBACK( on_update_address_cb )
156156{
157   const device_config *device = ptr;
157   const device_config *device = (const device_config *)ptr;
158158   mc6845_t *mc6845 = get_safe_token(device);
159159   int addr = (param >> 8);
160160   int strobe = (param & 0xff);
r4425r4426
463463
464464static TIMER_CALLBACK( de_changed_timer_cb )
465465{
466   const device_config *device = ptr;
466   const device_config *device = (const device_config *)ptr;
467467   mc6845_t *mc6845 = get_safe_token(device);
468468
469469   /* call the callback function -- we know it exists */
r4425r4426
475475
476476static TIMER_CALLBACK( vsync_on_timer_cb )
477477{
478   const device_config *device = ptr;
478   const device_config *device = (const device_config *)ptr;
479479   mc6845_t *mc6845 = get_safe_token(device);
480480
481481   /* call the callback function -- we know it exists */
r4425r4426
485485
486486static TIMER_CALLBACK( vsync_off_timer_cb )
487487{
488   const device_config *device = ptr;
488   const device_config *device = (const device_config *)ptr;
489489   mc6845_t *mc6845 = get_safe_token(device);
490490
491491   /* call the callback function -- we know it exists */
r4425r4426
497497
498498static TIMER_CALLBACK( hsync_on_timer_cb )
499499{
500   const device_config *device = ptr;
500   const device_config *device = (const device_config *)ptr;
501501   mc6845_t *mc6845 = get_safe_token(device);
502502
503503   /* call the callback function -- we know it exists */
r4425r4426
507507
508508static TIMER_CALLBACK( hsync_off_timer_cb )
509509{
510   const device_config *device = ptr;
510   const device_config *device = (const device_config *)ptr;
511511   mc6845_t *mc6845 = get_safe_token(device);
512512
513513   /* call the callback function -- we know it exists */
r4425r4426
572572
573573static TIMER_CALLBACK( light_pen_latch_timer_cb )
574574{
575   const device_config *device = ptr;
575   const device_config *device = (const device_config *)ptr;
576576   mc6845_t *mc6845 = get_safe_token(device);
577577
578578   mc6845->light_pen_addr = mc6845_get_ma(device);
r4425r4426
746746   assert(device != NULL);
747747   assert(device->tag != NULL);
748748
749   mc6845->intf = device->static_config;
749   mc6845->intf = (const mc6845_interface *)device->static_config;
750750   mc6845->device_type = device_type;
751751
752752   if (mc6845->intf != NULL)
src/emu/info.c
r4425r4426
601601   /* iterate over screens */
602602   for (screen = video_screen_first(config); screen != NULL; screen = video_screen_next(screen))
603603   {
604      const screen_config *scrconfig = screen->inline_config;
604      const screen_config *scrconfig = (const screen_config *)screen->inline_config;
605605
606606      fprintf(out, "\t\t<display");
607607
src/emu/tilemap.c
r4425r4426
324324   int group;
325325
326326   /* allocate the tilemap itself */
327   tmap = malloc_or_die(sizeof(*tmap));
327   tmap = (tilemap *)malloc_or_die(sizeof(*tmap));
328328   memset(tmap, 0, sizeof(*tmap));
329329
330330   /* fill in the basic metrics */
r4425r4426
354354   /* initialize scroll information */
355355   tmap->scrollrows = 1;
356356   tmap->scrollcols = 1;
357   tmap->rowscroll = malloc_or_die(tmap->height * sizeof(*tmap->rowscroll));
357   tmap->rowscroll = (INT32 *)malloc_or_die(tmap->height * sizeof(*tmap->rowscroll));
358358   memset(tmap->rowscroll, 0, tmap->height * sizeof(*tmap->rowscroll));
359   tmap->colscroll = malloc_or_die(tmap->width * sizeof(*tmap->colscroll));
359   tmap->colscroll = (INT32 *)malloc_or_die(tmap->width * sizeof(*tmap->colscroll));
360360   memset(tmap->colscroll, 0, tmap->width * sizeof(*tmap->colscroll));
361361
362362   /* allocate the pixel data cache */
363363   tmap->pixmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED16);
364364
365365   /* allocate transparency mapping data */
366   tmap->tileflags = malloc_or_die(tmap->max_logical_index);
366   tmap->tileflags = (UINT8 *)malloc_or_die(tmap->max_logical_index);
367367   tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED8);
368   tmap->pen_to_flags = malloc_or_die(sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
368   tmap->pen_to_flags = (UINT8 *)malloc_or_die(sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
369369   memset(tmap->pen_to_flags, 0, sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
370370   for (group = 0; group < TILEMAP_NUM_GROUPS; group++)
371371      tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
r4425r4426
10951095static STATE_POSTLOAD( tilemap_postload )
10961096{
10971097   /* recompute the mappings for this tilemap */
1098   tilemap *tmap = param;
1098   tilemap *tmap = (tilemap *)param;
10991099   mappings_update(tmap);
11001100}
11011101
r4425r4426
11571157   tmap->max_memory_index++;
11581158
11591159   /* allocate the necessary mappings */
1160   tmap->memory_to_logical = malloc_or_die(tmap->max_memory_index * sizeof(*tmap->memory_to_logical));
1161   tmap->logical_to_memory = malloc_or_die(tmap->max_logical_index * sizeof(*tmap->logical_to_memory));
1160   tmap->memory_to_logical = (tilemap_logical_index *)malloc_or_die(tmap->max_memory_index * sizeof(*tmap->memory_to_logical));
1161   tmap->logical_to_memory = (tilemap_memory_index *)malloc_or_die(tmap->max_logical_index * sizeof(*tmap->logical_to_memory));
11621162
11631163   /* update the mappings */
11641164   mappings_update(tmap);
r4425r4426
19691969
19701970static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
19711971{
1972   UINT16 *dest = _dest;
1972   UINT16 *dest = (UINT16 *)_dest;
19731973   int pal = pcode >> 16;
19741974   int i;
19751975
r4425r4426
20122012
20132013static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
20142014{
2015   UINT16 *dest = _dest;
2015   UINT16 *dest = (UINT16 *)_dest;
20162016   int pal = pcode >> 16;
20172017   int i;
20182018
r4425r4426
20462046static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
20472047{
20482048   const pen_t *clut = &pens[pcode >> 16];
2049   UINT16 *dest = _dest;
2049   UINT16 *dest = (UINT16 *)_dest;
20502050   int i;
20512051
20522052   /* priority case */
r4425r4426
20762076static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
20772077{
20782078   const pen_t *clut = &pens[pcode >> 16];
2079   UINT16 *dest = _dest;
2079   UINT16 *dest = (UINT16 *)_dest;
20802080   int i;
20812081
20822082   /* priority case */
r4425r4426
21082108static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
21092109{
21102110   const pen_t *clut = &pens[pcode >> 16];
2111   UINT16 *dest = _dest;
2111   UINT16 *dest = (UINT16 *)_dest;
21122112   int i;
21132113
21142114   /* priority case */
r4425r4426
21392139static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
21402140{
21412141   const pen_t *clut = &pens[pcode >> 16];
2142   UINT16 *dest = _dest;
2142   UINT16 *dest = (UINT16 *)_dest;
21432143   int i;
21442144
21452145   /* priority case */
r4425r4426
21712171static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
21722172{
21732173   const pen_t *clut = &pens[pcode >> 16];
2174   UINT32 *dest = _dest;
2174   UINT32 *dest = (UINT32 *)_dest;
21752175   int i;
21762176
21772177   /* priority case */
r4425r4426
22012201static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
22022202{
22032203   const pen_t *clut = &pens[pcode >> 16];
2204   UINT32 *dest = _dest;
2204   UINT32 *dest = (UINT32 *)_dest;
22052205   int i;
22062206
22072207   /* priority case */
r4425r4426
22332233static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
22342234{
22352235   const pen_t *clut = &pens[pcode >> 16];
2236   UINT32 *dest = _dest;
2236   UINT32 *dest = (UINT32 *)_dest;
22372237   int i;
22382238
22392239   /* priority case */
r4425r4426
22642264static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
22652265{
22662266   const pen_t *clut = &pens[pcode >> 16];
2267   UINT32 *dest = _dest;
2267   UINT32 *dest = (UINT32 *)_dest;
22682268   int i;
22692269
22702270   /* priority case */
src/emu/uiinput.c
r4425r4426
7676void ui_input_init(running_machine *machine)
7777{
7878   /* create the private data */
79   machine->ui_input_data = auto_malloc(sizeof(*machine->ui_input_data));
79   machine->ui_input_data = (ui_input_private *)auto_malloc(sizeof(*machine->ui_input_data));
8080   memset(machine->ui_input_data, 0, sizeof(*machine->ui_input_data));
8181   machine->ui_input_data->current_mouse_x = -1;
8282   machine->ui_input_data->current_mouse_y = -1;
src/emu/uimenu.c
r4425r4426
140140{
141141   input_item_data *   next;            /* pointer to next item in the list */
142142   const void *      ref;            /* reference to type description for global inputs or field for game inputs */
143   int               seqtype;         /* sequence type */
143   input_seq_type      seqtype;         /* sequence type */
144144   input_seq         seq;            /* copy of the live sequence */
145145   const input_seq *   defseq;            /* pointer to the default sequence */
146146   const char *      name;            /* pointer to the base name of the item */
r4425r4426
304304    to the default sequence for the given field
305305-------------------------------------------------*/
306306
307INLINE const input_seq *get_field_default_seq(const input_field_config *field, int seqtype)
307INLINE const input_seq *get_field_default_seq(const input_field_config *field, input_seq_type seqtype)
308308{
309309   if (input_seq_get_1(&field->seq[seqtype]) == SEQCODE_DEFAULT)
310310      return input_type_seq(field->port->machine, field->type, field->player, seqtype);
r4425r4426
425425   ui_menu *menu;
426426
427427   /* allocate and clear memory for the menu and the state */
428   menu = malloc_or_die(sizeof(*menu));
428   menu = (ui_menu *)malloc_or_die(sizeof(*menu));
429429   memset(menu, 0, sizeof(*menu));
430430
431431   /* initialize the state */
r4425r4426
537537   if (menu->numitems >= menu->allocitems)
538538   {
539539      menu->allocitems += UI_MENU_ALLOC_ITEMS;
540      menu->item = realloc(menu->item, menu->allocitems * sizeof(*item));
540      menu->item = (ui_menu_item *)realloc(menu->item, menu->allocitems * sizeof(*item));
541541   }
542542   index = menu->numitems++;
543543
r4425r4426
658658      }
659659
660660   /* allocate a new pool */
661   pool = malloc_or_die(sizeof(*pool) + UI_MENU_POOL_SIZE);
661   pool = (ui_menu_pool *)malloc_or_die(sizeof(*pool) + UI_MENU_POOL_SIZE);
662662   memset(pool, 0, sizeof(*pool));
663663
664664   /* wire it up */
r4425r4426
677677
678678const char *ui_menu_pool_strdup(ui_menu *menu, const char *string)
679679{
680   return strcpy(ui_menu_pool_alloc(menu, strlen(string) + 1), string);
680   return strcpy((char *)ui_menu_pool_alloc(menu, strlen(string) + 1), string);
681681}
682682
683683
r4425r4426
14251425   /* process the menu */
14261426   event = ui_menu_process(machine, menu, 0);
14271427   if (event != NULL && event->iptkey == IPT_UI_SELECT)
1428      ui_menu_stack_push(ui_menu_alloc(machine, event->itemref, NULL));
1428      ui_menu_stack_push(ui_menu_alloc(machine, (ui_menu_handler_func)event->itemref, NULL));
14291429}
14301430
14311431
r4425r4426
14571457      }
14581458
14591459   /* add input menu items */
1460   ui_menu_item_append(menu, "Input (general)", NULL, 0, menu_input_groups);
1461   ui_menu_item_append(menu, "Input (this " CAPSTARTGAMENOUN ")", NULL, 0, menu_input_specific);
1460   ui_menu_item_append(menu, "Input (general)", NULL, 0, (void *)menu_input_groups);
1461   ui_menu_item_append(menu, "Input (this " CAPSTARTGAMENOUN ")", NULL, 0, (void *)menu_input_specific);
14621462
14631463   /* add optional input-related menus */
14641464   if (has_dips)
1465      ui_menu_item_append(menu, "Dip Switches", NULL, 0, menu_settings_dip_switches);
1465      ui_menu_item_append(menu, "Dip Switches", NULL, 0, (void *)menu_settings_dip_switches);
14661466   if (has_configs)
1467      ui_menu_item_append(menu, "Driver Configuration", NULL, 0, menu_settings_driver_config);
1467      ui_menu_item_append(menu, "Driver Configuration", NULL, 0, (void *)menu_settings_driver_config);
14681468   if (has_categories)
1469      ui_menu_item_append(menu, "Categories", NULL, 0, menu_settings_categories);
1469      ui_menu_item_append(menu, "Categories", NULL, 0, (void *)menu_settings_categories);
14701470   if (has_analog)
1471      ui_menu_item_append(menu, "Analog Controls", NULL, 0, menu_analog);
1471      ui_menu_item_append(menu, "Analog Controls", NULL, 0, (void *)menu_analog);
14721472
14731473#ifndef MESS
14741474     /* add bookkeeping menu */
1475   ui_menu_item_append(menu, "Bookkeeping Info", NULL, 0, menu_bookkeeping);
1475   ui_menu_item_append(menu, "Bookkeeping Info", NULL, 0, (void *)menu_bookkeeping);
14761476#endif
14771477
14781478   /* add game info menu */
1479   ui_menu_item_append(menu, CAPSTARTGAMENOUN " Information", NULL, 0, menu_game_info);
1479   ui_menu_item_append(menu, CAPSTARTGAMENOUN " Information", NULL, 0, (void *)menu_game_info);
14801480
14811481#ifdef MESS
14821482   /* add MESS-specific menus */
r4425r4426
14841484#endif /* MESS */
14851485
14861486   /* add sliders menu */
1487   ui_menu_item_append(menu, "Slider Controls", NULL, 0, menu_sliders);
1487   ui_menu_item_append(menu, "Slider Controls", NULL, 0, (void *)menu_sliders);
14881488
14891489   /* add video options menu */
1490   ui_menu_item_append(menu, "Video Options", NULL, 0, (render_target_get_indexed(1) != NULL) ? menu_video_targets : menu_video_options);
1490   ui_menu_item_append(menu, "Video Options", NULL, 0, (render_target_get_indexed(1) != NULL) ? (void *)menu_video_targets : (void *)menu_video_options);
14911491
14921492   /* add cheat menu */
14931493   if (options_get_bool(mame_options(), OPTION_CHEAT) && cheat_get_next_menu_entry(machine, NULL, NULL, NULL, NULL) != NULL)
1494      ui_menu_item_append(menu, "Cheat", NULL, 0, menu_cheat);
1494      ui_menu_item_append(menu, "Cheat", NULL, 0, (void *)menu_cheat);
14951495
14961496   /* add memory card menu */
14971497   if (machine->config->memcard_handler != NULL)
1498      ui_menu_item_append(menu, "Memory Card", NULL, 0, menu_memory_card);
1498      ui_menu_item_append(menu, "Memory Card", NULL, 0, (void *)menu_memory_card);
14991499
15001500   /* add reset and exit menus */
1501   ui_menu_item_append(menu, "Select New " CAPSTARTGAMENOUN, NULL, 0, menu_select_game);
1501   ui_menu_item_append(menu, "Select New " CAPSTARTGAMENOUN, NULL, 0, (void *)menu_select_game);
15021502}
15031503
15041504
r4425r4426
15861586         for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
15871587         {
15881588            /* build an entry for the standard sequence */
1589            input_item_data *item = ui_menu_pool_alloc(menu, sizeof(*item));
1589            input_item_data *item = (input_item_data *)ui_menu_pool_alloc(menu, sizeof(*item));
15901590            memset(item, 0, sizeof(*item));
15911591            item->ref = typedesc;
15921592            item->seqtype = seqtype;
r4425r4426
16651665            for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
16661666            {
16671667               /* build an entry for the standard sequence */
1668               input_item_data *item = ui_menu_pool_alloc(menu, sizeof(*item));
1668               input_item_data *item = (input_item_data *)ui_menu_pool_alloc(menu, sizeof(*item));
16691669               memset(item, 0, sizeof(*item));
16701670               item->ref = field;
16711671               item->seqtype = seqtype;
r4425r4426
17041704   /* if no state, allocate now */
17051705   if (state == NULL)
17061706      state = ui_menu_alloc_state(menu, sizeof(*menustate), NULL);
1707   menustate = state;
1707   menustate = (input_menu_state *)state;
17081708
17091709   /* if the menu isn't built, populate now */
17101710   if (!ui_menu_populated(menu))
r4425r4426
17461746   /* otherwise, handle the events */
17471747   else if (event != NULL && event->itemref != NULL)
17481748   {
1749      input_item_data *item = event->itemref;
1749      input_item_data *item = (input_item_data *)event->itemref;
17501750      switch (event->iptkey)
17511751      {
17521752         /* an item was selected: begin polling */
r4425r4426
17781778      /* update a general input */
17791779      if (parameter != NULL)
17801780      {
1781         const input_type_desc *typedesc = seqchangeditem->ref;
1781         const input_type_desc *typedesc = (const input_type_desc *)seqchangeditem->ref;
17821782         input_type_set_seq(machine, typedesc->type, typedesc->player, seqchangeditem->seqtype, &seqchangeditem->seq);
17831783      }
17841784
r4425r4426
17871787      {
17881788         input_field_user_settings settings;
17891789
1790         input_field_get_user_settings(seqchangeditem->ref, &settings);
1790         input_field_get_user_settings((const input_field_config *)seqchangeditem->ref, &settings);
17911791         settings.seq[seqchangeditem->seqtype] = seqchangeditem->seq;
1792         input_field_set_user_settings(seqchangeditem->ref, &settings);
1792         input_field_set_user_settings((const input_field_config *)seqchangeditem->ref, &settings);
17931793      }
17941794
17951795      /* invalidate the menu to force an update */
r4425r4426
18141814
18151815static int menu_input_compare_items(const void *i1, const void *i2)
18161816{
1817   const input_item_data * const *data1 = i1;
1818   const input_item_data * const *data2 = i2;
1817   const input_item_data * const *data1 = (const input_item_data * const *)i1;
1818   const input_item_data * const *data2 = (const input_item_data * const *)i2;
18191819   if ((*data1)->sortorder < (*data2)->sortorder)
18201820      return -1;
18211821   if ((*data1)->sortorder > (*data2)->sortorder)
r4425r4426
18491849      numitems++;
18501850
18511851   /* now allocate an array of items and fill it up */
1852   itemarray = ui_menu_pool_alloc(menu, sizeof(*itemarray) * numitems);
1852   itemarray = (input_item_data **)ui_menu_pool_alloc(menu, sizeof(*itemarray) * numitems);
18531853   for (item = itemlist, curitem = 0; item != NULL; item = item->next)
18541854      itemarray[curitem++] = item;
18551855
r4425r4426
19361936   /* if no state, allocate now */
19371937   if (state == NULL)
19381938      state = ui_menu_alloc_state(menu, sizeof(*menustate), NULL);
1939   menustate = state;
1939   menustate = (settings_menu_state *)state;
19401940
19411941   /* if the menu isn't built, populate now */
19421942   if (!ui_menu_populated(menu))
r4425r4426
19481948   /* handle events */
19491949   if (event != NULL && event->itemref != NULL)
19501950   {
1951      const input_field_config *field = event->itemref;
1951      const input_field_config *field = (const input_field_config *)event->itemref;
19521952      input_field_user_settings settings;
19531953      int changed = FALSE;
19541954
r4425r4426
20382038                  /* allocate new if none */
20392039                  if (dip == NULL)
20402040                  {
2041                     dip = ui_menu_pool_alloc(menu, sizeof(*dip));
2041                     dip = (dip_descriptor *)ui_menu_pool_alloc(menu, sizeof(*dip));
20422042                     dip->next = NULL;
20432043                     dip->name = diploc->swname;
20442044                     dip->mask = dip->state = 0;
r4425r4426
20712071
20722072static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
20732073{
2074   const input_field_config *field = selectedref;
2075   settings_menu_state *menustate = state;
2074   const input_field_config *field = (const input_field_config *)selectedref;
2075   settings_menu_state *menustate = (settings_menu_state *)state;
20762076   dip_descriptor *dip;
20772077
20782078   /* add borders */
r4425r4426
21892189   /* handle events */
21902190   if (event != NULL && event->itemref != NULL)
21912191   {
2192      analog_item_data *data = event->itemref;
2192      analog_item_data *data = (analog_item_data *)event->itemref;
21932193      int newval = data->cur;
21942194
21952195      switch (event->iptkey)
r4425r4426
22912291                  UINT32 flags = 0;
22922292
22932293                  /* allocate a data item for tracking what this menu item refers to */
2294                  data = ui_menu_pool_alloc(menu, sizeof(*data));
2294                  data = (analog_item_data *)ui_menu_pool_alloc(menu, sizeof(*data));
22952295                  data->field = field;
22962296                  data->type = type;
22972297
r4425r4426
23632363   /* if no state, allocate some */
23642364   if (state == NULL)
23652365      state = ui_menu_alloc_state(menu, sizeof(*prevtime), NULL);
2366   prevtime = state;
2366   prevtime = (attotime *)state;
23672367
23682368   /* if the time has rolled over another second, regenerate */
23692369   curtime = timer_get_time(machine);
r4425r4426
25512551   /* if no state, allocate some */
25522552   if (state == NULL)
25532553      state = ui_menu_alloc_state(menu, sizeof(*cardnum), NULL);
2554   cardnum = state;
2554   cardnum = (int *)state;
25552555
25562556   /* if the menu isn't built, populate now */
25572557   if (!ui_menu_populated(menu))
r4425r4426
26532653{
26542654   int menuless_mode = (parameter != NULL);
26552655   const ui_menu_event *event;
2656   UINT8 *hidden = state;
2656   UINT8 *hidden = (UINT8 *)state;
26572657
26582658   /* if no state, allocate some */
26592659   if (hidden == NULL)
2660      hidden = ui_menu_alloc_state(menu, sizeof(*hidden), NULL);
2660      hidden = (UINT8 *)ui_menu_alloc_state(menu, sizeof(*hidden), NULL);
26612661   if (menuless_mode)
26622662      *hidden = TRUE;
26632663
r4425r4426
26722672      /* handle keys if there is a valid item selected */
26732673      if (event->itemref != NULL)
26742674      {
2675         const slider_state *slider = event->itemref;
2675         const slider_state *slider = (const slider_state *)event->itemref;
26762676         INT32 curvalue = (*slider->update)(machine, slider->arg, NULL, SLIDER_NOCHANGE);
26772677         INT32 increment = 0;
26782678
r4425r4426
27912791
27922792static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
27932793{
2794   const slider_state *curslider = selectedref;
2794   const slider_state *curslider = (const slider_state *)selectedref;
27952795   if (curslider != NULL)
27962796   {
27972797      float bar_left, bar_area_top, bar_width, bar_area_height, bar_top, bar_bottom, default_x, current_x;
r4425r4426
29112911
29122912static void menu_video_options(running_machine *machine, ui_menu *menu, void *parameter, void *state)
29132913{
2914   render_target *target = (parameter != NULL) ? parameter : render_target_get_indexed(0);
2914   render_target *target = (parameter != NULL) ? (render_target *)parameter : render_target_get_indexed(0);
29152915   const ui_menu_event *event;
29162916   int changed = FALSE;
29172917
r4425r4426
30593059   {
30603060      state = ui_menu_alloc_state(menu, sizeof(*menustate) + sizeof(menustate->driverlist) * driver_list_get_count(drivers), NULL);
30613061      if (parameter != NULL)
3062         strcpy(((select_game_state *)state)->search, parameter);
3062         strcpy(((select_game_state *)state)->search, (const char *)parameter);
30633063   }
3064   menustate = state;
3064   menustate = (select_game_state *)state;
30653065
30663066   /* if the menu isn't built, populate now */
30673067   if (!ui_menu_populated(menu))
r4425r4426
32433243   qsort((void *)menustate->driverlist, driver_count, sizeof(menustate->driverlist[0]), menu_select_game_driver_compare);
32443244
32453245   /* allocate a temporary array to track which ones we found */
3246   found = ui_menu_pool_alloc(menu, (driver_count + 7) / 8);
3246   found = (UINT8 *)ui_menu_pool_alloc(menu, (driver_count + 7) / 8);
32473247   memset(found, 0, (driver_count + 7) / 8);
32483248
32493249   /* open a path to the ROMs and find them in the array */
r4425r4426
32703270         /* find it in the array */
32713271         tempdriver.name = drivername;
32723272         tempdriver_ptr = &tempdriver;
3273         found_driver = bsearch(&tempdriver_ptr, menustate->driverlist, driver_count, sizeof(*menustate->driverlist), menu_select_game_driver_compare);
3273         found_driver = (const game_driver **)bsearch(&tempdriver_ptr, menustate->driverlist, driver_count, sizeof(*menustate->driverlist), menu_select_game_driver_compare);
32743274
32753275         /* if found, mark the corresponding entry in the array */
32763276         if (found_driver != NULL)
r4425r4426
32993299
33003300static void menu_select_game_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
33013301{
3302   select_game_state *menustate = state;
3302   select_game_state *menustate = (select_game_state *)state;
33033303   const game_driver *driver;
33043304   float width, maxwidth;
33053305   float x1, y1, x2, y2;
r4425r4426
33393339                 DRAW_NORMAL, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
33403340
33413341   /* determine the text to render below */
3342   driver = ((FPTR)selectedref > 1) ? selectedref : NULL;
3342   driver = ((FPTR)selectedref > 1) ? (const game_driver *)selectedref : NULL;
33433343   if ((FPTR)driver > 1)
33443344   {
33453345      const char *gfxstat, *soundstat;
src/emu/audit.c
r4425r4426
8282   if (records > 0)
8383   {
8484      /* allocate memory for the records */
85      *audit = malloc_or_die(sizeof(**audit) * records);
85      *audit = (audit_record *)malloc_or_die(sizeof(**audit) * records);
8686      memset(*audit, 0, sizeof(**audit) * records);
8787      record = *audit;
8888
r4425r4426
163163      goto skip;
164164
165165   /* allocate memory for the records */
166   *audit = malloc_or_die(sizeof(**audit) * records);
166   *audit = (audit_record *)malloc_or_die(sizeof(**audit) * records);
167167   memset(*audit, 0, sizeof(**audit) * records);
168168   record = *audit;
169169
src/emu/video.c
r4425r4426
6161   bitmap_t *            bitmap[2];            /* 2x bitmaps for rendering */
6262   UINT8               curbitmap;            /* current bitmap index */
6363   UINT8               curtexture;            /* current texture index */
64   bitmap_format         texture_format;         /* texture format of bitmap for this screen */
64   INT32               texture_format;         /* texture format of bitmap for this screen */
6565   UINT8               changed;            /* has this bitmap changed? */
6666   INT32               last_partial_scan;      /* scanline of last partial update */
6767
r4425r4426
131131   INT32               snap_height;         /* height of snapshots (0 == auto) */
132132
133133   /* movie recording */
134   mame_file *            mng_file;            /* handle to the open movie file */
135   avi_file *            avi_file;            /* handle to the open movie file */
134   mame_file *            mngfile;            /* handle to the open movie file */
135   avi_file *            avifile;            /* handle to the open movie file */
136136   attotime            movie_frame_period;      /* period of a single movie frame */
137137   attotime            movie_next_frame_time;   /* time of next frame */
138138   UINT32                movie_frame;         /* current movie frame number */
r4425r4426
434434   assert_always(spriteram_size != 0, "Video buffers spriteram but spriteram_size is 0");
435435
436436   /* allocate memory for the back buffer */
437   buffered_spriteram = auto_malloc(spriteram_size);
437   buffered_spriteram = (UINT8 *)auto_malloc(spriteram_size);
438438
439439   /* register for saving it */
440440   state_save_register_global_pointer(machine, buffered_spriteram, spriteram_size);
r4425r4426
443443   if (spriteram_2_size)
444444   {
445445      /* allocate memory */
446      buffered_spriteram_2 = auto_malloc(spriteram_2_size);
446      buffered_spriteram_2 = (UINT8 *)auto_malloc(spriteram_2_size);
447447
448448      /* register for saving it */
449449      state_save_register_global_pointer(machine, buffered_spriteram_2, spriteram_2_size);
r4425r4426
651651void video_screen_configure(const device_config *screen, int width, int height, const rectangle *visarea, attoseconds_t frame_period)
652652{
653653   screen_state *state = get_safe_token(screen);
654   screen_config *config = screen->inline_config;
654   screen_config *config = (screen_config *)screen->inline_config;
655655
656656   /* validate arguments */
657657   assert(width > 0);
r4425r4426
706706static void realloc_screen_bitmaps(const device_config *screen)
707707{
708708   screen_state *state = get_safe_token(screen);
709   screen_config *config = screen->inline_config;
709   screen_config *config = (screen_config *)screen->inline_config;
710710   if (config->type != SCREEN_TYPE_VECTOR)
711711   {
712712      int curwidth = 0, curheight = 0;
r4425r4426
12021202   assert(container != NULL);
12031203
12041204   /* get and validate the configuration */
1205   config = screen->inline_config;
1205   config = (screen_config *)screen->inline_config;
12061206   assert(config->width > 0);
12071207   assert(config->height > 0);
12081208   assert(config->refresh > 0);
r4425r4426
12741274
12751275static STATE_POSTLOAD( video_screen_postload )
12761276{
1277   const device_config *screen = param;
1277   const device_config *screen = (const device_config *)param;
12781278   realloc_screen_bitmaps(screen);
12791279   global.movie_next_frame_time = timer_get_time(machine);
12801280}
r4425r4426
13581358static TIMER_CALLBACK( vblank_begin_callback )
13591359{
13601360   int i;
1361   device_config *screen = ptr;
1361   device_config *screen = (device_config *)ptr;
13621362   screen_state *state = get_safe_token(screen);
13631363
13641364   /* reset the starting VBLANK time */
r4425r4426
13921392static TIMER_CALLBACK( vblank_end_callback )
13931393{
13941394   int i;
1395   const device_config *screen = ptr;
1395   const device_config *screen = (const device_config *)ptr;
13961396   screen_state *state = get_safe_token(screen);
13971397
13981398   /* call the screen specific callbacks */
r4425r4426
14271427
14281428static TIMER_CALLBACK( scanline0_callback )
14291429{
1430   const device_config *screen = ptr;
1430   const device_config *screen = (const device_config *)ptr;
14311431   screen_state *state = get_safe_token(screen);
14321432
14331433   /* reset partial updates */
r4425r4426
14451445
14461446static TIMER_CALLBACK( scanline_update_callback )
14471447{
1448   const device_config *screen = ptr;
1448   const device_config *screen = (const device_config *)ptr;
14491449   screen_state *state = get_safe_token(screen);
14501450   int scanline = param;
14511451
r4425r4426
15571557      /* only update if live */
15581558      if (render_is_live_screen(screen))
15591559      {
1560         const screen_config *config = screen->inline_config;
1560         const screen_config *config = (const screen_config *)screen->inline_config;
15611561
15621562         /* only update if empty and not a vector game; otherwise assume the driver did it directly */
15631563         if (config->type != SCREEN_TYPE_VECTOR && (machine->config->video_attributes & VIDEO_SELF_RENDER) == 0)
r4425r4426
23762376
23772377int video_mng_is_movie_active(running_machine *machine)
23782378{
2379   return (global.mng_file != NULL);
2379   return (global.mngfile != NULL);
23802380}
23812381
23822382
r4425r4426
23932393   int rate;
23942394
23952395   /* close any existing movie file */
2396   if (global.mng_file != NULL)
2396   if (global.mngfile != NULL)
23972397      video_mng_end_recording(machine);
23982398
23992399   /* look up the primary screen */
r4425r4426
24052405
24062406   /* create a new movie file and start recording */
24072407   if (name != NULL)
2408      filerr = mame_fopen(SEARCHPATH_MOVIE, name, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &global.mng_file);
2408      filerr = mame_fopen(SEARCHPATH_MOVIE, name, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &global.mngfile);
24092409   else
2410      filerr = mame_fopen_next(machine, SEARCHPATH_MOVIE, "mng", &global.mng_file);
2410      filerr = mame_fopen_next(machine, SEARCHPATH_MOVIE, "mng", &global.mngfile);
24112411
24122412   /* start the capture */
24132413   rate = (state != NULL) ? ATTOSECONDS_TO_HZ(state->frame_period) : DEFAULT_FRAME_RATE;
2414   pngerr = mng_capture_start(mame_core_file(global.mng_file), global.snap_bitmap, rate);
2414   pngerr = mng_capture_start(mame_core_file(global.mngfile), global.snap_bitmap, rate);
24152415   if (pngerr != PNGERR_NONE)
24162416   {
24172417      video_mng_end_recording(machine);
r4425r4426
24332433void video_mng_end_recording(running_machine *machine)
24342434{
24352435   /* close the file if it exists */
2436   if (global.mng_file != NULL)
2436   if (global.mngfile != NULL)
24372437   {
2438      mng_capture_stop(mame_core_file(global.mng_file));
2439      mame_fclose(global.mng_file);
2440      global.mng_file = NULL;
2438      mng_capture_stop(mame_core_file(global.mngfile));
2439      mame_fclose(global.mngfile);
2440      global.mngfile = NULL;
24412441      global.movie_frame = 0;
24422442   }
24432443}
r4425r4426
24512451static void video_mng_record_frame(running_machine *machine)
24522452{
24532453   /* only record if we have a file */
2454   if (global.mng_file != NULL)
2454   if (global.mngfile != NULL)
24552455   {
24562456      attotime curtime = timer_get_time(machine);
24572457      png_info pnginfo = { 0 };
r4425r4426
24802480
24812481         /* write the next frame */
24822482         palette = (machine->palette != NULL) ? palette_entry_list_adjusted(machine->palette) : NULL;
2483         error = mng_capture_frame(mame_core_file(global.mng_file), &pnginfo, global.snap_bitmap, machine->config->total_colors, palette);
2483         error = mng_capture_frame(mame_core_file(global.mngfile), &pnginfo, global.snap_bitmap, machine->config->total_colors, palette);
24842484         png_free(&pnginfo);
24852485         if (error != PNGERR_NONE)
24862486         {
r4425r4426
25172517   avi_error avierr;
25182518
25192519   /* close any existing movie file */
2520   if (global.avi_file != NULL)
2520   if (global.avifile != NULL)
25212521      video_avi_end_recording(machine);
25222522
25232523   /* look up the primary screen */
r4425r4426
25622562      mame_fclose(tempfile);
25632563
25642564      /* create the file and free the string */
2565      avierr = avi_create(astring_c(fullname), &info, &global.avi_file);
2565      avierr = avi_create(astring_c(fullname), &info, &global.avifile);
25662566      astring_free(fullname);
25672567   }
25682568}
r4425r4426
25762576void video_avi_end_recording(running_machine *machine)
25772577{
25782578   /* close the file if it exists */
2579   if (global.avi_file != NULL)
2579   if (global.avifile != NULL)
25802580   {
2581      avi_close(global.avi_file);
2582      global.avi_file = NULL;
2581      avi_close(global.avifile);
2582      global.avifile = NULL;
25832583      global.movie_frame = 0;
25842584   }
25852585}
r4425r4426
25932593static void video_avi_record_frame(running_machine *machine)
25942594{
25952595   /* only record if we have a file */
2596   if (global.avi_file != NULL)
2596   if (global.avifile != NULL)
25972597   {
25982598      attotime curtime = timer_get_time(machine);
25992599      avi_error avierr;
r4425r4426
26072607      while (attotime_compare(global.movie_next_frame_time, curtime) <= 0)
26082608      {
26092609         /* write the next frame */
2610         avierr = avi_append_video_frame_rgb32(global.avi_file, global.snap_bitmap);
2610         avierr = avi_append_video_frame_rgb32(global.avifile, global.snap_bitmap);
26112611         if (avierr != AVIERR_NONE)
26122612         {
26132613            video_avi_end_recording(machine);
r4425r4426
26322632void video_avi_add_sound(running_machine *machine, const INT16 *sound, int numsamples)
26332633{
26342634   /* only record if we have a file */
2635   if (global.avi_file != NULL)
2635   if (global.avifile != NULL)
26362636   {
26372637      avi_error avierr;
26382638
26392639      profiler_mark(PROFILER_MOVIE_REC);
26402640
26412641      /* write the next frame */
2642      avierr = avi_append_sound_samples(global.avi_file, 0, sound + 0, numsamples, 1);
2642      avierr = avi_append_sound_samples(global.avifile, 0, sound + 0, numsamples, 1);
26432643      if (avierr == AVIERR_NONE)
2644         avierr = avi_append_sound_samples(global.avi_file, 1, sound + 1, numsamples, 1);
2644         avierr = avi_append_sound_samples(global.avifile, 1, sound + 1, numsamples, 1);
26452645      if (avierr != AVIERR_NONE)
26462646         video_avi_end_recording(machine);
26472647
src/emu/memory.c
r4425r4426
441441         return;
442442
443443   /* allocate a new entry and fill it */
444   (*refptr) = malloc_or_die(sizeof(**refptr));
444   (*refptr) = (bank_reference *)malloc_or_die(sizeof(**refptr));
445445   (*refptr)->next = NULL;
446446   (*refptr)->space = space;
447447}
r4425r4426
471471   if (entry < STATIC_RAM)
472472      result = (*handler->bankbaseptr)[byteoffset];
473473   else
474      result = (*handler->handler.read.shandler8)(handler->object, byteoffset);
474      result = (*handler->handler.read.shandler8)((const address_space *)handler->object, byteoffset);
475475
476476   profiler_mark(PROFILER_END);
477477   return result;
r4425r4426
501501   if (entry < STATIC_RAM)
502502      (*handler->bankbaseptr)[byteoffset] = data;
503503   else
504      (*handler->handler.write.shandler8)(handler->object, byteoffset, data);
504      (*handler->handler.write.shandler8)((const address_space *)handler->object, byteoffset, data);
505505
506506   profiler_mark(PROFILER_END);
507507}
r4425r4426
531531   if (entry < STATIC_RAM)
532532      result = *(UINT16 *)&(*handler->bankbaseptr)[byteoffset & ~1];
533533   else
534      result = (*handler->handler.read.shandler16)(handler->object, byteoffset >> 1, mem_mask);
534      result = (*handler->handler.read.shandler16)((const address_space *)handler->object, byteoffset >> 1, mem_mask);
535535
536536   profiler_mark(PROFILER_END);
537537   return result;
r4425r4426
564564      *dest = (*dest & ~mem_mask) | (data & mem_mask);
565565   }
566566   else
567      (*handler->handler.write.shandler16)(handler->object, byteoffset >> 1, data, mem_mask);
567      (*handler->handler.write.shandler16)((const address_space *)handler->object, byteoffset >> 1, data, mem_mask);
568568
569569   profiler_mark(PROFILER_END);
570570}
r4425r4426
594594   if (entry < STATIC_RAM)
595595      result = *(UINT32 *)&(*handler->bankbaseptr)[byteoffset & ~3];
596596   else
597      result = (*handler->handler.read.shandler32)(handler->object, byteoffset >> 2, mem_mask);
597      result = (*handler->handler.read.shandler32)((const address_space *)handler->object, byteoffset >> 2, mem_mask);
598598
599599   profiler_mark(PROFILER_END);
600600   return result;
r4425r4426
627627      *dest = (*dest & ~mem_mask) | (data & mem_mask);
628628   }
629629   else
630      (*handler->handler.write.shandler32)(handler->object, byteoffset >> 2, data, mem_mask);
630      (*handler->handler.write.shandler32)((const address_space *)handler->object, byteoffset >> 2, data, mem_mask);
631631
632632   profiler_mark(PROFILER_END);
633633}
r4425r4426
657657   if (entry < STATIC_RAM)
658658      result = *(UINT64 *)&(*handler->bankbaseptr)[byteoffset & ~7];
659659   else
660      result = (*handler->handler.read.shandler64)(handler->object, byteoffset >> 3, mem_mask);
660      result = (*handler->handler.read.shandler64)((const address_space *)handler->object, byteoffset >> 3, mem_mask);
661661
662662   profiler_mark(PROFILER_END);
663663   return result;
r4425r4426
690690      *dest = (*dest & ~mem_mask) | (data & mem_mask);
691691   }
692692   else
693      (*handler->handler.write.shandler64)(handler->object, offset >> 3, data, mem_mask);
693      (*handler->handler.write.shandler64)((const address_space *)handler->object, offset >> 3, data, mem_mask);
694694
695695   profiler_mark(PROFILER_END);
696696}
r4425r4426
712712   add_exit_callback(machine, memory_exit);
713713
714714   /* allocate our private data */
715   memdata = machine->memory_data = auto_malloc(sizeof(*machine->memory_data));
715   memdata = machine->memory_data = (memory_private *)auto_malloc(sizeof(*machine->memory_data));
716716   memset(memdata, 0, sizeof(*memdata));
717717
718718   /* build up the cpudata array with info about all CPUs and address spaces */
r4425r4426
765765
766766address_map *address_map_alloc(const device_config *device, const game_driver *driver, int spacenum)
767767{
768   const cpu_config *cpuconfig = device->inline_config;
768   const cpu_config *cpuconfig = (const cpu_config *)device->inline_config;
769769   const addrmap_token *internal_map;
770770   address_map *map;
771771
772   map = malloc_or_die(sizeof(*map));
772   map = (address_map *)malloc_or_die(sizeof(*map));
773773   memset(map, 0, sizeof(*map));
774774
775775   /* append the internal CPU map (first so it takes priority) */
r4425r4426
10271027
10281028   /* if we have no bankptr yet, set it to the first entry */
10291029   if (memdata->bank_ptr[banknum] == NULL)
1030      memdata->bank_ptr[banknum] = bank->entry[0];
1030      memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[0];
10311031}
10321032
10331033
r4425r4426
10581058
10591059   /* if we have no bankptr yet, set it to the first entry */
10601060   if (memdata->bankd_ptr[banknum] == NULL)
1061      memdata->bankd_ptr[banknum] = bank->entryd[0];
1061      memdata->bankd_ptr[banknum] = (UINT8 *)bank->entryd[0];
10621062}
10631063
10641064
r4425r4426
10851085
10861086   /* set the base */
10871087   bank->curentry = entrynum;
1088   memdata->bank_ptr[banknum] = bank->entry[entrynum];
1089   memdata->bankd_ptr[banknum] = bank->entryd[entrynum];
1088   memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[entrynum];
1089   memdata->bankd_ptr[banknum] = (UINT8 *)bank->entryd[entrynum];
10901090
10911091   /* invalidate all the direct references to any referenced address spaces */
10921092   for (ref = bank->reflist; ref != NULL; ref = ref->next)
r4425r4426
11341134      validate_auto_malloc_memory(base, bank->byteend - bank->bytestart + 1);
11351135
11361136   /* set the base */
1137   memdata->bank_ptr[banknum] = base;
1137   memdata->bank_ptr[banknum] = (UINT8 *)base;
11381138
11391139   /* invalidate all the direct references to any referenced address spaces */
11401140   for (ref = bank->reflist; ref != NULL; ref = ref->next)
r4425r4426
11811181   if (whandler != NULL)
11821182      space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
11831183   mem_dump(space->machine);
1184   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1184   return (UINT8 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
11851185}
11861186
11871187
r4425r4426
11981198   if (whandler != NULL)
11991199      space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
12001200   mem_dump(space->machine);
1201   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1201   return (UINT16 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
12021202}
12031203
12041204
r4425r4426
12151215   if (whandler != NULL)
12161216      space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
12171217   mem_dump(space->machine);
1218   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1218   return (UINT32 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
12191219}
12201220
12211221
r4425r4426
12321232   if (whandler != NULL)
12331233      space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
12341234   mem_dump(space->machine);
1235   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1235   return (UINT64 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
12361236}
12371237
12381238
r4425r4426
12701270   if (whandler != NULL)
12711271      space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
12721272   mem_dump(space->machine);
1273   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1273   return (UINT8 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
12741274}
12751275
12761276
r4425r4426
12871287   if (whandler != NULL)
12881288      space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
12891289   mem_dump(space->machine);
1290   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1290   return (UINT16 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
12911291}
12921292
12931293
r4425r4426
13041304   if (whandler != NULL)
13051305      space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
13061306   mem_dump(space->machine);
1307   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1307   return (UINT32 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
13081308}
13091309
13101310
r4425r4426
13211321   if (whandler != NULL)
13221322      space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
13231323   mem_dump(space->machine);
1324   return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
1324   return (UINT64 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
13251325}
13261326
13271327
r4425r4426
14941494   int spacenum;
14951495
14961496   /* create a global watchpoint-filled table */
1497   memdata->wptable = auto_malloc(1 << LEVEL1_BITS);
1497   memdata->wptable = (UINT8 *)auto_malloc(1 << LEVEL1_BITS);
14981498   memset(memdata->wptable, STATIC_WATCHPOINT, 1 << LEVEL1_BITS);
14991499
15001500   /* loop over CPUs */
r4425r4426
15021502      for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
15031503         if (cpu_get_addrbus_width(device, spacenum) > 0)
15041504         {
1505            address_space *space = malloc_or_die(sizeof(*space));
1505            address_space *space = (address_space *)malloc_or_die(sizeof(*space));
15061506            int logbits = cpu_get_logaddr_width(device, spacenum);
15071507            int ashift = cpu_get_addrbus_shift(device, spacenum);
15081508            int abits = cpu_get_addrbus_width(device, spacenum);
r4425r4426
15361536            space->log_unmap = TRUE;
15371537
15381538            /* allocate subtable information; we malloc this manually because it will be realloc'ed */
1539            space->read.subtable = auto_malloc(sizeof(*space->read.subtable) * SUBTABLE_COUNT);
1539            space->read.subtable = (subtable_data *)auto_malloc(sizeof(*space->read.subtable) * SUBTABLE_COUNT);
15401540            memset(space->read.subtable, 0, sizeof(*space->read.subtable) * SUBTABLE_COUNT);
1541            space->write.subtable = auto_malloc(sizeof(*space->write.subtable) * SUBTABLE_COUNT);
1541            space->write.subtable = (subtable_data *)auto_malloc(sizeof(*space->write.subtable) * SUBTABLE_COUNT);
15421542            memset(space->write.subtable, 0, sizeof(*space->write.subtable) * SUBTABLE_COUNT);
15431543
15441544            /* allocate the handler table */
1545            space->read.handlers[0] = auto_malloc(sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers));
1545            space->read.handlers[0] = (handler_data *)auto_malloc(sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers));
15461546            memset(space->read.handlers[0], 0, sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers));
1547            space->write.handlers[0] = auto_malloc(sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers));
1547            space->write.handlers[0] = (handler_data *)auto_malloc(sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers));
15481548            memset(space->write.handlers[0], 0, sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers));
15491549            for (entrynum = 1; entrynum < ARRAY_LENGTH(space->read.handlers); entrynum++)
15501550            {
r4425r4426
15681568            space->write.handlers[STATIC_WATCHPOINT]->bytemask = ~0;
15691569
15701570            /* allocate memory; these aren't auto-malloc'ed as we need to expand them */
1571            space->read.table = malloc_or_die(1 << LEVEL1_BITS);
1572            space->write.table = malloc_or_die(1 << LEVEL1_BITS);
1571            space->read.table = (UINT8 *)malloc_or_die(1 << LEVEL1_BITS);
1572            space->write.table = (UINT8 *)malloc_or_die(1 << LEVEL1_BITS);
15731573
15741574            /* initialize everything to unmapped */
15751575            memset(space->read.table, STATIC_UNMAP, 1 << LEVEL1_BITS);
r4425r4426
18361836         block = block_allocate(space, curbytestart, curbyteend, NULL);
18371837
18381838         /* assign memory that intersected the new block */
1839         unassigned = block_assign_intersecting(space, curbytestart, curbyteend, block);
1839         unassigned = block_assign_intersecting(space, curbytestart, curbyteend, (UINT8 *)block);
18401840      }
18411841   }
18421842}
r4425r4426
18881888            for (entry = ref->space->map->entrylist; entry != NULL; entry = entry->next)
18891889               if (entry->bytestart == bank->bytestart)
18901890               {
1891                  memdata->bank_ptr[banknum] = entry->memory;
1891                  memdata->bank_ptr[banknum] = (UINT8 *)entry->memory;
18921892                  foundit = TRUE;
18931893                   VPRINTF(("assigned bank %d pointer to memory from range %08X-%08X [%p]\n", banknum, entry->addrstart, entry->addrend, entry->memory));
18941894                  break;
r4425r4426
18961896
18971897         /* if the entry was set ahead of time, override the automatically found pointer */
18981898         if (!bank->dynamic && bank->curentry != MAX_BANK_ENTRIES)
1899            memdata->bank_ptr[banknum] = bank->entry[bank->curentry];
1899            memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[bank->curentry];
19001900      }
19011901   }
19021902
r4425r4426
20592059
20602060         /* start a new range */
20612061         case ADDRMAP_TOKEN_RANGE:
2062            entry = *entryptr = malloc_or_die(sizeof(**entryptr));
2062            entry = *entryptr = (address_map_entry *)malloc_or_die(sizeof(**entryptr));
20632063            entryptr = &entry->next;
20642064            memset(entry, 0, sizeof(*entry));
20652065            TOKEN_GET_UINT64_UNPACK2(tokens, entry->addrstart, 32, entry->addrend, 32);
r4425r4426
22002200      /* assign a bank to the adjusted addresses */
22012201      handler = (genf *)bank_assign_dynamic(space, readorwrite, bytestart, byteend);
22022202      if (memdata->bank_ptr[HANDLER_TO_BANK(handler)] == NULL)
2203         memdata->bank_ptr[HANDLER_TO_BANK(handler)] = space_find_backing_memory(space, bytestart);
2203         memdata->bank_ptr[HANDLER_TO_BANK(handler)] = (UINT8 *)space_find_backing_memory(space, bytestart);
22042204   }
22052205
22062206   /* then do a normal installation */
r4425r4426
24332433      {
24342434         /* if this entry has a changed entry, set the appropriate pointer */
24352435         if (bank->curentry != MAX_BANK_ENTRIES)
2436            memdata->bank_ptr[banknum] = bank->entry[bank->curentry];
2436            memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[bank->curentry];
24372437      }
24382438   }
24392439}
r4425r4426
28162816            if (subindex >= tabledata->subtable_alloc)
28172817            {
28182818               tabledata->subtable_alloc += SUBTABLE_ALLOC;
2819               tabledata->table = realloc(tabledata->table, (1 << LEVEL1_BITS) + (tabledata->subtable_alloc << LEVEL2_BITS));
2819               tabledata->table = (UINT8 *)realloc(tabledata->table, (1 << LEVEL1_BITS) + (tabledata->subtable_alloc << LEVEL2_BITS));
28202820               if (!tabledata->table)
28212821                  fatalerror("error: ran out of memory allocating memory subtable");
28222822            }
r4425r4426
30303030   if (range != NULL)
30313031      space->direct.freerangelist = range->next;
30323032   else
3033      range = malloc_or_die(sizeof(*range));
3033      range = (direct_range *)malloc_or_die(sizeof(*range));
30343034
30353035   /* fill in the range */
30363036   table_derive_range(&space->read, byteaddress, &range->bytestart, &range->byteend);
r4425r4426
31023102      bytestoalloc += byteend - bytestart + 1;
31033103
31043104   /* allocate and clear the memory */
3105   block = malloc_or_die(bytestoalloc);
3105   block = (memory_block *)malloc_or_die(bytestoalloc);
31063106   memset(block, 0, bytestoalloc);
31073107   if (allocatemem)
31083108      memory = block + 1;
r4425r4426
31343134   block->isallocated = allocatemem;
31353135   block->bytestart = bytestart;
31363136   block->byteend = byteend;
3137   block->data = memory;
3137   block->data = (UINT8 *)memory;
31383138
31393139   /* attach us to the head of the list */
31403140   block->next = memdata->memory_block_list;
r4425r4426
35343534   {
35353535      int shift = *subshift++;
35363536      if ((UINT8)(mem_mask >> shift) != 0)
3537         result |= (*handler->subhandler.read.shandler8)(handler->subobject, offset) << shift;
3537         result |= (*handler->subhandler.read.shandler8)((const address_space *)handler->subobject, offset) << shift;
35383538      offset++;
35393539   }
35403540   return result;
r4425r4426
35583558   {
35593559      int shift = *subshift++;
35603560      if ((UINT8)(mem_mask >> shift) != 0)
3561         result |= (*handler->subhandler.read.shandler8)(handler->subobject, offset) << shift;
3561         result |= (*handler->subhandler.read.shandler8)((const address_space *)handler->subobject, offset) << shift;
35623562      offset++;
35633563   }
35643564   return result;
r4425r4426
35823582   {
35833583      int shift = *subshift++;
35843584      if ((UINT8)(mem_mask >> shift) != 0)
3585         result |= (UINT64)(*handler->subhandler.read.shandler8)(handler->subobject, offset) << shift;
3585         result |= (UINT64)(*handler->subhandler.read.shandler8)((const address_space *)handler->subobject, offset) << shift;
35863586      offset++;
35873587   }
35883588   return result;
r4425r4426
36063606   {
36073607      int shift = *subshift++;
36083608      if ((UINT16)(mem_mask >> shift) != 0)
3609         result |= (*handler->subhandler.read.shandler16)(handler->subobject, offset, mem_mask >> shift) << shift;
3609         result |= (*handler->subhandler.read.shandler16)((const address_space *)handler->subobject, offset, mem_mask >> shift) << shift;
36103610      offset++;
36113611   }
36123612   return result;
r4425r4426
36303630   {
36313631      int shift = *subshift++;
36323632      if ((UINT16)(mem_mask >> shift) != 0)
3633         result |= (UINT64)(*handler->subhandler.read.shandler16)(handler->subobject, offset, mem_mask >> shift) << shift;
3633         result |= (UINT64)(*handler->subhandler.read.shandler16)((const address_space *)handler->subobject, offset, mem_mask >> shift) << shift;
36343634      offset++;
36353635   }
36363636   return result;
r4425r4426
36543654   {
36553655      int shift = *subshift++;
36563656      if ((UINT32)(mem_mask >> shift) != 0)
3657         result |= (UINT64)(*handler->subhandler.read.shandler32)(handler->subobject, offset, mem_mask >> shift) << shift;
3657         result |= (UINT64)(*handler->subhandler.read.shandler32)((const address_space *)handler->subobject, offset, mem_mask >> shift) << shift;
36583658      offset++;
36593659   }
36603660   return result;
r4425r4426
36823682   {
36833683      int shift = *subshift++;
36843684      if ((UINT8)(mem_mask >> shift) != 0)
3685         (*handler->subhandler.write.shandler8)(handler->subobject, offset, data >> shift);
3685         (*handler->subhandler.write.shandler8)((const address_space *)handler->subobject, offset, data >> shift);
36863686      offset++;
36873687   }
36883688}
r4425r4426
37043704   {
37053705      int shift = *subshift++;
37063706      if ((UINT8)(mem_mask >> shift) != 0)
3707         (*handler->subhandler.write.shandler8)(handler->subobject, offset, data >> shift);
3707         (*handler->subhandler.write.shandler8)((const address_space *)handler->subobject, offset, data >> shift);
37083708      offset++;
37093709   }
37103710}
r4425r4426
37263726   {
37273727      int shift = *subshift++;
37283728      if ((UINT8)(mem_mask >> shift) != 0)
3729         (*handler->subhandler.write.shandler8)(handler->subobject, offset, data >> shift);
3729         (*handler->subhandler.write.shandler8)((const address_space *)handler->subobject, offset, data >> shift);
37303730      offset++;
37313731   }
37323732}
r4425r4426
37483748   {
37493749      int shift = *subshift++;
37503750      if ((UINT16)(mem_mask >> shift) != 0)
3751         (*handler->subhandler.write.shandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift);
3751         (*handler->subhandler.write.shandler16)((const address_space *)handler->subobject, offset, data >> shift, mem_mask >> shift);
37523752      offset++;
37533753   }
37543754}
r4425r4426
37703770   {
37713771      int shift = *subshift++;
37723772      if ((UINT16)(mem_mask >> shift) != 0)
3773         (*handler->subhandler.write.shandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift);
3773         (*handler->subhandler.write.shandler16)((const address_space *)handler->subobject, offset, data >> shift, mem_mask >> shift);
37743774      offset++;
37753775   }
37763776}
r4425r4426
37923792   {
37933793      int shift = *subshift++;
37943794      if ((UINT32)(mem_mask >> shift) != 0)
3795         (*handler->subhandler.write.shandler32)(handler->subobject, offset, data >> shift, mem_mask >> shift);
3795         (*handler->subhandler.write.shandler32)((const address_space *)handler->subobject, offset, data >> shift, mem_mask >> shift);
37963796      offset++;
37973797   }
37983798}
src/emu/memory.h
r4425r4426
853853/* ----- direct access control ----- */
854854
855855/* registers an address range as having a decrypted data pointer */
856void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base) ATTR_NONNULL;
856void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base) ATTR_NONNULL(1, 4);
857857
858858/* register a handler for opcode base changes on a given CPU */
859direct_update_func memory_set_direct_update_handler(const address_space *space, direct_update_func function) ATTR_NONNULL;
859direct_update_func memory_set_direct_update_handler(const address_space *space, direct_update_func function) ATTR_NONNULL(1);
860860
861861/* called by CPU cores to update the opcode base for the given address */
862int memory_set_direct_region(const address_space *space, offs_t *byteaddress) ATTR_NONNULL;
862int memory_set_direct_region(const address_space *space, offs_t *byteaddress) ATTR_NONNULL(1, 2);
863863
864864/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a bank */
865void *memory_get_read_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL;
865void *memory_get_read_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL(1);
866866
867867/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a writeable bank */
868void *memory_get_write_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL;
868void *memory_get_write_ptr(const address_space *space, offs_t byteaddress) ATTR_NONNULL(1);
869869
870870
871871
872872/* ----- memory banking ----- */
873873
874874/* configure the addresses for a bank */
875void memory_configure_bank(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL;
875void memory_configure_bank(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
876876
877877/* configure the decrypted addresses for a bank */
878void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL;
878void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
879879
880880/* select one pre-configured entry to be the new bank base */
881void memory_set_bank(running_machine *machine, int banknum, int entrynum) ATTR_NONNULL;
881void memory_set_bank(running_machine *machine, int banknum, int entrynum) ATTR_NONNULL(1);
882882
883883/* return the currently selected bank */
884int memory_get_bank(running_machine *machine, int banknum) ATTR_NONNULL;
884int memory_get_bank(running_machine *machine, int banknum) ATTR_NONNULL(1);
885885
886886/* set the absolute address of a bank base */
887void memory_set_bankptr(running_machine *machine, int banknum, void *base) ATTR_NONNULL;
887void memory_set_bankptr(running_machine *machine, int banknum, void *base) ATTR_NONNULL(1, 3);
888888
889889
890890
891891/* ----- dynamic address space mapping ----- */
892892
893893/* install a new memory handler into the given address space, returning a pointer to the memory backing it, if present */
894void *_memory_install_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
894void *_memory_install_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
895895
896896/* same as above but explicitly for 8-bit handlers */
897UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
897UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
898898
899899/* same as above but explicitly for 16-bit handlers */
900UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
900UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
901901
902902/* same as above but explicitly for 32-bit handlers */
903UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
903UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
904904
905905/* same as above but explicitly for 64-bit handlers */
906UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
906UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1);
907907
908908/* install a new device memory handler into the given address space, returning a pointer to the memory backing it, if present */
909void *_memory_install_device_handler(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
909void *_memory_install_device_handler(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
910910
911911/* same as above but explicitly for 8-bit handlers */
912UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
912UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
913913
914914/* same as above but explicitly for 16-bit handlers */
915UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
915UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
916916
917917/* same as above but explicitly for 32-bit handlers */
918UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
918UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
919919
920920/* same as above but explicitly for 64-bit handlers */
921UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL;
921UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name) ATTR_NONNULL(1, 2);
922922
923923/* install a new input port handler into the given address space */
924void memory_install_read_port_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *tag) ATTR_NONNULL;
924void memory_install_read_port_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *tag) ATTR_NONNULL(1, 6);
925925
926926
927927
src/emu/restrack.c
r4425r4426
2020    TYPE DEFINITIONS
2121***************************************************************************/
2222
23typedef enum _memory_block_overlap memory_block_overlap;
2423enum _memory_block_overlap
2524{
2625   OVERLAP_NONE,
2726   OVERLAP_PARTIAL,
2827   OVERLAP_FULL
2928};
29typedef enum _memory_block_overlap memory_block_overlap;
3030
3131
3232
r4425r4426
260260
261261astring *auto_astring_alloc_file_line(const char *file, int line)
262262{
263   return restrack_register_object(OBJTYPE_ASTRING, astring_alloc(), 0, file, line);
263   return (astring *)restrack_register_object(OBJTYPE_ASTRING, astring_alloc(), 0, file, line);
264264}
265265
266266
r4425r4426
271271
272272bitmap_t *auto_bitmap_alloc_file_line(int width, int height, bitmap_format format, const char *file, int line)
273273{
274   return restrack_register_object(OBJTYPE_BITMAP, bitmap_alloc(width, height, format), width * height, file, line);
274   return (bitmap_t *)restrack_register_object(OBJTYPE_BITMAP, bitmap_alloc(width, height, format), width * height, file, line);
275275}
276276
277277
r4425r4426
317317
318318static void astring_destructor(void *object, size_t size)
319319{
320   astring_free(object);
320   astring_free((astring *)object);
321321}
322322
323323
r4425r4426
328328
329329static void bitmap_destructor(void *object, size_t size)
330330{
331   bitmap_free(object);
331   bitmap_free((bitmap_t *)object);
332332}
333333
334334
r4425r4426
341341{
342342   memory_block_overlap overlap = OVERLAP_NONE;
343343   object_pool_iterator *iter;
344   UINT8 *ptrstart = ptr;
344   UINT8 *ptrstart = (UINT8 *)ptr;
345345   UINT8 *ptrend = ptrstart + size - 1;
346346   void *blockptr = NULL;
347347   size_t blocksize = 0;
src/emu/mame.c
r4425r4426
458458   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_frame_callback at init time!");
459459
460460   /* allocate memory */
461   cb = malloc_or_die(sizeof(*cb));
461   cb = (callback_item *)malloc_or_die(sizeof(*cb));
462462
463463   /* add us to the end of the list */
464464   cb->func.frame = callback;
r4425r4426
481481   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_reset_callback at init time!");
482482
483483   /* allocate memory */
484   cb = malloc_or_die(sizeof(*cb));
484   cb = (callback_item *)malloc_or_die(sizeof(*cb));
485485
486486   /* add us to the end of the list */
487487   cb->func.reset = callback;
r4425r4426
504504   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_pause_callback at init time!");
505505
506506   /* allocate memory */
507   cb = malloc_or_die(sizeof(*cb));
507   cb = (callback_item *)malloc_or_die(sizeof(*cb));
508508
509509   /* add us to the end of the list */
510510   cb->func.pause = callback;
r4425r4426
527527   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_exit_callback at init time!");
528528
529529   /* allocate memory */
530   cb = malloc_or_die(sizeof(*cb));
530   cb = (callback_item *)malloc_or_die(sizeof(*cb));
531531
532532   /* add us to the head of the list */
533533   cb->func.exit = callback;
r4425r4426
782782          fatalerror("memory_region_alloc called with duplicate region name \"%s\"\n", name);
783783
784784   /* allocate the region */
785   info = malloc_or_die(sizeof(*info) + length);
785   info = (region_info *)malloc_or_die(sizeof(*info) + length);
786786   info->next = NULL;
787787   info->name = astring_dupc(name);
788788   info->length = length;
r4425r4426
12471247
12481248   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_logerror_callback at init time!");
12491249
1250   cb = auto_malloc(sizeof(*cb));
1250   cb = (callback_item *)auto_malloc(sizeof(*cb));
12511251   cb->func.log = callback;
12521252   cb->next = NULL;
12531253
r4425r4426
13181318      config = machine_config_alloc(driver->machine_config);
13191319      for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
13201320      {
1321         const screen_config *scrconfig = device->inline_config;
1321         const screen_config *scrconfig = (const screen_config *)device->inline_config;
13221322         if (scrconfig->type == SCREEN_TYPE_VECTOR)
13231323         {
13241324            parse_ini_file(options, "vector");
r4425r4426
13871387   int cpunum;
13881388
13891389   /* allocate memory for the machine */
1390   machine = malloc(sizeof(*machine));
1390   machine = (running_machine *)malloc(sizeof(*machine));
13911391   if (machine == NULL)
13921392      goto error;
13931393   memset(machine, 0, sizeof(*machine));
13941394
13951395   /* allocate memory for the internal mame_data */
1396   machine->mame_data = malloc(sizeof(*machine->mame_data));
1396   machine->mame_data = (mame_private *)malloc(sizeof(*machine->mame_data));
13971397   if (machine->mame_data == NULL)
13981398      goto error;
13991399   memset(machine->mame_data, 0, sizeof(*machine->mame_data));
src/emu/inptport.c
r4425r4426
624624   time_t basetime;
625625
626626   /* allocate memory for our data structure */
627   machine->input_port_data = auto_malloc(sizeof(*machine->input_port_data));
627   machine->input_port_data = (input_port_private *)auto_malloc(sizeof(*machine->input_port_data));
628628   memset(machine->input_port_data, 0, sizeof(*machine->input_port_data));
629629   portdata = machine->input_port_data;
630630
r4425r4426
857857   /* copy the basics */
858858   for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
859859   {
860      const input_seq *defseq = input_type_seq(field->port->machine, field->type, field->player, seqtype);
860      const input_seq *defseq = input_type_seq(field->port->machine, field->type, field->player, (input_seq_type)seqtype);
861861      if (input_seq_cmp(defseq, &settings->seq[seqtype]) == 0)
862862         field->state->seq[seqtype] = default_seq;
863863      else
r4425r4426
15001500   for (typenum = 0; typenum < ARRAY_LENGTH(core_types); typenum++)
15011501   {
15021502      /* allocate memory for the state and link it to the end of the list */
1503      *stateptr = auto_malloc(sizeof(**stateptr));
1503      *stateptr = (input_type_state *)auto_malloc(sizeof(**stateptr));
15041504      memset(*stateptr, 0, sizeof(**stateptr));
15051505
15061506      /* copy the type description and link the previous description to it */
r4425r4426
15501550      input_port_state *portstate;
15511551
15521552      /* allocate a new input_port_info structure */
1553      portstate = auto_malloc(sizeof(*portstate));
1553      portstate = (input_port_state *)auto_malloc(sizeof(*portstate));
15541554      memset(portstate, 0, sizeof(*portstate));
15551555      ((input_port_config *)port)->state = portstate;
15561556      ((input_port_config *)port)->machine = machine;
r4425r4426
15671567         int seqtype;
15681568
15691569         /* allocate a new input_field_info structure */
1570         fieldstate = auto_malloc(sizeof(*fieldstate));
1570         fieldstate = (input_field_state *)auto_malloc(sizeof(*fieldstate));
15711571         memset(fieldstate, 0, sizeof(*fieldstate));
15721572         ((input_field_config *)field)->state = fieldstate;
15731573
r4425r4426
17141714   input_port_value mask;
17151715
17161716   /* allocate memory */
1717   info = auto_malloc(sizeof(*info));
1717   info = (callback_field_info *)auto_malloc(sizeof(*info));
17181718   memset(info, 0, sizeof(*info));
17191719
17201720   /* fill in the data */
r4425r4426
17371737   input_port_value mask;
17381738
17391739   /* allocate memory */
1740   state = auto_malloc(sizeof(*state));
1740   state = (analog_field_state *)auto_malloc(sizeof(*state));
17411741   memset(state, 0, sizeof(*state));
17421742
17431743   /* compute the shift amount and number of bits */
r4425r4426
24032403            TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
24042404
24052405            if (curport == NULL)
2406               return error_buf_append(errorbuf, errorbuflen, "INPUT_TOKEN_FIELD encountered with no active port (mask=%X defval=%X)\n", mask, defval);
2406               return (input_port_config *)error_buf_append(errorbuf, errorbuflen, "INPUT_TOKEN_FIELD encountered with no active port (mask=%X defval=%X)\n", mask, defval);
24072407
24082408            if (curfield != NULL)
24092409               field_config_insert(curfield, &maskbits, errorbuf, errorbuflen);
r4425r4426
29532953   input_port_config *config;
29542954
29552955   /* allocate memory */
2956   config = malloc_or_die(sizeof(*config));
2956   config = (input_port_config *)malloc_or_die(sizeof(*config));
29572957   memset(config, 0, sizeof(*config));
29582958
29592959   /* add it to the tail */
r4425r4426
30153015   int seqtype;
30163016
30173017   /* allocate memory */
3018   config = malloc_or_die(sizeof(*config));
3018   config = (input_field_config *)malloc_or_die(sizeof(*config));
30193019   memset(config, 0, sizeof(*config));
30203020
30213021   /* fill in the basic field values */
r4425r4426
31233123   input_setting_config *config;
31243124
31253125   /* allocate memory */
3126   config = malloc_or_die(sizeof(*config));
3126   config = (input_setting_config *)malloc_or_die(sizeof(*config));
31273127   memset(config, 0, sizeof(*config));
31283128
31293129   /* fill in the basic setting values */
r4425r4426
31833183      const char *comma, *colon, *number;
31843184
31853185      /* allocate a new entry */
3186      *tailptr = malloc_or_die(sizeof(**tailptr));
3186      *tailptr = (input_field_diplocation *)malloc_or_die(sizeof(**tailptr));
31873187      memset(*tailptr, 0, sizeof(**tailptr));
31883188      entries++;
31893189
r4425r4426
32033203      /* allocate and copy the name if it is present */
32043204      if (colon != NULL)
32053205      {
3206         (*tailptr)->swname = lastname = malloc_or_die(colon - tempbuf + 1);
3206         (*tailptr)->swname = lastname = (char *)malloc_or_die(colon - tempbuf + 1);
32073207         strncpy(lastname, tempbuf, colon - tempbuf);
32083208         lastname[colon - tempbuf] = 0;
32093209         number = colon + 1;
r4425r4426
32183218            error_buf_append(errorbuf, errorbuflen, "Switch location '%s' missing switch name!\n", location);
32193219            lastname = (char *)"UNK";
32203220         }
3221         (*tailptr)->swname = namecopy = malloc_or_die(strlen(lastname) + 1);
3221         (*tailptr)->swname = namecopy = (char *)malloc_or_die(strlen(lastname) + 1);
32223222         strcpy(namecopy, lastname);
32233223      }
32243224
r4425r4426
34503450      int remapnum;
34513451
34523452      /* allocate tables */
3453      oldtable = malloc_or_die(count * sizeof(*oldtable));
3454      newtable = malloc_or_die(count * sizeof(*newtable));
3453      oldtable = (input_code *)malloc_or_die(count * sizeof(*oldtable));
3454      newtable = (input_code *)malloc_or_die(count * sizeof(*newtable));
34553455
34563456      /* build up the remap table */
34573457      count = 0;
src/emu/rendfont.c
r4425r4426
141141   render_font *font;
142142
143143   /* allocate and clear memory */
144   font = malloc_or_die(sizeof(*font));
144   font = (render_font *)malloc_or_die(sizeof(*font));
145145   memset(font, 0, sizeof(*font));
146146
147147   /* attempt to load the cached version of the font first */
r4425r4426
150150
151151   /* if we failed, clean up and realloc */
152152   render_font_free(font);
153   font = malloc_or_die(sizeof(*font));
153   font = (render_font *)malloc_or_die(sizeof(*font));
154154   memset(font, 0, sizeof(*font));
155155
156156   /* load the raw data instead */
r4425r4426
434434
435435   /* determine the file size and allocate memory */
436436   font->rawsize = mame_fsize(file);
437   data = malloc_or_die(font->rawsize + 1);
437   data = (char *)malloc_or_die(font->rawsize + 1);
438438
439439   /* read and hash the first chunk */
440440   bytes = mame_fread(file, data, MIN(CACHED_BDF_HASH_SIZE, font->rawsize));
r4425r4426
584584            /* if we don't have a subtable yet, make one */
585585            if (font->chars[charnum / 256] == NULL)
586586            {
587               font->chars[charnum / 256] = malloc_or_die(256 * sizeof(font->chars[0][0]));
587               font->chars[charnum / 256] = (render_font_char *)malloc_or_die(256 * sizeof(font->chars[0][0]));
588588               memset(font->chars[charnum / 256], 0, 256 * sizeof(font->chars[0][0]));
589589            }
590590
r4425r4426
642642      goto error;
643643
644644   /* now read the rest of the data */
645   data = malloc_or_die(filesize - CACHED_HEADER_SIZE);
645   data = (UINT8 *)malloc_or_die(filesize - CACHED_HEADER_SIZE);
646646   bytes_read = mame_fread(file, data, filesize - CACHED_HEADER_SIZE);
647647   if (bytes_read != filesize - CACHED_HEADER_SIZE)
648648      goto error;
r4425r4426
658658      /* if we don't have a subtable yet, make one */
659659      if (font->chars[chnum / 256] == NULL)
660660      {
661         font->chars[chnum / 256] = malloc_or_die(256 * sizeof(font->chars[0][0]));
661         font->chars[chnum / 256] = (render_font_char *)malloc_or_die(256 * sizeof(font->chars[0][0]));
662662         memset(font->chars[chnum / 256], 0, 256 * sizeof(font->chars[0][0]));
663663      }
664664
r4425r4426
728728   }
729729
730730   /* allocate an array to hold the character data */
731   chartable = malloc_or_die(numchars * CACHED_CHAR_SIZE);
731   chartable = (UINT8 *)malloc_or_die(numchars * CACHED_CHAR_SIZE);
732732   memset(chartable, 0, numchars * CACHED_CHAR_SIZE);
733733
734734   /* allocate a temp buffer to compress into */
735   tempbuffer = malloc_or_die(65536);
735   tempbuffer = (UINT8 *)malloc_or_die(65536);
736736
737737   /* write the header */
738738   dest = tempbuffer;
src/emu/devintrf.c
r4425r4426
111111   configlen = (UINT32)devtype_get_info_int(type, DEVINFO_INT_INLINE_CONFIG_BYTES);
112112
113113   /* allocate a new device */
114   device = malloc_or_die(sizeof(*device) + strlen(tag) + configlen);
114   device = (device_config *)malloc_or_die(sizeof(*device) + strlen(tag) + configlen);
115115
116116   /* populate device relationships */
117117   device->next = NULL;
r4425r4426
121121
122122   /* populate device properties */
123123   device->type = type;
124   device->devclass = devtype_get_info_int(type, DEVINFO_INT_CLASS);
124   device->devclass = (device_class)(INT32)devtype_get_info_int(type, DEVINFO_INT_CLASS);
125125   device->set_info = (device_set_info_func)devtype_get_info_fct(type, DEVINFO_FCT_SET_INFO);
126126   device->execute = NULL;
127127
src/emu/eigccppc.h
r4425r4426
299299-------------------------------------------------*/
300300
301301#define compare_exchange32 _compare_exchange32
302INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
302INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
303303_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
304304{
305305   register INT32 result;
r4425r4426
333333
334334#if defined(__ppc64__) || defined(__PPC64__)
335335#define compare_exchange64 _compare_exchange64
336INLINE INT64 ATTR_NONNULL ATTR_FORCE_INLINE
336INLINE INT64 ATTR_NONNULL(1) ATTR_FORCE_INLINE
337337_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
338338{
339339   register INT64 result;
r4425r4426
343343      "   cmpd   %[compare], %[result]  \n"
344344      "   bne    2f                     \n"
345345      "   stdcx. %[exchange], 0, %[ptr] \n"
346      "   bne--  1b                     \n"
346      "   bne-   1b                     \n"
347347      "2:                                 "
348348     : [dummy]    "+m"  (*ptr)   /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
349349     , [result]   "=&r" (result)
r4425r4426
365365-------------------------------------------------*/
366366
367367#define atomic_exchange32 _atomic_exchange32
368INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
368INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
369369_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
370370{
371371   register INT32 result;
r4425r4426
393393-------------------------------------------------*/
394394
395395#define atomic_add32 _atomic_add32
396INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
396INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
397397_atomic_add32(INT32 volatile *ptr, INT32 delta)
398398{
399399   register INT32 result;
r4425r4426
422422-------------------------------------------------*/
423423
424424#define atomic_increment32 _atomic_increment32
425INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
425INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
426426_atomic_increment32(INT32 volatile *ptr)
427427{
428428   register INT32 result;
r4425r4426
450450-------------------------------------------------*/
451451
452452#define atomic_decrement32 _atomic_decrement32
453INLINE INT32 ATTR_NONNULL ATTR_FORCE_INLINE
453INLINE INT32 ATTR_NONNULL(1) ATTR_FORCE_INLINE
454454_atomic_decrement32(INT32 volatile *ptr)
455455{
456456   register INT32 result;
src/emu/machine/cr589.c
r4425r4426
2020{
2121   UINT8 *command;
2222   int commandLength;
23   SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance );
23   SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
2424   SCSIGetCommand( scsiInstance, &command, &commandLength );
2525
2626   switch( command[ 0 ] )
r4425r4426
4848{
4949   UINT8 *command;
5050   int commandLength;
51   SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance );
51   SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
5252   SCSIGetCommand( scsiInstance, &command, &commandLength );
5353
5454   switch( command[ 0 ] )
r4425r4426
8181{
8282   UINT8 *command;
8383   int commandLength;
84   SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance );
84   SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
8585   SCSIGetCommand( scsiInstance, &command, &commandLength );
8686
8787   switch( command[ 0 ] )
r4425r4426
111111static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
112112{
113113   running_machine *machine = scsiInstance->machine;
114   SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance );
114   SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
115115
116116   our_this->download = 0;
117117   memcpy( &our_this->buffer[ identity_offset ], "MATSHITACD-ROM CR-589   GS0N", 28 );
r4425r4426
128128   switch( operation )
129129   {
130130      case SCSIOP_EXEC_COMMAND:
131         return cr589_exec_command( file, ptrparm );
131         return cr589_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
132132
133133      case SCSIOP_READ_DATA:
134         cr589_read_data( file, ptrparm, intparm );
134         cr589_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
135135         return 0;
136136
137137      case SCSIOP_WRITE_DATA:
138         cr589_write_data( file, ptrparm, intparm );
138         cr589_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
139139         return 0;
140140
141141      case SCSIOP_ALLOC_INSTANCE:
142         params = ptrparm;
143         SCSIBase( &SCSIClassCr589, operation, file, intparm, ptrparm );
142         params = (SCSIAllocInstanceParams *)ptrparm;
143         SCSIBase( &SCSIClassCr589, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
144144         cr589_alloc_instance( params->instance, params->diskregion );
145145         return 0;
146146   }
147147
148   return SCSIBase( &SCSIClassCr589, operation, file, intparm, ptrparm );
148   return SCSIBase( &SCSIClassCr589, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
149149}
150150
151151const SCSIClass SCSIClassCr589 =
src/emu/machine/x76f100.c
r4425r4426
8484
8585   if( data == NULL )
8686   {
87      data = auto_malloc(
87      data = (UINT8 *)auto_malloc(
8888         SIZE_RESPONSE_TO_RESET +
8989         SIZE_READ_PASSWORD +
9090         SIZE_WRITE_PASSWORD +
src/emu/machine/timekpr.c
r4425r4426
308308   c->month = make_bcd( systime.local_time.month + 1 );
309309   c->year = make_bcd( systime.local_time.year % 100 );
310310   c->century = make_bcd( systime.local_time.year / 100 );
311   c->data = auto_malloc( c->size );
311   c->data = (UINT8 *)auto_malloc( c->size );
312312
313313   c->default_data = device->region;
314314   if (c->default_data != NULL)
src/emu/machine/scsihd.c
r4425r4426
2727{
2828   UINT8 *command;
2929   int commandLength;
30   SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
30   SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
3131   SCSIGetCommand( scsiInstance, &command, &commandLength );
3232
3333   switch ( command[0] )
r4425r4426
103103   int i;
104104   UINT8 *command;
105105   int commandLength;
106   SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
106   SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
107107   SCSIGetCommand( scsiInstance, &command, &commandLength );
108108
109109   switch ( command[0] )
r4425r4426
194194{
195195   UINT8 *command;
196196   int commandLength;
197   SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
197   SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
198198   SCSIGetCommand( scsiInstance, &command, &commandLength );
199199
200200   switch ( command[0] )
r4425r4426
225225static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
226226{
227227   running_machine *machine = scsiInstance->machine;
228   SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
228   SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
229229
230230   our_this->lba = 0;
231231   our_this->blocks = 0;
r4425r4426
249249static void scsihd_delete_instance( SCSIInstance *scsiInstance )
250250{
251251#ifndef MESS
252   SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
252   SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
253253
254254   if( our_this->disk )
255255   {
r4425r4426
260260
261261static void scsihd_get_device( SCSIInstance *scsiInstance, hard_disk_file **disk )
262262{
263   SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
263   SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
264264   *disk = our_this->disk;
265265}
266266
267267static void scsihd_set_device( SCSIInstance *scsiInstance, hard_disk_file *disk )
268268{
269   SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
269   SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
270270   our_this->disk = disk;
271271}
272272
r4425r4426
277277   switch (operation)
278278   {
279279      case SCSIOP_EXEC_COMMAND:
280         return scsihd_exec_command( file, ptrparm );
280         return scsihd_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
281281
282282      case SCSIOP_READ_DATA:
283         scsihd_read_data( file, ptrparm, intparm );
283         scsihd_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
284284         return 0;
285285
286286      case SCSIOP_WRITE_DATA:
287         scsihd_write_data( file, ptrparm, intparm );
287         scsihd_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
288288         return 0;
289289
290290      case SCSIOP_ALLOC_INSTANCE:
291         params = ptrparm;
292         SCSIBase( &SCSIClassHARDDISK, operation, file, intparm, ptrparm );
291         params = (SCSIAllocInstanceParams *)ptrparm;
292         SCSIBase( &SCSIClassHARDDISK, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
293293         scsihd_alloc_instance( params->instance, params->diskregion );
294294         return 0;
295295
296296      case SCSIOP_DELETE_INSTANCE:
297         scsihd_delete_instance( file );
297         scsihd_delete_instance( (SCSIInstance *)file );
298298         break;
299299
300300      case SCSIOP_GET_DEVICE:
301         scsihd_get_device( file, ptrparm );
301         scsihd_get_device( (SCSIInstance *)file, (hard_disk_file **)ptrparm );
302302         return 0;
303303
304304      case SCSIOP_SET_DEVICE:
305         scsihd_set_device( file, ptrparm );
305         scsihd_set_device( (SCSIInstance *)file, (hard_disk_file *)ptrparm );
306306         return 0;
307307   }
308308
309   return SCSIBase( &SCSIClassHARDDISK, operation, file, intparm, ptrparm );
309   return SCSIBase( &SCSIClassHARDDISK, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
310310}
311311
312312const SCSIClass SCSIClassHARDDISK =
src/emu/machine/6526cia.c
r4425r4426
448448
449449static TIMER_CALLBACK( cia_timer_proc )
450450{
451   cia_timer *timer = ptr;
451   cia_timer *timer = (cia_timer *)ptr;
452452   cia_state *cia = timer->cia;
453453
454454   cia_timer_underflow(cia->device, timer - cia->timer);
r4425r4426
554554
555555static TIMER_CALLBACK( cia_clock_tod_callback )
556556{
557   const device_config *device = ptr;
557   const device_config *device = (const device_config *)ptr;
558558   cia_clock_tod(device);
559559}
560560
src/emu/machine/74123.c
r4425r4426
7373
7474static TIMER_CALLBACK( output_callback )
7575{
76   const device_config *device = ptr;
76   const device_config *device = (const device_config *)ptr;
7777   ttl74123_t *chip = get_safe_token(device);
7878
7979   chip->intf->output_changed_cb(device, 0, param);
r4425r4426
9393
9494static TIMER_CALLBACK( clear_callback )
9595{
96   const device_config *device = ptr;
96   const device_config *device = (const device_config *)ptr;
9797   ttl74123_t *chip = get_safe_token(device);
9898   int output = timer_running(chip);
9999
r4425r4426
191191   ttl74123_t *chip = get_safe_token(device);
192192
193193   /* validate arguments */
194   chip->intf = device->static_config;
194   chip->intf = (ttl74123_config *)device->static_config;
195195
196196   assert_always(chip->intf, "No interface specified");
197197   assert_always((chip->intf->connection_type != TTL74123_GROUNDED) || (chip->intf->cap >= CAP_U(0.01)), "Only capacitors >= 0.01uF supported for GROUNDED type");
src/emu/machine/idectrl.c
r4425r4426
4747
4848#define IDE_CONFIG_REGISTERS         0x10
4949
50#define IDE_ADDR_CONFIG_UNK            0x034
51#define IDE_ADDR_CONFIG_REGISTER      0x038
52#define IDE_ADDR_CONFIG_DATA         0x03c
50#define BANK(b, v) (((v) << 4) | (b))
5351
54#define IDE_ADDR_DATA               0x1f0
55#define IDE_ADDR_ERROR               0x1f1
56#define IDE_ADDR_SECTOR_COUNT         0x1f2
57#define IDE_ADDR_SECTOR_NUMBER         0x1f3
58#define IDE_ADDR_CYLINDER_LSB         0x1f4
59#define IDE_ADDR_CYLINDER_MSB         0x1f5
60#define IDE_ADDR_HEAD_NUMBER         0x1f6
61#define IDE_ADDR_STATUS_COMMAND         0x1f7
52#define IDE_BANK0_DATA               BANK(0, 0)
53#define IDE_BANK0_ERROR               BANK(0, 1)
54#define IDE_BANK0_SECTOR_COUNT         BANK(0, 2)
55#define IDE_BANK0_SECTOR_NUMBER         BANK(0, 3)
56#define IDE_BANK0_CYLINDER_LSB         BANK(0, 4)
57#define IDE_BANK0_CYLINDER_MSB         BANK(0, 5)
58#define IDE_BANK0_HEAD_NUMBER         BANK(0, 6)
59#define IDE_BANK0_STATUS_COMMAND      BANK(0, 7)
6260
63#define IDE_ADDR_STATUS_CONTROL         0x3f6
61#define IDE_BANK1_STATUS_CONTROL      BANK(1, 6)
6462
63#define IDE_BANK2_CONFIG_UNK         BANK(2, 4)
64#define IDE_BANK2_CONFIG_REGISTER      BANK(2, 8)
65#define IDE_BANK2_CONFIG_DATA         BANK(2, 0xc)
66
6567#define IDE_COMMAND_READ_MULTIPLE      0x20
6668#define IDE_COMMAND_READ_MULTIPLE_ONCE   0x21
6769#define IDE_COMMAND_WRITE_MULTIPLE      0x30
r4425r4426
7981#define IDE_COMMAND_ATAPI_IDENTIFY      0xa1
8082#define IDE_COMMAND_RECALIBRATE         0x10
8183#define IDE_COMMAND_IDLE_IMMEDIATE      0xe1
84#define IDE_COMMAND_TAITO_GNET_UNLOCK_1 0xfe
85#define IDE_COMMAND_TAITO_GNET_UNLOCK_2 0xfc
8286
8387#define IDE_ERROR_NONE               0x00
8488#define IDE_ERROR_DEFAULT            0x01
r4425r4426
144148   UINT8         config_register[IDE_CONFIG_REGISTERS];
145149   UINT8         config_register_num;
146150
151   chd_file       *handle;
147152   hard_disk_file *disk;
148153   emu_timer *      last_status_timer;
149154   emu_timer *      reset_timer;
r4425r4426
170175static void read_first_sector(ide_state *ide);
171176static void read_next_sector(ide_state *ide);
172177
173static UINT32 ide_controller_read(const device_config *device, offs_t offset, int size);
174static void ide_controller_write(const device_config *device, offs_t offset, int size, UINT32 data);
178static UINT32 ide_controller_read(const device_config *device, int bank, offs_t offset, int size);
179static void ide_controller_write(const device_config *device, int bank, offs_t offset, int size, UINT32 data);
175180
176181
177182
r4425r4426
196201
197202INLINE void signal_interrupt(ide_state *ide)
198203{
199   const ide_config *config = ide->device->inline_config;
204   const ide_config *config = (const ide_config *)ide->device->inline_config;
200205
201206   LOG(("IDE interrupt assert\n"));
202207
r4425r4426
210215
211216INLINE void clear_interrupt(ide_state *ide)
212217{
213   const ide_config *config = ide->device->inline_config;
218   const ide_config *config = (const ide_config *)ide->device->inline_config;
214219
215220   LOG(("IDE interrupt clear\n"));
216221
r4425r4426
228233
229234static TIMER_CALLBACK( delayed_interrupt )
230235{
231   ide_state *ide = ptr;
236   ide_state *ide = (ide_state *)ptr;
232237   ide->status &= ~IDE_STATUS_BUSY;
233238   signal_interrupt(ide);
234239}
r4425r4426
236241
237242static TIMER_CALLBACK( delayed_interrupt_buffer_ready )
238243{
239   ide_state *ide = ptr;
244   ide_state *ide = (ide_state *)ptr;
240245   ide->status &= ~IDE_STATUS_BUSY;
241246   ide->status |= IDE_STATUS_BUFFER_READY;
242247   signal_interrupt(ide);
r4425r4426
289294
290295static TIMER_CALLBACK( reset_callback )
291296{
292   device_reset(ptr);
297   device_reset((const device_config *)ptr);
293298}
294299
295300
r4425r4426
427432}
428433
429434
430static void ide_build_features(ide_state *ide)
435static void ide_generate_features(ide_state *ide)
431436{
432437   int total_sectors = ide->num_cylinders * ide->num_heads * ide->num_sectors;
433438   int sectors_per_track = ide->num_heads * ide->num_sectors;
434439
435   memset(ide->buffer, 0, IDE_DISK_SECTOR_SIZE);
436
437440   /* basic geometry */
438441   ide->features[ 0*2+0] = 0x5a;                  /*  0: configuration bits */
439442   ide->features[ 0*2+1] = 0x04;
r4425r4426
586589}
587590
588591
592static void ide_build_features(ide_state *ide)
593{
594   memset(ide->features, 0, IDE_DISK_SECTOR_SIZE);
595   if (chd_get_metadata (ide->handle, HARD_DISK_IDENT_METADATA_TAG, 0, ide->features, IDE_DISK_SECTOR_SIZE, 0, 0, 0) != CHDERR_NONE)
596      ide_generate_features (ide);
597}
589598
590599/*************************************
591600 *
r4425r4426
595604
596605static TIMER_CALLBACK( security_error_done )
597606{
598   ide_state *ide = ptr;
607   ide_state *ide = (ide_state *)ptr;
599608
600609   /* clear error state */
601610   ide->status &= ~IDE_STATUS_ERROR;
r4425r4426
763772
764773static TIMER_CALLBACK( read_sector_done_callback )
765774{
766   read_sector_done(ptr);
775   read_sector_done((ide_state *)ptr);
767776}
768777
769778
r4425r4426
965974
966975static TIMER_CALLBACK( write_sector_done_callback )
967976{
968   write_sector_done(ptr);
977   write_sector_done((ide_state *)ptr);
969978}
970979
971980
r4425r4426
11601169         signal_interrupt(ide);
11611170         break;
11621171
1172      case IDE_COMMAND_TAITO_GNET_UNLOCK_1:
1173         LOGPRINT(("IDE GNET Unlock 1\n"));
1174
1175         ide->sector_count = 1;
1176         ide->status |= IDE_STATUS_DRIVE_READY;
1177         ide->status &= ~IDE_STATUS_ERROR;
1178         signal_interrupt(ide);
1179         break;
1180
1181      case IDE_COMMAND_TAITO_GNET_UNLOCK_2:
1182         LOGPRINT(("IDE GNET Unlock 2\n"));
1183
1184         /* reset the buffer */
1185         ide->buffer_offset = 0;
1186         ide->sectors_until_int = 0;
1187         ide->dma_active = 0;
1188
1189         /* mark the buffer ready */
1190         ide->status |= IDE_STATUS_BUFFER_READY;
1191         signal_interrupt(ide);
1192         break;
1193
11631194      default:
11641195         LOGPRINT(("IDE unknown command (%02X)\n", command));
11651196         debugger_break(ide->device->machine);
r4425r4426
11751206 *
11761207 *************************************/
11771208
1178static UINT32 ide_controller_read(const device_config *device, offs_t offset, int size)
1209static UINT32 ide_controller_read(const device_config *device, int bank, offs_t offset, int size)
11791210{
11801211   ide_state *ide = get_safe_token(device);
11811212   UINT32 result = 0;
11821213
11831214   /* logit */
1184//  if (offset != IDE_ADDR_DATA && offset != IDE_ADDR_STATUS_COMMAND && offset != IDE_ADDR_STATUS_CONTROL)
1185      LOG(("%s:IDE read at %03X, size=%d\n", cpuexec_describe_context(device->machine), offset, size));
1215//  if (BANK(bank, offset) != IDE_BANK0_DATA && BANK(bank, offset) != IDE_BANK0_STATUS_COMMAND && BANK(bank, offset) != IDE_BANK1_STATUS_CONTROL)
1216      LOG(("%s:IDE read at %d:%X, size=%d\n", cpuexec_describe_context(device->machine), bank, offset, size));
11861217
1187   switch (offset)
1218   switch (BANK(bank, offset))
11881219   {
11891220      /* unknown config register */
1190      case IDE_ADDR_CONFIG_UNK:
1221      case IDE_BANK2_CONFIG_UNK:
11911222         return ide->config_unknown;
11921223
11931224      /* active config register */
1194      case IDE_ADDR_CONFIG_REGISTER:
1225      case IDE_BANK2_CONFIG_REGISTER:
11951226         return ide->config_register_num;
11961227
11971228      /* data from active config register */
1198      case IDE_ADDR_CONFIG_DATA:
1229      case IDE_BANK2_CONFIG_DATA:
11991230         if (ide->config_register_num < IDE_CONFIG_REGISTERS)
12001231            return ide->config_register[ide->config_register_num];
12011232         return 0;
12021233
12031234      /* read data if there's data to be read */
1204      case IDE_ADDR_DATA:
1235      case IDE_BANK0_DATA:
12051236         if (ide->status & IDE_STATUS_BUFFER_READY)
12061237         {
12071238            /* fetch the correct amount of data */
r4425r4426
12241255         break;
12251256
12261257      /* return the current error */
1227      case IDE_ADDR_ERROR:
1258      case IDE_BANK0_ERROR:
12281259         return ide->error;
12291260
12301261      /* return the current sector count */
1231      case IDE_ADDR_SECTOR_COUNT:
1262      case IDE_BANK0_SECTOR_COUNT:
12321263         return ide->sector_count;
12331264
12341265      /* return the current sector */
1235      case IDE_ADDR_SECTOR_NUMBER:
1266      case IDE_BANK0_SECTOR_NUMBER:
12361267         return ide->cur_sector;
12371268
12381269      /* return the current cylinder LSB */
1239      case IDE_ADDR_CYLINDER_LSB:
1270      case IDE_BANK0_CYLINDER_LSB:
12401271         return ide->cur_cylinder & 0xff;
12411272
12421273      /* return the current cylinder MSB */
1243      case IDE_ADDR_CYLINDER_MSB:
1274      case IDE_BANK0_CYLINDER_MSB:
12441275         return ide->cur_cylinder >> 8;
12451276
12461277      /* return the current head */
1247      case IDE_ADDR_HEAD_NUMBER:
1278      case IDE_BANK0_HEAD_NUMBER:
12481279         return ide->cur_head_reg;
12491280
12501281      /* return the current status and clear any pending interrupts */
1251      case IDE_ADDR_STATUS_COMMAND:
1282      case IDE_BANK0_STATUS_COMMAND:
12521283      /* return the current status but don't clear interrupts */
1253      case IDE_ADDR_STATUS_CONTROL:
1284      case IDE_BANK1_STATUS_CONTROL:
12541285         result = ide->status;
12551286         if (attotime_compare(timer_timeelapsed(ide->last_status_timer), TIME_PER_ROTATION) > 0)
12561287         {
r4425r4426
12591290         }
12601291
12611292         /* clear interrutps only when reading the real status */
1262         if (offset == IDE_ADDR_STATUS_COMMAND)
1293         if (BANK(bank, offset) == IDE_BANK0_STATUS_COMMAND)
12631294         {
12641295            if (ide->interrupt_pending)
12651296               clear_interrupt(ide);
r4425r4426
12841315 *
12851316 *************************************/
12861317
1287static void ide_controller_write(const device_config *device, offs_t offset, int size, UINT32 data)
1318static void ide_controller_write(const device_config *device, int bank, offs_t offset, int size, UINT32 data)
12881319{
12891320   ide_state *ide = get_safe_token(device);
12901321
12911322   /* logit */
1292   if (offset != IDE_ADDR_DATA)
1293      LOG(("%s:IDE write to %03X = %08X, size=%d\n", cpuexec_describe_context(device->machine), offset, data, size));
1294
1295   switch (offset)
1323   if (BANK(bank, offset) != IDE_BANK0_DATA)
1324      LOG(("%s:IDE write to %d:%X = %08X, size=%d\n", cpuexec_describe_context(device->machine), bank, offset, data, size));
1325   //  fprintf(stderr, "ide write %03x %02x size=%d\n", offset, data, size);
1326   switch (BANK(bank, offset))
12961327   {
12971328      /* unknown config register */
1298      case IDE_ADDR_CONFIG_UNK:
1329      case IDE_BANK2_CONFIG_UNK:
12991330         ide->config_unknown = data;
13001331         break;
13011332
13021333      /* active config register */
1303      case IDE_ADDR_CONFIG_REGISTER:
1334      case IDE_BANK2_CONFIG_REGISTER:
13041335         ide->config_register_num = data;
13051336         break;
13061337
13071338      /* data from active config register */
1308      case IDE_ADDR_CONFIG_DATA:
1339      case IDE_BANK2_CONFIG_DATA:
13091340         if (ide->config_register_num < IDE_CONFIG_REGISTERS)
13101341            ide->config_register[ide->config_register_num] = data;
13111342         break;
13121343
13131344      /* write data */
1314      case IDE_ADDR_DATA:
1345      case IDE_BANK0_DATA:
13151346         if (ide->status & IDE_STATUS_BUFFER_READY)
13161347         {
13171348            /* store the correct amount of data */
r4425r4426
13281359            if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
13291360            {
13301361               LOG(("%s:IDE completed PIO write\n", cpuexec_describe_context(device->machine)));
1331               if (ide->command != IDE_COMMAND_SECURITY_UNLOCK)
1332                  continue_write(ide);
1333               else
1362               if (ide->command == IDE_COMMAND_SECURITY_UNLOCK)
13341363               {
13351364                  if (ide->user_password_enable && memcmp(ide->buffer, ide->user_password, 2 + 32) == 0)
13361365                  {
r4425r4426
13571386                     mame_printf_debug("\n");
13581387                  }
13591388
1360                  /* clear the busy adn error flags */
1389                  /* clear the busy and error flags */
13611390                  ide->status &= ~IDE_STATUS_ERROR;
13621391                  ide->status &= ~IDE_STATUS_BUSY;
13631392                  ide->status &= ~IDE_STATUS_BUFFER_READY;
r4425r4426
13671396                  else
13681397                     ide->status |= IDE_STATUS_DRIVE_READY;
13691398               }
1399               else if (ide->command == IDE_COMMAND_TAITO_GNET_UNLOCK_2)
1400               {
1401                  UINT8 key[5] = { 0, 0, 0, 0, 0 };
1402                  int i, bad = 0;
1403                  chd_get_metadata (ide->handle, HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0);
1404
1405                  for (i=0; !bad && i<512; i++)
1406                     bad = ((i < 2 || i >= 7) && ide->buffer[i]) || ((i >= 2 && i < 7) && ide->buffer[i] != key[i-2]);
1407
1408                  ide->status &= ~IDE_STATUS_BUSY;
1409                  ide->status &= ~IDE_STATUS_BUFFER_READY;
1410                  if (bad)
1411                     ide->status |= IDE_STATUS_ERROR;
1412                  else
1413                     ide->status &= ~IDE_STATUS_ERROR;
1414               }
1415               else
1416                  continue_write(ide);
1417
13701418            }
13711419         }
13721420         break;
13731421
13741422      /* precompensation offset?? */
1375      case IDE_ADDR_ERROR:
1423      case IDE_BANK0_ERROR:
13761424         ide->precomp_offset = data;
13771425         break;
13781426
13791427      /* sector count */
1380      case IDE_ADDR_SECTOR_COUNT:
1428      case IDE_BANK0_SECTOR_COUNT:
13811429         ide->sector_count = data ? data : 256;
13821430         break;
13831431
13841432      /* current sector */
1385      case IDE_ADDR_SECTOR_NUMBER:
1433      case IDE_BANK0_SECTOR_NUMBER:
13861434         ide->cur_sector = data;
13871435         break;
13881436
13891437      /* current cylinder LSB */
1390      case IDE_ADDR_CYLINDER_LSB:
1438      case IDE_BANK0_CYLINDER_LSB:
13911439         ide->cur_cylinder = (ide->cur_cylinder & 0xff00) | (data & 0xff);
13921440         break;
13931441
13941442      /* current cylinder MSB */
1395      case IDE_ADDR_CYLINDER_MSB:
1443      case IDE_BANK0_CYLINDER_MSB:
13961444         ide->cur_cylinder = (ide->cur_cylinder & 0x00ff) | ((data & 0xff) << 8);
13971445         break;
13981446
13991447      /* current head */
1400      case IDE_ADDR_HEAD_NUMBER:
1448      case IDE_BANK0_HEAD_NUMBER:
14011449         ide->cur_head = data & 0x0f;
14021450         ide->cur_head_reg = data;
14031451         // drive index = data & 0x10
r4425r4426
14051453         break;
14061454
14071455      /* command */
1408      case IDE_ADDR_STATUS_COMMAND:
1456      case IDE_BANK0_STATUS_COMMAND:
14091457         handle_command(ide, data);
14101458         break;
14111459
14121460      /* adapter control */
1413      case IDE_ADDR_STATUS_CONTROL:
1461      case IDE_BANK1_STATUS_CONTROL:
14141462         ide->adapter_control = data;
14151463
14161464         /* handle controller reset */
r4425r4426
15391587*/
15401588int ide_bus_r(const device_config *device, int select, int offset)
15411589{
1542   offset += select ? 0x3f0 : 0x1f0;
1543   return ide_controller_read(device, offset, (offset == 0x1f0) ? 2 : 1);
1590   return ide_controller_read(device, select ? 1 : 0, offset, select == 0 && offset == 0 ? 2 : 1);
15441591}
15451592
15461593/*
r4425r4426
15541601*/
15551602void ide_bus_w(const device_config *device, int select, int offset, int data)
15561603{
1557   offset += select ? 0x3f0 : 0x1f0;
1558   if (offset == 0x1f0)
1559      ide_controller_write(device, offset, 2, data);
1604   if (select == 0 && offset == 0)
1605      ide_controller_write(device, 0, 0, 2, data);
15601606   else
1561      ide_controller_write(device, offset, 1, data & 0xff);
1607      ide_controller_write(device, select ? 1 : 0, offset, 1, data & 0xff);
15621608}
15631609
1564int ide_controller_r(const device_config *device, int reg)
1610UINT32 ide_controller_r(const device_config *device, int reg, int size)
15651611{
1566   return ide_controller_read(device, reg, 1);
1612   if (reg >= 0x1f0 && reg < 0x1f8)
1613      return ide_controller_read(device, 0, reg & 7, size);
1614   if (reg >= 0x3f0 && reg < 0x3f8)
1615      return ide_controller_read(device, 1, reg & 7, size);
1616   if (reg >= 0x030 && reg < 0x040)
1617      return ide_controller_read(device, 2, reg & 0xf, size);
1618   return 0xffffffff;
15671619}
15681620
1569void ide_controller_w(const device_config *device, int reg, int data)
1621void ide_controller_w(const device_config *device, int reg, int size, UINT32 data)
15701622{
1571   ide_controller_write(device, reg, 1, data);
1623   if (reg >= 0x1f0 && reg < 0x1f8)
1624      ide_controller_write(device, 0, reg & 7, size, data);
1625   if (reg >= 0x3f0 && reg < 0x3f8)
1626      ide_controller_write(device, 1, reg & 7, size, data);
1627   if (reg >= 0x030 && reg < 0x040)
1628      ide_controller_write(device, 2, reg & 0xf, size, data);
15721629}
15731630
15741631
r4425r4426
15851642   offset *= 4;
15861643   size = convert_to_offset_and_size32(&offset, mem_mask);
15871644
1588   return ide_controller_read(device, offset, size) << ((offset & 3) * 8);
1645   return ide_controller_r(device, offset, size) << ((offset & 3) * 8);
15891646}
15901647
15911648
r4425r4426
15951652
15961653   offset *= 4;
15971654   size = convert_to_offset_and_size32(&offset, mem_mask);
1655   data = data >> ((offset & 3) * 8);
15981656
1599   ide_controller_write(device, offset, size, data >> ((offset & 3) * 8));
1657   ide_controller_w(device, offset, size, data);
16001658}
16011659
16021660
1661READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r )
1662{
1663   int size;
1664   UINT32 res = 0xffffffff;
1665
1666   offset *= 4;
1667   size = convert_to_offset_and_size32(&offset, mem_mask);
1668
1669   if (offset >= 0x000 && offset < 0x008)
1670      res = ide_controller_read(device, 0, offset & 7, size);
1671   if (offset >= 0x008 && offset < 0x010)
1672      res = ide_controller_read(device, 1, offset & 7, size);
1673
1674   return res << ((offset & 3) * 8);
1675}
1676
1677
1678WRITE32_DEVICE_HANDLER( ide_controller32_pcmcia_w )
1679{
1680   int size;
1681
1682   offset *= 4;
1683   size = convert_to_offset_and_size32(&offset, mem_mask);
1684   data = data >> ((offset & 3) * 8);
1685
1686   if (offset >= 0x000 && offset < 0x008)
1687      ide_controller_write(device, 0, offset & 7, size, data);
1688   if (offset >= 0x008 && offset < 0x010)
1689      ide_controller_write(device, 1, offset & 7, size, data);
1690}
1691
16031692READ32_DEVICE_HANDLER( ide_bus_master32_r )
16041693{
16051694   int size;
r4425r4426
16361725   offset *= 2;
16371726   size = convert_to_offset_and_size16(&offset, mem_mask);
16381727
1639   return ide_controller_read(device, offset, size) << ((offset & 1) * 8);
1728   return ide_controller_r(device, offset, size) << ((offset & 1) * 8);
16401729}
16411730
16421731
r4425r4426
16471736   offset *= 2;
16481737   size = convert_to_offset_and_size16(&offset, mem_mask);
16491738
1650   ide_controller_write(device, offset, size, data >> ((offset & 1) * 8));
1739   ide_controller_w(device, offset, size, data >> ((offset & 1) * 8));
16511740}
16521741
16531742
r4425r4426
16771766   ide->device = device;
16781767
16791768   /* set MAME harddisk handle */
1680   config = device->inline_config;
1681   ide->disk = hard_disk_open(get_disk_handle((config->master != NULL) ? config->master : device->tag));
1769   config = (const ide_config *)device->inline_config;
1770   ide->handle = get_disk_handle((config->master != NULL) ? config->master : device->tag);
1771   ide->disk = hard_disk_open(ide->handle);
16821772   assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n");
16831773
16841774   /* find the bus master space */
src/emu/machine/idectrl.h
r4425r4426
6666int ide_bus_r(const device_config *config, int select, int offset);
6767void ide_bus_w(const device_config *config, int select, int offset, int data);
6868
69int ide_controller_r(const device_config *config, int reg);
70void ide_controller_w(const device_config *config, int reg, int data);
69UINT32 ide_controller_r(const device_config *config, int reg, int size);
70void ide_controller_w(const device_config *config, int reg, int size, UINT32 data);
7171
7272READ32_DEVICE_HANDLER( ide_controller32_r );
7373WRITE32_DEVICE_HANDLER( ide_controller32_w );
74READ32_DEVICE_HANDLER( ide_controller32_pcmcia_r );
75WRITE32_DEVICE_HANDLER( ide_controller32_pcmcia_w );
7476READ32_DEVICE_HANDLER( ide_bus_master32_r );
7577WRITE32_DEVICE_HANDLER( ide_bus_master32_w );
7678
src/emu/machine/68681.c
r4425r4426
120120
121121static TIMER_CALLBACK( duart_timer_callback )
122122{
123   const device_config *device = ptr;
123   const device_config *device = (const device_config *)ptr;
124124   duart68681_state   *duart68681 = get_safe_token(device);
125125
126126   duart68681->ISR |= INT_COUNTER_READY;
r4425r4426
275275
276276static TIMER_CALLBACK( tx_timer_callback )
277277{
278   const device_config *device = ptr;
278   const device_config *device = (const device_config *)ptr;
279279   duart68681_state   *duart68681 = get_safe_token(device);
280280   int ch = param & 1;
281281
r4425r4426
592592   duart68681_state *duart68681 = get_safe_token(device);
593593
594594   memset(duart68681, 0, sizeof(duart68681_state));
595   duart68681->duart_config = device->static_config;
595   duart68681->duart_config = (const duart68681_config *)device->static_config;
596596   duart68681->device = device;
597597   duart68681->IVR = 0x0f;
598598
src/emu/machine/6532riot.c
r4425r4426
166166
167167static TIMER_CALLBACK( timer_end_callback )
168168{
169   const device_config *device = ptr;
169   const device_config *device = (const device_config *)ptr;
170170   riot6532_state *riot = get_safe_token(device);
171171
172172   assert(riot->timerstate != TIMER_IDLE);
r4425r4426
434434
435435   /* set static values */
436436   riot->device = device;
437   riot->intf = device->static_config;
437   riot->intf = (riot6532_interface *)device->static_config;
438438   riot->index = device_list_index(device->machine->config->devicelist, RIOT6532, device->tag);
439439
440440   /* configure the ports */
src/emu/machine/6522via.c
r4425r4426
380380
381381static TIMER_CALLBACK( via_shift_callback )
382382{
383   const device_config *device = ptr;
383   const device_config *device = (const device_config *)ptr;
384384   via_shift(device);
385385}
386386
r4425r4426
391391
392392static TIMER_CALLBACK( via_t1_timeout )
393393{
394   const device_config *device = ptr;
394   const device_config *device = (const device_config *)ptr;
395395   via6522_t *v = get_token(device);
396396
397397   if (T1_CONTINUOUS (v->acr))
r4425r4426
424424
425425static TIMER_CALLBACK( via_t2_timeout )
426426{
427   const device_config *device = ptr;
427   const device_config *device = (const device_config *)ptr;
428428   via6522_t *v = get_token(device);
429429
430430   v->t2_active = 0;
src/emu/machine/scsidev.c
r4425r4426
1717{
1818   UINT8 *command;
1919   int commandLength;
20//  SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
20//  SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
2121   SCSIGetCommand( scsiInstance, &command, &commandLength );
2222
2323   switch( command[ 0 ] )
r4425r4426
3636{
3737   UINT8 *command;
3838   int commandLength;
39//  SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
39//  SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
4040   SCSIGetCommand( scsiInstance, &command, &commandLength );
4141
4242   switch( command[ 0 ] )
r4425r4426
5151{
5252   UINT8 *command;
5353   int commandLength;
54//  SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
54//  SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
5555   SCSIGetCommand( scsiInstance, &command, &commandLength );
5656
5757   switch( command[ 0 ] )
r4425r4426
6464
6565static void scsidev_set_phase( SCSIInstance *scsiInstance, int phase )
6666{
67   SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
67   SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
6868   our_this->phase = phase;
6969}
7070
7171static int scsidev_get_phase( SCSIInstance *scsiInstance )
7272{
73   SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
73   SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
7474   return our_this->phase;
7575}
7676
7777static void scsidev_set_command( SCSIInstance *scsiInstance, void *command, int commandLength )
7878{
79   SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
79   SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
8080
8181   if( commandLength > sizeof( our_this->command ) )
8282   {
r4425r4426
9292
9393static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
9494{
95   SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
95   SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
9696   *command = our_this->command;
9797   return our_this->commandLength;
9898}
r4425r4426
100100static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
101101{
102102   running_machine *machine = scsiInstance->machine;
103   SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
103   SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
104104
105105   state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
106106   state_save_register_item( machine, "scsidev", diskregion, 0, our_this->commandLength );
r4425r4426
114114   switch( operation )
115115   {
116116      case SCSIOP_EXEC_COMMAND:
117         return scsidev_exec_command( file, ptrparm );
117         return scsidev_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
118118
119119      case SCSIOP_READ_DATA:
120         scsidev_read_data( file, ptrparm, intparm );
120         scsidev_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
121121         break;
122122
123123      case SCSIOP_WRITE_DATA:
124         scsidev_write_data( file, ptrparm, intparm );
124         scsidev_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
125125         break;
126126
127127      case SCSIOP_SET_PHASE:
128         scsidev_set_phase( file, intparm );
128         scsidev_set_phase( (SCSIInstance *)file, intparm );
129129         return 0;
130130
131131      case SCSIOP_GET_PHASE:
132         return scsidev_get_phase( file );
132         return scsidev_get_phase( (SCSIInstance *)file );
133133
134134      case SCSIOP_SET_COMMAND:
135         scsidev_set_command( file, ptrparm, intparm );
135         scsidev_set_command( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
136136         return 0;
137137
138138      case SCSIOP_GET_COMMAND:
139         return scsidev_get_command( file, ptrparm );
139         return scsidev_get_command( (SCSIInstance *)file, (void **)ptrparm );
140140
141141      case SCSIOP_ALLOC_INSTANCE:
142         params = ptrparm;
143         params->instance = SCSIMalloc( params->machine, file );
142         params = (SCSIAllocInstanceParams *)ptrparm;
143         params->instance = SCSIMalloc( params->machine, (const SCSIClass *)file );
144144         scsidev_alloc_instance( params->instance, params->diskregion );
145145         return 0;
146146
147147      case SCSIOP_DELETE_INSTANCE:
148         free( file );
148         free( (SCSIInstance *)file );
149149         return 0;
150150   }
151151   return 0;
src/emu/machine/scsicd.c
r4425r4426
4242{
4343   UINT8 *command;
4444   int commandLength;
45   SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
45   SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
4646
4747   cdrom_file *cdrom = our_this->cdrom;
4848   const device_config *cdda;
r4425r4426
310310{
311311   UINT8 *command;
312312   int commandLength;
313   SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
313   SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
314314
315315   int i;
316316   UINT32 last_phys_frame;
r4425r4426
629629{
630630   UINT8 *command;
631631   int commandLength;
632   SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
632   SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
633633   SCSIGetCommand( scsiInstance, &command, &commandLength );
634634
635635   switch (command[ 0 ])
r4425r4426
673673static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
674674{
675675   running_machine *machine = scsiInstance->machine;
676   SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
676   SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
677677
678678   our_this->lba = 0;
679679   our_this->blocks = 0;
r4425r4426
707707static void scsicd_delete_instance( SCSIInstance *scsiInstance )
708708{
709709#ifndef MESS
710   SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
710   SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
711711   if( our_this->cdrom )
712712   {
713713      cdrom_close( our_this->cdrom );
r4425r4426
717717
718718static void scsicd_get_device( SCSIInstance *scsiInstance, cdrom_file **cdrom )
719719{
720   SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
720   SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
721721   *cdrom = our_this->cdrom;
722722}
723723
724724static void scsicd_set_device( SCSIInstance *scsiInstance, cdrom_file *cdrom )
725725{
726   SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
726   SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
727727   our_this->cdrom = cdrom;
728728}
729729
r4425r4426
734734   switch (operation)
735735   {
736736      case SCSIOP_EXEC_COMMAND:
737         return scsicd_exec_command( file, ptrparm );
737         return scsicd_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
738738
739739      case SCSIOP_READ_DATA:
740         scsicd_read_data( file, ptrparm, intparm );
740         scsicd_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
741741         return 0;
742742
743743      case SCSIOP_WRITE_DATA:
744         scsicd_write_data( file, ptrparm, intparm );
744         scsicd_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
745745         return 0;
746746
747747      case SCSIOP_ALLOC_INSTANCE:
748         params = ptrparm;
749         SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm );
748         params = (SCSIAllocInstanceParams *)ptrparm;
749         SCSIBase( &SCSIClassCDROM, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
750750         scsicd_alloc_instance( params->instance, params->diskregion );
751751         return 0;
752752
753753      case SCSIOP_DELETE_INSTANCE:
754         scsicd_delete_instance( file );
754         scsicd_delete_instance( (SCSIInstance *)file );
755755         break;
756756
757757      case SCSIOP_GET_DEVICE:
758         scsicd_get_device( file, ptrparm );
758         scsicd_get_device( (SCSIInstance *)file, (cdrom_file **)ptrparm );
759759         return 0;
760760
761761      case SCSIOP_SET_DEVICE:
762         scsicd_set_device( file, ptrparm );
762         scsicd_set_device( (SCSIInstance *)file, (cdrom_file *)ptrparm );
763763         return 0;
764764   }
765765
766   return SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm );
766   return SCSIBase( &SCSIClassCDROM, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
767767}
768768
769769const SCSIClass SCSIClassCDROM =
src/emu/machine/ldpr8210.c
r4425r4426
521521
522522static TIMER_CALLBACK( vsync_off )
523523{
524   laserdisc_state *ld = ptr;
524   laserdisc_state *ld = (laserdisc_state *)ptr;
525525   ld->player->vsync = FALSE;
526526}
527527
r4425r4426
535535
536536static TIMER_CALLBACK( vbi_data_fetch )
537537{
538   laserdisc_state *ld = ptr;
538   laserdisc_state *ld = (laserdisc_state *)ptr;
539539   ldplayer_data *player = ld->player;
540540   UINT8 focus_on = !(player->port1 & 0x08);
541541   UINT8 laser_on = !(player->port2 & 0x01);
r4425r4426
10971097
10981098static TIMER_CALLBACK( irq_off )
10991099{
1100   laserdisc_state *ld = ptr;
1100   laserdisc_state *ld = (laserdisc_state *)ptr;
11011101   ldplayer_data *player = ld->player;
11021102   cpu_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
11031103   if (LOG_SIMUTREK)
r4425r4426
11811181
11821182static TIMER_CALLBACK( simutrek_latched_data_w )
11831183{
1184   laserdisc_state *ld = ptr;
1184   laserdisc_state *ld = (laserdisc_state *)ptr;
11851185   ldplayer_data *player = ld->player;
11861186
11871187   /* store the data and set the ready flag */
src/emu/machine/6840ptm.c
r4425r4426
355355   if (idx == 2) duration = attotime_mul(duration, currptr->t3_divisor);
356356   PLOG(("MC6840 #%d: reload_count(%d): output = %lf\n", which, idx, attotime_to_double(duration)));
357357
358   if (!currptr->control_reg[idx] & 0x02)
358   if (!(currptr->control_reg[idx] & 0x02))
359359   {
360360      if (!currptr->intf->external_clock[idx])
361361      {
r4425r4426
739739   ptm6840 *currptr = ptm + which;
740740   currptr->external_clock[counter] = clock;
741741
742   if (!currptr->control_reg[counter] & 0x02)
742   if (!(currptr->control_reg[counter] & 0x02))
743743   {
744744      if (!currptr->intf->external_clock[counter])
745745      {
src/emu/machine/z80dma.c
r4425r4426
201201
202202static TIMER_CALLBACK( z80dma_timerproc )
203203{
204   const device_config *device = ptr;
204   const device_config *device = (const device_config *)ptr;
205205   z80dma_t *cntx = get_safe_token(device);
206206   int done;
207207
r4425r4426
390390
391391static TIMER_CALLBACK( z80dma_rdy_write_callback )
392392{
393   const device_config *device = ptr;
393   const device_config *device = (const device_config *)ptr;
394394   int state = param & 0x01;
395395   z80dma_t *cntx = get_safe_token(device);
396396
r4425r4426
447447   assert(device != NULL);
448448   assert(device->tag != NULL);
449449
450   z80dma->intf = device->static_config;
450   z80dma->intf = (const z80dma_interface *)device->static_config;
451451
452452   z80dma->timer = timer_alloc(device->machine, z80dma_timerproc, (void *) device);
453453
src/emu/machine/8255ppi.c
r4425r4426
501501static DEVICE_START( ppi8255 ) {
502502   ppi8255_t   *ppi8255 = get_safe_token(device);
503503
504   ppi8255->intf = device->static_config;
504   ppi8255->intf = (const ppi8255_interface *)device->static_config;
505505
506506   devcb_resolve_read8(&ppi8255->port_read[0], &ppi8255->intf->port_a_read, device);
507507   devcb_resolve_read8(&ppi8255->port_read[1], &ppi8255->intf->port_b_read, device);
src/emu/machine/generic.c
r4425r4426
3030UINT8 *generic_nvram;
3131UINT16 *generic_nvram16;
3232UINT32 *generic_nvram32;
33UINT64 *generic_nvram64;
3334
3435/* memory card status */
3536static int memcard_inserted;
r4425r4426
8081   generic_nvram = NULL;
8182   generic_nvram16 = NULL;
8283   generic_nvram32 = NULL;
84   generic_nvram64 = NULL;
8385
8486   /* reset memory card info */
8587   memcard_inserted = -1;
r4425r4426
241243      return generic_nvram16;
242244   if (generic_nvram32)
243245      return generic_nvram32;
246   if (generic_nvram64)
247      return generic_nvram64;
244248   fatalerror("generic nvram handler called without nvram in the memory map");
245249   return 0;
246250}
r4425r4426
373377      mame_fread(file, nvram_select(), generic_nvram_size);
374378   else
375379   {
376      UINT8 *nvram = nvram_select();
380      UINT8 *nvram = (UINT8 *)nvram_select();
377381      for (i = 0; i < generic_nvram_size; i++)
378382         nvram[i] = mame_rand(machine);
379383   }
r4425r4426
570574
571575static TIMER_CALLBACK( clear_all_lines )
572576{
573   const device_config *device = ptr;
577   const device_config *device = (const device_config *)ptr;
574578   int inputcount = cpu_get_input_lines(device);
575579   int line;
576580
r4425r4426
587591
588592static TIMER_CALLBACK( irq_pulse_clear )
589593{
590   const device_config *device = ptr;
594   const device_config *device = (const device_config *)ptr;
591595   int irqline = param;
592596   cpu_set_input_line(device, irqline, CLEAR_LINE);
593597}
r4425r4426
770774
771775CUSTOM_INPUT( custom_port_read )
772776{
773   const char *tag = param;
777   const char *tag = (const char *)param;
774778   return input_port_read(field->port->machine, tag);
775779}
src/emu/machine/x76f041.c
r4425r4426
115115
116116   if( data == NULL )
117117   {
118      data = auto_malloc(
118      data = (UINT8 *)auto_malloc(
119119         SIZE_RESPONSE_TO_RESET +
120120         SIZE_READ_PASSWORD +
121121         SIZE_WRITE_PASSWORD +
src/emu/machine/smc91c9x.c
r4425r4426
510510
511511static DEVICE_START( smc91c9x )
512512{
513   const smc91c9x_config *config = device->inline_config;
513   const smc91c9x_config *config = (const smc91c9x_config *)device->inline_config;
514514   smc91c9x_state *smc = get_safe_token(device);
515515
516516   /* validate some basic stuff */
src/emu/machine/generic.h
r4425r4426
4444extern UINT8 *generic_nvram;
4545extern UINT16 *generic_nvram16;
4646extern UINT32 *generic_nvram32;
47extern UINT64 *generic_nvram64;
4748
4849
49
5050/***************************************************************************
5151    FUNCTION PROTOTYPES
5252***************************************************************************/
src/emu/machine/8257dma.c
r4425r4426
153153
154154static TIMER_CALLBACK( dma8257_timerproc )
155155{
156   const device_config *device = ptr;
156   const device_config *device = (const device_config *)ptr;
157157   dma8257_t *dma8257 = get_safe_token(device);
158158   int i, channel = 0, rr;
159159   int done;
r4425r4426
186186
187187static TIMER_CALLBACK( dma8257_msbflip_timerproc )
188188{
189   const device_config *device = ptr;
189   const device_config *device = (const device_config *)ptr;
190190   dma8257_t *dma8257 = get_safe_token(device);
191191   dma8257->msb ^= 1;
192192}
r4425r4426
324324
325325static TIMER_CALLBACK( dma8257_drq_write_callback )
326326{
327   const device_config *device = ptr;
327   const device_config *device = (const device_config *)ptr;
328328   dma8257_t *dma8257 = get_safe_token(device);
329329   int channel = param >> 1;
330330   int state = param & 0x01;
r4425r4426
368368   assert(device->tag != NULL);
369369
370370   //dma8257->device_type = device_type;
371   dma8257->intf = device->static_config;
371   dma8257->intf = (dma8257_interface *)device->static_config;
372372
373373   dma8257->status = 0x0f;
374374   dma8257->timer = timer_alloc(device->machine, dma8257_timerproc, (void *) device);
src/emu/machine/z80pio.c
r4425r4426
540540
541541static DEVICE_START( z80pio )
542542{
543   const z80pio_interface *intf = device->static_config;
543   const z80pio_interface *intf = (const z80pio_interface *)device->static_config;
544544   z80pio_t *z80pio = get_safe_token( device );
545545
546546   z80pio->intr = intf->intr;
src/emu/machine/i2cmem.c
r4425r4426
8686
8787   if( data == NULL )
8888   {
89      data = auto_malloc( data_size );
89      data = (unsigned char *)auto_malloc( data_size );
9090   }
9191
9292   if( page_size > 0 )
9393   {
94      page = auto_malloc( page_size );
94      page = (unsigned char *)auto_malloc( page_size );
9595   }
9696
9797   c->slave_address = slave_address;
src/emu/machine/ldvp931.c
r4425r4426
321321
322322static TIMER_CALLBACK( vbi_data_fetch )
323323{
324   laserdisc_state *ld = ptr;
324   laserdisc_state *ld = (laserdisc_state *)ptr;
325325   ldplayer_data *player = ld->player;
326326   int which = param & 3;
327327   int line = param >> 2;
r4425r4426
364364
365365static TIMER_CALLBACK( deferred_data_w )
366366{
367   laserdisc_state *ld = ptr;
367   laserdisc_state *ld = (laserdisc_state *)ptr;
368368   ldplayer_data *player = ld->player;
369369
370370   /* set the value and mark it pending */
r4425r4426
389389
390390static TIMER_CALLBACK( irq_off )
391391{
392   laserdisc_state *ld = ptr;
392   laserdisc_state *ld = (laserdisc_state *)ptr;
393393   cpu_set_input_line(ld->player->cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
394394}
395395
r4425r4426
401401
402402static TIMER_CALLBACK( datastrobe_off )
403403{
404   laserdisc_state *ld = ptr;
404   laserdisc_state *ld = (laserdisc_state *)ptr;
405405   ld->player->datastrobe = 0;
406406}
407407
r4425r4426
412412
413413static TIMER_CALLBACK( erp_off )
414414{
415   laserdisc_state *ld = ptr;
415   laserdisc_state *ld = (laserdisc_state *)ptr;
416416   ld->player->daticerp = 0;
417417}
418418
r4425r4426
423423
424424static TIMER_DEVICE_CALLBACK( track_timer )
425425{
426   laserdisc_state *ld = ptr;
426   laserdisc_state *ld = (laserdisc_state *)ptr;
427427   ldplayer_data *player = ld->player;
428428
429429   /* advance by the count and toggle the state */
src/emu/machine/f3853.c
r4425r4426
8383
8484static TIMER_CALLBACK( f3853_timer_callback )
8585{
86   const device_config *device = ptr;
86   const device_config *device = (const device_config *)ptr;
8787   f3853_t   *f3853 = get_safe_token( device );
8888
8989    if (f3853->timer_enable)
r4425r4426
167167   UINT8 reg=0xfe;
168168   int i;
169169
170   f3853->config = device->static_config;
170   f3853->config = (const f3853_config *)device->static_config;
171171
172172   for (i=254/*known to get 0xfe after 255 cycles*/; i>=0; i--)
173173   {
src/emu/machine/6850acia.c
r4425r4426
3939   STOP2,
4040};
4141
42enum parity_type
42enum _parity_type
4343{
4444   NONE,
4545   ODD,
4646   EVEN
4747};
48typedef enum _parity_type parity_type;
4849
4950typedef struct _acia6850_t acia6850_t;
5051struct _acia6850_t
r4425r4426
8081
8182   /* TX/RX state */
8283   int   bits;
83   enum    parity_type parity;
84   parity_type parity;
8485   int   stopbits;
8586   int tx_int;
8687
r4425r4426
295296   wordsel = (data & CR4_2) >> 2;
296297
297298   acia_p->bits = ACIA6850_WORD[wordsel][0];
298   acia_p->parity = ACIA6850_WORD[wordsel][1];
299   acia_p->parity = (parity_type)ACIA6850_WORD[wordsel][1];
299300   acia_p->stopbits = ACIA6850_WORD[wordsel][2];
300301
301302   // Transmitter Control Bits
r4425r4426
565566
566567static TIMER_CALLBACK( transmit_event )
567568{
568   const device_config *device = ptr;
569   const device_config *device = (const device_config *)ptr;
569570   acia6850_t *acia_p = get_token(device);
570571   tx_tick(device);
571572   acia_p->tx_counter = 0;
r4425r4426
756757
757758static TIMER_CALLBACK( receive_event )
758759{
759   const device_config *device = ptr;
760   const device_config *device = (const device_config *)ptr;
760761   acia6850_t *acia_p = get_token(device);
761762   rx_tick(device);
762763   acia_p->rx_counter = 0;
src/emu/machine/6850acia.h
r4425r4426
6363
6464DEVICE_GET_INFO( acia6850 );
6565
66void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL;
67void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL;
66void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL(1);
67void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL(1);
6868
69void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL;
70void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL;
69void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL(1);
70void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL(1);
7171
7272WRITE8_DEVICE_HANDLER( acia6850_ctrl_w );
7373READ8_DEVICE_HANDLER( acia6850_stat_r );
src/emu/machine/wd33c93.c
r4425r4426
798798   /* allocate a timer for commands */
799799   scsi_data.cmd_timer = timer_alloc(machine, wd33c93_complete_cb, NULL);
800800
801   scsi_data.temp_input = auto_malloc( TEMP_INPUT_LEN );
801   scsi_data.temp_input = (UINT8 *)auto_malloc( TEMP_INPUT_LEN );
802802
803803//  state_save_register_item_array(machine, "wd33c93", NULL, 0, scsi_data);
804804}
src/emu/machine/pic8259.c
r4425r4426
8080
8181static TIMER_CALLBACK( pic8259_timerproc )
8282{
83   const device_config *device = ptr;
83   const device_config *device = (const device_config *)ptr;
8484   pic8259_t   *pic8259 = get_safe_token(device);
8585   int irq;
8686   UINT8 mask;
r4425r4426
394394static DEVICE_START( pic8259 ) {
395395   pic8259_t   *pic8259 = get_safe_token(device);
396396
397   pic8259->intf = device->static_config;
397   pic8259->intf = (const struct pic8259_interface *)device->static_config;
398398
399399   pic8259->timer = timer_alloc( device->machine, pic8259_timerproc, (void *)device );
400400}
src/emu/machine/ldcore.c
r4425r4426
197197   ldcore_data *ldcore = ld->core;
198198   if (ldcore->audiocustom != NULL)
199199   {
200      sound_token *token = ldcore->audiocustom->token;
200      sound_token *token = (sound_token *)ldcore->audiocustom->token;
201201      stream_update(token->stream);
202202   }
203203}
r4425r4426
290290
291291static void vblank_state_changed(const device_config *screen, void *param, int vblank_state)
292292{
293   const device_config *device = param;
293   const device_config *device = (const device_config *)param;
294294   laserdisc_state *ld = get_safe_token(device);
295295   ldcore_data *ldcore = ld->core;
296296   attotime curtime = timer_get_time(screen->machine);
r4425r4426
318318
319319static TIMER_CALLBACK( perform_player_update )
320320{
321   laserdisc_state *ld = ptr;
321   laserdisc_state *ld = (laserdisc_state *)ptr;
322322   ldcore_data *ldcore = ld->core;
323323   attotime curtime = timer_get_time(machine);
324324
r4425r4426
940940
941941static DEVICE_START( laserdisc_sound )
942942{
943   sound_token *token = device->token;
943   sound_token *token = (sound_token *)device->token;
944944   token->stream = stream_create(device, 0, 2, 48000, token, custom_stream_callback);
945945   token->ld = NULL;
946946}
r4425r4426
975975
976976static STREAM_UPDATE( custom_stream_callback )
977977{
978   sound_token *token = param;
978   sound_token *token = (sound_token *)param;
979979   laserdisc_state *ld = token->ld;
980980   ldcore_data *ldcore = ld->core;
981981   stream_sample_t *dst0 = outputs[0];
r4425r4426
11031103   /* iterate over disc devices */
11041104   for (device = device_list_first(machine->config->devicelist, LASERDISC); device != NULL; device = device_list_next(device, LASERDISC))
11051105   {
1106      laserdisc_config *origconfig = device->inline_config;
1106      laserdisc_config *origconfig = (laserdisc_config *)device->inline_config;
11071107      laserdisc_state *ld = get_safe_token(device);
11081108      ldcore_data *ldcore = ld->core;
11091109      xml_data_node *overnode;
r4425r4426
11951195   if (laserdisc != NULL)
11961196   {
11971197      const rectangle *visarea = video_screen_get_visible_area(screen);
1198      laserdisc_state *ld = laserdisc->token;
1198      laserdisc_state *ld = (laserdisc_state *)laserdisc->token;
11991199      ldcore_data *ldcore = ld->core;
12001200      bitmap_t *overbitmap = ldcore->overbitmap[ldcore->overindex];
12011201      bitmap_t *vidbitmap = NULL;
r4425r4426
12991299
13001300static void init_disc(const device_config *device)
13011301{
1302   const laserdisc_config *config = device->inline_config;
1302   const laserdisc_config *config = (const laserdisc_config *)device->inline_config;
13031303   laserdisc_state *ld = get_safe_token(device);
13041304   ldcore_data *ldcore = ld->core;
13051305   chd_error err;
r4425r4426
13491349      ldcore->chdtracks = totalhunks / 2;
13501350
13511351      /* allocate memory for the precomputed per-frame metadata */
1352      ldcore->vbidata = auto_malloc(totalhunks * VBI_PACKED_BYTES);
1352      ldcore->vbidata = (UINT8 *)auto_malloc(totalhunks * VBI_PACKED_BYTES);
13531353      err = chd_get_metadata(ldcore->disc, AV_LD_METADATA_TAG, 0, ldcore->vbidata, totalhunks * VBI_PACKED_BYTES, &vbilength, NULL, NULL);
13541354      if (err != CHDERR_NONE || vbilength != totalhunks * VBI_PACKED_BYTES)
13551355         fatalerror("Precomputed VBI metadata missing or incorrect size");
r4425r4426
13821382      fillbitmap_yuy16(frame->bitmap, 40, 109, 240);
13831383
13841384      /* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */
1385      frame->visbitmap = auto_malloc(sizeof(*frame->visbitmap));
1385      frame->visbitmap = (bitmap_t *)auto_malloc(sizeof(*frame->visbitmap));
13861386      *frame->visbitmap = *frame->bitmap;
13871387      frame->visbitmap->base = BITMAP_ADDR16(frame->visbitmap, 44, frame->bitmap->width * 8 / 720);
13881388      frame->visbitmap->height -= 44;
r4425r4426
14101410   if (ldcore->config.overwidth > 0 && ldcore->config.overheight > 0 && ldcore->config.overupdate != NULL)
14111411   {
14121412      ldcore->overenable = TRUE;
1413      ldcore->overbitmap[0] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, ldcore->config.overformat);
1414      ldcore->overbitmap[1] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, ldcore->config.overformat);
1413      ldcore->overbitmap[0] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
1414      ldcore->overbitmap[1] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
14151415      ldcore->overtex = render_texture_alloc(NULL, NULL);
14161416      if (ldcore->overtex == NULL)
14171417         fatalerror("Out of memory allocating overlay texture");
r4425r4426
14351435   /* allocate audio buffers */
14361436   ldcore->audiomaxsamples = ((UINT64)ldcore->samplerate * 1000000 + ldcore->fps_times_1million - 1) / ldcore->fps_times_1million;
14371437   ldcore->audiobufsize = ldcore->audiomaxsamples * 4;
1438   ldcore->audiobuffer[0] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[0][0]));
1439   ldcore->audiobuffer[1] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[1][0]));
1438   ldcore->audiobuffer[0] = (INT16 *)auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[0][0]));
1439   ldcore->audiobuffer[1] = (INT16 *)auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[1][0]));
14401440}
14411441
14421442
r4425r4426
14511451
14521452static DEVICE_START( laserdisc )
14531453{
1454   const laserdisc_config *config = device->inline_config;
1454   const laserdisc_config *config = (const laserdisc_config *)device->inline_config;
14551455   laserdisc_state *ld = get_safe_token(device);
14561456   ldcore_data *ldcore;
14571457   int statesize;
r4425r4426
14701470   ld->device = device;
14711471
14721472   /* allocate memory for the core state */
1473   ld->core = auto_malloc(sizeof(*ld->core));
1473   ld->core = (ldcore_data *)auto_malloc(sizeof(*ld->core));
14741474   memset(ld->core, 0, sizeof(*ld->core));
14751475   ldcore = ld->core;
14761476
r4425r4426
14781478   statesize = 0;
14791479   for (index = 0; index < ARRAY_LENGTH(player_interfaces); index++)
14801480      statesize = MAX(statesize, player_interfaces[index]->statesize);
1481   ld->player = auto_malloc(statesize);
1481   ld->player = (ldplayer_data *)auto_malloc(statesize);
14821482   memset(ld->player, 0, statesize);
14831483
14841484   /* copy config data to the live state */
r4425r4426
15491549   /* attempt to wire up the audio */
15501550   if (ldcore->audiocustom != NULL)
15511551   {
1552      sound_token *token = ldcore->audiocustom->token;
1552      sound_token *token = (sound_token *)ldcore->audiocustom->token;
15531553      token->ld = ld;
15541554      stream_set_sample_rate(token->stream, ldcore->samplerate);
15551555   }
r4425r4426
16081608   /* if we have a device, figure out where our config lives */
16091609   if (device != NULL)
16101610   {
1611      laserdisc_state *ld = device->token;
1612      config = device->inline_config;
1611      laserdisc_state *ld = (laserdisc_state *)device->token;
1612      config = (const laserdisc_config *)device->inline_config;
16131613      if (ld != NULL && ld->core != NULL)
16141614      {
16151615         config = &ld->core->config;
src/emu/machine/intelfsh.c
r4425r4426
5050
5151static TIMER_CALLBACK( erase_finished )
5252{
53   struct flash_chip *c = ptr;
53   struct flash_chip *c = (struct flash_chip *)ptr;
5454
5555   switch( c->flash_mode )
5656   {
r4425r4426
9898      c->device_id = 0xaa;
9999      break;
100100   case FLASH_SHARP_LH28F400:
101   case FLASH_INTEL_E28F400:
101102      c->bits = 16;
102103      c->size = 0x80000;
103104      c->maker_id = 0xb0;
r4425r4426
159160      {
160161      case 8:
161162         {
162            UINT8 *flash_memory = c->flash_memory;
163            UINT8 *flash_memory = (UINT8 *)c->flash_memory;
163164            data = flash_memory[ address ];
164165         }
165166         break;
166167      case 16:
167168         {
168            UINT16 *flash_memory = c->flash_memory;
169            UINT16 *flash_memory = (UINT16 *)c->flash_memory;
169170            data = flash_memory[ address ];
170171         }
171172         break;
r4425r4426
345346         {
346347         case 8:
347348            {
348               UINT8 *flash_memory = c->flash_memory;
349               UINT8 *flash_memory = (UINT8 *)c->flash_memory;
349350               memset( &flash_memory[ address & ~0xffff ], 0xff, 64 * 1024 );
350351            }
351352            break;
352353         case 16:
353354            {
354               UINT16 *flash_memory = c->flash_memory;
355               UINT16 *flash_memory = (UINT16 *)c->flash_memory;
355356               memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 );
356357            }
357358            break;
r4425r4426
372373      {
373374      case 8:
374375         {
375            UINT8 *flash_memory = c->flash_memory;
376            UINT8 *flash_memory = (UINT8 *)c->flash_memory;
376377            flash_memory[ address ] = data;
377378         }
378379         break;
r4425r4426
387388      {
388389      case 8:
389390         {
390            UINT8 *flash_memory = c->flash_memory;
391            UINT8 *flash_memory = (UINT8 *)c->flash_memory;
391392            flash_memory[ address ] = data;
392393         }
393394         break;
394395      case 16:
395396         {
396            UINT16 *flash_memory = c->flash_memory;
397            UINT16 *flash_memory = (UINT16 *)c->flash_memory;
397398            flash_memory[ address ] = data;
398399         }
399400         break;
r4425r4426
412413         {
413414         case 8:
414415            {
415               UINT8 *flash_memory = c->flash_memory;
416               UINT8 *flash_memory = (UINT8 *)c->flash_memory;
416417               memset( &flash_memory[ address & ~0xffff ], 0xff, 64 * 1024 );
417418            }
418419            break;
419420         case 16:
420421            {
421               UINT16 *flash_memory = c->flash_memory;
422               UINT16 *flash_memory = (UINT16 *)c->flash_memory;
422423               memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 );
423424            }
424425            break;
src/emu/machine/ldcore.h
r4425r4426
137137typedef void (*laserdisc_vsync_func)(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
138138typedef INT32 (*laserdisc_update_func)(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
139139typedef void (*laserdisc_overlay_func)(laserdisc_state *ld, bitmap_t *bitmap);
140typedef void (*laserdisc_w_func)(laserdisc_state *ld, UINT8 prev, UINT8 new);
140typedef void (*laserdisc_w_func)(laserdisc_state *ld, UINT8 prev, UINT8 newval);
141141typedef UINT8 (*laserdisc_r_func)(laserdisc_state *ld);
142142
143143
src/emu/machine/x2212.c
r4425r4426
8888   assert(device->machine != NULL);
8989   assert(device->machine->config != NULL);
9090
91   c->sram = auto_malloc( SIZE_DATA );
92   c->e2prom = auto_malloc( SIZE_DATA );
91   c->sram = (UINT8 *)auto_malloc( SIZE_DATA );
92   c->e2prom = (UINT8 *)auto_malloc( SIZE_DATA );
9393   c->store = 1;
9494   c->array_recall = 1;
9595
96   config = device->static_config;
96   config = (const x2212_config *)device->static_config;
9797   if( config != NULL && config->data != NULL )
9898   {
9999      c->default_data = memory_region( device->machine, config->data );
src/emu/machine/intelfsh.h
r4425r4426
1313#define FLASH_INTEL_E28F008SA ( 3 )
1414#define FLASH_INTEL_TE28F160 ( 4 )
1515#define FLASH_SHARP_LH28F016S ( 5 )
16#define FLASH_INTEL_E28F400 ( 6 )
1617
1718extern void intelflash_init( running_machine *machine, int chip, int type, void *data );
1819extern UINT32 intelflash_read( int chip, UINT32 address );
src/emu/machine/at28c16.c
r4425r4426
137137   assert(device->machine != NULL);
138138   assert(device->machine->config != NULL);
139139
140   c->data = auto_malloc( SIZE_DATA );
141   c->id = auto_malloc( SIZE_ID );
140   c->data = (UINT8 *)auto_malloc( SIZE_DATA );
141   c->id = (UINT8 *)auto_malloc( SIZE_ID );
142142   c->a9_12v = 0;
143143   c->oe_12v = 0;
144144   c->last_write = -1;
145145   c->write_timer = timer_alloc(device->machine,  write_finished, c );
146146   c->default_data = device->region;
147147
148   config = device->inline_config;
148   config = (const at28c16_config *)device->inline_config;
149149   if (config->id != NULL)
150150      c->default_id = memory_region( device->machine, config->id );
151151
src/emu/machine/latch8.c
r4425r4426
5151
5252static TIMER_CALLBACK( latch8_timerproc )
5353{
54   const device_config *device = ptr;
54   const device_config *device = (const device_config *)ptr;
5555   UINT8 new_val = param & 0xFF;
5656   UINT8 mask = param >> 8;
5757
r4425r4426
9696      }
9797   }
9898
99   return (res & ~latch8->intf->maskout) ^ latch8->intf->xor;
99   return (res & ~latch8->intf->maskout) ^ latch8->intf->xorvalue;
100100}
101101
102102
r4425r4426
188188   int i;
189189
190190   /* validate arguments */
191   latch8->intf = device->inline_config;
191   latch8->intf = (latch8_config *)device->inline_config;
192192
193193   latch8->value = 0x0;
194194
src/emu/machine/8237dma.c
r4425r4426
114114
115115static TIMER_CALLBACK( dma8237_timerproc )
116116{
117   const device_config *device = ptr;
117   const device_config *device = (const device_config *)ptr;
118118   dma8237_t   *dma8237 = get_safe_token(device);
119119   int channel = param % 4;
120120   int done;
r4425r4426
134134
135135static TIMER_CALLBACK( dma8237_msbflip_timerproc )
136136{
137   const device_config *device = ptr;
137   const device_config *device = (const device_config *)ptr;
138138   dma8237_t   *dma8237 = get_safe_token(device);
139139   dma8237->msb ^= 1;
140140}
r4425r4426
394394static DEVICE_START( dma8237 ) {
395395   dma8237_t   *dma8237 = get_safe_token(device);
396396
397   dma8237->intf = device->static_config;
397   dma8237->intf = (struct dma8237_interface *)device->static_config;
398398}
399399
400400
src/emu/machine/cdp1852.c
r4425r4426
7575
7676static TIMER_CALLBACK( cdp1852_scan_tick )
7777{
78   const device_config *device = ptr;
78   const device_config *device = (const device_config *)ptr;
7979   cdp1852_t *cdp1852 = get_safe_token(device);
8080
8181   switch (cdp1852->mode)
r4425r4426
161161   devcb_resolve_write_line(&cdp1852->out_sr_func, &intf->out_sr_func, device);
162162
163163   /* set initial values */
164   cdp1852->mode = intf->mode;
164   cdp1852->mode = (cdp1852_mode)intf->mode;
165165
166166   if (device->clock > 0)
167167   {
src/emu/machine/latch8.h
r4425r4426
3636{
3737   /* only for byte reads, does not affect bit reads and node_map */
3838   UINT32               maskout;
39   UINT32               xor;  /* after mask */
39   UINT32               xorvalue;  /* after mask */
4040   UINT32               nosync;
4141   UINT32               node_map[8];
4242   const char *         node_device[8];
r4425r4426
5757
5858/* Bit mask specifying bits to be inverted */
5959#define MDRV_LATCH8_INVERT(_xor) \
60   MDRV_DEVICE_CONFIG_DATA32(latch8_config, xor, _xor)
60   MDRV_DEVICE_CONFIG_DATA32(latch8_config, xorvalue, _xor)
6161
6262/* Bit mask specifying bits not needing cpu synchronization. */
6363#define MDRV_LATCH8_NOSYNC(_nosync) \
src/emu/machine/cdp1852.h
r4425r4426
4949    TYPE DEFINITIONS
5050***************************************************************************/
5151
52typedef enum _cdp1852_mode cdp1852_mode;
5352enum _cdp1852_mode {
5453   CDP1852_MODE_INPUT = 0,
5554   CDP1852_MODE_OUTPUT
5655};
56typedef enum _cdp1852_mode cdp1852_mode;
5757
5858typedef struct _cdp1852_interface cdp1852_interface;
5959struct _cdp1852_interface
src/emu/machine/z80sio.c
r4425r4426
524524
525525static TIMER_CALLBACK( change_input_line )
526526{
527   const device_config *device = ptr;
527   const device_config *device = (const device_config *)ptr;
528528   z80sio *sio = get_safe_token(device);
529529   sio_channel *chan = &sio->chan[param & 1];
530530   UINT8 line = (param >> 8) & 0xff;
r4425r4426
607607
608608static TIMER_CALLBACK( serial_callback )
609609{
610   const device_config *device = ptr;
610   const device_config *device = (const device_config *)ptr;
611611   z80sio *sio = get_safe_token(device);
612612   sio_channel *chan = &sio->chan[param];
613613   int ch = param;
r4425r4426
782782
783783static DEVICE_START( z80sio )
784784{
785   const z80sio_interface *intf = device->static_config;
785   const z80sio_interface *intf = (const z80sio_interface *)device->static_config;
786786   astring *tempstring = astring_alloc();
787787   z80sio *sio = get_safe_token(device);
788788   void *ptr = (void *)device;
src/emu/machine/z80ctc.c
r4425r4426
138138
139139static TIMER_CALLBACK( timercallback )
140140{
141   const device_config *device = ptr;
141   const device_config *device = (const device_config *)ptr;
142142   z80ctc *ctc = get_safe_token(device);
143143   ctc_channel *channel = &ctc->channel[param];
144144
r4425r4426
461461
462462static DEVICE_START( z80ctc )
463463{
464   const z80ctc_interface *intf = device->static_config;
464   const z80ctc_interface *intf = (const z80ctc_interface *)device->static_config;
465465   astring *tempstring = astring_alloc();
466466   z80ctc *ctc = get_safe_token(device);
467467   int ch;
src/emu/machine/pci.c
r4425r4426
211211   assert(device->machine->config != NULL);
212212
213213   /* store a pointer back to the device */
214   pcibus->config = device->inline_config;
214   pcibus->config = (const pci_bus_config *)device->inline_config;
215215   pcibus->busdevice = device;
216216   pcibus->devicenum = -1;
217217
src/emu/machine/pit8253.c
r4425r4426
657657
658658static TIMER_CALLBACK( update_timer_cb )
659659{
660   const device_config *device = ptr;
660   const device_config *device = (const device_config *)ptr;
661661   pit8253_t   *pit8253 = get_safe_token(device);
662662   struct pit8253_timer *timer = get_timer(pit8253,param);
663663
r4425r4426
10421042   pit8253_t   *pit8253 = get_safe_token(device);
10431043   int         timerno;
10441044
1045   pit8253->config = device->static_config;
1045   pit8253->config = (const struct pit8253_config *)device->static_config;
10461046   pit8253->device_type = device_type;
10471047
10481048   /* register for state saving */
src/emu/machine/ldv1000.c
r4425r4426
333333
334334static TIMER_CALLBACK( vsync_off )
335335{
336   laserdisc_state *ld = ptr;
336   laserdisc_state *ld = (laserdisc_state *)ptr;
337337   ld->player->vsync = FALSE;
338338}
339339
r4425r4426
347347
348348static TIMER_CALLBACK( vbi_data_fetch )
349349{
350   laserdisc_state *ld = ptr;
350   laserdisc_state *ld = (laserdisc_state *)ptr;
351351   ldplayer_data *player = ld->player;
352352   UINT8 focus_on = !(player->portb1 & 0x01);
353353   UINT8 laser_on = (player->portb1 & 0x40);
r4425r4426
398398
399399static TIMER_DEVICE_CALLBACK( multijump_timer )
400400{
401   laserdisc_state *ld = ptr;
401   laserdisc_state *ld = (laserdisc_state *)ptr;
402402   ldplayer_data *player = ld->player;
403403   int direction;
404404
src/emu/machine/mc146818.c
r4425r4426
199199
200200void mc146818_init(running_machine *machine, MC146818_TYPE type)
201201{
202   mc146818 = auto_malloc(sizeof(*mc146818));
202   mc146818 = (struct mc146818_chip *)auto_malloc(sizeof(*mc146818));
203203   memset(mc146818, 0, sizeof(*mc146818));
204204   mc146818->type = type;
205205   mc146818->last_refresh = timer_get_time(machine);
src/emu/inptport.h
r4425r4426
5959   SEQ_TYPE_TOTAL
6060};
6161typedef enum _input_seq_type input_seq_type;
62DECLARE_ENUM_OPERATORS(input_seq_type)
6263
6364
6465/* conditions for DIP switches */
src/emu/rendutil.c
r4425r4426
8383
8484   /* if the source is higher res than the target, use full averaging */
8585   if (dx > 0x1000 || dy > 0x1000)
86      resample_argb_bitmap_average(dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy);
86      resample_argb_bitmap_average((UINT32 *)dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy);
8787   else
88      resample_argb_bitmap_bilinear(dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy);
88      resample_argb_bitmap_bilinear((UINT32 *)dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy);
8989}
9090
9191
src/emu/cpuexec.c
r4425r4426
223223   attotime min_quantum;
224224
225225   /* allocate global state */
226   machine->cpuexec_data = auto_malloc(sizeof(*machine->cpuexec_data));
226   machine->cpuexec_data = (cpuexec_private *)auto_malloc(sizeof(*machine->cpuexec_data));
227227   memset(machine->cpuexec_data, 0, sizeof(*machine->cpuexec_data));
228228
229229   /* set the core scheduling quantum */
r4425r4426
457457   assert(device->machine->config != NULL);
458458
459459   /* get pointers to our data */
460   config = device->inline_config;
460   config = (const cpu_config *)device->inline_config;
461461   header = cpu_get_class_header(device);
462462   classdata = get_class_data(device);
463463
r4425r4426
553553static DEVICE_RESET( cpu )
554554{
555555   cpu_class_data *classdata = get_class_data(device);
556   const cpu_config *config = device->inline_config;
556   const cpu_config *config = (const cpu_config *)device->inline_config;
557557   cpu_reset_func reset;
558558   int line;
559559
r4425r4426
685685
686686DEVICE_GET_INFO( cpu )
687687{
688   const cpu_config *config = (device != NULL) ? device->inline_config : NULL;
688   const cpu_config *config = (device != NULL) ? (const cpu_config *)device->inline_config : NULL;
689689   cpuinfo cinfo = { 0 };
690690
691691   switch (state)
r4425r4426
13631363      /* find any CPUs that have this screen as their VBLANK interrupt source */
13641364      for (cpu = device->machine->cpu[0]; cpu != NULL; cpu = cpu->typenext)
13651365      {
1366         const cpu_config *config = cpu->inline_config;
1366         const cpu_config *config = (const cpu_config *)cpu->inline_config;
13671367         cpu_class_data *classdata = get_class_data(cpu);
13681368         int cpu_interested;
13691369
r4425r4426
14101410
14111411static TIMER_CALLBACK( trigger_partial_frame_interrupt )
14121412{
1413   const device_config *device = ptr;
1414   const cpu_config *config = device->inline_config;
1413   const device_config *device = (const device_config *)ptr;
1414   const cpu_config *config = (const cpu_config *)device->inline_config;
14151415   cpu_class_data *classdata = get_class_data(device);
14161416
14171417   if (classdata->iloops == 0)
r4425r4426
14361436
14371437static TIMER_CALLBACK( trigger_periodic_interrupt )
14381438{
1439   const device_config *device = ptr;
1440   const cpu_config *config = device->inline_config;
1439   const device_config *device = (const device_config *)ptr;
1440   const cpu_config *config = (const cpu_config *)device->inline_config;
14411441
14421442   /* bail if there is no routine */
14431443   if (config->timed_interrupt != NULL && !cpu_is_suspended(device, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
r4425r4426
14621462
14631463static TIMER_CALLBACK( empty_event_queue )
14641464{
1465   const device_config *device = ptr;
1465   const device_config *device = (const device_config *)ptr;
14661466   cpu_class_data *classdata = get_class_data(device);
14671467   cpu_input_data *inputline = &classdata->input[param];
14681468   int curevent;
src/emu/mamecore.h
r4425r4426
174174    COMMON MACROS
175175***************************************************************************/
176176
177/* Macro for declaring enumerator operators for easier porting */
178#ifdef __cplusplus
179#define DECLARE_ENUM_OPERATORS(type) \
180inline void operator++(type &value) { value = (type)((int)value + 1); } \
181inline void operator++(type &value, int) { value = (type)((int)value + 1); } \
182inline void operator--(type &value) { value = (type)((int)value - 1); } \
183inline void operator--(type &value, int) { value = (type)((int)value - 1); }
184#else
185#define DECLARE_ENUM_OPERATORS(type)
186#endif
187
188
177189/* Standard MAME assertion macros */
178190#undef assert
179191#undef assert_always
r4425r4426
182194#define assert(x)   do { if (!(x)) fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
183195#define assert_always(x, msg) do { if (!(x)) fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
184196#else
185#define assert(x)
197#define assert(x)   do { } while (0)
186198#define assert_always(x, msg) do { if (!(x)) fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0)
187199#endif
188200
src/emu/rendlay.c
r4425r4426
217217
218218INLINE const char *copy_string(const char *string)
219219{
220   char *newstring = malloc_or_die(strlen(string) + 1);
220   char *newstring = (char *)malloc_or_die(strlen(string) + 1);
221221   strcpy(newstring, string);
222222   return newstring;
223223}
r4425r4426
348348
349349static void layout_element_scale(bitmap_t *dest, const bitmap_t *source, const rectangle *sbounds, void *param)
350350{
351   element_texture *elemtex = param;
351   element_texture *elemtex = (element_texture *)param;
352352   element_component *component;
353353
354354   /* iterate over components that are part of the current state */
r4425r4426
13401340   for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
13411341   {
13421342      int scrnum = device_list_index(config->devicelist, VIDEO_SCREEN, device->tag);
1343      const screen_config *scrconfig = device->inline_config;
1343      const screen_config *scrconfig = (const screen_config *)device->inline_config;
13441344
13451345      /* native X aspect factor */
13461346      sprintf(temp, "~scr%dnativexaspect~", scrnum);
r4425r4426
15091509      return NULL;
15101510
15111511   /* allocate the layout group object first */
1512   file = malloc_or_die(sizeof(*file));
1512   file = (layout_file *)malloc_or_die(sizeof(*file));
15131513   memset(file, 0, sizeof(*file));
15141514
15151515   /* find the layout node */
r4425r4426
15791579   int first;
15801580
15811581   /* allocate a new element */
1582   element = malloc_or_die(sizeof(*element));
1582   element = (layout_element *)malloc_or_die(sizeof(*element));
15831583   memset(element, 0, sizeof(*element));
15841584
15851585   /* extract the name */
r4425r4426
16421642   }
16431643
16441644   /* allocate an array of element textures for the states */
1645   element->elemtex = malloc_or_die((element->maxstate + 1) * sizeof(element->elemtex[0]));
1645   element->elemtex = (element_texture *)malloc_or_die((element->maxstate + 1) * sizeof(element->elemtex[0]));
16461646   for (state = 0; state <= element->maxstate; state++)
16471647   {
16481648      element->elemtex[state].element = element;
r4425r4426
16681668   element_component *component;
16691669
16701670   /* allocate memory for the component */
1671   component = malloc_or_die(sizeof(*component));
1671   component = (element_component *)malloc_or_die(sizeof(*component));
16721672   memset(component, 0, sizeof(*component));
16731673
16741674   /* fetch common data */
r4425r4426
16991699
17001700      /* allocate a copy of the string */
17011701      component->type = COMPONENT_TYPE_TEXT;
1702      string = malloc_or_die(strlen(text) + 1);
1702      string = (char *)malloc_or_die(strlen(text) + 1);
17031703      strcpy(string, text);
17041704      component->string = string;
17051705   }
r4425r4426
17561756   int layer;
17571757
17581758   /* first allocate memory */
1759   view = malloc_or_die(sizeof(*view));
1759   view = (layout_view *)malloc_or_die(sizeof(*view));
17601760   memset(view, 0, sizeof(*view));
17611761
17621762   /* allocate a copy of the name */
r4425r4426
18101810   const char *name;
18111811
18121812   /* allocate a new item */
1813   item = malloc_or_die(sizeof(*item));
1813   item = (view_item *)malloc_or_die(sizeof(*item));
18141814   memset(item, 0, sizeof(*item));
18151815
18161816   /* allocate a copy of the output name */
src/emu/output.c
r4425r4426
7878
7979INLINE const char *copy_string(const char *string)
8080{
81   char *newstring = malloc_or_die(strlen(string) + 1);
81   char *newstring = (char *)malloc_or_die(strlen(string) + 1);
8282   strcpy(newstring, string);
8383   return newstring;
8484}
r4425r4426
118118
119119INLINE output_item *create_new_item(const char *outname, INT32 value)
120120{
121   output_item *item = malloc_or_die(sizeof(*item));
121   output_item *item = (output_item *)malloc_or_die(sizeof(*item));
122122   UINT32 hash = get_hash(outname);
123123
124124   /* fill in the data */
r4425r4426
343343   /* find the end of the list and add to it */
344344   while (*headptr != NULL)
345345      headptr = &(*headptr)->next;
346   *headptr = malloc_or_die(sizeof(**headptr));
346   *headptr = (output_notify *)malloc_or_die(sizeof(**headptr));
347347
348348   /* fill in the new record */
349349   (*headptr)->next = NULL;
src/emu/sound/cdp1869.c
r4425r4426
157157
158158static TIMER_CALLBACK( prd_changed_tick )
159159{
160   const device_config *device = ptr;
160   const device_config *device = (const device_config *)ptr;
161161   cdp1869_t *cdp1869 = get_safe_token(device);
162162
163163   devcb_call_write_line(&cdp1869->out_prd_func, param);
r4425r4426
171171
172172static STATE_POSTLOAD( cdp1869_state_save_postload )
173173{
174   update_prd_changed_timer(param);
174   update_prd_changed_timer((cdp1869_t *)param);
175175}
176176
177177/*-------------------------------------------------
r4425r4426
783783
784784static STREAM_UPDATE( cdp1869_stream_update )
785785{
786   cdp1869_t *cdp1869 = param;
786   cdp1869_t *cdp1869 = (cdp1869_t *)param;
787787   INT16 signal = cdp1869->signal;
788788   stream_sample_t *buffer = outputs[0];
789789
r4425r4426
847847   cdp1869_t *cdp1869 = get_safe_token(device);
848848
849849   /* validate arguments */
850   cdp1869->intf = device->static_config;
850   cdp1869->intf = (const cdp1869_interface *)device->static_config;
851851
852852   assert(cdp1869->intf->page_ram_r != NULL);
853853   assert(cdp1869->intf->pcb_r != NULL);
src/emu/sound/sp0256.c
r4425r4426
11051105
11061106static STREAM_UPDATE( sp0256_update )
11071107{
1108   sp0256_state *sp = param;
1108   sp0256_state *sp = (sp0256_state *)param;
11091109   stream_sample_t *output = outputs[0];
11101110   int output_index = 0;
11111111   int length, did_samp, old_idx;
r4425r4426
11821182
11831183static DEVICE_START( sp0256 )
11841184{
1185   const sp0256_interface *intf = device->static_config;
1185   const sp0256_interface *intf = (const sp0256_interface *)device->static_config;
11861186   sp0256_state *sp = get_safe_token(device);
11871187
11881188   sp->device = device;
r4425r4426
12011201    /* -------------------------------------------------------------------- */
12021202    /*  Allocate a scratch buffer for generating ~10kHz samples.             */
12031203    /* -------------------------------------------------------------------- */
1204    sp->scratch = malloc_or_die(SCBUF_SIZE * sizeof(INT16));
1204    sp->scratch = (INT16 *)malloc_or_die(SCBUF_SIZE * sizeof(INT16));
12051205    sp->sc_head = sp->sc_tail = 0;
12061206
12071207    /* -------------------------------------------------------------------- */
src/emu/sound/ym2413.c
r4425r4426
11981198      /* we never reach zero here due to ((i*2)+1) */
11991199
12001200      if (m>0.0)
1201         o = 8*log(1.0/m)/log(2);   /* convert to 'decibels' */
1201         o = 8*log(1.0/m)/log(2.0);   /* convert to 'decibels' */
12021202      else
1203         o = 8*log(-1.0/m)/log(2);   /* convert to 'decibels' */
1203         o = 8*log(-1.0/m)/log(2.0);   /* convert to 'decibels' */
12041204
12051205      o = o / (ENV_STEP/4);
12061206
r4425r4426
20122012   state_size  = sizeof(YM2413);
20132013
20142014   /* allocate memory block */
2015   ptr = malloc(state_size);
2015   ptr = (char *)malloc(state_size);
20162016
20172017   if (ptr==NULL)
20182018      return NULL;
r4425r4426
20842084
20852085void ym2413_shutdown(void *chip)
20862086{
2087   YM2413 *OPLL = chip;
2087   YM2413 *OPLL = (YM2413 *)chip;
20882088
20892089   /* emulator shutdown */
20902090   OPLLDestroy(OPLL);
r4425r4426
20922092
20932093void ym2413_reset_chip(void *chip)
20942094{
2095   YM2413 *OPLL = chip;
2095   YM2413 *OPLL = (YM2413 *)chip;
20962096   OPLLResetChip(OPLL);
20972097}
20982098
20992099void ym2413_write(void *chip, int a, int v)
21002100{
2101   YM2413 *OPLL = chip;
2101   YM2413 *OPLL = (YM2413 *)chip;
21022102   OPLLWrite(OPLL, a, v);
21032103}
21042104
21052105unsigned char ym2413_read(void *chip, int a)
21062106{
2107   YM2413 *OPLL = chip;
2107   YM2413 *OPLL = (YM2413 *)chip;
21082108   return OPLLRead(OPLL, a) & 0x03 ;
21092109}
21102110
21112111void ym2413_set_update_handler(void *chip,OPLL_UPDATEHANDLER UpdateHandler,void *param)
21122112{
2113   YM2413 *OPLL = chip;
2113   YM2413 *OPLL = (YM2413 *)chip;
21142114   OPLLSetUpdateHandler(OPLL, UpdateHandler, param);
21152115}
21162116
r4425r4426
21242124*/
21252125void ym2413_update_one(void *_chip, SAMP **buffers, int length)
21262126{
2127   YM2413      *chip  = _chip;
2127   YM2413      *chip  = (YM2413 *)_chip;
21282128   UINT8      rhythm = chip->rhythm&0x20;
21292129   SAMP      *bufMO = buffers[0];
21302130   SAMP      *bufRO = buffers[1];
src/emu/sound/hc55516.c
r4425r4426
7070   hc55516_state *chip = get_safe_token(device);
7171
7272   /* compute the fixed charge, decay, and leak time constants */
73   charge = pow(exp(-1), 1.0 / (FILTER_CHARGE_TC * 16000.0));
74   decay = pow(exp(-1), 1.0 / (FILTER_DECAY_TC * 16000.0));
75   leak = pow(exp(-1), 1.0 / (INTEGRATOR_LEAK_TC * 16000.0));
73   charge = pow(exp(-1.0), 1.0 / (FILTER_CHARGE_TC * 16000.0));
74   decay = pow(exp(-1.0), 1.0 / (FILTER_DECAY_TC * 16000.0));
75   leak = pow(exp(-1.0), 1.0 / (INTEGRATOR_LEAK_TC * 16000.0));
7676
7777   chip->clock = device->clock;
7878   chip->shiftreg_mask = _shiftreg_mask;
r4425r4426
189189
190190static STREAM_UPDATE( hc55516_update )
191191{
192   hc55516_state *chip = param;
192   hc55516_state *chip = (hc55516_state *)param;
193193   stream_sample_t *buffer = outputs[0];
194194   int i;
195195   INT32 sample, slope;
src/emu/sound/cdp1869.h
r4425r4426
114114typedef void (*cdp1869_page_ram_write_func)(const device_config *device, UINT16 pma, UINT8 data);
115115typedef int (*cdp1869_pcb_read_func)(const device_config *device, UINT16 pma, UINT8 cma);
116116
117typedef enum _cdp1869_format cdp1869_format;
118117enum _cdp1869_format {
119118   CDP1869_NTSC = 0,
120119   CDP1869_PAL
121120};
121typedef enum _cdp1869_format cdp1869_format;
122122
123123/* interface */
124124typedef struct _cdp1869_interface cdp1869_interface;
src/emu/sound/iremga20.c
r4425r4426
6969
7070static STREAM_UPDATE( IremGA20_update )
7171{
72   ga20_state *chip = param;
72   ga20_state *chip = (ga20_state *)param;
7373   UINT32 rate[4], pos[4], frac[4], end[4], vol[4], play[4];
7474   UINT8 *pSamples;
7575   stream_sample_t *outL, *outR;
src/emu/sound/tms5110.c
r4425r4426
157157
158158void tms5110_set_variant(void *chip, int variant)
159159{
160   struct tms5110 *tms = chip;
160   struct tms5110 *tms = (struct tms5110 *)chip;
161161
162162   switch (variant)
163163   {
r4425r4426
181181{
182182   struct tms5110 *tms;
183183
184   tms = malloc_or_die(sizeof(*tms));
184   tms = (struct tms5110 *)malloc_or_die(sizeof(*tms));
185185   memset(tms, 0, sizeof(*tms));
186186
187187   tms->device = device;
r4425r4426
247247
248248void tms5110_reset_chip(void *chip)
249249{
250   struct tms5110 *tms = chip;
250   struct tms5110 *tms = (struct tms5110 *)chip;
251251
252252   /* initialize the FIFO */
253253   memset(tms->fifo, 0, sizeof(tms->fifo));
r4425r4426
284284
285285void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *))
286286{
287   struct tms5110 *tms = chip;
287   struct tms5110 *tms = (struct tms5110 *)chip;
288288   tms->M0_callback = func;
289289}
290290
r4425r4426
296296
297297void tms5110_set_load_address(void *chip, void (*func)(const device_config *, int))
298298{
299   struct tms5110 *tms = chip;
299   struct tms5110 *tms = (struct tms5110 *)chip;
300300   tms->set_load_address = func;
301301}
302302
r4425r4426
388388
389389int tms5110_status_read(void *chip)
390390{
391   struct tms5110 *tms = chip;
391   struct tms5110 *tms = (struct tms5110 *)chip;
392392   if (DEBUG_5110) logerror("Status read: TS=%d\n", tms->talk_status);
393393
394394   return (tms->talk_status << 0); /*CTL1 = still talking ? */
r4425r4426
404404
405405int tms5110_ready_read(void *chip)
406406{
407   struct tms5110 *tms = chip;
407   struct tms5110 *tms = (struct tms5110 *)chip;
408408   return (tms->fifo_count < FIFO_SIZE-1);
409409}
410410
r4425r4426
418418
419419void tms5110_process(void *chip, INT16 *buffer, unsigned int size)
420420{
421   struct tms5110 *tms = chip;
421   struct tms5110 *tms = (struct tms5110 *)chip;
422422   int buf_count=0;
423423   int i, interp_period, bitout;
424424   INT16 Y11, cliptemp;
r4425r4426
738738
739739void tms5110_CTL_set(void *chip, int data)
740740{
741   struct tms5110 *tms = chip;
741   struct tms5110 *tms = (struct tms5110 *)chip;
742742   tms->CTL_pins = data & 0xf;
743743}
744744
r4425r4426
750750
751751void tms5110_PDC_set(void *chip, int data)
752752{
753   struct tms5110 *tms = chip;
753   struct tms5110 *tms = (struct tms5110 *)chip;
754754   if (tms->PDC != (data & 0x1) )
755755   {
756756      tms->PDC = data & 0x1;
src/emu/sound/2612intf.c
r4425r4426
4343/* IRQ Handler */
4444static void IRQHandler(void *param,int irq)
4545{
46   ym2612_state *info = param;
46   ym2612_state *info = (ym2612_state *)param;
4747   if(info->intf->handler) info->intf->handler(info->device, irq);
4848}
4949
5050/* Timer overflow callback from timer.c */
5151static TIMER_CALLBACK( timer_callback_2612_0 )
5252{
53   ym2612_state *info = ptr;
53   ym2612_state *info = (ym2612_state *)ptr;
5454   ym2612_timer_over(info->chip,0);
5555}
5656
5757static TIMER_CALLBACK( timer_callback_2612_1 )
5858{
59   ym2612_state *info = ptr;
59   ym2612_state *info = (ym2612_state *)ptr;
6060   ym2612_timer_over(info->chip,1);
6161}
6262
6363static void timer_handler(void *param,int c,int count,int clock)
6464{
65   ym2612_state *info = param;
65   ym2612_state *info = (ym2612_state *)param;
6666   if( count == 0 )
6767   {   /* Reset FM Timer */
6868      timer_enable(info->timer[c], 0);
r4425r4426
7878/* update request from fm.c */
7979void ym2612_update_request(void *param)
8080{
81   ym2612_state *info = param;
81   ym2612_state *info = (ym2612_state *)param;
8282   stream_update(info->stream);
8383}
8484
r4425r4426
8888
8989static STREAM_UPDATE( ym2612_stream_update )
9090{
91   ym2612_state *info = param;
91   ym2612_state *info = (ym2612_state *)param;
9292   ym2612_update_one(info->chip, outputs, samples);
9393}
9494
9595
9696static STATE_POSTLOAD( ym2612_intf_postload )
9797{
98   ym2612_state *info = param;
98   ym2612_state *info = (ym2612_state *)param;
9999   ym2612_postload(info->chip);
100100}
101101
r4425r4426
106106   ym2612_state *info = get_safe_token(device);
107107   int rate = device->clock/72;
108108
109   info->intf = device->static_config ? device->static_config : &dummy;
109   info->intf = device->static_config ? (const ym2612_interface *)device->static_config : &dummy;
110110   info->device = device;
111111
112112   /* FM init */
src/emu/sound/c352.c
r4425r4426
337337
338338static STREAM_UPDATE( c352_update )
339339{
340   c352_state *info = param;
340   c352_state *info = (c352_state *)param;
341341   int i, j;
342342   stream_sample_t *bufferl = outputs[0];
343343   stream_sample_t *bufferr = outputs[1];
src/emu/sound/3526intf.c
r4425r4426
4848/* IRQ Handler */
4949static void IRQHandler(void *param,int irq)
5050{
51   ym3526_state *info = param;
51   ym3526_state *info = (ym3526_state *)param;
5252   if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE);
5353}
5454/* Timer overflow callback from timer.c */
5555static TIMER_CALLBACK( timer_callback_0 )
5656{
57   ym3526_state *info = ptr;
57   ym3526_state *info = (ym3526_state *)ptr;
5858   ym3526_timer_over(info->chip,0);
5959}
6060static TIMER_CALLBACK( timer_callback_1 )
6161{
62   ym3526_state *info = ptr;
62   ym3526_state *info = (ym3526_state *)ptr;
6363   ym3526_timer_over(info->chip,1);
6464}
6565/* TimerHandler from fm.c */
6666static void TimerHandler(void *param,int c,attotime period)
6767{
68   ym3526_state *info = param;
68   ym3526_state *info = (ym3526_state *)param;
6969   if( attotime_compare(period, attotime_zero) == 0 )
7070   {   /* Reset FM Timer */
7171      timer_enable(info->timer[c], 0);
r4425r4426
7979
8080static STREAM_UPDATE( ym3526_stream_update )
8181{
82   ym3526_state *info = param;
82   ym3526_state *info = (ym3526_state *)param;
8383   ym3526_update_one(info->chip, outputs[0], samples);
8484}
8585
8686static void _stream_update(void *param, int interval)
8787{
88   ym3526_state *info = param;
88   ym3526_state *info = (ym3526_state *)param;
8989   stream_update(info->stream);
9090}
9191
r4425r4426
9696   ym3526_state *info = get_safe_token(device);
9797   int rate = device->clock/72;
9898
99   info->intf = device->static_config ? device->static_config : &dummy;
99   info->intf = device->static_config ? (const ym3526_interface *)device->static_config : &dummy;
100100   info->device = device;
101101
102102   /* stream system initialize */
src/emu/sound/k051649.c
r4425r4426
7272   int gain = 8;
7373
7474   /* allocate memory */
75   info->mixer_table = auto_malloc(512 * voices * sizeof(INT16));
75   info->mixer_table = (INT16 *)auto_malloc(512 * voices * sizeof(INT16));
7676
7777   /* find the middle of the table */
7878   info->mixer_lookup = info->mixer_table + (256 * voices);
r4425r4426
9191/* generate sound to the mix buffer */
9292static STREAM_UPDATE( k051649_update )
9393{
94   k051649_state *info = param;
94   k051649_state *info = (k051649_state *)param;
9595   k051649_sound_channel *voice=info->channel_list;
9696   stream_sample_t *buffer = outputs[0];
9797   short *mix;
r4425r4426
145145   info->mclock = device->clock;
146146
147147   /* allocate a buffer to mix into - 1 second's worth should be more than enough */
148   info->mixer_buffer = auto_malloc(2 * sizeof(short) * info->rate);
148   info->mixer_buffer = (short *)auto_malloc(2 * sizeof(short) * info->rate);
149149
150150   /* build the mixer table */
151151   make_mixer_table(info, 5);
src/emu/sound/k054539.c
r4425r4426
5858   rendering instead of sample-based.
5959*/
6060
61typedef struct _k054539_channel k054539_channel;
62struct _k054539_channel {
63   UINT32 pos;
64   UINT32 pfrac;
65   INT32 val;
66   INT32 pval;
67};
68
6169typedef struct _k054539_state k054539_state;
6270struct _k054539_state {
6371   const k054539_interface *intf;
r4425r4426
8189   UINT32 rom_mask;
8290   sound_stream * stream;
8391
84   struct k054539_channel {
85      UINT32 pos;
86      UINT32 pfrac;
87      INT32 val;
88      INT32 pval;
89   } channels[8];
92   k054539_channel channels[8];
9093};
9194
9295INLINE k054539_state *get_safe_token(const device_config *device)
r4425r4426
132135
133136static STREAM_UPDATE( k054539_update )
134137{
135   k054539_state *info = param;
138   k054539_state *info = (k054539_state *)param;
136139#define VOL_CAP 1.80
137140
138141   static const INT16 dpcm[16] = {
r4425r4426
146149   UINT32 rom_mask;
147150
148151   unsigned char *base1, *base2;
149   struct k054539_channel *chan;
152   k054539_channel *chan;
150153   stream_sample_t *bufl, *bufr;
151154   int cur_pos, cur_pfrac, cur_val, cur_pval;
152155   int delta, rdelta, fdelta, pdelta;
r4425r4426
438441
439442static TIMER_CALLBACK( k054539_irq )
440443{
441   k054539_state *info = ptr;
444   k054539_state *info = (k054539_state *)ptr;
442445   if(info->regs[0x22f] & 0x20)
443446      info->intf->irq(info->device);
444447}
r4425r4426
452455   info->k054539_flags |= K054539_UPDATE_AT_KEYON; //* make it default until proven otherwise
453456
454457   // Real size of 0x4000, the addon is to simplify the reverb buffer computations
455   info->ram = auto_malloc(0x4000*2+device->clock/50*2);
458   info->ram = (unsigned char *)auto_malloc(0x4000*2+device->clock/50*2);
456459   info->reverb_pos = 0;
457460   info->cur_ptr = 0;
458461   memset(info->ram, 0, 0x4000*2+device->clock/50*2);
r4425r4426
611614
612615static STATE_POSTLOAD( reset_zones )
613616{
614   k054539_state *info = param;
617   k054539_state *info = (k054539_state *)param;
615618   int data = info->regs[0x22e];
616619   info->cur_zone =
617620      data == 0x80 ? info->ram :
r4425r4426
653656      info->k054539_gain[i] = 1.0;
654657   info->k054539_flags = K054539_RESET_FLAGS;
655658
656   info->intf = (device->static_config != NULL) ? device->static_config : &defintrf;
659   info->intf = (device->static_config != NULL) ? (const k054539_interface *)device->static_config : &defintrf;
657660
658661   /*
659662        I've tried various equations on volume control but none worked consistently.
r4425r4426
675678   // Formula is such that pan[i]**2+pan[0xe-i]**2 = 1 (constant output power)
676679   // and pan[0xe] = 1 (full panning)
677680   for(i=0; i<0xf; i++)
678      info->pantab[i] = sqrt(i) / sqrt(0xe);
681      info->pantab[i] = sqrt((double)i) / sqrt((double)0xe);
679682
680683   k054539_init_chip(device, info);
681684
src/emu/sound/disc_inp.c
r4425r4426
4949   /* Read the node input value if allowed */
5050   if (node)
5151   {
52      UINT8 *node_data = node->context;
52      UINT8 *node_data = (UINT8 *)node->context;
5353
5454      /* Bring the system up to now */
5555      stream_update(info->discrete_stream);
r4425r4426
7373   /* Update the node input value if it's a proper input node */
7474   if (node)
7575   {
76      UINT8 *node_data = node->context;
76      UINT8 *node_data = (UINT8 *)node->context;
7777      UINT8 last_data  = *node_data;
7878      UINT8 new_data    = 0;
7979
r4425r4426
129129
130130static DISCRETE_STEP(dss_adjustment)
131131{
132   struct dss_adjustment_context *context = node->context;
132   struct dss_adjustment_context *context = (struct dss_adjustment_context *)node->context;
133133
134134   INT32  rawportval = input_port_read_direct(context->port);
135135
r4425r4426
149149
150150static DISCRETE_RESET(dss_adjustment)
151151{
152   struct dss_adjustment_context *context = node->context;
152   struct dss_adjustment_context *context = (struct dss_adjustment_context *)node->context;
153153
154154   double min, max;
155155
156156   if (node->custom)
157157   {
158      context->port = input_port_by_tag(device->machine->portconfig, node->custom);
158      context->port = input_port_by_tag(device->machine->portconfig, (const char *)node->custom);
159159      if (context->port == NULL)
160160         fatalerror("DISCRETE_ADJUSTMENT_TAG - NODE_%d has invalid tag", node->node-NODE_00);
161161   }
r4425r4426
214214 ************************************************************************/
215215static DISCRETE_RESET(dss_input)
216216{
217   UINT8 *node_data = node->context;
217   UINT8 *node_data = (UINT8 *)node->context;
218218
219219   switch (node->module.type)
220220   {
r4425r4426
234234
235235static DISCRETE_STEP(dss_input_pulse)
236236{
237   UINT8 *node_data = node->context;
237   UINT8 *node_data = (UINT8 *)node->context;
238238
239239   /* Set a valid output */
240240   node->output[0] = *node_data;
r4425r4426
260260static DISCRETE_STEP(dss_input_stream)
261261{
262262   /* the context pointer is set to point to the current input stream data in discrete_stream_update */
263   stream_sample_t **ptr = node->context;
263   stream_sample_t **ptr = (stream_sample_t **)node->context;
264264   stream_sample_t *data = *ptr;
265265
266266   node->output[0] = data ? (*data) * DSS_INPUT_STREAM__GAIN + DSS_INPUT_STREAM__OFFSET : 0;
src/emu/sound/namco52.c
r4425r4426
8686
8787static STREAM_UPDATE( namco_52xx_stream_update_one )
8888{
89   namco_52xx *chip = param;
89   namco_52xx *chip = (namco_52xx *)param;
9090   int i, rom_pos, whole_pb_cycles, buf;
9191   stream_sample_t *buffer = outputs[0];
9292
r4425r4426
141141
142142static DEVICE_RESET( namco_52xx )
143143{
144   namco_52xx_reset(device->token);
144   namco_52xx_reset(get_safe_token(device));
145145}
146146
147147static DEVICE_START( namco_52xx )
148148{
149   namco_52xx *chip = device->token;
149   namco_52xx *chip = get_safe_token(device);
150150   int rate = device->clock/32;
151151
152   chip->intf = device->static_config;
152   chip->intf = (const namco_52xx_interface *)device->static_config;
153153   chip->rom     = device->region;
154154   chip->rom_len = device->regionbytes;
155155
src/emu/sound/c140.c
r4425r4426
272272
273273static STREAM_UPDATE( update_stereo )
274274{
275   c140_state *info = param;
275   c140_state *info = (c140_state *)param;
276276   int      i,j;
277277
278278   INT32   rvol,lvol;
r4425r4426
467467
468468static DEVICE_START( c140 )
469469{
470   const c140_interface *intf = device->static_config;
470   const c140_interface *intf = (const c140_interface *)device->static_config;
471471   c140_state *info = get_safe_token(device);
472472
473473   info->sample_rate=info->baserate=device->clock;
r4425r4426
496496   }
497497
498498   /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
499   info->mixer_buffer_left = auto_malloc(2 * sizeof(INT16)*info->sample_rate );
499   info->mixer_buffer_left = (INT16 *)auto_malloc(2 * sizeof(INT16)*info->sample_rate );
500500   info->mixer_buffer_right = info->mixer_buffer_left + info->sample_rate;
501501}
502502
src/emu/sound/msm5205.c
r4425r4426
103103/* stream update callbacks */
104104static STREAM_UPDATE( MSM5205_update )
105105{
106   msm5205_state *voice = param;
106   msm5205_state *voice = (msm5205_state *)param;
107107   stream_sample_t *buffer = outputs[0];
108108
109109   /* if this voice is active */
r4425r4426
123123/* timer callback at VCLK low eddge */
124124static TIMER_CALLBACK( MSM5205_vclk_callback )
125125{
126   msm5205_state *voice = ptr;
126   msm5205_state *voice = (msm5205_state *)ptr;
127127   int val;
128128   int new_signal;
129129   /* callback user handler and latch next data */
r4425r4426
182182   msm5205_state *voice = get_safe_token(device);
183183
184184   /* save a global pointer to our interface */
185   voice->intf = device->static_config;
185   voice->intf = (const msm5205_interface *)device->static_config;
186186   voice->device = device;
187187   voice->clock = device->clock;
188188
src/emu/sound/qsound.c
r4425r4426
118118   /* Create pan table */
119119   for (i=0; i<33; i++)
120120   {
121      chip->pan_table[i]=(int)((256/sqrt(32)) * sqrt(i));
121      chip->pan_table[i]=(int)((256/sqrt(32.0)) * sqrt((double)i));
122122   }
123123
124124   LOG(("Pan table\n"));
r4425r4426
317317
318318static STREAM_UPDATE( qsound_update )
319319{
320   qsound_state *chip = param;
320   qsound_state *chip = (qsound_state *)param;
321321   int i,j;
322322   int rvol, lvol, count;
323323   struct QSOUND_CHANNEL *pC=&chip->channel[0];
src/emu/sound/3812intf.c
r4425r4426
4848
4949static void IRQHandler(void *param,int irq)
5050{
51   ym3812_state *info = param;
51   ym3812_state *info = (ym3812_state *)param;
5252   if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE);
5353}
5454static TIMER_CALLBACK( timer_callback_0 )
5555{
56   ym3812_state *info = ptr;
56   ym3812_state *info = (ym3812_state *)ptr;
5757   ym3812_timer_over(info->chip,0);
5858}
5959
6060static TIMER_CALLBACK( timer_callback_1 )
6161{
62   ym3812_state *info = ptr;
62   ym3812_state *info = (ym3812_state *)ptr;
6363   ym3812_timer_over(info->chip,1);
6464}
6565
6666static void TimerHandler(void *param,int c,attotime period)
6767{
68   ym3812_state *info = param;
68   ym3812_state *info = (ym3812_state *)param;
6969   if( attotime_compare(period, attotime_zero) == 0 )
7070   {   /* Reset FM Timer */
7171      timer_enable(info->timer[c], 0);
r4425r4426
7979
8080static STREAM_UPDATE( ym3812_stream_update )
8181{
82   ym3812_state *info = param;
82   ym3812_state *info = (ym3812_state *)param;
8383   ym3812_update_one(info->chip, outputs[0], samples);
8484}
8585
8686static void _stream_update(void * param, int interval)
8787{
88   ym3812_state *info = param;
88   ym3812_state *info = (ym3812_state *)param;
8989   stream_update(info->stream);
9090}
9191
r4425r4426
9696   ym3812_state *info = get_safe_token(device);
9797   int rate = device->clock/72;
9898
99   info->intf = device->static_config ? device->static_config : &dummy;
99   info->intf = device->static_config ? (const ym3812_interface *)device->static_config : &dummy;
100100   info->device = device;
101101
102102   /* stream system initialize */
src/emu/sound/snkwave.c
r4425r4426
6565/* generate sound to the mix buffer */
6666static STREAM_UPDATE( snkwave_update )
6767{
68   snkwave_state *chip = param;
68   snkwave_state *chip = (snkwave_state *)param;
6969   stream_sample_t *buffer = outputs[0];
7070
7171   /* zap the contents of the buffer */
src/emu/sound/rf5c400.c
r4425r4426
119119static STREAM_UPDATE( rf5c400_update )
120120{
121121   int i, ch;
122   rf5c400_state *info = param;
122   rf5c400_state *info = (rf5c400_state *)param;
123123   INT16 *rom = info->rom;
124124   UINT32 start, end, loop;
125125   UINT64 pos;
src/emu/sound/cem3394.c
r4425r4426
152152/* generate sound to the mix buffer in mono */
153153static STREAM_UPDATE( cem3394_update )
154154{
155   cem3394_state *chip = param;
155   cem3394_state *chip = (cem3394_state *)param;
156156   int int_volume = (chip->volume * chip->mixer_internal) / 256;
157157   int ext_volume = (chip->volume * chip->mixer_external) / 256;
158158   UINT32 step = chip->step, position, end_position = 0;
r4425r4426
328328
329329static DEVICE_START( cem3394 )
330330{
331   const cem3394_interface *intf = device->static_config;
331   const cem3394_interface *intf = (const cem3394_interface *)device->static_config;
332332   cem3394_state *chip = get_safe_token(device);
333333
334334   chip->device = device;
r4425r4426
344344   chip->filter_zero_freq = intf->filter_zero_freq;
345345
346346   /* allocate memory for a mixer buffer and external buffer (1 second should do it!) */
347   chip->mixer_buffer = auto_malloc(chip->sample_rate * sizeof(INT16));
348   chip->external_buffer = auto_malloc(chip->sample_rate * sizeof(INT16));
347   chip->mixer_buffer = (INT16 *)auto_malloc(chip->sample_rate * sizeof(INT16));
348   chip->external_buffer = (INT16 *)auto_malloc(chip->sample_rate * sizeof(INT16));
349349
350350   state_save_register_device_item_array(device, 0, chip->values);
351351   state_save_register_device_item(device, 0, chip->wave_select);
src/emu/sound/saa1099.c
r4425r4426
226226
227227static STREAM_UPDATE( saa1099_update )
228228{
229   saa1099_state *saa = param;
229   saa1099_state *saa = (saa1099_state *)param;
230230    int j, ch;
231231
232232   /* if the channels are disabled we're done */
src/emu/sound/digitalk.c
r4425r4426
542542
543543static STREAM_UPDATE(digitalker_update)
544544{
545   digitalker *dg = param;
545   digitalker *dg = (digitalker *)param;
546546   stream_sample_t *sout = outputs[0];
547547   int cpos = 0;
548548   while(cpos != samples) {
src/emu/sound/ymz280b.c
r4425r4426
203203
204204static STATE_POSTLOAD( YMZ280B_state_save_update_step )
205205{
206   ymz280b_state *chip = param;
206   ymz280b_state *chip = (ymz280b_state *)param;
207207   int j;
208208   for (j = 0; j < 8; j++)
209209   {
r4425r4426
217217
218218static void update_irq_state_timer_common(void *param, int voicenum)
219219{
220   ymz280b_state *chip = param;
220   ymz280b_state *chip = (ymz280b_state *)param;
221221   struct YMZ280BVoice *voice = &chip->voice[voicenum];
222222
223223   if(!voice->irq_schedule) return;
r4425r4426
500500
501501static STREAM_UPDATE( ymz280b_update )
502502{
503   ymz280b_state *chip = param;
503   ymz280b_state *chip = (ymz280b_state *)param;
504504   stream_sample_t *lacc = outputs[0];
505505   stream_sample_t *racc = outputs[1];
506506   int v;
r4425r4426
640640static DEVICE_START( ymz280b )
641641{
642642   static const ymz280b_interface defintrf = { 0 };
643   const ymz280b_interface *intf = (device->static_config != NULL) ? device->static_config : &defintrf;
643   const ymz280b_interface *intf = (device->static_config != NULL) ? (const ymz280b_interface *)device->static_config : &defintrf;
644644   ymz280b_state *chip = get_safe_token(device);
645645
646646   chip->device = device;
r4425r4426
659659   chip->stream = stream_create(device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update);
660660
661661   /* allocate memory */
662   chip->scratch = auto_malloc(sizeof(chip->scratch[0]) * MAX_SAMPLE_CHUNK);
662   chip->scratch = (INT16 *)auto_malloc(sizeof(chip->scratch[0]) * MAX_SAMPLE_CHUNK);
663663
664664   /* state save */
665665   {
src/emu/sound/rf5c68.c
r4425r4426
5252
5353static STREAM_UPDATE( rf5c68_update )
5454{
55   rf5c68_state *chip = param;
55   rf5c68_state *chip = (rf5c68_state *)param;
5656   stream_sample_t *left = outputs[0];
5757   stream_sample_t *right = outputs[1];
5858   int i, j;
src/emu/sound/k005289.c
r4425r4426
7878   int gain = 16;
7979
8080   /* allocate memory */
81   info->mixer_table = auto_malloc(256 * voices * sizeof(INT16));
81   info->mixer_table = (INT16 *)auto_malloc(256 * voices * sizeof(INT16));
8282
8383   /* find the middle of the table */
8484   info->mixer_lookup = info->mixer_table + (128 * voices);
r4425r4426
9797/* generate sound to the mix buffer */
9898static STREAM_UPDATE( K005289_update )
9999{
100   k005289_state *info = param;
100   k005289_state *info = (k005289_state *)param;
101101   k005289_sound_channel *voice=info->channel_list;
102102   stream_sample_t *buffer = outputs[0];
103103   short *mix;
r4425r4426
171171   info->mclock = device->clock;
172172
173173   /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
174   info->mixer_buffer = auto_malloc(2 * sizeof(short) * info->rate);
174   info->mixer_buffer = (short *)auto_malloc(2 * sizeof(short) * info->rate);
175175
176176   /* build the mixer table */
177177   make_mixer_table(info, 2);
src/emu/sound/ymf262.c
r4425r4426
11811181      /* we never reach zero here due to ((i*2)+1) */
11821182
11831183      if (m>0.0)
1184         o = 8*log(1.0/m)/log(2);   /* convert to 'decibels' */
1184         o = 8*log(1.0/m)/log(2.0);   /* convert to 'decibels' */
11851185      else
1186         o = 8*log(-1.0/m)/log(2);   /* convert to 'decibels' */
1186         o = 8*log(-1.0/m)/log(2.0);   /* convert to 'decibels' */
11871187
11881188      o = o / (ENV_STEP/4);
11891189
r4425r4426
24692469
24702470void ymf262_shutdown(void *chip)
24712471{
2472   OPL3Destroy(chip);
2472   OPL3Destroy((OPL3 *)chip);
24732473}
24742474void ymf262_reset_chip(void *chip)
24752475{
2476   OPL3ResetChip(chip);
2476   OPL3ResetChip((OPL3 *)chip);
24772477}
24782478
24792479int ymf262_write(void *chip, int a, int v)
24802480{
2481   return OPL3Write(chip, a, v);
2481   return OPL3Write((OPL3 *)chip, a, v);
24822482}
24832483
24842484unsigned char ymf262_read(void *chip, int a)
r4425r4426
24922492
24932493   /* YMF278(OPL4) returns bit2 in LOW and bit1 in HIGH state ??? info from manual - not verified */
24942494
2495   return OPL3Read(chip, a);
2495   return OPL3Read((OPL3 *)chip, a);
24962496}
24972497int ymf262_timer_over(void *chip, int c)
24982498{
2499   return OPL3TimerOver(chip, c);
2499   return OPL3TimerOver((OPL3 *)chip, c);
25002500}
25012501
25022502void ymf262_set_timer_handler(void *chip, OPL3_TIMERHANDLER timer_handler, void *param)
25032503{
2504   OPL3SetTimerHandler(chip, timer_handler, param);
2504   OPL3SetTimerHandler((OPL3 *)chip, timer_handler, param);
25052505}
25062506void ymf262_set_irq_handler(void *chip,OPL3_IRQHANDLER IRQHandler,void *param)
25072507{
2508   OPL3SetIRQHandler(chip, IRQHandler, param);
2508   OPL3SetIRQHandler((OPL3 *)chip, IRQHandler, param);
25092509}
25102510void ymf262_set_update_handler(void *chip,OPL3_UPDATEHANDLER UpdateHandler,void *param)
25112511{
2512   OPL3SetUpdateHandler(chip, UpdateHandler, param);
2512   OPL3SetUpdateHandler((OPL3 *)chip, UpdateHandler, param);
25132513}
25142514
25152515
r4425r4426
25222522*/
25232523void ymf262_update_one(void *_chip, OPL3SAMPLE **buffers, int length)
25242524{
2525   OPL3      *chip  = _chip;
2525   OPL3      *chip  = (OPL3 *)_chip;
25262526   UINT8      rhythm = chip->rhythm&0x20;
25272527
25282528   OPL3SAMPLE   *ch_a = buffers[0];
src/emu/sound/disc_mth.c
r4425r4426
205205
206206static DISCRETE_STEP(dst_comp_adder)
207207{
208   struct dst_comp_adder_context    *context = node->context;
208   struct dst_comp_adder_context    *context = (struct dst_comp_adder_context *)node->context;
209209   int select;
210210
211211   select = (int)DST_COMP_ADDER__SELECT;
r4425r4426
215215
216216static DISCRETE_RESET(dst_comp_adder)
217217{
218   const  discrete_comp_adder_table *info = node->custom;
219   struct dst_comp_adder_context    *context = node->context;
218   const  discrete_comp_adder_table *info = (const  discrete_comp_adder_table *)node->custom;
219   struct dst_comp_adder_context    *context = (struct dst_comp_adder_context *)node->context;
220220
221221   int i, bit;
222222   int length = 1 << info->length;
r4425r4426
298298
299299static DISCRETE_STEP(dst_dac_r1)
300300{
301   const  discrete_dac_r1_ladder *info    = node->custom;
302   struct dst_dac_r1_context     *context = node->context;
301   const  discrete_dac_r1_ladder *info    = (const  discrete_dac_r1_ladder *)node->custom;
302   struct dst_dac_r1_context     *context = (struct dst_dac_r1_context *)node->context;
303303
304304   int      bit, bit_val, data;
305305   double   v, i_bit, i_total, x_time;
r4425r4426
355355
356356static DISCRETE_RESET(dst_dac_r1)
357357{
358   const discrete_dac_r1_ladder *info = node->custom;
359   struct dst_dac_r1_context *context = node->context;
358   const discrete_dac_r1_ladder *info = (const discrete_dac_r1_ladder *)node->custom;
359   struct dst_dac_r1_context *context = (struct dst_dac_r1_context *)node->context;
360360
361361   int   bit;
362362
r4425r4426
420420
421421static DISCRETE_STEP(dst_diode_mix)
422422{
423   struct   dst_diode_mix__context *context = node->context;
423   struct   dst_diode_mix__context *context = (struct   dst_diode_mix__context *)node->context;
424424
425425   double   val, max = 0;
426426   int      addr;
r4425r4426
436436
437437static DISCRETE_RESET(dst_diode_mix)
438438{
439   const  double *info = node->custom;
440   struct dst_diode_mix__context *context = node->context;
439   const  double *info = (const  double *)node->custom;
440   struct dst_diode_mix__context *context = (struct dst_diode_mix__context *)node->context;
441441
442442   int      addr;
443443
r4425r4426
574574
575575static DISCRETE_STEP(dst_integrate)
576576{
577   const  discrete_integrate_info *info    = node->custom;
578   struct dst_integrate_context   *context = node->context;
577   const  discrete_integrate_info *info    = (const  discrete_integrate_info *)node->custom;
578   struct dst_integrate_context   *context = (struct dst_integrate_context *)node->context;
579579
580580   int      trig0, trig1;
581581   double   i_neg = 0;   /* current into - input */
r4425r4426
619619
620620static DISCRETE_RESET(dst_integrate)
621621{
622   const discrete_integrate_info *info = node->custom;
623   struct dst_integrate_context *context = node->context;
622   const discrete_integrate_info *info = (const discrete_integrate_info *)node->custom;
623   struct dst_integrate_context *context = (struct dst_integrate_context *)node->context;
624624   double   i, v;
625625
626626   if (info->type & DISC_OP_AMP_IS_NORTON)
r4425r4426
851851
852852static DISCRETE_STEP(dst_logic_dff)
853853{
854   struct dst_flipflop_context *context = node->context;
854   struct dst_flipflop_context *context = (struct dst_flipflop_context *)node->context;
855855
856856   int clk = (int)DST_LOGIC_DFF__CLOCK;
857857
r4425r4426
873873
874874static DISCRETE_RESET(dst_logic_ff)
875875{
876   struct dst_flipflop_context *context = node->context;
876   struct dst_flipflop_context *context = (struct dst_flipflop_context *)node->context;
877877
878878   context->last_clk = 0;
879879   node->output[0]   = 0;
r4425r4426
901901
902902static DISCRETE_STEP(dst_logic_jkff)
903903{
904   struct dst_flipflop_context *context = node->context;
904   struct dst_flipflop_context *context = (struct dst_flipflop_context *)node->context;
905905
906906   int clk = (int)DST_LOGIC_JKFF__CLOCK;
907907   int j   = (int)DST_LOGIC_JKFF__J;
r4425r4426
959959
960960static DISCRETE_STEP(dst_lookup_table)
961961{
962   const double *table = node->custom;
962   const double *table = (const double *)node->custom;
963963
964964   int   addr = DST_LOOKUP_TABLE__IN;
965965
r4425r4426
10251025
10261026static DISCRETE_STEP(dst_mixer)
10271027{
1028   const  discrete_mixer_desc *info    = node->custom;
1029   struct dst_mixer_context   *context = node->context;
1028   const  discrete_mixer_desc *info    = (const  discrete_mixer_desc *)node->custom;
1029   struct dst_mixer_context   *context = (struct dst_mixer_context *)node->context;
10301030
10311031   double   v, vTemp, r_total, rTemp, rTemp2 = 0;
10321032   double   i = 0;      /* total current of inputs */
r4425r4426
11681168
11691169static DISCRETE_RESET(dst_mixer)
11701170{
1171   const  discrete_mixer_desc *info    = node->custom;
1172   struct dst_mixer_context   *context = node->context;
1171   const  discrete_mixer_desc *info    = (const  discrete_mixer_desc *)node->custom;
1172   struct dst_mixer_context   *context = (struct dst_mixer_context *)node->context;
11731173   node_description *r_node;
11741174
11751175   int      bit;
r4425r4426
12921292
12931293static DISCRETE_STEP(dst_multiplex)
12941294{
1295   struct dst_size_context *context = node->context;
1295   struct dst_size_context *context = (struct dst_size_context *)node->context;
12961296
12971297   int addr;
12981298
r4425r4426
13171317
13181318static DISCRETE_RESET(dst_multiplex)
13191319{
1320   struct dst_size_context *context = node->context;
1320   struct dst_size_context *context = (struct dst_size_context *)node->context;
13211321
13221322   context->size = node->active_inputs - 2;
13231323
r4425r4426
13451345
13461346static DISCRETE_STEP(dst_oneshot)
13471347{
1348   struct dst_oneshot_context *context = node->context;
1348   struct dst_oneshot_context *context = (struct dst_oneshot_context *)node->context;
13491349
13501350   int trigger = (DST_ONESHOT__TRIG != 0);
13511351
r4425r4426
14051405
14061406static DISCRETE_RESET(dst_oneshot)
14071407{
1408   struct dst_oneshot_context *context = node->context;
1408   struct dst_oneshot_context *context = (struct dst_oneshot_context *)node->context;
14091409
14101410   context->countdown = 0;
14111411   context->state     = 0;
r4425r4426
14361436
14371437static DISCRETE_STEP(dst_ramp)
14381438{
1439   struct dss_ramp_context *context = node->context;
1439   struct dss_ramp_context *context = (struct dss_ramp_context *)node->context;
14401440
14411441   if(DST_RAMP__ENABLE)
14421442   {
r4425r4426
14631463
14641464static DISCRETE_RESET(dst_ramp)
14651465{
1466   struct dss_ramp_context *context = node->context;
1466   struct dss_ramp_context *context = (struct dss_ramp_context *)node->context;
14671467
14681468   node->output[0]  = DST_RAMP__CLAMP;
14691469   context->step    = DST_RAMP__GRAD / discrete_current_context->sample_rate;
r4425r4426
14891489
14901490static DISCRETE_STEP(dst_samphold)
14911491{
1492   struct dst_samphold_context *context = node->context;
1492   struct dst_samphold_context *context = (struct dst_samphold_context *)node->context;
14931493
14941494   if(DST_SAMPHOLD__ENABLE)
14951495   {
r4425r4426
15261526
15271527static DISCRETE_RESET(dst_samphold)
15281528{
1529   struct dst_samphold_context *context = node->context;
1529   struct dst_samphold_context *context = (struct dst_samphold_context *)node->context;
15301530
15311531   node->output[0]     =  0;
15321532   context->last_input = -1;
r4425r4426
16321632   double   number1,top;
16331633   int      trans_stack_ptr = 0;
16341634
1635   const char *fPTR = node->custom;
1635   const char *fPTR = (const char *)node->custom;
16361636   node->output[0]  = 0;
16371637
16381638   top = HUGE_VAL;
r4425r4426
17381738
17391739static DISCRETE_STEP(dst_op_amp)
17401740{
1741   const  discrete_op_amp_info *info    = node->custom;
1742   struct dst_op_amp_context   *context = node->context;
1741   const  discrete_op_amp_info *info    = (const  discrete_op_amp_info *)node->custom;
1742   struct dst_op_amp_context   *context = (struct dst_op_amp_context *)node->context;
17431743
17441744   double i_pos = 0;
17451745   double i_neg = 0;
r4425r4426
17981798
17991799static DISCRETE_RESET(dst_op_amp)
18001800{
1801   const discrete_op_amp_info *info = node->custom;
1802   struct dst_op_amp_context *context = node->context;
1801   const discrete_op_amp_info *info = (const discrete_op_amp_info *)node->custom;
1802   struct dst_op_amp_context *context = (struct dst_op_amp_context *)node->context;
18031803
18041804   context->has_r1 = info->r1 > 0;
18051805   context->has_r4 = info->r4 > 0;
r4425r4426
18401840
18411841static DISCRETE_STEP(dst_op_amp_1sht)
18421842{
1843   const  discrete_op_amp_1sht_info *info    = node->custom;
1844   struct dst_op_amp_1sht_context   *context = node->context;
1843   const  discrete_op_amp_1sht_info *info    = (const  discrete_op_amp_1sht_info *)node->custom;
1844   struct dst_op_amp_1sht_context   *context = (struct dst_op_amp_1sht_context *)node->context;
18451845
18461846   double i_pos;
18471847   double i_neg;
r4425r4426
18801880
18811881static DISCRETE_RESET(dst_op_amp_1sht)
18821882{
1883   const  discrete_op_amp_1sht_info *info    = node->custom;
1884   struct dst_op_amp_1sht_context   *context = node->context;
1883   const  discrete_op_amp_1sht_info *info    = (const  discrete_op_amp_1sht_info *)node->custom;
1884   struct dst_op_amp_1sht_context   *context = (struct dst_op_amp_1sht_context *)node->context;
18851885
18861886   context->exponent1c = RC_CHARGE_EXP(RES_2_PARALLEL(info->r3, info->r4) * info->c1);
18871887   context->exponent1d = RC_CHARGE_EXP(info->r4 * info->c1);
r4425r4426
19151915
19161916static DISCRETE_STEP(dst_tvca_op_amp)
19171917{
1918   const  discrete_op_amp_tvca_info *info    = node->custom;
1919   struct dst_tvca_op_amp_context   *context = node->context;
1918   const  discrete_op_amp_tvca_info *info    = (const  discrete_op_amp_tvca_info *)node->custom;
1919   struct dst_tvca_op_amp_context   *context = (struct dst_tvca_op_amp_context *)node->context;
19201920
19211921   int      trig0, trig1, trig2, f3;
19221922   double   i2 = 0;      /* current through r2 */
r4425r4426
19951995
19961996static DISCRETE_RESET(dst_tvca_op_amp)
19971997{
1998   const  discrete_op_amp_tvca_info *info    = node->custom;
1999   struct dst_tvca_op_amp_context   *context = node->context;
1998   const  discrete_op_amp_tvca_info *info    = (const  discrete_op_amp_tvca_info *)node->custom;
1999   struct dst_tvca_op_amp_context   *context = (struct dst_tvca_op_amp_context *)node->context;
20002000
20012001   context->r67 = info->r6 + info->r7;
20022002
src/emu/sound/aica.c
r4425r4426
12751275
12761276static STREAM_UPDATE( AICA_Update )
12771277{
1278   aica_state *AICA = param;
1278   aica_state *AICA = (aica_state *)param;
12791279   bufferl = outputs[0];
12801280   bufferr = outputs[1];
12811281   length = samples;
r4425r4426
12881288
12891289   aica_state *AICA = get_safe_token(device);
12901290
1291   intf = device->static_config;
1291   intf = (const aica_interface *)device->static_config;
12921292
12931293   // init the emulation
12941294   AICA_Init(device, AICA, intf);
r4425r4426
13121312   aica_state *AICA = get_safe_token(device);
13131313   if (AICA)
13141314   {
1315      AICA->AICARAM = base;
1315      AICA->AICARAM = (unsigned char *)base;
13161316      AICA->AICARAM_LENGTH = size;
13171317      AICA->RAM_MASK = AICA->AICARAM_LENGTH-1;
13181318      AICA->RAM_MASK16 = AICA->RAM_MASK & 0x7ffffe;
1319      AICA->DSP.AICARAM = base;
1319      AICA->DSP.AICARAM = (UINT16 *)base;
13201320      AICA->DSP.AICARAM_LENGTH = size;
13211321   }
13221322}
src/emu/sound/sn76496.c
r4425r4426
145145static STREAM_UPDATE( SN76496Update )
146146{
147147   int i;
148   sn76496_state *R = param;
148   sn76496_state *R = (sn76496_state *)param;
149149   stream_sample_t *buffer = outputs[0];
150150
151151
src/emu/sound/astrocde.c
r4425r4426
8989
9090static STREAM_UPDATE( astrocade_update )
9191{
92   astrocade_state *chip = param;
92   astrocade_state *chip = (astrocade_state *)param;
9393   stream_sample_t *dest = outputs[0];
9494   UINT16 noise_state;
9595   UINT8 master_count;
src/emu/sound/x1_010.c
r4425r4426
114114--------------------------------------------------------------*/
115115static STREAM_UPDATE( seta_update )
116116{
117   x1_010_state *info = param;
117   x1_010_state *info = (x1_010_state *)param;
118118   X1_010_CHANNEL   *reg;
119119   int      ch, i, volL, volR, freq;
120120   register INT8   *start, *end, data;
r4425r4426
204204static DEVICE_START( x1_010 )
205205{
206206   int i;
207   const x1_010_interface *intf = device->static_config;
208   x1_010_state *info = device->token;
207   const x1_010_interface *intf = (const x1_010_interface *)device->static_config;
208   x1_010_state *info = get_safe_token(device);
209209
210210   info->region      = device->region;
211211   info->base_clock   = device->clock;
src/emu/sound/upd7759.c
r4425r4426
473473
474474static STREAM_UPDATE( upd7759_update )
475475{
476   upd7759_state *chip = param;
476   upd7759_state *chip = (upd7759_state *)param;
477477   INT32 clocks_left = chip->clocks_left;
478478   INT16 sample = chip->sample;
479479   UINT32 step = chip->step;
r4425r4426
536536
537537static TIMER_CALLBACK( upd7759_slave_update )
538538{
539   upd7759_state *chip = ptr;
539   upd7759_state *chip = (upd7759_state *)ptr;
540540   UINT8 olddrq = chip->drq;
541541
542542   /* update the stream */
r4425r4426
593593
594594static DEVICE_RESET( upd7759 )
595595{
596   upd7759_reset(device->token);
596   upd7759_reset(get_safe_token(device));
597597}
598598
599599
r4425r4426
640640static DEVICE_START( upd7759 )
641641{
642642   static const upd7759_interface defintrf = { 0 };
643   const upd7759_interface *intf = (device->static_config != NULL) ? device->static_config : &defintrf;
644   upd7759_state *chip = device->token;
643   const upd7759_interface *intf = (device->static_config != NULL) ? (const upd7759_interface *)device->static_config : &defintrf;
644   upd7759_state *chip = get_safe_token(device);
645645
646646   chip->device = device;
647647
src/emu/sound/ymf271.c
r4425r4426
690690   int i, j;
691691   int op;
692692   INT32 *mixp;
693   YMF271Chip *chip = param;
693   YMF271Chip *chip = (YMF271Chip *)param;
694694
695695   memset(mix, 0, sizeof(mix[0])*samples*2);
696696
r4425r4426
13581358
13591359static TIMER_CALLBACK( ymf271_timer_a_tick )
13601360{
1361   YMF271Chip *chip = ptr;
1361   YMF271Chip *chip = (YMF271Chip *)ptr;
13621362
13631363   chip->status |= 1;
13641364
r4425r4426
13711371
13721372static TIMER_CALLBACK( ymf271_timer_b_tick )
13731373{
1374   YMF271Chip *chip = ptr;
1374   YMF271Chip *chip = (YMF271Chip *)ptr;
13751375
13761376   chip->status |= 2;
13771377
r4425r4426
15741574
15751575   for (i=0; i < ARRAY_LENGTH(wavetable); i++)
15761576   {
1577      wavetable[i] = auto_malloc(SIN_LEN * sizeof(INT16));
1577      wavetable[i] = (INT16 *)auto_malloc(SIN_LEN * sizeof(INT16));
15781578   }
15791579
15801580   for (i=0; i < SIN_LEN; i++)
r4425r4426
16521652      alfo_table[3][i] = (i < (LFO_LENGTH/2)) ? ALFO_MAX-tri_wave : tri_wave;
16531653   }
16541654
1655   mix = auto_malloc(48000*2*sizeof(*mix));
1655   mix = (INT32 *)auto_malloc(48000*2*sizeof(*mix));
16561656}
16571657
16581658static void init_state(YMF271Chip *chip, const device_config *device)
r4425r4426
17551755   chip->device = device;
17561756   chip->clock = device->clock;
17571757
1758   intf = (device->static_config != NULL) ? device->static_config : &defintrf;
1758   intf = (device->static_config != NULL) ? (const ymf271_interface *)device->static_config : &defintrf;
17591759
17601760   ymf271_init(device, chip, device->region, intf->irq_callback, &intf->ext_read, &intf->ext_write);
17611761   chip->stream = stream_create(device, 0, 2, device->clock/384, chip, ymf271_update);
src/emu/sound/n63701x.c
r4425r4426
5959
6060static STREAM_UPDATE( namco_63701x_update )
6161{
62   namco_63701x *chip = param;
62   namco_63701x *chip = (namco_63701x *)param;
6363   int ch;
6464
6565   for (ch = 0;ch < 2;ch++)
src/emu/sound/tiasound.c
r4425r4426
160160
161161void tia_write(void *_chip, offs_t offset, UINT8 data)
162162{
163   struct tia *chip = _chip;
163   struct tia *chip = (struct tia *)_chip;
164164    UINT16 new_val = 0;
165165    UINT8 chan;
166166
r4425r4426
261261
262262void tia_process(void *_chip, stream_sample_t *buffer, int length)
263263{
264   struct tia *chip = _chip;
264   struct tia *chip = (struct tia *)_chip;
265265    UINT8 audc0, audc1;
266266    UINT8 div_n_cnt0, div_n_cnt1;
267267    UINT8 p5_0, p5_1;
r4425r4426
547547   struct tia *chip;
548548   int chan;
549549
550   chip = malloc(sizeof(*chip));
550   chip = (struct tia *)malloc(sizeof(*chip));
551551   if (!chip)
552552      return NULL;
553553   memset(chip, 0, sizeof(*chip));
src/emu/sound/pokey.c
r4425r4426
536536
537537static STREAM_UPDATE( pokey_update )
538538{
539   pokey_state *chip = param;
539   pokey_state *chip = (pokey_state *)param;
540540   stream_sample_t *buffer = outputs[0];
541541   PROCESS_POKEY(chip);
542542}
r4425r4426
679679
680680static TIMER_CALLBACK( pokey_timer_expire )
681681{
682   pokey_state *p = ptr;
682   pokey_state *p = (pokey_state *)ptr;
683683   int timers = param;
684684
685685   LOG_TIMER(("POKEY #%p timer %d with IRQEN $%02x\n", p, timers, p->IRQEN));
r4425r4426
749749
750750static TIMER_CALLBACK( pokey_serin_ready_cb )
751751{
752   pokey_state *p = ptr;
752   pokey_state *p = (pokey_state *)ptr;
753753    if( p->IRQEN & IRQ_SERIN )
754754   {
755755      /* set the enabled timer irq status bits */
r4425r4426
762762
763763static TIMER_CALLBACK( pokey_serout_ready_cb )
764764{
765   pokey_state *p = ptr;
765   pokey_state *p = (pokey_state *)ptr;
766766    if( p->IRQEN & IRQ_SEROR )
767767   {
768768      p->IRQST |= IRQ_SEROR;
r4425r4426
773773
774774static TIMER_CALLBACK( pokey_serout_complete )
775775{
776   pokey_state *p = ptr;
776   pokey_state *p = (pokey_state *)ptr;
777777    if( p->IRQEN & IRQ_SEROC )
778778   {
779779      p->IRQST |= IRQ_SEROC;
r4425r4426
784784
785785static TIMER_CALLBACK( pokey_pot_trigger )
786786{
787   pokey_state *p = ptr;
787   pokey_state *p = (pokey_state *)ptr;
788788   int pot = param;
789789   LOG(("POKEY #%p POT%d triggers after %dus\n", p, pot, (int)(1000000 * attotime_to_double(timer_timeelapsed(p->ptimer[pot])))));
790790   p->ALLPOT &= ~(1 << pot);   /* set the enabled timer irq status bits */
src/emu/sound/sp0250.c
r4425r4426
132132
133133static TIMER_CALLBACK( sp0250_timer_tick )
134134{
135   sp0250_state *sp = ptr;
135   sp0250_state *sp = (sp0250_state *)ptr;
136136   stream_update(sp->stream);
137137}
138138
139139static STREAM_UPDATE( sp0250_update )
140140{
141   sp0250_state *sp = param;
141   sp0250_state *sp = (sp0250_state *)param;
142142   stream_sample_t *output = outputs[0];
143143   int i;
144144   for (i = 0; i < samples; i++)
r4425r4426
205205
206206static DEVICE_START( sp0250 )
207207{
208   const struct sp0250_interface *intf = device->static_config;
208   const struct sp0250_interface *intf = (const struct sp0250_interface *)device->static_config;
209209   sp0250_state *sp = get_safe_token(device);
210210
211211   sp->device = device;
src/emu/sound/ay8910.c
r4425r4426
287287
288288/*
289289 * RL = 2000, Based on Matthew Westcott's measurements from Dec 2001.
290 * -------------------------------------------------------------------
290291 *
291292 * http://groups.google.com/group/comp.sys.sinclair/browse_thread/thread/fb3091da4c4caf26/d5959a800cda0b5e?lnk=gst&q=Matthew+Westcott#d5959a800cda0b5e
292293 * After what Russell mentioned a couple of weeks back about the lack of
r4425r4426
316317 * 13     2.06
317318 * 14     2.32
318319 * 15     2.58
320 * -------------------------------------------------------------------
321 *
322 * The ZX spectrum output circuit was modelled in SwitcherCAD and
323 * the resistor values below create the voltage levels above.
324 * RD was measured on a real chip to be 8m Ohm, RU was 0.8m Ohm.
319325 */
320326
321327static const ay_ym_param ay8910_param =
322328{
323   1030, 357,
329   800000, 8000000,
324330   16,
325   { 81509, 34403, 26998, 21248, 15890, 11495, 8625, 5314,
326      4287,  2583,  1836,  1350,   978,   745,  530,  392 }
331   { 15950, 15350, 15090, 14760, 14275, 13620, 12890, 11370,
332      10600,  8590,  7190,  5985,  4820,  3945,  3017,  2345 }
327333};
328334
329335/*************************************
r4425r4426
339345   double min = 10.0,  max = 0.0;
340346   double *temp;
341347
342   temp = malloc(8*32*32*32*sizeof(*temp));
348   temp = (double *)malloc(8*32*32*32*sizeof(*temp));
343349
344350   for (e=0; e < 8; e++)
345351      for (j1=0; j1 < 32; j1++)
r4425r4426
545551
546552static STREAM_UPDATE( ay8910_update )
547553{
548   ay8910_context *psg = param;
554   ay8910_context *psg = (ay8910_context *)param;
549555   stream_sample_t *buf[NUM_CHANNELS];
550556   int chan;
551557
r4425r4426
731737
732738void *ay8910_start_ym(void *infoptr, sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf)
733739{
734   ay8910_context *info = infoptr;
740   ay8910_context *info = (ay8910_context *)infoptr;
735741
736742   if (info == NULL)
737743   {
738      info = auto_malloc(sizeof(*info));
744      info = (ay8910_context *)auto_malloc(sizeof(*info));
739745      memset(info, 0, sizeof(*info));
740746   }
741747   info->device = device;
r4425r4426
787793
788794void ay8910_reset_ym(void *chip)
789795{
790   ay8910_context *psg = chip;
796   ay8910_context *psg = (ay8910_context *)chip;
791797   int i;
792798
793799   psg->register_latch = 0;
r4425r4426
835841
836842void ay8910_set_clock_ym(void *chip, int clock)
837843{
838   ay8910_context *psg = chip;
844   ay8910_context *psg = (ay8910_context *)chip;
839845   stream_set_sample_rate(psg->channel, clock / 8 );
840846}
841847
842848void ay8910_write_ym(void *chip, int addr, int data)
843849{
844   ay8910_context *psg = chip;
850   ay8910_context *psg = (ay8910_context *)chip;
845851
846852   if (addr & 1)
847853   {   /* Data port */
r4425r4426
864870
865871int ay8910_read_ym(void *chip)
866872{
867   ay8910_context *psg = chip;
873   ay8910_context *psg = (ay8910_context *)chip;
868874   int r = psg->register_latch;
869875
870876   if (r > 15) return 0;
871877
878   /* FIXME: calling stream_update here makes gyruss sound awfull.
879     *        For the time being, no idea why this is the case */
872880   /* update the output buffer before returning the register */
873   stream_update(psg->channel);
881   /* stream_update(psg->channel); */
874882
875883   switch (r)
876884   {
r4425r4426
912920      AY8910_DEFAULT_LOADS,
913921      DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
914922   };
915   const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910);
923   const ay8910_interface *intf = (device->static_config ? (const ay8910_interface *)device->static_config : &generic_ay8910);
916924   ay8910_start_ym(get_safe_token(device), SOUND_AY8910, device, device->clock, intf);
917925}
918926
r4425r4426
924932      AY8910_DEFAULT_LOADS,
925933      DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
926934   };
927   const ay8910_interface *intf = (device->static_config ? device->static_config : &generic_ay8910);
935   const ay8910_interface *intf = (device->static_config ? (const ay8910_interface *)device->static_config : &generic_ay8910);
928936   ay8910_start_ym(get_safe_token(device), SOUND_YM2149, device, device->clock, intf);
929937}
930938
src/emu/sound/cdda.c
r4425r4426
4444
4545static STREAM_UPDATE( cdda_update )
4646{
47   cdda_info *info = param;
47   cdda_info *info = (cdda_info *)param;
4848   get_audio_data(info, &outputs[0][0], &outputs[1][0], samples);
4949}
5050
r4425r4426
5959   cdda_info *info = get_safe_token(device);
6060
6161   /* allocate an audio cache */
62   info->audio_cache = auto_malloc( CD_MAX_SECTOR_DATA * MAX_SECTORS );
62   info->audio_cache = (UINT8 *)auto_malloc( CD_MAX_SECTOR_DATA * MAX_SECTORS );
6363
64   intf = device->static_config;
64   intf = (const struct CDDAinterface *)device->static_config;
6565
6666   info->stream = stream_create(device, 0, 2, 44100, info, cdda_update);
6767
src/emu/sound/tms36xx.c
r4425r4426
353353
354354static STREAM_UPDATE( tms36xx_sound_update )
355355{
356   tms_state *tms = param;
356   tms_state *tms = (tms_state *)param;
357357   int samplerate = tms->samplerate;
358358   stream_sample_t *buffer = outputs[0];
359359
r4425r4426
501501   tms_state *tms = get_safe_token(device);
502502   int enable;
503503
504   tms->intf = device->static_config;
504   tms->intf = (const tms36xx_interface *)device->static_config;
505505
506506   tms->channel = stream_create(device, 0, 1, device->clock * 64, tms, tms36xx_sound_update);
507507   tms->samplerate = device->clock * 64;
src/emu/sound/st0016.c
r4425r4426
6666
6767static STREAM_UPDATE( st0016_update )
6868{
69   st0016_state *info = param;
69   st0016_state *info = (st0016_state *)param;
7070   UINT8 *sound_ram = *info->sound_ram;
7171   int v, i, snum;
7272   unsigned char *slot;
r4425r4426
142142
143143static DEVICE_START( st0016 )
144144{
145   const st0016_interface *intf = device->static_config;
145   const st0016_interface *intf = (const st0016_interface *)device->static_config;
146146   st0016_state *info = get_safe_token(device);
147147
148148   info->sound_ram = intf->p_soundram;
src/emu/sound/tiaintf.c
r4425r4426
2222
2323static STREAM_UPDATE( tia_update )
2424{
25   tia_state *info = param;
25   tia_state *info = (tia_state *)param;
2626   tia_process(info->chip, outputs[0], samples);
2727}
2828
src/emu/sound/ym2151.c
r4425r4426
543543      /* we never reach zero here due to ((i*2)+1) */
544544
545545      if (m>0.0)
546         o = 8*log(1.0/m)/log(2);   /* convert to 'decibels' */
546         o = 8*log(1.0/m)/log(2.0);   /* convert to 'decibels' */
547547      else
548         o = 8*log(-1.0/m)/log(2);   /* convert to 'decibels' */
548         o = 8*log(-1.0/m)/log(2.0);   /* convert to 'decibels' */
549549
550550      o = o / (ENV_STEP/4);
551551
r4425r4426
782782
783783static TIMER_CALLBACK( irqAon_callback )
784784{
785   YM2151 *chip = ptr;
785   YM2151 *chip = (YM2151 *)ptr;
786786   int oldstate = chip->irqlinestate;
787787
788788   chip->irqlinestate |= 1;
r4425r4426
792792
793793static TIMER_CALLBACK( irqBon_callback )
794794{
795   YM2151 *chip = ptr;
795   YM2151 *chip = (YM2151 *)ptr;
796796   int oldstate = chip->irqlinestate;
797797
798798   chip->irqlinestate |= 2;
r4425r4426
802802
803803static TIMER_CALLBACK( irqAoff_callback )
804804{
805   YM2151 *chip = ptr;
805   YM2151 *chip = (YM2151 *)ptr;
806806   int oldstate = chip->irqlinestate;
807807
808808   chip->irqlinestate &= ~1;
r4425r4426
812812
813813static TIMER_CALLBACK( irqBoff_callback )
814814{
815   YM2151 *chip = ptr;
815   YM2151 *chip = (YM2151 *)ptr;
816816   int oldstate = chip->irqlinestate;
817817
818818   chip->irqlinestate &= ~2;
r4425r4426
822822
823823static TIMER_CALLBACK( timer_callback_a )
824824{
825   YM2151 *chip = ptr;
825   YM2151 *chip = (YM2151 *)ptr;
826826   timer_adjust_oneshot(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0);
827827   chip->timer_A_index_old = chip->timer_A_index;
828828   if (chip->irq_enable & 0x04)
r4425r4426
835835}
836836static TIMER_CALLBACK( timer_callback_b )
837837{
838   YM2151 *chip = ptr;
838   YM2151 *chip = (YM2151 *)ptr;
839839   timer_adjust_oneshot(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0);
840840   chip->timer_B_index_old = chip->timer_B_index;
841841   if (chip->irq_enable & 0x08)
r4425r4426
847847#if 0
848848static TIMER_CALLBACK( timer_callback_chip_busy )
849849{
850   YM2151 *chip = ptr;
850   YM2151 *chip = (YM2151 *)ptr;
851851   chip->status &= 0x7f;   /* reset busy flag */
852852}
853853#endif
r4425r4426
10431043/* write a register on YM2151 chip number 'n' */
10441044void ym2151_write_reg(void *_chip, int r, int v)
10451045{
1046   YM2151 *chip = _chip;
1046   YM2151 *chip = (YM2151 *)_chip;
10471047   YM2151Operator *op = &chip->oper[ (r&0x07)*4+((r&0x18)>>3) ];
10481048
10491049   /* adjust bus to 8 bits */
r4425r4426
13671367
13681368int ym2151_read_status( void *_chip )
13691369{
1370   YM2151 *chip = _chip;
1370   YM2151 *chip = (YM2151 *)_chip;
13711371   return chip->status;
13721372}
13731373
r4425r4426
15571557
15581558void ym2151_shutdown(void *_chip)
15591559{
1560   YM2151 *chip = _chip;
1560   YM2151 *chip = (YM2151 *)_chip;
15611561
15621562   free (chip);
15631563
r4425r4426
15881588void ym2151_reset_chip(void *_chip)
15891589{
15901590   int i;
1591   YM2151 *chip = _chip;
1591   YM2151 *chip = (YM2151 *)_chip;
15921592
15931593
15941594   /* initialize hardware registers */
r4425r4426
23772377   bufL = buffers[0];
23782378   bufR = buffers[1];
23792379
2380   PSG = chip;
2380   PSG = (YM2151 *)chip;
23812381
23822382#ifdef USE_MAME_TIMERS
23832383      /* ASG 980324 - handled by real timers now */
r4425r4426
24832483
24842484void ym2151_set_irq_handler(void *chip, void(*handler)(const device_config *device, int irq))
24852485{
2486   YM2151 *PSG = chip;
2486   YM2151 *PSG = (YM2151 *)chip;
24872487   PSG->irqhandler = handler;
24882488}
24892489
24902490void ym2151_set_port_write_handler(void *chip, write8_device_func handler)
24912491{
2492   YM2151 *PSG = chip;
2492   YM2151 *PSG = (YM2151 *)chip;
24932493   PSG->porthandler = handler;
24942494}
24952495
src/emu/sound/c6280.c
r4425r4426
9999
100100static void c6280_init(const device_config *device, c6280_t *p, double clk, double rate)
101101{
102   const c6280_interface *intf = device->static_config;
102   const c6280_interface *intf = (const c6280_interface *)device->static_config;
103103    int i;
104104    double step;
105105
r4425r4426
231231    };
232232    int ch;
233233    int i;
234    c6280_t *p = param;
234    c6280_t *p = (c6280_t *)param;
235235
236236    int lmal = (p->balance >> 4) & 0x0F;
237237    int rmal = (p->balance >> 0) & 0x0F;
src/emu/sound/discrete.c
r4425r4426
232232
233233node_description *discrete_find_node(void *chip, int node)
234234{
235   discrete_info *info = chip ? chip : discrete_current_context;
235   discrete_info *info = chip ? (discrete_info *)chip : discrete_current_context;
236236   if (node < NODE_START || node > NODE_END) return NULL;
237237   return info->indexed_node[NODE_INDEX(node)];
238238}
r4425r4426
248248static DEVICE_START( discrete )
249249{
250250   discrete_sound_block *intf = (discrete_sound_block *)device->static_config;
251   discrete_info *info = device->token;
251   discrete_info *info = get_safe_token(device);
252252   char name[32];
253253
254254   info->device = device;
r4425r4426
292292   discrete_log("discrete_start() - Sanity check counted %d nodes", info->node_count);
293293
294294   /* allocate memory for the array of actual nodes */
295   info->node_list = auto_malloc(info->node_count * sizeof(info->node_list[0]));
295   info->node_list = (node_description *)auto_malloc(info->node_count * sizeof(info->node_list[0]));
296296   memset(info->node_list, 0, info->node_count * sizeof(info->node_list[0]));
297297
298298   /* allocate memory for the node execution order array */
299   info->running_order = auto_malloc(info->node_count * sizeof(info->running_order[0]));
299   info->running_order = (node_description **)auto_malloc(info->node_count * sizeof(info->running_order[0]));
300300   memset(info->running_order, 0, info->node_count * sizeof(info->running_order[0]));
301301
302302   /* allocate memory to hold pointers to nodes by index */
303   info->indexed_node = auto_malloc(DISCRETE_MAX_NODES * sizeof(info->indexed_node[0]));
303   info->indexed_node = (node_description **)auto_malloc(DISCRETE_MAX_NODES * sizeof(info->indexed_node[0]));
304304   memset(info->indexed_node, 0, DISCRETE_MAX_NODES * sizeof(info->indexed_node[0]));
305305
306306   /* initialize the node data */
r4425r4426
327327
328328static DEVICE_STOP( discrete )
329329{
330   discrete_info *info = device->token;
330   discrete_info *info = get_safe_token(device);
331331   int log_num;
332332
333333#if (DISCRETE_PROFILING)
r4425r4426
387387
388388static DEVICE_RESET( discrete )
389389{
390   discrete_info *info = device->token;
390   discrete_info *info = get_safe_token(device);
391391   int nodenum;
392392
393393   discrete_current_context = info;
r4425r4426
421421
422422static STREAM_UPDATE( discrete_stream_update )
423423{
424   discrete_info *info = param;
424   discrete_info *info = (discrete_info *)param;
425425   int samplenum, nodenum, outputnum;
426426   double val;
427427   INT16 wave_data_l, wave_data_r;
r4425r4426
596596      /* setup module if custom */
597597      if (block->type == DST_CUSTOM)
598598      {
599         const discrete_custom_info *custom = node->custom;
599         const discrete_custom_info *custom = (const discrete_custom_info *)node->custom;
600600         node->module.reset = custom->reset;
601601         node->module.step = custom->step;
602602         node->module.contextsize = custom->contextsize;
src/emu/sound/samples.c
r4425r4426
153153      unsigned char *tempptr;
154154      int sindex;
155155
156      sample->data = auto_malloc(sizeof(*sample->data) * length);
156      sample->data = (INT16 *)auto_malloc(sizeof(*sample->data) * length);
157157      mame_fread(f, sample->data, length);
158158
159159      /* convert 8-bit data to signed samples */
r4425r4426
164164   else
165165   {
166166      /* 16-bit data is fine as-is */
167      sample->data = auto_malloc(sizeof(*sample->data) * (length/2));
167      sample->data = (INT16 *)auto_malloc(sizeof(*sample->data) * (length/2));
168168      mame_fread(f, sample->data, length);
169169      sample->length /= 2;
170170      if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE)
r4425r4426
201201      return NULL;
202202
203203   /* allocate the array */
204   samples = auto_malloc(sizeof(struct loaded_samples) + (i-1) * sizeof(struct loaded_sample));
204   samples = (struct loaded_samples *)auto_malloc(sizeof(struct loaded_samples) + (i-1) * sizeof(struct loaded_sample));
205205   memset(samples, 0, sizeof(struct loaded_samples) + (i-1) * sizeof(struct loaded_sample));
206206   samples->total = i;
207207
r4425r4426
387387
388388static STREAM_UPDATE( sample_update_sound )
389389{
390   sample_channel *chan = param;
390   sample_channel *chan = (sample_channel *)param;
391391   stream_sample_t *buffer = outputs[0];
392392
393393   if (chan->source && !chan->paused)
r4425r4426
439439
440440static STATE_POSTLOAD( samples_postload )
441441{
442   samples_info *info = param;
442   samples_info *info = (samples_info *)param;
443443   int i;
444444
445445   /* loop over channels */
r4425r4426
475475static DEVICE_START( samples )
476476{
477477   int i;
478   const samples_interface *intf = device->static_config;
478   const samples_interface *intf = (const samples_interface *)device->static_config;
479479   samples_info *info = get_safe_token(device);
480480
481481   info->device = device;
r4425r4426
487487   /* allocate channels */
488488   info->numchannels = intf->channels;
489489   assert(info->numchannels < MAX_CHANNELS);
490   info->channel = auto_malloc(sizeof(*info->channel) * info->numchannels);
490   info->channel = (sample_channel *)auto_malloc(sizeof(*info->channel) * info->numchannels);
491491   for (i = 0; i < info->numchannels; i++)
492492   {
493493       info->channel[i].stream = stream_create(device, 0, 1, device->machine->sample_rate, &info->channel[i], sample_update_sound);
src/emu/sound/msm5232.c
r4425r4426
712712
713713static STREAM_UPDATE( MSM5232_update_one )
714714{
715   MSM5232 * chip = param;
715   MSM5232 * chip = (MSM5232 *)param;
716716   stream_sample_t *buf1 = outputs[0];
717717   stream_sample_t *buf2 = outputs[1];
718718   stream_sample_t *buf3 = outputs[2];
r4425r4426
787787
788788static DEVICE_START( msm5232 )
789789{
790   const msm5232_interface *intf = device->static_config;
790   const msm5232_interface *intf = (const msm5232_interface *)device->static_config;
791791   int rate = device->clock/CLOCK_RATE_DIVIDER;
792   MSM5232 *chip = device->token;
792   MSM5232 *chip = get_safe_token(device);
793793
794794   chip->device = device;
795795
src/emu/sound/scsp.c
r4425r4426
12231223
12241224static STREAM_UPDATE( SCSP_Update )
12251225{
1226   struct _SCSP *SCSP = param;
1226   struct _SCSP *SCSP = (struct _SCSP *)param;
12271227   bufferl = outputs[0];
12281228   bufferr = outputs[1];
12291229   length = samples;
r4425r4426
12361236
12371237   struct _SCSP *SCSP = get_safe_token(device);
12381238
1239   intf = device->static_config;
1239   intf = (const scsp_interface *)device->static_config;
12401240
12411241   // init the emulation
12421242   SCSP_Init(device, SCSP, intf);
r4425r4426
12551255   struct _SCSP *SCSP = get_safe_token(device);
12561256   if (SCSP)
12571257   {
1258      SCSP->SCSPRAM = base;
1259      SCSP->DSP.SCSPRAM = base;
1258      SCSP->SCSPRAM = (unsigned char *)base;
1259      SCSP->DSP.SCSPRAM = (UINT16 *)base;
12601260      SCSP->SCSPRAM_LENGTH = 0x80000;
12611261      SCSP->DSP.SCSPRAM_LENGTH = 0x80000/2;
12621262   }
src/emu/sound/flt_rc.c
r4425r4426
2828{
2929   stream_sample_t *src = inputs[0];
3030   stream_sample_t *dst = outputs[0];
31   filter_rc_state *info = param;
31   filter_rc_state *info = (filter_rc_state *)param;
3232   int memory = info->memory;
3333
3434   switch (info->type)
r4425r4426
9393static DEVICE_START( filter_rc )
9494{
9595   filter_rc_state *info = get_safe_token(device);
96   const flt_rc_config *conf = device->static_config;
96   const flt_rc_config *conf = (const flt_rc_config *)device->static_config;
9797
9898   info->device = device;
9999   info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_rc_update);
src/emu/sound/2610intf.c
r4425r4426
4141
4242static void psg_set_clock(void *param, int clock)
4343{
44   ym2610_state *info = param;
44   ym2610_state *info = (ym2610_state *)param;
4545   ay8910_set_clock_ym(info->psg, clock);
4646}
4747
4848static void psg_write(void *param, int address, int data)
4949{
50   ym2610_state *info = param;
50   ym2610_state *info = (ym2610_state *)param;
5151   ay8910_write_ym(info->psg, address, data);
5252}
5353
5454static int psg_read(void *param)
5555{
56   ym2610_state *info = param;
56   ym2610_state *info = (ym2610_state *)param;
5757   return ay8910_read_ym(info->psg);
5858}
5959
6060static void psg_reset(void *param)
6161{
62   ym2610_state *info = param;
62   ym2610_state *info = (ym2610_state *)param;
6363   ay8910_reset_ym(info->psg);
6464}
6565
r4425r4426
7575/* IRQ Handler */
7676static void IRQHandler(void *param,int irq)
7777{
78   ym2610_state *info = param;
78   ym2610_state *info = (ym2610_state *)param;
7979   if(info->intf->handler) info->intf->handler(info->device, irq);
8080}
8181
8282/* Timer overflow callback from timer.c */
8383static TIMER_CALLBACK( timer_callback_0 )
8484{
85   ym2610_state *info = ptr;
85   ym2610_state *info = (ym2610_state *)ptr;
8686   ym2610_timer_over(info->chip,0);
8787}
8888
8989static TIMER_CALLBACK( timer_callback_1 )
9090{
91   ym2610_state *info = ptr;
91   ym2610_state *info = (ym2610_state *)ptr;
9292   ym2610_timer_over(info->chip,1);
9393}
9494
9595static void timer_handler(void *param,int c,int count,int clock)
9696{
97   ym2610_state *info = param;
97   ym2610_state *info = (ym2610_state *)param;
9898   if( count == 0 )
9999   {   /* Reset FM Timer */
100100      timer_enable(info->timer[c], 0);
r4425r4426
111111/* update request from fm.c */
112112void ym2610_update_request(void *param)
113113{
114   ym2610_state *info = param;
114   ym2610_state *info = (ym2610_state *)param;
115115   stream_update(info->stream);
116116}
117117
118118
119119static STREAM_UPDATE( ym2610_stream_update )
120120{
121   ym2610_state *info = param;
121   ym2610_state *info = (ym2610_state *)param;
122122   ym2610_update_one(info->chip, outputs, samples);
123123}
124124
125125static STREAM_UPDATE( ym2610b_stream_update )
126126{
127   ym2610_state *info = param;
127   ym2610_state *info = (ym2610_state *)param;
128128   ym2610b_update_one(info->chip, outputs, samples);
129129}
130130
131131
132132static STATE_POSTLOAD( ym2610_intf_postload )
133133{
134   ym2610_state *info = param;
134   ym2610_state *info = (ym2610_state *)param;
135135   ym2610_postload(info->chip);
136136}
137137
r4425r4426
145145      AY8910_DEFAULT_LOADS,
146146      DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
147147   };
148   const ym2610_interface *intf = device->static_config ? device->static_config : &generic_2610;
148   const ym2610_interface *intf = device->static_config ? (const ym2610_interface *)device->static_config : &generic_2610;
149149   int rate = device->clock/72;
150150   void *pcmbufa,*pcmbufb;
151151   int  pcmsizea,pcmsizeb;
src/emu/sound/fmopl.c
r4425r4426
11871187      /* we never reach zero here due to ((i*2)+1) */
11881188
11891189      if (m>0.0)
1190         o = 8*log(1.0/m)/log(2);   /* convert to 'decibels' */
1190         o = 8*log(1.0/m)/log(2.0);   /* convert to 'decibels' */
11911191      else
1192         o = 8*log(-1.0/m)/log(2);   /* convert to 'decibels' */
1192         o = 8*log(-1.0/m)/log(2.0);   /* convert to 'decibels' */
11931193
11941194      o = o / (ENV_STEP/4);
11951195
r4425r4426
19781978#endif
19791979
19801980   /* allocate memory block */
1981   ptr = malloc(state_size);
1981   ptr = (char *)malloc(state_size);
19821982
19831983   if (ptr==NULL)
19841984      return NULL;
r4425r4426
21692169
21702170void ym3812_shutdown(void *chip)
21712171{
2172   FM_OPL *YM3812 = chip;
2172   FM_OPL *YM3812 = (FM_OPL *)chip;
21732173
21742174   /* emulator shutdown */
21752175   OPLDestroy(YM3812);
21762176}
21772177void ym3812_reset_chip(void *chip)
21782178{
2179   FM_OPL *YM3812 = chip;
2179   FM_OPL *YM3812 = (FM_OPL *)chip;
21802180   OPLResetChip(YM3812);
21812181}
21822182
21832183int ym3812_write(void *chip, int a, int v)
21842184{
2185   FM_OPL *YM3812 = chip;
2185   FM_OPL *YM3812 = (FM_OPL *)chip;
21862186   return OPLWrite(YM3812, a, v);
21872187}
21882188
21892189unsigned char ym3812_read(void *chip, int a)
21902190{
2191   FM_OPL *YM3812 = chip;
2191   FM_OPL *YM3812 = (FM_OPL *)chip;
21922192   /* YM3812 always returns bit2 and bit1 in HIGH state */
21932193   return OPLRead(YM3812, a) | 0x06 ;
21942194}
21952195int ym3812_timer_over(void *chip, int c)
21962196{
2197   FM_OPL *YM3812 = chip;
2197   FM_OPL *YM3812 = (FM_OPL *)chip;
21982198   return OPLTimerOver(YM3812, c);
21992199}
22002200
22012201void ym3812_set_timer_handler(void *chip, OPL_TIMERHANDLER timer_handler, void *param)
22022202{
2203   FM_OPL *YM3812 = chip;
2203   FM_OPL *YM3812 = (FM_OPL *)chip;
22042204   OPLSetTimerHandler(YM3812, timer_handler, param);
22052205}
22062206void ym3812_set_irq_handler(void *chip,OPL_IRQHANDLER IRQHandler,void *param)
22072207{
2208   FM_OPL *YM3812 = chip;
2208   FM_OPL *YM3812 = (FM_OPL *)chip;
22092209   OPLSetIRQHandler(YM3812, IRQHandler, param);
22102210}
22112211void ym3812_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void *param)
22122212{
2213   FM_OPL *YM3812 = chip;
2213   FM_OPL *YM3812 = (FM_OPL *)chip;
22142214   OPLSetUpdateHandler(YM3812, UpdateHandler, param);
22152215}
22162216
r4425r4426
22242224*/
22252225void ym3812_update_one(void *chip, OPLSAMPLE *buffer, int length)
22262226{
2227   FM_OPL      *OPL = chip;
2227   FM_OPL      *OPL = (FM_OPL *)chip;
22282228   UINT8      rhythm = OPL->rhythm&0x20;
22292229   OPLSAMPLE   *buf = buffer;
22302230   int i;
r4425r4426
23052305
23062306void ym3526_shutdown(void *chip)
23072307{
2308   FM_OPL *YM3526 = chip;
2308   FM_OPL *YM3526 = (FM_OPL *)chip;
23092309   /* emulator shutdown */
23102310   OPLDestroy(YM3526);
23112311}
23122312void ym3526_reset_chip(void *chip)
23132313{
2314   FM_OPL *YM3526 = chip;
2314   FM_OPL *YM3526 = (FM_OPL *)chip;
23152315   OPLResetChip(YM3526);
23162316}
23172317
23182318int ym3526_write(void *chip, int a, int v)
23192319{
2320   FM_OPL *YM3526 = chip;
2320   FM_OPL *YM3526 = (FM_OPL *)chip;
23212321   return OPLWrite(YM3526, a, v);
23222322}
23232323
23242324unsigned char ym3526_read(void *chip, int a)
23252325{
2326   FM_OPL *YM3526 = chip;
2326   FM_OPL *YM3526 = (FM_OPL *)chip;
23272327   /* YM3526 always returns bit2 and bit1 in HIGH state */
23282328   return OPLRead(YM3526, a) | 0x06 ;
23292329}
23302330int ym3526_timer_over(void *chip, int c)
23312331{
2332   FM_OPL *YM3526 = chip;
2332   FM_OPL *YM3526 = (FM_OPL *)chip;
23332333   return OPLTimerOver(YM3526, c);
23342334}
23352335
23362336void ym3526_set_timer_handler(void *chip, OPL_TIMERHANDLER timer_handler, void *param)
23372337{
2338   FM_OPL *YM3526 = chip;
2338   FM_OPL *YM3526 = (FM_OPL *)chip;
23392339   OPLSetTimerHandler(YM3526, timer_handler, param);
23402340}
23412341void ym3526_set_irq_handler(void *chip,OPL_IRQHANDLER IRQHandler,void *param)
23422342{
2343   FM_OPL *YM3526 = chip;
2343   FM_OPL *YM3526 = (FM_OPL *)chip;
23442344   OPLSetIRQHandler(YM3526, IRQHandler, param);
23452345}
23462346void ym3526_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void *param)
23472347{
2348   FM_OPL *YM3526 = chip;
2348   FM_OPL *YM3526 = (FM_OPL *)chip;
23492349   OPLSetUpdateHandler(YM3526, UpdateHandler, param);
23502350}
23512351
r4425r4426
23592359*/
23602360void ym3526_update_one(void *chip, OPLSAMPLE *buffer, int length)
23612361{
2362   FM_OPL      *OPL = chip;
2362   FM_OPL      *OPL = (FM_OPL *)chip;
23632363   UINT8      rhythm = OPL->rhythm&0x20;
23642364   OPLSAMPLE   *buf = buffer;
23652365   int i;
r4425r4426
24292429
24302430static void Y8950_deltat_status_set(void *chip, UINT8 changebits)
24312431{
2432   FM_OPL *Y8950 = chip;
2432   FM_OPL *Y8950 = (FM_OPL *)chip;
24332433   OPL_STATUS_SET(Y8950, changebits);
24342434}
24352435static void Y8950_deltat_status_reset(void *chip, UINT8 changebits)
24362436{
2437   FM_OPL *Y8950 = chip;
2437   FM_OPL *Y8950 = (FM_OPL *)chip;
24382438   OPL_STATUS_RESET(Y8950, changebits);
24392439}
24402440
r4425r4426
24622462
24632463void y8950_shutdown(void *chip)
24642464{
2465   FM_OPL *Y8950 = chip;
2465   FM_OPL *Y8950 = (FM_OPL *)chip;
24662466   /* emulator shutdown */
24672467   OPLDestroy(Y8950);
24682468}
24692469void y8950_reset_chip(void *chip)
24702470{
2471   FM_OPL *Y8950 = chip;
2471   FM_OPL *Y8950 = (FM_OPL *)chip;
24722472   OPLResetChip(Y8950);
24732473}
24742474
24752475int y8950_write(void *chip, int a, int v)
24762476{
2477   FM_OPL *Y8950 = chip;
2477   FM_OPL *Y8950 = (FM_OPL *)chip;
24782478   return OPLWrite(Y8950, a, v);
24792479}
24802480
24812481unsigned char y8950_read(void *chip, int a)
24822482{
2483   FM_OPL *Y8950 = chip;
2483   FM_OPL *Y8950 = (FM_OPL *)chip;
24842484   return OPLRead(Y8950, a);
24852485}
24862486int y8950_timer_over(void *chip, int c)
24872487{
2488   FM_OPL *Y8950 = chip;
2488   FM_OPL *Y8950 = (FM_OPL *)chip;
24892489   return OPLTimerOver(Y8950, c);
24902490}
24912491
24922492void y8950_set_timer_handler(void *chip, OPL_TIMERHANDLER timer_handler, void *param)
24932493{
2494   FM_OPL *Y8950 = chip;
2494   FM_OPL *Y8950 = (FM_OPL *)chip;
24952495   OPLSetTimerHandler(Y8950, timer_handler, param);
24962496}
24972497void y8950_set_irq_handler(void *chip,OPL_IRQHANDLER IRQHandler,void *param)
24982498{
2499   FM_OPL *Y8950 = chip;
2499   FM_OPL *Y8950 = (FM_OPL *)chip;
25002500   OPLSetIRQHandler(Y8950, IRQHandler, param);
25012501}
25022502void y8950_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void *param)
25032503{
2504   FM_OPL *Y8950 = chip;
2504   FM_OPL *Y8950 = (FM_OPL *)chip;
25052505   OPLSetUpdateHandler(Y8950, UpdateHandler, param);
25062506}
25072507
25082508void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_size )
25092509{
2510   FM_OPL      *OPL = chip;
2510   FM_OPL      *OPL = (FM_OPL *)chip;
25112511   OPL->deltat->memory = (UINT8 *)(deltat_mem_ptr);
25122512   OPL->deltat->memory_size = deltat_mem_size;
25132513}
r4425r4426
25222522void y8950_update_one(void *chip, OPLSAMPLE *buffer, int length)
25232523{
25242524   int i;
2525   FM_OPL      *OPL = chip;
2525   FM_OPL      *OPL = (FM_OPL *)chip;
25262526   UINT8      rhythm  = OPL->rhythm&0x20;
25272527   YM_DELTAT   *DELTAT = OPL->deltat;
25282528   OPLSAMPLE   *buf    = buffer;
r4425r4426
25922592
25932593void y8950_set_port_handler(void *chip,OPL_PORTHANDLER_W PortHandler_w,OPL_PORTHANDLER_R PortHandler_r,void * param)
25942594{
2595   FM_OPL      *OPL = chip;
2595   FM_OPL      *OPL = (FM_OPL *)chip;
25962596   OPL->porthandler_w = PortHandler_w;
25972597   OPL->porthandler_r = PortHandler_r;
25982598   OPL->port_param = param;
r4425r4426
26002600
26012601void y8950_set_keyboard_handler(void *chip,OPL_PORTHANDLER_W KeyboardHandler_w,OPL_PORTHANDLER_R KeyboardHandler_r,void * param)
26022602{
2603   FM_OPL      *OPL = chip;
2603   FM_OPL      *OPL = (FM_OPL *)chip;
26042604   OPL->keyboardhandler_w = KeyboardHandler_w;
26052605   OPL->keyboardhandler_r = KeyboardHandler_r;
26062606   OPL->keyboard_param = param;
src/emu/sound/tms3615.c
r4425r4426
3333
3434static STREAM_UPDATE( tms3615_sound_update )
3535{
36   tms_state *tms = param;
36   tms_state *tms = (tms_state *)param;
3737   int samplerate = tms->samplerate;
3838   stream_sample_t *buffer8 = outputs[TMS3615_FOOTAGE_8];
3939   stream_sample_t *buffer16 = outputs[TMS3615_FOOTAGE_16];
src/emu/sound/ics2115.c
r4425r4426
9696
9797static STREAM_UPDATE( update )
9898{
99   ics2115_state *chip = param;
99   ics2115_state *chip = (ics2115_state *)param;
100100   int osc, i;
101101   int rec_irq = 0;
102102
r4425r4426
164164
165165static TIMER_CALLBACK( timer_cb_0 )
166166{
167   ics2115_state *chip = ptr;
167   ics2115_state *chip = (ics2115_state *)ptr;
168168   chip->irq_pend |= 1<<0;
169169   recalc_irq(chip);
170170}
171171
172172static TIMER_CALLBACK( timer_cb_1 )
173173{
174   ics2115_state *chip = ptr;
174   ics2115_state *chip = (ics2115_state *)ptr;
175175   chip->irq_pend |= 1<<1;
176176   recalc_irq(chip);
177177}
r4425r4426
455455   int i;
456456
457457   chip->device = device;
458   chip->intf = device->static_config;
458   chip->intf = (const ics2115_interface *)device->static_config;
459459   chip->rom = device->region;
460460   chip->timer[0].timer = timer_alloc(device->machine, timer_cb_0, chip);
461461   chip->timer[1].timer = timer_alloc(device->machine, timer_cb_1, chip);
462   chip->ulaw = auto_malloc(256*sizeof(INT16));
462   chip->ulaw = (INT16 *)auto_malloc(256*sizeof(INT16));
463463   chip->stream = stream_create(device, 0, 2, 33075, chip, update);
464464
465465   for(i=0; i<256; i++) {
src/emu/sound/dac.c
r4425r4426
3030
3131static STREAM_UPDATE( DAC_update )
3232{
33   dac_state *info = param;
33   dac_state *info = (dac_state *)param;
3434   stream_sample_t *buffer = outputs[0];
3535   INT16 out = info->output;
3636
src/emu/sound/s14001a.c
r4425r4426
545545{
546546   INT32 mix[48000];
547547   INT32 *mixp;
548   S14001AChip *chip = param;
548   S14001AChip *chip = (S14001AChip *)param;
549549   int i;
550550
551551   memset(mix, 0, sizeof(mix));
src/emu/sound/gaelco.c
r4425r4426
7777   INT16 volume_table[VOLUME_LEVELS][256];
7878};
7979
80static void *   wavraw;               /* raw waveform */
80static wav_file *   wavraw;               /* raw waveform */
8181
8282INLINE gaelco_sound_state *get_safe_token(const device_config *device)
8383{
r4425r4426
9696
9797static STREAM_UPDATE( gaelco_update )
9898{
99   gaelco_sound_state *info = param;
99   gaelco_sound_state *info = (gaelco_sound_state *)param;
100100   int j, ch;
101101
102102    /* fill all data needed */
r4425r4426
256256static DEVICE_START( gaelco )
257257{
258258   int j, vol;
259   const gaelcosnd_interface *intf = device->static_config;
259   const gaelcosnd_interface *intf = (const gaelcosnd_interface *)device->static_config;
260260
261261   gaelco_sound_state *info = get_safe_token(device);
262262
src/emu/sound/dac.h
r4425r4426
33#ifndef __DAC_H__
44#define __DAC_H__
55
6void dac_data_w(const device_config *device, UINT8 data) ATTR_NONNULL;
7void dac_signed_data_w(const device_config *device, UINT8 data) ATTR_NONNULL;
8void dac_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL;
9void dac_signed_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL;
6void dac_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1);
7void dac_signed_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1);
8void dac_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1);
9void dac_signed_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1);
1010
1111WRITE8_DEVICE_HANDLER( dac_w );
1212WRITE8_DEVICE_HANDLER( dac_signed_w );
src/emu/sound/fm.c
r4425r4426
17391739      /* we never reach zero here due to ((i*2)+1) */
17401740
17411741      if (m>0.0)
1742         o = 8*log(1.0/m)/log(2);   /* convert to 'decibels' */
1742         o = 8*log(1.0/m)/log(2.0);   /* convert to 'decibels' */
17431743      else
1744         o = 8*log(-1.0/m)/log(2);   /* convert to 'decibels' */
1744         o = 8*log(-1.0/m)/log(2.0);   /* convert to 'decibels' */
17451745
17461746      o = o / (ENV_STEP/4);
17471747
r4425r4426
22602260/* Generate samples for one of the YM2203s */
22612261void ym2203_update_one(void *chip, FMSAMPLE *buffer, int length)
22622262{
2263   YM2203 *F2203 = chip;
2263   YM2203 *F2203 = (YM2203 *)chip;
22642264   FM_OPN *OPN =   &F2203->OPN;
22652265   int i;
22662266   FMSAMPLE *buf = buffer;
r4425r4426
23442344void ym2203_reset_chip(void *chip)
23452345{
23462346   int i;
2347   YM2203 *F2203 = chip;
2347   YM2203 *F2203 = (YM2203 *)chip;
23482348   FM_OPN *OPN = &F2203->OPN;
23492349
23502350   /* Reset Prescaler */
r4425r4426
24542454/* shut down emulator */
24552455void ym2203_shutdown(void *chip)
24562456{
2457   YM2203 *FM2203 = chip;
2457   YM2203 *FM2203 = (YM2203 *)chip;
24582458
24592459   FMCloseTable();
24602460   free(FM2203);
r4425r4426
24632463/* YM2203 I/O interface */
24642464int ym2203_write(void *chip,int a,UINT8 v)
24652465{
2466   YM2203 *F2203 = chip;
2466   YM2203 *F2203 = (YM2203 *)chip;
24672467   FM_OPN *OPN = &F2203->OPN;
24682468
24692469   if( !(a&1) )
r4425r4426
25042504
25052505UINT8 ym2203_read(void *chip,int a)
25062506{
2507   YM2203 *F2203 = chip;
2507   YM2203 *F2203 = (YM2203 *)chip;
25082508   int addr = F2203->OPN.ST.address;
25092509   UINT8 ret = 0;
25102510
r4425r4426
25212521
25222522int ym2203_timer_over(void *chip,int c)
25232523{
2524   YM2203 *F2203 = chip;
2524   YM2203 *F2203 = (YM2203 *)chip;
25252525
25262526   if( c )
25272527   {   /* Timer B */
r4425r4426
34273427/* Generate samples for one of the YM2608s */
34283428void ym2608_update_one(void *chip, FMSAMPLE **buffer, int length)
34293429{
3430   YM2608 *F2608 = chip;
3430   YM2608 *F2608 = (YM2608 *)chip;
34313431   FM_OPN *OPN   = &F2608->OPN;
34323432   YM_DELTAT *DELTAT = &F2608->deltaT;
34333433   int i,j;
r4425r4426
36303630
36313631static void YM2608_deltat_status_set(void *chip, UINT8 changebits)
36323632{
3633   YM2608 *F2608 = chip;
3633   YM2608 *F2608 = (YM2608 *)chip;
36343634   FM_STATUS_SET(&(F2608->OPN.ST), changebits);
36353635}
36363636static void YM2608_deltat_status_reset(void *chip, UINT8 changebits)
36373637{
3638   YM2608 *F2608 = chip;
3638   YM2608 *F2608 = (YM2608 *)chip;
36393639   FM_STATUS_RESET(&(F2608->OPN.ST), changebits);
36403640}
36413641/* YM2608(OPNA) */
r4425r4426
36983698/* shut down emulator */
36993699void ym2608_shutdown(void *chip)
37003700{
3701   YM2608 *F2608 = chip;
3701   YM2608 *F2608 = (YM2608 *)chip;
37023702
37033703   FMCloseTable();
37043704   free(F2608);
r4425r4426
37083708void ym2608_reset_chip(void *chip)
37093709{
37103710   int i;
3711   YM2608 *F2608 = chip;
3711   YM2608 *F2608 = (YM2608 *)chip;
37123712   FM_OPN *OPN   = &F2608->OPN;
37133713   YM_DELTAT *DELTAT = &F2608->deltaT;
37143714
r4425r4426
37893789/* v = value   */
37903790int ym2608_write(void *chip, int a,UINT8 v)
37913791{
3792   YM2608 *F2608 = chip;
3792   YM2608 *F2608 = (YM2608 *)chip;
37933793   FM_OPN *OPN   = &F2608->OPN;
37943794   int addr;
37953795
r4425r4426
38853885
38863886UINT8 ym2608_read(void *chip,int a)
38873887{
3888   YM2608 *F2608 = chip;
3888   YM2608 *F2608 = (YM2608 *)chip;
38893889   int addr = F2608->OPN.ST.address;
38903890   UINT8 ret = 0;
38913891
r4425r4426
39253925
39263926int ym2608_timer_over(void *chip,int c)
39273927{
3928   YM2608 *F2608 = chip;
3928   YM2608 *F2608 = (YM2608 *)chip;
39293929
39303930    switch(c)
39313931   {
r4425r4426
39703970/* Generate samples for one of the YM2610s */
39713971void ym2610_update_one(void *chip, FMSAMPLE **buffer, int length)
39723972{
3973   YM2610 *F2610 = chip;
3973   YM2610 *F2610 = (YM2610 *)chip;
39743974   FM_OPN *OPN   = &F2610->OPN;
39753975   YM_DELTAT *DELTAT = &F2610->deltaT;
39763976   int i,j;
r4425r4426
41074107/* Generate samples for one of the YM2610Bs */
41084108void ym2610b_update_one(void *chip, FMSAMPLE **buffer, int length)
41094109{
4110   YM2610 *F2610 = chip;
4110   YM2610 *F2610 = (YM2610 *)chip;
41114111   FM_OPN *OPN   = &F2610->OPN;
41124112   YM_DELTAT *DELTAT = &F2610->deltaT;
41134113   int i,j;
r4425r4426
43144314
43154315static void YM2610_deltat_status_set(void *chip, UINT8 changebits)
43164316{
4317   YM2610 *F2610 = chip;
4317   YM2610 *F2610 = (YM2610 *)chip;
43184318   F2610->adpcm_arrivedEndAddress |= changebits;
43194319}
43204320static void YM2610_deltat_status_reset(void *chip, UINT8 changebits)
43214321{
4322   YM2610 *F2610 = chip;
4322   YM2610 *F2610 = (YM2610 *)chip;
43234323   F2610->adpcm_arrivedEndAddress &= (~changebits);
43244324}
43254325
r4425r4426
43754375/* shut down emulator */
43764376void ym2610_shutdown(void *chip)
43774377{
4378   YM2610 *F2610 = chip;
4378   YM2610 *F2610 = (YM2610 *)chip;
43794379
43804380   FMCloseTable();
43814381   free(F2610);
r4425r4426
43854385void ym2610_reset_chip(void *chip)
43864386{
43874387   int i;
4388   YM2610 *F2610 = chip;
4388   YM2610 *F2610 = (YM2610 *)chip;
43894389   FM_OPN *OPN   = &F2610->OPN;
43904390   YM_DELTAT *DELTAT = &F2610->deltaT;
43914391
r4425r4426
44504450/* v = value   */
44514451int ym2610_write(void *chip, int a, UINT8 v)
44524452{
4453   YM2610 *F2610 = chip;
4453   YM2610 *F2610 = (YM2610 *)chip;
44544454   FM_OPN *OPN   = &F2610->OPN;
44554455   int addr;
44564456   int ch;
r4425r4426
45524552
45534553UINT8 ym2610_read(void *chip,int a)
45544554{
4555   YM2610 *F2610 = chip;
4555   YM2610 *F2610 = (YM2610 *)chip;
45564556   int addr = F2610->OPN.ST.address;
45574557   UINT8 ret = 0;
45584558
r4425r4426
45804580
45814581int ym2610_timer_over(void *chip,int c)
45824582{
4583   YM2610 *F2610 = chip;
4583   YM2610 *F2610 = (YM2610 *)chip;
45844584
45854585   if( c )
45864586   {   /* Timer B */
r4425r4426
46264626/* Generate samples for one of the YM2612s */
46274627void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length)
46284628{
4629   YM2612 *F2612 = chip;
4629   YM2612 *F2612 = (YM2612 *)chip;
46304630   FM_OPN *OPN   = &F2612->OPN;
46314631   int i;
46324632   FMSAMPLE  *bufL,*bufR;
r4425r4426
48274827/* shut down emulator */
48284828void ym2612_shutdown(void *chip)
48294829{
4830   YM2612 *F2612 = chip;
4830   YM2612 *F2612 = (YM2612 *)chip;
48314831
48324832   FMCloseTable();
48334833   free(F2612);
r4425r4426
48374837void ym2612_reset_chip(void *chip)
48384838{
48394839   int i;
4840   YM2612 *F2612 = chip;
4840   YM2612 *F2612 = (YM2612 *)chip;
48414841   FM_OPN *OPN   = &F2612->OPN;
48424842
48434843   OPNSetPres( OPN, 6*24, 6*24, 0);
r4425r4426
48734873/* v = value   */
48744874int ym2612_write(void *chip, int a, UINT8 v)
48754875{
4876   YM2612 *F2612 = chip;
4876   YM2612 *F2612 = (YM2612 *)chip;
48774877   int addr;
48784878
48794879   v &= 0xff;   /* adjust to 8 bit bus */
r4425r4426
49364936
49374937UINT8 ym2612_read(void *chip,int a)
49384938{
4939   YM2612 *F2612 = chip;
4939   YM2612 *F2612 = (YM2612 *)chip;
49404940
49414941   switch( a&3){
49424942   case 0:   /* status 0 */
r4425r4426
49524952
49534953int ym2612_timer_over(void *chip,int c)
49544954{
4955   YM2612 *F2612 = chip;
4955   YM2612 *F2612 = (YM2612 *)chip;
49564956
49574957   if( c )
49584958   {   /* Timer B */
src/emu/sound/bsmt2000.c
r4425r4426
186186{
187187   stream_sample_t *left = outputs[0];
188188   stream_sample_t *right = outputs[1];
189   bsmt2000_chip *chip = param;
189   bsmt2000_chip *chip = (bsmt2000_chip *)param;
190190   bsmt2000_voice *voice;
191191   int samp, voicenum;
192192
src/emu/sound/wavwrite.c
r4425r4426
126126   if (!wav) return;
127127
128128   /* allocate temp memory */
129   temp = malloc(samples * sizeof(temp[0]));
129   temp = (INT16 *)malloc(samples * sizeof(temp[0]));
130130   if (!temp)
131131      return;
132132
r4425r4426
154154   if (!wav) return;
155155
156156   /* allocate temp memory */
157   temp = malloc(samples * 2 * sizeof(temp[0]));
157   temp = (INT16 *)malloc(samples * 2 * sizeof(temp[0]));
158158   if (!temp)
159159      return;
160160
r4425r4426
179179   if (!wav) return;
180180
181181   /* allocate temp memory */
182   temp = malloc(samples * 2 * sizeof(temp[0]));
182   temp = (INT16 *)malloc(samples * 2 * sizeof(temp[0]));
183183   if (!temp)
184184      return;
185185
src/emu/sound/dmadac.c
r4425r4426
7474
7575static STREAM_UPDATE( dmadac_update )
7676{
77   dmadac_state *ch = param;
77   dmadac_state *ch = (dmadac_state *)param;
7878   stream_sample_t *output = outputs[0];
7979   INT16 *source = ch->buffer;
8080   UINT32 curout = ch->bufout;
r4425r4426
103103
104104static DEVICE_START( dmadac )
105105{
106   dmadac_state *info = device->token;
106   dmadac_state *info = get_safe_token(device);
107107
108108   /* allocate a clear a buffer */
109   info->buffer = auto_malloc(sizeof(info->buffer[0]) * BUFFER_SIZE);
109   info->buffer = (INT16 *)auto_malloc(sizeof(info->buffer[0]) * BUFFER_SIZE);
110110   memset(info->buffer, 0, sizeof(info->buffer[0]) * BUFFER_SIZE);
111111
112112   /* reset the state */
src/emu/sound/2608intf.c
r4425r4426
4242
4343static void psg_set_clock(void *param, int clock)
4444{
45   ym2608_state *info = param;
45   ym2608_state *info = (ym2608_state *)param;
4646   ay8910_set_clock_ym(info->psg, clock);
4747}
4848
4949static void psg_write(void *param, int address, int data)
5050{
51   ym2608_state *info = param;
51   ym2608_state *info = (ym2608_state *)param;
5252   ay8910_write_ym(info->psg, address, data);
5353}
5454
5555static int psg_read(void *param)
5656{
57   ym2608_state *info = param;
57   ym2608_state *info = (ym2608_state *)param;
5858   return ay8910_read_ym(info->psg);
5959}
6060
6161static void psg_reset(void *param)
6262{
63   ym2608_state *info = param;
63   ym2608_state *info = (ym2608_state *)param;
6464   ay8910_reset_ym(info->psg);
6565}
6666
r4425r4426
7676/* IRQ Handler */
7777static void IRQHandler(void *param,int irq)
7878{
79   ym2608_state *info = param;
79   ym2608_state *info = (ym2608_state *)param;
8080   if(info->intf->handler) info->intf->handler(info->device, irq);
8181}
8282
8383/* Timer overflow callback from timer.c */
8484static TIMER_CALLBACK( timer_callback_2608_0 )
8585{
86   ym2608_state *info = ptr;
86   ym2608_state *info = (ym2608_state *)ptr;
8787   ym2608_timer_over(info->chip,0);
8888}
8989
9090static TIMER_CALLBACK( timer_callback_2608_1 )
9191{
92   ym2608_state *info = ptr;
92   ym2608_state *info = (ym2608_state *)ptr;
9393   ym2608_timer_over(info->chip,1);
9494}
9595
9696static void timer_handler(void *param,int c,int count,int clock)
9797{
98   ym2608_state *info = param;
98   ym2608_state *info = (ym2608_state *)param;
9999   if( count == 0 )
100100   {   /* Reset FM Timer */
101101      timer_enable(info->timer[c], 0);
r4425r4426
111111/* update request from fm.c */
112112void ym2608_update_request(void *param)
113113{
114   ym2608_state *info = param;
114   ym2608_state *info = (ym2608_state *)param;
115115   stream_update(info->stream);
116116}
117117
118118static STREAM_UPDATE( ym2608_stream_update )
119119{
120   ym2608_state *info = param;
120   ym2608_state *info = (ym2608_state *)param;
121121   ym2608_update_one(info->chip, outputs, samples);
122122}
123123
124124
125125static STATE_POSTLOAD( ym2608_intf_postload )
126126{
127   ym2608_state *info = param;
127   ym2608_state *info = (ym2608_state *)param;
128128   ym2608_postload(info->chip);
129129}
130130
r4425r4426
140140      },
141141      NULL
142142   };
143   const ym2608_interface *intf = device->static_config ? device->static_config : &generic_2608;
143   const ym2608_interface *intf = device->static_config ? (const ym2608_interface *)device->static_config : &generic_2608;
144144   int rate = device->clock/72;
145145   void *pcmbufa;
146146   int  pcmsizea;
src/emu/sound/disc_dev.c
r4425r4426
158158
159159static DISCRETE_STEP(dsd_555_astbl)
160160{
161   const  discrete_555_desc     *info    = node->custom;
162   struct dsd_555_astbl_context *context = node->context;
161   const  discrete_555_desc     *info    = (const  discrete_555_desc *)node->custom;
162   struct dsd_555_astbl_context *context = (struct dsd_555_astbl_context *)node->context;
163163
164164   int      count_f = 0;
165165   int      count_r = 0;
r4425r4426
376376
377377static DISCRETE_RESET(dsd_555_astbl)
378378{
379   const  discrete_555_desc     *info    = node->custom;
380   struct dsd_555_astbl_context *context = node->context;
379   const  discrete_555_desc     *info    = (const  discrete_555_desc *)node->custom;
380   struct dsd_555_astbl_context *context = (struct dsd_555_astbl_context *)node->context;
381381   node_description *v_charge_node;
382382
383383   context->use_ctrlv   = (node->input_is_node >> 4) & 1;
r4425r4426
457457
458458static DISCRETE_STEP(dsd_555_mstbl)
459459{
460   const  discrete_555_desc     *info    = node->custom;
461   struct dsd_555_mstbl_context *context = node->context;
460   const  discrete_555_desc     *info    = (const  discrete_555_desc *)node->custom;
461   struct dsd_555_mstbl_context *context = (struct dsd_555_mstbl_context *)node->context;
462462
463463   double v_cap;         /* Current voltage on capacitor, before dt */
464464   double v_cap_next = 0;   /* Voltage on capacitor, after dt */
r4425r4426
542542
543543static DISCRETE_RESET(dsd_555_mstbl)
544544{
545   const  discrete_555_desc     *info    = node->custom;
546   struct dsd_555_mstbl_context *context = node->context;
545   const  discrete_555_desc     *info    = (const  discrete_555_desc *)node->custom;
546   struct dsd_555_mstbl_context *context = (struct dsd_555_mstbl_context *)node->context;
547547
548548   context->output_type = info->options & DISC_555_OUT_MASK;
549549   if ((context->output_type == DISC_555_OUT_COUNT_F) || (context->output_type == DISC_555_OUT_COUNT_R))
r4425r4426
611611
612612static DISCRETE_STEP(dsd_555_cc)
613613{
614   const  discrete_555_cc_desc *info    = node->custom;
615   struct dsd_555_cc_context   *context = node->context;
614   const  discrete_555_cc_desc *info    = (const  discrete_555_cc_desc *)node->custom;
615   struct dsd_555_cc_context   *context = (struct dsd_555_cc_context *)node->context;
616616
617617   int      count_f  = 0;
618618   int      count_r  = 0;
r4425r4426
931931
932932static DISCRETE_RESET(dsd_555_cc)
933933{
934   const  discrete_555_cc_desc *info    = node->custom;
935   struct dsd_555_cc_context   *context = node->context;
934   const  discrete_555_cc_desc *info    = (const  discrete_555_cc_desc *)node->custom;
935   struct dsd_555_cc_context   *context = (struct dsd_555_cc_context *)node->context;
936936
937937   double   r_temp, r_discharge = 0, r_charge = 0;
938938
r4425r4426
11611161
11621162static DISCRETE_STEP(dsd_555_vco1)
11631163{
1164   const  discrete_555_vco1_desc *info    = node->custom;
1165   struct dsd_555_vco1_context   *context = node->context;
1164   const  discrete_555_vco1_desc *info    = (const  discrete_555_vco1_desc *)node->custom;
1165   struct dsd_555_vco1_context   *context = (struct dsd_555_vco1_context *)node->context;
11661166
11671167   int      count_f = 0;
11681168   int      count_r = 0;
r4425r4426
13141314
13151315static DISCRETE_RESET(dsd_555_vco1)
13161316{
1317   const  discrete_555_vco1_desc *info    = node->custom;
1318   struct dsd_555_vco1_context   *context = node->context;
1317   const  discrete_555_vco1_desc *info    = (const  discrete_555_vco1_desc *)node->custom;
1318   struct dsd_555_vco1_context   *context = (struct dsd_555_vco1_context *)node->context;
13191319
13201320   double v_ratio_r3, v_ratio_r4_1, r_in_1;
13211321
r4425r4426
13921392
13931393static DISCRETE_STEP(dsd_566)
13941394{
1395   const  discrete_566_desc *info    = node->custom;
1396   struct dsd_566_context   *context = node->context;
1395   const  discrete_566_desc *info    = (const  discrete_566_desc *)node->custom;
1396   struct dsd_566_context   *context = (struct dsd_566_context *)node->context;
13971397
13981398   double i;            /* Charging current created by vIn */
13991399   double dt;            /* change in time */
r4425r4426
15131513
15141514static DISCRETE_RESET(dsd_566)
15151515{
1516   const  discrete_566_desc *info    = node->custom;
1517   struct dsd_566_context   *context = node->context;
1516   const  discrete_566_desc *info    = (const  discrete_566_desc *)node->custom;
1517   struct dsd_566_context   *context = (struct dsd_566_context *)node->context;
15181518   node_description *v_charge_node;
15191519
15201520   double   v_diff, temp;
r4425r4426
15981598
15991599static DISCRETE_STEP(dsd_ls624)
16001600{
1601   struct dsd_ls624_context *context = node->context;
1601   struct dsd_ls624_context *context = (struct dsd_ls624_context *)node->context;
16021602
16031603   if (DSD_LS624__ENABLE)
16041604   {
r4425r4426
16531653
16541654static DISCRETE_RESET(dsd_ls624)
16551655{
1656   struct dsd_ls624_context *context = node->context;
1656   struct dsd_ls624_context *context = (struct dsd_ls624_context *)node->context;
16571657
16581658   context->remain   = 0;
16591659   context->state    = 0;
src/emu/sound/okim6376.c
r4425r4426
235235
236236static STREAM_UPDATE( okim6376_update )
237237{
238   okim6376_state *chip = param;
238   okim6376_state *chip = (okim6376_state *)param;
239239   int i;
240240
241241   memset(outputs[0], 0, samples * sizeof(*outputs[0]));
src/emu/sound/okim6295.c
r4425r4426
263263
264264static STREAM_UPDATE( okim6295_update )
265265{
266   okim6295_state *chip = param;
266   okim6295_state *chip = (okim6295_state *)param;
267267   int i;
268268
269269   memset(outputs[0], 0, samples * sizeof(*outputs[0]));
r4425r4426
329329
330330static DEVICE_START( okim6295 )
331331{
332   const okim6295_interface *intf = device->static_config;
332   const okim6295_interface *intf = (const okim6295_interface *)device->static_config;
333333   okim6295_state *info = get_safe_token(device);
334334   int voice;
335335   int divisor = intf->pin7 ? 132 : 165;
src/emu/sound/filter.c
r4425r4426
22#include "filter.h"
33
44static filter* filter_alloc(void) {
5   filter* f = malloc_or_die(sizeof(filter));
5   filter* f = (filter *)malloc_or_die(sizeof(filter));
66   return f;
77}
88
r4425r4426
2020
2121filter_state* filter_state_alloc(void) {
2222   int i;
23        filter_state* s = malloc_or_die(sizeof(filter_state));
23        filter_state* s = (filter_state *)malloc_or_die(sizeof(filter_state));
2424   s->prev_mac = 0;
2525   for(i=0;i<FILTER_ORDER_MAX;++i)
2626      s->xprev[i] = 0;
src/emu/sound/es5506.c
r4425r4426
194194   int i;
195195
196196   /* allocate ulaw lookup table */
197   chip->ulaw_lookup = auto_malloc(sizeof(chip->ulaw_lookup[0]) << ULAW_MAXBITS);
197   chip->ulaw_lookup = (INT16 *)auto_malloc(sizeof(chip->ulaw_lookup[0]) << ULAW_MAXBITS);
198198
199199   /* generate ulaw lookup table */
200200   for (i = 0; i < (1 << ULAW_MAXBITS); i++)
r4425r4426
213213   }
214214
215215   /* allocate volume lookup table */
216   chip->volume_lookup = auto_malloc(sizeof(chip->volume_lookup[0]) * 4096);
216   chip->volume_lookup = (UINT16 *)auto_malloc(sizeof(chip->volume_lookup[0]) * 4096);
217217
218218   /* generate ulaw lookup table */
219219   for (i = 0; i < 4096; i++)
r4425r4426
781781
782782static STREAM_UPDATE( es5506_update )
783783{
784   es5506_state *chip = param;
784   es5506_state *chip = (es5506_state *)param;
785785   INT32 *lsrc = chip->scratch, *rsrc = chip->scratch;
786786   stream_sample_t *ldest = outputs[0];
787787   stream_sample_t *rdest = outputs[1];
r4425r4426
833833
834834static void es5506_start_common(const device_config *device, const void *config, sound_type sndtype)
835835{
836   const es5506_interface *intf = config;
836   const es5506_interface *intf = (const es5506_interface *)config;
837837   es5506_state *chip = get_safe_token(device);
838838   int j;
839839   UINT32 accum_mask;
r4425r4426
873873   }
874874
875875   /* allocate memory */
876   chip->scratch = auto_malloc(sizeof(chip->scratch[0]) * 2 * MAX_SAMPLE_CHUNK);
876   chip->scratch = (INT32 *)auto_malloc(sizeof(chip->scratch[0]) * 2 * MAX_SAMPLE_CHUNK);
877877
878878   /* success */
879879}
r4425r4426
14461446
14471447static DEVICE_START( es5505 )
14481448{
1449   const es5505_interface *intf = device->static_config;
1449   const es5505_interface *intf = (const es5505_interface *)device->static_config;
14501450   es5506_interface es5506intf;
14511451
14521452   memset(&es5506intf, 0, sizeof(es5506intf));
src/emu/sound/ymf278b.c
r4425r4426
266266
267267static STREAM_UPDATE( ymf278b_pcm_update )
268268{
269   YMF278BChip *chip = param;
269   YMF278BChip *chip = (YMF278BChip *)param;
270270   int i, j;
271271   YMF278BSlot *slot = NULL;
272272   INT16 sample = 0;
r4425r4426
355355
356356static TIMER_CALLBACK( ymf278b_timer_a_tick )
357357{
358   YMF278BChip *chip = ptr;
358   YMF278BChip *chip = (YMF278BChip *)ptr;
359359   if(!(chip->enable & 0x40))
360360   {
361361      chip->current_irq |= 0x40;
r4425r4426
365365
366366static TIMER_CALLBACK( ymf278b_timer_b_tick )
367367{
368   YMF278BChip *chip = ptr;
368   YMF278BChip *chip = (YMF278BChip *)ptr;
369369   if(!(chip->enable & 0x20))
370370   {
371371      chip->current_irq |= 0x20;
r4425r4426
676676   chip->irq_line = CLEAR_LINE;
677677   chip->clock = device->clock;
678678
679   mix = auto_malloc(44100*2*sizeof(*mix));
679   mix = (INT32 *)auto_malloc(44100*2*sizeof(*mix));
680680}
681681
682682static DEVICE_START( ymf278b )
r4425r4426
687687   YMF278BChip *chip = get_safe_token(device);
688688
689689   chip->device = device;
690   intf = (device->static_config != NULL) ? device->static_config : &defintrf;
690   intf = (device->static_config != NULL) ? (const ymf278b_interface *)device->static_config : &defintrf;
691691
692692   ymf278b_init(device, chip, intf->irq_callback);
693693   chip->stream = stream_create(device, 0, 2, device->clock/768, chip, ymf278b_pcm_update);
src/emu/sound/disc_wav.c
r4425r4426
183183
184184static DISCRETE_STEP(dss_counter)
185185{
186   struct   dss_counter_context *context = node->context;
186   struct   dss_counter_context *context = (struct   dss_counter_context *)node->context;
187187   double   cycles;
188188   int      clock = 0, last_count, inc = 0;
189189   int      max;
r4425r4426
282282
283283static DISCRETE_RESET(dss_counter)
284284{
285   struct dss_counter_context *context = node->context;
285   struct dss_counter_context *context = (struct dss_counter_context *)node->context;
286286
287287   if ((int)DSS_COUNTER__CLOCK_TYPE & DISC_COUNTER_IS_7492)
288288   {
r4425r4426
393393
394394static DISCRETE_STEP(dss_lfsr)
395395{
396   const  discrete_lfsr_desc *lfsr_desc = node->custom;
397   struct dss_lfsr_context   *context   = node->context;
396   const  discrete_lfsr_desc *lfsr_desc = (const discrete_lfsr_desc *)node->custom;
397   struct dss_lfsr_context   *context   = (struct dss_lfsr_context *)node->context;
398398   double cycles;
399399   int clock, inc = 0;
400400   int fb0, fb1, fbresult;
r4425r4426
483483
484484static DISCRETE_RESET(dss_lfsr)
485485{
486   const  discrete_lfsr_desc *lfsr_desc = node->custom;
487   struct dss_lfsr_context   *context   = node->context;
486   const  discrete_lfsr_desc *lfsr_desc = (const  discrete_lfsr_desc *)node->custom;
487   struct dss_lfsr_context   *context   = (struct dss_lfsr_context *)node->context;
488488   int    fb0 , fb1, fbresult;
489489
490490   context->reset_on_high = (lfsr_desc->flags & DISC_LFSR_FLAG_RESET_TYPE_H) ? 1 : 0;
r4425r4426
537537
538538static DISCRETE_STEP(dss_noise)
539539{
540   struct dss_noise_context *context = node->context;
540   struct dss_noise_context *context = (struct dss_noise_context *)node->context;
541541
542542   if(DSS_NOISE__ENABLE)
543543   {
r4425r4426
574574
575575static DISCRETE_RESET(dss_noise)
576576{
577   struct dss_noise_context *context = node->context;
577   struct dss_noise_context *context = (struct dss_noise_context *)node->context;
578578
579579   context->phase=0;
580580   DISCRETE_STEP_CALL( dss_noise );
r4425r4426
603603
604604static DISCRETE_STEP(dss_note)
605605{
606   struct dss_note_context *context = node->context;
606   struct dss_note_context *context = (struct dss_note_context *)node->context;
607607
608608   double   cycles;
609609   int      clock  = 0, last_count2, inc = 0;
r4425r4426
693693
694694static DISCRETE_RESET(dss_note)
695695{
696   struct dss_note_context *context = node->context;
696   struct dss_note_context *context = (struct dss_note_context *)node->context;
697697
698698   context->clock_type = (int)DSS_NOTE__CLOCK_TYPE & DISC_CLK_MASK;
699699   context->out_type   = (int)DSS_NOTE__CLOCK_TYPE & DISC_OUT_MASK;
r4425r4426
732732
733733static DISCRETE_STEP(dss_op_amp_osc)
734734{
735   const  discrete_op_amp_osc_info *info    = node->custom;
736   struct dss_op_amp_osc_context   *context = node->context;
735   const  discrete_op_amp_osc_info *info    = (const  discrete_op_amp_osc_info *)node->custom;
736   struct dss_op_amp_osc_context   *context = (struct dss_op_amp_osc_context *)node->context;
737737
738738
739739   double i;         /* Charging current created by vIn */
r4425r4426
905905
906906static DISCRETE_RESET(dss_op_amp_osc)
907907{
908   const discrete_op_amp_osc_info *info = node->custom;
909   struct dss_op_amp_osc_context *context = node->context;
908   const discrete_op_amp_osc_info *info = (const discrete_op_amp_osc_info *)node->custom;
909   struct dss_op_amp_osc_context *context = (struct dss_op_amp_osc_context *)node->context;
910910   const double *r_info_ptr;
911911   const double **r_context_ptr;
912912   int loop;
r4425r4426
10481048
10491049static DISCRETE_STEP(dss_sawtoothwave)
10501050{
1051   struct dss_sawtoothwave_context *context = node->context;
1051   struct dss_sawtoothwave_context *context = (struct dss_sawtoothwave_context *)node->context;
10521052
10531053   if(DSS_SAWTOOTHWAVE__ENABLE)
10541054   {
r4425r4426
10741074
10751075static DISCRETE_RESET(dss_sawtoothwave)
10761076{
1077   struct dss_sawtoothwave_context *context = node->context;
1077   struct dss_sawtoothwave_context *context = (struct dss_sawtoothwave_context *)node->context;
10781078   double start;
10791079
10801080   /* Establish starting phase, convert from degrees to radians */
r4425r4426
11081108
11091109static DISCRETE_STEP(dss_schmitt_osc)
11101110{
1111   const  discrete_schmitt_osc_desc *info    = node->custom;
1112   struct dss_schmitt_osc_context   *context = node->context;
1111   const  discrete_schmitt_osc_desc *info    = (const  discrete_schmitt_osc_desc *)node->custom;
1112   struct dss_schmitt_osc_context   *context = (struct dss_schmitt_osc_context *)node->context;
11131113
11141114   double supply, v_cap, new_vCap, t, exponent;
11151115
r4425r4426
11821182
11831183static DISCRETE_RESET(dss_schmitt_osc)
11841184{
1185   const  discrete_schmitt_osc_desc *info    = node->custom;
1186   struct dss_schmitt_osc_context   *context = node->context;
1185   const  discrete_schmitt_osc_desc *info    = (const  discrete_schmitt_osc_desc *)node->custom;
1186   struct dss_schmitt_osc_context   *context = (struct dss_schmitt_osc_context *)node->context;
11871187   double rSource;
11881188
11891189   context->enable_type      =  info->options & DISC_SCHMITT_OSC_ENAB_MASK;
r4425r4426
12271227
12281228static DISCRETE_STEP(dss_sinewave)
12291229{
1230   struct dss_sinewave_context *context = node->context;
1230   struct dss_sinewave_context *context = (struct dss_sinewave_context *)node->context;
12311231
12321232   /* Set the output */
12331233   if(DSS_SINEWAVE__ENABLE)
r4425r4426
12531253
12541254static DISCRETE_RESET(dss_sinewave)
12551255{
1256   struct dss_sinewave_context *context = node->context;
1256   struct dss_sinewave_context *context = (struct dss_sinewave_context *)node->context;
12571257   double start;
12581258
12591259   /* Establish starting phase, convert from degrees to radians */
r4425r4426
12861286
12871287static DISCRETE_STEP(dss_squarewave)
12881288{
1289   struct dss_squarewave_context *context = node->context;
1289   struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context;
12901290
12911291   /* Establish trigger phase from duty */
12921292   context->trigger=((100-DSS_SQUAREWAVE__DUTY)/100)*(2.0*M_PI);
r4425r4426
13191319
13201320static DISCRETE_RESET(dss_squarewave)
13211321{
1322   struct dss_squarewave_context *context = node->context;
1322   struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context;
13231323   double start;
13241324
13251325   /* Establish starting phase, convert from degrees to radians */
r4425r4426
13521352
13531353static DISCRETE_STEP(dss_squarewfix)
13541354{
1355   struct dss_squarewfix_context *context = node->context;
1355   struct dss_squarewfix_context *context = (struct dss_squarewfix_context *)node->context;
13561356
13571357   context->t_left -= context->sample_step;
13581358
r4425r4426
13811381
13821382static DISCRETE_RESET(dss_squarewfix)
13831383{
1384   struct dss_squarewfix_context *context = node->context;
1384   struct dss_squarewfix_context *context = (struct dss_squarewfix_context *)node->context;
13851385
13861386   context->sample_step = 1.0 / discrete_current_context->sample_rate;
13871387   context->flip_flop   = 1;
r4425r4426
14301430
14311431static DISCRETE_STEP(dss_squarewave2)
14321432{
1433   struct dss_squarewave_context *context = node->context;
1433   struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context;
14341434   double newphase;
14351435
14361436   if(DSS_SQUAREWAVE2__ENABLE)
r4425r4426
14651465
14661466static DISCRETE_RESET(dss_squarewave2)
14671467{
1468   struct dss_squarewave_context *context = node->context;
1468   struct dss_squarewave_context *context = (struct dss_squarewave_context *)node->context;
14691469   double start;
14701470
14711471   /* Establish starting phase, convert from degrees to radians */
r4425r4426
15011501
15021502INLINE double dss_inverter_tftab(node_description *node, double x)
15031503{
1504   const  discrete_inverter_osc_desc *info    = node->custom;
1505   struct dss_inverter_osc_context   *context = node->context;
1504   const  discrete_inverter_osc_desc *info    = (const  discrete_inverter_osc_desc *)node->custom;
1505   struct dss_inverter_osc_context   *context = (struct dss_inverter_osc_context *)node->context;
15061506
15071507   x = x / info->vB;
15081508   if (x > 0)
r4425r4426
15131513
15141514INLINE double dss_inverter_tf(node_description *node, double x)
15151515{
1516   const  discrete_inverter_osc_desc *info    = node->custom;
1517   struct dss_inverter_osc_context   *context = node->context;
1516   const  discrete_inverter_osc_desc *info    = (const  discrete_inverter_osc_desc *)node->custom;
1517   struct dss_inverter_osc_context   *context = (struct dss_inverter_osc_context *)node->context;
15181518
15191519   if (x < 0.0)
15201520      return info->vB;
r4425r4426
15261526
15271527static DISCRETE_STEP(dss_inverter_osc)
15281528{
1529   struct dss_inverter_osc_context   *context = node->context;
1530   const  discrete_inverter_osc_desc *info = node->custom;
1529   struct dss_inverter_osc_context   *context = (struct dss_inverter_osc_context *)node->context;
1530   const  discrete_inverter_osc_desc *info = (const  discrete_inverter_osc_desc *)node->custom;
15311531
15321532   double diff, vG1, vG2, vG3, vI;
15331533   double vMix, rMix;
r4425r4426
16331633
16341634static DISCRETE_RESET(dss_inverter_osc)
16351635{
1636   struct dss_inverter_osc_context   *context = node->context;
1637   const  discrete_inverter_osc_desc *info    = node->custom;
1636   struct dss_inverter_osc_context   *context = (struct dss_inverter_osc_context *)node->context;
1637   const  discrete_inverter_osc_desc *info    = (const  discrete_inverter_osc_desc *)node->custom;
16381638
16391639   int i;
16401640
r4425r4426
16771677
16781678static DISCRETE_STEP(dss_trianglewave)
16791679{
1680   struct dss_trianglewave_context *context = node->context;
1680   struct dss_trianglewave_context *context = (struct dss_trianglewave_context *)node->context;
16811681
16821682   if(DSS_TRIANGLEWAVE__ENABLE)
16831683   {
r4425r4426
17041704
17051705static DISCRETE_RESET(dss_trianglewave)
17061706{
1707   struct dss_trianglewave_context *context = node->context;
1707   struct dss_trianglewave_context *context = (struct dss_trianglewave_context *)node->context;
17081708   double start;
17091709
17101710   /* Establish starting phase, convert from degrees to radians */
src/emu/sound/sid6581.c
r4425r4426
3131
3232static void sid_start(const device_config *device, SIDTYPE sidtype)
3333{
34   SID6581 *sid = device->token;
34   SID6581 *sid = get_sid(device);
3535   const sid6581_interface *iface = (const sid6581_interface*) device->static_config;
3636
3737   sid->device = device;
r4425r4426
4949
5050static DEVICE_RESET( sid )
5151{
52   SID6581 *sid = device->token;
52   SID6581 *sid = get_sid(device);
5353   sidEmuReset(sid);
5454}
5555
src/emu/sound/flt_vol.c
r4425r4426
2525{
2626   stream_sample_t *src = inputs[0];
2727   stream_sample_t *dst = outputs[0];
28   filter_volume_state *info = param;
28   filter_volume_state *info = (filter_volume_state *)param;
2929
3030   while (samples--)
3131      *dst++ = (*src++ * info->gain) >> 8;
src/emu/sound/5220intf.c
r4425r4426
5959   static const tms5220_interface dummy = { 0 };
6060   tms5220_state *info = get_safe_token(device);
6161
62   info->intf = device->static_config ? device->static_config : &dummy;
62   info->intf = device->static_config ? (const tms5220_interface *)device->static_config : &dummy;
6363
6464   info->chip = tms5220_create(device);
6565   assert_always(info->chip != NULL, "Error creating TMS5220 chip");
r4425r4426
203203
204204static STREAM_UPDATE( tms5220_update )
205205{
206   tms5220_state *info = param;
206   tms5220_state *info = (tms5220_state *)param;
207207   INT16 sample_data[MAX_SAMPLE_CHUNK];
208208   stream_sample_t *buffer = outputs[0];
209209
src/emu/sound/2151intf.c
r4425r4426
3636
3737static STREAM_UPDATE( ym2151_update )
3838{
39   ym2151_state *info = param;
39   ym2151_state *info = (ym2151_state *)param;
4040   ym2151_update_one(info->chip, outputs, samples);
4141}
4242
4343
4444static STATE_POSTLOAD( ym2151intf_postload )
4545{
46   ym2151_state *info = param;
46   ym2151_state *info = (ym2151_state *)param;
4747   ym2151_postload(machine, info->chip);
4848}
4949
r4425r4426
5151static DEVICE_START( ym2151 )
5252{
5353   static const ym2151_interface dummy = { 0 };
54   ym2151_state *info = device->token;
54   ym2151_state *info = get_safe_token(device);
5555   int rate;
5656
57   info->intf = device->static_config ? device->static_config : &dummy;
57   info->intf = device->static_config ? (const ym2151_interface *)device->static_config : &dummy;
5858
5959   rate = device->clock/64;
6060
r4425r4426
7373
7474static DEVICE_STOP( ym2151 )
7575{
76   ym2151_state *info = device->token;
76   ym2151_state *info = get_safe_token(device);
7777   ym2151_shutdown(info->chip);
7878}
7979
8080static DEVICE_RESET( ym2151 )
8181{
82   ym2151_state *info = device->token;
82   ym2151_state *info = get_safe_token(device);
8383   ym2151_reset_chip(info->chip);
8484}
8585
src/emu/sound/psx.c
r4425r4426
124124
125125static STREAM_UPDATE( PSXSPU_update )
126126{
127   struct psxinfo *chip = param;
127   struct psxinfo *chip = (struct psxinfo *)param;
128128   int v;
129129   int voll;
130130   int volr;
r4425r4426
267267   int n_effect;
268268   int n_channel;
269269
270   chip->intf = device->static_config;
270   chip->intf = (const psx_spu_interface *)device->static_config;
271271   chip->device = device;
272272   chip->g_p_n_psxram = *(chip->intf->p_psxram);
273273
r4425r4426
316316      chip->m_p_n_effect[ n_effect ] = 0;
317317   }
318318
319   chip->m_p_n_spuram = auto_malloc( SPU_RAM_SIZE );
319   chip->m_p_n_spuram = (UINT16 *)auto_malloc( SPU_RAM_SIZE );
320320
321321   state_save_register_device_item( device, 0, chip->m_n_mainvolumeleft );
322322   state_save_register_device_item( device, 0, chip->m_n_mainvolumeright );
src/emu/sound/k053260.c
r4425r4426
117117   UINT32 delta[4], end[4], pos[4];
118118   int dataL, dataR;
119119   signed char d;
120   k053260_state *ic = param;
120   k053260_state *ic = (k053260_state *)param;
121121
122122   /* precache some values */
123123   for ( i = 0; i < 4; i++ ) {
r4425r4426
217217
218218   /* Initialize our chip structure */
219219   ic->device = device;
220   ic->intf = (device->static_config != NULL) ? device->static_config : &defintrf;
220   ic->intf = (device->static_config != NULL) ? (const k053260_interface *)device->static_config : &defintrf;
221221
222222   ic->mode = 0;
223223   ic->rom = device->region;
src/emu/sound/2413intf.c
r4425r4426
4545
4646static STREAM_UPDATE( ym2413_stream_update )
4747{
48   ym2413_state *info = param;
48   ym2413_state *info = (ym2413_state *)param;
4949   ym2413_update_one(info->chip, outputs, samples);
5050}
5151
5252static void _stream_update(void *param, int interval)
5353{
54   ym2413_state *info = param;
54   ym2413_state *info = (ym2413_state *)param;
5555   stream_update(info->stream);
5656}
5757
src/emu/sound/segapcm.c
r4425r4426
2828
2929static STREAM_UPDATE( SEGAPCM_update )
3030{
31   segapcm_state *spcm = param;
31   segapcm_state *spcm = (segapcm_state *)param;
3232   int ch;
3333
3434   /* clear the buffers */
r4425r4426
8888
8989static DEVICE_START( segapcm )
9090{
91   const sega_pcm_interface *intf = device->static_config;
91   const sega_pcm_interface *intf = (const sega_pcm_interface *)device->static_config;
9292   int mask, rom_mask, len;
9393   segapcm_state *spcm = get_safe_token(device);
9494
9595   spcm->rom = (const UINT8 *)device->region;
96   spcm->ram = auto_malloc(0x800);
96   spcm->ram = (UINT8 *)auto_malloc(0x800);
9797
9898   memset(spcm->ram, 0xff, 0x800);
9999
src/emu/sound/vrender0.c
r4425r4426
3737
3838static STREAM_UPDATE( VR0_Update )
3939{
40   vr0_state *VR0 = param;
40   vr0_state *VR0 = (vr0_state *)param;
4141   VR0_RenderAudio(VR0, samples,outputs[0],outputs[1]);
4242}
4343
r4425r4426
109109   const vr0_interface *intf;
110110   vr0_state *VR0 = get_safe_token(device);
111111
112   intf=device->static_config;
112   intf=(const vr0_interface *)device->static_config;
113113
114114   memcpy(&(VR0->Intf),intf,sizeof(vr0_interface));
115115   memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS));
src/emu/sound/8950intf.c
r4425r4426
4747
4848static void IRQHandler(void *param,int irq)
4949{
50   y8950_state *info = param;
50   y8950_state *info = (y8950_state *)param;
5151   if (info->intf->handler) (info->intf->handler)(info->device, irq ? ASSERT_LINE : CLEAR_LINE);
5252}
5353static TIMER_CALLBACK( timer_callback_0 )
5454{
55   y8950_state *info = ptr;
55   y8950_state *info = (y8950_state *)ptr;
5656   y8950_timer_over(info->chip,0);
5757}
5858static TIMER_CALLBACK( timer_callback_1 )
5959{
60   y8950_state *info = ptr;
60   y8950_state *info = (y8950_state *)ptr;
6161   y8950_timer_over(info->chip,1);
6262}
6363static void TimerHandler(void *param,int c,attotime period)
6464{
65   y8950_state *info = param;
65   y8950_state *info = (y8950_state *)param;
6666   if( attotime_compare(period, attotime_zero) == 0 )
6767   {   /* Reset FM Timer */
6868      timer_enable(info->timer[c], 0);
r4425r4426
7676
7777static unsigned char Y8950PortHandler_r(void *param)
7878{
79   y8950_state *info = param;
79   y8950_state *info = (y8950_state *)param;
8080   if (info->intf->portread)
8181      return info->intf->portread(info->device,0);
8282   return 0;
r4425r4426
8484
8585static void Y8950PortHandler_w(void *param,unsigned char data)
8686{
87   y8950_state *info = param;
87   y8950_state *info = (y8950_state *)param;
8888   if (info->intf->portwrite)
8989      info->intf->portwrite(info->device,0,data);
9090}
9191
9292static unsigned char Y8950KeyboardHandler_r(void *param)
9393{
94   y8950_state *info = param;
94   y8950_state *info = (y8950_state *)param;
9595   if (info->intf->keyboardread)
9696      return info->intf->keyboardread(info->device,0);
9797   return 0;
r4425r4426
9999
100100static void Y8950KeyboardHandler_w(void *param,unsigned char data)
101101{
102   y8950_state *info = param;
102   y8950_state *info = (y8950_state *)param;
103103   if (info->intf->keyboardwrite)
104104      info->intf->keyboardwrite(info->device,0,data);
105105}
106106
107107static STREAM_UPDATE( y8950_stream_update )
108108{
109   y8950_state *info = param;
109   y8950_state *info = (y8950_state *)param;
110110   y8950_update_one(info->chip, outputs[0], samples);
111111}
112112
113113static void _stream_update(void *param, int interval)
114114{
115   y8950_state *info = param;
115   y8950_state *info = (y8950_state *)param;
116116   stream_update(info->stream);
117117}
118118
r4425r4426
123123   y8950_state *info = get_safe_token(device);
124124   int rate = device->clock/72;
125125
126   info->intf = device->static_config ? device->static_config : &dummy;
126   info->intf = device->static_config ? (const y8950_interface *)device->static_config : &dummy;
127127   info->device = device;
128128
129129   /* stream system initialize */
src/emu/sound/disc_flt.c
r4425r4426
141141
142142static DISCRETE_STEP(dst_crfilter)
143143{
144   struct dst_rcfilter_context *context = node->context;
144   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
145145
146146   if(DST_CRFILTER__ENABLE)
147147   {
r4425r4426
156156
157157static DISCRETE_RESET(dst_crfilter)
158158{
159   struct dst_rcfilter_context *context = node->context;
159   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
160160
161161   context->exponent = RC_CHARGE_EXP(DST_CRFILTER__R * DST_CRFILTER__C);
162162   context->vCap   = 0;
r4425r4426
208208
209209static DISCRETE_STEP(dst_filter1)
210210{
211   struct dss_filter1_context *context = node->context;
211   struct dss_filter1_context *context = (struct dss_filter1_context *)node->context;
212212
213213   double gain = 1.0;
214214
r4425r4426
225225
226226static DISCRETE_RESET(dst_filter1)
227227{
228   struct dss_filter1_context *context = node->context;
228   struct dss_filter1_context *context = (struct dss_filter1_context *)node->context;
229229
230230   calculate_filter1_coefficients(DST_FILTER1__FREQ, DST_FILTER1__TYPE, &context->a1, &context->b0, &context->b1);
231231   node->output[0] = 0;
r4425r4426
293293
294294static DISCRETE_STEP(dst_filter2)
295295{
296   struct dss_filter2_context *context = node->context;
296   struct dss_filter2_context *context = (struct dss_filter2_context *)node->context;
297297
298298   double gain = 1.0;
299299
r4425r4426
313313
314314static DISCRETE_RESET(dst_filter2)
315315{
316   struct dss_filter2_context *context = node->context;
316   struct dss_filter2_context *context = (struct dss_filter2_context *)node->context;
317317
318318   calculate_filter2_coefficients(DST_FILTER2__FREQ, DST_FILTER2__DAMP, DST_FILTER2__TYPE,
319319                           &context->a1, &context->a2,
r4425r4426
342342
343343static DISCRETE_STEP(dst_op_amp_filt)
344344{
345   const  discrete_op_amp_filt_info *info    = node->custom;
346   struct dst_op_amp_filt_context   *context = node->context;
345   const  discrete_op_amp_filt_info *info    = (const  discrete_op_amp_filt_info *)node->custom;
346   struct dst_op_amp_filt_context   *context = (struct dst_op_amp_filt_context *)node->context;
347347
348348   double i, v = 0;
349349
r4425r4426
425425
426426static DISCRETE_RESET(dst_op_amp_filt)
427427{
428   const  discrete_op_amp_filt_info *info    = node->custom;
429   struct dst_op_amp_filt_context   *context = node->context;
428   const  discrete_op_amp_filt_info *info    = (const  discrete_op_amp_filt_info *)node->custom;
429   struct dst_op_amp_filt_context   *context = (struct dst_op_amp_filt_context *)node->context;
430430
431431   /* Convert the passed filter type into an int for easy use. */
432432   context->type = (int)DST_OP_AMP_FILT__TYPE & DISC_OP_AMP_FILTER_TYPE_MASK;
r4425r4426
539539
540540static DISCRETE_STEP(dst_rcdisc)
541541{
542   struct dst_rcdisc_context *context = node->context;
542   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
543543
544544   switch (context->state)
545545   {
r4425r4426
566566
567567static DISCRETE_RESET(dst_rcdisc)
568568{
569   struct dst_rcdisc_context *context = node->context;
569   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
570570
571571   node->output[0] = 0;
572572
r4425r4426
598598
599599static DISCRETE_STEP(dst_rcdisc2)
600600{
601   struct dst_rcdisc_context *context = node->context;
601   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
602602
603603   double diff;
604604
r4425r4426
612612
613613static DISCRETE_RESET(dst_rcdisc2)
614614{
615   struct dst_rcdisc_context *context = node->context;
615   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
616616
617617   node->output[0] = 0;
618618
r4425r4426
642642
643643static DISCRETE_STEP(dst_rcdisc3)
644644{
645   struct dst_rcdisc_context *context = node->context;
645   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
646646
647647   double diff;
648648
r4425r4426
671671
672672static DISCRETE_RESET(dst_rcdisc3)
673673{
674   struct dst_rcdisc_context *context = node->context;
674   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
675675
676676   node->output[0] = 0;
677677
r4425r4426
706706
707707static DISCRETE_STEP(dst_rcdisc4)
708708{
709   struct dst_rcdisc4_context *context = node->context;
709   struct dst_rcdisc4_context *context = (struct dst_rcdisc4_context *)node->context;
710710
711711   int inp1 = (DST_RCDISC4__IN == 0) ? 0 : 1;
712712
r4425r4426
732732
733733static DISCRETE_RESET( dst_rcdisc4)
734734{
735   struct dst_rcdisc4_context *context = node->context;
735   struct dst_rcdisc4_context *context = (struct dst_rcdisc4_context *)node->context;
736736
737737   double   v, i, r, rT;
738738
r4425r4426
818818
819819static DISCRETE_STEP( dst_rcdisc5)
820820{
821   struct dst_rcdisc_context *context = node->context;
821   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
822822
823823   double diff,u;
824824
r4425r4426
845845
846846static DISCRETE_RESET( dst_rcdisc5)
847847{
848   struct dst_rcdisc_context *context = node->context;
848   struct dst_rcdisc_context *context = (struct dst_rcdisc_context *)node->context;
849849
850850   node->output[0] = 0;
851851
r4425r4426
881881
882882static DISCRETE_STEP(dst_rcdisc_mod)
883883{
884   struct dst_rcdisc_mod_context *context = node->context;
884   struct dst_rcdisc_mod_context *context = (struct dst_rcdisc_mod_context *)node->context;
885885
886886   double   diff, v_cap, u, vD;
887887   int      mod_state, mod1_state, mod2_state;
r4425r4426
916916
917917static DISCRETE_RESET(dst_rcdisc_mod)
918918{
919   struct dst_rcdisc_mod_context *context = node->context;
919   struct dst_rcdisc_mod_context *context = (struct dst_rcdisc_mod_context *)node->context;
920920
921921   double   rc[2], rc2[2];
922922
r4425r4426
971971
972972static DISCRETE_STEP(dst_rcfilter)
973973{
974   struct dst_rcfilter_context *context = node->context;
974   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
975975
976976   /************************************************************************/
977977   /* Next Value = PREV + (INPUT_VALUE - PREV)*(1-(EXP(-TIMEDELTA/RC)))    */
r4425r4426
990990
991991static DISCRETE_RESET(dst_rcfilter)
992992{
993   struct dst_rcfilter_context *context = node->context;
993   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
994994
995995   context->exponent = RC_CHARGE_EXP(DST_RCFILTER__R * DST_RCFILTER__C);
996996   context->vCap   = 0;
r4425r4426
10201020// FIXME: This needs optimization !
10211021static DISCRETE_STEP(dst_rcfilter_sw)
10221022{
1023   struct dst_rcfilter_sw_context *context = node->context;
1023   struct dst_rcfilter_sw_context *context = (struct dst_rcfilter_sw_context *)node->context;
10241024
10251025   int i,j ;
10261026   int bits = (int)DST_RCFILTER_SW__SWITCH;
r4425r4426
10711071
10721072static DISCRETE_RESET(dst_rcfilter_sw)
10731073{
1074   struct dst_rcfilter_sw_context *context = node->context;
1074   struct dst_rcfilter_sw_context *context = (struct dst_rcfilter_sw_context *)node->context;
10751075
10761076   int i;
10771077
r4425r4426
11271127
11281128static DISCRETE_STEP( dst_rcintegrate)
11291129{
1130   struct dst_rcintegrate_context *context = node->context;
1130   struct dst_rcintegrate_context *context = (struct dst_rcintegrate_context *)node->context;
11311131
11321132   double diff, u, iQ, iQc, iC, RG, vE;
11331133   double vP;
r4425r4426
11881188}
11891189static DISCRETE_RESET(dst_rcintegrate)
11901190{
1191   struct dst_rcintegrate_context *context = node->context;
1191   struct dst_rcintegrate_context *context = (struct dst_rcintegrate_context *)node->context;
11921192
11931193   double r;
11941194   double dt = discrete_current_context->sample_time;
r4425r4426
12321232
12331233static DISCRETE_STEP(dst_sallen_key)
12341234{
1235   struct dss_filter2_context *context = node->context;
1235   struct dss_filter2_context *context = (struct dss_filter2_context *)node->context;
12361236
12371237   double gain = 1.0;
12381238
r4425r4426
12521252
12531253static DISCRETE_RESET(dst_sallen_key)
12541254{
1255   struct dss_filter2_context       *context = node->context;
1256   const  discrete_op_amp_filt_info *info    = node->custom;
1255   struct dss_filter2_context       *context = (struct dss_filter2_context *)node->context;
1256   const  discrete_op_amp_filt_info *info    = (const  discrete_op_amp_filt_info *)node->custom;
12571257
12581258   double freq, q;
12591259
r4425r4426
13431343
13441344static DISCRETE_STEP(dst_rcdiscN)
13451345{
1346   struct dss_filter1_context *context = node->context;
1346   struct dss_filter1_context *context = (struct dss_filter1_context *)node->context;
13471347
13481348   double gain = 1.0;
13491349
r4425r4426
13941394
13951395static DISCRETE_STEP(dst_rcdisc2N)
13961396{
1397   struct dss_rcdisc2_context *context = node->context;
1397   struct dss_rcdisc2_context *context = (struct dss_rcdisc2_context *)node->context;
13981398
13991399   double input = ((DST_RCDISC2N__ENABLE == 0) ? DST_RCDISC2N__IN0 : DST_RCDISC2N__IN1);
14001400
r4425r4426
14091409
14101410static DISCRETE_RESET(dst_rcdisc2N)
14111411{
1412   struct dss_rcdisc2_context *context = node->context;
1412   struct dss_rcdisc2_context *context = (struct dss_rcdisc2_context *)node->context;
14131413   double f1,f2;
14141414
14151415   f1 = 1.0 / (2 * M_PI * DST_RCDISC2N__R0 * DST_RCDISC2N__C);
src/emu/sound/multipcm.c
r4425r4426
427427
428428static STREAM_UPDATE( MultiPCM_update )
429429{
430   MultiPCM *ptChip = param;
430   MultiPCM *ptChip = (MultiPCM *)param;
431431   stream_sample_t  *datap[2];
432432   int i,sl;
433433
src/emu/sound/namco.c
r4425r4426
139139      size = 32 * 8;      /* 32 samples, 8 waveforms */
140140   }
141141
142   p = auto_malloc(size * MAX_VOLUME * sizeof (INT16));
142   p = (INT16 *)auto_malloc(size * MAX_VOLUME * sizeof (INT16));
143143
144144   for (v = 0; v < MAX_VOLUME; v++)
145145   {
r4425r4426
172172/* generate sound to the mix buffer in mono */
173173static STREAM_UPDATE( namco_update_mono )
174174{
175   namco_sound *chip = param;
175   namco_sound *chip = (namco_sound *)param;
176176   stream_sample_t *buffer = outputs[0];
177177   sound_channel *voice;
178178
r4425r4426
255255/* generate sound to the mix buffer in stereo */
256256static STREAM_UPDATE( namco_update_stereo )
257257{
258   namco_sound *chip = param;
258   namco_sound *chip = (namco_sound *)param;
259259   sound_channel *voice;
260260
261261   /* zap the contents of the buffers */
r4425r4426
366366static DEVICE_START( namco )
367367{
368368   sound_channel *voice;
369   const namco_interface *intf = device->static_config;
369   const namco_interface *intf = (const namco_interface *)device->static_config;
370370   int clock_multiple;
371371   namco_sound *chip = get_safe_token(device);
372372
r4425r4426
701701
702702static WRITE8_DEVICE_HANDLER( namcos1_sound_w )
703703{
704   namco_sound *chip = device->token;
704   namco_sound *chip = get_safe_token(device);
705705   sound_channel *voice;
706706   int ch;
707707   int nssw;
src/emu/sound/sn76477.c
r4425r4426
19881988   double voltage_out;
19891989   double center_to_peak_voltage_out;
19901990
1991   sn76477_state *sn = param;
1991   sn76477_state *sn = (sn76477_state *)param;
19921992   stream_sample_t *buffer = outputs[0];
19931993
19941994
src/emu/sound/vlm5030.c
r4425r4426
8686#define IP_SIZE_FAST    (120/FR_SIZE)
8787#define IP_SIZE_FASTER  ( 80/FR_SIZE)
8888
89typedef struct _vlm5030_state vml5030_state;
89typedef struct _vlm5030_state vlm5030_state;
9090struct _vlm5030_state
9191{
9292   const device_config *device;
r4425r4426
219219       0,   -8127,  -16384,  -24511,   32638,   24511,   16254,    8127
220220};
221221
222INLINE vml5030_state *get_safe_token(const device_config *device)
222INLINE vlm5030_state *get_safe_token(const device_config *device)
223223{
224224   assert(device != NULL);
225225   assert(device->token != NULL);
226226   assert(device->type == SOUND);
227227   assert(sound_get_type(device) == SOUND_VLM5030);
228   return (vml5030_state *)device->token;
228   return (vlm5030_state *)device->token;
229229}
230230
231static int get_bits(vml5030_state *chip, int sbit,int bits)
231static int get_bits(vlm5030_state *chip, int sbit,int bits)
232232{
233233   int offset = chip->address + (sbit>>3);
234234   int data;
r4425r4426
242242}
243243
244244/* get next frame */
245static int parse_frame (vml5030_state *chip)
245static int parse_frame (vlm5030_state *chip)
246246{
247247   unsigned char cmd;
248248   int i;
r4425r4426
299299/* decode and buffering data */
300300static STREAM_UPDATE( vlm5030_update_callback )
301301{
302   vml5030_state *chip = param;
302   vlm5030_state *chip = (vlm5030_state *)param;
303303   int buf_count=0;
304304   int interp_effect;
305305   int i;
r4425r4426
454454}
455455
456456/* realtime update */
457static void vlm5030_update(vml5030_state *chip)
457static void vlm5030_update(vlm5030_state *chip)
458458{
459459   stream_update(chip->channel);
460460}
461461
462462/* setup parameteroption when RST=H */
463static void vlm5030_setup_parameter(vml5030_state *chip, UINT8 param)
463static void vlm5030_setup_parameter(vlm5030_state *chip, UINT8 param)
464464{
465465   /* latch parameter value */
466466   chip->parameter = param;
r4425r4426
488488
489489static STATE_POSTLOAD( vlm5030_restore_state )
490490{
491   vml5030_state *chip = param;
491   vlm5030_state *chip = (vlm5030_state *)param;
492492   int i;
493493
494494   int interp_effect = FR_SIZE - (chip->interp_count%FR_SIZE);
r4425r4426
504504}
505505
506506
507static void vlm5030_reset(vml5030_state *chip)
507static void vlm5030_reset(vlm5030_state *chip)
508508{
509509   chip->phase = PH_RESET;
510510   chip->address = 0;
r4425r4426
534534/* set speech rom address */
535535void vlm5030_set_rom(const device_config *device, void *speech_rom)
536536{
537   vml5030_state *chip = get_safe_token(device);
537   vlm5030_state *chip = get_safe_token(device);
538538   chip->rom = (UINT8 *)speech_rom;
539539}
540540
541541/* get BSY pin level */
542542int vlm5030_bsy(const device_config *device)
543543{
544   vml5030_state *chip = get_safe_token(device);
544   vlm5030_state *chip = get_safe_token(device);
545545   vlm5030_update(chip);
546546   return chip->pin_BSY;
547547}
r4425r4426
549549/* latch contoll data */
550550WRITE8_DEVICE_HANDLER( vlm5030_data_w )
551551{
552   vml5030_state *chip = get_safe_token(device);
552   vlm5030_state *chip = get_safe_token(device);
553553   chip->latch_data = (UINT8)data;
554554}
555555
556556/* set RST pin level : reset / set table address A8-A15 */
557557void vlm5030_rst (const device_config *device, int pin )
558558{
559   vml5030_state *chip = get_safe_token(device);
559   vlm5030_state *chip = get_safe_token(device);
560560   if( chip->pin_RST )
561561   {
562562      if( !pin )
r4425r4426
581581/* set VCU pin level : ?? unknown */
582582void vlm5030_vcu(const device_config *device, int pin)
583583{
584   vml5030_state *chip = get_safe_token(device);
584   vlm5030_state *chip = get_safe_token(device);
585585   /* direct mode / indirect mode */
586586   chip->pin_VCU = pin;
587587   return;
r4425r4426
590590/* set ST pin level  : set table address A0-A7 / start speech */
591591void vlm5030_st(const device_config *device, int pin )
592592{
593   vml5030_state *chip = get_safe_token(device);
593   vlm5030_state *chip = get_safe_token(device);
594594   int table;
595595
596596   if( chip->pin_ST != pin )
r4425r4426
651651{
652652   const vlm5030_interface defintrf = { 0 };
653653   int emulation_rate;
654   vml5030_state *chip = get_safe_token(device);
654   vlm5030_state *chip = get_safe_token(device);
655655
656656   chip->device = device;
657   chip->intf = (device->static_config != NULL) ? device->static_config : &defintrf;
657   chip->intf = (device->static_config != NULL) ? (const vlm5030_interface *)device->static_config : &defintrf;
658658
659659   emulation_rate = device->clock / 440;
660660
r4425r4426
708708   switch (state)
709709   {
710710      /* --- the following bits of info are returned as 64-bit signed integers --- */
711      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(vml5030_state);          break;
711      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(vlm5030_state);          break;
712712
713713      /* --- the following bits of info are returned as pointers to data or functions --- */
714714      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( vlm5030 );      break;
src/emu/sound/5110intf.c
r4425r4426
8686   static const tms5110_interface dummy = { 0 };
8787   tms5110_state *info = get_safe_token(device);
8888
89   info->intf = device->static_config ? device->static_config : &dummy;
89   info->intf = device->static_config ? (const tms5110_interface *)device->static_config : &dummy;
9090   info->table = device->region;
9191
9292   info->chip = tms5110_create(device, TMS5110_IS_5110A);
r4425r4426
250250
251251static STREAM_UPDATE( tms5110_update )
252252{
253   tms5110_state *info = param;
253   tms5110_state *info = (tms5110_state *)param;
254254   INT16 sample_data[MAX_SAMPLE_CHUNK];
255255   stream_sample_t *buffer = outputs[0];
256256
src/emu/sound/2203intf.c
r4425r4426
2929
3030static void psg_set_clock(void *param, int clock)
3131{
32   ym2203_state *info = param;
32   ym2203_state *info = (ym2203_state *)param;
3333   ay8910_set_clock_ym(info->psg, clock);
3434}
3535
3636static void psg_write(void *param, int address, int data)
3737{
38   ym2203_state *info = param;
38   ym2203_state *info = (ym2203_state *)param;
3939   ay8910_write_ym(info->psg, address, data);
4040}
4141
4242static int psg_read(void *param)
4343{
44   ym2203_state *info = param;
44   ym2203_state *info = (ym2203_state *)param;
4545   return ay8910_read_ym(info->psg);
4646}
4747
4848static void psg_reset(void *param)
4949{
50   ym2203_state *info = param;
50   ym2203_state *info = (ym2203_state *)param;
5151   ay8910_reset_ym(info->psg);
5252}
5353
r4425r4426
6262/* IRQ Handler */
6363static void IRQHandler(void *param,int irq)
6464{
65   ym2203_state *info = param;
65   ym2203_state *info = (ym2203_state *)param;
6666   if (info->intf->handler != NULL)
6767      (*info->intf->handler)(info->device, irq);
6868}
r4425r4426
7070/* Timer overflow callback from timer.c */
7171static TIMER_CALLBACK( timer_callback_2203_0 )
7272{
73   ym2203_state *info = ptr;
73   ym2203_state *info = (ym2203_state *)ptr;
7474   ym2203_timer_over(info->chip,0);
7575}
7676
7777static TIMER_CALLBACK( timer_callback_2203_1 )
7878{
79   ym2203_state *info = ptr;
79   ym2203_state *info = (ym2203_state *)ptr;
8080   ym2203_timer_over(info->chip,1);
8181}
8282
8383/* update request from fm.c */
8484void ym2203_update_request(void *param)
8585{
86   ym2203_state *info = param;
86   ym2203_state *info = (ym2203_state *)param;
8787   stream_update(info->stream);
8888}
8989
9090
9191static void timer_handler(void *param,int c,int count,int clock)
9292{
93   ym2203_state *info = param;
93   ym2203_state *info = (ym2203_state *)param;
9494   if( count == 0 )
9595   {   /* Reset FM Timer */
9696      timer_enable(info->timer[c], 0);
r4425r4426
105105
106106static STREAM_UPDATE( ym2203_stream_update )
107107{
108   ym2203_state *info = param;
108   ym2203_state *info = (ym2203_state *)param;
109109   ym2203_update_one(info->chip, outputs[0], samples);
110110}
111111
112112
113113static STATE_POSTLOAD( ym2203_intf_postload )
114114{
115   ym2203_state *info = param;
115   ym2203_state *info = (ym2203_state *)param;
116116   ym2203_postload(info->chip);
117117}
118118
r4425r4426
128128      },
129129      NULL
130130   };
131   const ym2203_interface *intf = device->static_config ? device->static_config : &generic_2203;
132   ym2203_state *info = device->token;
131   const ym2203_interface *intf = device->static_config ? (const ym2203_interface *)device->static_config : &generic_2203;
132   ym2203_state *info = get_safe_token(device);
133133   int rate = device->clock/72; /* ??? */
134134
135135   info->intf = intf;
r4425r4426
153153
154154static DEVICE_STOP( ym2203 )
155155{
156   ym2203_state *info = device->token;
156   ym2203_state *info = get_safe_token(device);
157157   ym2203_shutdown(info->chip);
158158   ay8910_stop_ym(info->psg);
159159}
160160
161161static DEVICE_RESET( ym2203 )
162162{
163   ym2203_state *info = device->token;
163   ym2203_state *info = get_safe_token(device);
164164   ym2203_reset_chip(info->chip);
165165}
166166
src/emu/sound/k007232.c
r4425r4426
227227
228228static STREAM_UPDATE( KDAC_A_update )
229229{
230  KDAC_A_PCM *info = param;
230  KDAC_A_PCM *info = (KDAC_A_PCM *)param;
231231  int i;
232232
233233  memset(outputs[0],0,samples * sizeof(*outputs[0]));
r4425r4426
308308   int i;
309309   KDAC_A_PCM *info = get_safe_token(device);
310310
311   info->intf = (device->static_config != NULL) ? device->static_config : &defintrf;
311   info->intf = (device->static_config != NULL) ? (const k007232_interface *)device->static_config : &defintrf;
312312
313313   /* Set up the chips */
314314
src/emu/sound/tms5220.c
r4425r4426
179179{
180180   struct tms5220 *tms;
181181
182   tms = malloc_or_die(sizeof(*tms));
182   tms = (struct tms5220 *)malloc_or_die(sizeof(*tms));
183183   memset(tms, 0, sizeof(*tms));
184184
185185   tms->device = device;
r4425r4426
248248
249249void tms5220_reset_chip(void *chip)
250250{
251   struct tms5220 *tms = chip;
251   struct tms5220 *tms = (struct tms5220 *)chip;
252252
253253   /* initialize the FIFO */
254254   /*memset(tms->fifo, 0, sizeof(tms->fifo));*/
r4425r4426
292292
293293void tms5220_set_irq(void *chip, void (*func)(const device_config *, int))
294294{
295   struct tms5220 *tms = chip;
295   struct tms5220 *tms = (struct tms5220 *)chip;
296296    tms->irq_func = func;
297297}
298298
r4425r4426
305305
306306void tms5220_set_read(void *chip, int (*func)(const device_config *, int))
307307{
308   struct tms5220 *tms = chip;
308   struct tms5220 *tms = (struct tms5220 *)chip;
309309   tms->read_callback = func;
310310}
311311
r4425r4426
318318
319319void tms5220_set_load_address(void *chip, void (*func)(const device_config *, int))
320320{
321   struct tms5220 *tms = chip;
321   struct tms5220 *tms = (struct tms5220 *)chip;
322322   tms->load_address_callback = func;
323323}
324324
r4425r4426
331331
332332void tms5220_set_read_and_branch(void *chip, void (*func)(const device_config *))
333333{
334   struct tms5220 *tms = chip;
334   struct tms5220 *tms = (struct tms5220 *)chip;
335335   tms->read_and_branch_callback = func;
336336}
337337
r4425r4426
344344
345345void tms5220_set_variant(void *chip, tms5220_variant new_variant)
346346{
347   struct tms5220 *tms = chip;
347   struct tms5220 *tms = (struct tms5220 *)chip;
348348   tms->variant = new_variant;
349349}
350350
r4425r4426
357357
358358void tms5220_data_write(void *chip, int data)
359359{
360   struct tms5220 *tms = chip;
360   struct tms5220 *tms = (struct tms5220 *)chip;
361361
362362    /* add this byte to the FIFO */
363363    if (tms->fifo_count < FIFO_SIZE)
r4425r4426
411411
412412int tms5220_status_read(void *chip)
413413{
414   struct tms5220 *tms = chip;
414   struct tms5220 *tms = (struct tms5220 *)chip;
415415
416416   if (tms->RDB_flag)
417417   {   /* if last command was read, return data register */
r4425r4426
440440
441441int tms5220_ready_read(void *chip)
442442{
443   struct tms5220 *tms = chip;
443   struct tms5220 *tms = (struct tms5220 *)chip;
444444    return (tms->fifo_count < FIFO_SIZE-1);
445445}
446446
r4425r4426
453453
454454int tms5220_cycles_to_ready(void *chip)
455455{
456   struct tms5220 *tms = chip;
456   struct tms5220 *tms = (struct tms5220 *)chip;
457457   int answer;
458458
459459
r4425r4426
495495
496496int tms5220_int_read(void *chip)
497497{
498   struct tms5220 *tms = chip;
498   struct tms5220 *tms = (struct tms5220 *)chip;
499499    return tms->irq_pin;
500500}
501501
r4425r4426
509509
510510void tms5220_process(void *chip, INT16 *buffer, unsigned int size)
511511{
512   struct tms5220 *tms = chip;
512   struct tms5220 *tms = (struct tms5220 *)chip;
513513    int buf_count=0;
514514    int i, interp_period, bitout;
515515
r4425r4426
798798
799799static INT16 lattice_filter(void *chip)
800800{
801        struct tms5220 *tms = chip;
801        struct tms5220 *tms = (struct tms5220 *)chip;
802802        /* Lattice filter here */
803803        /* Aug/05/07: redone as unrolled loop, for clarity - LN*/
804804        /* Copied verbatim from table I in US patent 4,209,804:
src/emu/sound/okim6258.c
r4425r4426
132132
133133static STREAM_UPDATE( okim6258_update )
134134{
135   okim6258_state *chip = param;
135   okim6258_state *chip = (okim6258_state *)param;
136136   stream_sample_t *buffer = outputs[0];
137137
138138   memset(outputs[0], 0, samples * sizeof(*outputs[0]));
r4425r4426
194194
195195static DEVICE_START( okim6258 )
196196{
197   const okim6258_interface *intf = device->static_config;
197   const okim6258_interface *intf = (const okim6258_interface *)device->static_config;
198198   okim6258_state *info = get_safe_token(device);
199199
200200   compute_tables();
src/emu/sound/es5503.c
r4425r4426
143143
144144static TIMER_CALLBACK( es5503_timer_cb )
145145{
146   ES5503Osc *osc = ptr;
146   ES5503Osc *osc = (ES5503Osc *)ptr;
147147   ES5503Chip *chip = (ES5503Chip *)osc->chip;
148148
149149   stream_update(chip->stream);
r4425r4426
155155   INT32 *mixp;
156156   int osc, snum, i;
157157   UINT32 ramptr;
158   ES5503Chip *chip = param;
158   ES5503Chip *chip = (ES5503Chip *)param;
159159
160160   memset(mix, 0, sizeof(mix));
161161
r4425r4426
238238   int osc;
239239   ES5503Chip *chip = get_safe_token(device);
240240
241   intf = device->static_config;
241   intf = (const es5503_interface *)device->static_config;
242242
243243   chip->irq_callback = intf->irq_callback;
244244   chip->adc_read = intf->adc_read;
src/emu/sound/nile.c
r4425r4426
144144
145145static STREAM_UPDATE( nile_update )
146146{
147   nile_state *info = param;
147   nile_state *info = (nile_state *)param;
148148   UINT8 *sound_ram = info->sound_ram;
149149   int v, i, snum;
150150   UINT16 *slot;
src/emu/sound/es8712.c
r4425r4426
179179static STREAM_UPDATE( es8712_update )
180180{
181181   stream_sample_t *buffer = outputs[0];
182   es8712_state *chip = param;
182   es8712_state *chip = (es8712_state *)param;
183183
184184   /* generate them into our buffer */
185185   generate_adpcm(chip, buffer, samples);
r4425r4426
220220
221221static DEVICE_START( es8712 )
222222{
223   es8712_state *chip = device->token;
223   es8712_state *chip = get_safe_token(device);
224224
225225   compute_tables();
226226
r4425r4426
250250
251251static DEVICE_RESET( es8712 )
252252{
253   es8712_state *chip = device->token;
253   es8712_state *chip = get_safe_token(device);
254254
255255   if (chip->playing)
256256   {
r4425r4426
270270
271271void es8712_set_bank_base(const device_config *device, int base)
272272{
273   es8712_state *chip = device->token;
273   es8712_state *chip = get_safe_token(device);
274274   stream_update(chip->stream);
275275   chip->bank_offset = base;
276276}
r4425r4426
284284
285285void es8712_set_frequency(const device_config *device, int frequency)
286286{
287   es8712_state *chip = device->token;
287   es8712_state *chip = get_safe_token(device);
288288
289289   /* update the stream and set the new base */
290290   stream_update(chip->stream);
src/emu/sound/nes_apu.c
r4425r4426
668668/* UPDATE APU SYSTEM */
669669static STREAM_UPDATE( nes_psg_update_sound )
670670{
671  nesapu_state *info = param;
671  nesapu_state *info = (nesapu_state *)param;
672672  apu_update(info, outputs[0], samples);
673673}
674674
r4425r4426
676676/* INITIALIZE APU SYSTEM */
677677static DEVICE_START( nesapu )
678678{
679   const nes_interface *intf = device->static_config;
679   const nes_interface *intf = (const nes_interface *)device->static_config;
680680   nesapu_state *info = get_safe_token(device);
681681   int rate = device->clock / 4;
682682   int i;
src/emu/sound/262intf.c
r4425r4426
3636
3737static void IRQHandler_262(void *param,int irq)
3838{
39   ymf262_state *info = param;
39   ymf262_state *info = (ymf262_state *)param;
4040   if (info->intf->handler) (info->intf->handler)(info->device, irq);
4141}
4242
4343static TIMER_CALLBACK( timer_callback_262_0 )
4444{
45   ymf262_state *info = ptr;
45   ymf262_state *info = (ymf262_state *)ptr;
4646   ymf262_timer_over(info->chip, 0);
4747}
4848
4949static TIMER_CALLBACK( timer_callback_262_1 )
5050{
51   ymf262_state *info = ptr;
51   ymf262_state *info = (ymf262_state *)ptr;
5252   ymf262_timer_over(info->chip, 1);
5353}
5454
5555static void timer_handler_262(void *param,int timer, attotime period)
5656{
57   ymf262_state *info = param;
57   ymf262_state *info = (ymf262_state *)param;
5858   if( attotime_compare(period, attotime_zero) == 0 )
5959   {   /* Reset FM Timer */
6060      timer_enable(info->timer[timer], 0);
r4425r4426
6767
6868static STREAM_UPDATE( ymf262_stream_update )
6969{
70   ymf262_state *info = param;
70   ymf262_state *info = (ymf262_state *)param;
7171   ymf262_update_one(info->chip, outputs, samples);
7272}
7373
7474static void _stream_update(void *param, int interval)
7575{
76   ymf262_state *info = param;
76   ymf262_state *info = (ymf262_state *)param;
7777   stream_update(info->stream);
7878}
7979
r4425r4426
8484   ymf262_state *info = get_safe_token(device);
8585   int rate = device->clock/288;
8686
87   info->intf = device->static_config ? device->static_config : &dummy;
87   info->intf = device->static_config ? (const ymf262_interface *)device->static_config : &dummy;
8888   info->device = device;
8989
9090   /* stream system initialize */
src/emu/inputseq.c
r4425r4426
361361            {
362362               /* increment the modifier, wrapping back to none */
363363               input_item_modifier oldmod = INPUT_CODE_MODIFIER(lastcode);
364               input_item_modifier newmod = (oldmod < ITEM_MODIFIER_NEG) ? oldmod + 1 : ITEM_MODIFIER_NONE;
364               input_item_modifier newmod = (oldmod < ITEM_MODIFIER_NEG) ? (input_item_modifier)(oldmod + 1) : ITEM_MODIFIER_NONE;
365365               newcode = INPUT_CODE_SET_MODIFIER(newcode, newmod);
366366
367367               /* back up over the previous code so we can re-append */
r4425r4426
511511
512512int input_seq_from_tokens(const char *string, input_seq *seq)
513513{
514   char *strcopy = malloc_or_die(strlen(string) + 1);
514   char *strcopy = (char *)malloc_or_die(strlen(string) + 1);
515515   char *str = strcopy;
516516   int result = FALSE;
517517
src/emu/debugger.c
r4425r4426
7575
7676      /* allocate a new entry for our global list */
7777      add_exit_callback(machine, debugger_exit);
78      entry = malloc_or_die(sizeof(*entry));
78      entry = (machine_entry *)malloc_or_die(sizeof(*entry));
7979      entry->next = machine_list;
8080      entry->machine = machine;
8181      machine_list = entry;
src/emu/sound.c
r4425r4426
166166   /* scan through the speakers until we find the indexed input */
167167   for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
168168   {
169      speaker_info *info = curspeak->token;
169      speaker_info *info = (speaker_info *)curspeak->token;
170170      if (index < count + info->inputs)
171171      {
172172         *input = index - count;
r4425r4426
202202   VPRINTF(("total speakers = %d\n", speaker_output_count(machine->config)));
203203
204204   /* allocate memory for mix buffers */
205   leftmix = auto_malloc(machine->sample_rate * sizeof(*leftmix));
206   rightmix = auto_malloc(machine->sample_rate * sizeof(*rightmix));
207   finalmix = auto_malloc(machine->sample_rate * sizeof(*finalmix));
205   leftmix = (INT32 *)auto_malloc(machine->sample_rate * sizeof(*leftmix));
206   rightmix = (INT32 *)auto_malloc(machine->sample_rate * sizeof(*rightmix));
207   finalmix = (INT16 *)auto_malloc(machine->sample_rate * sizeof(*finalmix));
208208
209209   /* allocate a global timer for sound timing */
210210   sound_update_timer = timer_alloc(machine, sound_update, NULL);
r4425r4426
270270   assert(device->machine->config != NULL);
271271
272272   /* get pointers to our data */
273   config = device->inline_config;
273   config = (const sound_config *)device->inline_config;
274274   classdata = get_class_data(device);
275275
276276   /* get the chip's start function */
r4425r4426
324324
325325static DEVICE_CUSTOM_CONFIG( sound )
326326{
327   sound_config *config = device->inline_config;
327   sound_config *config = (sound_config *)device->inline_config;
328328
329329   switch (entrytype)
330330   {
r4425r4426
341341
342342         /* allocate a new route */
343343         for (routeptr = &config->routelist; *routeptr != NULL; routeptr = &(*routeptr)->next) ;
344         *routeptr = malloc_or_die(sizeof(**routeptr));
344         *routeptr = (sound_route *)malloc_or_die(sizeof(**routeptr));
345345         (*routeptr)->next = NULL;
346346         (*routeptr)->output = output;
347347         (*routeptr)->input = input;
r4425r4426
372372
373373DEVICE_GET_INFO( sound )
374374{
375   const sound_config *config = (device != NULL) ? device->inline_config : NULL;
375   const sound_config *config = (device != NULL) ? (const sound_config *)device->inline_config : NULL;
376376
377377   switch (state)
378378   {
r4425r4426
425425   /* first count up the inputs for each speaker */
426426   for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound))
427427   {
428      const sound_config *config = sound->inline_config;
428      const sound_config *config = (const sound_config *)sound->inline_config;
429429      int numoutputs = stream_get_device_outputs(sound);
430430      const sound_route *route;
431431
r4425r4426
452452      {
453453         info->mixer_stream = stream_create(curspeak, info->inputs, 1, machine->sample_rate, info, mixer_update);
454454         state_save_register_postload(machine, mixer_postload, info->mixer_stream);
455         info->input = auto_malloc(info->inputs * sizeof(*info->input));
455         info->input = (speaker_input *)auto_malloc(info->inputs * sizeof(*info->input));
456456         info->inputs = 0;
457457      }
458458      else
r4425r4426
462462   /* iterate again over all the sound chips */
463463   for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound))
464464   {
465      const sound_config *config = sound->inline_config;
465      const sound_config *config = (const sound_config *)sound->inline_config;
466466      int numoutputs = stream_get_device_outputs(sound);
467467      const sound_route *route;
468468
r4425r4426
693693   /* force all the speaker streams to generate the proper number of samples */
694694   for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
695695   {
696      speaker_info *spk = curspeak->token;
696      speaker_info *spk = (speaker_info *)curspeak->token;
697697      const stream_sample_t *stream_buf;
698698
699699      /* get the output buffer */
r4425r4426
801801
802802static STREAM_UPDATE( mixer_update )
803803{
804   speaker_info *speaker = param;
804   speaker_info *speaker = (speaker_info *)param;
805805   int numinputs = speaker->inputs;
806806   int pos;
807807
r4425r4426
828828
829829static STATE_POSTLOAD( mixer_postload )
830830{
831   sound_stream *stream = param;
831   sound_stream *stream = (sound_stream *)param;
832832   stream_set_sample_rate(stream, machine->sample_rate);
833833}
834834
r4425r4426
845845
846846static DEVICE_START( speaker_output )
847847{
848   speaker_info *info = device->token;
848   speaker_info *info = (speaker_info *)device->token;
849849
850850   /* copy in all the relevant info */
851   info->speaker = device->inline_config;
851   info->speaker = (const speaker_config *)device->inline_config;
852852   info->tag = device->tag;
853853}
854854
r4425r4426
937937   /* count up the number of speaker inputs */
938938   for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
939939   {
940      speaker_info *info = curspeak->token;
940      speaker_info *info = (speaker_info *)curspeak->token;
941941      count += info->inputs;
942942   }
943943   return count;
src/emu/debugger.h
r4425r4426
1515#define __DEBUGGER_H__
1616
1717#include "mame.h"
18#include "cpuexec.h"
1819#include "debug/debugcpu.h"
1920
2021
src/emu/driver.c
r4425r4426
114114      int shufnum;
115115
116116      /* allocate a temporary list */
117      templist = malloc_or_die(driver_list_get_count(driverlist) * sizeof(*templist));
117      templist = (const game_driver **)malloc_or_die(driver_list_get_count(driverlist) * sizeof(*templist));
118118
119119      /* build up a list of valid entries */
120120      for (drvnum = driver_count = 0; driverlist[drvnum] != NULL; drvnum++)
r4425r4426
145145   }
146146
147147   /* allocate some temp memory */
148   penalty = malloc_or_die(matches * sizeof(*penalty));
148   penalty = (int *)malloc_or_die(matches * sizeof(*penalty));
149149
150150   /* initialize everyone's states */
151151   for (matchnum = 0; matchnum < matches; matchnum++)
src/emu/input.c
r4425r4426
677677         int changed = FALSE;
678678
679679         /* update the state of all the keys and see if any changed state */
680         for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++)
680         for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
681681         {
682682            input_device_item *item = device->item[itemid];
683683            if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
r4425r4426
695695         }
696696
697697         /* if the keyboard state is stable, copy it over */
698         for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++)
698         for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
699699         {
700700            input_device_item *item = device->item[itemid];
701701            if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
r4425r4426
729729   assert(devclass != DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
730730
731731   /* allocate a new device */
732   devlist->list = auto_realloc(devlist->list, (devlist->count + 1) * sizeof(devlist->list[0]));
732   devlist->list = (input_device *)auto_realloc(devlist->list, (devlist->count + 1) * sizeof(devlist->list[0]));
733733   device = &devlist->list[devlist->count++];
734734   memset(device, 0, sizeof(*device));
735735
r4425r4426
769769
770770   /* if we have a generic ID, pick a new internal one */
771771   if (itemid >= ITEM_ID_OTHER_SWITCH && itemid <= ITEM_ID_OTHER_AXIS_RELATIVE)
772      for (itemid = ITEM_ID_MAXIMUM + 1; itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; itemid++)
772      for (itemid = (input_item_id)(ITEM_ID_MAXIMUM + 1); itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; itemid++)
773773         if (device->item[itemid] == NULL)
774774            break;
775775   assert(itemid <= ITEM_ID_ABSOLUTE_MAXIMUM);
r4425r4426
778778   assert(device->item[itemid] == NULL);
779779
780780   /* allocate a new item and copy data into it */
781   item = auto_malloc(sizeof(*item));
781   item = (input_device_item *)auto_malloc(sizeof(*item));
782782   memset(item, 0, sizeof(*item));
783783   device->item[itemid] = item;
784784   device->maxitem = MAX(device->maxitem, itemid);
r4425r4426
947947   input_device_class devclass;
948948
949949   /* iterate over device classes and devices */
950   for (devclass = DEVICE_CLASS_INVALID + 1; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
950   for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
951951   {
952952      input_device_list *devlist = &device_list[devclass];
953953      int devnum;
r4425r4426
977977      code_pressed_memory_reset();
978978
979979   /* iterate over device classes and devices */
980   for (devclass = DEVICE_CLASS_INVALID + 1; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
980   for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
981981   {
982982      input_device_list *devlist = &device_list[devclass];
983983      int devnum;
r4425r4426
989989         input_item_id itemid;
990990
991991         /* iterate over items within each device */
992         for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++)
992         for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
993993         {
994994            input_device_item *item = device->item[itemid];
995995            if (item != NULL)
r4425r4426
10721072      input_item_id itemid;
10731073
10741074      /* iterate over items within each device */
1075      for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++)
1075      for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
10761076      {
10771077         input_device_item *item = device->item[itemid];
10781078         if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
r4425r4426
10981098   input_device_class devclass;
10991099
11001100   /* iterate over device classes and devices */
1101   for (devclass = DEVICE_CLASS_INVALID + 1; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
1101   for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
11021102   {
11031103      input_device_list *devlist = &device_list[devclass];
11041104      int devnum;
r4425r4426
11101110         input_item_id itemid;
11111111
11121112         /* iterate over items within each device */
1113         for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++)
1113         for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
11141114         {
11151115            input_device_item *item = device->item[itemid];
11161116            if (item != NULL)
r4425r4426
12921292   for (numtokens = 0; numtokens < ARRAY_LENGTH(token); )
12931293   {
12941294      /* make a token up to the next underscore */
1295      char *score = strchr(_token, '_');
1295      char *score = (char *)strchr(_token, '_');
12961296      token[numtokens++] = astring_dupch(_token, (score == NULL) ? strlen(_token) : (score - _token));
12971297
12981298      /* if we hit the end, we're done, else advance our pointer */
r4425r4426
13231323
13241324   /* if we're a standard code, default the itemclass based on it */
13251325   if (standard)
1326      itemclass = input_item_standard_class(devclass, itemid);
1326      itemclass = input_item_standard_class((input_device_class)devclass, (input_item_id)itemid);
13271327
13281328   /* otherwise, keep parsing */
13291329   else
r4425r4426
13361336      device = &device_list[devclass].list[devindex];
13371337
13381338      /* if not a standard code, look it up in the device specific codes */
1339      for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++)
1339      for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
13401340      {
13411341         input_device_item *item = device->item[itemid];
13421342         if (item != NULL && item->token != NULL && astring_cmp(token[curtok], item->token) == 0)
src/emu/drawgfx.c
r4425r4426
9090   gfx_element *gfx;
9191
9292   /* allocate memory for the gfx_element structure */
93   gfx = malloc_or_die(sizeof(*gfx));
93   gfx = (gfx_element *)malloc_or_die(sizeof(*gfx));
9494   memset(gfx, 0, sizeof(*gfx));
9595
9696   /* fill in the data */
r4425r4426
120120      }
121121      else
122122      {
123         UINT32 *buffer = malloc_or_die(sizeof(buffer[0]) * gfx->layout.width);
123         UINT32 *buffer = (UINT32 *)malloc_or_die(sizeof(buffer[0]) * gfx->layout.width);
124124         memcpy(buffer, gfx->layout.extxoffs, sizeof(gfx->layout.extxoffs[0]) * gfx->layout.width);
125125         gfx->layout.extxoffs = buffer;
126126      }
r4425r4426
135135      }
136136      else
137137      {
138         UINT32 *buffer = malloc_or_die(sizeof(buffer[0]) * gfx->layout.height);
138         UINT32 *buffer = (UINT32 *)malloc_or_die(sizeof(buffer[0]) * gfx->layout.height);
139139         memcpy(buffer, gfx->layout.extyoffs, sizeof(gfx->layout.extyoffs[0]) * gfx->layout.height);
140140         gfx->layout.extyoffs = buffer;
141141      }
r4425r4426
143143
144144   /* allocate a pen usage array for entries with 32 pens or less */
145145   if (gfx->color_depth <= 32)
146      gfx->pen_usage = malloc_or_die(gfx->total_elements * sizeof(*gfx->pen_usage));
146      gfx->pen_usage = (UINT32 *)malloc_or_die(gfx->total_elements * sizeof(*gfx->pen_usage));
147147
148148   /* allocate a dirty array */
149   gfx->dirty = malloc_or_die(gfx->total_elements * sizeof(*gfx->dirty));
149   gfx->dirty = (UINT8 *)malloc_or_die(gfx->total_elements * sizeof(*gfx->dirty));
150150   memset(gfx->dirty, 1, gfx->total_elements * sizeof(*gfx->dirty));
151151
152152   /* raw graphics case */
r4425r4426
173173      gfx->char_modulo = gfx->line_modulo * gfx->origheight;
174174
175175      /* allocate memory for the data */
176      gfx->gfxdata = malloc_or_die(gfx->total_elements * gfx->char_modulo);
176      gfx->gfxdata = (UINT8 *)malloc_or_die(gfx->total_elements * gfx->char_modulo);
177177   }
178178
179179   return gfx;
src/emu/input.h
r4425r4426
7474enum _input_device_class
7575{
7676   DEVICE_CLASS_INVALID,
77   DEVICE_CLASS_KEYBOARD,
77   DEVICE_CLASS_FIRST_VALID,
78   DEVICE_CLASS_KEYBOARD = DEVICE_CLASS_FIRST_VALID,
7879   DEVICE_CLASS_MOUSE,
7980   DEVICE_CLASS_LIGHTGUN,
8081   DEVICE_CLASS_JOYSTICK,
8182   DEVICE_CLASS_MAXIMUM
8283};
8384typedef enum _input_device_class input_device_class;
85DECLARE_ENUM_OPERATORS(input_device_class)
8486
8587
8688/* input item classes */
r4425r4426
114116enum _input_item_id
115117{
116118   ITEM_ID_INVALID,
119   ITEM_ID_FIRST_VALID,
117120
118121   /* standard keyboard IDs */
119   ITEM_ID_A,
122   ITEM_ID_A = ITEM_ID_FIRST_VALID,
120123   ITEM_ID_B,
121124   ITEM_ID_C,
122125   ITEM_ID_D,
r4425r4426
334337   ITEM_ID_ABSOLUTE_MAXIMUM = 0xfff
335338};
336339typedef enum _input_item_id input_item_id;
340DECLARE_ENUM_OPERATORS(input_item_id)
337341
338342
339343/* expanded codes referencing specific devices for input definitions */
src/emu/fileio.c
r4425r4426
181181   file_error filerr;
182182
183183   /* allocate the file itself */
184   *file = malloc(sizeof(**file));
184   *file = (mame_file *)malloc(sizeof(**file));
185185   if (*file == NULL)
186186      return FILERR_OUT_OF_MEMORY;
187187
r4425r4426
222222      return FILERR_INVALID_ACCESS;
223223
224224   /* allocate the file itself */
225   *file = malloc(sizeof(**file));
225   *file = (mame_file *)malloc(sizeof(**file));
226226   if (*file == NULL)
227227      return FILERR_OUT_OF_MEMORY;
228228
r4425r4426
651651   mame_path *path;
652652
653653   /* allocate a new mame_path */
654   path = malloc(sizeof(*path));
654   path = (mame_path *)malloc(sizeof(*path));
655655   if (path == NULL)
656656      return NULL;
657657   memset(path, 0, sizeof(*path));
r4425r4426
779779      return file->hash;
780780
781781   /* read the data if we can */
782   filedata = core_fbuffer(file->file);
782   filedata = (const UINT8 *)core_fbuffer(file->file);
783783   if (filedata == NULL)
784784      return file->hash;
785785
r4425r4426
853853   assert(file->zipfile != NULL);
854854
855855   /* allocate some memory */
856   file->zipdata = malloc(file->ziplength);
856   file->zipdata = (UINT8 *)malloc(file->ziplength);
857857   if (file->zipdata == NULL)
858858      return FILERR_OUT_OF_MEMORY;
859859
src/emu/render.c
r4425r4426
343343   if (result != NULL)
344344      container_item_free_list = result->next;
345345   else
346      result = malloc_or_die(sizeof(*result));
346      result = (container_item *)malloc_or_die(sizeof(*result));
347347
348348   memset(result, 0, sizeof(*result));
349349   return result;
r4425r4426
375375   if (result != NULL)
376376      render_primitive_free_list = result->next;
377377   else
378      result = malloc_or_die(sizeof(*result));
378      result = (render_primitive *)malloc_or_die(sizeof(*result));
379379
380380   /* clear to 0 */
381381   memset(result, 0, sizeof(*result));
r4425r4426
426426   if (ref != NULL)
427427      render_ref_free_list = ref->next;
428428   else
429      ref = malloc_or_die(sizeof(*ref));
429      ref = (render_ref *)malloc_or_die(sizeof(*ref));
430430
431431   /* set the refptr and link us into the list */
432432   ref->refptr = refptr;
r4425r4426
10731073   int listnum;
10741074
10751075   /* allocate memory for the target */
1076   target = malloc_or_die(sizeof(*target));
1076   target = (render_target *)malloc_or_die(sizeof(*target));
10771077   memset(target, 0, sizeof(*target));
10781078
10791079   /* add it to the end of the list */
r4425r4426
14681468         if (item->element == NULL)
14691469         {
14701470            const device_config *screen = device_list_find_by_index(target->machine->config->devicelist, VIDEO_SCREEN, item->index);
1471            const screen_config *scrconfig = screen->inline_config;
1471            const screen_config *scrconfig = (const screen_config *)screen->inline_config;
14721472            const rectangle vectorvis = { 0, 639, 0, 479 };
14731473            const rectangle *visarea = NULL;
14741474            render_container *container = get_screen_container_by_index(item->index);
r4425r4426
24332433      int texnum;
24342434
24352435      /* allocate a new group */
2436      texture = malloc_or_die(sizeof(*texture) * TEXTURE_GROUP_SIZE);
2436      texture = (render_texture *)malloc_or_die(sizeof(*texture) * TEXTURE_GROUP_SIZE);
24372437      memset(texture, 0, sizeof(*texture) * TEXTURE_GROUP_SIZE);
24382438
24392439      /* add them to the list */
r4425r4426
26722672         numentries = palette_get_num_colors(texture->palette) * palette_get_num_groups(texture->palette);
26732673         if (texture->bcglookup == NULL || texture->bcglookup_entries < numentries)
26742674         {
2675            texture->bcglookup = realloc(texture->bcglookup, numentries * sizeof(*texture->bcglookup));
2675            texture->bcglookup = (rgb_t *)realloc(texture->bcglookup, numentries * sizeof(*texture->bcglookup));
26762676            texture->bcglookup_entries = numentries;
26772677         }
26782678         for (index = 0; index < numentries; index++)
r4425r4426
26992699         adjusted = palette_entry_list_adjusted(texture->palette);
27002700         if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 32)
27012701         {
2702            texture->bcglookup = realloc(texture->bcglookup, 4 * 32 * sizeof(*texture->bcglookup));
2702            texture->bcglookup = (rgb_t *)realloc(texture->bcglookup, 4 * 32 * sizeof(*texture->bcglookup));
27032703            texture->bcglookup_entries = 4 * 32;
27042704         }
27052705
r4425r4426
27312731         adjusted = palette_entry_list_adjusted(texture->palette);
27322732         if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 256)
27332733         {
2734            texture->bcglookup = realloc(texture->bcglookup, 4 * 256 * sizeof(*texture->bcglookup));
2734            texture->bcglookup = (rgb_t *)realloc(texture->bcglookup, 4 * 256 * sizeof(*texture->bcglookup));
27352735            texture->bcglookup_entries = 4 * 256;
27362736         }
27372737
r4425r4426
27702770   int color;
27712771
27722772   /* allocate and clear memory */
2773   container = malloc_or_die(sizeof(*container));
2773   container = (render_container *)malloc_or_die(sizeof(*container));
27742774   memset(container, 0, sizeof(*container));
27752775
27762776   /* default values */
src/emu/clifront.c
r4425r4426
440440
441441int cli_info_listbrothers(core_options *options, const char *gamename)
442442{
443   UINT8 *didit = malloc_or_die(driver_list_get_count(drivers));
443   UINT8 *didit = (UINT8 *)malloc_or_die(driver_list_get_count(drivers));
444444   astring *filename = astring_alloc();
445445   int drvindex, count = 0;
446446
r4425r4426
954954   {
955955      /* now determine the new data length and allocate temporary memory for it */
956956      length = jedbin_output(&jed, NULL, 0);
957      tempjed = malloc(length);
957      tempjed = (UINT8 *)malloc(length);
958958      if (tempjed == NULL)
959959         return;
960960
src/emu/state.c
r4425r4426
133133   switch (entry->typesize)
134134   {
135135      case 2:
136         data16 = entry->data;
136         data16 = (UINT16 *)entry->data;
137137         for (count = 0; count < entry->typecount; count++)
138138            data16[count] = FLIPENDIAN_INT16(data16[count]);
139139         break;
140140
141141      case 4:
142         data32 = entry->data;
142         data32 = (UINT32 *)entry->data;
143143         for (count = 0; count < entry->typecount; count++)
144144            data32[count] = FLIPENDIAN_INT32(data32[count]);
145145         break;
146146
147147      case 8:
148         data64 = entry->data;
148         data64 = (UINT64 *)entry->data;
149149         for (count = 0; count < entry->typecount; count++)
150150            data64[count] = FLIPENDIAN_INT64(data64[count]);
151151         break;
r4425r4426
165165
166166void state_init(running_machine *machine)
167167{
168   machine->state_data = auto_malloc(sizeof(*machine->state_data));
168   machine->state_data = (state_private *)auto_malloc(sizeof(*machine->state_data));
169169   memset(machine->state_data, 0, sizeof(*machine->state_data));
170170}
171171
r4425r4426
264264
265265   /* didn't find one; allocate a new one */
266266   next = *entryptr;
267   *entryptr = malloc_or_die(sizeof(**entryptr));
267   *entryptr = (state_entry *)malloc_or_die(sizeof(**entryptr));
268268   memset(*entryptr, 0, sizeof(**entryptr));
269269
270270   /* fill in the rest */
r4425r4426
314314         fatalerror("Duplicate save state function (%p, %p)", param, func);
315315
316316   /* allocate a new entry */
317   *cbptr = malloc_or_die(sizeof(state_callback));
317   *cbptr = (state_callback *)malloc_or_die(sizeof(state_callback));
318318
319319   /* fill it in */
320320   (*cbptr)->next         = NULL;
r4425r4426
345345         fatalerror("Duplicate save state function (%p, %p)", param, func);
346346
347347   /* allocate a new entry */
348   *cbptr = malloc_or_die(sizeof(state_callback));
348   *cbptr = (state_callback *)malloc_or_die(sizeof(state_callback));
349349
350350   /* fill it in */
351351   (*cbptr)->next          = NULL;
src/emu/timer.c
r4425r4426
300300   int i;
301301
302302   /* allocate global data */
303   global = machine->timer_data = auto_malloc(sizeof(*global));
303   global = machine->timer_data = (timer_private *)auto_malloc(sizeof(*global));
304304   memset(global, 0, sizeof(*global));
305305
306306   /* we need to wait until the first call to timer_cyclestorun before using real CPU times */
r4425r4426
339339
340340void timer_destructor(void *ptr, size_t size)
341341{
342   timer_remove(ptr);
342   timer_remove((emu_timer *)ptr);
343343}
344344
345345
r4425r4426
10561056
10571057static TIMER_CALLBACK( periodic_timer_device_timer_callback )
10581058{
1059   const device_config *timer = ptr;
1059   const device_config *timer = (const device_config *)ptr;
10601060   timer_state *state = get_safe_token(timer);
1061   timer_config *config = timer->inline_config;
1061   timer_config *config = (timer_config *)timer->inline_config;
10621062
10631063   /* call the real callback */
10641064   config->callback(timer, state->ptr, state->param);
r4425r4426
10741074static TIMER_CALLBACK( scanline_timer_device_timer_callback )
10751075{
10761076   int next_vpos;
1077   const device_config *timer = ptr;
1077   const device_config *timer = (const device_config *)ptr;
10781078   timer_state *state = get_safe_token(timer);
1079   timer_config *config = timer->inline_config;
1079   timer_config *config = (timer_config *)timer->inline_config;
10801080
10811081   /* get the screen device and verify it */
10821082   const device_config *screen = devtag_get_device(timer->machine, config->screen);
r4425r4426
11731173   assert(device->machine->config != NULL);
11741174
11751175   /* get and validate the configuration */
1176   config = device->inline_config;
1176   config = (timer_config *)device->inline_config;
11771177   assert(config->type == TIMER_TYPE_PERIODIC || config->type == TIMER_TYPE_SCANLINE || config->type == TIMER_TYPE_GENERIC);
11781178   assert(config->callback != NULL);
11791179
src/emu/mconfig.c
r4425r4426
6969   machine_config *config;
7070
7171   /* allocate a new configuration object */
72   config = malloc_or_die(sizeof(*config));
72   config = (machine_config *)malloc_or_die(sizeof(*config));
7373   memset(config, 0, sizeof(*config));
7474
7575   /* parse tokens into the config */
r4425r4426
318318   if (depth == 0)
319319      for (device = config->devicelist; device != NULL; device = device->next)
320320      {
321         tokens = device_get_info_ptr(device, DEVINFO_PTR_MACHINE_CONFIG);
321         tokens = (const machine_config_token *)device_get_info_ptr(device, DEVINFO_PTR_MACHINE_CONFIG);
322322         if (tokens != NULL)
323323            machine_config_detokenize(config, tokens, device, depth + 1);
324324      }
src/emu/emupal.c
r4425r4426
9595
9696void palette_init(running_machine *machine)
9797{
98   int format;
99   palette_private *palette = auto_malloc(sizeof(*palette));
98   palette_private *palette = (palette_private *)auto_malloc(sizeof(*palette));
10099   const device_config *device = video_screen_first(machine->config);
100   bitmap_format format;
101101
102102   /* get the format from the first screen, or use BITMAP_FORMAT_INVALID, if screenless */
103103   if (device != NULL)
104104   {
105      screen_config *config = device->inline_config;
105      screen_config *config = (screen_config *)device->inline_config;
106106      format = config->format;
107107   }
108108   else
r4425r4426
146146
147147      /* set up save/restore of the palette */
148148      numcolors = palette_get_num_colors(machine->palette);
149      palette->save_pen = auto_malloc(sizeof(*palette->save_pen) * numcolors);
150      palette->save_bright = auto_malloc(sizeof(*palette->save_bright) * numcolors);
149      palette->save_pen = (pen_t *)auto_malloc(sizeof(*palette->save_pen) * numcolors);
150      palette->save_bright = (float *)auto_malloc(sizeof(*palette->save_bright) * numcolors);
151151      state_save_register_global_pointer(machine, palette->save_pen, numcolors);
152152      state_save_register_global_pointer(machine, palette->save_bright, numcolors);
153153      state_save_register_presave(machine, palette_presave, palette);
r4425r4426
330330   assert(palettesize > 0);
331331
332332   /* allocate the colortable */
333   ctable = auto_malloc(sizeof(*ctable));
333   ctable = (colortable_t *)auto_malloc(sizeof(*ctable));
334334   memset(ctable, 0, sizeof(*ctable));
335335
336336   /* fill in the basics */
r4425r4426
339339   ctable->palentries = palettesize;
340340
341341   /* allocate the raw colortable */
342   ctable->raw = auto_malloc(ctable->entries * sizeof(*ctable->raw));
342   ctable->raw = (UINT16 *)auto_malloc(ctable->entries * sizeof(*ctable->raw));
343343   for (index = 0; index < ctable->entries; index++)
344344      ctable->raw[index] = index % ctable->palentries;
345345   state_save_register_global_pointer(machine, ctable->raw, ctable->entries);
346346
347347   /* allocate the palette */
348   ctable->palette = auto_malloc(ctable->palentries * sizeof(*ctable->palette));
348   ctable->palette = (rgb_t *)auto_malloc(ctable->palentries * sizeof(*ctable->palette));
349349   for (index = 0; index < ctable->palentries; index++)
350350      ctable->palette[index] = MAKE_ARGB(0x80,0xff,0xff,0xff);
351351   state_save_register_global_pointer(machine, ctable->palette, ctable->palentries);
r4425r4426
536536static void palette_presave(running_machine *machine, void *param)
537537{
538538   int numcolors = palette_get_num_colors(machine->palette);
539   palette_private *palette = param;
539   palette_private *palette = (palette_private *)param;
540540   int index;
541541
542542   /* fill the save arrays with updated pen and brightness information */
r4425r4426
556556static void palette_postload(running_machine *machine, void *param)
557557{
558558   int numcolors = palette_get_num_colors(machine->palette);
559   palette_private *palette = param;
559   palette_private *palette = (palette_private *)param;
560560   int index;
561561
562562   /* reset the pen and brightness for each entry */
r4425r4426
660660   {
661661      case BITMAP_FORMAT_INDEXED16:
662662         /* create a dummy 1:1 mapping */
663         machine->pens = pentable = auto_malloc((total_colors + 2) * sizeof(machine->pens[0]));
663         machine->pens = pentable = (pen_t *)auto_malloc((total_colors + 2) * sizeof(machine->pens[0]));
664664         for (i = 0; i < total_colors + 2; i++)
665665            pentable[i] = i;
666666         break;
r4425r4426
690690   /* if we have shadows, allocate shadow tables */
691691   if (machine->config->video_attributes & VIDEO_HAS_SHADOWS)
692692   {
693      pen_t *table = auto_malloc(65536 * sizeof(*table));
693      pen_t *table = (pen_t *)auto_malloc(65536 * sizeof(*table));
694694      int i;
695695
696696      /* palettized mode gets a single 64k table in slots 0 and 2 */
r4425r4426
713713   /* if we have hilights, allocate shadow tables */
714714   if (machine->config->video_attributes & VIDEO_HAS_HIGHLIGHTS)
715715   {
716      pen_t *table = auto_malloc(65536 * sizeof(*table));
716      pen_t *table = (pen_t *)auto_malloc(65536 * sizeof(*table));
717717      int i;
718718
719719      /* palettized mode gets a single 64k table in slots 1 and 3 */
src/emu/cheat.c
r4425r4426
5151    variables may be requested via the 'tempvariables' attribute
5252    on the cheat.
5353
54**********************************************************************
55
56    Cheats are generally broken down into categories based on
57    which actions are defined and whether or not there is a
58    parameter present:
59
60    ---- Actions -----
61    On   Off  Run  Chg  Param?  Type
62    ===  ===  ===  ===  ======  =================================
63     N    N    N    ?    None   Text-only (displays text in menu)
64     Y    N    N    ?    None   Oneshot (select to activate)
65     Y    Y    N    ?    None   On/Off (select to toggle)
66     ?    ?    Y    ?    None   On/Off (select to toggle)
67
68     ?    N    N    Y    Any    Oneshot parameter (select to alter)
69     ?    Y    ?    ?    Value  Value parameter (off or a live value)
70     ?    ?    Y    ?    Value  Value parameter (off or a live value)
71     ?    Y    ?    ?    List   Item list parameter (off or a live value)
72     ?    ?    Y    ?    List   Item list parameter (off or a live value)
73
5474*********************************************************************/
5575
5676#include "driver.h"
r4425r4426
82102   SCRIPT_STATE_COUNT
83103};
84104typedef enum _script_state script_state;
105DECLARE_ENUM_OPERATORS(script_state)
85106
86107
87108
r4425r4426
97118   astring *         text;                     /* name of the item */
98119   UINT64            value;                     /* value of the item */
99120   int               valformat;                  /* format of value */
121   astring *         curtext;                  /* name of the current item */
100122};
101123
102124
r4425r4426
217239***************************************************************************/
218240
219241/*-------------------------------------------------
242    is_text_only_cheat - return TRUE if this
243    cheat entry is text-only (no actions)
244-------------------------------------------------*/
245
246INLINE int is_text_only_cheat(const cheat_entry *cheat)
247{
248   return (cheat->parameter == NULL &&
249         cheat->script[SCRIPT_STATE_RUN] == NULL &&
250         cheat->script[SCRIPT_STATE_OFF] == NULL &&
251         cheat->script[SCRIPT_STATE_ON] == NULL);
252}
253
254
255/*-------------------------------------------------
256    is_oneshot_cheat - return TRUE if this cheat
257    entry is a one-shot cheat (no "run" or "off"
258    action, but a valid "on" action)
259-------------------------------------------------*/
260
261INLINE int is_oneshot_cheat(const cheat_entry *cheat)
262{
263   return (cheat->parameter == NULL &&
264         cheat->script[SCRIPT_STATE_RUN] == NULL &&
265         cheat->script[SCRIPT_STATE_OFF] == NULL &&
266         cheat->script[SCRIPT_STATE_ON] != NULL);
267}
268
269
270/*-------------------------------------------------
271    is_onoff_cheat - return TRUE if this cheat
272    entry is a simple on/off toggle (either the
273    "run" or "off" actions are present)
274-------------------------------------------------*/
275
276INLINE int is_onoff_cheat(const cheat_entry *cheat)
277{
278   return (cheat->parameter == NULL &&
279         (cheat->script[SCRIPT_STATE_RUN] != NULL ||
280          (cheat->script[SCRIPT_STATE_OFF] != NULL &&
281           cheat->script[SCRIPT_STATE_ON] != NULL)));
282}
283
284
285/*-------------------------------------------------
286    is_value_parameter_cheat - return TRUE if this
287    cheat entry has a parameter represented by an
288    integer value
289-------------------------------------------------*/
290
291INLINE int is_value_parameter_cheat(const cheat_entry *cheat)
292{
293   return (cheat->parameter != NULL && cheat->parameter->itemlist == NULL);
294}
295
296
297/*-------------------------------------------------
298    is_itemlist_parameter_cheat - return TRUE if
299    this cheat entry has a parameter represented
300    by an item list
301-------------------------------------------------*/
302
303INLINE int is_itemlist_parameter_cheat(const cheat_entry *cheat)
304{
305   return (cheat->parameter != NULL && cheat->parameter->itemlist != NULL);
306}
307
308
309/*-------------------------------------------------
310    is_oneshot_parameter_cheat - return TRUE if
311    this cheat entry is a one-shot cheat with a
312    parameter (no "run" or "off" actions, but a
313    valid "change" action)
314-------------------------------------------------*/
315
316INLINE int is_oneshot_parameter_cheat(const cheat_entry *cheat)
317{
318   return (cheat->parameter != NULL &&
319         cheat->script[SCRIPT_STATE_RUN] == NULL &&
320         cheat->script[SCRIPT_STATE_OFF] == NULL &&
321         cheat->script[SCRIPT_STATE_CHANGE] != NULL);
322}
323
324
325/*-------------------------------------------------
220326    format_int - format an integer according to
221327    the format
222328-------------------------------------------------*/
223329
224static const char *format_int(astring *string, UINT64 value, int format)
330INLINE const char *format_int(astring *string, UINT64 value, int format)
225331{
226332   switch (format)
227333   {
r4425r4426
265371   add_exit_callback(machine, cheat_exit);
266372
267373   /* allocate memory */
268   cheatinfo = auto_malloc(sizeof(*cheatinfo));
374   cheatinfo = (cheat_private *)auto_malloc(sizeof(*cheatinfo));
269375   memset(cheatinfo, 0, sizeof(*cheatinfo));
270376   machine->cheat_data = cheatinfo;
271377
r4425r4426
343449void *cheat_get_next_menu_entry(running_machine *machine, void *previous, const char **description, const char **state, UINT32 *flags)
344450{
345451   cheat_private *cheatinfo = machine->cheat_data;
346   cheat_entry *preventry = previous;
452   cheat_entry *preventry = (cheat_entry *)previous;
347453   cheat_entry *cheat;
348454
349455   /* NULL previous means get the first */
r4425r4426
356462      *description = astring_c(cheat->description);
357463
358464   /* some cheat entries are just text for display */
359   if (cheat->parameter == NULL && cheat->script[SCRIPT_STATE_RUN] == NULL && cheat->script[SCRIPT_STATE_OFF] == NULL && cheat->script[SCRIPT_STATE_ON] == NULL)
465   if (is_text_only_cheat(cheat))
360466   {
361467      if (description != NULL)
362468      {
r4425r4426
372478   }
373479
374480   /* if we have no parameter and no run or off script, it's a oneshot cheat */
375   else if (cheat->parameter == NULL && cheat->script[SCRIPT_STATE_RUN] == NULL && cheat->script[SCRIPT_STATE_OFF] == NULL)
481   else if (is_oneshot_cheat(cheat))
376482   {
377483      if (state != NULL)
378484         *state = "Set";
r4425r4426
381487   }
382488
383489   /* if we have no parameter, it's just on/off */
384   else if (cheat->parameter == NULL)
490   else if (is_onoff_cheat(cheat))
385491   {
386492      if (state != NULL)
387493         *state = (cheat->state == SCRIPT_STATE_RUN) ? "On" : "Off";
r4425r4426
390496   }
391497
392498   /* if we have a value parameter, compute it */
393   else if (cheat->parameter->itemlist == NULL)
499   else if (is_value_parameter_cheat(cheat))
394500   {
395501      if (cheat->state == SCRIPT_STATE_OFF)
396502      {
397         if (state != NULL)
398            *state = "Off";
503         *state = is_oneshot_parameter_cheat(cheat) ? "Set" : "Off";
399504         if (flags != NULL)
400505            *flags = MENU_FLAG_RIGHT_ARROW;
401506      }
r4425r4426
416521   }
417522
418523   /* if we have an item list, pick the index */
419   else
524   else if (is_itemlist_parameter_cheat(cheat))
420525   {
421526      if (cheat->state == SCRIPT_STATE_OFF)
422527      {
423528         if (state != NULL)
424            *state = "Off";
529            *state = is_oneshot_parameter_cheat(cheat) ? "Set" : "Off";
425530         if (flags != NULL)
426531            *flags = MENU_FLAG_RIGHT_ARROW;
427532      }
r4425r4426
439544            *flags = MENU_FLAG_LEFT_ARROW;
440545            if (item == NULL || item->next != NULL)
441546               *flags |= MENU_FLAG_RIGHT_ARROW;
547            cheat->parameter->itemlist->curtext = item->text; /* Take a copy of the most current parameter for the popmessage (if used) */
442548         }
443549      }
444550   }
r4425r4426
455561int cheat_activate(running_machine *machine, void *entry)
456562{
457563   cheat_private *cheatinfo = machine->cheat_data;
458   cheat_entry *cheat = entry;
564   cheat_entry *cheat = (cheat_entry *)entry;
459565   int changed = FALSE;
460566
461567   /* if we have no parameter and no run or off script, but we do have an on script, it's a oneshot cheat */
462   if (cheat->parameter == NULL && cheat->script[SCRIPT_STATE_RUN] == NULL && cheat->script[SCRIPT_STATE_OFF] == NULL && cheat->script[SCRIPT_STATE_ON] != NULL)
568   if (is_oneshot_cheat(cheat))
463569   {
464570      cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_ON);
465571      changed = TRUE;
466572      popmessage("Activated %s", astring_c(cheat->description));
467573   }
468574
575   /* if we have no run or off script, but we do have parameter and change scripts and it's not in the off state, it's a oneshot list or selectable value cheat */
576   else if (is_oneshot_parameter_cheat(cheat) && cheat->state != SCRIPT_STATE_OFF)
577   {
578      cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
579      changed = TRUE;
580      if (cheat->parameter->itemlist != NULL)
581         popmessage("Activated\n %s = %s", astring_c(cheat->description), astring_c(cheat->parameter->itemlist->curtext) );
582      else
583         popmessage("Activated\n %s = %d (0x%X)", astring_c(cheat->description), (UINT32)cheat->parameter->value, (UINT32)cheat->parameter->value );
584   }
585
469586   return changed;
470587}
471588
r4425r4426
479596int cheat_select_default_state(running_machine *machine, void *entry)
480597{
481598   cheat_private *cheatinfo = machine->cheat_data;
482   cheat_entry *cheat = entry;
599   cheat_entry *cheat = (cheat_entry *)entry;
483600   int changed = FALSE;
484601
485602   /* if we have no parameter and no run or off script, it's either text or a oneshot cheat */
486   if (cheat->parameter == NULL && cheat->script[SCRIPT_STATE_RUN] == NULL && cheat->script[SCRIPT_STATE_OFF] == NULL)
603   if (is_oneshot_cheat(cheat))
487604      ;
488605
489606   /* if we have no parameter, it's just on/off; default to off */
r4425r4426
508625int cheat_select_previous_state(running_machine *machine, void *entry)
509626{
510627   cheat_private *cheatinfo = machine->cheat_data;
511   cheat_entry *cheat = entry;
628   cheat_entry *cheat = (cheat_entry *)entry;
512629   int changed = FALSE;
513630
514631   /* if we have no parameter and no run or off script, it's either text or a oneshot cheat */
515   if (cheat->parameter == NULL && cheat->script[SCRIPT_STATE_RUN] == NULL && cheat->script[SCRIPT_STATE_OFF] == NULL)
632   if (is_oneshot_cheat(cheat))
516633      ;
517634
518635   /* if we have no parameter, it's just on/off */
519   else if (cheat->parameter == NULL)
636   else if (is_onoff_cheat(cheat))
520637   {
521638      if (cheat->state != SCRIPT_STATE_OFF)
522639      {
r4425r4426
527644   }
528645
529646   /* if we have a value parameter, compute it */
530   else if (cheat->parameter->itemlist == NULL)
647   else if (is_value_parameter_cheat(cheat))
531648   {
532649      if (cheat->parameter->value > cheat->parameter->minval)
533650      {
r4425r4426
535652            cheat->parameter->value = cheat->parameter->minval;
536653         else
537654            cheat->parameter->value -= cheat->parameter->stepval;
538         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
655         if (!is_oneshot_parameter_cheat(cheat))
656            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
539657         changed = TRUE;
540658      }
541659      else if (cheat->state != SCRIPT_STATE_OFF)
r4425r4426
562680            cheat->state = SCRIPT_STATE_RUN;
563681         }
564682         cheat->parameter->value = prev->value;
565         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
683         if (!is_oneshot_parameter_cheat(cheat))
684            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
566685         changed = TRUE;
567686      }
568687      else if (cheat->state != SCRIPT_STATE_OFF)
r4425r4426
584703int cheat_select_next_state(running_machine *machine, void *entry)
585704{
586705   cheat_private *cheatinfo = machine->cheat_data;
587   cheat_entry *cheat = entry;
706   cheat_entry *cheat = (cheat_entry *)entry;
588707   int changed = FALSE;
589708
590709   /* if we have no parameter and no run or off script, it's a oneshot cheat */
591   if (cheat->parameter == NULL && cheat->script[SCRIPT_STATE_RUN] == NULL && cheat->script[SCRIPT_STATE_OFF] == NULL)
710   if (is_oneshot_cheat(cheat))
592711      ;
593712
594713   /* if we have no parameter, it's just on/off */
595   else if (cheat->parameter == NULL)
714   else if (is_onoff_cheat(cheat))
596715   {
597716      if (cheat->state != SCRIPT_STATE_RUN)
598717      {
r4425r4426
603722   }
604723
605724   /* if we have a value parameter, compute it */
606   else if (cheat->parameter->itemlist == NULL)
725   else if (is_value_parameter_cheat(cheat))
607726   {
608727      if (cheat->state == SCRIPT_STATE_OFF)
609728      {
610729         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_ON);
611730         cheat->state = SCRIPT_STATE_RUN;
612731         cheat->parameter->value = cheat->parameter->minval;
613         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
732         if (!is_oneshot_parameter_cheat(cheat))
733            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
614734         changed = TRUE;
615735      }
616736      else if (cheat->parameter->value < cheat->parameter->maxval)
r4425r4426
619739            cheat->parameter->value = cheat->parameter->maxval;
620740         else
621741            cheat->parameter->value += cheat->parameter->stepval;
622         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
742         if (!is_oneshot_parameter_cheat(cheat))
743            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
623744         changed = TRUE;
624745      }
625746   }
r4425r4426
634755         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_ON);
635756         cheat->state = SCRIPT_STATE_RUN;
636757         cheat->parameter->value = cheat->parameter->itemlist->value;
637         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
758         if (!is_oneshot_parameter_cheat(cheat))
759            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
638760         changed = TRUE;
639761      }
640762      else
r4425r4426
645767         if (item->next != NULL)
646768         {
647769            cheat->parameter->value = item->next->value;
648            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
770            if (!is_oneshot_parameter_cheat(cheat))
771               cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
649772            changed = TRUE;
650773         }
651774      }
r4425r4426
9371060   }
9381061
9391062   /* allocate memory for the cheat */
940   cheat = malloc_or_die(sizeof(*cheat) + (tempcount - 1) * sizeof(cheat->tempvar));
1063   cheat = (cheat_entry *)malloc_or_die(sizeof(*cheat) + (tempcount - 1) * sizeof(cheat->tempvar));
9411064   memset(cheat, 0, sizeof(*cheat) + (tempcount - 1) * sizeof(cheat->tempvar));
9421065   cheat->numtemp = tempcount;
9431066
r4425r4426
11081231   cheat_parameter *param;
11091232
11101233   /* allocate memory for it */
1111   param = malloc_or_die(sizeof(*param));
1234   param = (cheat_parameter *)malloc_or_die(sizeof(*param));
11121235   memset(param, 0, sizeof(*param));
11131236
11141237   /* read the core attributes */
r4425r4426
11261249      parameter_item *curitem;
11271250
11281251      /* allocate memory for it */
1129      curitem = malloc_or_die(sizeof(*curitem));
1252      curitem = (parameter_item *)malloc_or_die(sizeof(*curitem));
11301253      memset(curitem, 0, sizeof(*curitem));
11311254
11321255      /* check for NULL text */
r4425r4426
12371360   const char *state;
12381361
12391362   /* allocate memory for it */
1240   script = malloc_or_die(sizeof(*script));
1363   script = (cheat_script *)malloc_or_die(sizeof(*script));
12411364   memset(script, 0, sizeof(*script));
12421365
12431366   /* read the core attributes */
r4425r4426
13521475   EXPRERR experr;
13531476
13541477   /* allocate memory for it */
1355   entry = malloc_or_die(sizeof(*entry));
1478   entry = (script_entry *)malloc_or_die(sizeof(*entry));
13561479   memset(entry, 0, sizeof(*entry));
13571480
13581481   /* read the condition if present */
r4425r4426
14221545         output_argument *curarg;
14231546
14241547         /* allocate memory for it */
1425         curarg = malloc_or_die(sizeof(*curarg));
1548         curarg = (output_argument *)malloc_or_die(sizeof(*curarg));
14261549         memset(curarg, 0, sizeof(*curarg));
14271550
14281551         /* first extract attributes */
14291552         curarg->count = xml_get_attribute_int(argnode, "count", 1);
14301553         totalargs += curarg->count;
14311554
1555         /* max out on arguments */
1556         if (totalargs > MAX_ARGUMENTS)
1557         {
1558            mame_printf_error("%s.xml(%d): too many arguments (found %d, max is %d)\n", filename, argnode->line, totalargs, MAX_ARGUMENTS);
1559            goto error;
1560         }
1561
14321562         /* read the expression */
14331563         expression = argnode->value;
14341564         if (expression == NULL || expression[0] == 0)
r4425r4426
14481578         argtailptr = &curarg->next;
14491579      }
14501580
1451      /* max out on arguments */
1452      if (totalargs > MAX_ARGUMENTS)
1453      {
1454         mame_printf_error("%s.xml(%d): too many arguments (found %d, max is %d)\n", filename, argnode->line, totalargs, MAX_ARGUMENTS);
1455         goto error;
1456      }
1457
14581581      /* validate the format against the arguments */
14591582      if (!validate_format(filename, entrynode->line, entry))
14601583         goto error;
src/emu/state.h
r4425r4426
5252
5353
5454#define IS_COMPATIBLE_TYPE(_valtype, _checktype)                              \
55   (sizeof(_valtype) == sizeof(_checktype) && TYPES_COMPATIBLE(typeof(_valtype), _checktype))
55   (sizeof(_valtype) == sizeof(_checktype) && TYPES_COMPATIBLE(_valtype, _checktype))
5656
5757#define IS_VALID_SAVE_TYPE(_valtype)                                       \
5858   (IS_COMPATIBLE_TYPE(_valtype, double) || IS_COMPATIBLE_TYPE(_valtype, float)  ||   \
src/emu/validity.c
r4425r4426
233233
234234   /* determine how many total bytes we need */
235235   total_bytes = sizeof(*table) + entries * sizeof(table->entry[0]) + hashsize * sizeof(table->hash[0]);
236   table = auto_malloc(total_bytes);
236   table = (quark_table *)auto_malloc(total_bytes);
237237
238238   /* fill in the details */
239239   table->entries = entries;
r4425r4426
726726   /* loop over all the CPUs */
727727   for (device = cpu_first(config); device != NULL; device = cpu_next(device))
728728   {
729      const cpu_config *cpuconfig = device->inline_config;
729      const cpu_config *cpuconfig = (const cpu_config *)device->inline_config;
730730      int spacenum;
731731
732732      /* check the CPU for incompleteness */
r4425r4426
925925   /* loop over screens */
926926   for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
927927   {
928      const screen_config *scrconfig = device->inline_config;
928      const screen_config *scrconfig = (const screen_config *)device->inline_config;
929929
930930      /* sanity check dimensions */
931931      if ((scrconfig->width <= 0) || (scrconfig->height <= 0))
r4425r4426
14971497   /* make sure the sounds are wired to the speakers correctly */
14981498   for (cursound = sound_first(config); cursound != NULL; cursound = sound_next(cursound))
14991499   {
1500      const sound_config *curconfig = cursound->inline_config;
1500      const sound_config *curconfig = (const sound_config *)cursound->inline_config;
15011501      const sound_route *route;
15021502
15031503      /* loop over all the routes */
src/emu/romload.c
r4425r4426
125125   chd.origfile = file;
126126
127127   /* we're okay, add to the list of disks */
128   *chd_list_tailptr = auto_malloc(sizeof(**chd_list_tailptr));
128   *chd_list_tailptr = (open_chd *)auto_malloc(sizeof(**chd_list_tailptr));
129129   **chd_list_tailptr = chd;
130130   chd_list_tailptr = &(*chd_list_tailptr)->next;
131131}
r4425r4426
165165   if (config != NULL)
166166      for (device = config->devicelist; device != NULL; device = device->next)
167167      {
168         const rom_entry *devromp = device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
168         const rom_entry *devromp = (const rom_entry *)device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
169169         if (devromp != NULL)
170170            return (rom_source *)device;
171171      }
r4425r4426
191191   /* look for further devices with ROM definitions */
192192   for ( ; device != NULL; device = device->next)
193193   {
194      const rom_entry *devromp = device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
194      const rom_entry *devromp = (const rom_entry *)device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
195195      if (devromp != NULL)
196196         return (rom_source *)device;
197197   }
r4425r4426
211211   if (source == NULL || rom_source_is_gamedrv(drv, source))
212212      romp = drv->rom;
213213   else
214      romp = device_get_info_ptr((const device_config *)source, DEVINFO_PTR_ROM_REGION);
214      romp = (const rom_entry *)device_get_info_ptr((const device_config *)source, DEVINFO_PTR_ROM_REGION);
215215
216216   return (romp != NULL && !ROMENTRY_ISEND(romp)) ? romp : NULL;
217217}
r4425r4426
757757
758758   /* use a temporary buffer for complex loads */
759759   tempbufsize = MIN(TEMPBUFFER_MAX_SIZE, numbytes);
760   tempbuf = malloc_or_die(tempbufsize);
760   tempbuf = (UINT8 *)malloc_or_die(tempbufsize);
761761
762762   /* chunky reads for complex loads */
763763   skip += groupsize;
r4425r4426
11951195         /* get the header and extract the MD5/SHA1 */
11961196         header = *chd_get_header(chd.origchd);
11971197         hash_data_clear(acthash);
1198         hash_data_insert_binary_checksum(acthash, HASH_MD5, header.md5);
11991198         hash_data_insert_binary_checksum(acthash, HASH_SHA1, header.sha1);
12001199
1201         /* verify the MD5 */
1200         /* verify the hash */
12021201         if (!hash_data_is_equal(ROM_GETHASHDATA(romp), acthash, 0))
12031202         {
12041203            astring_catprintf(romdata->errorstring, "%s WRONG CHECKSUMS:\n", astring_c(filename));
r4425r4426
12261225
12271226         /* we're okay, add to the list of disks */
12281227         LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp)));
1229         *chd_list_tailptr = auto_malloc(sizeof(**chd_list_tailptr));
1228         *chd_list_tailptr = (open_chd *)auto_malloc(sizeof(**chd_list_tailptr));
12301229         **chd_list_tailptr = chd;
12311230         chd_list_tailptr = &(*chd_list_tailptr)->next;
12321231      }
src/lib/util/chd.c
r4425r4426
184184};
185185
186186
187/* a single metadata hash entry */
188typedef struct _metadata_hash metadata_hash;
189struct _metadata_hash
190{
191   UINT8               tag[4];         /* tag of the metadata in big-endian */
192   UINT8               sha1[CHD_SHA1_BYTES]; /* hash */
193};
187194
195
196
188197/***************************************************************************
189198    GLOBAL VARIABLES
190199***************************************************************************/
r4425r4426
225234static chd_error metadata_find_entry(chd_file *chd, UINT32 metatag, UINT32 metaindex, metadata_entry *metaentry);
226235static chd_error metadata_set_previous_next(chd_file *chd, UINT64 prevoffset, UINT64 nextoffset);
227236static chd_error metadata_set_length(chd_file *chd, UINT64 offset, UINT32 length);
237static chd_error metadata_compute_hash(chd_file *chd, const UINT8 *rawsha1, UINT8 *finalsha1);
238static int CLIB_DECL metadata_hash_compare(const void *elem1, const void *elem2);
228239
229240/* zlib compression codec */
230241static chd_error zlib_codec_init(chd_file *chd);
r4425r4426
519530
520531   /* build the header */
521532   memset(&header, 0, sizeof(header));
522   header.length = CHD_V3_HEADER_SIZE;
533   header.length = CHD_V4_HEADER_SIZE;
523534   header.version = CHD_HEADER_VERSION;
524535   header.flags = CHDFLAGS_IS_WRITEABLE;
525536   header.compression = compression;
r4425r4426
12171228      core_fseek(chd->file, metaentry.offset + METADATA_HEADER_SIZE, SEEK_SET);
12181229      count = core_fwrite(chd->file, inputbuf, inputlen);
12191230      if (count != inputlen)
1220         return CHDERR_WRITE_ERROR;
1231      {
1232         err = CHDERR_WRITE_ERROR;
1233         goto update;
1234      }
12211235
12221236      /* if the lengths don't match, we need to update the length in our header */
12231237      if (inputlen != metaentry.length)
1224      {
12251238         err = metadata_set_length(chd, metaentry.offset, inputlen);
1226         if (err != CHDERR_NONE)
1227            return err;
1228      }
1229      return CHDERR_NONE;
1239      goto update;
12301240   }
12311241
12321242   /* if we already have an entry, unlink it */
r4425r4426
12341244   {
12351245      err = metadata_set_previous_next(chd, metaentry.prev, metaentry.next);
12361246      if (err != CHDERR_NONE)
1237         return err;
1247         goto update;
12381248   }
12391249
12401250   /* now build us a new entry */
r4425r4426
12471257   core_fseek(chd->file, offset, SEEK_SET);
12481258   count = core_fwrite(chd->file, raw_meta_header, sizeof(raw_meta_header));
12491259   if (count != sizeof(raw_meta_header))
1250      return CHDERR_WRITE_ERROR;
1260   {
1261      err = CHDERR_WRITE_ERROR;
1262      goto update;
1263   }
12511264
12521265   /* follow that with the data */
12531266   core_fseek(chd->file, offset + METADATA_HEADER_SIZE, SEEK_SET);
12541267   count = core_fwrite(chd->file, inputbuf, inputlen);
12551268   if (count != inputlen)
1256      return CHDERR_WRITE_ERROR;
1269   {
1270      err = CHDERR_WRITE_ERROR;
1271      goto update;
1272   }
12571273
12581274   /* set the previous entry to point to us */
12591275   err = metadata_set_previous_next(chd, metaentry.prev, offset);
1260   if (err != CHDERR_NONE)
1261      return err;
12621276
1263   return CHDERR_NONE;
1277update:
1278   /* update the hash */
1279   if (metadata_compute_hash(chd, chd->header.rawsha1, chd->header.sha1) == CHDERR_NONE)
1280      err = header_write(chd->file, &chd->header);
1281   return err;
12641282}
12651283
12661284
r4425r4426
14391457   /* compute the final MD5/SHA1 values */
14401458   MD5Final(chd->header.md5, &chd->compmd5);
14411459   sha1_final(&chd->compsha1);
1442   sha1_digest(&chd->compsha1, SHA1_DIGEST_SIZE, chd->header.sha1);
1460   sha1_digest(&chd->compsha1, SHA1_DIGEST_SIZE, chd->header.rawsha1);
1461   metadata_compute_hash(chd, chd->header.rawsha1, chd->header.sha1);
14431462
14441463   /* turn off the writeable flag and re-write the header */
14451464   chd->header.flags &= ~CHDFLAGS_IS_WRITEABLE;
r4425r4426
15271546    the CHD
15281547-------------------------------------------------*/
15291548
1530chd_error chd_verify_finish(chd_file *chd, UINT8 *finalmd5, UINT8 *finalsha1)
1549chd_error chd_verify_finish(chd_file *chd, chd_verify_result *result)
15311550{
15321551   /* error if in the wrong state */
15331552   if (!chd->verifying)
15341553      return CHDERR_INVALID_STATE;
15351554
15361555   /* compute the final MD5 */
1537   if (finalmd5 != NULL)
1538      MD5Final(finalmd5, &chd->vermd5);
1556   MD5Final(result->md5, &chd->vermd5);
15391557
15401558   /* compute the final SHA1 */
1541   if (finalsha1 != NULL)
1542   {
1543      sha1_final(&chd->versha1);
1544      sha1_digest(&chd->versha1, SHA1_DIGEST_SIZE, finalsha1);
1545   }
1559   sha1_final(&chd->versha1);
1560   sha1_digest(&chd->versha1, SHA1_DIGEST_SIZE, result->rawsha1);
15461561
1562   /* compute the overall hash including metadata */
1563   metadata_compute_hash(chd, result->rawsha1, result->sha1);
1564
15471565   /* return an error */
15481566   chd->verifying = FALSE;
15491567   return (chd->verhunk < chd->header.totalhunks) ? CHDERR_VERIFY_INCOMPLETE : CHDERR_NONE;
r4425r4426
16531671   /* require a valid length */
16541672   if ((header->version == 1 && header->length != CHD_V1_HEADER_SIZE) ||
16551673      (header->version == 2 && header->length != CHD_V2_HEADER_SIZE) ||
1656      (header->version == 3 && header->length != CHD_V3_HEADER_SIZE))
1674      (header->version == 3 && header->length != CHD_V3_HEADER_SIZE) ||
1675      (header->version == 4 && header->length != CHD_V4_HEADER_SIZE))
16571676      return CHDERR_INVALID_PARAMETER;
16581677
16591678   /* require valid flags */
r4425r4426
17061725   UINT32 count;
17071726
17081727   /* punt if NULL */
1709   if (!header)
1728   if (header == NULL)
17101729      return CHDERR_INVALID_PARAMETER;
17111730
17121731   /* punt if invalid file */
1713   if (!file)
1732   if (file == NULL)
17141733      return CHDERR_INVALID_FILE;
17151734
17161735   /* seek and read */
r4425r4426
17351754   /* make sure the length is expected */
17361755   if ((header->version == 1 && header->length != CHD_V1_HEADER_SIZE) ||
17371756      (header->version == 2 && header->length != CHD_V2_HEADER_SIZE) ||
1738      (header->version == 3 && header->length != CHD_V3_HEADER_SIZE))
1757      (header->version == 3 && header->length != CHD_V3_HEADER_SIZE) ||
1758      (header->version == 4 && header->length != CHD_V4_HEADER_SIZE))
17391759      return CHDERR_INVALID_DATA;
17401760
17411761   /* extract the common data */
17421762   header->flags         = get_bigendian_uint32(&rawheader[16]);
17431763   header->compression   = get_bigendian_uint32(&rawheader[20]);
1744   memcpy(header->md5, &rawheader[44], CHD_MD5_BYTES);
1745   memcpy(header->parentmd5, &rawheader[60], CHD_MD5_BYTES);
17461764
17471765   /* extract the V1/V2-specific data */
17481766   if (header->version < 3)
r4425r4426
17531771      header->obsolete_cylinders = get_bigendian_uint32(&rawheader[32]);
17541772      header->obsolete_heads     = get_bigendian_uint32(&rawheader[36]);
17551773      header->obsolete_sectors   = get_bigendian_uint32(&rawheader[40]);
1774      memcpy(header->md5, &rawheader[44], CHD_MD5_BYTES);
1775      memcpy(header->parentmd5, &rawheader[60], CHD_MD5_BYTES);
17561776      header->logicalbytes = (UINT64)header->obsolete_cylinders * (UINT64)header->obsolete_heads * (UINT64)header->obsolete_sectors * (UINT64)seclen;
17571777      header->hunkbytes = seclen * header->obsolete_hunksize;
17581778      header->metaoffset = 0;
17591779   }
17601780
17611781   /* extract the V3-specific data */
1762   else
1782   else if (header->version == 3)
17631783   {
17641784      header->totalhunks   = get_bigendian_uint32(&rawheader[24]);
17651785      header->logicalbytes = get_bigendian_uint64(&rawheader[28]);
17661786      header->metaoffset   = get_bigendian_uint64(&rawheader[36]);
1787      memcpy(header->md5, &rawheader[44], CHD_MD5_BYTES);
1788      memcpy(header->parentmd5, &rawheader[60], CHD_MD5_BYTES);
17671789      header->hunkbytes    = get_bigendian_uint32(&rawheader[76]);
17681790      memcpy(header->sha1, &rawheader[80], CHD_SHA1_BYTES);
17691791      memcpy(header->parentsha1, &rawheader[100], CHD_SHA1_BYTES);
17701792   }
17711793
1794   /* extract the V4-specific data */
1795   else
1796   {
1797      header->totalhunks   = get_bigendian_uint32(&rawheader[24]);
1798      header->logicalbytes = get_bigendian_uint64(&rawheader[28]);
1799      header->metaoffset   = get_bigendian_uint64(&rawheader[36]);
1800      header->hunkbytes    = get_bigendian_uint32(&rawheader[44]);
1801      memcpy(header->sha1, &rawheader[48], CHD_SHA1_BYTES);
1802      memcpy(header->parentsha1, &rawheader[68], CHD_SHA1_BYTES);
1803      memcpy(header->rawsha1, &rawheader[88], CHD_SHA1_BYTES);
1804   }
1805
17721806   /* guess it worked */
17731807   return CHDERR_NONE;
17741808}
r4425r4426
17851819   UINT32 count;
17861820
17871821   /* punt if NULL */
1788   if (!header)
1822   if (header == NULL)
17891823      return CHDERR_INVALID_PARAMETER;
17901824
17911825   /* punt if invalid file */
1792   if (!file)
1826   if (file == NULL)
17931827      return CHDERR_INVALID_FILE;
17941828
17951829   /* only support writing modern headers */
1796   if (header->version != 3)
1830   if (header->version != 4)
17971831      return CHDERR_INVALID_PARAMETER;
17981832
17991833   /* assemble the data */
18001834   memset(rawheader, 0, sizeof(rawheader));
18011835   memcpy(rawheader, "MComprHD", 8);
18021836
1803   put_bigendian_uint32(&rawheader[8],  CHD_V3_HEADER_SIZE);
1837   put_bigendian_uint32(&rawheader[8],  CHD_V4_HEADER_SIZE);
18041838   put_bigendian_uint32(&rawheader[12], header->version);
18051839   put_bigendian_uint32(&rawheader[16], header->flags);
18061840   put_bigendian_uint32(&rawheader[20], header->compression);
18071841   put_bigendian_uint32(&rawheader[24], header->totalhunks);
18081842   put_bigendian_uint64(&rawheader[28], header->logicalbytes);
18091843   put_bigendian_uint64(&rawheader[36], header->metaoffset);
1810   memcpy(&rawheader[44], header->md5, CHD_MD5_BYTES);
1811   memcpy(&rawheader[60], header->parentmd5, CHD_MD5_BYTES);
1812   put_bigendian_uint32(&rawheader[76], header->hunkbytes);
1813   memcpy(&rawheader[80], header->sha1, CHD_SHA1_BYTES);
1814   memcpy(&rawheader[100], header->parentsha1, CHD_SHA1_BYTES);
1844   put_bigendian_uint32(&rawheader[44], header->hunkbytes);
1845   memcpy(&rawheader[48], header->sha1, CHD_SHA1_BYTES);
1846   memcpy(&rawheader[68], header->parentsha1, CHD_SHA1_BYTES);
1847   memcpy(&rawheader[88], header->rawsha1, CHD_SHA1_BYTES);
18151848
18161849   /* seek and write */
18171850   core_fseek(file, 0, SEEK_SET);
1818   count = core_fwrite(file, rawheader, CHD_V3_HEADER_SIZE);
1819   if (count != CHD_V3_HEADER_SIZE)
1851   count = core_fwrite(file, rawheader, CHD_V4_HEADER_SIZE);
1852   if (count != CHD_V4_HEADER_SIZE)
18201853      return CHDERR_WRITE_ERROR;
18211854
18221855   return CHDERR_NONE;
r4425r4426
23732406      metaentry->length = get_bigendian_uint32(&raw_meta_header[4]);
23742407      metaentry->next = get_bigendian_uint64(&raw_meta_header[8]);
23752408
2376      /* checksum is encoded as the high bit of length */
2409      /* flags are encoded in the high byte of length */
23772410      metaentry->flags = metaentry->length >> 24;
23782411      metaentry->length &= 0x00ffffff;
23792412
r4425r4426
24672500}
24682501
24692502
2503/*-------------------------------------------------
2504    metadata_compute_hash - compute the SHA1
2505    hash of all metadata that requests it
2506-------------------------------------------------*/
24702507
2508static chd_error metadata_compute_hash(chd_file *chd, const UINT8 *rawsha1, UINT8 *finalsha1)
2509{
2510   metadata_hash *hasharray = NULL;
2511   chd_error err = CHDERR_NONE;
2512   struct sha1_ctx sha1;
2513   UINT32 hashindex = 0;
2514   UINT32 hashalloc = 0;
2515   UINT64 offset, next;
2516
2517   /* only works for V4 and above */
2518   if (chd->header.version < 4)
2519   {
2520      memcpy(finalsha1, rawsha1, SHA1_DIGEST_SIZE);
2521      return CHDERR_NONE;
2522   }
2523
2524   /* loop until we run out of data */
2525   for (offset = chd->header.metaoffset; offset != 0; offset = next)
2526   {
2527      UINT8 raw_meta_header[METADATA_HEADER_SIZE];
2528      UINT32 count, metalength, metatag;
2529      UINT8 *tempbuffer;
2530      UINT8 metaflags;
2531
2532      /* read the raw header */
2533      core_fseek(chd->file, offset, SEEK_SET);
2534      count = core_fread(chd->file, raw_meta_header, sizeof(raw_meta_header));
2535      if (count != sizeof(raw_meta_header))
2536         break;
2537
2538      /* extract the data */
2539      metatag = get_bigendian_uint32(&raw_meta_header[0]);
2540      metalength = get_bigendian_uint32(&raw_meta_header[4]);
2541      next = get_bigendian_uint64(&raw_meta_header[8]);
2542
2543      /* flags are encoded in the high byte of length */
2544      metaflags = metalength >> 24;
2545      metalength &= 0x00ffffff;
2546
2547      /* if not checksumming, continue */
2548      if (!(metaflags & CHD_MDFLAGS_CHECKSUM))
2549         continue;
2550
2551      /* allocate memory */
2552      tempbuffer = (UINT8 *)malloc(metalength);
2553      if (tempbuffer == NULL)
2554      {
2555         err = CHDERR_OUT_OF_MEMORY;
2556         goto cleanup;
2557      }
2558
2559      /* seek and read the metadata */
2560      core_fseek(chd->file, offset + METADATA_HEADER_SIZE, SEEK_SET);
2561      count = core_fread(chd->file, tempbuffer, metalength);
2562      if (count != metalength)
2563      {
2564         free(tempbuffer);
2565         err = CHDERR_READ_ERROR;
2566         goto cleanup;
2567      }
2568
2569      /* compute this entry's hash */
2570      sha1_init(&sha1);
2571      sha1_update(&sha1, metalength, tempbuffer);
2572      sha1_final(&sha1);
2573      free(tempbuffer);
2574
2575      /* expand the hasharray if necessary */
2576      if (hashindex >= hashalloc)
2577      {
2578         hashalloc += 256;
2579         hasharray = (metadata_hash *)realloc(hasharray, hashalloc * sizeof(hasharray[0]));
2580         if (hasharray == NULL)
2581         {
2582            err = CHDERR_OUT_OF_MEMORY;
2583            goto cleanup;
2584         }
2585      }
2586
2587      /* fill in the entry */
2588      put_bigendian_uint32(hasharray[hashindex].tag, metatag);
2589      sha1_digest(&sha1, SHA1_DIGEST_SIZE, hasharray[hashindex].sha1);
2590      hashindex++;
2591   }
2592
2593   /* sort the array */
2594   qsort(hasharray, hashindex, sizeof(hasharray[0]), metadata_hash_compare);
2595
2596   /* compute the SHA1 of the raw plus the various metadata */
2597   sha1_init(&sha1);
2598   sha1_update(&sha1, CHD_SHA1_BYTES, rawsha1);
2599   sha1_update(&sha1, hashindex * sizeof(hasharray[0]), (const UINT8 *)hasharray);
2600   sha1_final(&sha1);
2601   sha1_digest(&sha1, SHA1_DIGEST_SIZE, finalsha1);
2602
2603cleanup:
2604   if (hasharray != NULL)
2605      free(hasharray);
2606   return err;
2607}
2608
2609
2610/*-------------------------------------------------
2611    metadata_hash_compare - compare two hash
2612    entries
2613-------------------------------------------------*/
2614
2615static int CLIB_DECL metadata_hash_compare(const void *elem1, const void *elem2)
2616{
2617   return memcmp(elem1, elem2, sizeof(metadata_hash));
2618}
2619
2620
2621
24712622/***************************************************************************
24722623    ZLIB COMPRESSION CODEC
24732624***************************************************************************/
src/lib/util/chd.h
r4425r4426
9090    [ 48] UINT8  sha1[20];      // combined raw+meta SHA1
9191    [ 68] UINT8  parentsha1[20];// combined raw+meta SHA1 of parent
9292    [ 88] UINT8  rawsha1[20];   // raw data SHA1
93    [108] UINT8  metasha1[20];  // metadata SHA1
94    [128] (V4 header length)
93    [108] (V4 header length)
9594
9695    Flags:
9796        0x00000001 - set if this drive has a parent
r4425r4426
105104***************************************************************************/
106105
107106/* header information */
108#define CHD_HEADER_VERSION         3
107#define CHD_HEADER_VERSION         4
109108#define CHD_V1_HEADER_SIZE         76
110109#define CHD_V2_HEADER_SIZE         80
111110#define CHD_V3_HEADER_SIZE         120
112#define CHD_MAX_HEADER_SIZE         CHD_V3_HEADER_SIZE
111#define CHD_V4_HEADER_SIZE         108
112#define CHD_MAX_HEADER_SIZE         CHD_V4_HEADER_SIZE
113113
114114/* checksumming information */
115115#define CHD_MD5_BYTES            16
r4425r4426
141141#define HARD_DISK_METADATA_TAG      0x47444444   /* 'GDDD' */
142142#define HARD_DISK_METADATA_FORMAT   "CYLS:%d,HEADS:%d,SECS:%d,BPS:%d"
143143
144/* hard disk identify information */
145#define HARD_DISK_IDENT_METADATA_TAG 0x49444e54 /* 'IDNT' */
146
147/* hard disk key information */
148#define HARD_DISK_KEY_METADATA_TAG   0x4b455920  /* 'KEY '  */
149
150/* pcmcia CIS information */
151#define PCMCIA_CIS_METADATA_TAG      0x43495320  /* 'CIS '  */
152
144153/* standard CD-ROM metadata */
145154#define CDROM_OLD_METADATA_TAG      0x43484344   /* 'CHCD' */
146155#define CDROM_TRACK_METADATA_TAG   0x43485452   /* 'CHTR' */
r4425r4426
213222   UINT32      totalhunks;               /* total # of hunks represented */
214223   UINT64      logicalbytes;            /* logical size of the data */
215224   UINT64      metaoffset;               /* offset in file of first metadata */
216   UINT8      md5[CHD_MD5_BYTES];         /* MD5 checksum of raw data */
217   UINT8      parentmd5[CHD_MD5_BYTES];   /* MD5 checksum of parent file */
218   UINT8      sha1[CHD_SHA1_BYTES];      /* SHA1 checksum of raw data */
219   UINT8      parentsha1[CHD_SHA1_BYTES];   /* SHA1 checksum of parent file */
225   UINT8      md5[CHD_MD5_BYTES];         /* overall MD5 checksum */
226   UINT8      parentmd5[CHD_MD5_BYTES];   /* overall MD5 checksum of parent */
227   UINT8      sha1[CHD_SHA1_BYTES];      /* overall SHA1 checksum */
228   UINT8      rawsha1[CHD_SHA1_BYTES];   /* SHA1 checksum of raw data */
229   UINT8      parentsha1[CHD_SHA1_BYTES];   /* overall SHA1 checksum of parent */
220230
221231   UINT32      obsolete_cylinders;         /* obsolete field -- do not use! */
222232   UINT32      obsolete_sectors;         /* obsolete field -- do not use! */
r4425r4426
225235};
226236
227237
238/* structure for returning information about a verification pass */
239typedef struct _chd_verify_result chd_verify_result;
240struct _chd_verify_result
241{
242   UINT8      md5[CHD_MD5_BYTES];         /* overall MD5 checksum */
243   UINT8      sha1[CHD_SHA1_BYTES];      /* overall SHA1 checksum */
244   UINT8      rawsha1[CHD_SHA1_BYTES];   /* SHA1 checksum of raw data */
245   UINT8      metasha1[CHD_SHA1_BYTES];   /* SHA1 checksum of metadata */
246};
228247
248
249
229250/***************************************************************************
230251    FUNCTION PROTOTYPES
231252***************************************************************************/
r4425r4426
323344chd_error chd_verify_hunk(chd_file *chd);
324345
325346/* finish verifying a CHD, returning the computed MD5 and SHA1 */
326chd_error chd_verify_finish(chd_file *chd, UINT8 *finalmd5, UINT8 *finalsha1);
347chd_error chd_verify_finish(chd_file *chd, chd_verify_result *result);
327348
328349
329350
src/lib/util/cdrom.c
r4425r4426
5656***************************************************************************/
5757
5858static chd_error read_sector_into_cache(cdrom_file *file, UINT32 lbasector, UINT32 *sectoroffs, UINT32 *tracknum);
59static chd_error parse_metadata(chd_file *chd, cdrom_toc *toc);
6059
6160
6261
r4425r4426
125124   file->cachehunk = -1;
126125
127126   /* read the CD-ROM metadata */
128   err = parse_metadata(chd, &file->cdtoc);
127   err = cdrom_parse_metadata(chd, &file->cdtoc);
129128   if (err != CHDERR_NONE)
130129   {
131130      free(file);
r4425r4426
528527
529528
530529/*-------------------------------------------------
531    parse_metadata - parse metadata into the TOC
532    structure
530    cdrom_parse_metadata - parse metadata into the
531    TOC structure
533532-------------------------------------------------*/
534533
535static chd_error parse_metadata(chd_file *chd, cdrom_toc *toc)
534chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc)
536535{
537536   static UINT32 oldmetadata[CD_METADATA_WORDS], *mrp;
538537   const chd_header *header = chd_get_header(chd);
r4425r4426
544543   /* start with no tracks */
545544   for (toc->numtrks = 0; toc->numtrks < CD_MAX_TRACKS; toc->numtrks++)
546545   {
547      cdrom_track_info *track = &toc->tracks[toc->numtrks];
548546      int tracknum = -1, frames = 0, hunks;
549547      char type[11], subtype[11];
548      cdrom_track_info *track;
550549
551550      /* fetch the metadata for this track */
552551      err = chd_get_metadata(chd, CDROM_TRACK_METADATA_TAG, toc->numtrks, metadata, sizeof(metadata), NULL, NULL, NULL);
r4425r4426
557556      type[0] = subtype[0] = 0;
558557      if (sscanf(metadata, CDROM_TRACK_METADATA_FORMAT, &tracknum, type, subtype, &frames) != 4)
559558         return CHDERR_INVALID_DATA;
560      if (tracknum != toc->numtrks + 1)
559      if (tracknum == 0 || tracknum > CD_MAX_TRACKS)
561560         return CHDERR_INVALID_DATA;
561      track = &toc->tracks[tracknum - 1];
562562
563563      /* extract the track type and determine the data size */
564564      track->trktype = CD_TRACK_MODE1;
r4425r4426
618618
619619   return CHDERR_NONE;
620620}
621
622
623/*-------------------------------------------------
624    cdrom_write_metadata - write metadata
625-------------------------------------------------*/
626
627chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc)
628{
629   chd_error err;
630   int i;
631
632   /* write the metadata */
633   for (i = 0; i < toc->numtrks; i++)
634   {
635      char metadata[256];
636      sprintf(metadata, CDROM_TRACK_METADATA_FORMAT, i + 1, cdrom_get_type_string(&toc->tracks[i]),
637            cdrom_get_subtype_string(&toc->tracks[i]), toc->tracks[i].frames);
638
639      err = chd_set_metadata(chd, CDROM_TRACK_METADATA_TAG, i, metadata, strlen(metadata) + 1, CHD_MDFLAGS_CHECKSUM);
640      if (err != CHDERR_NONE)
641         return err;
642   }
643   return CHDERR_NONE;
644}
src/lib/util/cdrom.h
r4425r4426
114114void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info);
115115const char *cdrom_get_type_string(const cdrom_track_info *info);
116116const char *cdrom_get_subtype_string(const cdrom_track_info *info);
117chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc);
118chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc);
117119
118120
119121
r4425r4426
136138}
137139
138140#endif   // __CDROM_H__
139
src/lib/util/corefile.c
r4425r4426
687687}
688688
689689
690/*-------------------------------------------------
691    core_fload - open a file with the specified
692    filename, read it into memory, and return a
693    pointer
694-------------------------------------------------*/
690695
696file_error core_fload(const char *filename, void **data, UINT32 *length)
697{
698   core_file *file = NULL;
699   file_error err;
700   UINT64 size;
701
702   /* attempt to open the file */
703   err = core_fopen(filename, OPEN_FLAG_READ, &file);
704   if (err != FILERR_NONE)
705      return err;
706
707   /* get the size */
708   size = core_fsize(file);
709   if ((UINT32)size != size)
710   {
711      core_fclose(file);
712      return FILERR_OUT_OF_MEMORY;
713   }
714
715   /* allocate memory */
716   *data = malloc(size);
717   if (length != NULL)
718      *length = (UINT32)size;
719
720   /* read the data */
721   if (core_fread(file, *data, size) != size)
722   {
723      core_fclose(file);
724      free(*data);
725      return FILERR_FAILURE;
726   }
727   return FILERR_NONE;
728}
729
730
731
691732/***************************************************************************
692733    FILE WRITE
693734***************************************************************************/
src/lib/util/corefile.h
r4425r4426
9999/* this function may cause the full file data to be read */
100100const void *core_fbuffer(core_file *file);
101101
102/* open a file with the specified filename, read it into memory, and return a pointer */
103file_error core_fload(const char *filename, void **data, UINT32 *length);
102104
103105
106
104107/* ----- file write ----- */
105108
106109/* standard binary write to a file */
src/mess/machine/68901mfp.h
r4425r4426
108108WRITE8_DEVICE_HANDLER( mc68901_register_w );
109109
110110/* get interrupt vector */
111int mc68901_get_vector(const device_config *device) ATTR_NONNULL;
111int mc68901_get_vector(const device_config *device) ATTR_NONNULL(1);
112112
113113/* write to Timer A input (pin 19) */
114void mc68901_tai_w(const device_config *device, int state) ATTR_NONNULL;
114void mc68901_tai_w(const device_config *device, int state) ATTR_NONNULL(1);
115115
116116/* write to Timer B input (pin 20) */
117void mc68901_tbi_w(const device_config *device, int state) ATTR_NONNULL;
117void mc68901_tbi_w(const device_config *device, int state) ATTR_NONNULL(1);
118118
119119/* receive clock */
120void mc68901_rx_clock_w(const device_config *device, int state) ATTR_NONNULL;
120void mc68901_rx_clock_w(const device_config *device, int state) ATTR_NONNULL(1);
121121
122122/* transmit clock */
123void mc68901_tx_clock_w(const device_config *device, int state) ATTR_NONNULL;
123void mc68901_tx_clock_w(const device_config *device, int state) ATTR_NONNULL(1);
124124
125125#endif
src/mess/machine/bebox.c
r4425r4426
500500   return devtag_get_device(machine, "ide_controller");
501501}
502502
503static READ8_HANDLER( bebox_800001F0_8_r ) { return ide_controller_r(ide_device(space->machine), offset + 0x1F0); }
504static WRITE8_HANDLER( bebox_800001F0_8_w ) { ide_controller_w(ide_device(space->machine), offset + 0x1F0, data); }
503static READ8_HANDLER( bebox_800001F0_8_r ) { return ide_controller_r(ide_device(space->machine), offset + 0x1F0, 1); }
504static WRITE8_HANDLER( bebox_800001F0_8_w ) { ide_controller_w(ide_device(space->machine), offset + 0x1F0, 1, data); }
505505
506506READ64_HANDLER( bebox_800001F0_r ) { return read64be_with_read8_handler(bebox_800001F0_8_r, space, offset, mem_mask); }
507507WRITE64_HANDLER( bebox_800001F0_w ) { write64be_with_write8_handler(bebox_800001F0_8_w, space, offset, data, mem_mask); }
r4425r4426
514514   if (((mem_mask >> 8) & 0xFF) == 0)
515515   {
516516      result &= ~(0xFF << 8);
517      result |= ide_controller_r(ide_device(space->machine), 0x3F6) << 8;
517      result |= ide_controller_r(ide_device(space->machine), 0x3F6, 1) << 8;
518518   }
519519
520520   if (((mem_mask >> 0) & 0xFF) == 0)
521521   {
522522      result &= ~(0xFF << 0);
523      result |= ide_controller_r(ide_device(space->machine), 0x3F7) << 0;
523      result |= ide_controller_r(ide_device(space->machine), 0x3F7, 1) << 0;
524524   }
525525   return result;
526526}
r4425r4426
531531   write64be_with_write8_handler(pc_fdc_w, space, offset, data, mem_mask | 0xFFFF);
532532
533533   if (((mem_mask >> 8) & 0xFF) == 0)
534      ide_controller_w(ide_device(space->machine), 0x3F6, (data >> 8) & 0xFF);
534      ide_controller_w(ide_device(space->machine), 0x3F6, 1, (data >> 8) & 0xFF);
535535
536536   if (((mem_mask >> 0) & 0xFF) == 0)
537      ide_controller_w(ide_device(space->machine), 0x3F7, (data >> 0) & 0xFF);
537      ide_controller_w(ide_device(space->machine), 0x3F7, 1, (data >> 0) & 0xFF);
538538}
539539
540540
src/mess/mess.mak
r4425r4426
139139#CPUS += ESRIP
140140CPUS += R3000
141141#CPUS += R3041
142#CPUS += VR4300
142143CPUS += R4600
143144#CPUS += R4650
144145#CPUS += R4700
src/ldplayer/ldplayer.mak
r4425r4426
3434# specify required sound cores
3535#-------------------------------------------------
3636
37SOUNDS += CUSTOM
37SOUNDS += WAVE
3838
3939
4040#-------------------------------------------------
docs/messnew.txt
r4425r4426
2727
2828Source Changes:
2929----------------
30(none)
30- The core is based on MAME 0.130u1.  This incorporates all features of the
31  update to this core.  [MAME team]
3132
3233
3334
makefile
r4425r4426
402402LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map
403403endif
404404
405# any reason why this doesn't work for all cases?
406ifeq ($(TARGETOS),macosx)
407LDFLAGSEMULATOR += -Xlinker -all_load
408endif
409405
410406
411
412407#-------------------------------------------------
413408# define the standard object directory; other
414409# projects can add their object directories to

Previous 15994 Revisions Next


© 1998-2018 The MESS Team