Previous 15994 Revisions Next

r14224 Friday 27th January, 2012 at 07:43:30 UTC by Miodrag Milanović
Sync with MAME r15181 (no whatsnew)
[src/emu]device.c device.h emualloc.c emualloc.h emutempl.h machine.c machine.h render.h romload.c ui.c video.c video.h
[src/emu/machine]generic.c
[src/mame/drivers]asuka.c bbusters.c champbwl.c crystal.c ddenlovr.c dec8.c dreamwld.c dynduke.c funkball.c galpanic.c gottlieb.c hvyunit.c lemmings.c n8080.c psikyo.c raiden.c sandscrp.c seta.c slapfght.c snowbros.c twin16.c wwfwfest.c
[src/mame/includes]gottlieb.h lemmings.h
[src/mame/video]airbustr.c armedf.c baraduke.c bionicc.c blktiger.c commando.c cps1.c crshrace.c deco_mlc.c decospr.c djboy.c dooyong.c exedexes.c gng.c gottlieb.c lastduel.c lemmings.c macrossp.c mcatadv.c namcos1.c namcos86.c othldrby.c pgm.c psikyo.c psikyosh.c seta.c sidearms.c simpl156.c srumbler.c taito_b.c taito_f2.c taito_f3.c taito_l.c taotaido.c tceptor.c tigeroad.c tnzs.c toaplan1.c toki.c twincobr.c tx1.c

src/mame/includes/lemmings.h
r14223r14224
3434
3535VIDEO_START( lemmings );
3636SCREEN_VBLANK( lemmings );
37SCREEN_UPDATE_IND16( lemmings );
37SCREEN_UPDATE_RGB32( lemmings );
38
src/mame/includes/gottlieb.h
r14223r14224
8686
8787VIDEO_START( gottlieb );
8888VIDEO_START( screwloo );
89SCREEN_UPDATE_IND16( gottlieb );
89SCREEN_UPDATE_RGB32( gottlieb );
src/mame/video/blktiger.c
r14223r14224
253253
254254SCREEN_VBLANK( blktiger )
255255{
256   // falling edge
257   if (!vblank_on)
256   // rising edge
257   if (vblank_on)
258258   {
259259      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
260260
src/mame/video/deco_mlc.c
r14223r14224
496496
497497SCREEN_VBLANK( mlc )
498498{
499   // falling edge
500   if (!vblank_on)
499   // rising edge
500   if (vblank_on)
501501   {
502502      deco_mlc_state *state = screen.machine().driver_data<deco_mlc_state>();
503503      /* Spriteram is definitely double buffered, as the vram lookup tables
src/mame/video/simpl156.c
r14223r14224
1717   state->m_pf2_rowscroll = auto_alloc_array_clear(machine, UINT16, 0x800/2);
1818   state->m_spriteram = auto_alloc_array_clear(machine, UINT16, 0x2000/2);
1919   machine.generic.paletteram.u16 =  auto_alloc_array_clear(machine, UINT16, 0x1000/2);
20   
21   memset(state->m_spriteram, 0xff, 0x2000);
2022
2123   /* and register the allocated ram so that save states still work */
2224   state->save_pointer(NAME(state->m_pf1_rowscroll), 0x800/2);
r14223r14224
4143   //FIXME: flip_screen_x should not be written!
4244   flip_screen_set_no_update(screen.machine(), 1);
4345
44   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram, 0x800); // 0x800 needed to charlien title
46   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more)
4547   return 0;
4648}
src/mame/video/twincobr.c
r14223r14224
518518
519519SCREEN_VBLANK( toaplan0 )
520520{
521   // falling edge
522   if (!vblank_on)
521   // rising edge
522   if (vblank_on)
523523   {
524524      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
525525
src/mame/video/exedexes.c
r14223r14224
247247
248248SCREEN_VBLANK( exedexes )
249249{
250   // falling edge
251   if (!vblank_on)
250   // rising edge
251   if (vblank_on)
252252   {
253253      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
254254
src/mame/video/armedf.c
r14223r14224
433433
434434SCREEN_VBLANK( armedf )
435435{
436   // falling edge
437   if (!vblank_on)
436   // rising edge
437   if (vblank_on)
438438   {
439439      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
440440
src/mame/video/taito_b.c
r14223r14224
505505
506506SCREEN_VBLANK( taitob )
507507{
508   // falling edge
509   if (!vblank_on)
508   // rising edge
509   if (vblank_on)
510510   {
511511      taitob_state *state = screen.machine().driver_data<taitob_state>();
512512      UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0);
src/mame/video/namcos86.c
r14223r14224
398398
399399SCREEN_VBLANK( namcos86 )
400400{
401   // falling edge
402   if (!vblank_on)
401   // rising edge
402   if (vblank_on)
403403   {
404404      namcos86_state *state = screen.machine().driver_data<namcos86_state>();
405405      if (state->m_copy_sprites)
src/mame/video/cps1.c
r14223r14224
29512951
29522952SCREEN_VBLANK( cps1 )
29532953{
2954   // falling edge
2955   if (!vblank_on)
2954   // rising edge
2955   if (vblank_on)
29562956   {
29572957      cps_state *state = screen.machine().driver_data<cps_state>();
29582958
src/mame/video/othldrby.c
r14223r14224
226226
227227SCREEN_VBLANK( othldrby )
228228{
229   // falling edge
230   if (!vblank_on)
229   // rising edge
230   if (vblank_on)
231231   {
232232      othldrby_state *state = screen.machine().driver_data<othldrby_state>();
233233
src/mame/video/decospr.c
r14223r14224
2222   cbuster.c (could probably use pdrawgfx, not m_sprite_bitmap)
2323   mirage.c (could probably use pdrawgfx, not m_sprite_bitmap)
2424   cninja.c
25   lemmings.c
26   deco32.c
2527
2628   partially converted:
27   deco32.c - video mixing
28
29 
2930   difficult to convert:
3031   rohga.c - complex video mixing, 6bpp gfx..
31   lemmings.c - priority stuff (plus sprites seem somewhat different anyway??)
3232   dassault.c - complex video mixing
3333   boogwing.c - complex video mixing
3434
src/mame/video/lemmings.c
r14223r14224
1414
1515#include "emu.h"
1616#include "includes/lemmings.h"
17#include "video/decospr.h"
1718
18static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *spritedata, int gfxbank, UINT16 pri )
19{
20   int offs;
21
22   for (offs = 0; offs < 0x400; offs += 4)
23   {
24      int x, y, sprite, colour, multi, fx, fy, inc, flash, mult;
25
26      sprite = spritedata[offs + 1] & 0x3fff;
27
28      if ((spritedata[offs + 2] & 0x2000) != pri)
29         continue;
30
31      y = spritedata[offs];
32      flash = y & 0x1000;
33      if (flash && (machine.primary_screen->frame_number() & 1))
34         continue;
35
36      x = spritedata[offs + 2];
37      colour = (x >>9) & 0xf;
38
39      fx = y & 0x2000;
40      fy = y & 0x4000;
41      multi = (1 << ((y & 0x0600) >> 9)) - 1;   /* 1x, 2x, 4x, 8x height */
42
43      x = x & 0x01ff;
44      y = y & 0x01ff;
45      if (x >= 320) x -= 512;
46      if (y >= 256) y -= 512;
47
48      if (x > 320 || x < -16) continue;
49
50      sprite &= ~multi;
51      if (fy)
52         inc = 1;
53      else
54      {
55         sprite += multi;
56         inc = -1;
57      }
58      mult = -16;
59
60      while (multi >= 0)
61      {
62         drawgfx_transpen(bitmap,cliprect,machine.gfx[gfxbank],
63               sprite - multi * inc,
64               colour,
65               fx,fy,
66               x,y + mult * multi,0);
67
68         multi--;
69      }
70   }
71}
72
7319/******************************************************************************/
7420
7521static TILE_GET_INFO( get_tile_info )
r14223r14224
9945
10046   gfx_element_set_source(machine.gfx[2], state->m_vram_buffer);
10147
48   machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap();
49   machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap();
50
10251   state->save_item(NAME(*state->m_bitmap0));
10352   state->save_pointer(NAME(state->m_vram_buffer), 2048 * 64);
10453   state->save_pointer(NAME(state->m_sprite_triple_buffer_0), 0x800 / 2);
r14223r14224
11968
12069/******************************************************************************/
12170
71// RAM based
12272WRITE16_HANDLER( lemmings_pixel_0_w )
12373{
74
12475   lemmings_state *state = space->machine().driver_data<lemmings_state>();
12576   int sx, sy, src, old;
12677
r14223r14224
14091   state->m_bitmap0->pix16(sy, sx + 1) = ((src >> 0) & 0xf) | 0x100;
14192}
14293
94// RAM based tiles for the FG tilemap
14395WRITE16_HANDLER( lemmings_pixel_1_w )
14496{
14597   lemmings_state *state = space->machine().driver_data<lemmings_state>();
146   int sx, sy, src, /*old,*/ tile;
98   int sx, sy, src, tile;
14799
148//  old = state->m_pixel_1_data[offset];
149100   COMBINE_DATA(&state->m_pixel_1_data[offset]);
150101   src = state->m_pixel_1_data[offset];
151//  if (old == src)
152//      return;
153102
154103   sy = ((offset << 1) / 0x200);
155104   sx = ((offset << 1) & 0x1ff);
r14223r14224
170119   state->m_vram_tilemap->mark_tile_dirty(offset);
171120}
172121
173SCREEN_UPDATE_IND16( lemmings )
122
123void lemmings_copy_bitmap(running_machine &machine, bitmap_rgb32& bitmap, bitmap_ind16& srcbitmap, int* xscroll, int* yscroll, const rectangle& cliprect)
174124{
125   int y,x;
126   const pen_t *paldata = machine.pens;
127
128   for (y=cliprect.min_y; y<cliprect.max_y;y++)
129   {
130      UINT32* dst = &bitmap.pix32(y,0);
131
132      for (x=cliprect.min_x; x<cliprect.max_x;x++)
133      {
134         UINT16 src = srcbitmap.pix16((y-*yscroll)&0xff,(x-*xscroll)&0x7ff);
135
136         if (src!=0x100)
137            dst[x] = paldata[src];
138      }
139   }
140}
141
142SCREEN_UPDATE_RGB32( lemmings )
143{
175144   lemmings_state *state = screen.machine().driver_data<lemmings_state>();
176145   int x1 = -state->m_control_data[0];
177146   int x0 = -state->m_control_data[2];
r14223r14224
180149   rect.max_y = cliprect.max_y;
181150   rect.min_y = cliprect.min_y;
182151
152   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_sprite_triple_buffer_1, 0x400, true);
153   screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_sprite_triple_buffer_0, 0x400, true);
154
183155   bitmap.fill(get_black_pen(screen.machine()), cliprect);
184   draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x0000);
156   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x300, 0xff);
185157
186158   /* Pixel layer can be windowed in hardware (two player mode) */
187159   if ((state->m_control_data[6] & 2) == 0)
188      copyscrollbitmap_trans(bitmap, *state->m_bitmap0, 1, &x1, 1, &y, cliprect, 0x100);
160   {
161      lemmings_copy_bitmap(screen.machine(), bitmap, *state->m_bitmap0, &x1, &y, cliprect);
162   }
189163   else
190164   {
191165      rect.max_x = 159;
192166      rect.min_x = 0;
193      copyscrollbitmap_trans(bitmap, *state->m_bitmap0, 1, &x0, 1, &y, rect, 0x100);
167      lemmings_copy_bitmap(screen.machine(), bitmap, *state->m_bitmap0, &x0, &y, rect);
168
194169      rect.max_x = 319;
195170      rect.min_x = 160;
196      copyscrollbitmap_trans(bitmap, *state->m_bitmap0, 1, &x1, 1, &y, rect, 0x100);
171      lemmings_copy_bitmap(screen.machine(), bitmap, *state->m_bitmap0, &x1, &y, rect);
197172   }
198   draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x0000);
199   draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x2000);
173
174   screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x200, 0xff);
175   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x300, 0xff);
200176   state->m_vram_tilemap->draw(bitmap, cliprect, 0, 0);
201   draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x2000);
177   screen.machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 0x200, 0xff);
202178   return 0;
203179}
src/mame/video/toaplan1.c
r14223r14224
12191219
12201220SCREEN_VBLANK( rallybik )
12211221{
1222   // falling edge
1223   if (!vblank_on)
1222   // rising edge
1223   if (vblank_on)
12241224   {
12251225      toaplan1_state *state = screen.machine().driver_data<toaplan1_state>();
12261226
r14223r14224
12301230
12311231SCREEN_VBLANK( toaplan1 )
12321232{
1233   // falling edge
1234   if (!vblank_on)
1233   // rising edge
1234   if (vblank_on)
12351235   {
12361236      toaplan1_state *state = screen.machine().driver_data<toaplan1_state>();
12371237
r14223r14224
12421242
12431243SCREEN_VBLANK( samesame )
12441244{
1245   // falling edge
1246   if (!vblank_on)
1245   // rising edge
1246   if (vblank_on)
12471247   {
12481248      toaplan1_state *state = screen.machine().driver_data<toaplan1_state>();
12491249
src/mame/video/bionicc.c
r14223r14224
262262
263263SCREEN_VBLANK( bionicc )
264264{
265   // falling edge
266   if (!vblank_on)
265   // rising edge
266   if (vblank_on)
267267   {
268268      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
269269
src/mame/video/psikyo.c
r14223r14224
389389   /* tile layers 0 & 1 have priorities 1 & 2 */
390390   static const int pri[] = { 0, 0xfc, 0xff, 0xff };
391391   int offs;
392
393   UINT16 *spritelist = (UINT16 *)(state->m_spriteram + 0x1800 / 4);
394
392   UINT16 *spritelist = (UINT16 *)(state->m_spritebuf2 + 0x1800 / 4);
395393   UINT8 *TILES = machine.region("spritelut")->base();   // Sprites LUT
396394   int TILES_LEN = machine.region("spritelut")->bytes();
397395
r14223r14224
425423      sprite = spritelist[BYTE_XOR_BE(offs)];
426424
427425      sprite %= 0x300;
428//      source = &state->m_bootleg_spritebuffer[sprite * 8 / 4];
429      source = &state->m_spriteram[sprite * 8 / 4];
426      source = &state->m_spritebuf2[sprite * 8 / 4];
430427
431428      /* Draw this sprite */
432429
r14223r14224
708705   UINT32 layer1_scrollx, layer1_scrolly;
709706   UINT32 layer0_ctrl = state->m_vregs[0x412 / 4];
710707   UINT32 layer1_ctrl = state->m_vregs[0x416 / 4];
711   UINT32 spr_ctrl = state->m_spriteram[0x1ffe / 4];
708   UINT32 spr_ctrl = state->m_spritebuf2[0x1ffe / 4];
712709
713710   tilemap_t *tmptilemap0, *tmptilemap1;
714711
r14223r14224
866863
867864SCREEN_VBLANK( psikyo )
868865{
869   // falling edge
870   if (!vblank_on)
866   // rising edge
867   if (vblank_on)
871868   {
872869      psikyo_state *state = screen.machine().driver_data<psikyo_state>();
873870      memcpy(state->m_spritebuf2, state->m_spritebuf1, 0x2000);
src/mame/video/pgm.c
r14223r14224
675675
676676SCREEN_VBLANK( pgm )
677677{
678   // falling edge
679   if (!vblank_on)
678   // rising edge
679   if (vblank_on)
680680   {
681681      pgm_state *state = screen.machine().driver_data<pgm_state>();
682682
src/mame/video/mcatadv.c
r14223r14224
271271
272272SCREEN_VBLANK( mcatadv )
273273{
274   // falling edge
275   if (!vblank_on)
274   // rising edge
275   if (vblank_on)
276276   {
277277      mcatadv_state *state = screen.machine().driver_data<mcatadv_state>();
278278      memcpy(state->m_spriteram_old, state->m_spriteram, state->m_spriteram_size);
src/mame/video/lastduel.c
r14223r14224
308308
309309SCREEN_VBLANK( lastduel )
310310{
311   // falling edge
312   if (!vblank_on)
311   // rising edge
312   if (vblank_on)
313313   {
314314      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
315315
src/mame/video/tceptor.c
r14223r14224
569569
570570SCREEN_VBLANK( tceptor )
571571{
572   // falling edge
573   if (!vblank_on)
572   // rising edge
573   if (vblank_on)
574574   {
575575      tceptor_state *state = screen.machine().driver_data<tceptor_state>();
576576      memcpy(state->m_sprite_ram_buffered, state->m_sprite_ram, 0x200);
src/mame/video/commando.c
r14223r14224
147147
148148SCREEN_VBLANK( commando )
149149{
150   // falling edge
151   if (!vblank_on)
150   // rising edge
151   if (vblank_on)
152152   {
153153      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
154154
src/mame/video/gng.c
r14223r14224
152152
153153SCREEN_VBLANK( gng )
154154{
155   // falling edge
156   if (!vblank_on)
155   // rising edge
156   if (vblank_on)
157157   {
158158      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
159159
src/mame/video/seta.c
r14223r14224
10671067
10681068SCREEN_VBLANK( setaroul )
10691069{
1070   // falling edge
1071   if (!vblank_on)
1070   // rising edge
1071   if (vblank_on)
10721072      screen.machine().device<seta001_device>("spritegen")->tnzs_eof();
10731073}
10741074
src/mame/video/tnzs.c
r14223r14224
5555
5656SCREEN_VBLANK( tnzs )
5757{
58   // falling edge
59   if (!vblank_on)
58   // rising edge
59   if (vblank_on)
6060      screen.machine().device<seta001_device>("spritegen")->tnzs_eof();
6161}
src/mame/video/namcos1.c
r14223r14224
442442
443443SCREEN_VBLANK( namcos1 )
444444{
445   // falling edge
446   if (!vblank_on)
445   // rising edge
446   if (vblank_on)
447447   {
448448      namcos1_state *state = screen.machine().driver_data<namcos1_state>();
449449      if (state->m_copy_sprites)
src/mame/video/toki.c
r14223r14224
3535
3636SCREEN_VBLANK( toki )
3737{
38   // falling edge
39   if (!vblank_on)
38   // rising edge
39   if (vblank_on)
4040      buffer_spriteram16_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
4141}
4242
4343SCREEN_VBLANK( tokib )
4444{
45   // falling edge
46   if (!vblank_on)
45   // rising edge
46   if (vblank_on)
4747      buffer_spriteram16_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
4848}
4949
src/mame/video/sidearms.c
r14223r14224
368368
369369SCREEN_VBLANK( sidearms )
370370{
371   // falling edge
372   if (!vblank_on)
371   // rising edge
372   if (vblank_on)
373373   {
374374      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
375375
src/mame/video/djboy.c
r14223r14224
8383
8484SCREEN_VBLANK( djboy )
8585{
86   // falling edge
87   if (!vblank_on)
86   // rising edge
87   if (vblank_on)
8888   {
8989      djboy_state *state = screen.machine().driver_data<djboy_state>();
9090      pandora_eof(state->m_pandora);
src/mame/video/tx1.c
r14223r14224
11261126
11271127SCREEN_VBLANK( tx1 )
11281128{
1129   // falling edge
1130   if (!vblank_on)
1129   // rising edge
1130   if (vblank_on)
11311131   {
11321132      tx1_state *state = screen.machine().driver_data<tx1_state>();
11331133
r14223r14224
30343034
30353035SCREEN_VBLANK( buggyboy )
30363036{
3037   // falling edge
3038   if (!vblank_on)
3037   // rising edge
3038   if (vblank_on)
30393039   {
30403040      tx1_state *state = screen.machine().driver_data<tx1_state>();
30413041
src/mame/video/srumbler.c
r14223r14224
172172
173173SCREEN_VBLANK( srumbler )
174174{
175   // falling edge
176   if (!vblank_on)
175   // rising edge
176   if (vblank_on)
177177   {
178178      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
179179
src/mame/video/tigeroad.c
r14223r14224
173173
174174SCREEN_VBLANK( tigeroad )
175175{
176   // falling edge
177   if (!vblank_on)
176   // rising edge
177   if (vblank_on)
178178   {
179179      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
180180
src/mame/video/psikyosh.c
r14223r14224
13101310
13111311SCREEN_VBLANK( psikyosh )
13121312{
1313   // falling edge
1314   if (!vblank_on)
1313   // rising edge
1314   if (vblank_on)
13151315   {
13161316      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
13171317      buffer_spriteram32_w(space, 0, 0, 0xffffffff);
src/mame/video/taito_f2.c
r14223r14224
893893
894894SCREEN_VBLANK( taitof2_no_buffer )
895895{
896   // falling edge
897   if (!vblank_on)
896   // rising edge
897   if (vblank_on)
898898   {
899899      taitof2_state *state = screen.machine().driver_data<taitof2_state>();
900900
r14223r14224
906906
907907SCREEN_VBLANK( taitof2_full_buffer_delayed )
908908{
909   // falling edge
910   if (!vblank_on)
909   // rising edge
910   if (vblank_on)
911911   {
912912      taitof2_state *state = screen.machine().driver_data<taitof2_state>();
913913      UINT16 *spriteram = state->m_spriteram;
r14223r14224
925925
926926SCREEN_VBLANK( taitof2_partial_buffer_delayed )
927927{
928   // falling edge
929   if (!vblank_on)
928   // rising edge
929   if (vblank_on)
930930   {
931931      taitof2_state *state = screen.machine().driver_data<taitof2_state>();
932932      UINT16 *spriteram = state->m_spriteram;
r14223r14224
944944
945945SCREEN_VBLANK( taitof2_partial_buffer_delayed_thundfox )
946946{
947   // falling edge
948   if (!vblank_on)
947   // rising edge
948   if (vblank_on)
949949   {
950950      taitof2_state *state = screen.machine().driver_data<taitof2_state>();
951951      UINT16 *spriteram = state->m_spriteram;
r14223r14224
967967
968968SCREEN_VBLANK( taitof2_partial_buffer_delayed_qzchikyu )
969969{
970   // falling edge
971   if (!vblank_on)
970   // rising edge
971   if (vblank_on)
972972   {
973973      /* spriteram[2] and [3] are 1 frame behind...
974974           probably thundfox_eof_callback would work fine */
src/mame/video/gottlieb.c
r14223r14224
211211 *
212212 *************************************/
213213
214static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
214static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
215215{
216216   gottlieb_state *state = machine.driver_data<gottlieb_state>();
217217   UINT8 *spriteram = state->m_spriteram;
r14223r14224
249249 *
250250 *************************************/
251251
252SCREEN_UPDATE_IND16( gottlieb )
252SCREEN_UPDATE_RGB32( gottlieb )
253253{
254254   gottlieb_state *state = screen.machine().driver_data<gottlieb_state>();
255255   /* if the background has lower priority, render it first, else clear the screen */
256256   if (!state->m_background_priority)
257257      state->m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
258258   else
259      bitmap.fill(0, cliprect);
259      bitmap.fill(screen.machine().pens[0], cliprect);
260260
261261   /* draw the sprites */
262262   draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/video/macrossp.c
r14223r14224
431431
432432SCREEN_VBLANK( macrossp )
433433{
434   // falling edge
435   if (!vblank_on)
434   // rising edge
435   if (vblank_on)
436436   {
437437      macrossp_state *state = screen.machine().driver_data<macrossp_state>();
438438
src/mame/video/taito_l.c
r14223r14224
329329
330330SCREEN_VBLANK( taitol )
331331{
332   // falling edge
333   if (!vblank_on)
332   // rising edge
333   if (vblank_on)
334334   {
335335      taitol_state *state = screen.machine().driver_data<taitol_state>();
336336      UINT8 *spriteram = state->m_rambanks + 0xb000;
src/mame/video/taotaido.c
r14223r14224
226226
227227SCREEN_VBLANK( taotaido )
228228{
229   // falling edge
230   if (!vblank_on)
229   // rising edge
230   if (vblank_on)
231231   {
232232      taotaido_state *state = screen.machine().driver_data<taotaido_state>();
233233      /* sprites need to be delayed by 2 frames? */
src/mame/video/taito_f3.c
r14223r14224
517517
518518SCREEN_VBLANK( f3 )
519519{
520   // falling edge
521   if (!vblank_on)
520   // rising edge
521   if (vblank_on)
522522   {
523523      taito_f3_state *state = screen.machine().driver_data<taito_f3_state>();
524524      if (state->m_sprite_lag==2)
src/mame/video/baraduke.c
r14223r14224
342342
343343SCREEN_VBLANK( baraduke )
344344{
345   // falling edge
346   if (!vblank_on)
345   // rising edge
346   if (vblank_on)
347347   {
348348      baraduke_state *state = screen.machine().driver_data<baraduke_state>();
349349      if (state->m_copy_sprites)
src/mame/video/crshrace.c
r14223r14224
219219
220220SCREEN_VBLANK( crshrace )
221221{
222   // falling edge
223   if (!vblank_on)
222   // rising edge
223   if (vblank_on)
224224   {
225225      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
226226
src/mame/video/airbustr.c
r14223r14224
148148
149149SCREEN_VBLANK( airbustr )
150150{
151   // falling edge
152   if (!vblank_on)
151   // rising edge
152   if (vblank_on)
153153   {
154154      airbustr_state *state = screen.machine().driver_data<airbustr_state>();
155155
src/mame/video/dooyong.c
r14223r14224
933933
934934SCREEN_VBLANK( dooyong )
935935{
936   // falling edge
937   if (!vblank_on)
936   // rising edge
937   if (vblank_on)
938938   {
939939      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
940940
r14223r14224
944944
945945SCREEN_VBLANK( rshark )
946946{
947   // falling edge
948   if (!vblank_on)
947   // rising edge
948   if (vblank_on)
949949   {
950950      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
951951
src/mame/drivers/dynduke.c
r14223r14224
287287   MCFG_MACHINE_RESET(seibu_sound)
288288
289289   // video hardware
290   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
290   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
291291
292292   MCFG_SCREEN_ADD("screen", RASTER)
293293   MCFG_SCREEN_REFRESH_RATE(60)
src/mame/drivers/snowbros.c
r14223r14224
9494
9595static SCREEN_VBLANK( snowbros )
9696{
97   // falling edge
98   if (!vblank_on)
97   // rising edge
98   if (vblank_on)
9999   {
100100      device_t *pandora = screen.machine().device("pandora");
101101      pandora_eof(pandora);
src/mame/drivers/ddenlovr.c
r14223r14224
85058505   MCFG_CPU_PROGRAM_MAP(hparadis_map)
85068506   MCFG_CPU_IO_MAP(hparadis_portmap)
85078507   MCFG_CPU_VBLANK_INT("screen", hparadis_irq)
8508   MCFG_DEVICE_REMOVE("scantimer")
85098508
85108509   MCFG_MACHINE_START(hparadis)
85118510MACHINE_CONFIG_END
src/mame/drivers/seta.c
r14223r14224
15471547*/
15481548static SCREEN_VBLANK( seta_buffer_sprites )
15491549{
1550   // falling edge
1551   if (!vblank_on)
1550   // rising edge
1551   if (vblank_on)
15521552   {
15531553      //seta_state *state = machine.driver_data<seta_state>();
15541554      screen.machine().device<seta001_device>("spritegen")->setac_eof();
src/mame/drivers/champbwl.c
r14223r14224
462462
463463SCREEN_VBLANK( champbwl )
464464{
465   // falling edge
466   if (!vblank_on)
465   // rising edge
466   if (vblank_on)
467467      screen.machine().device<seta001_device>("spritegen")->tnzs_eof();
468468}
469469
r14223r14224
521521
522522static SCREEN_VBLANK( doraemon )
523523{
524   // falling edge
525   if (!vblank_on)
524   // rising edge
525   if (vblank_on)
526526      screen.machine().device<seta001_device>("spritegen")->setac_eof();
527527}
528528
src/mame/drivers/raiden.c
r14223r14224
244244
245245static SCREEN_VBLANK( raiden )
246246{
247   // falling edge
248   if (!vblank_on)
247   // rising edge
248   if (vblank_on)
249249   {
250250      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
251251      buffer_spriteram16_w(space,0,0,0xffff); /* Could be a memory location instead */
src/mame/drivers/slapfght.c
r14223r14224
770770   MCFG_MACHINE_RESET(slapfight)
771771
772772   /* video hardware */
773   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
773   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
774774
775775   MCFG_SCREEN_ADD("screen", RASTER)
776776   MCFG_SCREEN_REFRESH_RATE(60)
r14223r14224
816816   MCFG_MACHINE_RESET(slapfight)
817817
818818   /* video hardware */
819   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
819   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
820820
821821   MCFG_SCREEN_ADD("screen", RASTER)
822822   MCFG_SCREEN_REFRESH_RATE(60)
r14223r14224
864864   MCFG_MACHINE_RESET(slapfight)
865865
866866   /* video hardware */
867   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
867   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
868868
869869   MCFG_SCREEN_ADD("screen", RASTER)
870870   MCFG_SCREEN_REFRESH_RATE(60)
r14223r14224
913913   MCFG_MACHINE_RESET(slapfight)
914914
915915   /* video hardware */
916   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
916   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
917917
918918   MCFG_SCREEN_ADD("screen", RASTER)
919919   MCFG_SCREEN_REFRESH_RATE(60)
src/mame/drivers/gottlieb.c
r14223r14224
18841884   MCFG_LASERDISC_AUDIO(laserdisc_audio_delegate(FUNC(laserdisc_audio_process), device))
18851885   MCFG_LASERDISC_OVERLAY_STATIC(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb)
18861886   MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8)
1887   MCFG_SOUND_ROUTE(0, "mono", 1.0)
1888   /* right channel is processed as data */
18871889
18881890   MCFG_DEVICE_REMOVE("screen")
18891891   MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
1890
1891   MCFG_SOUND_MODIFY("laserdisc")
1892   MCFG_SOUND_ROUTE(0, "mono", 1.0)
1893   /* right channel is processed as data */
18941892MACHINE_CONFIG_END
18951893
18961894
r14223r14224
19361934   MCFG_LASERDISC_AUDIO(laserdisc_audio_delegate(FUNC(laserdisc_audio_process), device))
19371935   MCFG_LASERDISC_OVERLAY_STATIC(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, gottlieb)
19381936   MCFG_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8)
1937   MCFG_SOUND_ROUTE(0, "mono", 1.0)
1938   /* right channel is processed as data */
19391939
19401940   MCFG_DEVICE_REMOVE("screen")
19411941   MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc")
19421942
1943   MCFG_SOUND_MODIFY("laserdisc")
1944   MCFG_SOUND_ROUTE(0, "mono", 1.0)
1945   /* right channel is processed as data */
1946
19471943   /* sound hardware */
19481944   MCFG_SOUND_MODIFY("dac1")
19491945   MCFG_SOUND_ROUTES_RESET()
src/mame/drivers/wwfwfest.c
r14223r14224
383383
384384static SCREEN_VBLANK( wwfwfest )
385385{
386   // falling edge
387   if (!vblank_on)
386   // rising edge
387   if (vblank_on)
388388   {
389389      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
390390
src/mame/drivers/crystal.c
r14223r14224
696696
697697static SCREEN_VBLANK(crystal)
698698{
699   // falling edge
700   if (!vblank_on)
699   // rising edge
700   if (vblank_on)
701701   {
702702      crystal_state *state = screen.machine().driver_data<crystal_state>();
703703      address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
src/mame/drivers/galpanic.c
r14223r14224
127127
128128static SCREEN_VBLANK( galpanic )
129129{
130   // falling edge
131   if (!vblank_on)
130   // rising edge
131   if (vblank_on)
132132   {
133133      device_t *pandora = screen.machine().device("pandora");
134134      pandora_eof(pandora);
src/mame/drivers/bbusters.c
r14223r14224
700700   MCFG_NVRAM_ADD_0FILL("eeprom")
701701
702702   /* video hardware */
703   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
703   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
704704
705705   MCFG_SCREEN_ADD("screen", RASTER)
706706   MCFG_SCREEN_REFRESH_RATE(60)
r14223r14224
737737   MCFG_CPU_IO_MAP(sounda_portmap)
738738
739739   /* video hardware */
740   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
740   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
741741
742742   MCFG_SCREEN_ADD("screen", RASTER)
743743   MCFG_SCREEN_REFRESH_RATE(60)
src/mame/drivers/lemmings.c
r14223r14224
2121#include "sound/2151intf.h"
2222#include "sound/okim6295.h"
2323#include "includes/lemmings.h"
24#include "video/decospr.h"
2425
2526static WRITE16_HANDLER( lemmings_control_w )
2627{
r14223r14224
230231   4,
231232   { 0x30000*8, 0x20000*8, 0x10000*8, 0x00000*8 },
232233   {
233      7, 6, 5, 4, 3, 2, 1, 0, 16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0
234      16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7,0, 1, 2, 3, 4, 5, 6, 7
234235   },
235   { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8, 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
236   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
236237   32*8
237238};
238239
239240static GFXDECODE_START( lemmings )
240   GFXDECODE_ENTRY( "gfx1", 0, sprite_layout,  32*16, 16 )   /* Sprites 16x16 */
241   GFXDECODE_ENTRY( "gfx2", 0, sprite_layout,  48*16, 16 )   /* Sprites 16x16 */
241   GFXDECODE_ENTRY( "gfx1", 0, sprite_layout,  0, 16 )   /* Sprites 16x16 */
242   GFXDECODE_ENTRY( "gfx2", 0, sprite_layout,  0, 16 )   /* Sprites 16x16 */
242243   GFXDECODE_ENTRY( NULL,           0, charlayout,         0, 16 ) /* Dynamically modified */
243244GFXDECODE_END
244245
r14223r14224
290291
291292   MCFG_VIDEO_START(lemmings)
292293
294   MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
295   decospr_device::set_gfx_region(*device, 1);
296
297   MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
298   decospr_device::set_gfx_region(*device, 0);
299
300
293301   /* sound hardware */
294302   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
295303
src/mame/drivers/psikyo.c
r14223r14224
11671167   MCFG_SCREEN_SIZE(320, 256)
11681168   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-32-1)
11691169   MCFG_SCREEN_UPDATE_STATIC(psikyo_bootleg)
1170   MCFG_SCREEN_VBLANK_STATIC(psikyo)
11701171
11711172   MCFG_GFXDECODE(psikyo)
11721173   MCFG_PALETTE_LENGTH(0x1000)
src/mame/drivers/n8080.c
r14223r14224
466466
467467static I8085_CONFIG( n8080_cpu_config )
468468{
469   DEVCB_HANDLER(n8080_status_callback),   /* STATUS changed callback */
470   DEVCB_LINE(n8080_inte_callback),      /* INTE changed callback */
469   DEVCB_DEVICE_HANDLER("maincpu",n8080_status_callback),   /* STATUS changed callback */
470   DEVCB_DEVICE_LINE("maincpu",n8080_inte_callback),      /* INTE changed callback */
471471   DEVCB_NULL,                        /* SID changed callback (8085A only) */
472472   DEVCB_NULL                        /* SOD changed callback (8085A only) */
473473};
src/mame/drivers/dreamwld.c
r14223r14224
585585   MCFG_MACHINE_RESET(dreamwld)
586586
587587   /* video hardware */
588   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
589
590588   MCFG_SCREEN_ADD("screen", RASTER)
591589   MCFG_SCREEN_REFRESH_RATE(58)
592590   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
src/mame/drivers/funkball.c
r14223r14224
33
44/***************************************************************************
55
6driver by Angelo Salese & Phil Bennett
7
68Notes:
7- currently fails DAC r/w in Voodoo registers (FPU fault?);
8(note: some of those are redundant)
9bp 0x18390,ax = 1;bp 0x1b5cb,ax = 1;
9-
1010
1111Funky Ball
1212dgPIX, 1998
r14223r14224
127127   DECLARE_READ8_MEMBER( flash_data_r );
128128   DECLARE_WRITE8_MEMBER( flash_data_w );
129129//  DECLARE_WRITE8_MEMBER( bios_ram_w );
130   DECLARE_READ32_MEMBER( test_r );
130   DECLARE_READ8_MEMBER( test_r );
131131
132132   DECLARE_READ8_MEMBER( fdc_r );
133133   DECLARE_WRITE8_MEMBER( fdc_w );
r14223r14224
560560   }
561561}
562562
563READ32_MEMBER( funkball_state::test_r )
563READ8_MEMBER( funkball_state::test_r )
564564{
565   return -1;
565   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7",
566                                            "IN8", "IN9", "INA", "INB", "INC", "IND", "INE", "INF",};
567
568   return input_port_read(machine(), portnames[offset]);
566569}
567570
568571static ADDRESS_MAP_START(funkball_map, AS_PROGRAM, 32, funkball_state)
r14223r14224
608611   AM_RANGE(0x0360, 0x0363) AM_WRITE8(flash_w,0xffffffff)
609612
610613//  AM_RANGE(0x0320, 0x0323) AM_READ(test_r)
611   AM_RANGE(0x036c, 0x036f) AM_READ(test_r)
614   AM_RANGE(0x0360, 0x036f) AM_READ8(test_r,0xffffffff) // inputs
612615ADDRESS_MAP_END
613616
614617static INPUT_PORTS_START( funkball )
618   PORT_START("IN0")
619   PORT_DIPNAME( 0x01, 0x01, "0" )
620   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
621   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
622   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
623   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
624   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
626   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
627   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
628   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
629   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
630   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
631   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
632   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
633   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
634   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
635   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
636   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
637   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
638   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
639   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
640   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
641   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
642   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
643   PORT_START("IN1")
644   PORT_DIPNAME( 0x01, 0x01, "1" )
645   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
646   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
647   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
648   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
649   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
650   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
651   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
652   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
653   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
654   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
655   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
656   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
657   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
658   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
659   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
660   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
661   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
662   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
663   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
664   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
665   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
666   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
667   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
668   PORT_START("IN2")
669   PORT_DIPNAME( 0x01, 0x01, "2" )
670   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
671   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
672   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
673   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
674   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
675   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
676   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
677   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
678   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
679   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
680   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
681   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
682   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
683   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
684   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
685   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
686   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
687   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
688   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
689   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
690   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
691   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
693   PORT_START("IN3")
694   PORT_DIPNAME( 0x01, 0x01, "3" )
695   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
696   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
697   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
698   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
699   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
700   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
701   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
702   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
703   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
704   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
705   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
706   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
707   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
708   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
709   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
710   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
711   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
712   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
713   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
714   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
715   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
716   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
717   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
718   PORT_START("IN4")
719   PORT_DIPNAME( 0x01, 0x01, "4" )
720   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
721   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
722   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
723   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
724   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
725   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
726   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
727   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
728   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
729   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
730   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
731   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
732   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
733   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
734   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
735   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
736   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
737   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
738   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
739   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
740   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
741   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
742   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
743   PORT_START("IN5")
744   PORT_DIPNAME( 0x01, 0x01, "5" )
745   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
746   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
747   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
748   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
749   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
750   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
751   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
752   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
753   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
754   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
755   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
756   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
757   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
758   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
759   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
760   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
761   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
762   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
763   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
764   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
765   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
766   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
767   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
768   PORT_START("IN6")
769   PORT_DIPNAME( 0x01, 0x01, "6" )
770   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
771   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
772   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
773   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
774   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
775   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
776   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
777   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
778   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
779   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
780   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
781   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
782   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
783   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
784   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
785   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
786   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
787   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
788   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
789   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
790   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
791   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
792   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
793   /* 7-8 P1/P2 E-F "dgDelay" */
794   PORT_START("IN7")
795   PORT_DIPNAME( 0x01, 0x01, "7" )
796   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
797   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
798   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
799   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
800   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
801   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
802   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
803   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
804   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
805   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
806   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
807   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
808   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
809   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
810   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
811   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
812   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
813   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
814   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
815   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
816   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
817   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
818   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
819   PORT_START("IN8")
820   PORT_DIPNAME( 0x01, 0x01, "8" )
821   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
822   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
823   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
824   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
825   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
826   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
827   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
828   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
829   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
830   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
831   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
832   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
833   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
834   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
835   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
836   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
837   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
838   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
839   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
840   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
841   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
842   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
843   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
844   PORT_START("IN9")
845   PORT_DIPNAME( 0x01, 0x01, "9" )
846   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
847   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
848   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
849   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
850   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
851   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
852   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
853   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
854   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
855   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
856   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
857   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
858   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
859   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
860   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
861   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
862   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
863   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
864   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
865   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
866   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
867   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
868   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
869   PORT_START("INA")
870   PORT_DIPNAME( 0x01, 0x01, "A" )
871   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
872   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
873   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
874   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
875   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
876   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
877   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
878   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
879   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
880   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
881   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
882   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
883   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
884   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
885   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
886   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
887   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
888   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
889   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
890   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
891   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
892   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
893   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
894   PORT_START("INB")
895   PORT_DIPNAME( 0x01, 0x01, "B" )
896   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
897   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
898   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
899   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
900   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
901   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
902   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
903   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
904   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
905   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
906   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
907   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
908   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
909   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
910   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
911   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
912   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
913   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
914   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
915   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
916   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
917   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
918   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
919   PORT_START("INC")
920   PORT_DIPNAME( 0x01, 0x01, "C" )
921   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
922   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
923   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
924   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
925   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
926   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
927   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
928   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
929   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
930   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
931   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
932   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
933   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
934   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
935   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
936   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
937   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
938   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
939   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
940   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
941   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
942   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
943   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
944   PORT_START("IND")
945   PORT_DIPNAME( 0x01, 0x01, "D" )
946   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
947   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
948   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
949   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
950   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
951   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
952   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
953   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
954   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
955   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
956   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
957   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
958   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
959   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
960   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
961   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
962   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
963   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
964   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
965   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
966   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
967   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
968   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
969   PORT_START("INE")
970   PORT_DIPNAME( 0x01, 0x01, "E" )
971   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
972   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
973   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
974   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
975   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
976   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
977   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
978   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
979   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
980   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
981   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
982   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
983   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
984   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
985   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
986   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
987   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
988   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
989   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
990   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
991   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
992   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
993   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
994   PORT_START("INF")
995   PORT_DIPNAME( 0x01, 0x01, "F" )
996   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
997   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
998   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
999   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1000   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1001   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1002   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1003   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1004   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1005   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1006   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1007   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1008   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1009   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1010   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1011   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1012   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1013   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1014   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1015   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1016   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1017   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1018   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6151019INPUT_PORTS_END
6161020
6171021static const struct pit8253_config funkball_pit8254_config =
r14223r14224
7421146}
7431147
7441148static MACHINE_CONFIG_START( funkball, funkball_state )
745   MCFG_CPU_ADD("maincpu", MEDIAGX, 66666666*3.5/16) // 66,6 MHz x 3.5
1149   MCFG_CPU_ADD("maincpu", MEDIAGX, 66666666*3.5) // 66,6 MHz x 3.5
7461150   MCFG_CPU_PROGRAM_MAP(funkball_map)
7471151   MCFG_CPU_IO_MAP(funkball_io)
7481152
src/mame/drivers/sandscrp.c
r14223r14224
136136
137137static SCREEN_VBLANK( sandscrp )
138138{
139   // falling edge
140   if (!vblank_on)
139   // rising edge
140   if (vblank_on)
141141   {
142142      sandscrp_state *state = screen.machine().driver_data<sandscrp_state>();
143143      device_t *pandora = screen.machine().device("pandora");
src/mame/drivers/twin16.c
r14223r14224
746746   MCFG_MACHINE_RESET(twin16)
747747
748748   // video hardware
749   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
749   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM)
750750
751751   MCFG_SCREEN_ADD("screen", RASTER)
752752   MCFG_SCREEN_REFRESH_RATE(((double)XTAL_18_432MHz / 2) / (576 * 264))
r14223r14224
799799   MCFG_MACHINE_RESET(twin16)
800800
801801   /* video hardware */
802   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
802   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_BUFFERS_SPRITERAM)
803803
804804   MCFG_SCREEN_ADD("screen", RASTER)
805805   MCFG_SCREEN_REFRESH_RATE(60)
src/mame/drivers/dec8.c
r14223r14224
20652065   MCFG_MACHINE_RESET(dec8)
20662066
20672067   /* video hardware */
2068   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
2068   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
20692069
20702070   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
20712071   deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
r14223r14224
22172217   MCFG_MACHINE_RESET(dec8)
22182218
22192219   /* video hardware */
2220   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM | VIDEO_UPDATE_AFTER_VBLANK)
2220   MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
22212221
22222222   MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
22232223   deco_karnovsprites_device::set_gfx_region(*device, 1);
src/mame/drivers/asuka.c
r14223r14224
876876
877877static SCREEN_VBLANK( asuka )
878878{
879   if (!vblank_on)
879   // rising edge
880   if (vblank_on)
880881   {
881882      asuka_state *state = screen.machine().driver_data<asuka_state>();
882883      pc090oj_eof_callback(state->m_pc090oj);
src/mame/drivers/hvyunit.c
r14223r14224
171171
172172static SCREEN_VBLANK( hvyunit )
173173{
174   // falling edge
175   if (!vblank_on)
174   // rising edge
175   if (vblank_on)
176176   {
177177      hvyunit_state *state = screen.machine().driver_data<hvyunit_state>();
178178      pandora_eof(state->m_pandora);
src/emu/video.c
r14223r14224
12811281    invalid palette index
12821282-------------------------------------------------*/
12831283
1284void video_assert_out_of_range_pixels(running_machine &machine, bitmap_ind16 &bitmap)
1284bool video_assert_out_of_range_pixels(running_machine &machine, bitmap_ind16 &bitmap)
12851285{
12861286#ifdef MAME_DEBUG
1287   // iterate over rows
12871288   int maxindex = palette_get_max_index(machine.palette);
1288   int x, y;
1289
1290   // iterate over rows
1291   for (y = 0; y < bitmap.height(); y++)
1289   for (int y = 0; y < bitmap.height(); y++)
12921290   {
12931291      UINT16 *rowbase = &bitmap.pix16(y);
1294      for (x = 0; x < bitmap.width(); x++)
1295         assert(rowbase[x] < maxindex);
1292      for (int x = 0; x < bitmap.width(); x++)
1293         if (rowbase[x] > maxindex)
1294         {
1295            osd_break_into_debugger("Out of range pixel");
1296            return true;
1297         }
12961298   }
12971299#endif
1300   return false;
12981301}
12991302
13001303
src/emu/video.h
r14223r14224
204204// ----- debugging helpers -----
205205
206206// assert if any pixels in the given bitmap contain an invalid palette index
207void video_assert_out_of_range_pixels(running_machine &machine, bitmap_ind16 &bitmap);
207bool video_assert_out_of_range_pixels(running_machine &machine, bitmap_ind16 &bitmap);
208208
209209
210210#endif   /* __VIDEO_H__ */
src/emu/emualloc.c
r14223r14224
112112//  GLOBALS
113113//**************************************************************************
114114
115// global resource pool to handle allocations outside of the emulator context
116resource_pool global_resource_pool(6151);
117
118115// dummy zeromem object
119116const zeromem_t zeromem = { };
120117
r14223r14224
126123memory_entry *memory_entry::s_hash[memory_entry::k_hash_prime] = { NULL };
127124memory_entry *memory_entry::s_freehead = NULL;
128125
126// wrapper for the global resource pool to help ensure construction order
127resource_pool &global_resource_pool()
128{
129   static resource_pool s_pool(6151);
130   return s_pool;
131};
129132
130133
131134//**************************************************************************
src/emu/machine.c
r14223r14224
932932
933933void running_machine::reset_all_devices()
934934{
935   // iterate over devices and reset them
936   device_iterator iter(root_device());
937   for (device_t *device = iter.first(); device != NULL; device = iter.next())
938      device->reset();
935   // reset the root and it will reset children
936   root_device().reset();
939937}
940938
941939
r14223r14224
12681266
12691267
12701268//-------------------------------------------------
1271//  device_reset - device override which calls
1272//  the various helpers
1269//  device_reset_after_children - device override
1270//  which calls the various helpers; must happen
1271//  after all child devices are reset
12731272//-------------------------------------------------
12741273
1275void driver_device::device_reset()
1274void driver_device::device_reset_after_children()
12761275{
12771276   // reset each piece
12781277   driver_reset();
src/emu/emualloc.h
r14223r14224
7474#define pool_free(_pool, v)                     (_pool).remove(v)
7575
7676// global allocation helpers
77#define global_alloc(_type)                     pool_alloc(global_resource_pool, _type)
78#define global_alloc_clear(_type)               pool_alloc_clear(global_resource_pool, _type)
79#define global_alloc_array(_type, _num)            pool_alloc_array(global_resource_pool, _type, _num)
80#define global_alloc_array_clear(_type, _num)      pool_alloc_array_clear(global_resource_pool, _type, _num)
81#define global_free(v)                        pool_free(global_resource_pool, v)
77#define global_alloc(_type)                     pool_alloc(global_resource_pool(), _type)
78#define global_alloc_clear(_type)               pool_alloc_clear(global_resource_pool(), _type)
79#define global_alloc_array(_type, _num)            pool_alloc_array(global_resource_pool(), _type, _num)
80#define global_alloc_array_clear(_type, _num)      pool_alloc_array_clear(global_resource_pool(), _type, _num)
81#define global_free(v)                        pool_free(global_resource_pool(), v)
8282
8383
8484
r14223r14224
281281
282282public:
283283   resource_pool(int hash_size = 193);
284   ~resource_pool();
284   virtual ~resource_pool();
285285
286286   void add(resource_pool_item &item);
287287   void remove(resource_pool_item &item) { remove(item.m_ptr); }
r14223r14224
308308//  GLOBAL VARIABLES
309309//**************************************************************************
310310
311// global resource pool
312extern resource_pool global_resource_pool;
313
314311// dummy objects to pass to the specialized new variants
315312extern const zeromem_t zeromem;
316313
317314
315resource_pool &global_resource_pool();
318316
317
318
319319//**************************************************************************
320320//  ADDDITIONAL MACROS
321321//**************************************************************************
src/emu/machine.h
r14223r14224
682682   virtual const rom_entry *device_rom_region() const;
683683   virtual ioport_constructor device_input_ports() const;
684684   virtual void device_start();
685   virtual void device_reset();
685   virtual void device_reset_after_children();
686686
687687   // internal helpers
688688   inline UINT16 paletteram16_le(offs_t offset) const { return m_generic_paletteram[offset & ~1] | (m_generic_paletteram[offset |  1] << 8); }
src/emu/ui.c
r14223r14224
10661066
10671067      /* count how many identical sound chips we have */
10681068      int count = 1;
1069//      for (device_sound_interface *scan = snditer.current(); scan != NULL; scan = snditer.next())
1070//      {
1071//         if (sound->device().type() != scan->device().type() || sound->device().clock() != scan->device().clock())
1072//            break;
1073//         count++;
1074//         sound = scan;
1075//      }
1069      for (device_sound_interface *scan = snditer.next(); scan != NULL; scan = snditer.next())
1070      {
1071         if (sound->device().type() != scan->device().type() || sound->device().clock() != scan->device().clock())
1072            break;
1073         count++;
1074         sound = scan;
1075      }
10761076      snditer.set_current(*sound);
10771077
10781078      /* if more than one, prepend a #x in front of the CPU name */
src/emu/emutempl.h
r14223r14224
5959
6060public:
6161   // construction/destruction
62   simple_list(resource_pool &pool = global_resource_pool) :
63      m_head(NULL),
64      m_tail(NULL),
65      m_pool(pool),
66      m_count(0) { }
62   simple_list(resource_pool &pool = global_resource_pool())
63      : m_head(NULL),
64        m_tail(NULL),
65        m_pool(pool),
66        m_count(0) { }
6767
6868   virtual ~simple_list() { reset(); }
6969
r14223r14224
307307
308308public:
309309   // construction/destruction
310   fixed_allocator(resource_pool &pool = global_resource_pool)
310   fixed_allocator(resource_pool &pool = global_resource_pool())
311311      : m_freelist(pool) { }
312312
313313   // allocate a new item, either by recycling an old one, or by allocating a new one
r14223r14224
343343
344344public:
345345   // construction/destruction
346   tagged_list(resource_pool &pool = global_resource_pool) :
347      m_list(pool) { }
346   tagged_list(resource_pool &pool = global_resource_pool())
347      : m_list(pool) { }
348348
349349   // simple getters
350350   resource_pool &pool() const { return m_list.pool(); }
src/emu/render.h
r14223r14224
260260
261261public:
262262   // construction/destruction
263   render_screen_list(resource_pool &pool = global_resource_pool)
263   render_screen_list(resource_pool &pool = global_resource_pool())
264264      : m_list(pool) { }
265265
266266   // getters
src/emu/romload.c
r14223r14224
3434    TYPE DEFINITIONS
3535***************************************************************************/
3636
37typedef struct _open_chd open_chd;
38struct _open_chd
37class open_chd
3938{
40   open_chd *         next;               /* pointer to next in the list */
41   const char *      region;               /* disk region we came from */
42   chd_file *         origchd;            /* handle to the original CHD */
43   emu_file *         origfile;            /* file handle to the original CHD file */
44   chd_file *         diffchd;            /* handle to the diff CHD */
45   emu_file *         difffile;            /* file handle to the diff CHD file */
39   friend class simple_list<open_chd>;
40
41public:
42   open_chd(const char *region, emu_file &file, chd_file &chdfile, emu_file *difffile = NULL, chd_file *diffchd = NULL)
43      : m_next(NULL),
44        m_region(region),
45        m_origchd(&chdfile),
46        m_origfile(&file),
47        m_diffchd(diffchd),
48        m_difffile(difffile) { }
49
50   ~open_chd()
51   {
52      if (m_diffchd != NULL) chd_close(m_diffchd);
53      global_free(m_difffile);
54      chd_close(m_origchd);
55      global_free(m_origfile);
56   }
57
58   open_chd *next() const { return m_next; }
59   const char *region() const { return m_region; }
60   chd_file *chd() const { return (m_diffchd != NULL) ? m_diffchd : m_origchd; }
61
62private:
63   open_chd *         m_next;               /* pointer to next in the list */
64   astring            m_region;            /* disk region we came from */
65   chd_file *         m_origchd;            /* handle to the original CHD */
66   emu_file *         m_origfile;            /* file handle to the original CHD file */
67   chd_file *         m_diffchd;            /* handle to the diff CHD */
68   emu_file *         m_difffile;            /* file handle to the diff CHD file */
4669};
4770
4871
r14223r14224
6588   UINT32         romstotalsize;      /* total size of ROMs to read */
6689
6790   emu_file *      file;            /* current file */
68   open_chd *      chd_list;         /* disks */
69   open_chd **      chd_list_tailptr;
91   simple_list<open_chd> chd_list;      /* disks */
7092
7193   memory_region *   region;            /* info about current region */
7294
r14223r14224
132154
133155chd_file *get_disk_handle(running_machine &machine, const char *region)
134156{
135   open_chd *curdisk;
136
137   for (curdisk = machine.romload_data->chd_list; curdisk != NULL; curdisk = curdisk->next)
138      if (strcmp(curdisk->region, region) == 0)
139         return (curdisk->diffchd != NULL) ? curdisk->diffchd : curdisk->origchd;
157    for (open_chd *curdisk = machine.romload_data->chd_list.first(); curdisk != NULL; curdisk = curdisk->next())
158      if (strcmp(curdisk->region(), region) == 0)
159         return curdisk->chd();
140160   return NULL;
141161}
142162
143163
144164/*-------------------------------------------------
145    add_disk_handle - add a disk to the to the
146    list of CHD files
147-------------------------------------------------*/
148
149static void add_disk_handle(running_machine &machine, open_chd *chd)
150{
151   romload_private *romload_data = machine.romload_data;
152
153   *romload_data->chd_list_tailptr = auto_alloc(machine, open_chd);
154   **romload_data->chd_list_tailptr = *chd;
155   romload_data->chd_list_tailptr = &(*romload_data->chd_list_tailptr)->next;
156}
157
158
159/*-------------------------------------------------
160165    set_disk_handle - set a pointer to the CHD
161166    file associated with the given region
162167-------------------------------------------------*/
163168
164169void set_disk_handle(running_machine &machine, const char *region, emu_file &file, chd_file &chdfile)
165170{
166   open_chd chd = { 0 };
167
168   /* note the region we are in */
169   chd.region = region;
170   chd.origchd = &chdfile;
171   chd.origfile = &file;
172
173   /* we're okay, add to the list of disks */
174   add_disk_handle(machine, &chd);
171   machine.romload_data->chd_list.append(*global_alloc(open_chd(region, file, chdfile)));
175172}
176173
177174
r14223r14224
12241221      if (ROMENTRY_ISFILE(romp))
12251222      {
12261223         hash_collection hashes(ROM_GETHASHDATA(romp));
1227         open_chd chd = { 0 };
12281224         chd_header header;
12291225         chd_error err;
12301226
1231         /* note the region we are in */
1232         chd.region = regiontag;
1233
12341227         /* make the filename of the source */
12351228         astring filename(ROM_GETNAME(romp), ".chd");
12361229
12371230         /* first open the source drive */
1231         chd_file *origchd;
1232         emu_file *origfile;
12381233         LOG(("Opening disk image: %s\n", filename.cstr()));
1239         err = open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, &chd.origfile, &chd.origchd, locationtag);
1234         err = open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, &origfile, &origchd, locationtag);
12401235         if (err != CHDERR_NONE)
12411236         {
12421237            if (err == CHDERR_FILE_NOT_FOUND)
r14223r14224
12551250         }
12561251
12571252         /* get the header and extract the SHA1 */
1258         header = *chd_get_header(chd.origchd);
1253         header = *chd_get_header(origchd);
12591254         hash_collection acthashes;
12601255         acthashes.add_from_buffer(hash_collection::HASH_SHA1, header.sha1, sizeof(header.sha1));
12611256
r14223r14224
12731268         }
12741269
12751270         /* if not read-only, make the diff file */
1271         chd_file *diffchd = NULL;
1272         emu_file *difffile = NULL;
12761273         if (!DISK_ISREADONLY(romp))
12771274         {
12781275            /* try to open or create the diff */
1279            err = open_disk_diff(romdata->machine().options(), romp, chd.origchd, &chd.difffile, &chd.diffchd);
1276            err = open_disk_diff(romdata->machine().options(), romp, origchd, &difffile, &diffchd);
12801277            if (err != CHDERR_NONE)
12811278            {
12821279               romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_error_string(err));
r14223r14224
12871284
12881285         /* we're okay, add to the list of disks */
12891286         LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp)));
1290         add_disk_handle(romdata->machine(), &chd);
1287         romdata->machine().romload_data->chd_list.append(*global_alloc(open_chd(regiontag, *origfile, *origchd, difffile, diffchd)));
12911288      }
12921289   }
12931290}
r14223r14224
15021499            process_rom_entries(romdata, (source->shortname()!=NULL) ? source->shortname() : NULL, region, region + 1);
15031500         }
15041501         else if (ROMREGION_ISDISKDATA(region))
1505            process_disk_entries(romdata, ROMREGION_GETTAG(region), region, region + 1, NULL);
1502            process_disk_entries(romdata, regiontag, region, region + 1, NULL);
15061503      }
15071504
15081505   /* now go back and post-process all the regions */
r14223r14224
15391536   count_roms(romdata);
15401537
15411538   /* reset the disk list */
1542   romdata->chd_list = NULL;
1543   romdata->chd_list_tailptr = &machine.romload_data->chd_list;
1539   romdata->chd_list.reset();
15441540
15451541   /* process the ROM entries we were passed */
15461542   process_region_list(romdata);
r14223r14224
15561552
15571553static void rom_exit(running_machine &machine)
15581554{
1559   open_chd *curchd;
1560
1561   /* close all hard drives */
1562   for (curchd = machine.romload_data->chd_list; curchd != NULL; curchd = curchd->next)
1563   {
1564      if (curchd->diffchd != NULL)
1565         chd_close(curchd->diffchd);
1566      if (curchd->difffile != NULL)
1567         global_free(curchd->difffile);
1568      if (curchd->origchd != NULL)
1569         chd_close(curchd->origchd);
1570      if (curchd->origfile != NULL)
1571         global_free(curchd->origfile);
1572   }
15731555}
15741556
15751557
src/emu/device.c
r14223r14224
262262
263263   // reset the device
264264   device_reset();
265   
266   // reset all child devices
267   for (device_t *child = m_subdevice_list.first(); child != NULL; child = child->next())
268      child->reset();
269   
270   // now allow for some post-child reset action
271   device_reset_after_children();
265272
266273   // let the interfaces do their post-work
267274   for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
r14223r14224
580587
581588
582589//-------------------------------------------------
590//  device_reset_after_children - hook to do
591//  reset logic that must happen after the children
592//  are reset; designed to be overriden by the
593//  actual device implementation
594//-------------------------------------------------
595
596void device_t::device_reset_after_children()
597{
598   // do nothing by default
599}
600
601
602//-------------------------------------------------
583603//  device_stop - clean up anything that needs to
584604//  happen before the running_machine goes away
585605//-------------------------------------------------
src/emu/device.h
r14223r14224
186186   astring &siblingtag(astring &dest, const char *tag) const { return (this != NULL && m_owner != NULL) ? m_owner->subtag(dest, tag) : dest.cpy(tag); }
187187   const memory_region *subregion(const char *tag) const;
188188   device_t *subdevice(const char *tag) const;
189   device_t *siblingdevice(const char *tag) const { return (this != NULL && m_owner != NULL) ? m_owner->subdevice(tag) : NULL; }
189   device_t *siblingdevice(const char *tag) const;
190190   template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); }
191191   template<class _DeviceClass> inline _DeviceClass *siblingdevice(const char *tag) const { return downcast<_DeviceClass *>(siblingdevice(tag)); }
192192   const memory_region *region() const { return m_region; }
r14223r14224
248248   virtual void device_start() ATTR_COLD = 0;
249249   virtual void device_stop() ATTR_COLD;
250250   virtual void device_reset() ATTR_COLD;
251   virtual void device_reset_after_children() ATTR_COLD;
251252   virtual void device_pre_save() ATTR_COLD;
252253   virtual void device_post_load() ATTR_COLD;
253254   virtual void device_clock_changed();
r14223r14224
754755
755756
756757//-------------------------------------------------
758//  siblingdevice - given a tag, find the device
759//  by name relative to this device's parent
760//-------------------------------------------------
761
762inline device_t *device_t::siblingdevice(const char *tag) const
763{
764   // safety first
765   if (this == NULL)
766      return NULL;
767
768   // empty string or NULL means this device
769   if (tag == NULL || *tag == 0)
770      return const_cast<device_t *>(this);
771   
772   // leading caret implies the owner, just skip it
773   if (tag[0] == '^') tag++;
774
775   // query relative to the parent
776   return (m_owner != NULL) ? m_owner->subdevice(tag) : NULL;
777}
778
779
780//-------------------------------------------------
757781//  bind_relative_to - perform a late binding of
758782//  a device_delegate
759783//-------------------------------------------------
src/emu/machine/generic.c
r14223r14224
316316    NVRAM depending of selected BIOS
317317-------------------------------------------------*/
318318
319static astring nvram_filename(running_machine &machine, astring &result)
319static astring &nvram_filename(astring &result, device_t &device)
320320{
321   if (rom_system_bios(machine) == 0 || rom_default_bios(machine) == rom_system_bios(machine)) {
322      result.printf("%s",machine.basename());
323   } else {
324      result.printf("%s_%d",machine.basename(),rom_system_bios(machine) - 1);
325   }
326   return result;
327}
321   running_machine &machine = device.machine();
328322
329/*-------------------------------------------------
330    nvram_filename - returns filename of system's
331    NVRAM depending of selected BIOS
332-------------------------------------------------*/
323   // start with either basename or basename_biosnum   
324   result.cpy(machine.basename());
325   if (rom_system_bios(machine) != 0 && rom_default_bios(machine) != rom_system_bios(machine))
326      result.catprintf("_%d", rom_system_bios(machine) - 1);
333327
334static astring nvram_filename(device_t &device, astring &result)
335{
336   running_machine &machine = device.machine();
337   astring name = astring(device.tag()).replacechr(':','_');
338   if (rom_system_bios(machine) == 0 || rom_default_bios(machine) == rom_system_bios(machine)) {
339      result.printf("%s\\%s",machine.basename(),name.cstr());
340   } else {
341      result.printf("%s_%d\\%s",machine.basename(),rom_system_bios(machine) - 1,name.cstr());
328   // device-based NVRAM gets its own name in a subdirectory
329   if (&device != &device.machine().root_device())
330   {
331      astring tag(device.tag());
332      tag.del(0, 1).replacechr(':', '_');
333      result.cat('\\').cat(tag);
342334   }
343335   return result;
344336}
r14223r14224
353345   {
354346      astring filename;
355347      emu_file file(machine.options().nvram_directory(), OPEN_FLAG_READ);
356      if (file.open(nvram_filename(machine,filename),".nv") == FILERR_NONE)
348      if (file.open(nvram_filename(filename, machine.root_device()), ".nv") == FILERR_NONE)
357349      {
358350         (*machine.config().m_nvram_handler)(machine, &file, FALSE);
359351         file.close();
r14223r14224
369361   {
370362      astring filename;
371363      emu_file file(machine.options().nvram_directory(), OPEN_FLAG_READ);
372      if (file.open(nvram_filename(nvram->device(),filename)) == FILERR_NONE)
364      if (file.open(nvram_filename(filename, nvram->device())) == FILERR_NONE)
373365      {
374366         nvram->nvram_load(file);
375367         file.close();
r14223r14224
390382   {
391383      astring filename;
392384      emu_file file(machine.options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
393      if (file.open(nvram_filename(machine,filename), ".nv") == FILERR_NONE)
385      if (file.open(nvram_filename(filename, machine.root_device()), ".nv") == FILERR_NONE)
394386      {
395387         (*machine.config().m_nvram_handler)(machine, &file, TRUE);
396388         file.close();
r14223r14224
402394   {
403395      astring filename;
404396      emu_file file(machine.options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
405      if (file.open(nvram_filename(nvram->device(),filename)) == FILERR_NONE)
397      if (file.open(nvram_filename(filename, nvram->device())) == FILERR_NONE)
406398      {
407399         nvram->nvram_save(file);
408400         file.close();

Previous 15994 Revisions Next


© 1998-2018 The MESS Team