Previous 15994 Revisions Next

r3290 Friday 19th September, 2008 at 11:15:26 UTC by Nathan Woods
Updated to MAME 0.127u4 core
[docs]messnew.txt
[src/emu]emu.mak memory.c romload.c sndintrf.c sndintrf.h
[src/emu/cpu/mcs48]mcs48.c mcs48dsm.c
[src/emu/debug]debugcpu.c
[src/emu/drivers]xtal.h
[src/emu/machine]laserdsc.c laserdsc.h ldcore.c ldcore.h ldpr8210.c ldv1000.c x2212.c* x2212.h*
[src/emu/sound]sound.mak
[src/ldplayer]ldplayer.c
[src/lib/util]chd.h vbiparse.c vbiparse.h
[src/mame]mame.mak mamedriv.c
[src/mame/audio]mario.c
[src/mame/drivers]40love.c adp.c argus.c arkanoid.c atarisy1.c cps1.c cps2.c cubeqst.c dec0.c epos.c firefox.c* funworld.c galaxi.c gottlieb.c harddriv.c mainsnk.c meritm.c midtunit.c namcona1.c namconb1.c naomi.c powerbal.c psikyo.c psychic5.c sg1000a.c shadfrce.c snk.c system1.c
[src/mame/layout]funworld.lay galaxi.lay*
[src/mame/machine]cps2crpt.c nb1413m3.c
[src/mame/video]argus.c cps1.c funworld.c jalblend.c jalblend.h* namconb1.c psychic5.c
[src/mess]mess.mak
[src/tools]chdman.c

src/mame/audio/mario.c
r3289r3290
267267   if (audiocpu != -1 && machine->config->cpu[audiocpu].type != CPU_Z80)
268268   {
269269      state->eabank = 1;
270      memory_install_read8_handler(machine, audiocpu, ADDRESS_SPACE_PROGRAM, 0x000, 0x7ff, 0, 0, SMH_BANK1);
270271      memory_configure_bank(1, 0, 1, memory_region(machine, "audio"), 0);
271272       memory_configure_bank(1, 1, 1, memory_region(machine, "audio") + 0x1000, 0x800);
272273   }
src/mame/machine/cps2crpt.c
r3289r3290
915915   { "vsavh",    { 0xb2d37c8d,0xd3b7aadd }, 0x100000 },   // 0C80 726A 4BAF  cmpi.l  #$726A4BAF,D0
916916   { "vsav2",    { 0xd681e4f4,0x60371edf }, 0x100000 },   // 0C80 0692 0760  cmpi.l  #$06920760,D0
917917   { "mvsc",     { 0x48025ade,0x1c697b27 }, 0x100000 },   // 0C81 1972 0121  cmpi.l  #$19720121,D1
918   { "mvscr1",   { 0x48025ade,0x1c697b27 }, 0x100000 },   // 0C81 1972 0121  cmpi.l  #$19720121,D1
918919   { "mvscu",    { 0x692dc41b,0x7ef1c805 }, 0x100000 },   // 0C81 1972 0121  cmpi.l  #$19720121,D1
919920   { "mvscj",    { 0xafc16138,0x97123eb0 }, 0x100000 },   // 0C81 1972 0121  cmpi.l  #$19720121,D1
920921   { "mvscjr1",  { 0xafc16138,0x97123eb0 }, 0x100000 },   // 0C81 1972 0121  cmpi.l  #$19720121,D1
src/mame/machine/nb1413m3.c
r3289r3290
395395
396396READ8_HANDLER( nb1413m3_inputport0_r )
397397{
398   return ((input_port_read(machine, "SYSTEM") & 0xfc) | ((nb1413m3_outcoin_flag & 0x01) << 1));
398   return ((input_port_read(machine, "SYSTEM") & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
399399}
400400
401401READ8_HANDLER( nb1413m3_inputport1_r )
src/mame/mamedriv.c
r3289r3290
24492449   DRIVER( 3wonders )   /* 20/05/1991 (c) 1991 (World) */
24502450   DRIVER( 3wonderu )   /* 20/05/1991 (c) 1991 (US)    */
24512451   DRIVER( wonder3 )   /* 20/05/1991 (c) 1991 (Japan) */
2452   DRIVER( 3wonderh )   /* hack? */
24522453   DRIVER( kod )      /* 11/07/1991 (c) 1991 (World) */
24532454   DRIVER( kodu )      /* 10/09/1991 (c) 1991 (US)    */
24542455   DRIVER( kodj )      /* 05/08/1991 (c) 1991 (Japan) */
r3289r3290
26892690   DRIVER( vhunt2r1 )   /* 13/09/1997 (c) 1997 (Japan) */
26902691   DRIVER( vhunt2 )   /* 29/09/1997 (c) 1997 (Japan) */
26912692   DRIVER( vsav2 )      /* 13/09/1997 (c) 1997 (Japan) */
2692   DRIVER( mvsc )      /* 12/01/1998 (c) 1998 (Euro) */
2693   DRIVER( mvsc )      /* 23/01/1998 (c) 1998 (Euro) */
2694   DRIVER( mvscr1 )   /* 12/01/1998 (c) 1998 (Euro) */
26932695   DRIVER( mvscu )      /* 23/01/1998 (c) 1998 (US) */
26942696   DRIVER( mvscj )      /* 23/01/1998 (c) 1998 (Japan) */
26952697   DRIVER( mvscjr1 )   /* 12/01/1998 (c) 1998 (Japan) */
r3289r3290
51535155   DRIVER( agentx1 )   /* 136023           (c) 1983 */
51545156   DRIVER( cloud9 )   /* (proto)          (c) 1983 */
51555157   DRIVER( firebeas )   /* (proto)          (c) 1983 */
5158   DRIVER( firefox )   /* 136026           (c) 1984 */
5159   DRIVER( firefoxa )   /* 136026           (c) 1984 */
51565160   DRIVER( jedi )      /* 136030           (c) 1984 */
51575161
51585162   /* Atari System 1 games */
r3289r3290
66056609   DRIVER( s1945jn )   /* (c) 1995 */
66066610   DRIVER( s1945k )   /* (c) 1995 */
66076611   DRIVER( tengai )   /* (c) 1996 */
6612   DRIVER( tengaij )   /* (c) 1996 */
66086613   DRIVER( s1945ii )   /* (c) 1997 */
66096614   DRIVER( soldivid )   /* (c) 1997 */
66106615   DRIVER( sbomberb )   /* (c) 1998 */
r3289r3290
70587063   DRIVER( powerbal )   /* (c) 1994 */
70597064   DRIVER( powerbls )   /* (c) 1994 */
70607065   DRIVER( magicstk )   /* (c) 1995 */
7066   DRIVER( hotminda )   /* (c) 1995 */
70617067   DRIVER( bigtwin )   /* (c) 1995 */
70627068   DRIVER( wbeachvl )   /* (c) 1995 */
70637069   DRIVER( wbeachv2 )   /* (c) 1995 */
r3289r3290
76497655   DRIVER( skattva )   /* (c) 1995 */
76507656   DRIVER( fashiong )   /* (c) 1997 */
76517657
7658   /* Other games on adp hardware */
7659   DRIVER( funlddlx )   /* (c) 1999 */
7660
76527661   /* JPM Give us a Break hardware */
76537662   DRIVER( guab )      /* (c) 1986 */
76547663   DRIVER( guab3 )      /* (c) 1986 */
r3289r3290
80048013   DRIVER( pool10 )   /* (c) 1996 C.M.C. */
80058014   DRIVER( pool10b )   /* (c) 1996 C.M.C. */
80068015   DRIVER( pool10c )   /* (c) 1996 C.M.C. */
8016   DRIVER( pool10d )   /* (c) 1997 C.M.C. */
80078017   DRIVER( tortufam )   /* (c) 1997 C.M.C. */
80088018   DRIVER( potgame )   /* (c) 1996 C.M.C. */
80098019   DRIVER( royalcrd )   /* (c) 1991 TAB-Austria */
r3289r3290
80718081   DRIVER( suprpool )   /* (c) 1997 ABM Games */
80728082   DRIVER( hotslot )   /* (c) 1996 ABM Electronics */
80738083   DRIVER( mcolors )   /* 1999 unknown */
8074   DRIVER( sgsafari )   /* 1996 New Impeuropex Corp. */
8084   DRIVER( sgsafari )   /* (c) 1996 New Impeuropex Corp. */
80758085   DRIVER( galaxi )   /* (c) 2000 BRL S.R.L. Bologna */
80768086   DRIVER( magjoker )   /* (c) 2000 BRL S.R.L. Bologna */
80778087   DRIVER( dwarfd )   /* (c) 198? Electro-Sports */
src/mame/mame.mak
r3289r3290
263263SOUNDS += NAMCO_CUS30
264264SOUNDS += NAMCO_52XX
265265SOUNDS += NAMCO_63701X
266SOUNDS += NAMCONA
267266SOUNDS += SNKWAVE
268267SOUNDS += C140
269268SOUNDS += C352
r3289r3290
502501   $(DRIVERS)/destroyr.o $(VIDEO)/destroyr.o \
503502   $(DRIVERS)/dragrace.o $(AUDIO)/dragrace.o $(VIDEO)/dragrace.o \
504503   $(DRIVERS)/eprom.o $(VIDEO)/eprom.o \
504   $(DRIVERS)/firefox.o \
505505   $(DRIVERS)/firetrk.o $(AUDIO)/firetrk.o $(VIDEO)/firetrk.o \
506506   $(DRIVERS)/flyball.o $(VIDEO)/flyball.o \
507507   $(DRIVERS)/foodf.o $(VIDEO)/foodf.o \
r3289r3290
803803$(MAMEOBJ)/jaleco.a: \
804804   $(DRIVERS)/aeroboto.o $(VIDEO)/aeroboto.o \
805805   $(DRIVERS)/argus.o $(VIDEO)/argus.o \
806   $(VIDEO)/jalblend.o \
806807   $(DRIVERS)/bestleag.o \
807808   $(DRIVERS)/bigstrkb.o $(VIDEO)/bigstrkb.o \
808809   $(DRIVERS)/blueprnt.o $(VIDEO)/blueprnt.o \
r3289r3290
17131714
17141715$(DRIVERS)/funworld.o:   $(LAYOUT)/funworld.lh
17151716
1717$(DRIVERS)/galaxi.o:   $(LAYOUT)/galaxi.lh
1718
17161719$(DRIVERS)/gatron.o:   $(LAYOUT)/poker41.lh \
17171720                  $(LAYOUT)/pulltabs.lh
17181721
src/mame/video/argus.c
r3289r3290
114114***************************************************************************/
115115
116116#include "driver.h"
117#include "jalblend.h"
117118
118#include "jalblend.c"
119119
120#define BUTASAN_TEXT_RAMSIZE      0x0800
121#define BUTASAN_BG0_RAMSIZE         0x0800
122#define BUTASAN_TXBACK_RAMSIZE      0x0800
123#define BUTASAN_BG0BACK_RAMSIZE      0x0800
124
125
126120UINT8 *argus_paletteram;
127121UINT8 *argus_txram;
128122UINT8 *argus_bg0_scrollx;
r3289r3290
132126UINT8 *argus_bg1_scrolly;
133127UINT8 *butasan_bg1ram;
134128
129static int bg0_scrollx, bg0_scrolly;
130static int bg1_scrollx, bg1_scrolly;
131
135132static UINT8 *argus_dummy_bg0ram;
136133static UINT8 *butasan_txram;
137134static UINT8 *butasan_bg0ram;
138135static UINT8 *butasan_bg0backram;
139136static UINT8 *butasan_txbackram;
137static UINT8 *butasan_pagedram[2];
138static UINT8 butasan_page_latch;
140139
141140static tilemap *tx_tilemap  = NULL;
142141static tilemap *bg0_tilemap = NULL;
143142static tilemap *bg1_tilemap = NULL;
144static tilemap *bombsa_bg_tilemap = NULL;
145143
146144static UINT8 argus_bg_status;
147145static UINT8 butasan_bg1_status;
148static UINT8 argus_bg_purple  = 0;
149static UINT8 argus_flipscreen = 0;
146static UINT8 argus_flipscreen;
150147
151static int argus_palette_intensity = 0;
148static UINT16 argus_palette_intensity;
152149
153150/* VROM scroll related for Argus */
154static int lowbitscroll = 0;
155static int prvscrollx = 0;
151static int lowbitscroll;
152static int prvscrollx;
156153
157static UINT8 bombsa_ram_page;
158static UINT8* bomba_otherram;
159
160static int valtric_mosaic=0;
154static UINT8 valtric_mosaic;
161155static bitmap_t *mosaicbitmap;
162156
157static UINT8 valtric_unknown;
158static UINT8 butasan_unknown;
163159
160
164161/***************************************************************************
165162  Callbacks for the tilemap code
166163***************************************************************************/
167164
168165static TILE_GET_INFO( argus_get_tx_tile_info )
169166{
170   int hi, lo;
167   UINT8 hi, lo;
171168
172   lo = argus_txram[  tile_index << 1  ];
173   hi = argus_txram[ (tile_index << 1) + 1 ];
169   tile_index <<= 1;
174170
171   lo = argus_txram[tile_index];
172   hi = argus_txram[tile_index + 1];
173
175174   SET_TILE_INFO(
176175         3,
177176         ((hi & 0xc0) << 2) | lo,
r3289r3290
181180
182181static TILE_GET_INFO( argus_get_bg0_tile_info )
183182{
184   int hi, lo;
183   UINT8 hi, lo;
185184
186   lo = argus_dummy_bg0ram[  tile_index << 1  ];
187   hi = argus_dummy_bg0ram[ (tile_index << 1) + 1 ];
185   tile_index <<= 1;
188186
187   lo = argus_dummy_bg0ram[tile_index];
188   hi = argus_dummy_bg0ram[tile_index + 1];
189
189190   SET_TILE_INFO(
190191         1,
191192         ((hi & 0xc0) << 2) | lo,
r3289r3290
195196
196197static TILE_GET_INFO( argus_get_bg1_tile_info )
197198{
198   int hi, lo;
199   UINT8 hi, lo;
199200
200   lo = argus_bg1ram[  tile_index << 1  ];
201   hi = argus_bg1ram[ (tile_index << 1) + 1 ];
201   tile_index <<= 1;
202202
203   lo = argus_bg1ram[tile_index];
204   hi = argus_bg1ram[tile_index + 1];
205
203206   SET_TILE_INFO(
204207         2,
205208         lo,
r3289r3290
209212
210213static TILE_GET_INFO( valtric_get_tx_tile_info )
211214{
212   int hi, lo;
215   UINT8 hi, lo;
213216
214   lo = argus_txram[  tile_index << 1  ];
215   hi = argus_txram[ (tile_index << 1) + 1 ];
217   tile_index <<= 1;
216218
219   lo = argus_txram[tile_index];
220   hi = argus_txram[tile_index + 1];
221
217222   SET_TILE_INFO(
218223         2,
219224         ((hi & 0xc0) << 2) | lo,
r3289r3290
223228
224229static TILE_GET_INFO( valtric_get_bg_tile_info )
225230{
226   int hi, lo, color, tile;
231   UINT8 hi, lo;
227232
228   lo = argus_bg1ram[  tile_index << 1  ];
229   hi = argus_bg1ram[ (tile_index << 1) + 1 ];
233   tile_index <<= 1;
230234
231   tile = ((hi & 0xc0) << 2) | ((hi & 0x20) << 5) | lo;
232   color = hi & 0x0f;
235   lo = argus_bg1ram[tile_index];
236   hi = argus_bg1ram[tile_index + 1];
233237
234238   SET_TILE_INFO(
235239         1,
236         tile,
237         color,
240         ((hi & 0xc0) << 2) | ((hi & 0x20) << 5) | lo,
241         hi & 0x0f,
238242         0);
239243}
240244
241245static TILE_GET_INFO( butasan_get_tx_tile_info )
242246{
243   int hi, lo;
247   UINT8 hi, lo;
244248
245249   tile_index ^= 0x3e0;
250   tile_index <<= 1;
246251
247   lo = butasan_txram[  tile_index << 1  ];
248   hi = butasan_txram[ (tile_index << 1) + 1 ];
252   lo = butasan_txram[tile_index];
253   hi = butasan_txram[tile_index + 1];
249254
250255   SET_TILE_INFO(
251256         3,
r3289r3290
256261
257262static TILE_GET_INFO( butasan_get_bg0_tile_info )
258263{
259   int hi, lo;
264   UINT8 hi, lo;
260265   int attrib;
261266
262   attrib = (tile_index & 0x00f) | ((tile_index & 0x1e0) >> 1);
263   attrib |= ((tile_index & 0x200) >> 1) | ((tile_index & 0x010) << 5);
267   attrib = (tile_index & 0x00f) | ((tile_index & 0x3e0) >> 1) | ((tile_index & 0x010) << 5);
264268   attrib ^= 0x0f0;
269   attrib <<= 1;
265270
266   lo = butasan_bg0ram[  attrib << 1  ];
267   hi = butasan_bg0ram[ (attrib << 1) + 1 ];
271   lo = butasan_bg0ram[attrib];
272   hi = butasan_bg0ram[attrib + 1];
268273
269274   SET_TILE_INFO(
270275         1,
r3289r3290
273278         TILE_FLIPYX((hi & 0x30) >> 4));
274279}
275280
276
277
278
279
280
281281static TILE_GET_INFO( butasan_get_bg1_tile_info )
282282{
283   int bank, tile, attrib, color;
283   int attrib, tile;
284284
285   attrib = (tile_index & 0x00f) | ((tile_index & 0x3e0) >> 1)
286            | ((tile_index & 0x010) << 5);
285   attrib = (tile_index & 0x00f) | ((tile_index & 0x3e0) >> 1) | ((tile_index & 0x010) << 5);
287286   attrib ^= 0x0f0;
288287
289   bank = (butasan_bg1_status & 0x02) << 7;
290   tile = butasan_bg1ram[ attrib ] | bank;
291   color = (tile & 0x80) >> 7;
288   tile = butasan_bg1ram[attrib] | ((butasan_bg1_status & 2) << 7);
292289
293290   SET_TILE_INFO(
294291         2,
295292         tile,
296         color,
293         (tile & 0x80) >> 7,
297294         0);
298295}
299296
r3289r3290
302299  Initialize and destroy video hardware emulation
303300***************************************************************************/
304301
305static void reset_common(void)
302static void reset_common(running_machine *machine)
306303{
307304   argus_bg_status = 0x01;
308   argus_bg_purple = 0;
309305   argus_flipscreen = 0;
310306   argus_palette_intensity = 0;
307
308   if (jal_blend_table != NULL)
309      memset(jal_blend_table, 0, 0xc00);
311310}
312311
313312VIDEO_START( argus )
314313{
315   /*                           info                      offset             type                  w   h  col  row */
316   bg0_tilemap = tilemap_create(argus_get_bg0_tile_info,  tilemap_scan_cols,       16, 16, 32, 32);
317   bg1_tilemap = tilemap_create(argus_get_bg1_tile_info,  tilemap_scan_cols,  16, 16, 32, 32);
318   tx_tilemap  = tilemap_create(argus_get_tx_tile_info,   tilemap_scan_cols,   8,  8, 32, 32);
314   /*                           info                     offset             w   h  col  row */
315   bg0_tilemap = tilemap_create(argus_get_bg0_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
316   bg1_tilemap = tilemap_create(argus_get_bg1_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
317   tx_tilemap  = tilemap_create(argus_get_tx_tile_info,  tilemap_scan_cols,  8,  8, 32, 32);
319318
319   tilemap_set_transparent_pen(bg1_tilemap, 15);
320   tilemap_set_transparent_pen(tx_tilemap,  15);
321
320322   /* dummy RAM for back ground */
321   argus_dummy_bg0ram = auto_malloc( 0x800 );
323   argus_dummy_bg0ram = auto_malloc(0x800);
322324
323   tilemap_set_transparent_pen( bg0_tilemap, 15 );
324   tilemap_set_transparent_pen( bg1_tilemap, 15 );
325   tilemap_set_transparent_pen( tx_tilemap,  15 );
326
327325   jal_blend_table = auto_malloc(0xc00);
328326}
329327
r3289r3290
331329{
332330   lowbitscroll = 0;
333331   prvscrollx = 0;
334
335   memset( argus_dummy_bg0ram, 0, 0x800 );
336   memset( argus_bg0_scrollx, 0x00, 2 );
337
338   memset(jal_blend_table,0,0xc00);
339   reset_common();
332   argus_bg0_scrollx[0] = 0;
333   argus_bg0_scrollx[1] = 0;
334   memset(argus_dummy_bg0ram, 0, 0x800);
335   reset_common(machine);
340336}
341337
342338VIDEO_START( valtric )
343339{
344   /*                           info                       offset             w   h   col  row */
345   bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols, 16, 16, 32, 32);
346   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols, 8,  8,  32, 32);
340   /*                           info                      offset             w   h  col  row */
341   bg1_tilemap = tilemap_create(valtric_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
342   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info, tilemap_scan_cols,  8,  8, 32, 32);
347343
348   tilemap_set_transparent_pen( bg1_tilemap, 15 );
349   tilemap_set_transparent_pen( tx_tilemap,  15 );
344   tilemap_set_transparent_pen(tx_tilemap,  15);
345
350346   mosaicbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
347
351348   jal_blend_table = auto_malloc(0xc00);
352349}
353350
354351VIDEO_RESET( valtric )
355352{
356   valtric_mosaic = 0;
357   memset(jal_blend_table,0,0xc00);
358   reset_common();
353   valtric_mosaic = 0x0f;
354   reset_common(machine);
359355}
360356
361357VIDEO_START( butasan )
362358{
363   /*                           info                       offset             type                 w   h  col  row */
364   bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows,       16, 16, 32, 32);
365   bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows,       16, 16, 32, 32);
366   tx_tilemap  = tilemap_create(butasan_get_tx_tile_info,  tilemap_scan_rows,   8,  8, 32, 32);
359   /*                           info                       offset             w   h  col  row */
360   bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
361   bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
362   tx_tilemap  = tilemap_create(butasan_get_tx_tile_info,  tilemap_scan_rows,  8,  8, 32, 32);
367363
368   butasan_txram = auto_malloc( BUTASAN_TEXT_RAMSIZE );
369   butasan_bg0ram = auto_malloc( BUTASAN_BG0_RAMSIZE );
370   butasan_txbackram = auto_malloc( BUTASAN_TXBACK_RAMSIZE );
371   butasan_bg0backram = auto_malloc( BUTASAN_BG0BACK_RAMSIZE );
364   tilemap_set_transparent_pen(bg1_tilemap, 15);
365   tilemap_set_transparent_pen(tx_tilemap,  15);
372366
373   tilemap_set_transparent_pen( tx_tilemap,  15 );
367   butasan_pagedram[0] = auto_malloc(0x1000);
368   butasan_pagedram[1] = auto_malloc(0x1000);
374369
370   butasan_bg0ram     = &butasan_pagedram[0][0x000];
371   butasan_bg0backram = &butasan_pagedram[0][0x800];
372   butasan_txram      = &butasan_pagedram[1][0x000];
373   butasan_txbackram  = &butasan_pagedram[1][0x800];
374
375375   jal_blend_table = auto_malloc(0xc00);
376   //jal_blend_table = NULL;
376377}
377378
378379VIDEO_RESET( butasan )
379380{
381   butasan_page_latch = 0;
380382   butasan_bg1_status = 0x01;
381
382   memset( butasan_txram,      0x00, BUTASAN_TEXT_RAMSIZE );
383   memset( butasan_bg0ram,     0x00, BUTASAN_BG0_RAMSIZE );
384   memset( butasan_txbackram,  0x00, BUTASAN_TXBACK_RAMSIZE );
385   memset( butasan_bg0backram, 0x00, BUTASAN_BG0BACK_RAMSIZE );
386
387   memset(jal_blend_table,0,0xc00);
388   reset_common();
383   memset(butasan_pagedram[0], 0, 0x1000);
384   memset(butasan_pagedram[1], 0, 0x1000);
385   reset_common(machine);
389386}
390387
391#if 0
392static TILE_GET_INFO( bombsa_get_tx_alt_tile_info )
393{
394   int hi, lo;
395388
396   lo = bombsa_tx_alt_ram[  tile_index << 1  ];
397   hi = bombsa_tx_alt_ram[ (tile_index << 1) + 1 ];
398
399   SET_TILE_INFO(
400         2,
401         ((hi & 0xc0) << 2) | lo,
402         hi & 0x0f,
403         TILE_FLIPYX((hi & 0x30) >> 4));
404}
405#endif
406
407static TILE_GET_INFO( bombsa_get_bg_tile_info )
408{
409   int tileno;
410   int col;
411
412   tileno = bomba_otherram[tile_index*2] | ( bomba_otherram[tile_index*2+1]<<8);
413   col = 0;
414
415   SET_TILE_INFO(
416         1,
417         tileno,
418         col,
419         0);
420}
421
422
423VIDEO_START( bombsa )
424{
425   /*                           info                       offset             type                 w   h  col  row */
426//  bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols,       16, 16, 32, 32);
427   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols,   8,  8, 32, 32);
428
429#if 0
430   /* this might be wrong.. but it looks like there may be a tilemap here that can change between 8x8 and 16x16 mode.. */
431   /* when you start the game it gets 'corrupted' with data for another layer.. */
432   tx_alt_tilemap  = tilemap_create(bombsa_get_tx_alt_tile_info,  tilemap_scan_cols,   8,  8, 32, 32);
433#endif
434
435   bombsa_bg_tilemap  = tilemap_create(bombsa_get_bg_tile_info,  tilemap_scan_cols,   16,  16, 64, 32);
436
437#if 0
438   bombsa_tx_alt_ram = auto_malloc(0x800);
439#endif
440
441//  tilemap_set_transparent_pen( bg1_tilemap, 15 );
442   tilemap_set_transparent_pen( tx_tilemap,  15 );
443#if 0
444   tilemap_set_transparent_pen( tx_alt_tilemap,  15 );
445#endif
446//  jal_blend_table = auto_malloc(0xc00);
447//  memset(jal_blend_table,0,0xc00) ;
448
449   bomba_otherram = auto_malloc(0x1000);
450}
451
452VIDEO_RESET( bombsa )
453{
454   bombsa_ram_page = 0;
455   memset(bomba_otherram, 0, 0x1000);
456   reset_common();
457}
458
459389/***************************************************************************
460390  Functions for handler of MAP roms in Argus and palette color
461391***************************************************************************/
462392
463393/* Write bg0 pattern data to dummy bg0 ram */
464static void argus_write_dummy_rams( running_machine *machine, int dramoffs, int vromoffs )
394static void argus_write_dummy_rams(running_machine *machine, int dramoffs, int vromoffs)
465395{
466396   int i;
467397   int voffs;
468398   int offs;
469399
470   UINT8 *VROM1 = memory_region( machine, "user1" );      /* "ag_15.bin" */
471   UINT8 *VROM2 = memory_region( machine, "user2" );      /* "ag_16.bin" */
400   UINT8 *VROM1 = memory_region(machine, "user1");      /* "ag_15.bin" */
401   UINT8 *VROM2 = memory_region(machine, "user2");      /* "ag_16.bin" */
472402
473403   /* offset in pattern data */
474   offs = VROM1[ vromoffs ] | ( VROM1[ vromoffs + 1 ] << 8 );
404   offs = VROM1[vromoffs] | (VROM1[vromoffs + 1] << 8);
475405   offs &= 0x7ff;
476406
477407   voffs = offs * 16;
478   for (i = 0 ; i < 8 ; i ++)
408   for (i = 0; i < 8; i++)
479409   {
480      argus_dummy_bg0ram[ dramoffs ] = VROM2[ voffs ];
481      argus_dummy_bg0ram[ dramoffs + 1 ] = VROM2[ voffs + 1 ];
482      tilemap_mark_tile_dirty( bg0_tilemap, dramoffs >> 1 );
410      argus_dummy_bg0ram[dramoffs]     = VROM2[voffs];
411      argus_dummy_bg0ram[dramoffs + 1] = VROM2[voffs + 1];
412      tilemap_mark_tile_dirty(bg0_tilemap, dramoffs >> 1);
483413      dramoffs += 2;
484414      voffs += 2;
485415   }
486416}
487417
488
489static void bombsa_change_palette(running_machine *machine, int color, int data)
418static void argus_change_palette(running_machine *machine, int color, int lo_offs, int hi_offs)
490419{
491   palette_set_color_rgb(machine, color, pal4bit(data >> 12), pal4bit(data >> 8), pal4bit(data >> 4));
420   UINT8 lo = argus_paletteram[lo_offs];
421   UINT8 hi = argus_paletteram[hi_offs];
422   if (jal_blend_table != NULL) jal_blend_table[color] = hi & 0x0f;
423   palette_set_color_rgb(machine, color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4));
492424}
493425
494
495static void argus_change_palette(running_machine *machine, int color, int data)
426static void argus_change_bg_palette(running_machine *machine, int color, int lo_offs, int hi_offs)
496427{
497   jal_blend_table[color] = data & 0x0f ;
428   UINT8 r,g,b,lo,hi,ir,ig,ib,ix;
429   rgb_t rgb,irgb;
498430
499   palette_set_color_rgb(machine, color, pal4bit(data >> 12), pal4bit(data >> 8), pal4bit(data >> 4));
500}
431   /* red,green,blue intensities */
432   ir = pal4bit(argus_palette_intensity >> 12);
433   ig = pal4bit(argus_palette_intensity >>  8);
434   ib = pal4bit(argus_palette_intensity >>  4);
435   ix = argus_palette_intensity & 0x0f;
501436
502static void argus_change_bg_palette(running_machine *machine, int color, int data)
503{
504   int r, g, b;
505   int ir, ig, ib;
437   irgb = MAKE_RGB(ir,ig,ib);
506438
507   r = (data >> 12) & 0x0f;
508   g = (data >>  8) & 0x0f;
509   b = (data >>  4) & 0x0f;
439   lo = argus_paletteram[lo_offs];
440   hi = argus_paletteram[hi_offs];
510441
511   ir = (argus_palette_intensity >> 12) & 0x0f;
512   ig = (argus_palette_intensity >>  8) & 0x0f;
513   ib = (argus_palette_intensity >>  4) & 0x0f;
442   /* red,green,blue component */
443   r = pal4bit(lo >> 4);
444   g = pal4bit(lo);
445   b = pal4bit(hi >> 4);
514446
515   r = (r - ir > 0) ? r - ir : 0;
516   g = (g - ig > 0) ? g - ig : 0;
517   b = (b - ib > 0) ? b - ib : 0;
518
519   if (argus_bg_status & 2)         /* Gray / purple scale */
447   /* Grey background enable */
448   if (argus_bg_status & 2)
520449   {
521      r = (r + g + b) / 3;
522      g = b = r;
523      if (argus_bg_purple == 2)      /* Purple */
524         g = 0;
450      UINT8 val = (r + g + b) / 3;
451      rgb = MAKE_RGB(val,val,val);
525452   }
453   else
454   {
455      rgb = MAKE_RGB(r,g,b);
456   }
526457
527   palette_set_color_rgb(machine, color, pal4bit(r), pal4bit(g), pal4bit(b));
458   rgb = jal_blend_func(rgb,irgb,ix);
459
460   palette_set_color(machine,color,rgb);
528461}
529462
530463
r3289r3290
532465  Memory handler
533466***************************************************************************/
534467
535WRITE8_HANDLER(valtric_mosaic_w)
468WRITE8_HANDLER( valtric_mosaic_w )
536469{
537   if(data!=0x80)
538   {
539      valtric_mosaic=0x0f-(data&0x0f);
540
541      if(valtric_mosaic!=0)
542      {
543         valtric_mosaic++;
544      }
545
546      if(data&0x80)
547      {
548         valtric_mosaic*=-1;
549      }
550   }
470   valtric_mosaic = data;
551471}
552472
553
554WRITE8_HANDLER( bombsa_pageselect_w )
555{
556   bombsa_ram_page = data;
557}
558
559473READ8_HANDLER( argus_txram_r )
560474{
561   return argus_txram[ offset ];
475   return argus_txram[offset];
562476}
563477
564478WRITE8_HANDLER( argus_txram_w )
565479{
566   argus_txram[ offset ] = data;
480   argus_txram[offset] = data;
567481   tilemap_mark_tile_dirty(tx_tilemap, offset >> 1);
568482}
569483
570READ8_HANDLER( bombsa_txram_r )
571{
572#if 0
573   if (bombsa_ram_page == 1)
574   {
575      return argus_txram[ offset ];
576   }
577   else
578   {
579      return bombsa_tx_alt_ram[ offset ];
580   }
581#endif
582
583   return argus_txram[ offset ];
584
585}
586
587WRITE8_HANDLER( bombsa_txram_w )
588{
589#if 0
590   if (bombsa_ram_page == 1)
591   {
592      argus_txram[ offset ] = data;
593      tilemap_mark_tile_dirty(tx_tilemap, offset >> 1);
594   }
595   else
596   {
597      /* 8x8 .. */
598      bombsa_tx_alt_ram[ offset ] = data;
599      tilemap_mark_tile_dirty(tx_alt_tilemap, offset >> 1);
600      /* also 16x16 ..? */
601   }
602#endif
603   argus_txram[ offset ] = data;
604   tilemap_mark_tile_dirty(tx_tilemap, offset >> 1);
605}
606
607READ8_HANDLER( butasan_txram_r )
608{
609   return butasan_txram[ offset ];
610}
611
612WRITE8_HANDLER( butasan_txram_w )
613{
614   butasan_txram[ offset ] = data;
615   tilemap_mark_tile_dirty(tx_tilemap, (offset ^ 0x7c0) >> 1);
616}
617
618484READ8_HANDLER( argus_bg1ram_r )
619485{
620   return argus_bg1ram[ offset ];
486   return argus_bg1ram[offset];
621487}
622488
623489WRITE8_HANDLER( argus_bg1ram_w )
624490{
625   argus_bg1ram[ offset ] = data;
491   argus_bg1ram[offset] = data;
626492   tilemap_mark_tile_dirty(bg1_tilemap, offset >> 1);
627493}
628494
629READ8_HANDLER( butasan_bg0ram_r )
495WRITE8_HANDLER( argus_bg0_scrollx_w )
630496{
631   return butasan_bg0ram[ offset ];
497   argus_bg0_scrollx[offset] = data;
498   bg0_scrollx = argus_bg0_scrollx[0] | (argus_bg0_scrollx[1] << 8);
632499}
633500
634WRITE8_HANDLER( butasan_bg0ram_w )
635{
636   int idx;
637
638   butasan_bg0ram[ offset ] = data;
639
640   idx = ((offset & 0x01f) >> 1) | ((offset & 0x400) >> 6);
641   idx |= (offset & 0x3e0) ^ 0x1e0;
642
643   tilemap_mark_tile_dirty(bg0_tilemap, idx);
644}
645
646READ8_HANDLER( butasan_bg1ram_r )
647{
648   return butasan_bg1ram[ offset ];
649}
650
651WRITE8_HANDLER( butasan_bg1ram_w )
652{
653   int idx;
654
655   butasan_bg1ram[ offset ] = data;
656
657   idx = (offset & 0x00f) | ((offset & 0x200) >> 5) | ((offset & 0x1f0) << 1);
658   idx ^= 0x0f0;
659
660   tilemap_mark_tile_dirty(bg1_tilemap, idx);
661}
662
663WRITE8_HANDLER ( argus_bg0_scrollx_w )
664{
665   if (argus_bg0_scrollx[ offset ] != data)
666   {
667      argus_bg0_scrollx[ offset ] = data;
668   }
669}
670
671501WRITE8_HANDLER( argus_bg0_scrolly_w )
672502{
673   if (argus_bg0_scrolly[ offset ] != data)
674   {
675      int scrolly;
676      argus_bg0_scrolly[ offset ] = data;
677      scrolly = argus_bg0_scrolly[0] | ( (argus_bg0_scrolly[1] & 0x01) << 8);
678      if (!argus_flipscreen)
679         tilemap_set_scrolly( bg0_tilemap, 0, scrolly );
680      else
681         tilemap_set_scrolly( bg0_tilemap, 0, (scrolly + 256) & 0x1ff );
682   }
503   argus_bg0_scrolly[offset] = data;
504   bg0_scrolly = argus_bg0_scrolly[0] | (argus_bg0_scrolly[1] << 8);
683505}
684506
685WRITE8_HANDLER( butasan_bg0_scrollx_w )
686{
687   if (argus_bg0_scrollx[ offset ] != data)
688   {
689      int scrollx;
690      argus_bg0_scrollx[ offset ] = data;
691      scrollx = argus_bg0_scrollx[0] | ( (argus_bg0_scrollx[1] & 0x01) << 8);
692      if (!argus_flipscreen)
693         tilemap_set_scrollx( bg0_tilemap, 0, scrollx );
694      else
695         tilemap_set_scrollx( bg0_tilemap, 0, (scrollx + 256) & 0x1ff );
696   }
697}
698
699507WRITE8_HANDLER( argus_bg1_scrollx_w )
700508{
701   if (argus_bg1_scrollx[ offset ] != data)
702   {
703      int scrollx;
704      argus_bg1_scrollx[ offset ] = data;
705      scrollx = argus_bg1_scrollx[0] | ( (argus_bg1_scrollx[1] & 0x01) << 8);
706      if (!argus_flipscreen)
707         tilemap_set_scrollx( bg1_tilemap, 0, scrollx );
708      else
709         tilemap_set_scrollx( bg1_tilemap, 0, (scrollx + 256) & 0x1ff );
710   }
509   argus_bg1_scrollx[offset] = data;
510   bg1_scrollx = argus_bg1_scrollx[0] | (argus_bg1_scrollx[1] << 8);
711511}
712512
713513WRITE8_HANDLER( argus_bg1_scrolly_w )
714514{
715   if (argus_bg1_scrolly[ offset ] != data)
716   {
717      int scrolly;
718      argus_bg1_scrolly[ offset ] = data;
719      scrolly = argus_bg1_scrolly[0] | ( (argus_bg1_scrolly[1] & 0x01) << 8);
720      if (!argus_flipscreen)
721         tilemap_set_scrolly( bg1_tilemap, 0, scrolly );
722      else
723         tilemap_set_scrolly( bg1_tilemap, 0, (scrolly + 256) & 0x1ff );
724   }
515   argus_bg1_scrolly[offset] = data;
516   bg1_scrolly = argus_bg1_scrolly[0] | (argus_bg1_scrolly[1] << 8);
725517}
726518
727519WRITE8_HANDLER( argus_bg_status_w )
r3289r3290
730522   {
731523      argus_bg_status = data;
732524
733      /* Backgound enable */
734      tilemap_set_enable(bg1_tilemap, argus_bg_status & 1);
735
736525      /* Gray / purple scale */
737526      if (argus_bg_status & 2)
738527      {
739528         int offs;
740529
741         for (offs = 0x400 ; offs < 0x500 ; offs ++)
530         for (offs = 0x400; offs < 0x500; offs++)
742531         {
743            argus_change_bg_palette( machine, (offs - 0x0400) + 128,
744               (argus_paletteram[offs] << 8) | argus_paletteram[offs + 0x0400] );
532            argus_change_bg_palette(machine, (offs - 0x400) + 0x080, offs, offs + 0x400);
745533         }
746534      }
747535   }
r3289r3290
753541   {
754542      argus_bg_status = data;
755543
756      /* Backgound enable */
757      tilemap_set_enable(bg1_tilemap, argus_bg_status & 1);
758
759544      /* Gray / purple scale */
760545      if (argus_bg_status & 2)
761546      {
762547         int offs;
763548
764         for (offs = 0x400 ; offs < 0x600 ; offs += 2)
549         for (offs = 0x400; offs < 0x600; offs += 2)
765550         {
766            argus_change_bg_palette( machine, ((offs - 0x0400) >> 1) + 256,
767               argus_paletteram[offs | 1] | (argus_paletteram[offs & ~1] << 8));
551            argus_change_bg_palette(machine, ((offs - 0x400) >> 1) + 0x100, offs & ~1, offs | 1);
768552         }
769553      }
770554   }
r3289r3290
772556
773557WRITE8_HANDLER( butasan_bg0_status_w )
774558{
775   if (argus_bg_status != data)
559   argus_bg_status = data;
560}
561
562WRITE8_HANDLER( butasan_bg1_status_w )
563{
564   if (butasan_bg1_status != data)
776565   {
777      argus_bg_status = data;
566      butasan_bg1_status = data;
778567
779      /* Backgound enable */
780      tilemap_set_enable(bg0_tilemap, argus_bg_status & 1);
568      /* Bank changed */
569      tilemap_mark_all_tiles_dirty(bg1_tilemap);
781570   }
782571}
783572
784573WRITE8_HANDLER( argus_flipscreen_w )
785574{
786   if (argus_flipscreen != (data >> 7))
787   {
788      argus_flipscreen = data >> 7;
789      tilemap_set_flip( ALL_TILEMAPS, (argus_flipscreen) ? TILEMAP_FLIPY | TILEMAP_FLIPX : 0);
790      if (!argus_flipscreen)
791      {
792         int scrollx, scrolly;
793
794         if (bg0_tilemap != NULL)
795         {
796            scrollx = argus_bg0_scrollx[0] | ( (argus_bg0_scrollx[1] & 0x01) << 8);
797            tilemap_set_scrollx(bg0_tilemap, 0, scrollx & 0x1ff);
798
799            scrolly = argus_bg0_scrolly[0] | ( (argus_bg0_scrolly[1] & 0x01) << 8);
800            tilemap_set_scrolly(bg0_tilemap, 0, scrolly);
801         }
802         scrollx = argus_bg1_scrollx[0] | ( (argus_bg1_scrollx[1] & 0x01) << 8);
803         tilemap_set_scrollx(bg1_tilemap, 0, scrollx);
804
805         scrolly = argus_bg1_scrolly[0] | ( (argus_bg1_scrolly[1] & 0x01) << 8);
806         tilemap_set_scrolly(bg1_tilemap, 0, scrolly);
807      }
808      else
809      {
810         int scrollx, scrolly;
811
812         if (bg0_tilemap != NULL)
813         {
814            scrollx = argus_bg0_scrollx[0] | ( (argus_bg0_scrollx[1] & 0x01) << 8);
815            tilemap_set_scrollx(bg0_tilemap, 0, (scrollx + 256) & 0x1ff);
816
817            scrolly = argus_bg0_scrolly[0] | ( (argus_bg0_scrolly[1] & 0x01) << 8);
818            tilemap_set_scrolly(bg0_tilemap, 0, (scrolly + 256) & 0x1ff);
819         }
820         scrollx = argus_bg1_scrollx[0] | ( (argus_bg1_scrollx[1] & 0x01) << 8);
821         tilemap_set_scrollx(bg1_tilemap, 0, (scrollx + 256) & 0x1ff);
822
823         scrolly = argus_bg1_scrolly[0] | ( (argus_bg1_scrolly[1] & 0x01) << 8);
824         tilemap_set_scrolly(bg1_tilemap, 0, (scrolly + 256) & 0x1ff);
825      }
826   }
575   argus_flipscreen = data & 0x80;
827576}
828577
829578READ8_HANDLER( argus_paletteram_r )
830579{
831   return argus_paletteram[ offset ];
580   return argus_paletteram[offset];
832581}
833582
834583WRITE8_HANDLER( argus_paletteram_w )
835584{
836585   int offs;
837586
838   argus_paletteram[ offset ] = data;
587   argus_paletteram[offset] = data;
839588
840   if (offset != 0x007f && offset != 0x00ff)
589   if (offset <= 0x0ff)                        /* sprite color */
841590   {
842      if (offset >= 0x0000 && offset <= 0x00ff)            /* sprite color */
843      {
844         if (offset & 0x80)
845            offset -= 0x80;
591      offset &= 0x07f;
846592
847         argus_change_palette( machine, offset,
848            (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x80] );
849      }
593      argus_change_palette(machine, offset, offset, offset + 0x080);
850594
851      else if ( (offset >= 0x0400 && offset <= 0x04ff) ||
852              (offset >= 0x0800 && offset <= 0x08ff) )      /* BG0 color */
595      if (offset == 0x07f || offset == 0x0ff)
853596      {
854         if (offset >= 0x0800)
855            offset -= 0x0400;
597         argus_palette_intensity = argus_paletteram[0x0ff] | (argus_paletteram[0x07f] << 8);
856598
857         argus_change_bg_palette( machine, (offset - 0x0400) + 128,
858            (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x0400] );
599         for (offs = 0x400; offs < 0x500; offs++)
600            argus_change_bg_palette(machine, (offs & 0xff) + 0x080, offs, offs + 0x400);
859601      }
602   }
603   else if ((offset >= 0x400 && offset <= 0x4ff) ||
604          (offset >= 0x800 && offset <= 0x8ff))      /* BG0 color */
605   {
606      offs = offset & 0xff;
607      offset = offs | 0x400;
860608
861      else if ( (offset >= 0x0500 && offset <= 0x05ff) ||
862              (offset >= 0x0900 && offset <= 0x09ff) )      /* BG1 color */
863      {
864         if (offset >= 0x0900)
865            offset -= 0x0400;
609      argus_change_bg_palette(machine, offs + 0x080, offset, offset + 0x400);
610   }
611   else if ((offset >= 0x500 && offset <= 0x5ff) ||
612          (offset >= 0x900 && offset <= 0x9ff))      /* BG1 color */
613   {
614      offs = offset & 0xff;
615      offset = offs | 0x500;
866616
867         argus_change_palette( machine, (offset - 0x0500) + 384,
868            (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x0400] );
869      }
870
871      else if ( (offset >= 0x0700 && offset <= 0x07ff) ||
872              (offset >= 0x0b00 && offset <= 0x0bff) )      /* text color */
873      {
874         if (offset >= 0x0b00)
875            offset -= 0x0400;
876
877         argus_change_palette( machine, (offset - 0x0700) + 640,
878            (argus_paletteram[offset] << 8) | argus_paletteram[offset + 0x0400] );
879      }
617      argus_change_palette(machine, offs + 0x180, offset, offset + 0x400);
880618   }
881   else
619   else if ((offset >= 0x700 && offset <= 0x7ff) ||
620          (offset >= 0xb00 && offset <= 0xbff))      /* text color */
882621   {
883      argus_palette_intensity = (argus_paletteram[0x007f] << 8) | argus_paletteram[0x00ff];
622      offs = offset & 0xff;
623      offset = offs | 0x700;
884624
885      for (offs = 0x400 ; offs < 0x500 ; offs ++)
886      {
887         argus_change_bg_palette( machine, (offs - 0x0400) + 128,
888            (argus_paletteram[offs] << 8) | argus_paletteram[offs + 0x0400] );
889      }
890
891      argus_bg_purple = argus_paletteram[0x0ff] & 0x0f;
625      argus_change_palette(machine, offs + 0x280, offset, offset + 0x400);
892626   }
893627}
894628
895629WRITE8_HANDLER( valtric_paletteram_w )
896630{
897   int offs;
631   argus_paletteram[offset] = data;
898632
899   argus_paletteram[ offset ] = data;
900
901   if (offset != 0x01fe && offset != 0x01ff)
633   if (offset <= 0x1ff)                     /* Sprite color */
902634   {
903      if (offset >= 0x0000 && offset <= 0x01ff)
635      argus_change_palette(machine, offset >> 1, offset & ~1, offset | 1);
636
637      if (offset == 0x1fe || offset == 0x1ff)
904638      {
905         argus_change_palette( machine, offset >> 1,
906            argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
639         int offs;
640
641         argus_palette_intensity = argus_paletteram[0x1ff] | (argus_paletteram[0x1fe] << 8);
642
643         for (offs = 0x400; offs < 0x600; offs += 2)
644            argus_change_bg_palette(machine, ((offs & 0x1ff) >> 1) + 0x100, offs & ~1, offs | 1);
907645      }
908      else if (offset >= 0x0400 && offset <= 0x05ff )
909      {
910         argus_change_bg_palette( machine, ((offset - 0x0400) >> 1) + 256,
911            argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
912      }
913      else if (offset >= 0x0600 && offset <= 0x07ff )
914      {
915         argus_change_palette( machine, ((offset - 0x0600) >> 1) + 512,
916            argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
917      }
918646   }
919   else
647   else if (offset >= 0x400 && offset <= 0x5ff)      /* BG color */
920648   {
921      argus_palette_intensity = (argus_paletteram[0x01fe] << 8) | argus_paletteram[0x01ff];
922
923      for (offs = 0x400 ; offs < 0x600 ; offs += 2)
924      {
925         argus_change_bg_palette( machine, ((offs - 0x0400) >> 1) + 256,
926            argus_paletteram[offs | 1] | (argus_paletteram[offs & ~1] << 8));
927      }
928
929      argus_bg_purple = argus_paletteram[0x01ff] & 0x0f;
649      argus_change_bg_palette(machine, ((offset & 0x1ff) >> 1) + 0x100, offset & ~1, offset | 1);
930650   }
651   else if (offset >= 0x600 && offset <= 0x7ff)      /* Text color */
652   {
653      argus_change_palette(machine, ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
654   }
931655}
932656
933657WRITE8_HANDLER( butasan_paletteram_w )
934658{
935   argus_paletteram[ offset ] = data;
659   argus_paletteram[offset] = data;
936660
937   if (offset < 0x0200 )                     /* BG1 color */
661   if (offset <= 0x1ff)                     /* BG0 color */
938662   {
939      argus_change_palette( machine, ((offset - 0x0000) >> 1) + 256,
940         argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
663      argus_change_palette(machine, (offset >> 1) + 0x100, offset & ~1, offset | 1);
941664   }
942   else if (offset < 0x0240 )                  /* BG0 color */
665   else if (offset <= 0x23f)                  /* BG1 color */
943666   {
944      argus_change_palette( machine, ((offset - 0x0200) >> 1) + 192,
945         argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
667      argus_change_palette(machine, ((offset & 0x3f) >> 1) + 0x0c0, offset & ~1, offset | 1);
946668   }
947   else if (offset >= 0x0400 && offset <= 0x04ff )   /* Sprite color */
948   {
949      if (offset < 0x0480)         /* 16 colors */
950         argus_change_palette( machine, ((offset - 0x0400) >> 1) + 0,
951            argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
952      else                     /* 8  colors */
953      {
954         argus_change_palette( machine, (offset & 0x70) + ((offset & 0x00f) >> 1) + 64,
955            argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
956         argus_change_palette( machine, (offset & 0x70) + ((offset & 0x00f) >> 1) + 72,
957            argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
958      }
669   else if (offset >= 0x400 && offset <= 0x47f)   /* Sprite color */
670   {                                    /* 16 colors */
671      argus_change_palette(machine, (offset & 0x7f) >> 1, offset & ~1, offset | 1);
959672   }
960   else if (offset >= 0x0600 && offset <= 0x07ff )   /* Text color */
961   {
962      argus_change_palette( machine, ((offset - 0x0600) >> 1) + 512,
963         argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
964   }
965}
673   else if (offset >= 0x480 && offset <= 0x4ff)   /* Sprite color */
674   {                                    /* 8  colors */
675      int offs = (offset & 0x070) | ((offset & 0x00f) >> 1);
966676
967READ8_HANDLER( bombsa_paletteram_r )
968{
969   if (bombsa_ram_page==1)
970   {
971      return argus_paletteram[ offset ];
677      argus_change_palette(machine, offs + 0x040, offset & ~1, offset | 1);
678      argus_change_palette(machine, offs + 0x048, offset & ~1, offset | 1);
972679   }
973   else if (bombsa_ram_page==0)
680   else if (offset >= 0x600 && offset <= 0x7ff)   /* Text color */
974681   {
975      return bomba_otherram[ offset ];
682      argus_change_palette(machine, ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
976683   }
977   else
978   {
979      mame_printf_debug("unknown bombsa_paletteram_r %02x %04x\n",bombsa_ram_page,offset);
980      return 0x00;
981   }
684   else if (offset >= 0x240 && offset <= 0x25f)   // dummy
685      argus_change_palette(machine, ((offset & 0x1f) >> 1) + 0xe0, offset & ~1, offset | 1);
686   else if (offset >= 0x500 && offset <= 0x51f)   // dummy
687      argus_change_palette(machine, ((offset & 0x1f) >> 1) + 0xf0, offset & ~1, offset | 1);
982688}
983689
984WRITE8_HANDLER( bombsa_paletteram_w )
690READ8_HANDLER( butasan_bg1ram_r )
985691{
986   if (bombsa_ram_page==1)
987   {
988      argus_paletteram[ offset ] = data;
989      bombsa_change_palette( machine, offset>>1, argus_paletteram[offset | 1] | (argus_paletteram[offset & ~1] << 8));
990   }
991   else if (bombsa_ram_page==0)
992   {
993      bomba_otherram[offset] = data;
994
995      tilemap_mark_tile_dirty(bombsa_bg_tilemap, offset/2);
996   }
997   else
998   {
999      mame_printf_debug("unknown bombsa_paletteram_w %02x %04x %02x\n",bombsa_ram_page,offset, data);
1000   }
692   return butasan_bg1ram[offset];
1001693}
1002694
1003READ8_HANDLER( butasan_txbackram_r )
695WRITE8_HANDLER( butasan_bg1ram_w )
1004696{
1005   return butasan_txbackram[ offset ];
697   int idx;
698
699   butasan_bg1ram[offset] = data;
700
701   idx = (offset & 0x00f) | ((offset & 0x200) >> 5) | ((offset & 0x1f0) << 1);
702   idx ^= 0x0f0;
703
704   tilemap_mark_tile_dirty(bg1_tilemap, idx);
1006705}
1007706
1008WRITE8_HANDLER( butasan_txbackram_w )
707WRITE8_HANDLER( butasan_pageselect_w )
1009708{
1010   if (butasan_txbackram[ offset ] != data)
1011   {
1012      butasan_txbackram[ offset ] = data;
1013   }
709   butasan_page_latch = data & 1;
1014710}
1015711
1016READ8_HANDLER( butasan_bg0backram_r )
712READ8_HANDLER( butasan_pagedram_r )
1017713{
1018   return butasan_bg0backram[ offset ];
714   return butasan_pagedram[butasan_page_latch][offset];
1019715}
1020716
1021WRITE8_HANDLER( butasan_bg0backram_w )
717WRITE8_HANDLER( butasan_pagedram_w )
1022718{
1023   if (butasan_bg0backram[ offset ] != data)
719   butasan_pagedram[butasan_page_latch][offset] = data;
720
721   if (!butasan_page_latch)
1024722   {
1025      butasan_bg0backram[ offset ] = data;
723      if (offset <= 0x07ff)
724      {
725         int idx;
726         idx = ((offset & 0x01e) >> 1) | ((offset & 0x400) >> 6) | (offset & 0x3e0);
727         idx ^= 0x1e0;
728         tilemap_mark_tile_dirty(bg0_tilemap, idx);
729      }
1026730   }
731   else
732   {
733      if (offset <= 0x07ff)
734         tilemap_mark_tile_dirty(tx_tilemap, (offset ^ 0x7c0) >> 1);
735   }
1027736}
1028737
1029WRITE8_HANDLER( butasan_bg1_status_w )
738WRITE8_HANDLER( valtric_unknown_w )
1030739{
1031   if (butasan_bg1_status != data)
1032   {
1033      butasan_bg1_status = data;
740   valtric_unknown = data;
741}
1034742
1035      tilemap_set_enable(bg1_tilemap, butasan_bg1_status & 0x01);   /* Set enable flag */
1036      tilemap_mark_all_tiles_dirty( bg1_tilemap );            /* Bank changed */
1037   }
743WRITE8_HANDLER( butasan_unknown_w )
744{
745   butasan_unknown = data;
1038746}
1039747
1040748
r3289r3290
1042750  Screen refresh
1043751***************************************************************************/
1044752
1045static void argus_bg0_scroll_handle( running_machine *machine )
753static void bg_setting(void)
1046754{
755   tilemap_set_flip(ALL_TILEMAPS, argus_flipscreen ? TILEMAP_FLIPY|TILEMAP_FLIPX : 0);
756
757   if (!argus_flipscreen)
758   {
759      if (bg0_tilemap != NULL)
760      {
761         tilemap_set_scrollx(bg0_tilemap, 0, bg0_scrollx & 0x1ff);
762         tilemap_set_scrolly(bg0_tilemap, 0, bg0_scrolly & 0x1ff);
763      }
764      tilemap_set_scrollx(bg1_tilemap, 0, bg1_scrollx & 0x1ff);
765      tilemap_set_scrolly(bg1_tilemap, 0, bg1_scrolly & 0x1ff);
766   }
767   else
768   {
769      if (bg0_tilemap != NULL)
770      {
771         tilemap_set_scrollx(bg0_tilemap, 0, (bg0_scrollx + 256) & 0x1ff);
772         tilemap_set_scrolly(bg0_tilemap, 0, (bg0_scrolly + 256) & 0x1ff);
773      }
774      tilemap_set_scrollx(bg1_tilemap, 0, (bg1_scrollx + 256) & 0x1ff);
775      tilemap_set_scrolly(bg1_tilemap, 0, (bg1_scrolly + 256) & 0x1ff);
776   }
777}
778
779static void argus_bg0_scroll_handle(running_machine *machine)
780{
1047781   int delta;
1048   int scrollx;
1049782   int dcolumn;
1050783
1051784   /* Deficit between previous and current scroll value */
1052   scrollx = argus_bg0_scrollx[0] | (argus_bg0_scrollx[1] << 8);
1053   delta = scrollx - prvscrollx;
1054   prvscrollx = scrollx;
785   delta = bg0_scrollx - prvscrollx;
786   prvscrollx = bg0_scrollx;
1055787
1056   if ( delta == 0 )
788   if (delta == 0)
1057789      return;
1058790
1059791   if (delta > 0)
r3289r3290
1063795
1064796      if (lowbitscroll >= 16)
1065797      {
1066         dcolumn ++;
798         dcolumn++;
1067799         lowbitscroll -= 16;
1068800      }
1069801
r3289r3290
1072804         int i, j;
1073805         int col, woffs, roffs;
1074806
1075         col = ( (scrollx / 16) + 16 ) % 32;
807         col = ((bg0_scrollx / 16) + 16) % 32;
1076808         woffs = 32 * 2 * col;
1077         roffs = ( ( (scrollx / 16) + 16 ) * 8 ) % 0x8000;
809         roffs = (((bg0_scrollx / 16) + 16) * 8) % 0x8000;
1078810
1079         if ( dcolumn >= 18 )
811         if (dcolumn >= 18)
1080812            dcolumn = 18;
1081813
1082         for ( i = 0 ; i < dcolumn ; i ++ )
814         for (i = 0; i < dcolumn; i++)
1083815         {
1084            for ( j = 0 ; j < 4 ; j ++ )
816            for (j = 0; j < 4; j++)
1085817            {
1086               argus_write_dummy_rams( machine, woffs, roffs );
818               argus_write_dummy_rams(machine, woffs, roffs);
1087819               woffs += 16;
1088820               roffs += 2;
1089821            }
r3289r3290
1103835
1104836      if (lowbitscroll <= 0)
1105837      {
1106         dcolumn ++;
838         dcolumn++;
1107839         lowbitscroll += 16;
1108840      }
1109841
r3289r3290
1112844         int i, j;
1113845         int col, woffs, roffs;
1114846
1115         col = ( (scrollx / 16) + 31 ) % 32;
847         col = ((bg0_scrollx / 16) + 31) % 32;
1116848         woffs = 32 * 2 * col;
1117         roffs = ( (scrollx / 16) - 1 ) * 8;
849         roffs = ((bg0_scrollx / 16) - 1) * 8;
1118850         if (roffs < 0)
1119851            roffs += 0x08000;
1120852
1121853         if (dcolumn >= 18)
1122854            dcolumn = 18;
1123855
1124         for ( i = 0 ; i < dcolumn ; i ++ )
856         for (i = 0; i < dcolumn; i++)
1125857         {
1126            for ( j = 0 ; j < 4 ; j ++ )
858            for (j = 0; j < 4; j++)
1127859            {
1128               argus_write_dummy_rams( machine, woffs, roffs );
860               argus_write_dummy_rams(machine, woffs, roffs);
1129861               woffs += 16;
1130862               roffs += 2;
1131863            }
r3289r3290
1136868         }
1137869      }
1138870   }
1139
1140   if (!argus_flipscreen)
1141      tilemap_set_scrollx(bg0_tilemap, 0, scrollx & 0x1ff);
1142   else
1143      tilemap_set_scrollx(bg0_tilemap, 0, (scrollx + 256) & 0x1ff);
1144
1145871}
1146872
1147873static void argus_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
r3289r3290
1149875   int offs;
1150876
1151877   /* Draw the sprites */
1152   for (offs = 11 ; offs < spriteram_size ; offs += 16)
878   for (offs = 0; offs < spriteram_size; offs += 16)
1153879   {
1154      if ( !(spriteram[offs+4] == 0 && spriteram[offs] == 0xf0) )
880      if (!(spriteram[offs+15] == 0 && spriteram[offs+11] == 0xf0))
1155881      {
1156882         int sx, sy, tile, flipx, flipy, color, pri;
1157883
1158         sx = spriteram[offs + 1];
1159         sy = spriteram[offs];
884         sx = spriteram[offs+12]; if (spriteram[offs+13] & 0x01) sx -= 256;
885         sy = spriteram[offs+11]; if (!(spriteram[offs+13] & 0x02)) sy -= 256;
1160886
887         tile  = spriteram[offs+14] | ((spriteram[offs+13] & 0xc0) << 2);
888         flipx = spriteram[offs+13] & 0x10;
889         flipy = spriteram[offs+13] & 0x20;
890         color = spriteram[offs+15] & 0x07;
891         pri   = (spriteram[offs+15] & 0x08) >> 3;
892
1161893         if (argus_flipscreen)
1162894         {
1163895            sx = 240 - sx;
1164896            sy = 240 - sy;
897            flipx = !flipx;
898            flipy = !flipy;
1165899         }
1166900
1167         if (!argus_flipscreen)
1168         {
1169            if (  spriteram[offs+2] & 0x01)  sx -= 256;
1170            if (!(spriteram[offs+2] & 0x02)) sy -= 256;
1171         }
1172         else
1173         {
1174            if (  spriteram[offs+2] & 0x01)  sx += 256;
1175            if (!(spriteram[offs+2] & 0x02)) sy += 256;
1176         }
1177
1178         tile    = spriteram[offs+3] + ((spriteram[offs+2] & 0xc0) << 2);
1179         flipx    = spriteram[offs+2] & 0x10;
1180         flipy    = spriteram[offs+2] & 0x20;
1181         color    = spriteram[offs+4] & 0x07;
1182         pri      = (spriteram[offs+4] & 0x08) >> 3;
1183
1184         if (argus_flipscreen)
1185         {
1186            flipx ^= 0x10;
1187            flipy ^= 0x20;
1188         }
1189
1190901         if (priority != pri)
1191902            jal_blend_drawgfx(machine,
1192903                     bitmap,machine->gfx[0],
r3289r3290
1195906                     flipx, flipy,
1196907                     sx, sy,
1197908                     cliprect,
1198                     TRANSPARENCY_PEN, 15
1199            );
909                     TRANSPARENCY_PEN, 15);
1200910      }
1201911   }
1202912}
1203913
914#if 1
915static void valtric_draw_mosaic(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect)
916{
917   static int mosaic=0;
918
919   if (valtric_mosaic!=0x80)
920   {
921      mosaic=0x0f-(valtric_mosaic&0x0f);
922      if (mosaic!=0) mosaic++;
923      if (valtric_mosaic&0x80) mosaic*=-1;
924   }
925
926   if (mosaic==0)
927      tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
928   else
929   {
930      tilemap_draw(mosaicbitmap, cliprect, bg1_tilemap, 0, 0);
931      {
932         int step=mosaic;
933         UINT32 *dest;
934         int x,y,xx,yy;
935         int width = video_screen_get_width(screen);
936         int height = video_screen_get_height(screen);
937
938         if (mosaic<0)step*=-1;
939
940         for (y=0;y<width+step;y+=step)
941            for (x=0;x<height+step;x+=step)
942            {
943               static int c=0;
944
945               if (y<height && x< width)
946                  c=*BITMAP_ADDR32(mosaicbitmap, y, x);
947
948               if (mosaic<0)
949                  if (y+step-1<height && x+step-1< width)
950                     c = *BITMAP_ADDR32(mosaicbitmap, y+step-1, x+step-1);
951
952               for (yy=0;yy<step;yy++)
953                  for (xx=0;xx<step;xx++)
954                  {
955                     if (xx+x < width && yy+y<height)
956                     {
957                        dest=BITMAP_ADDR32(bitmap, y+yy, x+xx);
958                        *dest=c;
959                     }
960                  }
961            }
962      }
963   }
964}
965#else
966static void valtric_draw_mosaic(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect)
967{
968   int step = 0x10 - (valtric_mosaic & 0x0f);
969
970   if (step == 1)
971      tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
972   else
973   {
974      tilemap_draw(mosaicbitmap, cliprect, bg1_tilemap, 0, 0);
975      {
976         UINT32 *dest;
977         int x,y,xx,yy;
978         int width = video_screen_get_width(screen);
979         int height = video_screen_get_height(screen);
980
981         for (y = 0; y < width+step; y += step)
982            for (x = 0; x < height+step; x += step)
983            {
984               static int c = 0;
985
986               if (y < height && x < width)
987                  c = *BITMAP_ADDR32(mosaicbitmap, y, x);
988
989               if (valtric_mosaic & 0x80)
990                  if (y+step-1 < height && x+step-1 < width)
991                     c = *BITMAP_ADDR32(mosaicbitmap, y+step-1, x+step-1);
992
993               for (yy = 0; yy < step; yy++)
994                  for (xx = 0; xx < step; xx++)
995                  {
996                     if (xx+x < width && yy+y < height)
997                     {
998                        dest = BITMAP_ADDR32(bitmap, y+yy, x+xx);
999                        *dest = c;
1000                     }
1001                  }
1002            }
1003      }
1004   }
1005}
1006#endif
1007
12041008static void valtric_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
12051009{
12061010   int offs;
12071011
12081012   /* Draw the sprites */
1209   for (offs = 11 ; offs < spriteram_size ; offs += 16)
1013   for (offs = 0; offs < spriteram_size; offs += 16)
12101014   {
1211      if ( !(spriteram[offs+4] == 0 && spriteram[offs] == 0xf0) )
1015      if (!(spriteram[offs+15] == 0 && spriteram[offs+11] == 0xf0))
12121016      {
12131017         int sx, sy, tile, flipx, flipy, color;
12141018
1215         sx = spriteram[offs + 1];
1216         sy = spriteram[offs];
1019         sx = spriteram[offs+12]; if (spriteram[offs+13] & 0x01) sx -= 256;
1020         sy = spriteram[offs+11]; if (!(spriteram[offs+13] & 0x02)) sy -= 256;
12171021
1022         tile  = spriteram[offs+14] | ((spriteram[offs+13] & 0xc0) << 2);
1023         flipx = spriteram[offs+13] & 0x10;
1024         flipy = spriteram[offs+13] & 0x20;
1025         color = spriteram[offs+15] & 0x0f;
1026
12181027         if (argus_flipscreen)
12191028         {
12201029            sx = 240 - sx;
12211030            sy = 240 - sy;
1031            flipx = !flipx;
1032            flipy = !flipy;
12221033         }
12231034
1224         if (!argus_flipscreen)
1225         {
1226            if (  spriteram[offs+2] & 0x01)  sx -= 256;
1227            if (!(spriteram[offs+2] & 0x02)) sy -= 256;
1228         }
1229         else
1230         {
1231            if (  spriteram[offs+2] & 0x01)  sx += 256;
1232            if (!(spriteram[offs+2] & 0x02)) sy += 256;
1233         }
1234
1235         tile    = spriteram[offs+3] + ((spriteram[offs+2] & 0xc0) << 2);
1236         flipx    = spriteram[offs+2] & 0x10;
1237         flipy    = spriteram[offs+2] & 0x20;
1238         color    = spriteram[offs+4] & 0x0f;
1239
1240         if (argus_flipscreen)
1241         {
1242            flipx ^= 0x10;
1243            flipy ^= 0x20;
1244         }
1245
12461035         jal_blend_drawgfx(machine,
12471036                  bitmap,machine->gfx[0],
12481037                  tile,
r3289r3290
12601049   int offs;
12611050
12621051   /* Draw the sprites */
1263   for (offs = 8 ; offs < spriteram_size ; offs += 16)
1052   for (offs = 0; offs < spriteram_size; offs += 16)
12641053   {
12651054      int sx, sy, tile, flipx, flipy, color;
1055      int fx, fy;
12661056
1267      sx = spriteram[offs + 2];
1268      sy = 240 - spriteram[offs + 4];
1057      tile  = spriteram[offs+14] | ((spriteram[offs+15] & 0x0f) << 8);
1058      flipx = spriteram[offs+8] & 0x01;
1059      flipy = spriteram[offs+8] & 0x04;
1060      color = spriteram[offs+9] & 0x0f;
12691061
1270      if (spriteram[offs + 3] & 0x01) sx -= 256;
1271      if (spriteram[offs + 5] & 0x01) sy += 256;
1062      sx = spriteram[offs+10];
1063      sy = spriteram[offs+12];
12721064
1273      tile    = spriteram[offs + 6] + ((spriteram[offs + 7] & 0x0f) << 8);
1274      flipx    = spriteram[offs + 0] & 0x01;
1275      flipy    = spriteram[offs + 0] & 0x04;
1276      color    = spriteram[offs + 1] & 0x0f;
1065      if (spriteram[offs+11] & 0x01) sx-=256;
1066      if (spriteram[offs+13] & 0x01) sy-=256;
12771067
1278      if (!argus_flipscreen)
1279      {
1280         if ( (offs >= 0x100 && offs < 0x300) || (offs >= 0x400 && offs < 0x580) )
1281         {
1282            jal_blend_drawgfx(machine,
1283                     bitmap,machine->gfx[0],
1284                     tile,
1285                     color,
1286                     flipx, flipy,
1287                     sx, sy,
1288                     cliprect,
1289                     TRANSPARENCY_PEN, 7);
1290         }
1291         else if ( (offs >= 0x000 && offs < 0x100) || (offs >= 0x300 && offs < 0x400) )
1292         {
1293            int i;
1068      sy = 240 - sy;
12941069
1295            for ( i = 0 ; i <= 1 ; i ++ )
1296            {
1297               int td;
1070      fx = flipx;
1071      fy = flipy;
12981072
1299               td = (flipx) ? (1 - i) : i;
1300
1301               jal_blend_drawgfx(machine,
1302                        bitmap,machine->gfx[0],
1303                        tile + td,
1304                        color,
1305                        flipx, flipy,
1306                        sx + i * 16, sy,
1307                        cliprect,
1308                        TRANSPARENCY_PEN, 7);
1309            }
1310         }
1311         else if ( offs >= 0x580 && offs < 0x620 )
1312         {
1313            int i, j;
1314
1315            for ( i = 0 ; i <= 1 ; i ++ )
1316            {
1317               for ( j = 0 ; j <= 1 ; j ++ )
1318               {
1319                  int td;
1320
1321                  if ( !flipy )
1322                     td = (flipx) ? (i * 2) + 1 - j : i * 2 + j;
1323                  else
1324                     td = (flipx) ? ( (1 - i) * 2 ) + 1 - j : (1 - i) * 2 + j;
1325
1326                  jal_blend_drawgfx(machine,
1327                           bitmap,machine->gfx[0],
1328                           tile + td,
1329                           color,
1330                           flipx, flipy,
1331                           sx + j * 16, sy - i * 16,
1332                           cliprect,
1333                           TRANSPARENCY_PEN, 7);
1334               }
1335            }
1336         }
1337         else if ( offs >= 0x620 && offs < 0x680 )
1338         {
1339            int i, j;
1340
1341            for ( i = 0 ; i <= 3 ; i ++ )
1342            {
1343               for ( j = 0 ; j <= 3 ; j ++ )
1344               {
1345                  int td;
1346
1347                  if ( !flipy )
1348                     td = (flipx) ? (i * 4) + 3 - j : i * 4 + j;
1349                  else
1350                     td = (flipx) ? ( (3 - i) * 4 ) + 3 - j : (3 - i) * 4 + j;
1351
1352                  jal_blend_drawgfx(machine,
1353                           bitmap,machine->gfx[0],
1354                           tile + td,
1355                           color,
1356                           flipx, flipy,
1357                           sx + j * 16, sy - i * 16,
1358                           cliprect,
1359                           TRANSPARENCY_PEN, 7);
1360               }
1361            }
1362         }
1363      }
1364      else
1073      if (argus_flipscreen)
13651074      {
13661075         sx = 240 - sx;
13671076         sy = 240 - sy;
1368         flipx ^= 0x01;
1369         flipy ^= 0x04;
1077         flipx = !flipx;
1078         flipy = !flipy;
1079      }
13701080
1371         if ( (offs >= 0x100 && offs < 0x300) || (offs >= 0x400 && offs < 0x580) )
1081      {
1082         int i, j, td;
1083
1084         if ((offs >= 0x100 && offs <= 0x2ff) || (offs >= 0x400 && offs <= 0x57f))
13721085         {
13731086            jal_blend_drawgfx(machine,
13741087                     bitmap,machine->gfx[0],
r3289r3290
13791092                     cliprect,
13801093                     TRANSPARENCY_PEN, 7);
13811094         }
1382         else if ( (offs >= 0x000 && offs < 0x100) || (offs >= 0x300 && offs < 0x400) )
1095         else if ((offs >= 0x000 && offs <= 0x0ff) || (offs >= 0x300 && offs <= 0x3ff))
13831096         {
1384            int i;
1385
1386            for ( i = 0 ; i <= 1 ; i ++ )
1097            for (i = 0; i <= 1; i++)
13871098            {
1388               int td;
1099               td = (fx) ? (1 - i) : i;
13891100
1390               td = (flipx) ? i : (1 - i);
1391
13921101               jal_blend_drawgfx(machine,
13931102                        bitmap,machine->gfx[0],
13941103                        tile + td,
13951104                        color,
13961105                        flipx, flipy,
1397                        sx - i * 16, sy,
1106                        sx + i * 16, sy,
13981107                        cliprect,
13991108                        TRANSPARENCY_PEN, 7);
14001109            }
14011110         }
1402         else if ( offs >= 0x580 && offs < 0x620 )
1111         else if (offs >= 0x580 && offs <= 0x61f)
14031112         {
1404            int i, j;
1405
1406            for ( i = 0 ; i <= 1 ; i ++ )
1113            for (i = 0; i <= 1; i++)
14071114            {
1408               for ( j = 0 ; j <= 1 ; j ++ )
1115               for (j = 0; j <= 1; j++)
14091116               {
1410                  int td;
1411
1412                  if ( !flipy )
1413                     td = (flipx) ? (1 - i) * 2 + j : ( (1 - i) * 2 ) + 1 - j;
1117                  if (fy)
1118                     td = (fx) ? ((1 - i) * 2) + 1 - j : (1 - i) * 2 + j;
14141119                  else
1415                     td = (flipx) ? i * 2 + j : (i * 2) + 1 - j;
1120                     td = (fx) ? (i * 2) + 1 - j : i * 2 + j;
14161121
14171122                  jal_blend_drawgfx(machine,
14181123                           bitmap,machine->gfx[0],
14191124                           tile + td,
14201125                           color,
14211126                           flipx, flipy,
1422                           sx - j * 16, sy + i * 16,
1127                           sx + j * 16, sy - i * 16,
14231128                           cliprect,
14241129                           TRANSPARENCY_PEN, 7);
14251130               }
14261131            }
14271132         }
1428         else if ( offs >= 0x620 && offs < 0x680 )
1133         else if (offs >= 0x620 && offs <= 0x67f)
14291134         {
1430            int i, j;
1431
1432            for ( i = 0 ; i <= 3 ; i ++ )
1135            for (i = 0; i <= 3; i++)
14331136            {
1434               for ( j = 0 ; j <= 3 ; j ++ )
1137               for (j = 0; j <= 3; j++)
14351138               {
1436                  int td;
1437
1438                  if ( !flipy )
1439                     td = (flipx) ? (3 - i) * 4 + j : ( (3 - i) * 4 ) + 3 - j;
1139                  if (fy)
1140                     td = (fx) ? ((3 - i) * 4) + 3 - j : (3 - i) * 4 + j;
14401141                  else
1441                     td = (flipx) ? i * 4 + j : (i * 4) + 3 - j;
1142                     td = (fx) ? (i * 4) + 3 - j : i * 4 + j;
14421143
14431144                  jal_blend_drawgfx(machine,
14441145                           bitmap,machine->gfx[0],
14451146                           tile + td,
14461147                           color,
14471148                           flipx, flipy,
1448                           sx - j * 16, sy + i * 16,
1149                           sx + j * 16, sy - i * 16,
14491150                           cliprect,
14501151                           TRANSPARENCY_PEN, 7);
14511152               }
r3289r3290
14611162{
14621163   int offs;
14631164
1464   if ( input_code_pressed(KEYCODE_M) )
1165   if (input_code_pressed(KEYCODE_M))
14651166   {
14661167      int i;
14671168      logerror("\nSprite RAM\n");
14681169      logerror("---------------------------------------\n");
14691170      logerror("       +0 +1 +2 +3 +4 +5 +6 +7  +8 +9 +a +b +c +d +e +f\n");
1470      for (offs = 0 ; offs < spriteram_size ; offs += 16)
1171      for (offs = 0; offs < spriteram_size; offs += 16)
14711172      {
1472         for (i = 0 ; i < 16 ; i ++)
1173         for (i = 0; i < 16; i++)
14731174         {
14741175            if (i == 0)
14751176            {
r3289r3290
14871188      logerror("\nColor RAM\n");
14881189      logerror("---------------------------------------\n");
14891190      logerror("       +0 +1 +2 +3 +4 +5 +6 +7  +8 +9 +a +b +c +d +e +f\n");
1490      for (offs = 0 ; offs < 0xbf0 ; offs += 16)
1191      for (offs = 0; offs < 0xbf0; offs += 16)
14911192      {
1492         for (i = 0 ; i < 16 ; i ++)
1193         for (i = 0; i < 16; i++)
14931194         {
14941195            if (i == 0)
14951196            {
r3289r3290
15081209}
15091210#endif
15101211
1511static void bombsa_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
1512{
1513   int offs;
1514
1515   /* Draw the sprites */
1516   for (offs = 11 ; offs < spriteram_size ; offs += 16)
1517   {
1518      if ( !(spriteram[offs+4] == 0 && spriteram[offs] == 0xf0) )
1519      {
1520         int sx, sy, tile, flipx, flipy, color, size;
1521
1522         sx = spriteram[offs + 1];
1523         sy = spriteram[offs];
1524
1525         if (spriteram[offs+2] & 0x01)  sx += 256;
1526         if (spriteram[offs+2] & 0x02)  sy += 256;
1527
1528
1529         tile    = spriteram[offs+3] + ((spriteram[offs+2] & 0xc0) << 2);
1530         flipx    = spriteram[offs+2] & 0x10;
1531         flipy    = spriteram[offs+2] & 0x20;
1532         color    = spriteram[offs+4] & 0x0f;
1533         size     = spriteram[offs+2] & 0x08;
1534
1535         if(!size)
1536         {
1537            drawgfx(bitmap,machine->gfx[0],tile,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15);
1538         }
1539         else
1540         {
1541            if (!flipy && !flipx)
1542            {
1543               drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15);
1544               drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15);
1545               drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15);
1546               drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15);
1547            }
1548            else if (!flipy && flipx)
1549            {
1550               drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15);
1551               drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15);
1552               drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15);
1553               drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15);
1554            }
1555            else if (flipy && !flipx)
1556            {
1557               drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15);
1558               drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15);
1559               drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15);
1560               drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15);
1561            }
1562            else if (flipy && flipx)
1563            {
1564               drawgfx(bitmap,machine->gfx[0],tile+0,color,flipx,flipy,sx+16,sy+16,cliprect,TRANSPARENCY_PEN,15);
1565               drawgfx(bitmap,machine->gfx[0],tile+1,color,flipx,flipy,sx+16,sy,cliprect,TRANSPARENCY_PEN,15);
1566               drawgfx(bitmap,machine->gfx[0],tile+2,color,flipx,flipy,sx,sy+16,cliprect,TRANSPARENCY_PEN,15);
1567               drawgfx(bitmap,machine->gfx[0],tile+3,color,flipx,flipy,sx,sy,cliprect,TRANSPARENCY_PEN,15);
1568            }
1569         }
1570      }
1571   }
1572}
1573
15741212VIDEO_UPDATE( argus )
15751213{
1214   bg_setting();
1215
15761216   /* scroll BG0 and render tile at proper position */
15771217   argus_bg0_scroll_handle(screen->machine);
15781218
1579   fillbitmap(bitmap, screen->machine->pens[0], cliprect);
1580
15811219   tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0);
15821220   argus_draw_sprites(screen->machine, bitmap, cliprect, 0);
1583   tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
1221   if (argus_bg_status & 1)   /* Backgound enable */
1222      tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
15841223   argus_draw_sprites(screen->machine, bitmap, cliprect, 1);
15851224   tilemap_draw(bitmap, cliprect, tx_tilemap,  0, 0);
15861225   return 0;
r3289r3290
15881227
15891228VIDEO_UPDATE( valtric )
15901229{
1591   fillbitmap(bitmap, screen->machine->pens[0], cliprect);
1230   bg_setting();
15921231
1593   if(valtric_mosaic==0)
1594      tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
1232   if (argus_bg_status & 1)   /* Backgound enable */
1233      valtric_draw_mosaic(screen, bitmap, cliprect);
15951234   else
1596   {
1597      tilemap_draw(mosaicbitmap, cliprect, bg1_tilemap, 0, 0);
1598      {
1599         int step=valtric_mosaic;
1600         UINT32 *dest;
1601         int x,y,xx,yy;
1602         int width = video_screen_get_width(screen);
1603         int height = video_screen_get_height(screen);
1604
1605         if(valtric_mosaic<0)step*=-1;
1606
1607         for(y=0;y<width+step;y+=step)
1608            for(x=0;x<height+step;x+=step)
1609            {
1610               static int c=0;
1611
1612               if(y<height && x< width)
1613                  c=*BITMAP_ADDR32(mosaicbitmap, y, x);
1614
1615               if(valtric_mosaic<0)
1616                  if(y+step-1<height && x+step-1< width)
1617                     c = *BITMAP_ADDR32(mosaicbitmap, y+step-1, x+step-1);
1618
1619               for(yy=0;yy<step;yy++)
1620                for(xx=0;xx<step;xx++)
1621                {
1622                     if(xx+x < width && yy+y<height)
1623                     {
1624                         dest=BITMAP_ADDR32(bitmap, y+yy, x+xx);
1625                        *dest=c;
1626                     }
1627                }
1628            }
1629       }
1630   }
1631
1235      fillbitmap(bitmap, get_black_pen(screen->machine), cliprect);
16321236   valtric_draw_sprites(screen->machine, bitmap, cliprect);
16331237   tilemap_draw(bitmap, cliprect, tx_tilemap,  0, 0);
16341238   return 0;
r3289r3290
16361240
16371241VIDEO_UPDATE( butasan )
16381242{
1639   fillbitmap(bitmap, screen->machine->pens[0], cliprect);
1243   bg_setting();
16401244
1641   tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
1642   tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0);
1245   if (argus_bg_status & 1)   /* Backgound enable */
1246      tilemap_draw(bitmap, cliprect, bg0_tilemap, 0, 0);
1247   else
1248      fillbitmap(bitmap, get_black_pen(screen->machine), cliprect);
1249   if (butasan_bg1_status & 1) tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
16431250   butasan_draw_sprites(screen->machine, bitmap, cliprect);
16441251   tilemap_draw(bitmap, cliprect, tx_tilemap,  0, 0);
16451252
r3289r3290
16481255#endif
16491256   return 0;
16501257}
1651
1652
1653VIDEO_UPDATE( bombsa )
1654{
1655   fillbitmap(bitmap, screen->machine->pens[0], cliprect);
1656
1657//  tilemap_draw(bitmap, cliprect, bg1_tilemap, 0, 0);
1658//  valtric_draw_sprites(screen->bitmap, cliprect);
1659   tilemap_draw(bitmap, cliprect, bombsa_bg_tilemap,  0, 0);
1660
1661#if 0
1662   tilemap_draw(bitmap, cliprect, tx_alt_tilemap,  0, 0);
1663#endif
1664   tilemap_draw(bitmap, cliprect, tx_tilemap,  0, 0);
1665   bombsa_draw_sprites(screen->machine, bitmap,cliprect);
1666   return 0;
1667}
src/mame/video/cps1.c
r3289r3290
12581258   {"3wonders", CPS_B_21_BT1, mapper_RT24B },
12591259   {"3wonderu", CPS_B_21_BT1, mapper_RT24B },
12601260   {"wonder3",  CPS_B_21_BT1, mapper_RT22B },   // equivalent to RT24B
1261   {"3wonderh", CPS_B_02    , mapper_RT24B },   /* Not 100% sure of the CPS B-ID */
12611262   {"kod",      CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },
12621263   {"kodu",     CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },
12631264   {"kodj",     CPS_B_21_BT2, mapper_KD29B,  0x36, 0, 0x34 },
src/mame/video/namconb1.c
r3289r3290
102102   }
103103} /* namconb1_install_palette */
104104
105/**
106 * MCU simulation.  It manages coinage, input ports, and presumably
107 * communication with the sound CPU.
108 */
109105static void
110handle_mcu( running_machine *machine )
111{
112   static int toggle;
113   static UINT16 credits;
114   static int old_coin_state;
115   static UINT16 old_p1;
116   static UINT16 old_p2;
117   static UINT16 old_p3;
118   static UINT16 old_p4;
119   int new_coin_state = input_port_read(machine, "COIN") & 0x3;   /* coin1,2 */
120   UINT16 dsw = input_port_read(machine, "DSW");
121   UINT16 p1 = input_port_read(machine, "P1");
122   UINT16 p2 = input_port_read(machine, "P2");
123   UINT16 p3;
124   UINT16 p4;
125
126   toggle = !toggle;
127   if(toggle)
128      dsw &= ~0x80;
129
130   if(cpunum_is_suspended(1, SUSPEND_REASON_HALT))
131      return;
132
133   if( namcos2_gametype == NAMCONB2_MACH_BREAKERS )
134   {
135      p3 = input_port_read_safe(machine, "P3", 0);
136      p4 = input_port_read_safe(machine, "P4", 0);
137   }
138   else
139   {
140      p3 = 0;
141      p4 = 0;
142   }
143
144   p1 = (p1&(~old_p1))|(p1<<8);
145   p2 = (p2&(~old_p2))|(p2<<8);
146   p3 = (p3&(~old_p3))|(p3<<8);
147   p4 = (p4&(~old_p4))|(p4<<8);
148
149   old_p1 = p1;
150   old_p2 = p2;
151   old_p3 = p3;
152   old_p4 = p4;
153
154   namcoc7x_soundram16_w(machine, 0x6000/2, dsw, 0xffff);
155   namcoc7x_soundram16_w(machine, 0x6002/2, p1, 0xffff);
156   namcoc7x_soundram16_w(machine, 0x6004/2, p2, 0xffff);
157   namcoc7x_soundram16_w(machine, 0x6006/2, p3, 0xffff);
158   namcoc7x_soundram16_w(machine, 0x6008/2, p4, 0xffff);
159
160   if( new_coin_state && !old_coin_state )
161   {
162      credits++;
163   }
164   old_coin_state = new_coin_state;
165    namcoc7x_soundram16_w(machine, 0x601e/2, credits, 0xffff);
166} /* handle_mcu */
167
168static void
169106video_update_common(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bROZ )
170107{
171108   int pri;
172   handle_mcu(machine);
173109   namconb1_install_palette(machine);
174110
175111   if( bROZ )
src/mame/video/jalblend.c
r3289r3290
1111
1212****************************************************************************/
1313
14#include "driver.h"
15#include "jalblend.h"
1416
17
1518/* each palette entry contains a fourth 'alpha' value */
16static UINT8 *jal_blend_table;
19UINT8 *jal_blend_table;
1720
1821/*
1922 * 'Alpha' Format
r3289r3290
2124 *
2225 * Bytes     | Use
2326 * -76543210-+----------------
24 *  xxxx---- | unknown - maybe special background?
25 *  ----x--- | unknown - same as above
27 *  ----x--- | blend enable flag (?)
2628 *  -----x-- | red add/subtract
2729 *  ------x- | green add/subtract
2830 *  -------x | blue add/subtract
2931 */
3032
3133/* basically an add/subtract function with clamping */
32static rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha)
34rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha)
3335{
34   int r  = (float)RGB_RED  (addMe) ;
35   int g  = (float)RGB_GREEN(addMe) ;
36   int b  = (float)RGB_BLUE (addMe) ;
36   int r, g, b;
37   int ir, ig, ib;
3738
38   int rd = (float)RGB_RED  (dest) ;
39   int gd = (float)RGB_GREEN(dest) ;
40   int bd = (float)RGB_BLUE (dest) ;
39   r = (int)RGB_RED  (dest);
40   g = (int)RGB_GREEN(dest);
41   b = (int)RGB_BLUE (dest);
4142
42   int finalR, finalG, finalB ;
43   ir = (int)RGB_RED  (addMe);
44   ig = (int)RGB_GREEN(addMe);
45   ib = (int)RGB_BLUE (addMe);
4346
44   int subR = (alpha & 0x04) >> 2 ;
45   int subG = (alpha & 0x02) >> 1 ;
46   int subB = (alpha & 0x01) ;
47   if (alpha & 4)
48      { r -= ir; if (r < 0) r = 0; }
49   else
50      { r += ir; if (r > 255) r = 255; }
51   if (alpha & 2)
52      { g -= ig; if (g < 0) g = 0; }
53   else
54      { g += ig; if (g > 255) g = 255; }
55   if (alpha & 1)
56      { b -= ib; if (b < 0) b = 0; }
57   else
58      { b += ib; if (b > 255) b = 255; }
4759
48   if (subR) finalR = rd - r ;
49   else      finalR = rd + r ;
50   if (finalR < 0) finalR = 0 ;
51   else if (finalR > 255) finalR = 255 ;
52
53
54   if (subG) finalG = gd - g ;
55   else      finalG = gd + g ;
56   if (finalG < 0) finalG = 0 ;
57   else if (finalG > 255) finalG = 255 ;
58
59
60   if (subB) finalB = bd - b ;
61   else      finalB = bd + b ;
62   if (finalB < 0) finalB = 0 ;
63   else if (finalB > 255) finalB = 255 ;
64
65   return MAKE_RGB((UINT8)finalR,(UINT8)finalG,(UINT8)finalB) ;
60   return MAKE_RGB(r,g,b);
6661}
6762
68static void jal_blend_drawgfx( running_machine *machine, bitmap_t *dest_bmp,const gfx_element *gfx,
69                        UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
70                        const rectangle *clip,int transparency,int transparent_color)
63void jal_blend_drawgfx(running_machine *machine,bitmap_t *dest_bmp,const gfx_element *gfx,
64                     UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
65                     const rectangle *clip,int transparency,int transparent_color)
7166{
72   /* drawgfx(dest_bmp, gfx, code, color, flipx, flipy, offsx, offsy, clip, TRANSPARENCY_PEN, 15); */
67   if (jal_blend_table == NULL)
68   {
69      drawgfx(dest_bmp,gfx,code,color,flipx,flipy,offsx,offsy,clip,transparency,transparent_color);
70      return;
71   }
7372
74   int xstart, ystart, xend, yend, xinc, yinc;
75   int xtile, ytile ;
76   int code_offset = 0;
77
78   int wide = 1 ;
79   int high = 1 ;
80
81   if (flipx)   { xstart = wide-1; xend = -1;   xinc = -1; }
82   else      { xstart = 0;      xend = wide; xinc = +1; }
83
84   if (flipy)   { ystart = high-1; yend = -1;   yinc = -1; }
85   else      { ystart = 0;      yend = high; yinc = +1; }
86
8773   /* Start drawing */
88   if( gfx )
74   if (gfx)
8975   {
90      for (ytile = ystart; ytile != yend; ytile += yinc )
91      {
92         for (xtile = xstart; xtile != xend; xtile += xinc )
93         {
94            const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
95            const UINT8 *alpha = &jal_blend_table[gfx->color_granularity * (color % gfx->total_colors)];
96            int source_base = ((code + code_offset++) % gfx->total_elements) * gfx->height;
76      const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
77      const UINT8 *alpha = &jal_blend_table[gfx->color_granularity * (color % gfx->total_colors)];
78      UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
79      int x_index_base, y_index, sx, sy, ex, ey;
80      int xinc, yinc;
9781
98            int x_index_base, y_index, sx, sy, ex, ey;
82      xinc = flipx ? -1 : 1;
83      yinc = flipy ? -1 : 1;
9984
100            if (flipx)   { x_index_base = gfx->width-1; }
101            else      { x_index_base = 0; }
85      x_index_base = flipx ? gfx->width-1 : 0;
86      y_index = flipy ? gfx->height-1 : 0;
10287
103            if (flipy)   { y_index = gfx->height-1; }
104            else      { y_index = 0; }
88      /* start coordinates */
89      sx = offsx;
90      sy = offsy;
10591
106            /* start coordinates */
107            sx = offsx + xtile*gfx->width;
108            sy = offsy + ytile*gfx->height;
92      /* end coordinates */
93      ex = sx + gfx->width;
94      ey = sy + gfx->height;
10995
110            /* end coordinates */
111            ex = sx + gfx->width;
112            ey = sy + gfx->height;
96      if (clip)
97      {
98         if (sx < clip->min_x)
99         { /* clip left */
100            int pixels = clip->min_x-sx;
101            sx += pixels;
102            x_index_base += xinc*pixels;
103         }
104         if (sy < clip->min_y)
105         { /* clip top */
106            int pixels = clip->min_y-sy;
107            sy += pixels;
108            y_index += yinc*pixels;
109         }
110         /* NS 980211 - fixed incorrect clipping */
111         if (ex > clip->max_x+1)
112         { /* clip right */
113            ex = clip->max_x+1;
114         }
115         if (ey > clip->max_y+1)
116         { /* clip bottom */
117            ey = clip->max_y+1;
118         }
119      }
113120
114            if( clip )
121      if (ex > sx)
122      { /* skip if inner loop doesn't draw anything */
123         int x, y;
124
125         /* 32-bit destination bitmap */
126         if (dest_bmp->bpp == 32)
127         {
128            /* taken from case 7: TRANSPARENCY_ALPHARANGE */
129            for (y = sy; y < ey; y++)
115130            {
116               if( sx < clip->min_x)
117               { /* clip left */
118                  int pixels = clip->min_x-sx;
119                  sx += pixels;
120                  x_index_base += xinc*pixels;
131               UINT8 *source = source_base + y_index*gfx->line_modulo;
132               UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
133               int x_index = x_index_base;
134               for (x = sx; x < ex; x++)
135               {
136                  int c = source[x_index];
137                  if (c != transparent_color)
138                  {
139                     if (alpha[c] & 8)
140                     {
141                        /* Comp with clamp */
142                        dest[x] = jal_blend_func(dest[x], pal[c], alpha[c]);
143                     }
144                     else
145                     {
146                        /* Skip the costly alpha step altogether */
147                        dest[x] = pal[c];
148                     }
149                  }
150                  x_index += xinc;
121151               }
122               if( sy < clip->min_y )
123               { /* clip top */
124                  int pixels = clip->min_y-sy;
125                  sy += pixels;
126                  y_index += yinc*pixels;
127               }
128               /* NS 980211 - fixed incorrect clipping */
129               if( ex > clip->max_x+1 )
130               { /* clip right */
131                  int pixels = ex-clip->max_x-1;
132                  ex -= pixels;
133               }
134               if( ey > clip->max_y+1 )
135               { /* clip bottom */
136                  int pixels = ey-clip->max_y-1;
137                  ey -= pixels;
138               }
152               y_index += yinc;
139153            }
154         }
140155
141            if( ex>sx )
142            { /* skip if inner loop doesn't draw anything */
143               int y;
144
145               /* taken from case 7: TRANSPARENCY_ALPHARANGE */
146               UINT8 *source = gfx->gfxdata + (source_base + y_index)*gfx->line_modulo + x_index_base;
147               UINT32 *dest = (UINT32 *)dest_bmp->base + sy*dest_bmp->rowpixels + sx;
148               int src_modulo = yinc*gfx->line_modulo - xinc*(ex-sx);
149               int dst_modulo = dest_bmp->rowpixels - (ex-sx);
150
151               for( y=sy; y<ey; y++ )
156         /* 16-bit destination bitmap */
157         else
158         {
159            /* taken from case 7: TRANSPARENCY_ALPHARANGE */
160            for (y = sy; y < ey; y++)
161            {
162               UINT8 *source = source_base + y_index*gfx->line_modulo;
163               UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
164               int x_index = x_index_base;
165               for (x = sx; x < ex; x++)
152166               {
153                  int x;
154                  for( x=sx; x<ex; x++ )
167                  int c = source[x_index];
168                  if (c != transparent_color)
155169                  {
156                     int c = *source;
157                     if( c != transparent_color )
170                     if (alpha[c] & 8)
158171                     {
159                        if( alpha[c] == 0x00 )
160                        {
161                           /* Skip the costly alpha step altogether */
162                           *dest = pal[c];
163                        }
164                        else
165                        {
166                           /* Comp with clamp */
167                           *dest = jal_blend_func(*dest, pal[c], alpha[c]) ;
168                        }
172                        /* Comp with clamp */
173                        dest[x] = jal_blend_func(dest[x], pal[c], alpha[c]);
169174                     }
170                     dest++;
171                     source += xinc;
175                     else
176                     {
177                        /* Skip the costly alpha step altogether */
178                        dest[x] = pal[c];
179                     }
172180                  }
173                  dest += dst_modulo;
174                  source += src_modulo;
181                  x_index += xinc;
175182               }
183               y_index += yinc;
176184            }
177185         }
178186      }
src/mame/video/jalblend.h
r0r3290
1extern UINT8 *jal_blend_table;
2rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha);
3void jal_blend_drawgfx(running_machine *machine,bitmap_t *dest_bmp,const gfx_element *gfx,
4                     UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
5                     const rectangle *clip,int transparency,int transparent_color);
src/mame/video/psychic5.c
r3289r3290
11/***************************************************************************
22  Psychic 5
3  Bombs Away
34
45  Functions to emulate the video hardware of the machine.
56
67***************************************************************************/
78
89#include "driver.h"
9#include "jalblend.c"
10#include "jalblend.h"
1011
1112#define   BG_SCROLLX_LSB      0x308
1213#define   BG_SCROLLX_MSB      0x309
r3289r3290
1617#define   BG_PAL_INTENSITY_RG   0x1fe
1718#define   BG_PAL_INTENSITY_BU   0x1ff
1819
19static int ps5_vram_page;
20static int bg_clip_mode;
21static int title_screen;
20static UINT8 ps5_vram_page;
21static UINT8 bg_clip_mode;
22static UINT8 title_screen;
23static UINT8 psychic5_bg_status;
2224
25static UINT8 *ps5_pagedram[2];
26
2327/* Paged RAM 0 */
2428static UINT8 *psychic5_bg_videoram;
2529static UINT8 *ps5_dummy_bg_ram;
r3289r3290
3135
3236static tilemap *bg_tilemap, *fg_tilemap;
3337
34MACHINE_RESET( psychic5 )
35{
36   bg_clip_mode = -10;
37   flip_screen_set(0);
38}
38static int bg_palette_ram_base;
39static int bg_palette_base;
3940
40WRITE8_HANDLER( psychic5_vram_page_select_w )
41{
42   ps5_vram_page = data;
43}
41static UINT16 palette_intensity;
4442
45READ8_HANDLER( psychic5_vram_page_select_r )
46{
47   return ps5_vram_page;
48}
43static UINT8 bombsa_unknown;
4944
50WRITE8_HANDLER( psychic5_title_screen_w )
45
46/***************************************************************************
47  Palette color
48***************************************************************************/
49
50static void psychic5_change_palette(running_machine *machine, int color, int offset)
5151{
52   title_screen = data & 0x01;
52   UINT8 lo = ps5_palette_ram[offset & ~1];
53   UINT8 hi = ps5_palette_ram[offset | 1];
54   if (jal_blend_table != NULL) jal_blend_table[color] = hi & 0x0f;
55   palette_set_color_rgb(machine, color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4));
5356}
5457
55static void psychic5_paletteram_w(running_machine *machine, int color_offs, int offset, int data)
58static void psychic5_change_bg_palette(running_machine *machine, int color, int lo_offs, int hi_offs)
5659{
57   int r,g,b,a,val;
60   UINT8 r,g,b,lo,hi,ir,ig,ib,ix;
61   rgb_t irgb;
5862
59   ps5_palette_ram[offset] = data;
63   /* red,green,blue intensities */
64   ir = pal4bit(palette_intensity >> 12);
65   ig = pal4bit(palette_intensity >>  8);
66   ib = pal4bit(palette_intensity >>  4);
67   ix = palette_intensity & 0x0f;
6068
61   /* red component */
62   r  = (ps5_palette_ram[offset & ~1] >> 4) & 0x0f ;
69   irgb = MAKE_RGB(ir,ig,ib);
6370
64   /* green component */
65   g  = (ps5_palette_ram[offset & ~1]) & 0x0f ;
71   lo = ps5_palette_ram[lo_offs];
72   hi = ps5_palette_ram[hi_offs];
6673
67   /* blue component */
68   b  = (ps5_palette_ram[offset | 1] >> 4) & 0x0f ;
74   /* red,green,blue component */
75   r = pal4bit(lo >> 4);
76   g = pal4bit(lo);
77   b = pal4bit(hi >> 4);
6978
70   /* "alpha" component */
71   val  = (ps5_palette_ram[offset | 1] & 0x0f) & 0x0f ;
72   a = (val << 4) | val ;
73
74   jal_blend_table[(offset / 2)-color_offs] = a ;
75
76   palette_set_color_rgb(machine,(offset / 2)-color_offs,pal4bit(r),pal4bit(g),pal4bit(b));
79   /* Grey background enable */
80   if (psychic5_bg_status & 2)
81   {
82      UINT8 val = (r + g + b) / 3;      /* Grey */
83      /* Just leave plain grey */
84      palette_set_color(machine,color,jal_blend_func(MAKE_RGB(val,val,val),irgb,ix));
85   }
86   else
87   {
88      /* Seems fishy, but the title screen would be black otherwise... */
89      if (!(title_screen & 1))
90      {
91         /* Leave the world as-is */
92         palette_set_color(machine,color,jal_blend_func(MAKE_RGB(r,g,b),irgb,ix));
93      }
94   }
7795}
7896
7997static void set_background_palette_intensity(running_machine *machine)
8098{
81   int i,r,g,b,val,lo,hi,ir,ig,ib,ix;
99   int i;
100   palette_intensity = ps5_palette_ram[BG_PAL_INTENSITY_BU] |
101                  (ps5_palette_ram[BG_PAL_INTENSITY_RG]<<8);
82102
83   /* red,green,blue intensites */
84   ir = ps5_palette_ram[BG_PAL_INTENSITY_RG] >> 4 ;  ir = (ir << 4) | ir ;
85   ig = ps5_palette_ram[BG_PAL_INTENSITY_RG] & 15 ;  ig = (ig << 4) | ig ;
86   ib = ps5_palette_ram[BG_PAL_INTENSITY_BU] >> 4 ;  ib = (ib << 4) | ib ;
87   ix = ps5_palette_ram[0x1ff] & 0x0f ;
88
89103   /* for all of the background palette */
90104   for (i = 0; i < 0x100; i++)
91   {
92      lo = ps5_palette_ram[0x400+i*2];
93      hi = ps5_palette_ram[0x400+i*2+1];
105      psychic5_change_bg_palette(machine,bg_palette_base+i,bg_palette_ram_base+i*2,bg_palette_ram_base+i*2+1);
106}
94107
95      /* red component */
96      val  = (lo  >> 4) & 0x0f;
97      r = (val << 4) | val ;
98108
99      /* green component */
100      val  = (lo  & 15) & 0x0f;
101      g = (val << 4) | val ;
109/***************************************************************************
110  Memory handler
111***************************************************************************/
102112
103      /* blue component */
104      val =  (hi  >> 4) & 0x0f;
105      b = (val << 4) | val ;
106
107      /* Grey background enable */
108      if (ps5_io_ram[BG_SCREEN_MODE] & 0x02)
109      {
110         val = (UINT8)((r + g + b) / 3);      /* Grey */
111
112         if (ix != 0x0)                  /* Tint the grey */
113         {
114            UINT32 result = jal_blend_func(MAKE_RGB(val,val,val), MAKE_RGB(ir, ig, ib), jal_blend_table[0xff]) ;
115            palette_set_color(machine, 0x100+i, result) ;
116         }
117         else                        /* Just leave plain grey */
118         {
119            palette_set_color(machine,0x100+i,MAKE_RGB(val,val,val));
120         }
121      }
122      else
123      {
124         /* Seems fishy, but the title screen would be black otherwise... */
125         if (!title_screen)
126         {
127            if (ix != 0x0)      /* Tint the world */
128            {
129               UINT32 result = jal_blend_func(MAKE_RGB(r, g, b), MAKE_RGB(ir, ig, ib), jal_blend_table[0xff]) ;
130               palette_set_color(machine, 0x100+i, result) ;
131            }
132            else            /* Leave the world as-is */
133            {
134               palette_set_color(machine,0x100+i,MAKE_RGB(r,g,b)) ;
135            }
136         }
137      }
138   }
113READ8_HANDLER( psychic5_vram_page_select_r )
114{
115   return ps5_vram_page;
139116}
140117
141
142static WRITE8_HANDLER( psychic5_bg_videoram_w )
118WRITE8_HANDLER( psychic5_vram_page_select_w )
143119{
144   psychic5_bg_videoram[offset] = data;
145   tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
120   ps5_vram_page = data & 1;
146121}
147122
148static WRITE8_HANDLER( psychic5_fg_videoram_w )
123WRITE8_HANDLER( psychic5_title_screen_w )
149124{
150   psychic5_fg_videoram[offset] = data;
151   tilemap_mark_tile_dirty(fg_tilemap, offset / 2);
125   title_screen = data;
152126}
153127
154128READ8_HANDLER( psychic5_paged_ram_r )
155129{
156   int val;
130   if (ps5_vram_page == 1)
131   {
132      switch (offset)
133      {
134         case 0x00: return input_port_read(machine, "SYSTEM");
135         case 0x01: return input_port_read(machine, "P1");
136         case 0x02: return input_port_read(machine, "P2");
137         case 0x03: return input_port_read(machine, "DSW1");
138         case 0x04: return input_port_read(machine, "DSW2");
139      }
140   }
157141
158   if (!ps5_vram_page)
142   return ps5_pagedram[ps5_vram_page][offset];
143}
144
145WRITE8_HANDLER( psychic5_paged_ram_w )
146{
147   ps5_pagedram[ps5_vram_page][offset] = data;
148
149   if (ps5_vram_page == 0)
159150   {
160      if (offset < 0x1000)
161         return psychic5_bg_videoram[offset];
162      else
163         return ps5_dummy_bg_ram[offset & 0xfff];
151      if (offset <= 0xfff)
152         tilemap_mark_tile_dirty(bg_tilemap, offset >> 1);
164153   }
165154   else
166155   {
167      if (offset < 0x400)
156      if (offset == BG_SCROLLX_LSB || offset == BG_SCROLLX_MSB)
168157      {
169         val = 0;
170         switch(offset)
171         {
172            case 0x00:
173               val = input_port_read(machine, "IN0");
174               break;
175            case 0x01:
176               val = input_port_read(machine, "P1");
177               break;
178            case 0x02:
179               val = input_port_read(machine, "P2");
180               break;
181            case 0x03:
182               val = input_port_read(machine, "DSW0");
183               break;
184            case 0x04:
185               val = input_port_read(machine, "DSW1");
186               break;
187            default:
188               val = ps5_io_ram[offset];
189         }
190         return (val);
158         UINT16 bg_scrollx = ps5_io_ram[BG_SCROLLX_LSB] | (ps5_io_ram[BG_SCROLLX_MSB] << 8);
159         tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
191160      }
192      else if (offset < 0x1000)
161      else if (offset == BG_SCROLLY_LSB || offset == BG_SCROLLY_MSB)
193162      {
194         return ps5_palette_ram[offset-0x400];
163         UINT16 bg_scrolly = ps5_io_ram[BG_SCROLLY_LSB] | (ps5_io_ram[BG_SCROLLY_MSB] << 8);
164         tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
195165      }
196      else
166      else if (offset == BG_SCREEN_MODE)
197167      {
198         return psychic5_fg_videoram[offset & 0xfff];
168         psychic5_bg_status = ps5_io_ram[BG_SCREEN_MODE];
199169      }
170      else if (offset >= 0x400 && offset <= 0x5ff)   /* Sprite color */
171         psychic5_change_palette(machine,((offset >> 1) & 0xff)+0x000,offset-0x400);
172      else if (offset >= 0x800 && offset <= 0x9ff)   /* BG color */
173         psychic5_change_palette(machine,((offset >> 1) & 0xff)+0x100,offset-0x400);
174      else if (offset >= 0xa00 && offset <= 0xbff)   /* Text color */
175         psychic5_change_palette(machine,((offset >> 1) & 0xff)+0x200,offset-0x400);
176      else if (offset >= 0x1000)
177         tilemap_mark_tile_dirty(fg_tilemap, (offset-0x1000) >> 1);
200178   }
201179}
202180
203WRITE8_HANDLER( psychic5_paged_ram_w )
181WRITE8_HANDLER( bombsa_paged_ram_w )
204182{
205   if (!ps5_vram_page)
183   ps5_pagedram[ps5_vram_page][offset] = data;
184
185   if (ps5_vram_page == 0)
206186   {
207      if (offset < 0x1000)
208         psychic5_bg_videoram_w(machine,offset,data);
209      else
210         ps5_dummy_bg_ram[offset & 0xfff] = data;
187      tilemap_mark_tile_dirty(bg_tilemap, offset >> 1);
211188   }
212189   else
213190   {
214      if (offset < 0x400)
191      if (offset == BG_SCROLLX_LSB || offset == BG_SCROLLX_MSB)
215192      {
216         ps5_io_ram[offset] = data;
193         UINT16 bg_scrollx = ps5_io_ram[BG_SCROLLX_LSB] | (ps5_io_ram[BG_SCROLLX_MSB] << 8);
194         tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
217195      }
218      else if (offset < 0x600)
196      else if (offset == BG_SCROLLY_LSB || offset == BG_SCROLLY_MSB)
219197      {
220         psychic5_paletteram_w(machine, 000, offset-0x400, data);
198         UINT16 bg_scrolly = ps5_io_ram[BG_SCROLLY_LSB] | (ps5_io_ram[BG_SCROLLY_MSB] << 8);
199         tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
221200      }
222      else if (offset > 0x5ff && offset< 0x800)
201      else if (offset == BG_SCREEN_MODE)
223202      {
224         ps5_palette_ram[offset-0x400] = data;
203         psychic5_bg_status = ps5_io_ram[BG_SCREEN_MODE];
225204      }
226      else if (offset > 0x7ff && offset < 0xa00)
227      {
228         psychic5_paletteram_w(machine, 256, offset-0x400, data);
229      }
230      else if (offset > 0x9ff && offset < 0xc00)
231      {
232         psychic5_paletteram_w(machine, 256, offset-0x400, data);
233      }
234      else if (offset < 0x1000)
235      {
236         ps5_palette_ram[offset-0x400] = data;
237      }
238      else
239      {
240         psychic5_fg_videoram_w(machine, offset & 0xfff, data);
241      }
205      else if (offset >= 0x0800 && offset <= 0x0fff)
206         tilemap_mark_tile_dirty(fg_tilemap, (offset & 0x7ff) >> 1);
207      else if (offset >= 0x1000 && offset <= 0x15ff)
208         psychic5_change_palette(machine, (offset >> 1) & 0x3ff, offset-0x1000);
242209   }
243210}
244211
212WRITE8_HANDLER( bombsa_unknown_w )
213{
214   bombsa_unknown = data;
215}
216
217
218/***************************************************************************
219  Callbacks for the tilemap code
220***************************************************************************/
221
245222static TILE_GET_INFO( get_bg_tile_info )
246223{
247   int offs = tile_index * 2;
224   int offs = tile_index << 1;
248225   int attr = psychic5_bg_videoram[offs + 1];
249   int code = psychic5_bg_videoram[offs] + ((attr & 0xc0) << 2);
226   int code = psychic5_bg_videoram[offs] | ((attr & 0xc0) << 2);
250227   int color = attr & 0x0f;
251   int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0);
228   int flags = TILE_FLIPYX((attr & 0x30) >> 4);
252229
253230   SET_TILE_INFO(1, code, color, flags);
254231}
255232
256233static TILE_GET_INFO( get_fg_tile_info )
257234{
258   int offs = tile_index * 2;
235   int offs = tile_index << 1;
259236   int attr = psychic5_fg_videoram[offs + 1];
260   int code = psychic5_fg_videoram[offs] + ((attr & 0xc0) << 2);
237   int code = psychic5_fg_videoram[offs] | ((attr & 0xc0) << 2);
261238   int color = attr & 0x0f;
262   int flags = ((attr & 0x10) ? TILE_FLIPX : 0) + ((attr & 0x20) ? TILE_FLIPY : 0);
239   int flags = TILE_FLIPYX((attr & 0x30) >> 4);
263240
264241   SET_TILE_INFO(2, code, color, flags);
265242}
266243
244
245/***************************************************************************
246  Initialize and destroy video hardware emulation
247***************************************************************************/
248
267249VIDEO_START( psychic5 )
268250{
269   psychic5_bg_videoram = auto_malloc(0x1000);
270   psychic5_fg_videoram = auto_malloc(0x1000);
271   ps5_dummy_bg_ram = auto_malloc(0x1000);
272   ps5_io_ram = auto_malloc(0x400);
273   ps5_palette_ram = auto_malloc(0xc00);
274   jal_blend_table = auto_malloc(0xc00);
251   /*                          info              offset             w   h  col  row */
252   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
253   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,  8,  8, 32, 32);
275254
276   memset(psychic5_bg_videoram, 0,0x1000);
277   memset(psychic5_fg_videoram,0,0x1000);
278   memset(ps5_dummy_bg_ram,0,0x1000);
279   memset(ps5_io_ram,0,0x400);
280   memset(ps5_palette_ram,0,0xc00);
281   memset(jal_blend_table,0,0xc00) ;
255   tilemap_set_transparent_pen(fg_tilemap, 15);
282256
283   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
284       16, 16, 64, 32);
257   ps5_pagedram[0] = auto_malloc(0x2000);
258   ps5_pagedram[1] = auto_malloc(0x2000);
285259
286   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
287       8, 8, 32, 32);
260   psychic5_bg_videoram  = &ps5_pagedram[0][0x0000];
261   ps5_dummy_bg_ram      = &ps5_pagedram[0][0x1000];
262   ps5_io_ram            = &ps5_pagedram[1][0x0000];
263   ps5_palette_ram       = &ps5_pagedram[1][0x0400];
264   psychic5_fg_videoram  = &ps5_pagedram[1][0x1000];
288265
266   jal_blend_table = auto_malloc(0xc00);
267
268   bg_palette_ram_base = 0x400;
269   bg_palette_base = 0x100;
270}
271
272VIDEO_START( bombsa )
273{
274   /*                          info              offset             w   h   col  row */
275   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, 16, 16, 128, 32);
276   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,  8,  8,  32, 32);
277
289278   tilemap_set_transparent_pen(fg_tilemap, 15);
279
280   ps5_pagedram[0] = auto_malloc(0x2000);
281   ps5_pagedram[1] = auto_malloc(0x2000);
282
283   psychic5_bg_videoram  = &ps5_pagedram[0][0x0000];
284   ps5_dummy_bg_ram      = &ps5_pagedram[0][0x1000];
285   ps5_io_ram            = &ps5_pagedram[1][0x0000];
286   psychic5_fg_videoram  = &ps5_pagedram[1][0x0800];
287   ps5_palette_ram       = &ps5_pagedram[1][0x1000];
288
289   //jal_blend_table = auto_malloc(0xc00);
290   jal_blend_table = NULL;
291
292   bg_palette_ram_base = 0x000;
293   bg_palette_base = 0x000;
290294}
291295
296VIDEO_RESET( psychic5 )
297{
298   bg_clip_mode = 0;
299   ps5_vram_page = 0;
300   psychic5_bg_status = 0;
301   memset(ps5_pagedram[0],0,0x2000);
302   memset(ps5_pagedram[1],0,0x2000);
303   palette_intensity = 0;
304   if (jal_blend_table != NULL) memset(jal_blend_table,0,0xc00);
305}
306
307VIDEO_RESET( bombsa )
308{
309   ps5_vram_page = 0;
310   psychic5_bg_status = 0;
311   title_screen = 0;
312   memset(ps5_pagedram[0],0,0x2000);
313   memset(ps5_pagedram[1],0,0x2000);
314   palette_intensity = 0;
315   if (jal_blend_table != NULL) memset(jal_blend_table,0,0xc00);
316}
317
318
319/***************************************************************************
320  Screen refresh
321***************************************************************************/
322
292323#define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(machine, bitmap, machine->gfx[0], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 15);
293/* #define DRAW_SPRITE(code, sx, sy) drawgfx(bitmap, machine->gfx[0], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 15); */
294324
295static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
325static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
296326{
297327   int offs;
298328
299   if (title_screen)
300      return;
301   else
302      bg_clip_mode = -10;
303
304   for (offs = 11; offs < spriteram_size; offs += 16)
329   /* Draw the sprites */
330   for (offs = 0; offs < spriteram_size; offs += 16)
305331   {
306      int tileofs0, tileofs1, tileofs2, tileofs3, temp1, temp2;
307      int attr = spriteram[offs + 2];
308      int code = spriteram[offs + 3] + ((attr & 0xc0) << 2);
309      int color = spriteram[offs + 4] & 0x0f;
332      int attr  = spriteram[offs + 13];
333      int code  = spriteram[offs + 14] | ((attr & 0xc0) << 2);
334      int color = spriteram[offs + 15] & 0x0f;
310335      int flipx = attr & 0x10;
311336      int flipy = attr & 0x20;
312      int sx = spriteram[offs + 1];
313      int sy = spriteram[offs];
314      int size32 = attr & 0x08;
337      int sx = spriteram[offs + 12];
338      int sy = spriteram[offs + 11];
339      int size = (attr & 0x08) ? 32:16;
315340
316341      if (attr & 0x01) sx -= 256;
317342      if (attr & 0x04) sy -= 256;
r3289r3290
324349         flipy = !flipy;
325350      }
326351
327      if (flipy)
352      if (size == 32)
328353      {
329         tileofs0 = 1; tileofs1 = 0;   tileofs2 = 3; tileofs3 = 2;
330      }
331      else
332      {
333         tileofs0 = 0; tileofs1 = 1;   tileofs2 = 2; tileofs3 = 3;
334      }
354         int x0,x1,y0,y1;
335355
336      if (flipx)
337      {
338         temp1 = tileofs0;
339         temp2 = tileofs1;
340         tileofs0 = tileofs2;
341         tileofs1 = tileofs3;
342         tileofs2 = temp1;
343         tileofs3 = temp2;
344      }
356         if (flipx) { x0 = 2; x1 = 0; }
357         else { x0 = 0; x1 = 2; }
345358
346      if (size32)
347      {
348         DRAW_SPRITE(code + tileofs0, sx, sy)
349         DRAW_SPRITE(code + tileofs1, sx, sy + 16)
350         DRAW_SPRITE(code + tileofs2, sx + 16, sy)
351         DRAW_SPRITE(code + tileofs3, sx + 16, sy + 16)
359         if (flipy) { y0 = 1; y1 = 0; }
360         else { y0 = 0; y1 = 1; }
361
362         DRAW_SPRITE(code + x0 + y0, sx, sy)
363         DRAW_SPRITE(code + x0 + y1, sx, sy + 16)
364         DRAW_SPRITE(code + x1 + y0, sx + 16, sy)
365         DRAW_SPRITE(code + x1 + y1, sx + 16, sy + 16)
352366      }
353367      else
354368      {
r3289r3290
360374   }
361375}
362376
363static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
377static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
364378{
365   int bg_scrollx = (ps5_io_ram[BG_SCROLLX_LSB] + ((ps5_io_ram[BG_SCROLLX_MSB] & 0x03) << 8)) & 0x3ff;
366   int bg_scrolly = (ps5_io_ram[BG_SCROLLY_LSB] + ((ps5_io_ram[BG_SCROLLY_MSB] & 0x01) << 8)) & 0x1ff;
379   static int sx1 = 0, sy1 = 0, sy2 = 0;
367380
368   tilemap_set_scrollx(bg_tilemap, 0, bg_scrollx);
369   tilemap_set_scrolly(bg_tilemap, 0, bg_scrolly);
381   rectangle clip = *cliprect;
370382
371383   set_background_palette_intensity(machine);
372384
373   if (ps5_io_ram[BG_SCREEN_MODE] & 0x01)  /* background enable */
385   if (!(title_screen & 1))
374386   {
375      if (title_screen)
376      {
377         rectangle clip = *cliprect;
387      bg_clip_mode = 0;
388      sx1 = sy1 = sy2 = 0;
389   }
390   else
391   {
392      int sy1_old = sy1;
393      int sx1_old = sx1;
394      int sy2_old = sy2;
378395
379         int sx1 = spriteram[12];      /* sprite 0 */
380         int sy1 = spriteram[11];
381         int tile = spriteram[14];
382         int sy2 = spriteram[11+128];   /* sprite 8 */
396      sy1 = spriteram[11];      /* sprite 0 */
397      sx1 = spriteram[12];
398      sy2 = spriteram[11+128];   /* sprite 8 */
383399
384         if (bg_clip_mode >=0 && bg_clip_mode < 3 && sy1==240) bg_clip_mode = 0;
385         if (bg_clip_mode > 2 && bg_clip_mode < 5 && sy2==240) bg_clip_mode = -10;
386         if (bg_clip_mode > 4 && bg_clip_mode < 7 && sx1==240) bg_clip_mode = 0;
387         if (bg_clip_mode > 6 && bg_clip_mode < 9 && (sx1==240 || sx1==0)) bg_clip_mode = -10;
400      switch (bg_clip_mode)
401      {
402      case  0: case  4: if (sy1_old != sy1) bg_clip_mode++; break;
403      case  2: case  6: if (sy2_old != sy2) bg_clip_mode++; break;
404      case  8: case 10:
405      case 12: case 14: if (sx1_old != sx1) bg_clip_mode++; break;
406      case  1: case  5: if (sy1 == 0xf0) bg_clip_mode++; break;
407      case  3: case  7: if (sy2 == 0xf0) bg_clip_mode++; break;
408      case  9: case 11: if (sx1 == 0xf0) bg_clip_mode++; break;
409      case 13: case 15: if (sx1_old == 0xf0) bg_clip_mode++;
410      case 16: if (sy1 != 0x00) bg_clip_mode = 0; break;
411      }
388412
389         if (sy1!=240 && sy1!=0 && bg_clip_mode<=0)
390         {
391            if (sy1 > 128)
392               bg_clip_mode = 1;
393            else
394               bg_clip_mode = 2;
395         }
413      switch (bg_clip_mode)
414      {
415      case  0: case  4: case  8: case 12: case 16:
416         clip.min_x = clip.max_x = clip.min_y = clip.max_y = 0;
417         break;
418      case  1: clip.min_y = sy1; break;
419      case  3: clip.max_y = sy2; break;
420      case  5: clip.max_y = sy1; break;
421      case  7: clip.min_y = sy2; break;
422      case  9: case 15: clip.min_x = sx1; break;
423      case 11: case 13: clip.max_x = sx1; break;
424      }
396425
397         if (sy2!=240 && sy2!=0 && bg_clip_mode<=0)
398         {
399            if (sy2 > 128)
400               bg_clip_mode = 3;
401            else
402               bg_clip_mode = 4;
403         }
404
405         if (sx1!=240 && sx1!=0 && bg_clip_mode<=0 && tile==0x3c)
406         {
407            if (sx1 > 128)
408               bg_clip_mode = 5;
409            else
410               bg_clip_mode = 6;
411         }
412
413         if (sx1!=240 && sx1!=0 && bg_clip_mode<=0 && tile==0x1c)
414         {
415            if (sx1 > 128)
416               bg_clip_mode = 7;
417            else
418               bg_clip_mode = 8;
419         }
420
421         if (bg_clip_mode)
422         {
423            if (bg_clip_mode == 1)
424               clip.min_y = sy1;
425            else if (bg_clip_mode == 2)
426                clip.max_y = sy1;
427            else if (bg_clip_mode == 3)
428               clip.max_y = sy2;
429            else if (bg_clip_mode == 4)
430               clip.min_y = sy2;
431            else if (bg_clip_mode == 5)
432               clip.min_x = sx1;
433            else if (bg_clip_mode == 6)
434                clip.max_x = sx1;
435            else if (bg_clip_mode == 7)
436               clip.max_x = sx1;
437            else if (bg_clip_mode == 8)
438               clip.min_x = sx1;
439            else if (bg_clip_mode == -10)
440            {
441               clip.min_x = 0;
442               clip.min_y = 0;
443               clip.max_x = 0;
444               clip.max_y = 0;
445            }
446
447            fillbitmap(bitmap, get_black_pen(machine), cliprect);
448            tilemap_draw(bitmap, &clip, bg_tilemap, 0, 0);
449         }
450         else
451            tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
426      if (flip_screen_get())
427      {
428         int min_x,max_x,min_y,max_y;
429         min_x = 255 - clip.max_x;
430         max_x = 255 - clip.min_x;
431         min_y = 255 - clip.max_y;
432         max_y = 255 - clip.min_y;
433         clip.min_x = min_x;
434         clip.max_x = max_x;
435         clip.min_y = min_y;
436         clip.max_y = max_y;
452437      }
453      else
454         tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
455438   }
456   else
457      fillbitmap(bitmap, get_black_pen(machine), cliprect);
439
440   tilemap_draw(bitmap, &clip, bg_tilemap, 0, 0);
458441}
459442
460443VIDEO_UPDATE( psychic5 )
461444{
462   draw_background(screen->machine, bitmap, cliprect);
445   fillbitmap(bitmap, get_black_pen(screen->machine), cliprect);
446   if (psychic5_bg_status & 1)   /* Backgound enable */
447      draw_background(screen->machine, bitmap, cliprect);
448   if (!(title_screen & 1))
449      draw_sprites(screen->machine, bitmap, cliprect);
450   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
451   return 0;
452}
453
454VIDEO_UPDATE( bombsa )
455{
456   if (psychic5_bg_status & 1)   /* Backgound enable */
457      tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
458   else
459      fillbitmap(bitmap, screen->machine->pens[0x0ff], cliprect);
463460   draw_sprites(screen->machine, bitmap, cliprect);
464461   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
465462   return 0;
src/mame/video/funworld.c
r3289r3290
2929    * Pool 10 (italian, set 1),                         C.M.C.,             1996.
3030    * Pool 10 (italian, set 2),                         C.M.C.,             1996.
3131    * Pool 10 (italian, set 3),                         C.M.C.,             1996.
32    * Pool 10 (italian, set 4),                         C.M.C.,             1997.
3233    * Tortuga Family (italian),                         C.M.C.,             1997.
3334    * Pot Game (italian),                               C.M.C.,             1996.
3435    * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
src/mame/layout/funworld.lay
r3289r3290
11<?xml version="1.0"?>
22<mamelayout version="2">
33   <element name="hold1" defstate="1">
4      <rect>
4      <rect state="1">
55         <color red="1.0" green="0.0" blue="0.0" />
66      </rect>
7      <text string="HOLD 1" state="1">
7      <rect state="0">
8         <color red="0.3" green="0.0" blue="0.0" />
9      </rect>
10      <text string="HOLD 1">
811         <color red="0.0" green="0.0" blue="0.0" />
912         <bounds x="0" y="0.1" width="1" height="0.8" />
1013      </text>
1114   </element>
1215
1316   <element name="hold2" defstate="1">
14      <rect>
17      <rect state="1">
1518         <color red="1.0" green="0.0" blue="0.0" />
1619      </rect>
17      <text string="HOLD 2" state="1">
20      <rect state="0">
21         <color red="0.3" green="0.0" blue="0.0" />
22      </rect>
23      <text string="HOLD 2">
1824         <color red="0.0" green="0.0" blue="0.0" />
1925         <bounds x="0" y="0.1" width="1" height="0.8" />
2026      </text>
2127   </element>
2228
2329   <element name="hold3" defstate="1">
24      <rect>
30      <rect state="1">
2531         <color red="1.0" green="0.0" blue="0.0" />
2632      </rect>
27      <text string="HOLD 3" state="1">
33      <rect state="0">
34         <color red="0.3" green="0.0" blue="0.0" />
35      </rect>
36      <text string="HOLD 3">
2837         <color red="0.0" green="0.0" blue="0.0" />
2938         <bounds x="0" y="0.1" width="1" height="0.8" />
3039      </text>
3140   </element>
3241
3342   <element name="hold4" defstate="1">
34      <rect>
43      <rect state="1">
3544         <color red="1.0" green="0.0" blue="0.0" />
3645      </rect>
37      <text string="HOLD 4" state="1">
46      <rect state="0">
47         <color red="0.3" green="0.0" blue="0.0" />
48      </rect>
49      <text string="HOLD 4">
3850         <color red="0.0" green="0.0" blue="0.0" />
3951         <bounds x="0" y="0.1" width="1" height="0.8" />
4052      </text>
4153   </element>
4254
4355   <element name="hold5" defstate="1">
44      <rect>
56      <rect state="1">
4557         <color red="1.0" green="0.0" blue="0.0" />
4658      </rect>
47      <text string="HOLD 5" state="1">
59      <rect state="0">
60         <color red="0.3" green="0.0" blue="0.0" />
61      </rect>
62      <text string="HOLD 5">
4863         <color red="0.0" green="0.0" blue="0.0" />
4964         <bounds x="0" y="0.1" width="1" height="0.8" />
5065      </text>
5166   </element>
5267
5368   <element name="cancel" defstate="1">
54      <rect>
69      <rect state="1">
5570         <color red="0.0" green="1.0" blue="0.0" />
5671      </rect>
57      <text string="CANCEL" state="1">
72      <rect state="0">
73         <color red="0.0" green="0.3" blue="0.0" />
74      </rect>
75      <text string="CANCEL">
5876         <color red="0.0" green="0.0" blue="0.0" />
5977         <bounds x="0" y="0.1" width="1" height="0.8" />
6078      </text>
6179   </element>
6280
6381   <element name="start" defstate="1">
64      <rect>
82      <rect state="1">
6583         <color red="0.0" green="1.0" blue="0.0" />
6684      </rect>
67      <text string="START" state="1">
85      <rect state="0">
86         <color red="0.0" green="0.3" blue="0.0" />
87      </rect>
88      <text string="START">
6889         <color red="0.0" green="0.0" blue="0.0" />
6990         <bounds x="0" y="0.1" width="1" height="0.8" />
7091      </text>
src/mame/layout/galaxi.lay
r0r3290
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="L1" 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="HOLD1">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.1" width="1" height="0.8" />
13      </text>
14   </element>
15
16   <element name="L2" defstate="1">
17      <rect state="1">
18         <color red="1.0" green="0.0" blue="0.0" />
19      </rect>
20      <rect state="0">
21         <color red="0.3" green="0.0" blue="0.0" />
22      </rect>
23      <text string="HOLD2">
24         <color red="0.0" green="0.0" blue="0.0" />
25         <bounds x="0" y="0.1" width="1" height="0.8" />
26      </text>
27   </element>
28
29   <element name="L3" defstate="1">
30      <rect state="1">
31         <color red="1.0" green="0.0" blue="0.0" />
32      </rect>
33      <rect state="0">
34         <color red="0.3" green="0.0" blue="0.0" />
35      </rect>
36      <text string="HOLD3">
37         <color red="0.0" green="0.0" blue="0.0" />
38         <bounds x="0" y="0.1" width="1" height="0.8" />
39      </text>
40   </element>
41
42   <element name="L4" defstate="1">
43      <rect state="1">
44         <color red="1.0" green="0.0" blue="0.0" />
45      </rect>
46      <rect state="0">
47         <color red="0.3" green="0.0" blue="0.0" />
48      </rect>
49      <text string="HOLD4">
50         <color red="0.0" green="0.0" blue="0.0" />
51         <bounds x="0" y="0.1" width="1" height="0.8" />
52      </text>
53   </element>
54
55   <element name="L5" defstate="1">
56      <rect state="1">
57         <color red="1.0" green="0.0" blue="0.0" />
58      </rect>
59      <rect state="0">
60         <color red="0.3" green="0.0" blue="0.0" />
61      </rect>
62      <text string="HOLD5">
63         <color red="0.0" green="0.0" blue="0.0" />
64         <bounds x="0" y="0.1" width="1" height="0.8" />
65      </text>
66   </element>
67
68   <element name="L6" defstate="1">
69      <rect state="1">
70         <color red="1.0" green="1.0" blue="1.0" />
71      </rect>
72      <rect state="0">
73         <color red="0.3" green="0.3" blue="0.3" />
74      </rect>
75      <text string="START">
76         <color red="0.0" green="0.0" blue="0.0" />
77         <bounds x="0" y="0.1" width="1" height="0.8" />
78      </text>
79   </element>
80
81
82   <view name="Button Lamps">
83      <screen index="0">
84         <bounds left="0" top="0" right="4" bottom="3" />
85      </screen>
86      <bezel name="lamp1" element="L1">
87         <bounds x="0.5" y="3.13" width="0.40" height="0.24" />
88      </bezel>
89      <bezel name="lamp2" element="L2">
90         <bounds x="1.0" y="3.13" width="0.40" height="0.24" />
91      </bezel>
92      <bezel name="lamp3" element="L3">
93         <bounds x="1.5" y="3.13" width="0.40" height="0.24" />
94      </bezel>
95      <bezel name="lamp4" element="L4">
96         <bounds x="2.0" y="3.13" width="0.40" height="0.24" />
97      </bezel>
98      <bezel name="lamp5" element="L5">
99         <bounds x="2.5" y="3.13" width="0.40" height="0.24" />
100      </bezel>
101      <bezel name="lamp6" element="L6">
102         <bounds x="3.0" y="3.13" width="0.40" height="0.24" />
103      </bezel>
104   </view>
105</mamelayout>
src/mame/drivers/mainsnk.c
r3289r3290
77
88Notes:
99------
10- mainsnk controls:
11  The game uses 2 joysticks (with button on top) and 2 buttons per player.
12  Left stick
13  up: left straight punch to enemy's face
14  left: swey to left
15
16  Right stick
17  up: right straight punch to enemy's face
18  right: swey to right
19
20  Left + Right stick combinations
21  L down + R up: right straight punch to enemy's body
22  L up + R down: left straight punch to enemy's body
23  L right + R left: guard player's body
24
25  to move the boxer, use joystick while pressing the button on top of the stick.
26
27  Left button: left uppercut
28  Right button: right uppercut
29  to recover from down, press these buttons rapidly.
30
31
1032- canvas doesn't use the tx layer, though the circuitry is presumably still
1133  present on the pcb. One gfx ROM socket is left empty which causes the tx layer
1234  to be completely transparent.
r3289r3290
173195   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SERVICE )
174196
175197   PORT_START("IN1")
176   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
179   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
180   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
181   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
198   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP )
199   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN )
200   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT )
201   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT )
202   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP )
203   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN )
204   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT )
205   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT )
184206
185207   PORT_START("IN2")
186   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
187   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
188   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
189   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
190   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
191   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
192   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
193   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
208   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(2)
209   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(2)
210   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(2)
211   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(2)
212   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(2)
213   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(2)
214   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(2)
215   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(2)
194216
195217   PORT_START("IN3")
196   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* ?? */
197   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
198   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
199   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
200   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) /* ?? */
201   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
202   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
203   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
218   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )   // button on top of left stick
219   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )   // button on top of right stick
220   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )   // left button
221   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )   // right button
222   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
223   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
224   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
225   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
204226
227   // the manual only mentions one dip switch apparently.
205228   PORT_START("DSW1")
206229   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1")
207230   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
r3289r3290
230253
231254   PORT_START("DSW2")
232255   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW2:1,2,3")
233//  PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )    // duplicate
256//  PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )    // duplicate
234257//  PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )    // duplicate
235   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
258   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
236259   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
237260   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
238261   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
239262   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
240263   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
241   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4")
242   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
243   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
244   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") /* $1ecf */
245   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
246   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:4")
265   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
266   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
267   PORT_DIPNAME( 0x10, 0x10, "Round Time" ) PORT_DIPLOCATION("DSW2:5") /* $1ecf */
268   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
269   PORT_DIPSETTING(    0x00, "Short" )
247270   PORT_DIPNAME( 0x60, 0x20, "Game mode" ) PORT_DIPLOCATION("DSW2:6,7")
248271   PORT_DIPSETTING(    0x60, "Demo Sounds Off" )
249272   PORT_DIPSETTING(    0x20, "Demo Sounds On" )
src/mame/drivers/midtunit.c
r3289r3290
12911291
12921292GAME( 1993, nbajam,   0,       tunit_adpcm, nbajam,   nbajam,   ROT0, "Midway",   "NBA Jam (rev 3.01 04/07/93)", GAME_SUPPORTS_SAVE )
12931293GAME( 1993, nbajamr2, nbajam,  tunit_adpcm, nbajam,   nbajam,   ROT0, "Midway",   "NBA Jam (rev 2.00 02/10/93)", GAME_SUPPORTS_SAVE )
1294GAME( 1994, nbajamte, nbajam,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 4.0 03/23/94)", GAME_SUPPORTS_SAVE )
1295GAME( 1994, nbajamt1, nbajam,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 1.0 01/17/94)", GAME_SUPPORTS_SAVE )
1296GAME( 1994, nbajamt2, nbajam,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 2.0 01/28/94)", GAME_SUPPORTS_SAVE )
1297GAME( 1994, nbajamt3, nbajam,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 3.0 03/04/94)", GAME_SUPPORTS_SAVE )
1294
1295GAME( 1994, nbajamte, 0,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 4.0 03/23/94)", GAME_SUPPORTS_SAVE )
1296GAME( 1994, nbajamt1, nbajamte,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 1.0 01/17/94)", GAME_SUPPORTS_SAVE )
1297GAME( 1994, nbajamt2, nbajamte,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 2.0 01/28/94)", GAME_SUPPORTS_SAVE )
1298GAME( 1994, nbajamt3, nbajamte,  tunit_adpcm, nbajamte, nbajamte, ROT0, "Midway",   "NBA Jam TE (rev 3.0 03/04/94)", GAME_SUPPORTS_SAVE )
src/mame/drivers/system1.c
r3289r3290
121121   cpu_spinuntil_time(ATTOTIME_IN_USEC(50));
122122}
123123
124/* protection values from real hardware, these were verified to be the same on the title
125   screen and in the first level... they're all jumps that the MCU appears to put in RAM
126   at some point */
127static const int shtngtab[]=
128{
129   0xC3,0xC1,0x39,
130   0xC3,0x6F,0x0A,
131   0xC3,0x56,0x39,
132   0xC3,0x57,0x0C,
133   0xC3,0xE2,0x0B,
134   0xC3,0x68,0x03,
135   0xC3,0xF1,0x06,
136   0xC3,0xCA,0x06,
137   0xC3,0xC4,0x06,
138   0xC3,0xD6,0x07,
139   0xC3,0x89,0x13,
140   0xC3,0x75,0x13,
141   0xC3,0x9F,0x13,
142   0xC3,0xFF,0x38,
143   0xC3,0x60,0x13,
144   0xC3,0x62,0x00,
145   0xC3,0x39,0x04,
146   -1
147};
124148
149static WRITE8_HANDLER(mcuenable_hack_w)
150{
151   //in fact it's gun feedback write, not mcu related
152   int i=0;
153   while(shtngtab[i]>=0)
154   {
155      system1_ram[i+0x40]=shtngtab[i];
156      i++;
157   }
125158
159   system1_ram[0x2ff]=0x49; // I ?
160   system1_ram[0x3ff]=0x54; // T ?
161}
162
163
126164static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
127165   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
128166   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_ROM)
r3289r3290
238276ADDRESS_MAP_END
239277
240278
241static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
279static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
242280   ADDRESS_MAP_GLOBAL_MASK(0xff)
243281   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
244282   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
r3289r3290
246284   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
247285   AM_RANGE(0x0e, 0x0e) AM_READ_PORT("DSW2")   /* DIP2 blckgalb reads it from here */
248286   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
249   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here */
250                                    /* but there are games which check BOTH! */
251
287   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here but there are games which check BOTH! */
252288   AM_RANGE(0x11, 0x11) AM_READ_PORT("DSW2")   /* DIP2 ... blockgal */
253
254
255   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
256   AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r)    /* mirror address */
289   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)   /* sound commands */
290   AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, system1_videomode_w)   /* video control and (in some games) bank switching */
291   AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w)   /* mirror address */
292   AM_RANGE(0x19, 0x19) AM_READWRITE(system1_videomode_r, system1_videomode_w)    /* mirror address */
257293ADDRESS_MAP_END
258294
259static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
295static ADDRESS_MAP_START( wbml_io_map, ADDRESS_SPACE_IO, 8 )
260296   ADDRESS_MAP_GLOBAL_MASK(0xff)
261   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)    /* sound commands */
262   AM_RANGE(0x15, 0x15) AM_WRITE(system1_videomode_w)    /* video control and (in some games) bank switching */
263   AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w)    /* mirror address */
264   AM_RANGE(0x19, 0x19) AM_WRITE(system1_videomode_w)    /* mirror address */
265ADDRESS_MAP_END
266
267static ADDRESS_MAP_START( wbml_readport, ADDRESS_SPACE_IO, 8 )
268   ADDRESS_MAP_GLOBAL_MASK(0xff)
269297   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
270298   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
271299   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
272300   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
273301   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
274   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here */
275                                    /* but there are games which check BOTH! */
276   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
277   AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r)
302   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here but there are games which check BOTH! */
303   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)    /* sound commands */
304   AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, chplft_videomode_w)
305   AM_RANGE(0x16, 0x16) AM_READWRITE(wbml_videoram_bank_latch_r, wbml_videoram_bank_latch_w)
278306   AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r)  /* mirror address */
279307ADDRESS_MAP_END
280308
281static ADDRESS_MAP_START( sht_readport, ADDRESS_SPACE_IO, 8 )
309static ADDRESS_MAP_START( sht_io_map, ADDRESS_SPACE_IO, 8 )
282310   ADDRESS_MAP_GLOBAL_MASK(0xff)
283311/*  AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") */
284312/*  AM_RANGE(0x04, 0x04) AM_READ_PORT("P2") */
285313   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
286314   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
287315   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
288   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here */
289                                    /* but there are games which check BOTH! */
290
316   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1") AM_WRITE(mcuenable_hack_w)
317                                    /* DIP1 ... and some others from here but there are games which check BOTH! */
291318   AM_RANGE(0x12, 0x12) AM_READ_PORT("TRIGGER")
292
319   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)   /* sound commands */
320   AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, chplft_videomode_w)
321   AM_RANGE(0x16, 0x16) AM_READWRITE(wbml_videoram_bank_latch_r, wbml_videoram_bank_latch_w)
322   AM_RANGE(0x18, 0x18) AM_READ_PORT("18")            /* ?? */
323   AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r)   /* mirror address */
293324   AM_RANGE(0x1c, 0x1c) AM_READ_PORT("GUNX")
294325   AM_RANGE(0x1d, 0x1d) AM_READ_PORT("GUNY")
295
296   AM_RANGE(0x18, 0x18) AM_READ_PORT("18")      /* ?? */
297
298
299   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
300   AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r)
301   AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r)  /* mirror address */
302326ADDRESS_MAP_END
303327
304
305
306static ADDRESS_MAP_START( nobo_readport, ADDRESS_SPACE_IO, 8 )
328static ADDRESS_MAP_START( nobo_io_map, ADDRESS_SPACE_IO, 8 )
307329   ADDRESS_MAP_GLOBAL_MASK(0xff)
308330   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
309331   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
310332   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
311   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")         /* DIP2 */
312   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")         /* DIP1 some games read it from here... */
313   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
314   AM_RANGE(0x16, 0x16) AM_READ(inport16_r)         /* Used - check code at 0x05cb */
315   AM_RANGE(0x1c, 0x1c) AM_READ(inport1c_r)         /* Shouldn't be called ! */
316   AM_RANGE(0x22, 0x22) AM_READ(inport22_r)         /* Used - check code at 0xb253 */
317   AM_RANGE(0x23, 0x23) AM_READ(inport23_r)         /* Used - check code at 0xb275 and 0xb283 */
333   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")      /* DIP2 */
334   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")      /* DIP1 some games read it from here... */
335   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)   /* sound commands ? */
336   AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, brain_videomode_w)   /* video control + bank switching */
337   AM_RANGE(0x16, 0x16) AM_READWRITE(inport16_r, outport16_w)   /* Used - check code at 0x05cb */
338   AM_RANGE(0x17, 0x17) AM_WRITE(outport17_w)      /* Not handled in emul. of other SS1/2 games */
339   AM_RANGE(0x1c, 0x1c) AM_READ(inport1c_r)      /* Shouldn't be called ! */
340   AM_RANGE(0x22, 0x22) AM_READ(inport22_r)      /* Used - check code at 0xb253 */
341   AM_RANGE(0x23, 0x23) AM_READ(inport23_r)      /* Used - check code at 0xb275 and 0xb283 */
342   AM_RANGE(0x24, 0x24) AM_WRITE(outport24_w)         /* Used - check code at 0xb24e and 0xb307 */
318343ADDRESS_MAP_END
319344
320static ADDRESS_MAP_START( wbml_writeport, ADDRESS_SPACE_IO, 8 )
345static ADDRESS_MAP_START( hvymetal_io_map, ADDRESS_SPACE_IO, 8 )
321346   ADDRESS_MAP_GLOBAL_MASK(0xff)
322   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)    /* sound commands */
323   AM_RANGE(0x15, 0x15) AM_WRITE(chplft_videomode_w)
324   AM_RANGE(0x16, 0x16) AM_WRITE(wbml_videoram_bank_latch_w)
325ADDRESS_MAP_END
326
327static ADDRESS_MAP_START( hvymetal_writeport, ADDRESS_SPACE_IO, 8 )
328   ADDRESS_MAP_GLOBAL_MASK(0xff)
347   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
348   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
349   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
350   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
351   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
352   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here but there are games which check BOTH! */
353   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
354   AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r)
329355   AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w)    /* sound commands */
330   AM_RANGE(0x19, 0x19) AM_WRITE(hvymetal_videomode_w)
356   AM_RANGE(0x19, 0x19) AM_READWRITE(system1_videomode_r, hvymetal_videomode_w)  /* mirror address */
331357ADDRESS_MAP_END
332358
333static ADDRESS_MAP_START( brain_writeport, ADDRESS_SPACE_IO, 8 )
359static ADDRESS_MAP_START( brain_io_map, ADDRESS_SPACE_IO, 8 )
334360   ADDRESS_MAP_GLOBAL_MASK(0xff)
335   AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w)    /* sound commands */
336   AM_RANGE(0x19, 0x19) AM_WRITE(brain_videomode_w)
361   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
362   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
363   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
364   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
365   AM_RANGE(0x0e, 0x0e) AM_READ_PORT("DSW2")   /* DIP2 blckgalb reads it from here */
366   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
367   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here but there are games which check BOTH! */
368   AM_RANGE(0x11, 0x11) AM_READ_PORT("DSW2")   /* DIP2 ... blockgal */
369   AM_RANGE(0x15, 0x15) AM_READ(system1_videomode_r)
370   AM_RANGE(0x18, 0x18) AM_WRITE(system1_soundport_w)   /* sound commands */
371   AM_RANGE(0x19, 0x19) AM_READWRITE(system1_videomode_r, brain_videomode_w)   /* mirror address */
337372ADDRESS_MAP_END
338373
339/* protection values from real hardware, these were verified to be the same on the title
340   screen and in the first level... they're all jumps that the MCU appears to put in RAM
341   at some point */
342static const int shtngtab[]=
343{
344   0xC3,0xC1,0x39,
345   0xC3,0x6F,0x0A,
346   0xC3,0x56,0x39,
347   0xC3,0x57,0x0C,
348   0xC3,0xE2,0x0B,
349   0xC3,0x68,0x03,
350   0xC3,0xF1,0x06,
351   0xC3,0xCA,0x06,
352   0xC3,0xC4,0x06,
353   0xC3,0xD6,0x07,
354   0xC3,0x89,0x13,
355   0xC3,0x75,0x13,
356   0xC3,0x9F,0x13,
357   0xC3,0xFF,0x38,
358   0xC3,0x60,0x13,
359   0xC3,0x62,0x00,
360   0xC3,0x39,0x04,
361   -1
362};
363static WRITE8_HANDLER(mcuenable_hack_w)
364{
365   //in fact it's gun feedback write, not mcu related
366   int i=0;
367   while(shtngtab[i]>=0)
368   {
369      system1_ram[i+0x40]=shtngtab[i];
370      i++;
371   }
372
373   system1_ram[0x2ff]=0x49; // I ?
374   system1_ram[0x3ff]=0x54; // T ?
375}
376
377static ADDRESS_MAP_START( sht_writeport, ADDRESS_SPACE_IO, 8 )
374static ADDRESS_MAP_START( chplft_io_map, ADDRESS_SPACE_IO, 8 )
378375   ADDRESS_MAP_GLOBAL_MASK(0xff)
379   AM_RANGE(0x10,0x10) AM_WRITE(mcuenable_hack_w)
380
376   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
377   AM_RANGE(0x04, 0x04) AM_READ_PORT("P2")
378   AM_RANGE(0x08, 0x08) AM_READ_PORT("SYSTEM")
379   AM_RANGE(0x0c, 0x0c) AM_READ_PORT("DSW2")   /* DIP2 */
380   AM_RANGE(0x0d, 0x0d) AM_READ_PORT("DSW1")   /* DIP1 some games read it from here... */
381   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW1")   /* DIP1 ... and some others from here but there are games which check BOTH! */
381382   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)    /* sound commands */
382   AM_RANGE(0x15, 0x15) AM_WRITE(chplft_videomode_w)
383
384   AM_RANGE(0x16, 0x16) AM_WRITE(wbml_videoram_bank_latch_w)
383   AM_RANGE(0x15, 0x15) AM_READWRITE(system1_videomode_r, chplft_videomode_w)
384   AM_RANGE(0x16, 0x16) AM_READ(wbml_videoram_bank_latch_r)
385   AM_RANGE(0x19, 0x19) AM_READ(system1_videomode_r)  /* mirror address */
385386ADDRESS_MAP_END
386387
387388
388static ADDRESS_MAP_START( chplft_writeport, ADDRESS_SPACE_IO, 8 )
389   ADDRESS_MAP_GLOBAL_MASK(0xff)
390   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)    /* sound commands */
391   AM_RANGE(0x15, 0x15) AM_WRITE(chplft_videomode_w)
392ADDRESS_MAP_END
393
394static ADDRESS_MAP_START( nobo_writeport, ADDRESS_SPACE_IO, 8 )
395   ADDRESS_MAP_GLOBAL_MASK(0xff)
396   AM_RANGE(0x14, 0x14) AM_WRITE(system1_soundport_w)   /* sound commands ? */
397   AM_RANGE(0x15, 0x15) AM_WRITE(brain_videomode_w)   /* video control + bank switching */
398   AM_RANGE(0x16, 0x16) AM_WRITE(outport16_w)         /* Used - check code at 0x05cb */
399   AM_RANGE(0x17, 0x17) AM_WRITE(outport17_w)         /* Not handled in emul. of other SS1/2 games */
400   AM_RANGE(0x24, 0x24) AM_WRITE(outport24_w)         /* Used - check code at 0xb24e and 0xb307 */
401ADDRESS_MAP_END
402
403
404389static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
405390   AM_RANGE(0x0000, 0x7fff) AM_ROM
406391   AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x1800) AM_RAM
r3289r3290
18101795   /* basic machine hardware */
18111796   MDRV_CPU_ADD("main", Z80, XTAL_4MHz)   /* My Hero has 2 OSCs 8 & 20 MHz (Cabbe Info) */
18121797   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1813   MDRV_CPU_IO_MAP(readport,writeport)
1798   MDRV_CPU_IO_MAP(io_map,0)
18141799   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
18151800
18161801   MDRV_CPU_ADD("sound", Z80, XTAL_4MHz)
r3289r3290
18741859   MDRV_IMPORT_FROM( system1 )
18751860   MDRV_CPU_MODIFY("main")
18761861   MDRV_CPU_PROGRAM_MAP(brain_readmem,writemem)
1877   MDRV_CPU_IO_MAP(wbml_readport,hvymetal_writeport)
1862   MDRV_CPU_IO_MAP(hvymetal_io_map,0)
18781863
18791864   MDRV_MACHINE_RESET(system1_banked)
18801865
r3289r3290
18871872   MDRV_IMPORT_FROM( system1 )
18881873   MDRV_CPU_MODIFY("main")
18891874   MDRV_CPU_PROGRAM_MAP(brain_readmem,chplft_writemem)
1890   MDRV_CPU_IO_MAP(wbml_readport,chplft_writeport)
1875   MDRV_CPU_IO_MAP(chplft_io_map,0)
18911876
18921877   MDRV_MACHINE_RESET(system1_banked)
18931878
r3289r3290
19041889   MDRV_IMPORT_FROM( system1 )
19051890   MDRV_CPU_MODIFY("main")
19061891   MDRV_CPU_PROGRAM_MAP(brain_readmem,writemem)
1907   MDRV_CPU_IO_MAP(readport,brain_writeport)
1892   MDRV_CPU_IO_MAP(brain_io_map,0)
19081893
19091894   MDRV_MACHINE_RESET(system1_banked)
19101895
r3289r3290
19171902   MDRV_IMPORT_FROM( system1 )
19181903   MDRV_CPU_MODIFY("main")
19191904   MDRV_CPU_PROGRAM_MAP(wbml_readmem,wbml_writemem)
1920   MDRV_CPU_IO_MAP(wbml_readport,wbml_writeport)
1905   MDRV_CPU_IO_MAP(wbml_io_map,0)
19211906
19221907   MDRV_MACHINE_RESET(wbml)
19231908
r3289r3290
19331918   MDRV_IMPORT_FROM( system1 )
19341919   MDRV_CPU_MODIFY("main")
19351920   MDRV_CPU_PROGRAM_MAP(brain_readmem,chplft_writemem)
1936   MDRV_CPU_IO_MAP(sht_readport,sht_writeport)
1921   MDRV_CPU_IO_MAP(sht_io_map,0)
19371922
19381923   MDRV_MACHINE_RESET(system1_banked)
19391924
r3289r3290
19531938   MDRV_IMPORT_FROM( system1 )
19541939   MDRV_CPU_REPLACE( "main", Z80, 8000000)    /* ? guess ? */
19551940   MDRV_CPU_PROGRAM_MAP(brain_readmem,nobo_writemem)
1956   MDRV_CPU_IO_MAP(nobo_readport,nobo_writeport)
1941   MDRV_CPU_IO_MAP(nobo_io_map,0)
19571942
19581943   MDRV_MACHINE_RESET(system1_banked)
19591944
src/mame/drivers/argus.c
r3289r3290
1717 Argus      (C) 1986 NMK / Jaleco
1818 Valtric    (C) 1986 NMK / Jaleco
1919 Butasan    (C) 1987 NMK / Jaleco
20 Bombs Away (C) 1988 Jaleco
2120
2221
2322System specs :
r3289r3290
111110VIDEO_START( argus );
112111VIDEO_START( valtric );
113112VIDEO_START( butasan );
114VIDEO_START( bombsa );
115113VIDEO_RESET( argus );
116114VIDEO_RESET( valtric );
117115VIDEO_RESET( butasan );
118VIDEO_RESET( bombsa );
119116VIDEO_UPDATE( argus );
120117VIDEO_UPDATE( valtric );
121118VIDEO_UPDATE( butasan );
122VIDEO_UPDATE( bombsa );
123119
124static UINT8 argus_bank_latch   = 0x00;
125static UINT8 butasan_page_latch = 0x00;
126
127120READ8_HANDLER( argus_txram_r );
128READ8_HANDLER( butasan_txram_r );
129READ8_HANDLER( bombsa_txram_r );
130121READ8_HANDLER( argus_bg1ram_r );
131READ8_HANDLER( butasan_bg0ram_r );
132READ8_HANDLER( butasan_bg1ram_r );
133122READ8_HANDLER( argus_paletteram_r );
134READ8_HANDLER( bombsa_paletteram_r );
135READ8_HANDLER( butasan_txbackram_r );
136READ8_HANDLER( butasan_bg0backram_r );
137123
138124WRITE8_HANDLER( argus_txram_w );
139WRITE8_HANDLER( butasan_txram_w );
140WRITE8_HANDLER( bombsa_txram_w );
141125WRITE8_HANDLER( argus_bg1ram_w );
142WRITE8_HANDLER( butasan_bg0ram_w );
143WRITE8_HANDLER( butasan_bg1ram_w );
144126WRITE8_HANDLER( argus_bg0_scrollx_w );
145127WRITE8_HANDLER( argus_bg0_scrolly_w );
146WRITE8_HANDLER( butasan_bg0_scrollx_w );
147128WRITE8_HANDLER( argus_bg1_scrollx_w );
148129WRITE8_HANDLER( argus_bg1_scrolly_w );
149130WRITE8_HANDLER( argus_bg_status_w );
150WRITE8_HANDLER( valtric_bg_status_w );
151WRITE8_HANDLER( butasan_bg0_status_w );
152131WRITE8_HANDLER( argus_flipscreen_w );
153132WRITE8_HANDLER( argus_paletteram_w );
133
134WRITE8_HANDLER( valtric_bg_status_w );
154135WRITE8_HANDLER( valtric_paletteram_w );
136WRITE8_HANDLER( valtric_mosaic_w );
137WRITE8_HANDLER( valtric_unknown_w );
138
139READ8_HANDLER( butasan_pagedram_r );
140READ8_HANDLER( butasan_bg1ram_r );
141READ8_HANDLER( butasan_txbackram_r );
142READ8_HANDLER( butasan_bg0backram_r );
143WRITE8_HANDLER( butasan_pageselect_w );
144WRITE8_HANDLER( butasan_pagedram_w );
145WRITE8_HANDLER( butasan_bg1ram_w );
146WRITE8_HANDLER( butasan_bg0_status_w );
155147WRITE8_HANDLER( butasan_paletteram_w );
156WRITE8_HANDLER( bombsa_paletteram_w );
157148WRITE8_HANDLER( butasan_txbackram_w );
158149WRITE8_HANDLER( butasan_bg0backram_w );
159150WRITE8_HANDLER( butasan_bg1_status_w );
160WRITE8_HANDLER( bombsa_pageselect_w );
161WRITE8_HANDLER( valtric_mosaic_w);
151WRITE8_HANDLER( butasan_unknown_w );
162152
153
163154/***************************************************************************
164155
165156  Interrupt(s)
r3289r3290
169160static INTERRUPT_GEN( argus_interrupt )
170161{
171162   if (cpu_getiloops() == 0)
172      cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7);   /* RST 10h */
163      cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7);   /* RST 10h */
173164   else
174      cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf);   /* RST 08h */
165      cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf);   /* RST 08h */
175166}
176167
177168/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
r3289r3290
197188
198189***************************************************************************/
199190
200#if 0
201static READ8_HANDLER( argus_bankselect_r )
202{
203   return argus_bank_latch;
204}
205#endif
206
207191static WRITE8_HANDLER( argus_bankselect_w )
208192{
209193   UINT8 *RAM = memory_region(machine, "main");
210194   int bankaddress;
211195
212   argus_bank_latch = data;
213196   bankaddress = 0x10000 + ((data & 7) * 0x4000);
214197   memory_set_bankptr(1, &RAM[bankaddress]);    /* Select 8 banks of 16k */
215198}
216199
217static WRITE8_HANDLER( butasan_pageselect_w )
218{
219   butasan_page_latch = data;
220}
221200
222static READ8_HANDLER( butasan_pagedram_r )
223{
224   if (!(butasan_page_latch & 0x01))
225   {
226      if (offset < 0x0800)      /* BG0 RAM */
227      {
228         return butasan_bg0ram_r( machine, offset );
229      }
230      else if (offset < 0x1000)   /* Back BG0 RAM */
231      {
232         return butasan_bg0backram_r( machine, offset - 0x0800 );
233      }
234   }
235   else
236   {
237      if (offset < 0x0800)      /* Text RAM */
238      {
239         return butasan_txram_r( machine, offset );
240      }
241      else if (offset < 0x1000)   /* Back text RAM */
242      {
243         return butasan_txbackram_r( machine, offset - 0x0800 );
244      }
245   }
246
247   return 0;
248}
249
250static WRITE8_HANDLER( butasan_pagedram_w )
251{
252   if (!(butasan_page_latch & 0x01))
253   {
254      if (offset < 0x0800)      /* BG0 RAM */
255      {
256         butasan_bg0ram_w( machine, offset, data );
257      }
258      else if (offset < 0x1000)   /* Back BG0 RAM */
259      {
260         butasan_bg0backram_w( machine, offset - 0x0800, data );
261      }
262   }
263
264   else
265   {
266      if (offset < 0x0800)      /* Text RAM */
267      {
268         butasan_txram_w( machine, offset, data );
269      }
270      else if (offset < 0x1000)   /* Back text RAM */
271      {
272         butasan_txbackram_w( machine, offset - 0x0800, data );
273      }
274   }
275}
276
277
278201/***************************************************************************
279202
280203  Memory Map(s)
r3289r3290
316239   AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w)
317240   AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w)
318241   AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
242   AM_RANGE(0xc300, 0xc300) AM_WRITE(valtric_unknown_w)
319243   AM_RANGE(0xc308, 0xc309) AM_WRITE(argus_bg1_scrollx_w) AM_BASE(&argus_bg1_scrollx)
320244   AM_RANGE(0xc30a, 0xc30b) AM_WRITE(argus_bg1_scrolly_w) AM_BASE(&argus_bg1_scrolly)
321245   AM_RANGE(0xc30c, 0xc30c) AM_WRITE(valtric_bg_status_w)
r3289r3290
336260   AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P2")
337261   AM_RANGE(0xc003, 0xc003) AM_READ_PORT("DSW1")
338262   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("DSW2")
263   AM_RANGE(0xc100, 0xc100) AM_WRITE(butasan_unknown_w)
339264   AM_RANGE(0xc200, 0xc200) AM_WRITE(soundlatch_w)
340265   AM_RANGE(0xc201, 0xc201) AM_WRITE(argus_flipscreen_w)
341266   AM_RANGE(0xc202, 0xc202) AM_WRITE(argus_bankselect_w)
342267   AM_RANGE(0xc203, 0xc203) AM_WRITE(butasan_pageselect_w)
343   AM_RANGE(0xc300, 0xc301) AM_WRITE(butasan_bg0_scrollx_w) AM_BASE(&argus_bg0_scrollx)
268   AM_RANGE(0xc300, 0xc301) AM_WRITE(argus_bg0_scrollx_w) AM_BASE(&argus_bg0_scrollx)
344269   AM_RANGE(0xc302, 0xc303) AM_WRITE(argus_bg0_scrolly_w) AM_BASE(&argus_bg0_scrolly)
345270   AM_RANGE(0xc304, 0xc304) AM_WRITE(butasan_bg0_status_w)
346271   AM_RANGE(0xc308, 0xc309) AM_WRITE(argus_bg1_scrollx_w) AM_BASE(&argus_bg1_scrollx)
r3289r3290
354279   AM_RANGE(0xf680, 0xffff) AM_RAM
355280ADDRESS_MAP_END
356281
357WRITE8_HANDLER( bombsa_txram_w );
358READ8_HANDLER( bombsa_txram_r );
359
360static ADDRESS_MAP_START( bombsa_map, ADDRESS_SPACE_PROGRAM, 8 )
361   AM_RANGE(0x0000, 0x7fff) AM_ROM
362   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1)
363   AM_RANGE(0xc000, 0xcfff) AM_RAM
364
365   /* ports look like the other games */
366   AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_w) // confirmed
367//  AM_RANGE(0xd001, 0xd001) AM_WRITE(argus_flipscreen_w)
368   AM_RANGE(0xd002, 0xd002) AM_WRITE(argus_bankselect_w)
369   AM_RANGE(0xd003, 0xd003) AM_WRITE(bombsa_pageselect_w) // 0,1,0,1,0,1 etc.
370
371   AM_RANGE(0xd000, 0xd1ff) AM_RAM
372   AM_RANGE(0xd200, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
373   AM_RANGE(0xd800, 0xdfff) AM_RAM
374
375   /* Input ports */
376   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("SYSTEM")
377   AM_RANGE(0xe001, 0xe001) AM_READ_PORT("P1")
378   AM_RANGE(0xe002, 0xe002) AM_READ_PORT("P2")
379   AM_RANGE(0xe003, 0xe003) AM_READ_PORT("DSW1")
380   AM_RANGE(0xe004, 0xe004) AM_READ_PORT("DSW2")
381   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(SMH_RAM) // ??
382   AM_RANGE(0xe800, 0xefff) AM_READWRITE(bombsa_txram_r, bombsa_txram_w) AM_BASE(&argus_txram) // banked? it gets corrupted at game start, maybe its banked and one layer can be 16x16 or 8x8?
383   AM_RANGE(0xf000, 0xffff) AM_READWRITE(bombsa_paletteram_r, bombsa_paletteram_w) AM_BASE(&argus_paletteram) // banked?
384ADDRESS_MAP_END
385
386282static ADDRESS_MAP_START( sound_map_a, ADDRESS_SPACE_PROGRAM, 8 )
387283   AM_RANGE(0x0000, 0x7fff) AM_ROM
388284   AM_RANGE(0x8000, 0x87ff) AM_RAM
r3289r3290
395291   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
396292ADDRESS_MAP_END
397293
398static ADDRESS_MAP_START( sound_map_c, ADDRESS_SPACE_PROGRAM, 8 )
399   AM_RANGE(0x0000, 0xbfff) AM_ROM
400   AM_RANGE(0xc000, 0xc7ff) AM_RAM
401   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
402   AM_RANGE(0xf000, 0xf000) AM_WRITEONLY                        // Is this a confirm of some sort?
403ADDRESS_MAP_END
404
294#if 0
405295static ADDRESS_MAP_START( sound_portmap_1, ADDRESS_SPACE_IO, 8 )
406296   ADDRESS_MAP_GLOBAL_MASK(0xff)
407297   AM_RANGE(0x00, 0x00) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w)
408298   AM_RANGE(0x01, 0x01) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w)
409299ADDRESS_MAP_END
300#endif
410301
411302static ADDRESS_MAP_START( sound_portmap_2, ADDRESS_SPACE_IO, 8 )
412303   ADDRESS_MAP_GLOBAL_MASK(0xff)
r3289r3290
461352   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
462353   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW1:6,7")
463354   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
464   PORT_DIPSETTING(    0x06, DEF_STR( Medium ) )
355   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
465356   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
466357   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
467358   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) )      PORT_DIPLOCATION("SW1:5")
468359   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
469360   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
470   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet) )         PORT_DIPLOCATION("SW1:4")
361   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )         PORT_DIPLOCATION("SW1:4")
471362   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
472363   PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
473364   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW1:3")
r3289r3290
491382   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
492383   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
493384   PORT_DIPSETTING(    0x10, DEF_STR( 1C_4C ) )
494   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A) )         PORT_DIPLOCATION("SW2:1,2,3")
385   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW2:1,2,3")
495386   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
496387   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
497388   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )
r3289r3290
505396static INPUT_PORTS_START( valtric )
506397   PORT_INCLUDE( argus )
507398
399   PORT_MODIFY("DSW1")
400   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW1:6,7")
401   PORT_DIPSETTING(    0x06, DEF_STR( Normal ) )
402   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
403   PORT_DIPSETTING(    0x02, DEF_STR( Harder ) )
404   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
405   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )         PORT_DIPLOCATION("SW1:1,2")
406   PORT_DIPSETTING(    0x00, "2" )
407   PORT_DIPSETTING(    0xc0, "3" )
408   PORT_DIPSETTING(    0x80, "4" )
409   PORT_DIPSETTING(    0x40, "5" )
410
508411   PORT_MODIFY("DSW2")
509   PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat")      PORT_DIPLOCATION("SW2:8")
412   PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat)" )   PORT_DIPLOCATION("SW2:8")
510413   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
511414   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
512415   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW2:4,5,6")
r3289r3290
533436   PORT_INCLUDE( valtric )
534437
535438   PORT_MODIFY("SYSTEM")
536   PORT_SERVICE( 0x20,   IP_ACTIVE_LOW )
439   PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
537440
538441   PORT_MODIFY("DSW1")
539442   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) )      PORT_DIPLOCATION("SW1:8")
540443   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
541444   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
542   PORT_DIPNAME( 0x02, 0x02, "Invulnerability (Cheat)")   PORT_DIPLOCATION("SW1:7")
445   PORT_DIPNAME( 0x02, 0x02, "Invulnerability (Cheat)" )   PORT_DIPLOCATION("SW1:7")
543446   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
544447   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
545448   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )         PORT_DIPLOCATION("SW1:5,6")
r3289r3290
561464   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
562465INPUT_PORTS_END
563466
564static INPUT_PORTS_START( bombsa )
565   PORT_INCLUDE( argus )
566467
567   PORT_MODIFY("SYSTEM")
568   PORT_BIT( 0x20,   IP_ACTIVE_LOW, IPT_SERVICE1 )
569
570   PORT_MODIFY("DSW1")
571   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:8" )         // Coin_B
572   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:7" )
573   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:6" )         // Coin_B
574   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:5" )         // Coin_B
575   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:4" )
576   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:3" )
577   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW1:1,2")
578   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
579   PORT_DIPSETTING(    0x40, "2 Coins 1 Credit/4 Coins 3 Credits" )
580   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
581   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
582
583   PORT_MODIFY("DSW2")
584   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:8" )
585   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:7" )
586   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:6" )
587   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:5" )
588   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:4" )
589   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:3" )
590   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:2" )
591   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:1" )
592INPUT_PORTS_END
593
594468/***************************************************************************
595469
596470  Machine Driver(s)
r3289r3290
600474static const gfx_layout charlayout =
601475{
602476   8,8,    /* 8x8 characters */
603   1024,   /* 1024 characters */
477   1024,   /* 1024 characters */
604478   4,      /* 4 bits per pixel */
605479   { 0, 1, 2, 3 },
606480   { 0, 4, 8, 12, 16, 20, 24, 28 },
r3289r3290
611485static const gfx_layout tilelayout_256 =
612486{
613487   16,16,  /* 16x16 characters */
614   256,   /* 256 characters */
488   256,    /* 256 characters */
615489   4,      /* 4 bits per pixel */
616490   { 0, 1, 2, 3 },
617491   { 0, 4, 8, 12, 16, 20, 24, 28,
r3289r3290
624498static const gfx_layout tilelayout_512 =
625499{
626500   16,16,  /* 16x16 characters */
627   512,   /* 512 characters */
501   512,    /* 512 characters */
628502   4,      /* 4 bits per pixel */
629503   { 0, 1, 2, 3 },
630504   { 0, 4, 8, 12, 16, 20, 24, 28,
r3289r3290
637511static const gfx_layout tilelayout_1024 =
638512{
639513   16,16,  /* 16x16 characters */
640   1024,   /* 1024 characters */
514   1024,   /* 1024 characters */
641515   4,      /* 4 bits per pixel */
642516   { 0, 1, 2, 3 },
643517   { 0, 4, 8, 12, 16, 20, 24, 28,
r3289r3290
650524static const gfx_layout tilelayout_2048 =
651525{
652526   16,16,  /* 16x16 characters */
653   2048,   /* 2048 characters */
527   2048,   /* 2048 characters */
654528   4,      /* 4 bits per pixel */
655529   { 0, 1, 2, 3 },
656530   { 0, 4, 8, 12, 16, 20, 24, 28,
r3289r3290
663537static const gfx_layout tilelayout_4096 =
664538{
665539   16,16,  /* 16x16 characters */
666   4096,   /* 4096 characters */
540   4096,   /* 4096 characters */
667541   4,      /* 4 bits per pixel */
668542   { 0, 1, 2, 3 },
669543   { 0, 4, 8, 12, 16, 20, 24, 28,
r3289r3290
681555GFXDECODE_END
682556
683557static GFXDECODE_START( valtric )
684   GFXDECODE_ENTRY( "gfx1", 0, tilelayout_1024, 0*16, 16 )
558   GFXDECODE_ENTRY( "gfx1", 0, tilelayout_1024, 0*16, 16 )
685559   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_2048, 16*16, 16 )
686560   GFXDECODE_ENTRY( "gfx3", 0, charlayout,      32*16, 16 )
687561GFXDECODE_END
r3289r3290
693567   GFXDECODE_ENTRY( "gfx4", 0, charlayout,      32*16, 16 )
694568GFXDECODE_END
695569
696static GFXDECODE_START( bombsa )
697   GFXDECODE_ENTRY( "gfx1", 0, tilelayout_1024, 32*16, 16 )
698   GFXDECODE_ENTRY( "gfx2", 0, tilelayout_1024, 0*16, 16 )
699   GFXDECODE_ENTRY( "gfx3", 0, charlayout,      16*16, 16 )
700GFXDECODE_END
701570
702571static MACHINE_DRIVER_START( argus )
703572
r3289r3290
708577
709578   MDRV_CPU_ADD("audio", Z80, 5000000)
710579   MDRV_CPU_PROGRAM_MAP(sound_map_a,0)
580#if 0
711581   MDRV_CPU_IO_MAP(sound_portmap_1,0)
582#else
583   MDRV_CPU_IO_MAP(sound_portmap_2,0)
584#endif
712585
713586   MDRV_INTERLEAVE(10)
714587
r3289r3290
719592   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
720593   MDRV_SCREEN_SIZE(32*16, 32*16)
721594   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
595
722596   MDRV_GFXDECODE(argus)
723597   MDRV_PALETTE_LENGTH(896)
724598
r3289r3290
729603   /* sound hardware */
730604   MDRV_SPEAKER_STANDARD_MONO("mono")
731605
606#if 0
732607   MDRV_SOUND_ADD("ym", YM2203, 6000000 / 4)
733608   MDRV_SOUND_CONFIG(ym2203_config)
734609   MDRV_SOUND_ROUTE(0, "mono", 0.15)
735610   MDRV_SOUND_ROUTE(1, "mono", 0.15)
736611   MDRV_SOUND_ROUTE(2, "mono", 0.15)
737612   MDRV_SOUND_ROUTE(3, "mono", 0.50)
613#else
614   MDRV_SOUND_ADD("ym1", YM2203, 6000000 / 4)
615   MDRV_SOUND_CONFIG(ym2203_config)
616   MDRV_SOUND_ROUTE(0, "mono", 0.15)
617   MDRV_SOUND_ROUTE(1, "mono", 0.15)
618   MDRV_SOUND_ROUTE(2, "mono", 0.15)
619   MDRV_SOUND_ROUTE(3, "mono", 0.50)
620
621   MDRV_SOUND_ADD("ym2", YM2203, 6000000 / 4)
622   MDRV_SOUND_ROUTE(0, "mono", 0.15)
623   MDRV_SOUND_ROUTE(1, "mono", 0.15)
624   MDRV_SOUND_ROUTE(2, "mono", 0.15)
625   MDRV_SOUND_ROUTE(3, "mono", 0.50)
626#endif
738627MACHINE_DRIVER_END
739628
740629static MACHINE_DRIVER_START( valtric )
r3289r3290
757646   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
758647   MDRV_SCREEN_SIZE(32*16, 32*16)
759648   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
649
760650   MDRV_GFXDECODE(valtric)
761651   MDRV_PALETTE_LENGTH(768)
762652
r3289r3290
801691   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
802692   MDRV_SCREEN_SIZE(32*16, 32*16)
803693   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
694
804695   MDRV_GFXDECODE(butasan)
805696   MDRV_PALETTE_LENGTH(768)
806697
r3289r3290
825716   MDRV_SOUND_ROUTE(3, "mono", 1.0)
826717MACHINE_DRIVER_END
827718
828static MACHINE_DRIVER_START( bombsa )
829719
830   /* basic machine hardware */
831   MDRV_CPU_ADD("main", Z80, 5000000)         /* 5 MHz */
832   MDRV_CPU_PROGRAM_MAP(bombsa_map,0)
833   MDRV_CPU_VBLANK_INT_HACK(argus_interrupt,2)
834
835   MDRV_CPU_ADD("audio", Z80, 12000000 / 2)      /* maybe CPU speeds are reversed? Probably not (ajg) */
836   MDRV_CPU_PROGRAM_MAP(sound_map_c,0)
837   MDRV_CPU_IO_MAP(sound_portmap_2,0)
838
839   MDRV_INTERLEAVE(10)
840
841   /* video hardware */
842   MDRV_SCREEN_ADD("main", RASTER)
843   MDRV_SCREEN_REFRESH_RATE(54)                           /* Guru says : VSync - 54Hz . HSync - 15.25kHz */
844   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
845   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
846   MDRV_SCREEN_SIZE(32*16, 32*16)
847   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
848   MDRV_GFXDECODE(bombsa)
849   MDRV_PALETTE_LENGTH(0x1000/2)
850
851   MDRV_VIDEO_START(bombsa)
852   MDRV_VIDEO_RESET(bombsa)
853   MDRV_VIDEO_UPDATE(bombsa)
854
855   /* sound hardware */
856   MDRV_SPEAKER_STANDARD_MONO("mono")
857
858   MDRV_SOUND_ADD("ym1", YM2203, 12000000 / 8)
859   MDRV_SOUND_CONFIG(ym2203_config)
860   MDRV_SOUND_ROUTE(0, "mono", 0.30)
861   MDRV_SOUND_ROUTE(1, "mono", 0.30)
862   MDRV_SOUND_ROUTE(2, "mono", 0.30)
863   MDRV_SOUND_ROUTE(3, "mono", 1.0)
864
865   MDRV_SOUND_ADD("ym2", YM2203, 12000000 / 8)
866   MDRV_SOUND_ROUTE(0, "mono", 0.30)
867   MDRV_SOUND_ROUTE(1, "mono", 0.30)
868   MDRV_SOUND_ROUTE(2, "mono", 0.30)
869   MDRV_SOUND_ROUTE(3, "mono", 1.0)
870MACHINE_DRIVER_END
871
872
873720/***************************************************************************
874721
875722  Game driver(s)
r3289r3290
878725
879726ROM_START( argus )
880727   ROM_REGION( 0x28000, "main", 0 )                /* Main CPU */
881   ROM_LOAD( "ag_02.bin", 0x00000, 0x08000, CRC(278a3f3d) SHA1(c5ac5a004ebf0194c33f71dab4020fa636cefbc2) )
882   ROM_LOAD( "ag_03.bin", 0x10000, 0x08000, CRC(3a7f3bfa) SHA1(b11e134c084fc3c982dfe31836c1cf3fc0d481fd) )
883   ROM_LOAD( "ag_04.bin", 0x18000, 0x08000, CRC(76adc9f6) SHA1(e223a8b2371c51f121958ee3687c777f597334c9) )
884   ROM_LOAD( "ag_05.bin", 0x20000, 0x08000, CRC(f76692d6) SHA1(1dc353a042cdda909eb9f1b1ca749a3b3eaa01e4) )
728   ROM_LOAD( "ag_02.bin",    0x00000, 0x08000, CRC(278a3f3d) SHA1(c5ac5a004ebf0194c33f71dab4020fa636cefbc2) )
729   ROM_LOAD( "ag_03.bin",    0x10000, 0x08000, CRC(3a7f3bfa) SHA1(b11e134c084fc3c982dfe31836c1cf3fc0d481fd) )
730   ROM_LOAD( "ag_04.bin",    0x18000, 0x08000, CRC(76adc9f6) SHA1(e223a8b2371c51f121958ee3687c777f597334c9) )
731   ROM_LOAD( "ag_05.bin",    0x20000, 0x08000, CRC(f76692d6) SHA1(1dc353a042cdda909eb9f1b1ca749a3b3eaa01e4) )
885732
886733   ROM_REGION( 0x10000, "audio", 0 )               /* Sound CPU */
887   ROM_LOAD( "ag_01.bin", 0x00000, 0x04000, CRC(769e3f57) SHA1(209160a96486ab0b90967c015143ec28fba2e2a4) )
734   ROM_LOAD( "ag_01.bin",    0x00000, 0x04000, CRC(769e3f57) SHA1(209160a96486ab0b90967c015143ec28fba2e2a4) )
888735
889736   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE )   /* Sprite */
890   ROM_LOAD( "ag_09.bin", 0x00000, 0x08000, CRC(6dbc1c58) SHA1(ef7b6901b702dd347b3a3f162162138175efe578) )
891   ROM_LOAD( "ag_08.bin", 0x08000, 0x08000, CRC(ce6e987e) SHA1(9de257d8061ec917f4d443ff509fd457f995d73b) )
892   ROM_LOAD( "ag_07.bin", 0x10000, 0x08000, CRC(bbb9638d) SHA1(61dec71d4d976bef3af26d0dc9c0355fd1098ffb) )
893   ROM_LOAD( "ag_06.bin", 0x18000, 0x08000, CRC(655b48f8) SHA1(4fce1dffe091b97e7055955743434e49e97b4b79) )
737   ROM_LOAD( "ag_09.bin",    0x00000, 0x08000, CRC(6dbc1c58) SHA1(ef7b6901b702dd347b3a3f162162138175efe578) )
738   ROM_LOAD( "ag_08.bin",    0x08000, 0x08000, CRC(ce6e987e) SHA1(9de257d8061ec917f4d443ff509fd457f995d73b) )
739   ROM_LOAD( "ag_07.bin",    0x10000, 0x08000, CRC(bbb9638d) SHA1(61dec71d4d976bef3af26d0dc9c0355fd1098ffb) )
740   ROM_LOAD( "ag_06.bin",    0x18000, 0x08000, CRC(655b48f8) SHA1(4fce1dffe091b97e7055955743434e49e97b4b79) )
894741
895742   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )   /* BG0 */
896   ROM_LOAD( "ag_13.bin", 0x00000, 0x08000, CRC(20274268) SHA1(9b7767d14bd169dabe6add0623d353bf4b59779b) )
897   ROM_LOAD( "ag_14.bin", 0x08000, 0x08000, CRC(ceb8860b) SHA1(90e094686d9d18e49e4848d18d1e31ac95f13937) )
898   ROM_LOAD( "ag_11.bin", 0x10000, 0x08000, CRC(99ce8556) SHA1(39caababd6e20ecb0375b85fb6490ee0b04f0949) )
899   ROM_LOAD( "ag_12.bin", 0x18000, 0x08000, CRC(e0e5377c) SHA1(b5981d832127d0b28b6a7bb0437716593e0ed71a) )
743   ROM_LOAD( "ag_13.bin",    0x00000, 0x08000, CRC(20274268) SHA1(9b7767d14bd169dabe6add0623d353bf4b59779b) )
744   ROM_LOAD( "ag_14.bin",    0x08000, 0x08000, CRC(ceb8860b) SHA1(90e094686d9d18e49e4848d18d1e31ac95f13937) )
745   ROM_LOAD( "ag_11.bin",    0x10000, 0x08000, CRC(99ce8556) SHA1(39caababd6e20ecb0375b85fb6490ee0b04f0949) )
746   ROM_LOAD( "ag_12.bin",    0x18000, 0x08000, CRC(e0e5377c) SHA1(b5981d832127d0b28b6a7bb0437716593e0ed71a) )
900747
901748   ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE )   /* BG1 */
902   ROM_LOAD( "ag_17.bin", 0x00000, 0x08000, CRC(0f12d09b) SHA1(718db4ff016526dddacdf6f0088f247ee97c6543) )
749   ROM_LOAD( "ag_17.bin",    0x00000, 0x08000, CRC(0f12d09b) SHA1(718db4ff016526dddacdf6f0088f247ee97c6543) )
903750
904751   ROM_REGION( 0x08000, "gfx4", ROMREGION_DISPOSE )   /* Text */
905   ROM_LOAD( "ag_10.bin", 0x00000, 0x04000, CRC(2de696c4) SHA1(1ad0f1cde127a1618c2ea74a53e522963a79e5ce) )
752   ROM_LOAD( "ag_10.bin",    0x00000, 0x04000, CRC(2de696c4) SHA1(1ad0f1cde127a1618c2ea74a53e522963a79e5ce) )
906753
907754   ROM_REGION( 0x08000, "user1", 0 )               /* Map */
908   ROM_LOAD( "ag_15.bin", 0x00000, 0x08000, CRC(99834c1b) SHA1(330f271771b158493b28bb178c8cda98efd1d90c) )
755   ROM_LOAD( "ag_15.bin",    0x00000, 0x08000, CRC(99834c1b) SHA1(330f271771b158493b28bb178c8cda98efd1d90c) )
909756
910757   ROM_REGION( 0x08000, "user2", 0 )               /* Pattern */
911   ROM_LOAD( "ag_16.bin", 0x00000, 0x08000, CRC(39a51714) SHA1(ad89a630f1352eb4d8beeeebf909d5e2b5d7cc12) )
758   ROM_LOAD( "ag_16.bin",    0x00000, 0x08000, CRC(39a51714) SHA1(ad89a630f1352eb4d8beeeebf909d5e2b5d7cc12) )
912759ROM_END
913760
914761ROM_START( valtric )
r3289r3290
969816ROM_END
970817
971818
972/*
973Bombs Away
974Jaleco, 1988
975
976PCB Layout
977----------
978
979BB-8744
980|------------------------------------------|
981|         1      Z80(1)          4         |
982|         6116      5MHz                  |-|
983|VOL      YM2203                 5        | |
984|4558     YM2203      Z80(2)              | |
985|4558 YM3014                     6        | |
986|     YM3014                              | |
987|J          6116                6264      | |
988|A                                        |-|
989|M                                         |
990|M                                         |
991|A                                        |-|
992|                                         | |
993|                                         | |
994|                2   62256                | |
995| DSW1                                    | |
996|                3   62256                | |
997| DSW2    82S137                          |-|
998|                                          |
999|------------------------------------------|
1000Notes:
1001      Z80(1) clock - 5.000MHz
1002      Z80(2) clock - 6.000MHz [12/2]
1003      YM2203 clock - 1.500MHz [12/8, both]
1004      VSync - 54Hz
1005      HSync - 15.25kHz
1006
1007
1008BB-8745
1009|--------------------------------|
1010|                                |
1011|                      |-----|  |-|
1012|                      |N8633|  | |
1013|                      |-S   |  | |
1014|                      |-----|  | |
1015|  82S123                       | |
1016|              |-----|          | |
1017|              |N8633|          |-|
1018|              |-V   |           |
1019|2018          |     |           |
1020|2018        7 |6116 |    12MHz |-|
1021|              |-----|          | |
1022|      |-----|                  | |
1023|      |N8633|                  | |
1024|      |-V64 |                  | |
1025|      |     |                  | |
1026| 9  8 |6264 |                  |-|
1027|      |-----|                   |
1028|--------------------------------|
1029Notes:
1030      3 soldered-in 'modules' are located on this PCB.
1031      N-8633-V 6-7 TOYOCOM
1032      N-8633-V64 6-7 TOYOCOM
1033      N-8633-S 6-7 TOYOCOM
1034      The 2 larger ones have 62 pins, 31 pins on each side of a small PCB. The PCB contains some
1035      surface mounted logic chips and some surface mounted RAM.
1036      The smaller module has 40 pins, 20 pins on each side of a small PCB. The PCB contains only
1037      logic on both sides.
1038*/
1039
1040ROM_START( bombsa )
1041   ROM_REGION( 0x30000, "main", 0 )               /* Main CPU */
1042   ROM_LOAD( "4.7a", 0x00000, 0x08000, CRC(0191f6a7) SHA1(10a0434abbf4be068751e65c81b1a211729e3742) )
1043   /* these fail their self-test... should be checked on real hw (hold start1+start2 on boot) */
1044   ROM_LOAD( "5.7c", 0x10000, 0x08000, BAD_DUMP CRC(095c451a) SHA1(892ca84376f89640ad4d28f1e548c26bc8f72c0e) ) // contains palettes etc. but fails rom check??
1045   ROM_LOAD( "6.7d", 0x20000, 0x10000, BAD_DUMP CRC(89f9dc0f) SHA1(5cf6a7aade3d56bc229d3771bc4141ad0c0e8da2) )
1046
1047   ROM_REGION( 0x10000, "audio", 0 )               /* Sound CPU */
1048   ROM_LOAD( "1.3a", 0x00000, 0x08000, CRC(92801404) SHA1(c4ff47989d355b18a909eaa88f138e2f68178ecc) )
1049
1050   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE )   /* Sprite */
1051   ROM_LOAD( "2.4p", 0x00000, 0x10000, CRC(bd972ff4) SHA1(63bfb455bc0ae1d31e6f1066864ec0c8d2d0cf99) )
1052   ROM_LOAD( "3.4s", 0x10000, 0x10000, CRC(9a8a8a97) SHA1(13328631202c196c9d8791cc6063048eb6be0472) )
1053
1054   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )   /* BG0 */
1055   /* some corrupt 'blank' characters, should also be checked with a redump */
1056   ROM_LOAD( "8.2l", 0x00000, 0x10000, BAD_DUMP CRC(3391c769) SHA1(7ae7575ac81d6e0d915c279c1f57a9bc6d096bd6) )
1057   ROM_LOAD( "9.2m", 0x10000, 0x10000, BAD_DUMP CRC(5b315976) SHA1(d17cc1926f926bdd88b66ea6af88dac30880e7d4) )
1058
1059   ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE )   /* Text */
1060   ROM_LOAD( "7.4f", 0x00000, 0x08000, CRC(400114b9) SHA1(db2f3ba05a2005ae0e0e7d19c8739353032cbeab) )
1061
1062   ROM_REGION( 0x08000, "user1", ROMREGION_DISPOSE )   /* Proms */
1063   ROM_LOAD( "82s131.7l", 0x000, 0x200, CRC(6a7d13c0) SHA1(2a835a4ac1acb7663d0b915d0339af9800284da6) )
1064   ROM_LOAD( "82s137.3t", 0x000, 0x400, CRC(59e44236) SHA1(f53d99694fa5acd7cc51dd78e09f0d2ef730e7a4) )
1065ROM_END
1066
1067
1068/*  ( YEAR   NAME     PARENT  MACHINE   INPUT     INIT  MONITOR  COMPANY                 FULLNAME ) */
819/*  ( YEAR   NAME     PARENT  MACHINE   INPUT     INIT  MONITOR  COMPANY                   FULLNAME ) */
1069820GAME( 1986, argus,    0,      argus,    argus,    0,    ROT270,  "[NMK] (Jaleco license)", "Argus"          , GAME_IMPERFECT_GRAPHICS )
1070821GAME( 1986, valtric,  0,      valtric,  valtric,  0,    ROT270,  "[NMK] (Jaleco license)", "Valtric"        , GAME_IMPERFECT_GRAPHICS )
1071822GAME( 1987, butasan,  0,      butasan,  butasan,  0,    ROT0,    "[NMK] (Jaleco license)", "Butasan (Japan)", GAME_IMPERFECT_GRAPHICS )
1072GAME( 1988, bombsa,   0,      bombsa,   bombsa,   0,    ROT270,  "Jaleco",                 "Bombs Away"     , GAME_NOT_WORKING )
src/mame/drivers/namcona1.c
r3289r3290
1818-   X-Day 2
1919
2020To Do:
21- Remove remaining MCU simulation hacks
22- View area / screen resolution controlled by registers?
2123
22- view area / screen resolution controlled by registers?
23
24- Xday 2:
24- X-Day 2:
2525    Rom board  M112
2626    Rom board custom Key chip i.d. C394
2727    Game uses a small cash-register type printer (connects to rom board)
r3289r3290
162162#include "deprecat.h"
163163#include "namcona1.h"
164164#include "sound/c140.h"
165#include "sound/namcona.h"
166165#include "cpu/m37710/m37710.h"
167166
168167static UINT16 *mpBank0, *mpBank1;
169static UINT8 mCoinCount[4];
170static UINT8 mCoinState;
171static UINT16 *mcu_ram;
172168static int mEnableInterrupts;
173169int namcona1_gametype;
174static int is_na2;
175170
176171/*************************************************************************/
177172
r3289r3290
370365   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
371366INPUT_PORTS_END
372367
373static INPUT_PORTS_START( namcona2_joy )
374   PORT_START("DSW")
375   PORT_DIPNAME( 0x01, 0x00, "DIP2 (Freeze)" )
376   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
377   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
378   PORT_DIPNAME( 0x02, 0x00, "DIP1 (Test)" )
379   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
380   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
381   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Test ) )
382   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
383   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
384   PORT_DIPNAME( 0x40, 0x00, "SERVICE" )
385   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
386   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
387   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE )
388368
389   PORT_START("P1")
390   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
391   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
392   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
393   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
394   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
395   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
396   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
397   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
398
399   PORT_START("P2")
400   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
401   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
402   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
403   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
404   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
405   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
406   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
407   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
408
409   PORT_START("P3")
410   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
411   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
412   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
413   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
414   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)
415   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3)
416   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3)
417   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START3 )
418
419   PORT_START("P4")
420   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
421   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
422   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
423   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
424   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4)
425   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4)
426   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4)
427   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 )
428
429   PORT_START("COIN")
430   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
431   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
432   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
433   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN3 )
434   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN4 )
435INPUT_PORTS_END
436
437static INPUT_PORTS_START( namcona2_quiz )
438   PORT_START("DSW")
439   PORT_DIPNAME( 0x01, 0x00, "DIP2 (Freeze)" )
440   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
441   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
442   PORT_DIPNAME( 0x02, 0x00, "DIP1 (Test)" )
443   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
444   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
445   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Test ) )
446   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
447   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
448   PORT_DIPNAME( 0x40, 0x00, "SERVICE" )
449   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
450   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
451   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE )
452
453   PORT_START("P1")
454   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 )
455   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 )
456   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )
457   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
458   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
459   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
460   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
461   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
462
463   PORT_START("P2")
464   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2)
465   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
466   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
467   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
468   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
469   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
470   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
471   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
472
473   PORT_START("P3")
474   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(3)
475   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3)
476   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3)
477   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)
478   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
479   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
480   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
481   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START3 )
482
483   PORT_START("P4")
484   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(4)
485   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4)
486   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4)
487   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4)
488   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
489   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
490   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
491   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 )
492
493   PORT_START("COIN")
494   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
495   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
496   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
497   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN3 )
498   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN4 )
499INPUT_PORTS_END
500
501369/***************************************************************************/
502370
503static void
504simulate_mcu( running_machine *machine )
371/* FIXME: These two functions shouldn't be necessary? */
372static void simulate_mcu( running_machine *machine )
505373{
506   int i;
507   UINT16 data;
508   UINT8 poll_coins;
509   static const char *const portnames[] = { "P1", "P2", "P3", "P4" };
510
511374   namcona1_workram[0xf60/2] = 0x0000; /* mcu ready */
512
513   if (is_na2)
514   {
515      mcu_ram[0xfc0/2] = input_port_read(machine, "DSW"); /* dipswitch */
516
517      for( i=1; i<=4; i++ )
518      {
519         data = input_port_read(machine, portnames[i-1])<<8;
520         switch( namcona1_gametype )
521         {
522         case NAMCO_KNCKHEAD:
523         case NAMCO_BKRTMAQ:
524         case NAMCO_QUIZTOU:
525         case NAMCO_EXBANIA:
526            data |= data>>8;
527            break;
528
529         case NAMCO_XDAY2:
530            data |= data>>8; /* wrong! */
531            break;
532
533         case NAMCO_TINKLPIT:
534            if( data&0x2000 ) data |= 0x20; /* throw */
535            if( data&0x4000 ) data |= 0x10; /* jump */
536            if( i==1 )
537            {
538               if( input_port_read(machine, "P1") & 0x80 ) data |= 0x80; /* P1 start */
539            }
540            if( i==2 )
541            {
542               if( input_port_read(machine, "P2") & 0x80 ) data |= 0x80; /* P2 start */
543            }
544            break;
545
546         default:
547            break;
548         }
549         mcu_ram[0xfc0/2+i] = data;
550      }
551
552      /* "analog" and "encoder" ports are polled during test mode,
553         * but I haven't found any games that make use of them.
554         */
555      mcu_ram[0xfc0/2+0x05] = 0xffff; /* analog0,1 */
556      mcu_ram[0xfc0/2+0x06] = 0xffff; /* analog2,3 */
557      mcu_ram[0xfc0/2+0x07] = 0xffff; /* analog4,5 */
558      mcu_ram[0xfc0/2+0x08] = 0xffff; /* analog6,7 */
559      mcu_ram[0xfc0/2+0x09] = 0xffff; /* encoder0,1 */
560
561      poll_coins = input_port_read(machine, "COIN"); /* coin input */
562      if( (poll_coins&0x8)&~(mCoinState&0x8) ) mCoinCount[0]++;
563      if( (poll_coins&0x4)&~(mCoinState&0x4) ) mCoinCount[1]++;
564      if( (poll_coins&0x2)&~(mCoinState&0x2) ) mCoinCount[2]++;
565      if( (poll_coins&0x1)&~(mCoinState&0x1) ) mCoinCount[3]++;
566      mCoinState = poll_coins;
567
568      mcu_ram[0xfc0/2+0xa] = (mCoinCount[0]<<8)|mCoinCount[1];
569      mcu_ram[0xfc0/2+0xb] = (mCoinCount[2]<<8)|mCoinCount[3];
570
571      /* special handling for F/A */
572      data = ~((input_port_read(machine, "P1")<<8)|input_port_read(machine, "P2"));
573      mcu_ram[0xffc/2] = data;
574      mcu_ram[0xffe/2] = data;
575
576      if( namcona1_gametype == NAMCO_XDAY2 )
577      {
578         int p1 = input_port_read(machine, "P1");
579         int p2 = input_port_read(machine, "P2");
580         UINT32 code = 0;
581         if( p2&0x40 ) code |= 0x2000; // enter (top-level of self-test)
582         if( p2&0x20 ) code |= 0x1000; // exit  (top-level of self-test)
583         if( p1&0x40 ) code |= 0x0020; // next  (top-level of self-test)
584         if( p1&0x20 ) code |= 0x0010; // prev  (top-level of self-test)
585         code = ~code;
586         mcu_ram[0xffc/2] = code>>16;
587         mcu_ram[0xffe/2] = code&0xffff;
588      }
589   }
590} /* simulate_mcu */
591
592#ifdef UNUSED_FUNCTION
593static READ16_HANDLER( namcona1_mcu_r )
594{
595   return mcu_ram[offset];
596375}
597#endif
598376
599static WRITE16_HANDLER( namcona1_mcu_w )
600{
601   COMBINE_DATA( &mcu_ram[offset] );
602   if( offset>=0x400/2 && (offset<0x820/2 || (offset>=0xf30/2 && offset<0xf72/2)) )
603   {
604      logerror( "0x%03x: 0x%04x\n", offset*2, mcu_ram[offset] );
605   }
606   /*
607        400..53d  code for MCU?
608377
609        820:                    song select
610        822:                    song control (volume? tempo?)
611        824,826,828,....89e:    sample select
612            0x40 is written to odd addresses to signal the MCU that a sound command has been issued
613
614        8f0: 0x07 unknown
615        8f2: 0x01 unknown
616        8f4: 0xa4 unknown
617
618        f30..f71    data for MCU
619        f72: MCU command:
620            0x07 = identify version
621            0x03 = process data
622            0x87 = ?
623
624        fc0..fc9: used by knuckleheads (NA2-specific?)
625
626        fd8: ?
627
628        fbf: watchdog
629    */
630}
631
632378/* NA2 hardware sends a special command to the MCU, then tests to
633379 * see if the proper BIOS version string appears in shared memory.
634380 */
r3289r3290
643389   {
644390      namcona1_workram[0x1000/2+i] = source[i];
645391   }
646} /* write_version_info */
392}
647393
648static WRITE16_HANDLER( mcu_command_w )
649{
650   UINT16 cmd = mcu_ram[0xf72/2]>>8;
651
652   switch( cmd ){
653   case 0x03:
654      /* Process data at 0xf30..0xf71
655         *
656         * f30: 0101 0020 0400 013e 8a00 0000 0000 011e
657         * f40: 0301 0000 0000 0000 8a16 0000 0000 012c
658         * f50: 0301 0000 0000 0000 8a61 0000 0000 019e
659         * f60: 0301 0000 0000 0000 8a61 0000 0000 01ae
660         * f70: 0000
661         *
662         * f30: 0301 0000 0000 0000 8a88 0000 0000 0120
663         * f40: 0301 0000 0000 0000 8ad1 0000 0000 015a
664         * f50: 0301 0000 0000 0000 8af6 0000 0000 011c
665         * f60: 0301 0000 0000 0000 8b08 0000 0000 0114
666         * f70: 0000
667         *
668         * f30: 0300 0000 0000 0000 8b1f 2004 0000 0000
669         * f40: 0301 0000 0000 0000 8b33 0000 0000 8902
670         * f50: 0000
671         */
672      break;
673
674   case 0x07:
675      /* This command is used to detect Namco NA-2 hardware; without it,
676         * NA-2 games (Knuckleheads, Numan Athletics) refuse to run.
677         */
678      write_version_info();
679      break;
680   }
681} /* mcu_command_w */
682
683/***************************************************************************/
684/* sound
685 *
686 * 8 bit signed PCM data
687 * copied to workram
688 *
689 *  0x01fffc: pointer
690 *  0x020000: samples
691 *  0x040000: samples
692 *  0x060000: samples
693 *
694 *  0x070000: metadata; 10 byte frames
695 */
696
697/***************************************************************************/
698
699394/**
700395 * "Custom Key" Emulation
701396 *
r3289r3290
800495   return namcona1_vreg[offset];
801496} /* namcona1_vreg_r */
802497
803static int
804transfer_dword( running_machine *machine, UINT32 dest, UINT32 source )
498static int transfer_dword( running_machine *machine, UINT32 dest, UINT32 source )
805499{
806500   UINT16 data;
807501
r3289r3290
846540   return 0;
847541} /* transfer_dword */
848542
849static void
850blit_setup( int format, int *bytes_per_row, int *pitch, int mode )
543static void blit_setup( int format, int *bytes_per_row, int *pitch, int mode )
851544{
852545   if( mode == 3 )
853546   { /* TILE DATA */
r3289r3290
1027720{
1028721//  logerror("mailbox_w_68k: %x @ %x\n", data, offset);
1029722
1030   if (offset == 4) cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE);
723   if (offset == 4)
724      cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE);
1031725
1032726   COMBINE_DATA(&mcu_mailbox[offset%8]);
727
728   /* FIXME: This shouldn't be necessary now that the C70 BIOS is implemented,
729    but for some reason the MCU never responds to the version string command */
730   if ( (namcona1_gametype == NAMCO_NUMANATH) || (namcona1_gametype == NAMCO_KNCKHEAD) )
731   {
732      if ((namcona1_workram[0xf72/2] >> 8) == 7)
733         write_version_info();
734   }
1033735}
1034736
1035737static WRITE16_HANDLER( mcu_mailbox_w_mcu )
r3289r3290
1053755   AM_RANGE(0xfff000, 0xffffff) AM_RAM   AM_BASE(&spriteram16)         /* spriteram */
1054756ADDRESS_MAP_END
1055757
758
759static ADDRESS_MAP_START( namcona2_main_map, ADDRESS_SPACE_PROGRAM, 16 )
760   AM_RANGE(0x000000, 0x07ffff) AM_RAM AM_BASE(&namcona1_workram)
761   AM_RANGE(0x3f8000, 0x3fffff) AM_READWRITE(mcu_mailbox_r, mcu_mailbox_w_68k)
762   AM_RANGE(0x400000, 0xbfffff) AM_ROM AM_REGION("main", 0x280000)   /* data */
763   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(SMH_NOP) /* xday: serial out? */
764   AM_RANGE(0xd40000, 0xd40001) AM_WRITE(SMH_NOP) /* xday: serial out? */
765   AM_RANGE(0xd80000, 0xd80001) AM_WRITE(SMH_NOP) /* xday: serial out? */
766   AM_RANGE(0xdc0000, 0xdc001f) AM_WRITE(SMH_NOP) /* xday: serial config? */
767   AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION("main", 0x080000)   /* code */
768   AM_RANGE(0xe00000, 0xe00fff) AM_READWRITE(namcona1_nvram_r, namcona1_nvram_w)
769   /* xday: additional battery-backed ram at 00E024FA? */
770   AM_RANGE(0xe40000, 0xe4000f) AM_READWRITE(custom_key_r, custom_key_w)
771   AM_RANGE(0xefff00, 0xefffff) AM_READWRITE(namcona1_vreg_r, namcona1_vreg_w) AM_BASE(&namcona1_vreg)
772   AM_RANGE(0xf00000, 0xf01fff) AM_READWRITE(namcona1_paletteram_r, namcona1_paletteram_w) AM_BASE(&paletteram16)
773   AM_RANGE(0xf40000, 0xf7ffff) AM_READWRITE(namcona1_gfxram_r, namcona1_gfxram_w)
774   AM_RANGE(0xff0000, 0xffbfff) AM_READWRITE(namcona1_videoram_r,    namcona1_videoram_w) AM_BASE(&videoram16)
775   AM_RANGE(0xffd000, 0xffdfff) AM_RAM /* unknown */
776   AM_RANGE(0xffe000, 0xffefff) AM_RAM   AM_BASE(&namcona1_scroll)      /* scroll registers */
777   AM_RANGE(0xfff000, 0xffffff) AM_RAM   AM_BASE(&spriteram16)         /* spriteram */
778ADDRESS_MAP_END
779
780
1056781/* ----- NA-1 MCU handling ----------------------------------- */
1057782
1058783static READ16_HANDLER( na1mcu_shared_r )
r3289r3290
12851010   MDRV_CPU_PROGRAM_MAP(namcona1_main_map,0)
12861011   MDRV_CPU_VBLANK_INT_HACK(namcona1_interrupt,5)
12871012
1288   MDRV_CPU_ADD("mcu", M37710, 50113000/4)
1013   MDRV_CPU_ADD("mcu", M37702, 50113000/4)
12891014   MDRV_CPU_PROGRAM_MAP(namcona1_mcu_map, 0)
12901015   MDRV_CPU_IO_MAP( namcona1_mcu_io_map, 0 )
12911016   MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 2)
r3289r3290
13311056   MDRV_SCREEN_VISIBLE_AREA(0, 38*8-1-0, 4*8, 32*8-1)
13321057MACHINE_DRIVER_END
13331058
1334static ADDRESS_MAP_START( namcona2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1335   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_RAM) /* work RAM */
1336   AM_RANGE(0x400000, 0xbfffff) AM_ROM AM_REGION("main", 0x280000)   /* data */
1337   AM_RANGE(0xc00000, 0xdfffff) AM_ROM AM_REGION("main", 0x080000)   /* code */
1338   AM_RANGE(0xe00000, 0xe00fff) AM_READ(namcona1_nvram_r)
1339   /* xday: additional battery-backed ram at 00E024FA? */
1340   AM_RANGE(0xe40000, 0xe4000f) AM_READ(custom_key_r)
1341   AM_RANGE(0xefff00, 0xefffff) AM_READ(namcona1_vreg_r)
1342   AM_RANGE(0xf00000, 0xf01fff) AM_READ(namcona1_paletteram_r)
1343   AM_RANGE(0xf40000, 0xf7ffff) AM_READ(namcona1_gfxram_r)
1344   AM_RANGE(0xff0000, 0xffbfff) AM_READ(namcona1_videoram_r)
1345   AM_RANGE(0xffd000, 0xffdfff) AM_READ(SMH_RAM) /* unknown */
1346   AM_RANGE(0xffe000, 0xffefff) AM_READ(SMH_RAM) /* scroll registers */
1347   AM_RANGE(0xfff000, 0xffffff) AM_READ(SMH_RAM) /* spriteram */
1348ADDRESS_MAP_END
13491059
1350static ADDRESS_MAP_START( namcona2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1351   AM_RANGE(0x000000, 0x000fff) AM_WRITE(namcona1_mcu_w) AM_BASE(&mcu_ram)
1352   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_workram)
1353   AM_RANGE(0x3f8008, 0x3f8009) AM_WRITE(mcu_command_w)
1354   AM_RANGE(0xd00000, 0xd00001) AM_WRITE(SMH_NOP) /* xday: serial out? */
1355   AM_RANGE(0xd40000, 0xd40001) AM_WRITE(SMH_NOP) /* xday: serial out? */
1356   AM_RANGE(0xd80000, 0xd80001) AM_WRITE(SMH_NOP) /* xday: serial out? */
1357   AM_RANGE(0xdc0000, 0xdc001f) AM_WRITE(SMH_NOP) /* xday: serial config? */
1358   AM_RANGE(0x400000, 0xdfffff) AM_WRITE(SMH_ROM) /* data + code */
1359   AM_RANGE(0xe00000, 0xe00fff) AM_WRITE(namcona1_nvram_w)
1360   AM_RANGE(0xe40000, 0xe4000f) AM_WRITE(custom_key_w)
1361   AM_RANGE(0xefff00, 0xefffff) AM_WRITE(namcona1_vreg_w) AM_BASE(&namcona1_vreg)
1362   AM_RANGE(0xf00000, 0xf01fff) AM_WRITE(namcona1_paletteram_w) AM_BASE(&paletteram16)
1363   AM_RANGE(0xf40000, 0xf7ffff) AM_WRITE(namcona1_gfxram_w)
1364   AM_RANGE(0xff0000, 0xffbfff) AM_WRITE(namcona1_videoram_w) AM_BASE(&videoram16)
1365   AM_RANGE(0xffd000, 0xffdfff) AM_WRITE(SMH_RAM) /* unknown */
1366   AM_RANGE(0xffe000, 0xffefff) AM_WRITE(SMH_RAM) AM_BASE(&namcona1_scroll)
1367   AM_RANGE(0xfff000, 0xffffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16)
1368ADDRESS_MAP_END
1369
1370static namcona_interface NAMCONA_interface =
1371{
1372   NULL,
1373   0x70000/2
1374};
1375
13761060static MACHINE_DRIVER_START( namcona2 )
1061
13771062   /* basic machine hardware */
1378   MDRV_CPU_ADD("main", M68000, 50113000/4)
1379   MDRV_CPU_PROGRAM_MAP(namcona2_readmem,namcona2_writemem)
1380   MDRV_CPU_VBLANK_INT_HACK(namcona1_interrupt,5)
1063   MDRV_IMPORT_FROM(namcona1)
13811064
1382   MDRV_NVRAM_HANDLER(namcosna1)
1383   MDRV_INTERLEAVE(40)
1384
1385   /* video hardware */
1386   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
1387
1388   MDRV_SCREEN_ADD("main", RASTER)
1389   MDRV_SCREEN_REFRESH_RATE(60)
1390   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
1391   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1392   MDRV_SCREEN_SIZE(38*8, 32*8)
1393   MDRV_SCREEN_VISIBLE_AREA(8, 38*8-1-8, 4*8, 32*8-1)
1394
1395   MDRV_PALETTE_LENGTH(0x2000)
1396
1397   MDRV_VIDEO_START(namcona1)
1398   MDRV_VIDEO_UPDATE(namcona1)
1399
1400   /* sound hardware */
1401   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1402
1403   MDRV_SOUND_ADD("namco", NAMCONA, 4*8000)
1404   MDRV_SOUND_CONFIG(NAMCONA_interface)
1405   MDRV_SOUND_ROUTE(0, "left", 1.0)
1406   MDRV_SOUND_ROUTE(1, "right", 1.0)
1065   MDRV_CPU_REPLACE("main", M68000, 50113000/4)
1066   MDRV_CPU_PROGRAM_MAP(namcona2_main_map, 0)
14071067MACHINE_DRIVER_END
14081068
1409static void
1410init_namcona1( running_machine *machine, int gametype )
1411{
1412   UINT16 *pMem = (UINT16 *)memory_region( machine, "main" );
14131069
1414   namcona1_gametype = gametype;
1415   mpBank0 = &pMem[0x80000/2];
1416   mpBank1 = mpBank0 +  0x200000/2;
1417
1418   is_na2 = 0;
1419   mEnableInterrupts = 0;
1420}
1421
1422static void
1423init_namcona2( running_machine *machine, int gametype )
1070static void init_namcona1( running_machine *machine, int gametype )
14241071{
14251072   UINT16 *pMem = (UINT16 *)memory_region( machine, "main" );
14261073
1427   namcona1_workram[0] = 0x0007; namcona1_workram[1] = 0xfffc; /* (?) stack */
1428   namcona1_workram[2] = 0x00c0; namcona1_workram[3] = 0x0000; /* reset vector */
1429
14301074   namcona1_gametype = gametype;
14311075   mpBank0 = &pMem[0x80000/2];
14321076   mpBank1 = mpBank0 +  0x200000/2;
14331077
1434   is_na2 = 1;
1435   mCoinCount[0] = mCoinCount[1] = mCoinCount[2] = mCoinCount[3] = 0;
1436   mCoinState = 0;
14371078   mEnableInterrupts = 0;
1438
1439   NAMCONA_interface.memory_base = namcona1_workram;
1440   if (namcona1_gametype == NAMCO_KNCKHEAD)
1441      NAMCONA_interface.metadata_offset = 0x10000/2;
1442   else
1443      NAMCONA_interface.metadata_offset = 0x70000/2;
14441079}
14451080
14461081static DRIVER_INIT( bkrtmaq ){      init_namcona1(machine, NAMCO_BKRTMAQ); }
14471082static DRIVER_INIT( cgangpzl ){   init_namcona1(machine, NAMCO_CGANGPZL); }
1448static DRIVER_INIT( emeralda ){   init_namcona2(machine, NAMCO_EMERALDA); } /* NA-2 Hardware */
1083static DRIVER_INIT( emeralda ){   init_namcona1(machine, NAMCO_EMERALDA); } /* NA-2 Hardware */
14491084static DRIVER_INIT( emeraldj ){   init_namcona1(machine, NAMCO_EMERALDA); } /* NA-1 Hardware */
14501085static DRIVER_INIT( exbania ){      init_namcona1(machine, NAMCO_EXBANIA); }
14511086static DRIVER_INIT( fa ){           init_namcona1(machine, NAMCO_FA); }
1452static DRIVER_INIT( knckhead ){   init_namcona2(machine, NAMCO_KNCKHEAD); }
1453static DRIVER_INIT( numanath ){   init_namcona2(machine, NAMCO_NUMANATH); }
1454static DRIVER_INIT( quiztou ){      init_namcona2(machine, NAMCO_QUIZTOU); }
1087static DRIVER_INIT( knckhead ){   init_namcona1(machine, NAMCO_KNCKHEAD); }
1088static DRIVER_INIT( numanath ){   init_namcona1(machine, NAMCO_NUMANATH); }
1089static DRIVER_INIT( quiztou ){      init_namcona1(machine, NAMCO_QUIZTOU); }
14551090static DRIVER_INIT( swcourt ){      init_namcona1(machine, NAMCO_SWCOURT); }
14561091static DRIVER_INIT( tinklpit ){   init_namcona1(machine, NAMCO_TINKLPIT); }
1457static DRIVER_INIT( xday2 ){      init_namcona2(machine, NAMCO_XDAY2); }
1092static DRIVER_INIT( xday2 ){      init_namcona1(machine, NAMCO_XDAY2); }
14581093
14591094ROM_START( bkrtmaq )
14601095   ROM_REGION( 0xa80000, "main", 0 )
r3289r3290
16331268   ROM_LOAD16_BYTE( "em2-ep1u.7f", 0x180000, 0x080000, CRC(dee15a81) SHA1(474a264029bd77e4205773a7461dea695e65933f) )
16341269
16351270   /* M37702 BIOS - labeled as Namco custom C70 */
1636   ROM_REGION16_LE( 0x4000, "cpu1", 0 )
1637        ROM_LOAD( "c70.bin",      0x000000, 0x004000, NO_DUMP )
1271   ROM_REGION16_LE( 0x4000, "mcu", 0 )
1272        ROM_LOAD( "c70.bin",      0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) )
16381273ROM_END
16391274
16401275ROM_START( knckhead )
r3289r3290
16541289   ROM_LOAD16_BYTE( "kh1-ma3u.bin", 0x880000, 0x100000, CRC(efeb768d) SHA1(15d016244549f3ea0d19f5cfb04bcebd65ac6134) )
16551290
16561291   /* M37702 BIOS - labeled as Namco custom C70 */
1657   ROM_REGION16_LE( 0x4000, "cpu1", 0 )
1658        ROM_LOAD( "c70.bin",      0x000000, 0x004000, NO_DUMP )
1292   ROM_REGION16_LE( 0x4000, "mcu", 0 )
1293        ROM_LOAD( "c70.bin",      0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) )
16591294ROM_END
16601295
16611296ROM_START( knckhedj )
r3289r3290
16751310   ROM_LOAD16_BYTE( "kh1-ma3u.bin", 0x880000, 0x100000, CRC(efeb768d) SHA1(15d016244549f3ea0d19f5cfb04bcebd65ac6134) )
16761311
16771312   /* M37702 BIOS - labeled as Namco custom C70 */
1678   ROM_REGION16_LE( 0x4000, "cpu1", 0 )
1679        ROM_LOAD( "c70.bin",      0x000000, 0x004000, NO_DUMP )
1313   ROM_REGION16_LE( 0x4000, "mcu", 0 )
1314        ROM_LOAD( "c70.bin",      0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) )
16801315ROM_END
16811316
16821317ROM_START( numanath )
r3289r3290
16961331   ROM_LOAD16_BYTE( "nm1-ma3u.bin", 0x880000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25) )
16971332
16981333   /* M37702 BIOS - labeled as Namco custom C70 */
1699   ROM_REGION16_LE( 0x4000, "cpu1", 0 )
1700        ROM_LOAD( "c70.bin",      0x000000, 0x004000, NO_DUMP )
1334   ROM_REGION16_LE( 0x4000, "mcu", 0 )
1335        ROM_LOAD( "c70.bin",      0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) )
17011336ROM_END
17021337
17031338ROM_START( numanatj )
r3289r3290
17171352   ROM_LOAD16_BYTE( "nm1-ma3u.bin", 0x880000, 0x100000, CRC(f79e2112) SHA1(8bb8639a9d3a5d3ac5c9bb78e72b3d76582a9c25) )
17181353
17191354   /* M37702 BIOS - labeled as Namco custom C70 */
1720   ROM_REGION16_LE( 0x4000, "cpu1", 0 )
1721        ROM_LOAD( "c70.bin",      0x000000, 0x004000, NO_DUMP )
1355   ROM_REGION16_LE( 0x4000, "mcu", 0 )
1356        ROM_LOAD( "c70.bin",      0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) )
17221357ROM_END
17231358
17241359ROM_START( quiztou )
r3289r3290
17381373   ROM_LOAD16_BYTE( "qt1ma3u.5f", 0x880000, 0x100000, CRC(14a5a163) SHA1(1107f50e491bedeb4ab7ac3f32cfe47727274ba9) )
17391374
17401375   /* M37702 BIOS - labeled as Namco custom C70 */
1741   ROM_REGION16_LE( 0x4000, "cpu1", 0 )
1742        ROM_LOAD( "c70.bin",      0x000000, 0x004000, NO_DUMP )
1376   ROM_REGION16_LE( 0x4000, "mcu", 0 )
1377        ROM_LOAD( "c70.bin",      0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) )
17431378ROM_END
17441379
17451380ROM_START( xday2 )
r3289r3290
17531388   ROM_LOAD16_BYTE( "xds1-dat3.8c", 0x680000, 0x200000, CRC(8980acc4) SHA1(ecd94a3d3a38923e8e322cd8863671af26e30812) )
17541389
17551390   /* M37702 BIOS - labeled as Namco custom C70 */
1756   ROM_REGION16_LE( 0x4000, "cpu1", 0 )
1757        ROM_LOAD( "c70.bin",      0x000000, 0x004000, NO_DUMP )
1391   ROM_REGION16_LE( 0x4000, "mcu", 0 )
1392        ROM_LOAD( "c70.bin",      0x000000, 0x004000, CRC(b4015f23) SHA1(7ce91eda76e86b5cab625e2b67c463b7d143832e) )
17581393ROM_END
17591394
17601395// NA-1 (C69 MCU)
17611396GAME( 1992,bkrtmaq,  0,        namcona1w, namcona1_quiz,bkrtmaq,  ROT0, "Namco", "Bakuretsu Quiz Ma-Q Dai Bouken (Japan)", 0 )
1762GAME( 1992,cgangpzl, 0,        namcona1w, namcona1_joy,   cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", 0 )
1763GAME( 1992,cgangpzj, cgangpzl, namcona1w, namcona1_joy,   cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", 0 )
1764GAME( 1992,exvania,  0,        namcona1,  namcona1_joy,   exbania,  ROT0, "Namco", "Exvania (Japan)", 0 )
1765GAME( 1992,fghtatck, 0,        namcona1,  namcona1_joy,   fa,       ROT90,"Namco", "Fighter & Attacker (US)", 0 )
1766GAME( 1992,fa,       fghtatck, namcona1,  namcona1_joy,   fa,       ROT90,"Namco", "F/A (Japan)", 0 )
1767GAME( 1992,swcourt,  0,        namcona1w, namcona1_joy,   swcourt,  ROT0, "Namco", "Super World Court (World)", 0 )
1768GAME( 1992,swcourtj, swcourt,  namcona1w, namcona1_joy,   swcourt,  ROT0, "Namco", "Super World Court (Japan)", 0 )
1769GAME( 1993,emeraldj, emeralda, namcona1w, namcona1_joy,   emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", 0 ) /* Parent is below on NA-2 Hardware */
1770GAME( 1993,emerldja, emeralda, namcona1w, namcona1_joy,   emeraldj, ROT0, "Namco", "Emeraldia (Japan)", 0 ) /* Parent is below on NA-2 Hardware */
1771GAME( 1993,tinklpit, 0,        namcona1w, namcona1_joy,   tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", 0 )
1397GAME( 1992,cgangpzl, 0,        namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (US)", 0 )
1398GAME( 1992,cgangpzj, cgangpzl, namcona1w, namcona1_joy, cgangpzl, ROT0, "Namco", "Cosmo Gang the Puzzle (Japan)", 0 )
1399GAME( 1992,exvania,  0,        namcona1,  namcona1_joy, exbania,  ROT0, "Namco", "Exvania (Japan)", 0 )
1400GAME( 1992,fghtatck, 0,        namcona1,  namcona1_joy, fa,       ROT90,"Namco", "Fighter & Attacker (US)", 0 )
1401GAME( 1992,fa,       fghtatck, namcona1,  namcona1_joy, fa,       ROT90,"Namco", "F/A (Japan)", 0 )
1402GAME( 1992,swcourt,  0,        namcona1w, namcona1_joy, swcourt,  ROT0, "Namco", "Super World Court (World)", 0 )
1403GAME( 1992,swcourtj, swcourt,  namcona1w, namcona1_joy, swcourt,  ROT0, "Namco", "Super World Court (Japan)", 0 )
1404GAME( 1993,emeraldj, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan Version B)", 0 ) /* Parent is below on NA-2 Hardware */
1405GAME( 1993,emerldja, emeralda, namcona1w, namcona1_joy, emeraldj, ROT0, "Namco", "Emeraldia (Japan)", 0 ) /* Parent is below on NA-2 Hardware */
1406GAME( 1993,tinklpit, 0,        namcona1w, namcona1_joy, tinklpit, ROT0, "Namco", "Tinkle Pit (Japan)", 0 )
17721407
17731408// NA-2 (C70 MCU)
1774GAME( 1992,knckhead, 0,        namcona2,  namcona2_joy,   knckhead, ROT0, "Namco", "Knuckle Heads (World)", GAME_IMPERFECT_SOUND )
1775GAME( 1992,knckhedj, knckhead, namcona2,  namcona2_joy,   knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", GAME_IMPERFECT_SOUND )
1776GAME( 1993,emeralda, 0,        namcona2,  namcona2_joy,   emeralda, ROT0, "Namco", "Emeraldia (World)", GAME_IMPERFECT_SOUND )
1777GAME( 1993,numanath, 0,        namcona2,  namcona2_joy,   numanath, ROT0, "Namco", "Numan Athletics (World)", GAME_IMPERFECT_SOUND )
1778GAME( 1993,numanatj, numanath, namcona2,  namcona2_joy,   numanath, ROT0, "Namco", "Numan Athletics (Japan)", GAME_IMPERFECT_SOUND )
1779GAME( 1993,quiztou,  0,        namcona2,  namcona2_quiz,quiztou,  ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", GAME_IMPERFECT_SOUND )
1780GAME( 1995,xday2,    0,        namcona2,  namcona2_joy, xday2,    ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
1409GAME( 1992,knckhead, 0,        namcona2,  namcona1_joy, knckhead, ROT0, "Namco", "Knuckle Heads (World)", 0 )
1410GAME( 1992,knckhedj, knckhead, namcona2,  namcona1_joy, knckhead, ROT0, "Namco", "Knuckle Heads (Japan)", 0 )
1411GAME( 1993,emeralda, 0,        namcona2,  namcona1_joy, emeralda, ROT0, "Namco", "Emeraldia (World)", 0 )
1412GAME( 1993,numanath, 0,        namcona2,  namcona1_joy, numanath, ROT0, "Namco", "Numan Athletics (World)", 0 )
1413GAME( 1993,numanatj, numanath, namcona2,  namcona1_joy, numanath, ROT0, "Namco", "Numan Athletics (Japan)", 0 )
1414GAME( 1993,quiztou,  0,        namcona2,  namcona1_quiz,quiztou,  ROT0, "Namco", "Nettou! Gekitou! Quiztou!! (Japan)", 0 )
1415GAME( 1995,xday2,    0,        namcona2,  namcona1_joy, xday2,    ROT0, "Namco", "X-Day 2 (Japan)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/cps1.c
r3289r3290
55915591   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
55925592ROM_END
55935593
5594/* Three Wonders (hack?) */
5595ROM_START( 3wonderh )
5596   ROM_REGION( CODE_SIZE, "main", 0 )      /* 68000 code */
5597   ROM_LOAD16_BYTE( "22.bin",      0x00000, 0x20000, CRC(e6071884) SHA1(5cf1a859739cf98846cb049b64fd083733acb29c) )
5598   ROM_LOAD16_BYTE( "26.bin",      0x00001, 0x20000, CRC(a28447b7) SHA1(e3f11911f1d3d115c03edf1bb6c8a68fccd9e9b3) )
5599   ROM_LOAD16_BYTE( "23.bin",      0x40000, 0x20000, CRC(fd3d6509) SHA1(0824ec397d12c2b832c9e694c23b59c2e489ed3b) )
5600   ROM_LOAD16_BYTE( "27.bin",      0x40001, 0x20000, CRC(999cba3d) SHA1(99dfb902c0c77f798a868eb13340eb54fb4a84d3) )
5601   ROM_LOAD16_BYTE( "rt_28a.9f",   0x80000, 0x20000, CRC(054137c8) SHA1(e4c406e0a32198323a5931093fbaa6836510b8ad) )
5602   ROM_LOAD16_BYTE( "rt_33a.9h",   0x80001, 0x20000, CRC(7264cb1b) SHA1(b367acb9f6579569321ecaa98a14e29dd775b9db) )
5603   ROM_LOAD16_BYTE( "rte_29a.10f", 0xc0000, 0x20000, CRC(cddaa919) SHA1(0c98e95ad5033d2c5ade7651243e7ccdb4e35463) )
5604   ROM_LOAD16_BYTE( "rte_34a.10h", 0xc0001, 0x20000, CRC(ed52e7e5) SHA1(352433ae484967d26376141e3a8a0f968b98fde6) )
5605
5606   ROM_REGION( 0x400000, "gfx", 0 )
5607   ROMX_LOAD( "16.bin",    0x000000, 0x40000, CRC(c997bca2) SHA1(6b6cd9c2fc56690c42a3368cd5e6c98d6bff5b5b) , ROM_SKIP(7) )
5608   ROMX_LOAD( "6.bin",     0x000001, 0x40000, CRC(3eea321a) SHA1(4368aaf8a532c29f4b950adb2daedd3069d84cf1) , ROM_SKIP(7) )
5609   ROMX_LOAD( "18.bin",    0x000002, 0x40000, CRC(98acdfd4) SHA1(910dfd6742e166530388c700c0797e692e501f97) , ROM_SKIP(7) )
5610   ROMX_LOAD( "8.bin",     0x000003, 0x40000, CRC(dc9ca6f9) SHA1(77549e9a128d1b7ca0c4547cdc56f43450d426e0) , ROM_SKIP(7) )
5611   ROMX_LOAD( "12.bin",    0x000004, 0x40000, CRC(0d8a6007) SHA1(48d61cbd91df01ba4b2f0e80e60375a50ddb065e) , ROM_SKIP(7) )
5612   ROMX_LOAD( "2.bin",     0x000005, 0x40000, CRC(d75563b9) SHA1(7b7b105b84dc5d7b17838961fdd8be5bac90cbc6) , ROM_SKIP(7) )
5613   ROMX_LOAD( "14.bin",    0x000006, 0x40000, CRC(84369a28) SHA1(3877186371fe289522133fd99be034b141a974ca) , ROM_SKIP(7) )
5614   ROMX_LOAD( "4.bin",     0x000007, 0x40000, CRC(d4831578) SHA1(9ff5860f22976e9e4c023946f35e24fde84fe8ea) , ROM_SKIP(7) )
5615   ROMX_LOAD( "17.bin",    0x200000, 0x40000, CRC(040edff5) SHA1(9747d67b980cc357c6fa732300a84ae55150bc51) , ROM_SKIP(7) )
5616   ROMX_LOAD( "7.bin",     0x200001, 0x40000, CRC(c7c0468c) SHA1(e7a14cf579b023e8954b7e06aa2337db4f53bedc) , ROM_SKIP(7) )
5617   ROMX_LOAD( "19.bin",    0x200002, 0x40000, CRC(9fef114f) SHA1(394afb083ce7c46d9a39097d0040f9e18aaab508) , ROM_SKIP(7) )
5618   ROMX_LOAD( "9.bin",     0x200003, 0x40000, CRC(48cbfba5) SHA1(74047433e50795e29d8299526ae2c424610f0a5e) , ROM_SKIP(7) )
5619   ROMX_LOAD( "13.bin",    0x200004, 0x40000, CRC(8fc3d7d1) SHA1(e2784e0fccfe062ea8dc440e4a884fc665f4a846) , ROM_SKIP(7) )
5620   ROMX_LOAD( "3.bin",     0x200005, 0x40000, CRC(c65e9a86) SHA1(359ab1e2dd0fcf38ed9815a6a50294cbeca8223c) , ROM_SKIP(7) )
5621   ROMX_LOAD( "15.bin",    0x200006, 0x40000, CRC(f239341a) SHA1(b1858f5f7a5d210c5327b84a797ed7e898250596) , ROM_SKIP(7) )
5622   ROMX_LOAD( "5.bin",     0x200007, 0x40000, CRC(947ac944) SHA1(d962f49ba532fc60209bb3957ff8a456855ef67f) , ROM_SKIP(7) )
5623
5624   ROM_REGION( 0x18000, "audio", 0 ) /* 64k for the audio CPU (+banks) */
5625   ROM_LOAD( "rt_9.12b",   0x00000, 0x08000, CRC(abfca165) SHA1(428069d3bdc45775854cd0e8abe447f134fe5492) )
5626   ROM_CONTINUE(           0x10000, 0x08000 )
5627
5628   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
5629   ROM_LOAD( "rt_18.11c",  0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
5630   ROM_LOAD( "rt_19.12c",  0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
5631
5632   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
5633   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
5634   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
5635   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
5636   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
5637   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
5638
5639   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
5640   ROM_LOAD( "rt24b.1a",     0x0000, 0x0117, CRC(54b85159) SHA1(c6f4fb5d747a215f4f50e4f2258e35d3f9bdbb2e) )
5641   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
5642
5643   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
5644   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
5645ROM_END
5646
55945647/* B-Board 90629B */
55955648ROM_START( kod )
55965649   ROM_REGION( CODE_SIZE, "main", 0 )      /* 68000 code */
r3289r3290
83378390GAME( 1991, 3wonders, 0,        cps1_10MHz, 3wonders, cps1,     ROT0,   "Capcom", "Three Wonders (World 910520)" , 0)               // "ETC"
83388391GAME( 1991, 3wonderu, 3wonders, cps1_10MHz, 3wonders, cps1,     ROT0,   "Capcom", "Three Wonders (US 910520)", 0 )
83398392GAME( 1991, wonder3,  3wonders, cps1_10MHz, 3wonders, cps1,     ROT0,   "Capcom", "Wonder 3 (Japan 910520)", 0 )
8393GAME( 1991, 3wonderh, 3wonders, cps1_10MHz, 3wonders, cps1,     ROT0,   "bootleg","Three Wonders (hack?)", 0 )
83408394GAME( 1991, kod,      0,        cps1_10MHz, kod,      cps1,     ROT0,   "Capcom", "The King of Dragons (World 910711)" , 0)            // "ETC"
83418395GAME( 1991, kodu,     kod,      cps1_10MHz, kodj,     cps1,     ROT0,   "Capcom", "The King of Dragons (US 910910)", 0 )
83428396GAME( 1991, kodj,     kod,      cps1_10MHz, kodj,     cps1,     ROT0,   "Capcom", "The King of Dragons (Japan 910805)", 0 )
src/mame/drivers/snk.c
r3289r3290
6767  1988 fsoccer: use the service mode dip switch
6868  1988 fitegolf: use the service mode dip switch
6969
70- in all games except jcross, credits are edded on the 0->1 transition of the
71  coin inputs. However declaring the inputs as ACTIVE_HIGH makes ikarijp
72  enter test mode on boot, therefore I have to assume that ACTIVE_LOW is the
73  correct setting and the games just wait for the pulse to finish before
74  adding a credit.
75
7076- the I/O area (C000-CFFF) is probably mirrored in large part on the two main
7177  CPUs, however I mapped only the addresses actually used by the games.
7278
r3289r3290
14441450
14451451static INPUT_PORTS_START( marvins )
14461452   PORT_START("IN0")
1447   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1448   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1449   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1453   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
1454   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
1455   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )
14501456   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
14511457   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
14521458   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
r3289r3290
15271533
15281534static INPUT_PORTS_START( vangrd2 )
15291535   PORT_START("IN0")
1530   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1536   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
15311537   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15321538   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15331539   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
r3289r3290
16111617
16121618static INPUT_PORTS_START( madcrash )
16131619   PORT_START("IN0")
1614   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1615   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1616   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1620   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
1621   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
1622   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )
16171623   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
16181624   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
16191625   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(marvins_sound_busy, NULL) /* sound CPU status */
r3289r3290
17741780
17751781static INPUT_PORTS_START( sgladiat )
17761782   PORT_START("IN0")
1777   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1783   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
17781784   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1779   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1785   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
17801786   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
17811787   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
17821788   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
r3289r3290
18581864
18591865static INPUT_PORTS_START( hal21 )
18601866   PORT_START("IN0")
1861   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1867   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
18621868   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1863   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1869   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
18641870   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
18651871   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
18661872   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
r3289r3290
19411947
19421948static INPUT_PORTS_START( aso )
19431949   PORT_START("IN0")
1944   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1950   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
19451951   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1946   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coinage" settings - code at 0x2e04 */
1952   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coinage" settings - code at 0x2e04 */
19471953   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
19481954   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
19491955   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
r3289r3290
20282034
20292035static INPUT_PORTS_START( alphamis )
20302036   PORT_START("IN0")
2031   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2032   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2033   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x2e17 */
2037   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
2038   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
2039   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x2e17 */
20342040   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
20352041   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
20362042   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
r3289r3290
21102116
21112117static INPUT_PORTS_START( tnk3 )
21122118   PORT_START("IN0")
2113   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2119   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
21142120   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2115   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2121   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
21162122   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
21172123   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
21182124   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
r3289r3290
22002206static INPUT_PORTS_START( athena )
22012207   PORT_START("IN0")
22022208   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2203   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x09d4 */
2209   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x09d4 */
22042210   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
22052211   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2206   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2207   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2212   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2213   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
22082214   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
22092215   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
22102216
r3289r3290
22852291static INPUT_PORTS_START( fitegolf )
22862292   PORT_START("IN0")
22872293   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2288   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x045b */
2294   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x045b */
22892295   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )               /* reset */
22902296   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )           /* same as the dip switch */
2291   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2292   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2297   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2298   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
22932299   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
22942300   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
22952301
r3289r3290
23702376static INPUT_PORTS_START( countryc )
23712377   PORT_START("IN0")
23722378   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2373   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x0450 */
2379   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x0450 */
23742380   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )               /* reset */
23752381   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )           /* same as the dip switch */
2376   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2377   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2382   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2383   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
23782384   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
23792385   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
23802386
r3289r3290
24522458static INPUT_PORTS_START( ikari )
24532459   PORT_START("IN0")
24542460   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2455   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2461   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
24562462   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
24572463   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2458   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2459   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2464   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2465   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
24602466   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
24612467   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
24622468
r3289r3290
25392545   // non-JAMMA system inputs
25402546
25412547   PORT_MODIFY("IN0")
2542   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2543   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2544   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2548   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
2549   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2 )
2550   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )
25452551   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
25462552   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
25472553   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
r3289r3290
25862592static INPUT_PORTS_START( victroad )
25872593   PORT_START("IN0")
25882594   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2589   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2595   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
25902596   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )  /* reset */
25912597   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2592   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2593   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2598   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2599   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
25942600   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
25952601   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
25962602
r3289r3290
26882694static INPUT_PORTS_START( bermudat )
26892695   PORT_START("IN0")
26902696   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2691   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2697   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
26922698   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT ) /* tilt? */
26932699   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2694   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2695   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2700   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2701   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
26962702   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
26972703   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
26982704
r3289r3290
28092815static INPUT_PORTS_START( gwar )
28102816   PORT_START("IN0")
28112817   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2812   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2818   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
28132819   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )   /* tilt? causes reset */
28142820   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )
2815   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2816   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2821   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2822   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
28172823   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
28182824   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
28192825
r3289r3290
29162922   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
29172923   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )  /* reset */
29182924   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2919   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2920   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2925   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
2926   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
29212927   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
29222928   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
29232929
r3289r3290
29953001static INPUT_PORTS_START( chopper )
29963002   PORT_START("IN0")
29973003   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2998   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
3004   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
29993005   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )  /* Reset */
30003006   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )
3001   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
3002   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
3007   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN2 )
3008   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN1 )
30033009   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
30043010   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
30053011
r3289r3290
31093115   PORT_START("IN0")
31103116   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
31113117   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE )
3112   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
3118   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
31133119   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
3114   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
3115   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
3120   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN1 )
3121   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN2 )
31163122   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 ) PORT_NAME("Start Game A")
31173123   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 ) PORT_NAME("Start Game B")
31183124
r3289r3290
32503256   PORT_START("IN0")
32513257   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
32523258   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE )   // same as the dip switch
3253   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
3259   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
32543260   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
3255   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
3256   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
3261   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_COIN1 )
3262   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_COIN2 )
32573263   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 ) PORT_NAME("Start Game A")
32583264   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 ) PORT_NAME("Start Game B")
32593265
src/mame/drivers/namconb1.c
r3289r3290
1212Main CPU : Motorola 68020 32-bit processor @ 25MHz
1313Secondary CPUs : C329 + 137 (both custom)
1414Custom Graphics Chips : GFX:123,145,156,C116 - Motion Objects:C355,187,C347
15Sound CPU : C75 (custom)
15Sound CPU : C75 (Mitsu M37702 with internal ROM)
1616PCM Sound chip : C352 (custom)
1717I/O Chip : 160 (custom)
1818Board composition : Single board
r3289r3290
274274#include "namconb1.h"
275275#include "namcos2.h"
276276#include "namcoic.h"
277#include "audio/namcoc7x.h"
277#include "sound/c352.h"
278#include "cpu/m37710/m37710.h"
278279
279280#define NB1_NVMEM_SIZE (0x800)
280281static UINT32 *nvmem32;
r3289r3290
282283UINT32 *namconb1_workram32;
283284UINT32 *namconb1_spritebank32;
284285UINT32 *namconb1_tilebank32;
286static UINT16 *namconb_shareram;
285287
286288/****************************************************************************/
287289
r3289r3290
351353   }
352354} /* namconb1_interrupt */
353355
356static INTERRUPT_GEN( mcu_interrupt )
357{
358   if (cpu_getiloops() == 0)
359   {
360      cpunum_set_input_line(machine, 1, M37710_LINE_IRQ0, HOLD_LINE);
361   }
362   else if (cpu_getiloops() == 1)
363   {
364      cpunum_set_input_line(machine, 1, M37710_LINE_IRQ2, HOLD_LINE);
365   }
366   else
367   {
368       cpunum_set_input_line(machine, 1, M37710_LINE_ADC, HOLD_LINE);
369   }
370}
354371
355372static TIMER_CALLBACK( namconb2_TriggerPOSIRQ )
356373{
r3289r3290
596613   memset( &pMem[0xe6f*8], 0, numBytes );
597614
598615   namcos2_gametype = NAMCONB1_NEBULRAY;
599
600   namcoc7x_on_driver_init(machine);
601616} /* nebulray */
602617
603618static DRIVER_INIT( gslgr94u )
604619{
605620   namcos2_gametype = NAMCONB1_GSLGR94U;
606   namcoc7x_on_driver_init(machine);
607621} /* gslgr94u */
608622
609623static DRIVER_INIT( sws95 )
610624{
611625   namcos2_gametype = NAMCONB1_SWS95;
612   namcoc7x_on_driver_init(machine);
613626} /* sws95 */
614627
615628static DRIVER_INIT( sws96 )
616629{
617630   namcos2_gametype = NAMCONB1_SWS96;
618   namcoc7x_on_driver_init(machine);
619631} /* sws96 */
620632
621633static DRIVER_INIT( sws97 )
622634{
623635   namcos2_gametype = NAMCONB1_SWS97;
624   namcoc7x_on_driver_init(machine);
625636} /* sws97 */
626637
627638static DRIVER_INIT( gunbulet )
628639{
629640   namcos2_gametype = NAMCONB1_GUNBULET;
630   namcoc7x_on_driver_init(machine);
631641} /* gunbulet */
632642
633643static DRIVER_INIT( vshoot )
634644{
635645   namcos2_gametype = NAMCONB1_VSHOOT;
636   namcoc7x_on_driver_init(machine);
637646} /* vshoot */
638647
639648static DRIVER_INIT( machbrkr )
640649{
641650   namcos2_gametype = NAMCONB2_MACH_BREAKERS;
642   namcoc7x_on_driver_init(machine);
643651}
644652
645653static DRIVER_INIT( outfxies )
646654{
647655   namcos2_gametype = NAMCONB2_OUTFOXIES;
648   namcoc7x_on_driver_init(machine);
649656}
650657
651658static READ32_HANDLER( custom_key_r )
r3289r3290
817824     */
818825} /* srand_w */
819826
827static READ32_HANDLER(namconb_share_r)
828{
829   return (namconb_shareram[offset*2] << 16) | namconb_shareram[offset*2+1];
830}
831
832static WRITE32_HANDLER(namconb_share_w)
833{
834   COMBINE_DATA(namconb_shareram+offset*2+1);
835   data >>= 16;
836   mem_mask >>= 16;
837   COMBINE_DATA(namconb_shareram+offset*2);
838}
839
820840static ADDRESS_MAP_START( namconb1_am, ADDRESS_SPACE_PROGRAM, 32 )
821841   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM)
822842   AM_RANGE(0x100000, 0x10001f) AM_READ(gunbulet_gun_r)
823843   AM_RANGE(0x1c0000, 0x1cffff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM)
824844   AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w)
825   AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namcoc7x_soundram32_r, namcoc7x_soundram32_w)
845   AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namconb_share_r, namconb_share_w)
826846   AM_RANGE(0x208000, 0x2fffff) AM_RAM
827847   AM_RANGE(0x400000, 0x40001f) AM_READWRITE(namconb_cpureg_r, namconb1_cpureg_w)
828848   AM_RANGE(0x580000, 0x5807ff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM) AM_BASE(&nvmem32)
r3289r3290
839859   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM) AM_WRITE(SMH_ROM)
840860   AM_RANGE(0x1c0000, 0x1cffff) AM_READ(SMH_RAM) AM_WRITE(SMH_RAM)
841861   AM_RANGE(0x1e4000, 0x1e4003) AM_READWRITE(randgen_r,srand_w)
842   AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namcoc7x_soundram32_r, namcoc7x_soundram32_w)
862   AM_RANGE(0x200000, 0x207fff) AM_READWRITE(namconb_share_r, namconb_share_w)
843863   AM_RANGE(0x208000, 0x2fffff) AM_RAM
844864   AM_RANGE(0x400000, 0x4fffff) AM_ROM AM_REGION("data", 0)
845865   AM_RANGE(0x600000, 0x61ffff) AM_READWRITE(namco_obj32_r,namco_obj32_w)
r3289r3290
858878   AM_RANGE(0xf00000, 0xf0001f) AM_READWRITE(namconb_cpureg_r, namconb2_cpureg_w)
859879ADDRESS_MAP_END /* namconb2_readmem */
860880
881static WRITE16_HANDLER( nbmcu_shared_w )
882{
883   // HACK!  Many games data ROM routines redirect the vector from the sound command read to an RTS.
884   // This needs more investigation.  nebulray and vshoot do NOT do this.
885   // Timers A2 and A3 are set up in "external input counter" mode, this may be related.
886   if ((offset == 0x647c/2) && (data != 0))
887   {
888      data = 0xd2f6;
889   }
890
891   COMBINE_DATA(&namconb_shareram[offset]);
892
893   // C74 BIOS has a very short window on the CPU sync signal, so immediately let the '020 at it
894   if ((offset == 0x6000/2) && (data & 0x80))
895   {
896      cpu_spinuntil_time(ATTOTIME_IN_CYCLES(300, 1));
897   }
898}
899
900static ADDRESS_MAP_START( namcoc75_am, ADDRESS_SPACE_PROGRAM, 16 )
901   AM_RANGE(0x002000, 0x002fff) AM_READWRITE( c352_0_r, c352_0_w )
902   AM_RANGE(0x004000, 0x00bfff) AM_RAM_WRITE(nbmcu_shared_w) AM_BASE(&namconb_shareram)
903   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_REGION("c75", 0)
904   AM_RANGE(0x200000, 0x27ffff) AM_ROM AM_REGION("c75data", 0)
905ADDRESS_MAP_END
906
907static UINT8 nbx_port6;
908
909static READ8_HANDLER( port6_r )
910{
911   return nbx_port6;
912}
913
914static WRITE8_HANDLER( port6_w )
915{
916   nbx_port6 = data;
917}
918
919static READ8_HANDLER( port7_r )
920{
921   switch (nbx_port6 & 0xf0)
922   {
923      case 0x00:
924         return input_port_read_safe(machine, "P4", 0xff);
925         break;
926
927      case 0x20:
928         return input_port_read(machine, "MISC");
929         break;
930
931      case 0x40:
932         return input_port_read(machine, "P1");
933         break;
934
935      case 0x60:
936         return input_port_read(machine, "P2");
937         break;
938
939      default:
940         break;
941   }
942
943   return 0xff;
944}
945
946// Is this madness?  No, this is Namco.  They didn't have enough digital ports for all 4 players,
947// so the 8 bits of player 3 got routed to the 8 analog inputs.  +5V on the analog input will
948// register full scale, so it works...
949static READ8_HANDLER(dac7_r)      // bit 7
950{
951   return input_port_read_safe(machine, "P3", 0xff)&0x80;
952}
953
954static READ8_HANDLER(dac6_r)      // bit 3
955{
956   return (input_port_read_safe(machine, "P3", 0xff)<<1)&0x80;
957}
958
959static READ8_HANDLER(dac5_r)      // bit 2
960{
961   return (input_port_read_safe(machine, "P3", 0xff)<<2)&0x80;
962}
963
964static READ8_HANDLER(dac4_r)      // bit 1
965{
966   return (input_port_read_safe(machine, "P3", 0xff)<<3)&0x80;
967}
968
969static READ8_HANDLER(dac3_r)      // bit 0
970{
971   return (input_port_read_safe(machine, "P3", 0xff)<<4)&0x80;
972}
973
974static READ8_HANDLER(dac2_r)      // bit 4
975{
976   return (input_port_read_safe(machine, "P3", 0xff)<<5)&0x80;
977}
978
979static READ8_HANDLER(dac1_r)      // bit 5
980{
981   return (input_port_read_safe(machine, "P3", 0xff)<<6)&0x80;
982}
983
984static READ8_HANDLER(dac0_r)      // bit 6
985{
986   return (input_port_read_safe(machine, "P3", 0xff)<<7)&0x80;
987}
988
989static ADDRESS_MAP_START( namcoc75_io, ADDRESS_SPACE_IO, 8 )
990   AM_RANGE(M37710_PORT6, M37710_PORT6) AM_READWRITE(port6_r, port6_w)
991   AM_RANGE(M37710_PORT7, M37710_PORT7) AM_READ(port7_r)
992   AM_RANGE(M37710_ADC7_L, M37710_ADC7_L) AM_READ(dac7_r)
993   AM_RANGE(M37710_ADC6_L, M37710_ADC6_L) AM_READ(dac6_r)
994   AM_RANGE(M37710_ADC5_L, M37710_ADC5_L) AM_READ(dac5_r)
995   AM_RANGE(M37710_ADC4_L, M37710_ADC4_L) AM_READ(dac4_r)
996   AM_RANGE(M37710_ADC3_L, M37710_ADC3_L) AM_READ(dac3_r)
997   AM_RANGE(M37710_ADC2_L, M37710_ADC2_L) AM_READ(dac2_r)
998   AM_RANGE(M37710_ADC1_L, M37710_ADC1_L) AM_READ(dac1_r)
999   AM_RANGE(M37710_ADC0_L, M37710_ADC0_L) AM_READ(dac0_r)
1000ADDRESS_MAP_END
1001
8611002#define MASTER_CLOCK_HZ 48384000
8621003
8631004static MACHINE_DRIVER_START( namconb1 )
r3289r3290
8651006   MDRV_CPU_PROGRAM_MAP(namconb1_am,0)
8661007   MDRV_CPU_VBLANK_INT("main", namconb1_interrupt)
8671008
868   NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3)
1009   MDRV_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3)
1010   MDRV_CPU_PROGRAM_MAP(namcoc75_am, 0)
1011   MDRV_CPU_IO_MAP(namcoc75_io, 0)
1012   MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 3)
8691013
8701014   MDRV_NVRAM_HANDLER(namconb1)
8711015   MDRV_MACHINE_START(namconb)
r3289r3290
8821026   MDRV_VIDEO_START(namconb1)
8831027   MDRV_VIDEO_UPDATE(namconb1)
8841028
885   NAMCO_C7X_SOUND(MASTER_CLOCK_HZ/3)
1029   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1030   MDRV_SOUND_ADD("c352", C352, MASTER_CLOCK_HZ/3)
1031   MDRV_SOUND_ROUTE(0, "right", 1.00)
1032   MDRV_SOUND_ROUTE(1, "left", 1.00)
1033   MDRV_SOUND_ROUTE(2, "right", 1.00)
1034   MDRV_SOUND_ROUTE(3, "left", 1.00)
8861035MACHINE_DRIVER_END
8871036
8881037static MACHINE_DRIVER_START( namconb2 )
r3289r3290
8901039   MDRV_CPU_PROGRAM_MAP(namconb2_am,0)
8911040   MDRV_CPU_VBLANK_INT("main", namconb2_interrupt)
8921041
893   NAMCO_C7X_MCU(MASTER_CLOCK_HZ/3)
1042   MDRV_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3)
1043   MDRV_CPU_PROGRAM_MAP(namcoc75_am, 0)
1044   MDRV_CPU_IO_MAP(namcoc75_io, 0)
1045   MDRV_CPU_VBLANK_INT_HACK(mcu_interrupt, 3)
8941046
8951047   MDRV_NVRAM_HANDLER(namconb1)
8961048   MDRV_MACHINE_START(namconb)
r3289r3290
9071059   MDRV_VIDEO_START(namconb2)
9081060   MDRV_VIDEO_UPDATE(namconb2)
9091061
910   NAMCO_C7X_SOUND(MASTER_CLOCK_HZ/3)
1062   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1063   MDRV_SOUND_ADD("c352", C352, MASTER_CLOCK_HZ/3)
1064   MDRV_SOUND_ROUTE(0, "right", 1.00)
1065   MDRV_SOUND_ROUTE(1, "left", 1.00)
1066   MDRV_SOUND_ROUTE(2, "right", 1.00)
1067   MDRV_SOUND_ROUTE(3, "left", 1.00)
9111068MACHINE_DRIVER_END
9121069
9131070/***************************************************************/
r3289r3290
9171074   ROM_LOAD32_WORD( "gn2mprlb.15b", 0x00002, 0x80000, CRC(fe2d9425) SHA1(51b166a629cbb522720d63720558816b496b6b76) )
9181075   ROM_LOAD32_WORD( "gn2mprub.13b", 0x00000, 0x80000, CRC(3bf4985a) SHA1(f559e0d5f55d23d886fe61bd7d5ca556acc7f87c) )
9191076
920   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1077   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1078   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1079
1080   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
9211081   ROM_LOAD( "gn1-spr0.bin", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) )
922   NAMCO_C7X_BIOS
9231082
9241083   ROM_REGION( 0x200000, "c352", 0 )
9251084   ROM_LOAD( "gn1-voi0.bin", 0, 0x200000, CRC(05477eb7) SHA1(f2eaacb5dbac06c37c56b9b131230c9cf6602221) )
r3289r3290
9451104   ROM_LOAD32_WORD( "gn1-mprl.bin", 0x00002, 0x80000, CRC(f99e309e) SHA1(3fe0ddf756e6849f8effc7672456cbe32f65c98a) )
9461105   ROM_LOAD32_WORD( "gn1-mpru.bin", 0x00000, 0x80000, CRC(72a4db07) SHA1(8c5e1e51cd961b311d03f7b21f36a5bd5e8e9104) )
9471106
948   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1107   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1108   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1109
1110   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
9491111   ROM_LOAD( "gn1-spr0.bin", 0, 0x20000, CRC(6836ba38) SHA1(6ea17ea4bbb59be108e8887acd7871409580732f) )
950   NAMCO_C7X_BIOS
9511112
9521113   ROM_REGION( 0x200000, "c352", 0 )
9531114   ROM_LOAD( "gn1-voi0.bin", 0, 0x200000, CRC(05477eb7) SHA1(f2eaacb5dbac06c37c56b9b131230c9cf6602221) )
r3289r3290
9731134   ROM_LOAD32_WORD( "nr2-mpru.13b", 0x00000, 0x80000, CRC(049b97cb) SHA1(0e344b29a4d4bdc854fa9849589772df2eeb0a05) )
9741135   ROM_LOAD32_WORD( "nr2-mprl.15b", 0x00002, 0x80000, CRC(0431b6d4) SHA1(54c96e8ac9e753956c31bdef79d390f1c20e10ff) )
9751136
976   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1137   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1138   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1139
1140   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
9771141   ROM_LOAD( "nr1-spr0", 0, 0x20000, CRC(1cc2b44b) SHA1(161f4ed39fabe89d7ee1d539f8b9f08cd0ff3111) )
978   NAMCO_C7X_BIOS
9791142
9801143   ROM_REGION( 0x200000, "c352", 0 )
9811144   ROM_LOAD( "nr1-voi0", 0, 0x200000, CRC(332d5e26) SHA1(9daddac3fbe0709e25ed8e0b456bac15bfae20d7) )
r3289r3290
10081171   ROM_LOAD32_WORD( "nr1-mpru", 0x00000, 0x80000, CRC(42ef71f9) SHA1(20e3cb63e1fde293c60c404b378d901d635c4b79) )
10091172   ROM_LOAD32_WORD( "nr1-mprl", 0x00002, 0x80000, CRC(fae5f62c) SHA1(143d716abbc834aac6270db3bbb89ec71ea3804d) )
10101173
1011   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1174   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1175   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1176
1177   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
10121178   ROM_LOAD( "nr1-spr0", 0, 0x20000, CRC(1cc2b44b) SHA1(161f4ed39fabe89d7ee1d539f8b9f08cd0ff3111) )
1013   NAMCO_C7X_BIOS
10141179
10151180   ROM_REGION( 0x200000, "c352", 0 )
10161181   ROM_LOAD( "nr1-voi0", 0, 0x200000, CRC(332d5e26) SHA1(9daddac3fbe0709e25ed8e0b456bac15bfae20d7) )
r3289r3290
10431208   ROM_LOAD32_WORD( "gse2mprl.bin", 0x00002, 0x80000, CRC(a514349c) SHA1(1f7ec81cd6193410d2f01e6f0f84878561fc8035) )
10441209   ROM_LOAD32_WORD( "gse2mpru.bin", 0x00000, 0x80000, CRC(b6afd238) SHA1(438a3411ac8ce3d22d5da8c0800738cb8d2994a9) )
10451210
1046   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1211   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1212   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1213
1214   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
10471215   ROM_LOAD( "gse2spr0.bin", 0, 0x20000, CRC(17e87cfc) SHA1(9cbeadb6dfcb736e8c80eab344f70fc2f58469d6) )
1048   NAMCO_C7X_BIOS
10491216
10501217   ROM_REGION( 0x200000, "c352", 0 )
10511218   ROM_LOAD( "gse-voi0.bin", 0, 0x200000, CRC(d3480574) SHA1(0c468ed060769b36b7e41cf4919cb6d8691d64f6) )
r3289r3290
11951362   ROM_LOAD32_WORD( "gs1mprl.15b", 0x00002, 0x80000, CRC(1e6c3626) SHA1(56abe21884fd87df10996db19c49ce14214d4b73) )
11961363   ROM_LOAD32_WORD( "gs1mpru.13b", 0x00000, 0x80000, CRC(ef355179) SHA1(0ab0ef4301a318681bb5827d35734a0732b35484) )
11971364
1198   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1365   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1366   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1367
1368   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
11991369   ROM_LOAD( "gs1spr0.5b", 0, 0x80000, CRC(561ea20f) SHA1(adac6b77effc3a82079a9b228bafca0fcef72ba5) )
1200   NAMCO_C7X_BIOS
12011370
12021371   ROM_REGION( 0x200000, "c352", 0 )
12031372   ROM_LOAD( "gs1voi-0.5j", 0, 0x200000, CRC(6f8262aa) SHA1(beea98d9f8b927a572eb0bfcf678e9d6e40fc68d) )
r3289r3290
12211390   ROM_LOAD32_WORD( "ss51mprl.bin", 0x00002, 0x80000, CRC(c9e0107d) SHA1(0f10582416023a86ea1ef2679f3f06016c086e08) )
12221391   ROM_LOAD32_WORD( "ss51mpru.bin", 0x00000, 0x80000, CRC(0d93d261) SHA1(5edef26e2c86dbc09727d910af92747d022e4fed) )
12231392
1224   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1393   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1394   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1395
1396   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
12251397   ROM_LOAD( "ss51spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) )
1226   NAMCO_C7X_BIOS
12271398
12281399   ROM_REGION( 0x200000, "c352", 0 )
12291400   ROM_LOAD( "ss51voi0.bin", 0, 0x200000, CRC(2740ec72) SHA1(9694a7378ea72771d2b1d43db6d74ed347ba27d3) )
r3289r3290
12481419   ROM_LOAD32_WORD( "ss61mprl.bin", 0x00002, 0x80000, CRC(06f55e73) SHA1(6be26f8a2ef600bf07c580f210d7b265ac464002) )
12491420   ROM_LOAD32_WORD( "ss61mpru.bin", 0x00000, 0x80000, CRC(0abdbb83) SHA1(67e8b712291f9bcf2c3a52fbc451fad54679cab8) )
12501421
1251   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1422   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1423   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1424
1425   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
12521426   ROM_LOAD( "ss61spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) )
1253   NAMCO_C7X_BIOS
12541427
12551428   ROM_REGION( 0x200000, "c352", 0 )
12561429   ROM_LOAD( "ss61voi0.bin", 0, 0x200000, CRC(2740ec72) SHA1(9694a7378ea72771d2b1d43db6d74ed347ba27d3) )
r3289r3290
12741447   ROM_LOAD32_WORD( "ss71mprl.bin", 0x00002, 0x80000, CRC(bd60b50e) SHA1(9e00bacd506182ab2af2c0efdd5cc401b3e46485) )
12751448   ROM_LOAD32_WORD( "ss71mpru.bin", 0x00000, 0x80000, CRC(3444f5a8) SHA1(8d0f35b3ba8f65dbc67c3b2d273833227a8b8b2a) )
12761449
1277   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1450   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1451   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1452
1453   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
12781454   ROM_LOAD( "ss71spr0.bin", 0, 0x80000, CRC(71cb12f5) SHA1(6e13bd16a5ba14d6e47a21875db3663ada3c06a5) )
1279   NAMCO_C7X_BIOS
12801455
12811456   ROM_REGION( 0x200000, "c352", 0 )
12821457   ROM_LOAD( "ss71voi0.bin", 0, 0x200000, CRC(2740ec72) SHA1(9694a7378ea72771d2b1d43db6d74ed347ba27d3) )
r3289r3290
13001475   ROM_LOAD32_WORD( "vsj1mprl.15b", 0x00002, 0x80000, CRC(83a60d92) SHA1(c3db0c79f772a79418914353a3d6ecc4883ea54e) )
13011476   ROM_LOAD32_WORD( "vsj1mpru.13b", 0x00000, 0x80000, CRC(c63eb92d) SHA1(f93bd4b91daee645677955020dc8df14dc9bfd27) )
13021477
1303   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1478   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1479   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1480
1481   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
13041482   ROM_LOAD( "vsj1spr0.5b", 0, 0x80000, CRC(b0c71aa6) SHA1(a94fae02b46a645ff728d2f98827c85ff155892b) )
1305   NAMCO_C7X_BIOS
13061483
13071484   ROM_REGION( 0x200000, "c352", 0 )
13081485   ROM_LOAD( "vsjvoi-0.5j", 0, 0x200000, CRC(0528c9ed) SHA1(52b67978fdeb97b77065575774a7ddeb49fe1d81) )
r3289r3290
14861663   ROM_LOAD32_WORD( "ou2mprl.11c", 0x00002, 0x80000, CRC(f414a32e) SHA1(9733ab087cfde1b8fb5b676d8a2eb5325ebdbb56) )
14871664   ROM_LOAD32_WORD( "ou2mpru.11d", 0x00000, 0x80000, CRC(ab5083fb) SHA1(cb2e7a4838c2b80057edb83ea63116bccb1394d3) )
14881665
1489   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1666   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1667   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1668
1669   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
14901670   ROM_LOAD( "ou1spr0.5b", 0, 0x80000, CRC(60cee566) SHA1(2f3b96793816d90011586e0f9f71c58b636b6d4c) )
1491   NAMCO_C7X_BIOS
14921671
14931672   ROM_REGION( 0x200000, "c352", 0 )
14941673   ROM_LOAD( "ou1voi0.6n", 0, 0x200000, CRC(2d8fb271) SHA1(bde9d45979728f5a2cd8ec89f5f81bf16b694cc2) )
r3289r3290
15291708   ROM_LOAD32_WORD( "ou1-mprl.11c", 0x00002, 0x80000, CRC(d3b9e530) SHA1(3f5fe5eea817a23dfe42e76f32912ce94d4c49c9) )
15301709   ROM_LOAD32_WORD( "ou1-mpru.11d", 0x00000, 0x80000, CRC(d98308fb) SHA1(fdefeebf56464a20e3aaefd88df4eee9f7b5c4f3) )
15311710
1532   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1711   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1712   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1713
1714   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
15331715   ROM_LOAD( "ou1spr0.5b", 0, 0x80000, CRC(60cee566) SHA1(2f3b96793816d90011586e0f9f71c58b636b6d4c) )
1534   NAMCO_C7X_BIOS
15351716
15361717   ROM_REGION( 0x200000, "c352", 0 )
15371718   ROM_LOAD( "ou1voi0.6n", 0, 0x200000, CRC(2d8fb271) SHA1(bde9d45979728f5a2cd8ec89f5f81bf16b694cc2) )
r3289r3290
15731754   ROM_LOAD32_WORD( "mb1_mprl.11c", 0x00002, 0x80000, CRC(86cf0644) SHA1(07eeadda1d94c9be2f882edb6f2eb0b98292e500) )
15741755   ROM_LOAD32_WORD( "mb1_mpru.11d", 0x00000, 0x80000, CRC(fb1ff916) SHA1(e0ba96c1f26a60f87d8050e582e164d91e132183) )
15751756
1576   ROM_REGION16_LE( 0x100000, "c7x", 0 ) /* sound data and MCU BIOS */
1757   ROM_REGION( 0x4000, "c75", 0 ) /* C75 program */
1758   ROM_LOAD( "c75.bin", 0, 0x4000, CRC(42f539a5) SHA1(3103e5a0a2867620309fd4fe478a2be0effbeff8) )
1759
1760   ROM_REGION16_LE( 0x80000, "c75data", 0 ) /* sound data */
15771761   ROM_LOAD( "mb1_spr0.5b", 0, 0x80000, CRC(d10f6272) SHA1(cb99e06e050dbf86998ea51ef2ca130b2acfb2f6) )
1578   NAMCO_C7X_BIOS
15791762
15801763   ROM_REGION( 0x1000000, "c352", 0 )
15811764   ROM_LOAD( "mb1_voi0.6n", 0x000000, 0x200000, CRC(d363ca3b) SHA1(71650b66ca3eb00f6ad7d3f1df0f37210b77b942) )
r3289r3290
16171800/***************************************************************/
16181801
16191802static INPUT_PORTS_START( gunbulet )
1620   PORT_START("COIN")
1621   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1622   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1623
1624   PORT_START("DSW")
1625   PORT_DIPNAME( 0x01, 0x00, "DSW2 (Unused)" )
1803   PORT_START("MISC")
1804   PORT_DIPNAME( 0x01, 0x00, "DSW2 (unused)" )
16261805   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16271806   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1628   PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" )
1807   PORT_DIPNAME( 0x02, 0x00, "DSW1 (unused)" )
16291808   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16301809   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1631   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1632   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */
1810   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1811   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1812   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
1813   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
1814   PORT_DIPNAME( 0x40, 0x00, "Test switch" )
1815   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1816   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1817   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
16331818
16341819   PORT_START("P1")
1635   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1636   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
1820   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1821   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
16371822
16381823   PORT_START("P2")
1639   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1640   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
1824   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1825   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
16411826
16421827   PORT_START("LIGHT0_X")
16431828   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(4)
r3289r3290
16491834   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(4) PORT_PLAYER(2)
16501835INPUT_PORTS_END
16511836
1652#ifdef UNUSED_DEFINITION
1653static INPUT_PORTS_START( machbrkr )
1654   PORT_START("COIN")
1655   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1656   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1837static INPUT_PORTS_START( outfxies )
1838   PORT_START("P1")
1839   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1840   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1841   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1842   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1843   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1844   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
1845   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
1846   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
16571847
1658   PORT_START("DSW")
1659   PORT_DIPNAME( 0x01, 0x00, "Freeze Screen" )
1848   PORT_START("P2")
1849   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1850   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1851   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1852   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1853   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1854   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1855   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1856   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
1857
1858   PORT_START("MISC")
1859   PORT_DIPNAME( 0x01, 0x01, "Freeze Screen" )
16601860   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16611861   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1662   PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" )
1862   PORT_DIPNAME( 0x02, 0x02, "DSW1 (Test)" )
16631863   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
16641864   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1665   PORT_DIPNAME( 0x04, 0x00, "Alternate Test Switch" )
1666   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1667   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1668   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1669   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1670   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1671   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1672   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1673   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1674   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1675   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1676   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1677   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1678   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */
1865   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
1866   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
1867   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1868   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1869   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1870   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
1871INPUT_PORTS_END
16791872
1873static INPUT_PORTS_START( nbsports )
16801874   PORT_START("P1")
1681   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // self test: up
1682   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // self test: enter
1683   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) // self test: down
1684   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
1875   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1876   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1877   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1878   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1879   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1880   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
1881   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
1882   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
16851883
16861884   PORT_START("P2")
1687   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1688   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
1689   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
1690   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
1885   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1886   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1887   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1888   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1889   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1890   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1891   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1892   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
16911893
1692   PORT_START("P3")
1693   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3)
1694   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3)
1695   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3)
1696   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START3 )
1697
1698   PORT_START("P4")
1699   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4)
1700   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4)
1701   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4)
1702   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START4 )
1703INPUT_PORTS_END
1704#endif
1705
1706static INPUT_PORTS_START( outfxies )
1707   PORT_START("COIN")
1708   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1709   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1710
1711   PORT_START("DSW")
1712   PORT_DIPNAME( 0x01, 0x00, "Freeze Screen" )
1894   PORT_START("MISC")
1895   PORT_DIPNAME( 0x01, 0x01, "Freeze Screen" )
17131896   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17141897   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1715   PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" )
1898   PORT_DIPNAME( 0x02, 0x02, "DSW1 (Test)" )
17161899   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17171900   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1718   PORT_DIPNAME( 0x04, 0x00, "Alternate Test Switch" )
1719   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1720   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1721   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1722   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1723   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1724   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1725   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1726   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1727   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1728   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1729   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1730   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1731   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */
1901   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1902   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1903   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1904   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1905   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1906   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
1907INPUT_PORTS_END
17321908
1909static INPUT_PORTS_START( namconb1 )
17331910   PORT_START("P1")
1734   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1735   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1736   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1737   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1738   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1739   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1740   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
1741   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
1911   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1912   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1913   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1914   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1915   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1916   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
1917   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
1918   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
17421919
17431920   PORT_START("P2")
1744   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1745   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1746   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1747   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1748   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1749   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
1750   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
1751   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
1752INPUT_PORTS_END
1921   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1922   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1923   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1924   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1925   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1926   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1927   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1928   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
17531929
1754static INPUT_PORTS_START( namconb1 )
1755   PORT_START("COIN")
1756   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1757   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1930   PORT_START("P3")
1931   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1932   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1933   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1934   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1935   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1936   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1937   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1938   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
17581939
1759   PORT_START("DSW")
1760   PORT_DIPNAME( 0x01, 0x00, "DSW2 (Unused)" )
1940   PORT_START("P4")
1941   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
1942   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
1943   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
1944   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
1945   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1946   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
1947   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
1948   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
1949
1950   PORT_START("MISC")
1951   PORT_DIPNAME( 0x01, 0x00, "DSW2 (unused)" )
17611952   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17621953   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1763   PORT_DIPNAME( 0x02, 0x00, "DSW1 (Test)" )
1954   PORT_DIPNAME( 0x02, 0x00, "DSW1 (unused)" )
17641955   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17651956   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1766   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1957   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
1958   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
1959   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )
1960   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 )
1961   PORT_DIPNAME( 0x40, 0x00, "Test switch" )
17671962   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1768   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1769   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1770   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1771   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1772   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1773   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1774   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1775   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1776   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1777   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17781963   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1779   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* C75 status */
1780
1781   PORT_START("P1")
1782   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1783   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
1784   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
1785   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
1786   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1787   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
1788   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
1789   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
1790
1791   PORT_START("P2")
1792   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1793   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1794   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1795   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1796   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
1797   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
1798   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
1799   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START2 )
1964   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
18001965INPUT_PORTS_END
18011966
1802
18031967GAME( 1994, nebulray, 0,        namconb1, namconb1, nebulray, ROT90, "Namco", "Nebulas Ray (World)", GAME_IMPERFECT_SOUND )
18041968GAME( 1994, nebulryj, nebulray, namconb1, namconb1, nebulray, ROT90, "Namco", "Nebulas Ray (Japan)", GAME_IMPERFECT_SOUND )
18051969GAME( 1994, ptblank,  0,        namconb1, gunbulet, gunbulet, ROT0,  "Namco", "Point Blank", GAME_IMPERFECT_SOUND )
18061970GAME( 1994, gunbulet, ptblank,  namconb1, gunbulet, gunbulet, ROT0,  "Namco", "Gun Bullet (Japan)", GAME_IMPERFECT_SOUND )
1807GAME( 1993, gslugrsj, 0,        namconb1, namconb1, gslgr94u, ROT0,  "Namco", "Great Sluggers (Japan)", GAME_IMPERFECT_SOUND )
1808GAME( 1994, gslgr94u, 0,        namconb1, namconb1, gslgr94u, ROT0,  "Namco", "Great Sluggers '94", GAME_IMPERFECT_SOUND )
1809GAME( 1995, sws95,    0,        namconb1, namconb1, sws95,    ROT0,  "Namco", "Super World Stadium '95 (Japan)", GAME_IMPERFECT_SOUND )
1810GAME( 1996, sws96,    0,        namconb1, namconb1, sws96,    ROT0,  "Namco", "Super World Stadium '96 (Japan)", GAME_IMPERFECT_SOUND )
1811GAME( 1997, sws97,    0,        namconb1, namconb1, sws97,    ROT0,  "Namco", "Super World Stadium '97 (Japan)", GAME_IMPERFECT_SOUND )
1971GAME( 1993, gslugrsj, 0,        namconb1, nbsports, gslgr94u, ROT0,  "Namco", "Great Sluggers (Japan)", GAME_IMPERFECT_SOUND )
1972GAME( 1994, gslgr94u, 0,        namconb1, nbsports, gslgr94u, ROT0,  "Namco", "Great Sluggers '94", GAME_IMPERFECT_SOUND )
1973GAME( 1995, sws95,    0,        namconb1, nbsports, sws95,    ROT0,  "Namco", "Super World Stadium '95 (Japan)", GAME_IMPERFECT_SOUND )
1974GAME( 1996, sws96,    0,        namconb1, nbsports, sws96,    ROT0,  "Namco", "Super World Stadium '96 (Japan)", GAME_IMPERFECT_SOUND )
1975GAME( 1997, sws97,    0,        namconb1, nbsports, sws97,    ROT0,  "Namco", "Super World Stadium '97 (Japan)", GAME_IMPERFECT_SOUND )
18121976GAME( 1994, vshoot,   0,        namconb1, namconb1, vshoot,   ROT0,  "Namco", "J-League Soccer V-Shoot", GAME_IMPERFECT_SOUND )
18131977
18141978/*     YEAR, NAME,     PARENT,   MACHINE,  INPUT,    INIT,     MNTR,  COMPANY, FULLNAME,   FLAGS */
18151979GAME( 1994, outfxies, 0,      namconb2, outfxies, outfxies, ROT0, "Namco", "Outfoxies", GAME_IMPERFECT_SOUND )
1816GAME( 1994, outfxesj, outfxies, namconb2, outfxies, outfxies, ROT0, "Namco", "Outfoxies (Japan)", GAME_IMPERFECT_SOUND )
1980GAME( 1994, outfxesj, outfxies, namconb2, outfxies   , outfxies, ROT0, "Namco", "Outfoxies (Japan)", GAME_IMPERFECT_SOUND )
18171981GAME( 1995, machbrkr, 0,      namconb2, namconb1, machbrkr, ROT0, "Namco", "Mach Breakers - Numan Athletics 2 (Japan)", GAME_IMPERFECT_SOUND )
src/mame/drivers/cps2.c
r3289r3290
38913891
38923892ROM_START( mvsc )
38933893   ROM_REGION( CODE_SIZE, "main", 0 )      /* 68000 code */
3894   ROM_LOAD16_WORD_SWAP( "mvce.03a", 0x000000, 0x80000, CRC(824e4a90) SHA1(5c79c166d988d8a75d9941f4ee6fa4d6476e55e1) )
3895   ROM_LOAD16_WORD_SWAP( "mvce.04a", 0x080000, 0x80000, CRC(cac02153) SHA1(ee9f9da6fda53f21ba7b74367612c90281269690) )
3896   ROM_LOAD16_WORD_SWAP( "mvc.05a",  0x100000, 0x80000, CRC(2d8c8e86) SHA1(b07d640a734c5d336054ed05195786224c9a6cd4) )
3897   ROM_LOAD16_WORD_SWAP( "mvc.06a",  0x180000, 0x80000, CRC(8528e1f5) SHA1(cd065c05268ab581b05676da544baf6af642acac) )
3898   ROM_LOAD16_WORD_SWAP( "mvc.07",   0x200000, 0x80000, CRC(c3baa32b) SHA1(d35589847e0753e869ffcd7c3abed925bfdb0fa2) )
3899   ROM_LOAD16_WORD_SWAP( "mvc.08",   0x280000, 0x80000, CRC(bc002fcd) SHA1(0b6735a071a9274f7ab25c743271fc30411fe819) )
3900   ROM_LOAD16_WORD_SWAP( "mvc.09",   0x300000, 0x80000, CRC(c67b26df) SHA1(6e9969246c57269d7ba0992a5cc319c8910bf8a9) )
3901   ROM_LOAD16_WORD_SWAP( "mvc.10",   0x380000, 0x80000, CRC(0fdd1e26) SHA1(5fa684d823b4f4eec61ed9e9b8938af5272ae1ed) )
3902
3903   ROM_REGION( 0x2000000, "gfx", 0 )
3904   ROMX_LOAD( "mvc.13m",   0x0000000, 0x400000, CRC(fa5f74bc) SHA1(79a619248938a85ce4f7794a704647b9cf564fbc) , ROM_GROUPWORD | ROM_SKIP(6) )
3905   ROMX_LOAD( "mvc.15m",   0x0000002, 0x400000, CRC(71938a8f) SHA1(6982f7203458c1c46a1c1c13c0d0f2a5e109d271) , ROM_GROUPWORD | ROM_SKIP(6) )
3906   ROMX_LOAD( "mvc.17m",   0x0000004, 0x400000, CRC(92741d07) SHA1(ddfd70eab7c983ab452194b1860059f8ad694459) , ROM_GROUPWORD | ROM_SKIP(6) )
3907   ROMX_LOAD( "mvc.19m",   0x0000006, 0x400000, CRC(bcb72fc6) SHA1(46ab98dcdf6f5d611646a22a7355939ef5b2bbe5) , ROM_GROUPWORD | ROM_SKIP(6) )
3908   ROMX_LOAD( "mvc.14m",   0x1000000, 0x400000, CRC(7f1df4e4) SHA1(ede92b31c1fe87f91b4fe74ac211f2fb5f863bc2) , ROM_GROUPWORD | ROM_SKIP(6) )
3909   ROMX_LOAD( "mvc.16m",   0x1000002, 0x400000, CRC(90bd3203) SHA1(ed83208c486ea0f407b7e5d16a8cf242a6f73774) , ROM_GROUPWORD | ROM_SKIP(6) )
3910   ROMX_LOAD( "mvc.18m",   0x1000004, 0x400000, CRC(67aaf727) SHA1(e0e69104e31d2c41e18c0d24e9ab962406a7ca9a) , ROM_GROUPWORD | ROM_SKIP(6) )
3911   ROMX_LOAD( "mvc.20m",   0x1000006, 0x400000, CRC(8b0bade8) SHA1(c5732361bb4bf284c4d12a82ac2c5750b1f9d441) , ROM_GROUPWORD | ROM_SKIP(6) )
3912
3913   ROM_REGION( QSOUND_SIZE, "audio", 0 ) /* 64k for the audio CPU (+banks) */
3914   ROM_LOAD( "mvc.01",   0x00000, 0x08000, CRC(41629e95) SHA1(36925c05b5fdcbe43283a882d021e5360c947061) )
3915   ROM_CONTINUE(         0x10000, 0x18000 )
3916   ROM_LOAD( "mvc.02",   0x28000, 0x20000, CRC(963abf6b) SHA1(6b784870e338701cefabbbe4669984b5c4e8a9a5) )
3917
3918   ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
3919   ROM_LOAD16_WORD_SWAP( "mvc.11m",   0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
3920   ROM_LOAD16_WORD_SWAP( "mvc.12m",   0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
3921ROM_END
3922
3923ROM_START( mvscr1 )
3924   ROM_REGION( CODE_SIZE, "main", 0 )      /* 68000 code */
38943925   ROM_LOAD16_WORD_SWAP( "mvce.03", 0x000000, 0x80000, CRC(e0633fc0) SHA1(d2feffb5505a2f8940192ae267f49561fc580b87) )
38953926   ROM_LOAD16_WORD_SWAP( "mvce.04", 0x080000, 0x80000, CRC(a450a251) SHA1(1e34fa55bb93c7573ab0205f8c5620a51765d3eb) )
38963927   ROM_LOAD16_WORD_SWAP( "mvc.05",  0x100000, 0x80000, CRC(7db71ce9) SHA1(a0097109e9f4aba40791932269d600c0ffa099a7) )
r3289r3290
73817412GAME( 1997, vhunt2,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929)", 0 )
73827413GAME( 1997, vhunt2r1, vhunt2,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913)", 0 )
73837414GAME( 1997, vsav2,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior 2: The Lord of Vampire (Japan 970913)", 0 )
7384GAME( 1998, mvsc,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980112)", 0 )
7415GAME( 1998, mvsc,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980123)", 0 )
7416GAME( 1998, mvscr1,   mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980112)", 0 )
73857417GAME( 1998, mvscu,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123)", 0 )
73867418GAME( 1998, mvscj,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980123)", 0 )
73877419GAME( 1998, mvscjr1,  mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980112)", 0 )
src/mame/drivers/psikyo.c
r3289r3290
901901   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN )
902902   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
903903   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
904   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
905   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
906   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
907   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
908   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
909   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
910   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
911   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
912   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
913   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
914   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
915   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
916904INPUT_PORTS_END
917905
918906
r3289r3290
10381026    Bit 0 1 2 3
10391027        1 1 1 1 Japan, anything but 0x0f = "World"
10401028    ************************************************/
1041   PORT_DIPNAME( 0x0000000f, 0x0000000e, "Country" )
1029   PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" )
10421030   PORT_DIPSETTING(          0x0000000f, DEF_STR( Japan ) )
10431031   PORT_DIPSETTING(          0x0000000e, DEF_STR( World ) )
1044   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1045   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1046   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1047   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1048   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1049   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1050   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1051   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1052   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1053   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1054   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1055   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
10561032INPUT_PORTS_END
10571033
10581034static INPUT_PORTS_START( s1945j )
r3289r3290
10641040   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
10651041   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
10661042   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1067   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1068   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1069   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_VBLANK  )   // vblank
1070   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1071   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1072   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
1073   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1074   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1075   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1076   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1077   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested!
10781043INPUT_PORTS_END
10791044
10801045
r3289r3290
11081073
11091074    This Dip port is bit based:
11101075
1111    If any of the bits are set it becomes World.
1112    Text for other regions is present though.
1076    Bit 0 1 2 3
1077        1 1 1 1 World
1078        0 1 1 1 USA & Canada
1079        1 0 1 1 Korea
1080        1 1 0 1 Hong Kong
1081        1 1 1 0 Taiwan
11131082
11141083    ************************************************/
1115   PORT_DIPNAME( 0x0000000f, 0x0000000e, "Country" )
1116   PORT_DIPSETTING(          0x0000000f, DEF_STR( Japan ) )
1117   PORT_DIPSETTING(          0x0000000e, DEF_STR( World ) )
1084   PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" )
1085   PORT_DIPSETTING(          0x0000000f, DEF_STR( World ) )
1086   PORT_DIPSETTING(          0x0000000e, "U.S.A & Canada" )
1087   PORT_DIPSETTING(          0x0000000d, "Korea" )
1088   PORT_DIPSETTING(          0x0000000b, "Hong Kong" )
1089   PORT_DIPSETTING(          0x00000007, "Taiwan" )
11181090   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
11191091   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
11201092   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3289r3290
11741146   PORT_DIPSETTING(          0x00000000, "On [Free Play]" ) // Forces 1C_1C
11751147INPUT_PORTS_END
11761148
1149static INPUT_PORTS_START( tengaij )
1150   PORT_INCLUDE( tengai )
11771151
1152   PORT_MODIFY("DSW")
1153   /***********************************************
1154
1155    This Dip port is bit based:
1156
1157    Bit 0 1 2 3
1158        1 1 1 1 Japan, anything but 0x0f = "World"
1159
1160    Text for other regions is present though.
1161
1162    ************************************************/
1163   PORT_DIPNAME( 0x0000000f, 0x0000000f, "Country" )
1164   PORT_DIPSETTING(          0x0000000f, DEF_STR( Japan ) )
1165   PORT_DIPSETTING(          0x0000000e, DEF_STR( World ) )
1166INPUT_PORTS_END
1167
1168
11781169/***************************************************************************
11791170
11801171
r3289r3290
19711962ROM_START( tengai )
19721963
19731964   ROM_REGION( 0x100000, "main", 0 )      /* Main CPU Code */
1965   ROM_LOAD32_WORD_SWAP( "5-u40.bin", 0x000000, 0x080000, CRC(90088195) SHA1(8ec48d581ecd14b3dad36edc65d5a273324cf3c1) ) // 1&0
1966   ROM_LOAD32_WORD_SWAP( "4-u41.bin", 0x000002, 0x080000, CRC(0d53196c) SHA1(454bb4695b13ce44ca5dac7c6d4142a8b9afa798) ) // 3&2
1967
1968   ROM_REGION( 0x030000, "audio", 0 )      /* Sound CPU Code */
1969   ROM_LOAD( "1-u63.bin", 0x00000, 0x20000, CRC(2025e387) SHA1(334b0eb3b416d46ccaadff3eee6f1abba63285fb) )
1970   ROM_RELOAD(            0x10000, 0x20000             )
1971
1972   ROM_REGION( 0x000100, "cpu2", 0 )      /* MCU */
1973   ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP )
1974
1975   ROM_REGION( 0x600000, "gfx1", ROMREGION_DISPOSE )   /* Sprites */
1976   ROM_LOAD16_WORD_SWAP( "u20.bin",  0x000000, 0x200000, CRC(ed42ef73) SHA1(74693fcc83a2654ddb18fd513d528033863d6116) )
1977   ROM_LOAD16_WORD_SWAP( "u22.bin",  0x200000, 0x200000, CRC(8d21caee) SHA1(2a68af8b2be2158dcb152c434e91a75871478d41) )
1978   ROM_LOAD16_WORD_SWAP( "u21.bin",  0x400000, 0x200000, CRC(efe34eed) SHA1(7891495b443a5acc7b2f17fe694584f6cb0afacc) )
1979
1980   ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE )   /* Layer 0 + 1 */
1981   ROM_LOAD16_WORD_SWAP( "u34.bin",  0x000000, 0x400000, CRC(2a2e2eeb) SHA1(f1d99353c0affc5c908985e6f2a5724e5223cccc) ) /* four banks of 0x100000 */
1982
1983   ROM_REGION( 0x400000, "ymf", 0 )   /* Samples */
1984   ROM_LOAD( "u61.bin",  0x000000, 0x200000, CRC(a63633c5) SHA1(89e75a40518926ebcc7d88dea86c01ba0bb496e5) )   // 8 bit signed pcm (16KHz)
1985   ROM_LOAD( "u62.bin",  0x200000, 0x200000, CRC(3ad0c357) SHA1(35f78cfa2eafa93ab96b24e336f569ee84af06b6) )
1986
1987   ROM_REGION( 0x040000, "user1", 0 )   /* Sprites LUT */
1988   ROM_LOAD( "u1.bin",  0x000000, 0x040000, CRC(681d7d55) SHA1(b0b28471440d747adbc4d22d1918f89f6ede1615) )
1989
1990ROM_END
1991
1992ROM_START( tengaij )
1993
1994   ROM_REGION( 0x100000, "main", 0 )      /* Main CPU Code */
19741995   ROM_LOAD32_WORD_SWAP( "2-u40.bin", 0x000000, 0x080000, CRC(ab6fe58a) SHA1(6687a3af192b3eab60d75ca286ebb8e0636297b5) ) // 1&0
19751996   ROM_LOAD32_WORD_SWAP( "3-u41.bin", 0x000002, 0x080000, CRC(02e42e39) SHA1(6cdb7b1cebab50c0a44cd60cd437f0e878ccac5c) ) // 3&2
19761997
r3289r3290
20292050GAME( 1994, gunbirdk, gunbird,  gunbird,  gunbirdj, gunbird,  ROT270, "Psikyo", "Gunbird (Korea)", 0 )
20302051GAME( 1994, gunbirdj, gunbird,  gunbird,  gunbirdj, gunbird,  ROT270, "Psikyo", "Gunbird (Japan)", 0 )
20312052GAME( 1994, btlkroad, 0,        gunbird,  btlkroad, gunbird,  ROT0,   "Psikyo", "Battle K-Road", 0 )
2032GAME( 1995, s1945,    0,        s1945,    s1945,    s1945,    ROT270, "Psikyo", "Strikers 1945", 0 )
2033GAME( 1995, s1945a,   s1945,    s1945,    s1945a,   s1945a,   ROT270, "Psikyo", "Strikers 1945 (Alt)", 0) // Region dip - 0x0f=Japan, anything else=World
2053GAME( 1995, s1945,    0,        s1945,    s1945,    s1945,    ROT270, "Psikyo", "Strikers 1945 (World)", 0 )
2054GAME( 1995, s1945a,   s1945,    s1945,    s1945a,   s1945a,   ROT270, "Psikyo", "Strikers 1945 (Japan / World)", 0) // Region dip - 0x0f=Japan, anything else=World
20342055GAME( 1995, s1945j,   s1945,    s1945,    s1945j,   s1945j,   ROT270, "Psikyo", "Strikers 1945 (Japan)", 0 )
20352056GAME( 1995, s1945jn,  s1945,    gunbird,  s1945j,   s1945jn,  ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", 0 )
20362057GAME( 1995, s1945k,   s1945,    s1945,    s1945j,   s1945,    ROT270, "Psikyo", "Strikers 1945 (Korea)", 0 )
2037GAME( 1996, tengai,   0,        s1945,    tengai,   tengai,   ROT0,   "Psikyo", "Tengai / Sengoku Blade: Sengoku Ace Episode II", 0 )
2058GAME( 1996, tengai,   0,        s1945,    tengai,   tengai,   ROT0,   "Psikyo", "Tengai (World)", 0 )
2059GAME( 1996, tengaij,  tengai,   s1945,    tengaij,  tengai,   ROT0,   "Psikyo", "Sengoku Blade: Sengoku Ace Episode II / Tengai", 0 ) // Region dip - 0x0f=Japan, anything else=World
20382060
src/mame/drivers/adp.c
r3289r3290
1515- Skat TV v. TS3  ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1995")
1616- Fashion Gambler ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1997")
1717- Backgammon        ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1994")
18- Funny Land de Luxe ("Copyright 1992-99 by Stella International Germany")
1819
1920
20
2121Skat TV (Version TS3)
2222Three board stack.
2323
r3289r3290
131131
132132There's also (external) JAMMA adapter - 4th board filled with resistors and diodes.
133133
134
135
136Funny Land de Luxe
137------------------
138
139Video board has additional chips:
140  - Altera EPM7032 (PLD)
141  - SG-615PH (32.0000M oscillator)
142  - Bt481 (RAMDAC)
143
134144*/
135145
136146#include "driver.h"
r3289r3290
621631   ROM_LOAD16_BYTE( "m48z08posz.bin", 0x0001, 0x2000, CRC(7c5a4b78) SHA1(262d0d7f5b24e356ab54eb2450bbaa90e3fb5464) )
622632ROM_END
623633
634ROM_START( funlddlx )
635   ROM_REGION( 0x100000, "main", 0 )
636   ROM_LOAD16_BYTE( "fldl_f6_1.bin", 0x00001, 0x80000, CRC(85c74040) SHA1(24a7d3e6acbaf73ef9817379bef64c38a9ff7896) )
637   ROM_LOAD16_BYTE( "fldl_f6_2.bin", 0x00000, 0x80000, CRC(93bf1a4b) SHA1(5b4353feba1e0d4402cd26f4855e3803e6be43b9) )
638
639   ROM_REGION( 0x100000, "gfx1", 0 )
640   ROM_LOAD16_BYTE( "flv_f1_i.bin", 0x00000, 0x80000, CRC(286fccdc) SHA1(dd23deda625e486a7cfe1f3268731d10053a96e9) )
641   ROM_LOAD16_BYTE( "flv_f1_ii.bin", 0x00001, 0x80000, CRC(2aa904e6) SHA1(864530b136dd488d619cc95f48e7dce8d93d88e0) )
642ROM_END
643
624644GAME( 1990, backgamn,        0, backgamn,    adp,    0, ROT0,  "ADP", "Backgammon", GAME_NOT_WORKING )
625645GAME( 1993, quickjac,        0, quickjac,    skattv,    0, ROT0,  "ADP", "Quick Jack", GAME_NOT_WORKING )
626646GAME( 1994, skattv,          0, skattv,      skattv,    0, ROT0,  "ADP", "Skat TV", GAME_NOT_WORKING )
627647GAME( 1995, skattva,    skattv, skattv,      skattv,    0, ROT0,  "ADP", "Skat TV (version TS3)", GAME_NOT_WORKING )
628648GAME( 1997, fashiong,        0, skattv,      adp,    0, ROT0,  "ADP", "Fashion Gambler", GAME_NOT_WORKING )
629
649GAME( 1999, funlddlx,        0, skattv,      adp,    0, ROT0,  "Stella", "Funny Land de Luxe", GAME_NOT_WORKING )
src/mame/drivers/epos.c
r3289r3290
141141
142142static INPUT_PORTS_START( megadon )
143143   PORT_START("DSW")
144   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )
144
145// There are odd port mappings (old=new)
146// 02=10, 04=40, 08=02, 10=20, 20=04, 40=08
147
148   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
145149   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
146150   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
147   PORT_DIPNAME( 0x02, 0x00, "Fuel Consumption" )
151   PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
152   PORT_DIPSETTING(    0x00, "3" )
153   PORT_DIPSETTING(    0x10, "4" )
154   PORT_DIPSETTING(    0x40, "5" )
155   PORT_DIPSETTING(    0x50, "6" )
156   PORT_DIPNAME( 0x02, 0x00, "Fuel Consumption" ) PORT_DIPLOCATION("SW1:4")
148157   PORT_DIPSETTING(    0x00, "Slow" )
149158   PORT_DIPSETTING(    0x02, "Fast" )
150   PORT_DIPNAME( 0x04, 0x00, "Rotation" )
159   PORT_DIPNAME( 0x20, 0x20, "Enemy Fire Rate" ) PORT_DIPLOCATION("SW1:5")
160   PORT_DIPSETTING(    0x20, "Slow" )
161   PORT_DIPSETTING(    0x00, "Fast" )
162   PORT_DIPNAME( 0x04, 0x00, "Rotation" ) PORT_DIPLOCATION("SW1:6")
151163   PORT_DIPSETTING(    0x04, "Slow" )
152164   PORT_DIPSETTING(    0x00, "Fast" )
153   PORT_DIPNAME( 0x08, 0x08, "ERG" )
165   PORT_DIPNAME( 0x08, 0x08, "ERG" ) PORT_DIPLOCATION("SW1:7")
154166   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
155167   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
156   PORT_DIPNAME( 0x20, 0x20, "Enemy Fire Rate" )
157   PORT_DIPSETTING(    0x20, "Slow" )
158   PORT_DIPSETTING(    0x00, "Fast" )
159   PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) )
160   PORT_DIPSETTING(    0x00, "3" )
161   PORT_DIPSETTING(    0x10, "4" )
162   PORT_DIPSETTING(    0x40, "5" )
163   PORT_DIPSETTING(    0x50, "6" )
164   PORT_DIPNAME( 0x80, 0x00, "Game Mode" )
168   PORT_DIPNAME( 0x80, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW1:8")
165169   PORT_DIPSETTING(    0x00, "Arcade" )
166170   PORT_DIPSETTING(    0x80, "Contest" )
167171
r3289r3290
189193
190194static INPUT_PORTS_START( suprglob )
191195   PORT_START("DSW")
192   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )
196
197// There are odd port mappings (old=new)
198// 02=10, 04=40, 08=20, 10=02, 20=04, 40=08
199
200   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
193201   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
194202   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
195   PORT_DIPNAME( 0x26, 0x00, DEF_STR( Difficulty ) )
203   PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
204   PORT_DIPSETTING(    0x00, "3" )
205   PORT_DIPSETTING(    0x10, "4" )
206   PORT_DIPSETTING(    0x40, "5" )
207   PORT_DIPSETTING(    0x50, "6" )
208   PORT_DIPNAME( 0x26, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5,6")
196209   PORT_DIPSETTING(    0x00, "1" )
197210   PORT_DIPSETTING(    0x02, "2" )
198211   PORT_DIPSETTING(    0x20, "3" )
r3289r3290
201214   PORT_DIPSETTING(    0x06, "6" )
202215   PORT_DIPSETTING(    0x24, "7" )
203216   PORT_DIPSETTING(    0x26, "8" )
204   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
217   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7")
205218   PORT_DIPSETTING(    0x00, "10000 + Difficulty * 10000" )
206219   PORT_DIPSETTING(    0x08, "90000 + Difficulty * 10000" )
207   PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) )
208   PORT_DIPSETTING(    0x00, "3" )
209   PORT_DIPSETTING(    0x10, "4" )
210   PORT_DIPSETTING(    0x40, "5" )
211   PORT_DIPSETTING(    0x50, "6" )
212   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
220   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
213221   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
214222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
215223
r3289r3290
240248
241249static INPUT_PORTS_START( igmo )
242250   PORT_START("DSW")
243   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )
251
252// There are odd port mappings (old=new)
253// 02=10, 04=40, 08=20, 10=02, 20=04, 40=08
254
255   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
244256   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
245257   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
246   PORT_DIPNAME( 0x22, 0x00, DEF_STR( Bonus_Life ) )
258   PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
259   PORT_DIPSETTING(    0x00, "3" )
260   PORT_DIPSETTING(    0x10, "4" )
261   PORT_DIPSETTING(    0x40, "5" )
262   PORT_DIPSETTING(    0x50, "6" )
263   PORT_DIPNAME( 0x22, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,5")
247264   PORT_DIPSETTING(    0x00, "20000" )
248265   PORT_DIPSETTING(    0x02, "40000" )
249266   PORT_DIPSETTING(    0x20, "60000" )
250267   PORT_DIPSETTING(    0x22, "80000" )
251   PORT_DIPNAME( 0x8c, 0x00, DEF_STR( Difficulty ) )
268   PORT_DIPNAME( 0x8c, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7,8")
252269   PORT_DIPSETTING(    0x00, "1" )
253270   PORT_DIPSETTING(    0x04, "2" )
254271   PORT_DIPSETTING(    0x08, "3" )
r3289r3290
257274   PORT_DIPSETTING(    0x84, "6" )
258275   PORT_DIPSETTING(    0x88, "7" )
259276   PORT_DIPSETTING(    0x8c, "8" )
260   PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) )
261   PORT_DIPSETTING(    0x00, "3" )
262   PORT_DIPSETTING(    0x10, "4" )
263   PORT_DIPSETTING(    0x40, "5" )
264   PORT_DIPSETTING(    0x50, "6" )
265277
266278   PORT_START("SYSTEM")
267279   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r3289r3290
287299INPUT_PORTS_END
288300
289301
302static INPUT_PORTS_START( catapult )
303   PORT_INCLUDE(igmo)
304        PORT_MODIFY("DSW")
305
306// There are odd port mappings (old=new)
307// 02=08, 04=20, 08=40, 10=02, 20=10, 40=04
308
309   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
310   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
311   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
312   PORT_DIPNAME( 0x50, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,3")
313   PORT_DIPSETTING(    0x00, "3" )
314   PORT_DIPSETTING(    0x10, "4" )
315   PORT_DIPSETTING(    0x40, "5" )
316   PORT_DIPSETTING(    0x50, "6" )
317   PORT_DIPNAME( 0x22, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5")
318   PORT_DIPSETTING(    0x00, "1" )
319   PORT_DIPSETTING(    0x02, "2" )
320   PORT_DIPSETTING(    0x20, "3" )
321   PORT_DIPSETTING(    0x22, "4" )
322   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:6,7")
323   PORT_DIPSETTING(    0x00, "20000" )
324   PORT_DIPSETTING(    0x04, "40000" )
325   PORT_DIPSETTING(    0x08, "60000" )
326   PORT_DIPSETTING(    0x0c, "80000" )
327   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
328   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
329   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
330INPUT_PORTS_END
331
332
290333static INPUT_PORTS_START( dealer )
291334   PORT_START("DSW")
292   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
335   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1")
293336   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
294337   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
295   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Free_Play ) )
338   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:2")
296339   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
297340   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
298   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
299   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
300   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
301   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
302   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
303   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
304   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
305   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
306   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
307   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
308   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
309   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
310   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
341   PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:4" )
342   PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:5" )
343   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:6" )
344   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:7" )
345   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:7")
311346   PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
312347   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
313   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
348   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8")
314349   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
315350   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
316351
r3289r3290
612647 *************************************/
613648
614649GAME( 1982, megadon,  0,        epos,   megadon,  0,        ROT270, "Epos Corporation (Photar Industries license)", "Megadon", 0 )
615GAME( 1982, catapult, 0,        epos,   igmo,    0,        ROT270, "Epos Corporation", "Catapult", GAME_NOT_WORKING) /* bad rom, hold f2 for test mode */
650GAME( 1982, catapult, 0,        epos,   catapult, 0,        ROT270, "Epos Corporation", "Catapult", GAME_NOT_WORKING) /* bad rom, hold f2 for test mode */
616651GAME( 1983, suprglob, 0,        epos,   suprglob, 0,        ROT270, "Epos Corporation", "Super Glob", 0 )
617652GAME( 1983, theglob,  suprglob, epos,   suprglob, 0,        ROT270, "Epos Corporation", "The Glob", 0 )
618653GAME( 1983, theglob2, suprglob, epos,   suprglob, 0,        ROT270, "Epos Corporation", "The Glob (earlier)", 0 )
src/mame/drivers/atarisy1.c
r3289r3290
570570INPUT_PORTS_END
571571
572572
573static INPUT_PORTS_START( indytemc )
574   PORT_INCLUDE( indytemp )
575
576   PORT_MODIFY("IN0")   /* F40000 */
577   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
578   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
579   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
580   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
581   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
582INPUT_PORTS_END
583
584
573585static INPUT_PORTS_START( roadrunn )
574586   PORT_START("IN0")   /* F40000 */
575587   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
r3289r3290
11961208ROM_END
11971209
11981210
1199ROM_START( indytemc )
1211ROM_START( indytemc ) /* Dedicated boardset marked 'ATARI SYSTEM I LSI CARTRIDGE COCKTAIL A043310' */
12001212   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1201    MOTHERBOARD_BIOS
1202   ROM_LOAD16_BYTE( "136036.632",   0x10000, 0x08000, BAD_DUMP CRC(8af67d9b) SHA1(5777ed2048fe1a58a1cac8276185843396754d38) )
1203   ROM_LOAD16_BYTE( "136036.631",   0x10001, 0x08000, CRC(9ac96ba8) SHA1(d80adabb4198461b5976577bdd8cc4e650de1c8e) )
1213   ROM_LOAD16_BYTE( "136032.116",   0x00000, 0x04000, CRC(195c54ad) SHA1(d7cda3cd3db4c6f77074ca05e96ae11b62e048b7) )
1214   ROM_LOAD16_BYTE( "136032.117",   0x00001, 0x04000, CRC(9af9fe29) SHA1(1d5077662e4111ece9f8a5124394dad8b1abdc13) )
1215   ROM_LOAD16_BYTE( "136032.632",   0x10000, 0x08000, CRC(d3e1a611) SHA1(edbced6dd64ca44a59aff6a4acca0b3ddb233810) )
1216   ROM_LOAD16_BYTE( "136032.631",   0x10001, 0x08000, CRC(9ac96ba8) SHA1(d80adabb4198461b5976577bdd8cc4e650de1c8e) )
12041217   ROM_LOAD16_BYTE( "136036.534",   0x20000, 0x08000, CRC(eae396be) SHA1(6d7a82a2fd43b91c6c1e2c07d33c81487b845bba) )
12051218   ROM_LOAD16_BYTE( "136036.533",   0x20001, 0x08000, CRC(06c66335) SHA1(848cd7d8c2d8da4d07ddc908676155e154ae764a) )
12061219   ROM_LOAD16_BYTE( "136036.568",   0x30000, 0x08000, CRC(2bbc16ed) SHA1(f20a07632679641f007caa44feb52272f8a2936d) )
r3289r3290
12101223
12111224   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for 6502 code */
12121225   ROM_LOAD( "136036.153",   0x4000, 0x4000, CRC(95294641) SHA1(00f90a0d49d2c77d5288080036f81a74ad31f8bc) )
1213   ROM_LOAD( "136036.170",   0x8000, 0x8000, BAD_DUMP CRC(8af67d9b) SHA1(5777ed2048fe1a58a1cac8276185843396754d38) )
1226   ROM_LOAD( "136036.170",   0x8000, 0x8000, CRC(f318b321) SHA1(8fe9e88fa9f2104526f89926a7119b866051e4ef) )
12141227
12151228   ROM_REGION( 0x4000, "alpha", ROMREGION_DISPOSE )
12161229   ROM_LOAD( "136032.120",   0x00000, 0x04000, CRC(90a1950d) SHA1(fba32c255850312175d1e3c03d677ffb57e09e07) )  /* alpha font */
r3289r3290
12381251
12391252   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
12401253   ROM_LOAD( "136036.152",   0x000, 0x200, CRC(4f96e57c) SHA1(271633a0aacd1d1efe2917728b73e90010c64d2c) )  /* remap */
1241   ROM_LOAD( "136036.151",   0x200, 0x200, CRC(7daf351f) SHA1(95c13d81a47440f847af7b19632cc032380b9ff4) )  /* color */
1254   ROM_LOAD( "136036.160",   0x200, 0x200, CRC(88c65843) SHA1(81fef378b3dbf4d7228beb7427e2f75cae371808) )  /* color */
12421255ROM_END
12431256
12441257
r3289r3290
22202233GAME( 1985, indytem3, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (set 3)", 0 )
22212234GAME( 1985, indytem4, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (set 4)", 0 )
22222235GAME( 1985, indytemd, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (German)", 0 )
2223GAME( 1985, indytemc, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (Cocktail)", 0 )
2236GAME( 1985, indytemc, indytemp, atarisy1, indytemc, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (Cocktail)", GAME_IMPERFECT_GRAPHICS )
22242237
22252238GAME( 1985, roadrunn, atarisy1, atarisy1, roadrunn, roadrunn, ROT0, "Atari Games", "Road Runner (rev 2)", 0 )
22262239GAME( 1985, roadrun2, roadrunn, atarisy1, roadrunn, roadrunn, ROT0, "Atari Games", "Road Runner (rev 1+)", 0 )
src/mame/drivers/dec0.c
r3289r3290
3333    Gouky's patch for Bad Dudes & YM3812 information!
3434    Thanks to JC Alexander for fix to Robocop ending!
3535
36    All games' Dip Switches (except Boulder Dash) have been verified against
37Original Service Manuals and Service Mode (when available).
38
39
3640ToDo:
3741  Hook up the 68705 in Midnight Resistance (bootleg)
3842
r3289r3290
426430INPUT_PORTS_END
427431
428432#define DEC0_COIN_SETTING \
429   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) \
433   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")\
430434   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) ) \
431435   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) ) \
432436   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) ) \
433437   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_2C ) ) \
434   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) \
438   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3,4")\
435439   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) ) \
436440   PORT_DIPSETTING(      0x0004, DEF_STR( 2C_1C ) ) \
437441   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) ) \
r3289r3290
441445   PORT_INCLUDE( dec0 )
442446
443447   PORT_START("DSW")
444   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) )
448   PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")
445449   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_1C ) )
446450   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_1C ) )
447451   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_2C ) )
448452   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_3C ) )
449   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) )
453   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:3,4")
450454   PORT_DIPSETTING(      0x0000, DEF_STR( 2C_1C ) )
451455   PORT_DIPSETTING(      0x000c, DEF_STR( 1C_1C ) )
452456   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_2C ) )
453457   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_3C ) )
454458   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
455   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
459   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
456460   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
457461   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
458   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
462   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
459463   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
460464   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
461   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )   // Always OFF
462   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
463   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
465   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )   // Always OFF
464466
465   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
466   PORT_DIPSETTING(      0x0100, "1" )
467   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
467468   PORT_DIPSETTING(      0x0300, "3" )
468469   PORT_DIPSETTING(      0x0200, "5" )
470   PORT_DIPSETTING(      0x0100, "1" )
469471   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
470   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
472   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
471473   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
472474   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
473475   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
474476   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
475   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) )
477   PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:5,6")
476478   PORT_DIPSETTING(      0x3000, "30k 80k 160k" )
477   PORT_DIPSETTING(      0x1000, "50k 120k 190k" )
478   PORT_DIPSETTING(      0x2000, "100k 200k 300k" )
479   PORT_DIPSETTING(      0x2000, "50k 120k 190k" )
480   PORT_DIPSETTING(      0x1000, "100k 200k 300k" )
479481   PORT_DIPSETTING(      0x0000, "150k 300k 450k" )
480   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) )
482   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7")
481483   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
482484   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
483   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
484   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
485   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
485   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW1:8" )   // Always OFF
486486
487487   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
488488   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
r3289r3290
496496
497497   PORT_START("DSW")
498498   DEC0_COIN_SETTING
499   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
500   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
499   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:5")
500   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
501501   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
502502   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
503   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
503   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
504504   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
505505   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
506   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
507   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
508   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
506   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )   // Always OFF
509507
510   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
511   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
512   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
513   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
514   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
515   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
516   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
517   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
518   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
519   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
520   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
521   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
522   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
508   PORT_DIPNAME( 0x0300, 0x0300, "Difficulty (Extend)" ) PORT_DIPLOCATION("SW2:1,2")
509   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
510   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
511   PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
512   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
513   PORT_DIPNAME( 0x0c00, 0x0c00, "Difficulty (Course)" ) PORT_DIPLOCATION("SW2:3,4")
514   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
515   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
516   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
517   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
518   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5")
523519   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
524520   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
525   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
526   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
527   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
528   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
529   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
530   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
531   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
532   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
533   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
521   PORT_DIPNAME( 0x2000, 0x2000, "Timer" ) PORT_DIPLOCATION("SW2:6")
522   PORT_DIPSETTING(      0x2000, DEF_STR( Normal ) )
523   PORT_DIPSETTING(      0x0000, "Fast" )
524   PORT_DIPNAME( 0xc000, 0x0000, "Control Panel Type" ) PORT_DIPLOCATION("SW2:7,8")
525   PORT_DIPSETTING(      0xc000, "Type A - Cocktail" )
526   PORT_DIPSETTING(      0x8000, "Type B - Cocktail 2" )
527   PORT_DIPSETTING(      0x4000, DEF_STR( Unused ) )
528   PORT_DIPSETTING(      0x0000, "Type C - Upright" )
534529
535530   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
536531   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
r3289r3290
544539
545540   PORT_START("DSW")
546541   DEC0_COIN_SETTING
547   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
548   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
542   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:5")
543   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
549544   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
550545   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
551   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
546   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
552547   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
553548   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
554   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )   // According to some technical sources should be "Cabinet"
555   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
556   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
549   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )      // Always OFF
557550
558   PORT_DIPNAME( 0x0300, 0x0200, DEF_STR( Lives ) )
551   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
552   PORT_DIPSETTING(      0x0200, "5" )
553   PORT_DIPSETTING(      0x0300, "3" )
559554   PORT_DIPSETTING(      0x0100, "1" )
560   PORT_DIPSETTING(      0x0300, "2" )
561   PORT_DIPSETTING(      0x0200, "3" )
562555   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
563   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
556   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
564557   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
565558   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
566559   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
567560   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
568   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) )
569   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
570   PORT_DIPSETTING(      0x1000, DEF_STR( Yes ) )
571   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )   // Always OFF
572   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
573   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
574   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) )   // Always OFF
575   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
576   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
577   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
578   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
579   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
561   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5")
562   PORT_DIPSETTING(      0x1000, DEF_STR( No ) )
563   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
564   PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" )   // Always OFF
565   PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" )   // Always OFF
566   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )   // Always OFF
580567
581568   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
582569   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused */
r3289r3290
590577
591578   PORT_START("DSW")
592579   DEC0_COIN_SETTING
593   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )   // Always OFF
594   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
595   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
596   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
580   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" )   // Always OFF
581   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
597582   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
598583   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
599   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
584   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
600585   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
601586   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
602   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) )
587   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
603588   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
604589   PORT_DIPSETTING(      0x0080, DEF_STR( Cocktail ) )
605590
606   PORT_DIPNAME( 0x0300, 0x0300, "Player Energy" )
591   PORT_DIPNAME( 0x0300, 0x0300, "Player Energy" ) PORT_DIPLOCATION("SW2:1,2")
607592   PORT_DIPSETTING(      0x0100, DEF_STR( Low ) )
608593   PORT_DIPSETTING(      0x0300, DEF_STR( Medium ) )
609594   PORT_DIPSETTING(      0x0200, DEF_STR( High ) )
610595   PORT_DIPSETTING(      0x0000, DEF_STR( Very_High ) )
611   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
596   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
612597   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
613598   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
614599   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
615600   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
616   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) )
601   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5")
617602   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
618603   PORT_DIPSETTING(      0x1000, DEF_STR( Yes ) )
619   PORT_DIPNAME( 0x2000, 0x2000, "Bonus Stage Energy" )
604   PORT_DIPNAME( 0x2000, 0x2000, "Bonus Stage Energy" ) PORT_DIPLOCATION("SW2:6")
620605   PORT_DIPSETTING(      0x0000, DEF_STR( Low ) )
621606   PORT_DIPSETTING(      0x2000, DEF_STR( High ) )
622607   PORT_DIPNAME( 0x4000, 0x4000, "Brink Time" )
623   PORT_DIPSETTING(      0x4000, DEF_STR( Normal ) )
608   PORT_DIPSETTING(      0x4000, DEF_STR( Normal ) ) PORT_DIPLOCATION("SW2:7")   /* not mentioned in manual */
624609   PORT_DIPSETTING(      0x0000, "Less" )
625   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
626   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
627   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
610   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )   // Always OFF
628611INPUT_PORTS_END
629612
630613static INPUT_PORTS_START( hippodrm )
r3289r3290
632615
633616   PORT_START("DSW")
634617   DEC0_COIN_SETTING
635   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )   // Always OFF
636   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
637   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
638   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
618   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" )   // Always OFF
619   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
639620   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
640621   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
641   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
622   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
642623   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
643624   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
644   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )   // Always OFF
645   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
646   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
625   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )   // Always OFF
647626
648   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
627   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
649628   PORT_DIPSETTING(      0x0100, "1" )
650629   PORT_DIPSETTING(      0x0300, "2" )
651630   PORT_DIPSETTING(      0x0200, "3" )
652631   PORT_DIPSETTING(      0x0000, "5" )
653   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
632   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
654633   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
655634   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
656635   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
657636   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
658   PORT_DIPNAME( 0x3000, 0x3000, "Player & Enemy Energy" )
659   PORT_DIPSETTING(      0x1000, DEF_STR( Low ) )
660   PORT_DIPSETTING(      0x2000, DEF_STR( Medium ) )
661   PORT_DIPSETTING(      0x3000, DEF_STR( High ) )
662   PORT_DIPSETTING(      0x0000, DEF_STR( Very_High ) )
663   PORT_DIPNAME( 0x4000, 0x4000, "Enemy Power on Continue" )
664   PORT_DIPSETTING(      0x4000, "3 Dots" )   // 3 Dots less
665   PORT_DIPSETTING(      0x0000, "2 Dots" )   // 2 Dots less
666   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
667   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
668   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
637   PORT_DIPNAME( 0x3000, 0x3000, "Player & Enemy Energy" ) PORT_DIPLOCATION("SW2:5,6")
638   PORT_DIPSETTING(      0x3000, DEF_STR( Medium ) )
639   PORT_DIPSETTING(      0x2000, DEF_STR( Low ) )
640   PORT_DIPSETTING(      0x1000, DEF_STR( Very_Low ) )
641   PORT_DIPSETTING(      0x0000, DEF_STR( High ) )
642   PORT_DIPNAME( 0x4000, 0x4000, "Enemy Power Decrease on Continue" ) PORT_DIPLOCATION("SW2:7")
643   PORT_DIPSETTING(      0x4000, "2 Dots" )   // 2 Dots less
644   PORT_DIPSETTING(      0x0000, "3 Dots" )   // 3 Dots less
645   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )   // Always OFF
669646
670647   PORT_START("VBLANK")
671648   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK )
r3289r3290
677654
678655   PORT_START("DSW")
679656   DEC0_COIN_SETTING
680   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
681   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
657   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:5")
658   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
682659   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
683660   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
684   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
661   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
685662   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
686663   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
687   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) )
664   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
688665   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
689666   PORT_DIPSETTING(      0x0080, DEF_STR( Cocktail ) )
690667
691   PORT_DIPNAME( 0x0300, 0x0300, "Energy" )
692   PORT_DIPSETTING(      0x0200, DEF_STR( Low ) )
693   PORT_DIPSETTING(      0x0300, DEF_STR( Medium ) )
694   PORT_DIPSETTING(      0x0100, DEF_STR( High ) )
695   PORT_DIPSETTING(      0x0000, DEF_STR( Very_High ) )
696   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
668   PORT_DIPNAME( 0x0300, 0x0300, "Energy" ) PORT_DIPLOCATION("SW2:1,2")
669   PORT_DIPSETTING(      0x0200, "Low - 8 bars" )
670   PORT_DIPSETTING(      0x0300, "Medium - 10 bars" )
671   PORT_DIPSETTING(      0x0100, "High - 12 bars" )
672   PORT_DIPSETTING(      0x0000, "Very High - 14 bars" )
673   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")   /* not mentioned in manual */
697674   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
698675   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
699676   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
700677   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
701   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) )
678   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5")
702679   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
703680   PORT_DIPSETTING(      0x1000, DEF_STR( Yes ) )
704   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )   // Always OFF
705   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
706   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
707   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unused ) )   // Always OFF
708   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
709   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
710   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
711   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
712   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
681   PORT_DIPUNUSED_DIPLOC( 0x2000, 0x2000, "SW2:6" )   // Always OFF
682   PORT_DIPUNUSED_DIPLOC( 0x4000, 0x4000, "SW2:7" )   // Always OFF
683   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )   // Always OFF
713684INPUT_PORTS_END
714685
715686static INPUT_PORTS_START( midres )
r3289r3290
717688
718689   PORT_START("DSW")
719690   DEC0_COIN_SETTING
720   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )   // Always OFF
721   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
722   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
723   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
691   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" )   // Always OFF
692   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
724693   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
725694   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
726   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
695   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
727696   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
728697   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
729   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )   // Always OFF
730   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
731   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
698   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )   // Always OFF
732699
733   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
734   PORT_DIPSETTING(      0x0100, "1" )
700   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
735701   PORT_DIPSETTING(      0x0300, "3" )
736   PORT_DIPSETTING(      0x0200, "5" )
702   PORT_DIPSETTING(      0x0200, "4" )
703   PORT_DIPSETTING(      0x0100, "5" )
737704   PORT_DIPSETTING(      0x0000, "Infinite (Cheat)")
738   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
705   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
739706   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
740707   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
741708   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
742709   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
743   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )   // Extra Lives?
710   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )  PORT_DIPLOCATION("SW2:5")   /* manual mentions Extra Lives - Default OFF */
744711   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
745712   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
746   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )   // Extra Lives?
713   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )  PORT_DIPLOCATION("SW2:6")   /* manual mentions Extra Lives - Default OFF */
747714   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
748715   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
749   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) )
716   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Allow_Continue ) )  PORT_DIPLOCATION("SW2:7")
750717   PORT_DIPSETTING(      0x4000, DEF_STR( No ) )
751718   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
752   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )   // Always OFF
753   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
754   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
719   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )   // Always OFF
755720
756721   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
757722   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
r3289r3290
768733
769734   PORT_START("DSW")
770735   /* Different Coinage. Just a few combinations from manual, the rest was figured out */
771   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )
736   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
772737   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
773738   PORT_DIPSETTING(      0x0001, DEF_STR( 2C_1C ) )
774739   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
r3289r3290
777742   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
778743   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_5C ) )
779744   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_6C ) )
780   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) )
745   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6")
781746   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
782747   PORT_DIPSETTING(      0x0008, DEF_STR( 2C_1C ) )
783748   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
r3289r3290
786751   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_4C ) )
787752   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_5C ) )
788753   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_6C ) )
789   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
754   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7")
790755   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
791756   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
792   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) )
757   PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
793758   PORT_DIPSETTING(      0x0000, DEF_STR( Upright ) )
794759   PORT_DIPSETTING(      0x0080, DEF_STR( Cocktail ) )
795760
796   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) )
761   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
797762   PORT_DIPSETTING(      0x0000, "2" )
798763   PORT_DIPSETTING(      0x0300, "3" )
799764   PORT_DIPSETTING(      0x0200, "4" )
800765   PORT_DIPSETTING(      0x0100, "5" )
801   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) )
766   PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
802767   PORT_DIPSETTING(      0x0800, DEF_STR( Easy ) )
803768   PORT_DIPSETTING(      0x0c00, DEF_STR( Normal ) )
804769   PORT_DIPSETTING(      0x0400, DEF_STR( Hard ) )
805770   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
806   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) )   // Always OFF
807   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
808   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
809   PORT_DIPNAME( 0x2000, 0x2000, "Game Change Mode" )
771   PORT_DIPUNUSED_DIPLOC( 0x1000, 0x1000, "SW2:5" )   // Always OFF
772   PORT_DIPNAME( 0x2000, 0x2000, "Game Change Mode" ) PORT_DIPLOCATION("SW2:6")
810773   PORT_DIPSETTING(      0x2000, "Part 1" )
811774   PORT_DIPSETTING(      0x0000, "Part 2" )
812   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) )
775   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7")
813776   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
814777   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
815   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )
778   PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SW2:8")
816779   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
817780   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
818781INPUT_PORTS_END
src/mame/drivers/shadfrce.c
r3289r3290
518518}
519519
520520static MACHINE_DRIVER_START( shadfrce )
521   MDRV_CPU_ADD("main", M68000, 28000000/2) /* ? Guess - CPU is rated for 16MHz */
521   MDRV_CPU_ADD("main", M68000, XTAL_28MHz/2) /* verified on pcb */
522522   MDRV_CPU_PROGRAM_MAP(shadfrce_map,0)
523523   MDRV_CPU_VBLANK_INT_HACK(shadfrce_interrupt,256)
524524
525   MDRV_CPU_ADD("audio", Z80, 3579545)
525   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) /* verified on pcb */
526526   MDRV_CPU_PROGRAM_MAP(shadfrce_sound_map,0)
527527
528528   MDRV_MACHINE_RESET(shadfrce)
r3289r3290
544544   /* sound hardware */
545545   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
546546
547   MDRV_SOUND_ADD("ym", YM2151, 3579545)
547   MDRV_SOUND_ADD("ym", YM2151, XTAL_3_579545MHz) /* verified on pcb */
548548   MDRV_SOUND_CONFIG(ym2151_config)
549549   MDRV_SOUND_ROUTE(0, "left", 0.50)
550550   MDRV_SOUND_ROUTE(1, "right", 0.50)
551551
552   MDRV_SOUND_ADD("oki", OKIM6295, 1584000)
553   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
552   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_13_4952MHz/8) /* verified on pcb */
553   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) /* verified on pcb, pin7 is at 2.4v */
554554   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
555555   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
556556MACHINE_DRIVER_END
src/mame/drivers/naomi.c
r3289r3290
32503250   DISK_IMAGE_READONLY( "gds-0012", 0, SHA1(d68436ee72ea5db40e184b7ff38903a9cadb6df7) MD5(5a18300646a68f2994ed8c81abe9bdd8) )
32513251
32523252   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3253   // this key is wrong! not for this game
3254   // (it's for game with a BDR.bin file on the GD-ROM, vf4 has BDM.bin)
3253   //PIC16C622A (317-0314-COM)
3254   //(sticker 253-5508-0314)
3255   ROM_LOAD("317-0314-com.data", 0x00, 0x50, CRC(91a97eb4) SHA1(059342368bc5d25b494ed3c729870695f9584fc7) )
3256ROM_END
32553257
3258   // this is actually Beach Spikers...
32563259   //PIC16C622A (317-0317-COM)
32573260   //(sticker 253-5508-0317)
3258   ROM_LOAD("317-0317-com.data", 0x00, 0x50, BAD_DUMP CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) )
3259ROM_END
3261   //ROM_LOAD("317-0317-com.data", 0x00, 0x50, CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) )
32603262
3263
32613264ROM_START( initd )
32623265   NAOMI2_BIOS
32633266
src/mame/drivers/powerbal.c
r3289r3290
114114   AM_RANGE(0x0c201c, 0x0c201d) AM_WRITE(oki_banking)
115115   AM_RANGE(0x0c201e, 0x0c201f) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
116116   AM_RANGE(0x0c4000, 0x0c4001) AM_WRITENOP
117   AM_RANGE(0x0f0000, 0x0fffff) AM_RAM
117   AM_RANGE(0x0e0000, 0x0fffff) AM_RAM
118118   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
119119ADDRESS_MAP_END
120120
r3289r3290
320320   PORT_DIPSETTING(    0xe0, "Easy 9" )
321321INPUT_PORTS_END
322322
323static INPUT_PORTS_START( hotminda )
324   PORT_START("IN0")
325   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
326   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
327   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
328   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
329   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
330   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
331   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
332   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
333
334   PORT_START("IN1")
335   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
336   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
337   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
338   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
339   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
340   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
341   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
342   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
343
344   PORT_START("IN2")
345   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)   /* EEPROM data */
346   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
347   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
348   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
349   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
350   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
351   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
352   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
353
354   PORT_START("DSW1")
355   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:8")
356   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
357   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
358   PORT_DIPNAME( 0x06, 0x06, "Premio" )         PORT_DIPLOCATION("DSW1:7,6")
359   PORT_DIPSETTING(    0x00, "1 Premio ogni 10 Vincite" )
360   PORT_DIPSETTING(    0x04, "1 Premio ogni 10 Vincite" )
361   PORT_DIPSETTING(    0x02, "1 Premio ogni 5 Vincite" )
362   PORT_DIPSETTING(    0x06, "Paga 1 Premio ogni Vincita" )
363   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B )   )   PORT_DIPLOCATION("DSW1:5,4")
364   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
365   PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
366   PORT_DIPSETTING(    0x10, DEF_STR( 1C_5C ) )
367   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
368   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:3")
369   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
370   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
371   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:2")
372   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
373   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
374   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:1")
375   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
376   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
377
378   PORT_START("DSW2")
379   PORT_DIPNAME( 0x01, 0x01, "Clear Counters" )   PORT_DIPLOCATION("DSW2:8")
380   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
381   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
382   PORT_DIPNAME( 0x02, 0x02, "Ticket" )         PORT_DIPLOCATION("DSW2:7")
383   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
384   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
385   PORT_DIPNAME( 0x04, 0x04, "Hopper" )         PORT_DIPLOCATION("DSW2:6")
386   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
387   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
388   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("DSW2:5")
389   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
390   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
391   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )               PORT_DIPLOCATION("DSW2:4")
392   PORT_DIPNAME( 0xe0, 0x60, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("DSW2:3,2,1")
393   PORT_DIPSETTING(    0xa0, "Hard 7" )
394   PORT_DIPSETTING(    0x20, "Very Hard 6" )
395   PORT_DIPSETTING(    0xc0, "Very Hard 5" )
396   PORT_DIPSETTING(    0x40, "Very Hard 4" )
397   PORT_DIPSETTING(    0x80, "Very Hard 3" )
398   PORT_DIPSETTING(    0x00, "Very Hard 2" )
399   PORT_DIPSETTING(    0x60, "Normal 8" )
400   PORT_DIPSETTING(    0xe0, "Easy 9" )
401INPUT_PORTS_END
402
323403static TILE_GET_INFO( powerbal_get_bg_tile_info )
324404{
325405   int code = (magicstk_videoram[tile_index] & 0x07ff) + magicstk_tilebank * 0x800;
r3289r3290
572652   ROM_LOAD( "gal22v10b.bin", 0x0400, 0x02e5, NO_DUMP ) /* GAL is soldered */
573653ROM_END
574654
655
656ROM_START( hotminda )
657   ROM_REGION( 0x80000, "main", 0 )   /* 68000 code */
658   ROM_LOAD16_BYTE( "rom1.rom",       0x00001, 0x20000, CRC(33aaceba) SHA1(a914400b081eabd869f1ca2c843a91b03af510b1) )
659   ROM_LOAD16_BYTE( "rom2.rom",       0x00000, 0x20000, CRC(f5accd9f) SHA1(12194ea7c35263be9afd91f0abe2041998528af9) )
660
661   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE )
662   ROM_LOAD( "rom13.rom",       0x00000, 0x20000, CRC(18d22109) SHA1(52bbb68f4ef5f4d41f5915bef4304784451ca6d8) )
663   ROM_LOAD( "rom14.rom",       0x20000, 0x20000, CRC(f95a1ff6) SHA1(646c59199570ccd11cb53b0b59a6cd03b1b42fac) )
664   ROM_LOAD( "rom15.rom",       0x40000, 0x20000, CRC(8a9ea7ed) SHA1(529c0466df3f0aa050526699099ea7a5da9dbcfe) )
665   ROM_LOAD( "rom16.rom",       0x60000, 0x20000, CRC(df63b642) SHA1(d5df740717193b06267508d169bb5df6214ca13d))
666
667   ROM_REGION( 0x80000, "gfx2", ROMREGION_DISPOSE )
668   ROM_LOAD( "rom17.rom",       0x00000, 0x20000, CRC(805002cf) SHA1(dc97881bc78dcb753f404b7df2cfd4a071ca8393) )
669   ROM_LOAD( "rom18.rom",       0x20000, 0x20000, CRC(6a9d896b) SHA1(d617a69e6954de3bf7c322529232eadb90034fbc) )
670   ROM_LOAD( "rom19.rom",       0x40000, 0x20000, CRC(223ad90f) SHA1(57b4e364f21aeea24a99deb6bab13019846e8f9b) )
671   ROM_LOAD( "rom20.rom",       0x60000, 0x20000, CRC(ab37a273) SHA1(2051ee99a7ff3f4fc2b91c2c9d4e4da2f12db256) )
672
673   ROM_REGION( 0x40000, "oki", 0 ) /* OKI Samples */
674   ROM_LOAD( "rom10.rom",       0x00000, 0x40000,  CRC(0bf3a3e5) SHA1(2ae06f37a6bcd20bc5fbaa90d970aba2ebf3cf5a) )
675ROM_END
676
575677static DRIVER_INIT( powerbal )
576678{
577679   bg_yoffset = 16;
r3289r3290
584686   yoffset = -5;
585687}
586688
587GAME( 1994, powerbal, 0, powerbal, powerbal, powerbal, ROT0, "Playmark", "Power Balls", 0 )
588GAME( 1995, magicstk, 0, magicstk, magicstk, magicstk, ROT0, "Playmark", "Magic Sticks", 0 )
689/*************************
690*      Game Drivers      *
691*************************/
692
693/*    YEAR  NAME      PARENT   MACHINE   INPUT     INIT      ROT    COMPANY     FULLNAME                      FLAGS */
694GAME( 1994, powerbal, 0,       powerbal, powerbal, powerbal, ROT0, "Playmark", "Power Balls",                 0 )
695GAME( 1995, magicstk, 0,       magicstk, magicstk, magicstk, ROT0, "Playmark", "Magic Sticks",                0 )
696GAME( 1995, hotminda, hotmind, magicstk, hotminda, magicstk, ROT0, "Playmark", "Hot Mind (adjustable prize)", 0 )
src/mame/drivers/firefox.c
r0r3290
1/***************************************************************************
2
3    Atari Fire Fox hardware
4
5    driver by smf, Aaron Giles, Chris Hardy & Scott Waye
6
7short term:
8    split driver/vidhrdw/sndhrdw/machine
9    add option to centre joystick to enter test menu
10
11it uses a quad pokey package 137323-1221-406???
12the laser disc is a philips lvp 22vp931
13( but maybe this works too... Special Drive: Laser Disc Player - Philips VP-832A )
14
15
16AV# 60626
17Atari "Firefox" V
18
19Laser Disc - 30 minutes - Color - 1983
20
21An interactive CAV laserdisc designed for use in the Atari video arcade game machine.
22Contains over 100 visual and sound segments that include all of the branching possibilities of this game.
23Each segment is two to five seconds long. This disc will play on any player,
24but requires a special level III player for proper control. Video: CAV. Audio: Analog.
25
26*/
27
28#include "mame.h"
29#include "deprecat.h"
30#include "driver.h"
31#include "cpu/m6809/m6809.h"
32#include "cpu/m6502/m6502.h"
33#include "sound/pokey.h"
34#include "sound/tms5220.h"
35#include "sound/5220intf.h"
36#include "machine/laserdsc.h"
37#include "machine/6532riot.h"
38#include "machine/x2212.h"
39
40/*
41fff6=firq e4a2 when dav goes active/low
42fff8=irq e38f  This is through a flip-flop so goes off (high as active low) only when reset_irq is active - low.
43fffa=??? e38d
44fffc=??? e38d
45fffe=reset e7cc
46*/
47
48/* 0x50-52 Used as a copy of the status
49   0x59 = 6-length of laser disc return code
50   0x53 = pointer to laser disc return
51   ( LaserDiscBits & 0x80 ) != 0 when return code available
52   DSKREAD = acknowledge
53   ReadDiscData = return code
54*/
55
56/* FXXXXX for first field
57   AXXXXX for second field */
58
59static int m_n_disc_lock;
60static int m_n_disc_left_audio;
61static int m_n_disc_right_audio;
62static int m_n_disc_data;
63static int command_offset;
64static int command_data[ 3 ];
65static int manchester_data[ 6 ];
66static int manchester_offset;
67static int disc_reset;
68static int disk_opr = 0;
69static int dav = 0x80;
70static int dak_just_low = 0;  /* simulate the 15 uS time for the player to read the data */
71static int dak = 0x40; /* DAK or DSKFULL active low indicates player has data,
72                          reset when player has read data */
73static int disk_data; /* after a command is sent the first bit indicates an error, except of the data is 0x00 which indicates an invalid manchester data read (whatever that means) */
74
75int laser_disc_speed = 0;
76int laser_disc_field = 0;
77void laser_seek_frame( int frame )
78{
79}
80
81
82/* 20 = DISKOPR - Active low
83   40 = DISKFULL - Active low
84   80 = DISKDAV - Active low data available
85   */
86READ8_HANDLER( firefox_disc_status_r )
87{
88   int n_data;
89   n_data = dav | dak | disk_opr; /* always operational */
90   logerror( "%08x: disc status r %02x\n", activecpu_get_pc(), n_data & ( 0x80 | 0x40 | 0x20 ) );
91   /*
92    fprintf(stderr,  "%08x: reading disc status r %02x\n", activecpu_get_pc(), n_data & ( 0x80 | 0x40 | 0x20 ) );
93    */
94   if(dak_just_low)
95   {
96      /* assume that the next status read will be after 15uS */
97      dak = 0x40;
98      dak_just_low = 0;
99   }
100   return n_data;
101}
102
103/* 4105 - DREAD */
104/* this reset RDDSK (&DSKRD) */
105READ8_HANDLER( firefox_disc_data_r )
106{
107   return disk_data;
108}
109
110/* DISK READ ENABLE */
111/* 4218 - DSKREAD, set RDDSK */
112WRITE8_HANDLER( firefox_disc_read_w )
113{
114   dav=0x80;
115   if( manchester_offset < 6 )
116   {
117      disk_data = manchester_data[ manchester_offset++ ];
118      if(manchester_offset < 6)
119       {
120         dav = 0; /* more data */
121         cpunum_set_input_line( machine, 0, M6809_FIRQ_LINE, ASSERT_LINE );
122      }
123
124   }
125}
126
127WRITE8_HANDLER( firefox_disc_lock_w )
128{
129   m_n_disc_lock = data & 0x80;
130}
131
132WRITE8_HANDLER( firefox_disc_right_audio_enable_w )
133{
134   m_n_disc_right_audio = data & 0x80;
135}
136
137WRITE8_HANDLER( firefox_disc_left_audio_enable_w )
138{
139   m_n_disc_left_audio = data & 0x80;
140}
141
142WRITE8_HANDLER( firefox_disc_reset_w )
143{
144   disc_reset = (data & 0x80);
145   if(!disc_reset)
146   {
147      laser_disc_speed = 0;
148      manchester_offset = 6; /* no data available */
149      command_offset = 0;
150      dak = 0x40;
151      dav = 0x80;
152   }
153}
154
155/* active low on dbb7 */
156WRITE8_HANDLER( firefox_disc_write_w )
157{
158   if( ( data & 0x80 ) == 0 )
159   {
160      dak = 0; /* should go high after 15 uS */
161      dak_just_low = 1;
162      command_data[ command_offset++ ] = m_n_disc_data;
163      if( command_offset == 3 )
164      {
165         command_offset = 0;
166         switch( command_data[ 0 ] & 0xf0 )
167         {
168         case 0xf0:
169            logerror( "CMD: goto Frame #%01x%02x%02x & play forward\n", command_data[ 0 ] & 0x0f, command_data[ 1 ], command_data[ 2 ] );
170            laser_disc_field =
171               ( ( command_data[ 0 ] & 0x0f ) * 20000 ) +
172               ( (( command_data[ 1 ] & 0xf0 ) >> 4) * 2000 ) +
173               ( ( command_data[ 1 ] & 0x0f ) * 200 ) +
174               ( (( command_data[ 2 ] & 0xf0 ) >> 4) * 20 ) +
175               ( ( command_data[ 2 ] & 0x0f ) * 2 );
176            laser_seek_frame(laser_disc_field >> 1);
177            /*
178                fprintf(stderr, "CMD: goto frame #%01x%02x%02x & play forward disc_field %d\n", command_data[ 0 ] & 0x0f, command_data[ 1 ], command_data[ 2 ] , laser_disc_field);
179                */
180            laser_disc_speed = 1;
181            return;
182         case 0xd0:
183            /*
184                fprintf(stderr,  "CMD: goto Frame #%01x%02x%02x & halt (first field)\n", command_data[ 0 ] & 0x0f, command_data[ 1 ], command_data[ 2 ] );
185                */
186            laser_disc_field =
187               ( ( command_data[ 0 ] & 0x0f ) * 20000 ) +
188               ( (( command_data[ 1 ] & 0xf0 ) >> 4) * 2000 ) +
189               ( ( command_data[ 1 ] & 0x0f ) * 200 ) +
190               ( (( command_data[ 2 ] & 0xf0 ) >> 4) * 20 ) +
191               ( ( command_data[ 2 ] & 0x0f ) * 2 );
192            laser_seek_frame(laser_disc_field >> 1);
193            laser_disc_speed = 0;
194            return;
195         case 0x00:
196            switch( command_data[ 0 ] & 0x0f )
197            {
198            case 0x00:
199               switch( command_data[ 1 ] & 0xf0 )
200               {
201               case 0x00:
202                  laser_disc_speed = 1;
203                  return;
204               case 0x10:
205                  laser_disc_speed = -1;
206                  return;
207               case 0x20:
208                  laser_disc_speed = 0;
209                  return;
210               case 0x40:
211                  return;
212               case 0x50:
213                  return;
214               case 0xa0:
215                  laser_disc_speed = 75;
216                  return;
217               case 0xb0:
218                  laser_disc_speed = -75;
219                  return;
220               case 0xe0:
221                  return;
222               case 0xf0:
223                  return;
224               }
225               break;
226            case 0x02:
227               switch( command_data[ 1 ] )
228               {
229               case 0xb0:
230                  logerror( "CMD: Video ON/OFF %02x\n", command_data[ 2 ] );
231                  return;
232               case 0xb1:
233                  logerror( "CMD: Audio-I ON/OFF %02x\n", command_data[ 2 ] );
234                  return;
235               case 0xb2:
236                  logerror( "CMD: Audio-II ON/OFF %02x\n", command_data[ 2 ] );
237                  return;
238               case 0xb3:
239                  logerror( "CMD: CX ON/OFF %02x\n", command_data[ 2 ] );
240                  return;
241               }
242               break;
243            }
244            break;
245         }
246         logerror( "CMD: invalid %02x%02x%02x\n", command_data[ 0 ], command_data[ 1 ], command_data[ 2 ] );
247      }
248   }
249}
250
251/* latch the data */
252WRITE8_HANDLER( firefox_disc_data_w )
253{
254   m_n_disc_data = data;
255}
256
257static TIMER_DEVICE_CALLBACK( laserdisk_timer_callback )
258{
259   if(param == 0 && laser_disc_speed != 0)
260   {
261      manchester_data[ 0 ] = ( ( laser_disc_field & 0x01 )?0xA0:0xF0 ) | ( ( laser_disc_field / 20000 ) % 10 );
262      manchester_data[ 1 ] = ( ( ( laser_disc_field / 2000 ) % 10 ) << 4 ) | ( ( laser_disc_field / 200 ) % 10 );
263      manchester_data[ 2 ] = ( ( ( laser_disc_field / 20 ) % 10 ) << 4 ) | ( ( laser_disc_field / 2 ) % 10 );
264      manchester_data[ 3 ] = 0xff;
265      manchester_data[ 4 ] = 0xff;
266      manchester_data[ 5 ] = 0xff;
267      manchester_offset = 0;
268      cpunum_set_input_line( Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE );
269      dav = 0;  /* buffer contains info */
270
271      laser_disc_field += laser_disc_speed;
272   }
273}
274
275
276
277static unsigned char *tileram;
278static size_t tileram_size;
279static unsigned char *tile_palette;
280static unsigned char *sprite_palette;
281static const device_config *nvram_1c;
282static const device_config *nvram_1d;
283
284static int control_num;
285static UINT8 sound_to_main_flag;
286static UINT8 main_to_sound_flag;
287static int sprite_bank;
288
289/*************************************
290 *
291 *  Video
292 *
293 *************************************/
294
295static void draw_sprites( bitmap_t *bitmap, int priority, const rectangle *visarea )
296{
297   int sprite;
298
299   for( sprite = 0; sprite < 32; sprite++ )
300   {
301      UINT8 *sprite_data = spriteram + ( 0x200 * sprite_bank ) + ( sprite * 16 );
302      int flags = sprite_data[ 0 ];
303      int y = sprite_data[ 1 ] + ( 256 * ( ( flags >> 0 ) & 1 ) );
304      int x = sprite_data[ 2 ] + ( 256 * ( ( flags >> 1 ) & 1 ) );
305
306      if( x != 0 )
307      {
308         int row;
309
310         for( row = 0; row < 8; row++ )
311         {
312            int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) );
313            int color = 2 * ( ( flags >> 2 ) & 0x03 );
314            int flipx = flags & 0x20;
315            int flipy = flags & 0x10;
316
317            if( ( flags & 1 ) == priority )
318            {
319               drawgfx( bitmap, Machine->gfx[ 1 ], code, color, flipx, flipy, x + 16, 500 - y - ( row * 16 ), visarea, TRANSPARENCY_PEN, 0 );
320            }
321         }
322      }
323   }
324
325}
326
327VIDEO_UPDATE( firefox )
328{
329   int x;
330   int y;
331   const rectangle *visarea = video_screen_get_visible_area( Machine->primary_screen );
332
333   fillbitmap( bitmap, 256, visarea );
334
335   draw_sprites( bitmap, 1, visarea );
336
337   for( y = 0; y < 64; y++ )
338   {
339      for( x = 0; x < 64; x++ )
340      {
341         drawgfx( bitmap, Machine->gfx[ 0 ], tileram[ x + ( y * 64 ) ], 0, 0, 0, x * 8, y * 8, visarea, TRANSPARENCY_PEN, 0 );
342      }
343   }
344
345   draw_sprites( bitmap, 0, visarea );
346
347   return 0;
348}
349
350static TIMER_DEVICE_CALLBACK( video_timer_callback )
351{
352   video_screen_update_now(timer->machine->primary_screen);
353
354   cpunum_set_input_line( Machine, 0, M6809_IRQ_LINE, ASSERT_LINE );
355}
356
357static void set_rgba( int start, int index, unsigned char *palette_ram )
358{
359   int r = palette_ram[ index ];
360   int g = palette_ram[ index + 256 ];
361   int b = palette_ram[ index + 512 ];
362   int a = ( b & 3 ) * 0x55;
363
364   palette_set_color( Machine, start + index, MAKE_RGB( r, g, b ) );
365   render_container_set_palette_alpha(render_container_get_screen(Machine->primary_screen), start + index, a);
366}
367
368static WRITE8_HANDLER( tile_palette_w )
369{
370   tile_palette[ offset ] = data;
371   set_rgba( 0, offset & 0xff, tile_palette );
372}
373
374static WRITE8_HANDLER( sprite_palette_w )
375{
376   sprite_palette[ offset ] = data;
377   set_rgba( 256, offset & 0xff, sprite_palette );
378}
379
380WRITE8_HANDLER( firefox_objram_bank_w )
381{
382   sprite_bank = data & 0x03;
383}
384
385
386
387/*************************************
388 *
389 *  Main <-> sound communication
390 *
391 *************************************/
392
393static CUSTOM_INPUT( mainflag_r )
394{
395   return main_to_sound_flag;
396}
397
398static CUSTOM_INPUT( soundflag_r )
399{
400   return sound_to_main_flag;
401}
402
403static READ8_HANDLER( sound_to_main_r )
404{
405   sound_to_main_flag = 0;
406   return soundlatch2_r(machine, 0);
407}
408
409static WRITE8_HANDLER( main_to_sound_w )
410{
411   main_to_sound_flag = 1;
412   soundlatch_w(Machine, 0, data);
413   cputag_set_input_line(Machine, "audio", INPUT_LINE_NMI, PULSE_LINE);
414}
415
416static WRITE8_HANDLER( sound_reset_w )
417{
418   cputag_set_input_line(machine, "audio", INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
419   if ((data & 0x80) != 0)
420      sound_to_main_flag = main_to_sound_flag = 0;
421}
422
423static READ8_HANDLER( main_to_sound_r )
424{
425   main_to_sound_flag = 0;
426   return soundlatch_r(Machine, 0);
427}
428
429static WRITE8_HANDLER( sound_to_main_w )
430{
431   sound_to_main_flag = 1;
432   soundlatch2_w(Machine, 0, data);
433}
434
435
436
437/*************************************
438 *
439 *  6532 RIOT handlers
440 *
441 *************************************/
442
443static UINT8 riot_porta_r(const device_config *device, UINT8 olddata)
444{
445   /* bit 7 = MAINFLAG */
446   /* bit 6 = SOUNDFLAG */
447   /* bit 5 = PA5 */
448   /* bit 4 = TEST */
449   /* bit 3 = n/c */
450   /* bit 2 = TMS /ready */
451   /* bit 1 = TMS /read */
452   /* bit 0 = TMS /write */
453
454   return (main_to_sound_flag << 7) | (sound_to_main_flag << 6) | 0x10 | (!tms5220_ready_r() << 2);
455}
456
457
458static void riot_porta_w(const device_config *device, UINT8 newdata, UINT8 olddata)
459{
460   /* handle 5220 read */
461   if ((olddata & 2) != 0 && (newdata & 2) == 0)
462      riot6532_portb_in_set(device, tms5220_status_r(device->machine, 0), 0xff);
463
464   /* handle 5220 write */
465   if ((olddata & 1) != 0 && (newdata & 1) == 0)
466      tms5220_data_w(device->machine, 0, riot6532_portb_out_get(device));
467}
468
469
470static void riot_irq(const device_config *device, int state)
471{
472   cputag_set_input_line(device->machine, "audio", M6502_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
473}
474
475
476
477/*************************************
478 *
479 *  ADC input and control
480 *
481 *************************************/
482
483static READ8_HANDLER( adc_r )
484{
485   if( control_num == 0 )
486   {
487      return input_port_read( Machine, "PITCH" );
488   }
489
490   return input_port_read( Machine, "YAW" );
491}
492
493static WRITE8_HANDLER( adc_select_w )
494{
495   control_num = offset;
496}
497
498
499
500/*************************************
501 *
502 *  Non-Volatile RAM (NOVRAM)
503 *
504 *************************************/
505
506static WRITE8_HANDLER( nvram_w )
507{
508   x2212_write( nvram_1c, offset, data >> 4 );
509   x2212_write( nvram_1d, offset, data & 0xf );
510}
511
512static READ8_HANDLER( nvram_r )
513{
514   return ( x2212_read( nvram_1c, offset ) << 4 ) | x2212_read( nvram_1d, offset );
515}
516
517static WRITE8_HANDLER( novram_recall_w )
518{
519   x2212_array_recall( nvram_1c, ( data >> 7 ) & 1 );
520   x2212_array_recall( nvram_1d, ( data >> 7 ) & 1 );
521}
522
523static WRITE8_HANDLER( novram_store_w )
524{
525   x2212_store( nvram_1c, ( data >> 7 ) & 1 );
526   x2212_store( nvram_1d, ( data >> 7 ) & 1 );
527}
528
529
530
531/*************************************
532 *
533 *  Main cpu
534 *
535 *************************************/
536
537WRITE8_HANDLER( rom_bank_w )
538{
539   memory_set_bank(1, data & 0x1f);
540}
541
542static WRITE8_HANDLER( main_irq_clear_w )
543{
544    cpunum_set_input_line( machine, 0, M6809_IRQ_LINE, CLEAR_LINE );
545}
546
547static WRITE8_HANDLER( main_firq_clear_w )
548{
549    cpunum_set_input_line( machine, 0, M6809_FIRQ_LINE, CLEAR_LINE );
550}
551
552WRITE8_HANDLER( self_reset_w )
553{
554   cpunum_set_input_line( Machine, 0, INPUT_LINE_RESET, PULSE_LINE );
555}
556
557
558
559/*************************************
560 *
561 *  I/O
562 *
563 *************************************/
564
565WRITE8_HANDLER( led_w )
566{
567   if( ( data & 0x80 ) != 0 )
568   {
569       set_led_status( offset, 0 );
570   }
571   else
572   {
573       set_led_status( offset, 1 );
574   }
575}
576
577WRITE8_HANDLER( firefox_coin_counter_w )
578{
579   coin_counter_w( offset, data & 0x80 );
580}
581
582
583
584MACHINE_START( firefox )
585{
586   memory_configure_bank(1, 0, 32, memory_region(machine, "main") + 0x10000, 0x1000);
587   nvram_1c = device_list_find_by_tag(machine->config->devicelist, X2212, "nvram_1c");
588   nvram_1d = device_list_find_by_tag(machine->config->devicelist, X2212, "nvram_1d");
589
590   control_num = 0;
591   sprite_bank = 0;
592
593   command_data[ 0 ] = 0;
594   command_data[ 1 ] = 0;
595   command_data[ 2 ] = 0;
596   command_offset = 0;
597
598   laser_disc_field = 0;
599   laser_disc_speed = 0;
600   manchester_offset = 6;
601}
602
603
604/*************************************
605 *
606 *  Main CPU memory handlers
607 *
608 *************************************/
609
610static ADDRESS_MAP_START( main_map , ADDRESS_SPACE_PROGRAM, 8)
611   AM_RANGE(0x0000, 0x0fff) AM_RAM
612   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_BASE(&tileram) AM_SIZE(&tileram_size)
613   AM_RANGE(0x2000, 0x27ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
614   AM_RANGE(0x2800, 0x2aff) AM_READWRITE(SMH_RAM, sprite_palette_w) AM_BASE(&sprite_palette)
615   AM_RANGE(0x2b00, 0x2b00) AM_WRITE(firefox_objram_bank_w)
616   AM_RANGE(0x2b01, 0x2bff) AM_RAM
617   AM_RANGE(0x2c00, 0x2eff) AM_READWRITE(SMH_RAM, tile_palette_w) AM_BASE(&tile_palette)
618   AM_RANGE(0x2f00, 0x2fff) AM_RAM
619   AM_RANGE(0x3000, 0x3fff) AM_ROMBANK(1)
620   AM_RANGE(0x4000, 0x40ff) AM_READWRITE(nvram_r, nvram_w)
621   AM_RANGE(0x4100, 0x4100) AM_READ_PORT("IN0")
622   AM_RANGE(0x4101, 0x4101) AM_READ_PORT("IN1")
623   AM_RANGE(0x4102, 0x4102) AM_READ(firefox_disc_status_r)
624   AM_RANGE(0x4103, 0x4103) AM_READ_PORT("IN3")
625   AM_RANGE(0x4104, 0x4104) AM_READ_PORT("IN4")
626   AM_RANGE(0x4105, 0x4105) AM_READ(firefox_disc_data_r)
627   AM_RANGE(0x4106, 0x4106) AM_READ(sound_to_main_r)
628   AM_RANGE(0x4107, 0x4107) AM_READ(adc_r)
629   AM_RANGE(0x4200, 0x4200) AM_WRITE(main_irq_clear_w)
630   AM_RANGE(0x4208, 0x4208) AM_WRITE(main_firq_clear_w)
631   AM_RANGE(0x4210, 0x4210) AM_WRITE(watchdog_reset_w)
632   AM_RANGE(0x4218, 0x4218) AM_WRITE(firefox_disc_read_w)
633   AM_RANGE(0x4220, 0x4221) AM_WRITE(adc_select_w)
634   AM_RANGE(0x4230, 0x4230) AM_WRITE(self_reset_w)
635   AM_RANGE(0x4280, 0x4280) AM_WRITE(novram_recall_w)
636   AM_RANGE(0x4281, 0x4281) AM_WRITE(sound_reset_w)
637   AM_RANGE(0x4282, 0x4282) AM_WRITE(novram_store_w)
638   AM_RANGE(0x4283, 0x4283) AM_WRITE(firefox_disc_lock_w)
639   AM_RANGE(0x4284, 0x4284) AM_WRITE(firefox_disc_right_audio_enable_w)
640   AM_RANGE(0x4285, 0x4285) AM_WRITE(firefox_disc_left_audio_enable_w)
641   AM_RANGE(0x4286, 0x4286) AM_WRITE(firefox_disc_reset_w)
642   AM_RANGE(0x4287, 0x4287) AM_WRITE(firefox_disc_write_w)
643   AM_RANGE(0x4288, 0x4289) AM_WRITE(firefox_coin_counter_w)
644   AM_RANGE(0x428c, 0x428f) AM_WRITE(led_w)
645   AM_RANGE(0x4290, 0x4290) AM_WRITE(rom_bank_w)
646   AM_RANGE(0x4298, 0x4298) AM_WRITE(main_to_sound_w)
647   AM_RANGE(0x42a0, 0x42a7) AM_WRITE(firefox_disc_data_w)
648   AM_RANGE(0x4400, 0xffff) AM_ROM
649ADDRESS_MAP_END
650
651
652
653/*************************************
654 *
655 *  Sound CPU memory handlers
656 *
657 *************************************/
658
659static ADDRESS_MAP_START(audio_map, ADDRESS_SPACE_PROGRAM, 8)
660   AM_RANGE(0x0000, 0x07ff) AM_RAM
661   AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0700) AM_RAM /* RIOT ram */
662   AM_RANGE(0x0880, 0x089f) AM_MIRROR(0x07e0) AM_DEVREADWRITE(RIOT6532,"riot",riot6532_r, riot6532_w)
663   AM_RANGE(0x1000, 0x1000) AM_READ(main_to_sound_r)
664   AM_RANGE(0x1800, 0x1800) AM_WRITE(sound_to_main_w)
665   AM_RANGE(0x2000, 0x200f) AM_READWRITE(pokey1_r, pokey1_w)
666   AM_RANGE(0x2800, 0x280f) AM_READWRITE(pokey2_r, pokey2_w)
667   AM_RANGE(0x3000, 0x300f) AM_READWRITE(pokey3_r, pokey3_w)
668   AM_RANGE(0x3800, 0x380f) AM_READWRITE(pokey4_r, pokey4_w)
669   AM_RANGE(0x8000, 0xffff) AM_ROM
670ADDRESS_MAP_END
671
672
673
674/*************************************
675 *
676 *  Port definitions
677 *
678 *************************************/
679
680INPUT_PORTS_START( firefox )
681   PORT_START("IN0")
682   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
683   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
684   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
685   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 )
686   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
687   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
688   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
689   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
690
691   PORT_START("IN1")
692   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mainflag_r, NULL)
693   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(soundflag_r, NULL)
694   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
695   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
696   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
697   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
698   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
699   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
700
701   PORT_START("IN3")
702   PORT_DIPNAME(    0x03, 0x00, "Coins Per Credit" )
703   PORT_DIPSETTING( 0x00, "1 Coin 1 Credit" )
704   PORT_DIPSETTING( 0x01, "2 Coins 1 Credit" )
705   PORT_DIPSETTING( 0x02, "3 Coins 1 Credit" )
706   PORT_DIPSETTING( 0x03, "4 Coins 1 Credit" )
707   PORT_DIPNAME(    0x0c, 0x00, "Right Coin" )
708   PORT_DIPSETTING( 0x00, "1 Coin for 1 Coin Unit" )
709   PORT_DIPSETTING( 0x04, "1 Coin for 4 Coin Units" )
710   PORT_DIPSETTING( 0x08, "1 Coin for 5 Coin Units" )
711   PORT_DIPSETTING( 0x0c, "1 Coin for 6 Coin Units" )
712   PORT_DIPNAME(    0x10, 0x00, "Left Coin" )
713   PORT_DIPSETTING( 0x00, "1 Coin for 1 Coin Unit" )
714   PORT_DIPSETTING( 0x10, "1 Coin for 2 Coin Units" )
715   PORT_DIPNAME(    0xe0, 0x00, "Bonus Adder" )
716   PORT_DIPSETTING( 0x00, DEF_STR( None ) )
717   PORT_DIPSETTING( 0x20, "1 Credit for 2 Coin Units" )
718   PORT_DIPSETTING( 0xa0, "1 Credit for 3 Coin Units" )
719   PORT_DIPSETTING( 0x40, "1 Credit for 4 Coin Units" )
720   PORT_DIPSETTING( 0x80, "1 Credit for 5 Coin Units" )
721   PORT_DIPSETTING( 0x60, "2 Credits for 4 Coin Units" )
722   PORT_DIPSETTING( 0xe0, DEF_STR( Free_Play ) )
723
724   PORT_START("IN4")
725   PORT_DIPNAME( 0x01, 0x00, "Missions" )
726   PORT_DIPSETTING(    0x00, "All .50" )
727   PORT_DIPSETTING(    0x01, ".50 .75" )
728   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Difficulty ) )
729   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
730   PORT_DIPSETTING(    0x02, "Moderate" )
731   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
732   PORT_DIPSETTING(    0x06, DEF_STR( Hardest ) )
733   PORT_DIPNAME( 0x18, 0x00, "Gas Usage" )
734   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
735   PORT_DIPSETTING(    0x08, "Moderate" )
736   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
737   PORT_DIPSETTING(    0x18, DEF_STR( Hardest ) )
738   PORT_DIPNAME( 0x60, 0x00, "Bonus Gas" )
739   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
740   PORT_DIPSETTING(    0x20, "Moderate" )
741   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
742   PORT_DIPSETTING(    0x60, DEF_STR( Hardest ) )
743   PORT_DIPNAME( 0x80, 0x00, "Pro Limit" )
744   PORT_DIPSETTING(    0x00, "Moderate" )
745   PORT_DIPSETTING(    0x80, DEF_STR( Hardest ) )
746
747   PORT_START("PITCH")
748   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(70) PORT_KEYDELTA(30)
749
750   PORT_START("YAW")
751   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(30)
752INPUT_PORTS_END
753
754
755
756/*************************************
757 *
758 *  Graphics definitions
759 *
760 *************************************/
761
762static const gfx_layout tilelayout =
763{
764   8,8,
765   RGN_FRAC(1,1),
766   4,
767   { STEP4(0,1) },
768   { STEP8(0,4) },
769   { STEP8(0,32) },
770   32*8
771};
772
773static const gfx_layout spritelayout =
774{
775   16,16,
776   RGN_FRAC(1,5),
777   5,
778   { RGN_FRAC(0,5), RGN_FRAC(1,5), RGN_FRAC(2,5), RGN_FRAC(3,5), RGN_FRAC(4,5) },
779   { STEP16(0,1) },
780   { STEP16(0,16) },
781   32*8
782};
783
784static GFXDECODE_START( firefox )
785   GFXDECODE_ENTRY("tiles",   0, tilelayout, 0, 16)
786   GFXDECODE_ENTRY("sprites", 0, spritelayout, 256, 32)
787GFXDECODE_END
788
789
790
791/*************************************
792 *
793 *  Machine driver
794 *
795 *************************************/
796
797static const riot6532_interface riot_intf =
798{
799   riot_porta_r,
800   NULL,
801   riot_porta_w,
802   NULL,
803   riot_irq
804};
805
806
807static MACHINE_DRIVER_START( firefox )
808
809   /* basic machine hardware */
810   MDRV_CPU_ADD("main", M6809, 4000000)
811   MDRV_CPU_PROGRAM_MAP(main_map, 0)
812   MDRV_TIMER_ADD_SCANLINE("32v", video_timer_callback, "main", 96, 128)
813
814   MDRV_CPU_ADD("audio", M6502, 2000000)
815   MDRV_CPU_PROGRAM_MAP(audio_map, 0)
816
817   MDRV_MACHINE_START(firefox)
818
819   /* video hardware */
820   MDRV_LASERDISC_SCREEN_ADD_NTSC("main", BITMAP_FORMAT_INDEXED16)
821
822   MDRV_GFXDECODE(firefox)
823   MDRV_PALETTE_LENGTH(512)
824
825   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "main", "ldsound")
826   MDRV_LASERDISC_OVERLAY(firefox, 64*8, 64*8, BITMAP_FORMAT_INDEXED16)
827   MDRV_LASERDISC_OVERLAY_CLIP(7*8, 53*8-1, 1*8, 62*8-1)
828   MDRV_TIMER_ADD_SCANLINE("laserdisk", laserdisk_timer_callback, "main", 0, 0)
829
830   MDRV_DEVICE_ADD("nvram_1c",X2212)
831   MDRV_DEVICE_ADD("nvram_1d",X2212)
832   MDRV_RIOT6532_ADD("riot", 1500000, riot_intf)
833
834   /* sound hardware */
835   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
836
837   MDRV_SOUND_ADD("pokey1", POKEY, 1500000)
838   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20)
839   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20)
840
841   MDRV_SOUND_ADD("pokey2", POKEY, 1500000)
842   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20)
843   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20)
844
845   MDRV_SOUND_ADD("pokey3", POKEY, 1500000)
846   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20)
847   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20)
848
849   MDRV_SOUND_ADD("pokey4", POKEY, 1500000)
850   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.20)
851   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.20)
852
853   MDRV_SOUND_ADD("tms", TMS5220, 640000)
854   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
855   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
856
857   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
858   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
859   MDRV_SOUND_ROUTE(0, "left", 1.0)
860   MDRV_SOUND_ROUTE(1, "right", 1.0)
861
862MACHINE_DRIVER_END
863
864
865
866/*************************************
867 *
868 *  ROM definitions
869 *
870 *************************************/
871
872ROM_START( firefox )
873   ROM_REGION( 0x30000, "main", 0 ) /* 64k for code + data & 128k for banked roms */
874   ROM_LOAD( "136026.209",     0x04000, 0x4000, CRC(9f559f1b) SHA1(142d14cb5158ea77f6fc6d9bf0ce723842f345e2) ) /* 8b/c */
875   ROM_LOAD( "136026.210",     0x08000, 0x4000, CRC(d769b40d) SHA1(2d354649a381f3399cb0161267bd1c36a8f2bb4b) ) /* 7b/c */
876   ROM_LOAD( "136026.211",     0x0c000, 0x4000, CRC(7293ab03) SHA1(73d0d173da295ad59e431bab0a9814a71146cbc2) ) /* 6b/c */
877   ROM_LOAD( "136026.201",     0x10000, 0x4000, CRC(c118547a) SHA1(4d3502cbde3116588ed944bf1750bab50e4c813c) ) /* 8a */
878   /* empty 7a */
879   /* empty 6a */
880   /* empty 5a */
881   ROM_LOAD( "136026.205",     0x20000, 0x4000, CRC(dc21677f) SHA1(576a96c1e07e1362a0a367e76dc369ee8a950144) ) /* 4a */
882   ROM_LOAD( "136026.127",     0x24000, 0x2000, CRC(c0c765ab) SHA1(79f6c8c1d00684d7143b2d33a5669bdf5cd01e96) ) /* 3a */
883   ROM_RELOAD( 0x26000, 0x2000 )
884   /* empty 2a */
885   /* empty 1a */
886
887   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for code */
888   /* empty 4k/l */
889   ROM_LOAD( "136026.128",     0x08000, 0x2000, CRC(5358d870) SHA1(e8f2983a7e612e1a050a3c0b9f19b1077de4c146) ) /* 4m */
890   ROM_RELOAD( 0x0a000, 0x2000 )
891   ROM_LOAD( "136026.214",     0x0c000, 0x4000, CRC(92378b78) SHA1(62c7a1fee675fa3f9125f8e208b8207f0ce28bbe) ) /* 4n */
892
893   ROM_REGION( 0x2000, "tiles", ROMREGION_DISPOSE )
894   ROM_LOAD( "136026.125",     0x0000,  0x2000, CRC(8a32f9f1) SHA1(f899174f55cd4a24a3be4a0f4bb44d3e8e938586) ) /* 6p */
895
896   ROM_REGION( 0x28000, "sprites", ROMREGION_DISPOSE )
897   /* empty 6c */
898   /* empty 6a */
899   ROM_LOAD( "136026.124",     0x00000,  0x4000, CRC(5efe0f6c) SHA1(df35fd9267d966ab379c2f78ed418f4606741b28)) /* 5c */
900   ROM_LOAD( "136026.123",     0x04000,  0x4000, CRC(dffe48b3) SHA1(559907651bb425e26a834b467959b15092d23d27)) /* 5a */
901   ROM_LOAD( "136026.118",     0x08000,  0x4000, CRC(0ed4df15) SHA1(7aa599f428112fff4bfedf63fafc22f19fa66546)) /* 4c */
902   ROM_LOAD( "136026.122",     0x0c000,  0x4000, CRC(8e2c6616) SHA1(59cbd585028bb634034a9dfd552275bd41f01989)) /* 4a */
903   ROM_LOAD( "136026.117",     0x10000,  0x4000, CRC(79129084) SHA1(4219ff7cd444ad11e4cb9f1c30ac15fe0cfc5a17)) /* 3c */
904   ROM_LOAD( "136026.121",     0x14000,  0x4000, CRC(494972d4) SHA1(fa0e24e911b233e9644d7794ba03f76bfd39aa8c)) /* 3a */
905   ROM_LOAD( "136026.116",     0x18000,  0x4000, CRC(d5282d4e) SHA1(de5fdf82a615625aa77b39e035b4206216faaf9c)) /* 2c */
906   ROM_LOAD( "136026.120",     0x1c000,  0x4000, CRC(e1b95923) SHA1(b6d0c0af0a8f55e728cd0f4c3222745eefd57f50)) /* 2a */
907   ROM_LOAD( "136026.115",     0x20000,  0x4000, CRC(861abc82) SHA1(1845888d07162ae915364a2a91294731f1c5b3bd)) /* 1c */
908   ROM_LOAD( "136026.119",     0x24000,  0x4000, CRC(959471b1) SHA1(a032209a209f51d34360d5c7ad32ec62150158d2)) /* 1a */
909ROM_END
910
911ROM_START( firefoxa )
912   ROM_REGION( 0x30000, "main", 0 ) /* 64k for code + data & 128k for banked roms */
913   ROM_LOAD( "136026.109",     0x04000, 0x4000, CRC(7639270c) SHA1(1b8f53c516d26aecb4478ac99783a37e5b1a107f)) /* 8b/c */
914   ROM_LOAD( "136026.110",     0x08000, 0x4000, CRC(f3102944) SHA1(460f18180b19b6360c99c7e70f86d745f69ba95d)) /* 7b/c */
915   ROM_LOAD( "136026.111",     0x0c000, 0x4000, CRC(8a230bb5) SHA1(0cfa1e981e4a8ccaf5903b4e761a2085b5a56181)) /* 6b/c */
916   ROM_LOAD( "136026.101",     0x10000, 0x4000, CRC(91bba45a) SHA1(d584a8f60bbbdbe250978b7aeb3f5e7698f94d60)) /* 8a */
917   ROM_LOAD( "136026.102",     0x14000, 0x4000, CRC(5f1e423d) SHA1(c55c27600877272c1ca94eab75c1eb25ff84d36f)) /* 7a */
918   /* empty 6a */
919   /* empty 5a */
920   ROM_LOAD( "136026.105",     0x20000, 0x4000, CRC(83f1d4ed) SHA1(ed4b22b3473f16cbcca1415f6d81be558ab10ff3)) /* 4a */
921   ROM_LOAD( "136026.106",     0x24000, 0x4000, CRC(c5d8d417) SHA1(6a29595b2c091bbcf413c7213c6577eaf9c507d1)) /* 3a */
922   /* empty 2a */
923   /* empty 1a */
924
925   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for code */
926   /* empty 4k/l */
927   ROM_LOAD( "136026.113",     0x08000, 0x4000, CRC(90988b3b) SHA1(7571cf6b7e9e3e22f930d9ba991b730e734edfb7)) /* 4m */
928   ROM_LOAD( "136026.114",     0x0c000, 0x4000, CRC(1437ce14) SHA1(eef14172b3935a4afb3470852f93d30926b139e4)) /* 4n */
929
930   ROM_REGION( 0x2000, "tiles", ROMREGION_DISPOSE )
931   ROM_LOAD( "136026.125",     0x0000,  0x2000, CRC(8a32f9f1) SHA1(f899174f55cd4a24a3be4a0f4bb44d3e8e938586) ) /* 6p */
932
933   ROM_REGION( 0x28000, "sprites", ROMREGION_DISPOSE )
934   /* empty 6c */
935   /* empty 6a */
936   ROM_LOAD( "136026.124",     0x00000,  0x4000, CRC(5efe0f6c) SHA1(df35fd9267d966ab379c2f78ed418f4606741b28)) /* 5c */
937   ROM_LOAD( "136026.123",     0x04000,  0x4000, CRC(dffe48b3) SHA1(559907651bb425e26a834b467959b15092d23d27)) /* 5a */
938   ROM_LOAD( "136026.118",     0x08000,  0x4000, CRC(0ed4df15) SHA1(7aa599f428112fff4bfedf63fafc22f19fa66546)) /* 4c */
939   ROM_LOAD( "136026.122",     0x0c000,  0x4000, CRC(8e2c6616) SHA1(59cbd585028bb634034a9dfd552275bd41f01989)) /* 4a */
940   ROM_LOAD( "136026.117",     0x10000,  0x4000, CRC(79129084) SHA1(4219ff7cd444ad11e4cb9f1c30ac15fe0cfc5a17)) /* 3c */
941   ROM_LOAD( "136026.121",     0x14000,  0x4000, CRC(494972d4) SHA1(fa0e24e911b233e9644d7794ba03f76bfd39aa8c)) /* 3a */
942   ROM_LOAD( "136026.116",     0x18000,  0x4000, CRC(d5282d4e) SHA1(de5fdf82a615625aa77b39e035b4206216faaf9c)) /* 2c */
943   ROM_LOAD( "136026.120",     0x1c000,  0x4000, CRC(e1b95923) SHA1(b6d0c0af0a8f55e728cd0f4c3222745eefd57f50)) /* 2a */
944   ROM_LOAD( "136026.115",     0x20000,  0x4000, CRC(861abc82) SHA1(1845888d07162ae915364a2a91294731f1c5b3bd)) /* 1c */
945   ROM_LOAD( "136026.119",     0x24000,  0x4000, CRC(959471b1) SHA1(a032209a209f51d34360d5c7ad32ec62150158d2)) /* 1a */
946ROM_END
947
948
949
950/*************************************
951 *
952 *  Game drivers
953 *
954 *************************************/
955
956GAME( 1984, firefox,  0,       firefox, firefox, 0, ROT0, "Atari", "Fire Fox (set 1)", 0 )
957GAME( 1984, firefoxa, firefox, firefox, firefox, 0, ROT0, "Atari", "Fire Fox (set 2)", 0 )
src/mame/drivers/40love.c
r3289r3290
672672   AM_RANGE(0x880b, 0x880b) AM_READ_PORT("P2")
673673   AM_RANGE(0x880c, 0x880c) AM_READ_PORT("DSW1") AM_WRITE(fortyl_pixram_sel_w) /* pixram bank select */
674674   AM_RANGE(0x880d, 0x880d) AM_READ_PORT("DSW2") AM_WRITENOP /* unknown */
675   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1)
676675   AM_RANGE(0x9000, 0x97ff) AM_READWRITE(fortyl_bg_videoram_r, fortyl_bg_videoram_w) AM_BASE(&videoram)      /* #1 M5517P on video board */
677676   AM_RANGE(0x9800, 0x983f) AM_RAM AM_BASE(&fortyl_video_ctrl)         /* video control area */
678677   AM_RANGE(0x9840, 0x987f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* sprites part 1 */
679678   AM_RANGE(0x9880, 0x98bf) AM_READWRITE(fortyl_bg_colorram_r, fortyl_bg_colorram_w) AM_BASE(&colorram)      /* background attributes (2 bytes per line) */
680679   AM_RANGE(0x98c0, 0x98ff) AM_RAM AM_BASE(&spriteram_2) AM_SIZE(&spriteram_2_size)/* sprites part 2 */
680   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1)
681681   AM_RANGE(0xc000, 0xffff) AM_READWRITE(fortyl_pixram_r, fortyl_pixram_w) /* banked pixel layer */
682682ADDRESS_MAP_END
683683
r3289r3290
692692   AM_RANGE(0xa804, 0xa804) AM_READWRITE(from_snd_r, sound_command_w)
693693   AM_RANGE(0xa805, 0xa805) AM_READ(snd_flag_r) AM_WRITENOP /*sound_reset*/   //????
694694   AM_RANGE(0xa807, 0xa807) AM_READNOP AM_WRITENOP /* unknown */
695   AM_RANGE(0x8808, 0x8808) AM_READ_PORT("DSW3")
696   AM_RANGE(0x8809, 0x8809) AM_READ_PORT("P1")
697   AM_RANGE(0x880a, 0x880a) AM_READ_PORT("SYSTEM")
698   AM_RANGE(0x880b, 0x880b) AM_READ_PORT("P2")
699   AM_RANGE(0x880c, 0x880c) AM_READ_PORT("DSW1") AM_WRITE(fortyl_pixram_sel_w) /* pixram bank select */
700   AM_RANGE(0x880d, 0x880d) AM_READ_PORT("DSW2") AM_WRITENOP /* unknown */
695   AM_RANGE(0xa808, 0xa808) AM_READ_PORT("DSW3")
696   AM_RANGE(0xa809, 0xa809) AM_READ_PORT("P1")
697   AM_RANGE(0xa80a, 0xa80a) AM_READ_PORT("SYSTEM")
698   AM_RANGE(0xa80b, 0xa80b) AM_READ_PORT("P2")
699   AM_RANGE(0xa80c, 0xa80c) AM_READ_PORT("DSW1") AM_WRITE(fortyl_pixram_sel_w) /* pixram bank select */
700   AM_RANGE(0xa80d, 0xa80d) AM_READ_PORT("DSW2") AM_WRITENOP /* unknown */
701701   AM_RANGE(0xb000, 0xb7ff) AM_READWRITE(fortyl_bg_videoram_r, fortyl_bg_videoram_w) AM_BASE(&videoram)      /* #1 M5517P on video board */
702702   AM_RANGE(0xb800, 0xb83f) AM_RAM AM_BASE(&fortyl_video_ctrl)         /* video control area */
703703   AM_RANGE(0xb840, 0xb87f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* sprites part 1 */
src/mame/drivers/sg1000a.c
r3289r3290
114114#include "driver.h"
115115#include "sound/sn76496.h"
116116#include "video/tms9928a.h"
117#include "machine/8255ppi.h"
117118#include "machine/segacrpt.h"
118119
119120/*************************************
r3289r3290
122123 *
123124 *************************************/
124125
125static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
126   AM_RANGE(0x0000, 0x7FFF) AM_READ(SMH_ROM)
127   AM_RANGE(0x8000, 0xbFFF) AM_READ(SMH_ROM)
128   AM_RANGE(0xc000, 0xc3ff) AM_READ(SMH_RAM)
126static ADDRESS_MAP_START( program_map, ADDRESS_SPACE_PROGRAM, 8 )
127   AM_RANGE(0x0000, 0x7fff) AM_ROM // separate region needed for decrypting
128   AM_RANGE(0x8000, 0xbfff) AM_ROM
129   AM_RANGE(0xc000, 0xc3ff) AM_RAM
129130ADDRESS_MAP_END
130131
131static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
132   AM_RANGE(0x0000, 0x7FFF) AM_WRITE(SMH_ROM)
133   AM_RANGE(0x8000, 0xbFFF) AM_WRITE(SMH_ROM)
134   AM_RANGE(0xc000, 0xc3ff) AM_WRITE(SMH_RAM)
135ADDRESS_MAP_END
136
137132static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
138133   ADDRESS_MAP_GLOBAL_MASK(0xff)
139   AM_RANGE(0x7f, 0x7F) AM_WRITE(sn76496_0_w)
140   AM_RANGE(0xBE, 0xBE) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
141   AM_RANGE(0xBF, 0xBF) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
142   AM_RANGE(0xDC, 0xDC) AM_READ_PORT("P1")
143   AM_RANGE(0xDD, 0xDD) AM_READ_PORT("P2")
144   AM_RANGE(0xDE, 0xDE) AM_READ_PORT("DSW")
145   AM_RANGE(0xDF, 0xDF) AM_WRITE(SMH_NOP)  //? 8255 ?
134   AM_RANGE(0x7f, 0x7f) AM_WRITE(sn76496_0_w)
135   AM_RANGE(0xbe, 0xbe) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
136   AM_RANGE(0xbf, 0xbf) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
137   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
146138ADDRESS_MAP_END
147139
148140/*************************************
r3289r3290
213205   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
214206INPUT_PORTS_END
215207
216
217208static INPUT_PORTS_START( chboxing )
218209   PORT_INCLUDE( sg1000 )
219210
r3289r3290
223214   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
224215INPUT_PORTS_END
225216
226
227217static INPUT_PORTS_START( dokidoki )
228218   PORT_INCLUDE( sg1000 )
229219
r3289r3290
233223   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
234224INPUT_PORTS_END
235225
236
237static INTERRUPT_GEN( sg100a_interrupt )
226static INTERRUPT_GEN( sg1000a_interrupt )
238227{
239228   TMS9928A_interrupt(machine);
240229}
241230
242static void vdp_interrupt (running_machine *machine, int state)
231static void vdp_interrupt(running_machine *machine, int state)
243232{
244   cpunum_set_input_line(machine, 0,0, HOLD_LINE);
233   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, state);
245234}
246235
247236static const TMS9928a_interface tms9928a_interface =
r3289r3290
252241   vdp_interrupt
253242};
254243
244static WRITE8_HANDLER( sg1000a_coin_counter_w )
245{
246   coin_counter_w(0, data & 0x01);
247}
248
249static const ppi8255_interface ppi8255_intf =
250{
251   input_port_0_r,
252   input_port_1_r,
253   input_port_2_r,
254   NULL,
255   NULL,
256   sg1000a_coin_counter_w
257};
258
255259/*************************************
256260 *
257261 *  Machine drivers
r3289r3290
259263 *************************************/
260264
261265static MACHINE_DRIVER_START( sg1000a )
262   MDRV_CPU_ADD("main", Z80, 3579545)       /* 3.579545 Mhz */
263   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
264   MDRV_CPU_IO_MAP(io_map,0)
265   MDRV_CPU_VBLANK_INT("main", sg100a_interrupt)
266   /* basic machine hardware */
267   MDRV_CPU_ADD("main", Z80, XTAL_3_579545MHz)
268   MDRV_CPU_PROGRAM_MAP(program_map, 0)
269   MDRV_CPU_IO_MAP(io_map, 0)
270   MDRV_CPU_VBLANK_INT("main", sg1000a_interrupt)
266271
272   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
273   MDRV_DEVICE_CONFIG( ppi8255_intf )
274
267275   /* video hardware */
268276   MDRV_IMPORT_FROM(tms9928a)
269277   MDRV_SCREEN_MODIFY("main")
270   MDRV_SCREEN_REFRESH_RATE(60)
278   MDRV_SCREEN_REFRESH_RATE((float)XTAL_10_738635MHz/2/342/262)
271279   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
272280   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
273281
282   /* sound hardware */
274283   MDRV_SPEAKER_STANDARD_MONO("mono")
275284
276   MDRV_SOUND_ADD("sn", SN76489, 3579545)
285   MDRV_SOUND_ADD("sn", SN76489, XTAL_3_579545MHz)
277286   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
278287MACHINE_DRIVER_END
279288
r3289r3290
327336 *
328337 *************************************/
329338
330GAME( 1984, chboxing, 0, sg1000a, chboxing, sg1000a,  ROT0, "Sega", "Champion Boxing", 0)
331GAME( 1985, chwrestl, 0, sg1000a, chwrestl, chwrestl, ROT0, "Sega", "Champion Pro Wrestling", 0)
332GAME( 1985, dokidoki, 0, sg1000a, dokidoki, sg1000a,  ROT0, "Sega", "Doki Doki Penguin Land", 0)
333
334
335
339GAME( 1984, chboxing, 0, sg1000a, chboxing, sg1000a,  ROT0, "Sega", "Champion Boxing", 0 )
340GAME( 1985, chwrestl, 0, sg1000a, chwrestl, chwrestl, ROT0, "Sega", "Champion Pro Wrestling", 0 )
341GAME( 1985, dokidoki, 0, sg1000a, dokidoki, sg1000a,  ROT0, "Sega", "Doki Doki Penguin Land", 0 )
src/mame/drivers/psychic5.c
r3289r3290
8686
87873) MAIN CPU MEMORY MAP.
8888
890000-7fff       ROM
908000-bfff       paged ROM
91c000-dfff       paged RAM (RAM/VRAM/IO)
890000-7fff   ROM
908000-bfff   paged ROM
91c000-dfff   paged RAM (RAM/VRAM/IO)
9292f000-f1ff   I/O
9393f200-f7ff   Sprites registers (misc RAM)
94f800-ffff       Work RAM
94f800-ffff   Work RAM
9595
9696-paged RAM memory map
9797
9898Bank 0
9999
100100c000-cfff   Background tile buffer
101e000-dfff   RAM (dummy background image for software collisions)
101d000-dfff   RAM (dummy background image for software collisions)
102102
103103Bank 1
104104
105105c000-c3ff   I/O
106c400-cbff   Palette RAM
107d000-d800   Foreground tile buffer
106c400-cfff   Palette RAM
107d000-dfff   Foreground tile buffer
108108
109109
1101104) I/O
r3289r3290
153153
154154c309    BACKGROUND SCROLL Y  most significant 2 bits
155155
156    76543210
157          ||
158          |^-- Y scroll bit 8
159          ^--- Y scroll bit 9
156        76543210
157              ||
158              |^-- Y scroll bit 8
159              ^--- Y scroll bit 9
160160
161161c30A    BACKGROUND SCROLL X  least significant 8 bits
162162
163163c30B    BACKGROUND SCROLL X  MSB
164164
165    76543210
166    ||||||||
167    |||||||^-- X scroll bit 8
168    ||||||^--- Unknown (title screen)
169    ^^^^^^---- Unknown (title screen: 0xff)
165        76543210
166        ||||||||
167        |||||||^-- X scroll bit 8
168        ||||||^--- Unknown (title screen)
169        ^^^^^^---- Unknown (title screen: 0xff)
170170
171171c30C    SCREEN MODE
172172
173    76543210
174          ||
175          |^-- background enable bit (0 means black BG)
176          ^--- grey background enable bit
173        76543210
174              ||
175              |^-- background enable bit (0 means black BG)
176              ^--- grey background enable bit
177177
178178c5fe    BACKGROUND PALETTE INTENSITY (red and green)
179179
180    76543210
181    ||||||||
182    ||||^^^^-- green intensity
183    ^^^^------ red intensity
180        76543210
181        ||||||||
182        ||||^^^^-- green intensity
183        ^^^^------ red intensity
184184
185185c5ff    BACKGROUND PALETTE INTENSITY (blue)
186186
187    76543210
188    ||||||||
187        76543210
188        ||||||||
189189        ||||^^^^-- unknown (?)
190    ^^^^------ blue intensity
190        ^^^^------ blue intensity
191191
192192-RAM f000-f1ff
193193
194194f000    SOUND COMMAND (?)
195195
196196f001    UNKNOWN
197    maybe some external HW like a flashing light
198    when a coin falls in slot (?)
197        maybe some external HW like a flashing light
198        when a coin falls in slot (?)
199199
200200f002    ROM PAGE SELECTOR
201    select four (0-3) ROM pages at 8000-bfff.
201        select four (0-3) ROM pages at 8000-bfff.
202202
203203f003    VRAM PAGE SELECTOR
204    selects two (0-1) VRAM pages at c000-dfff.
204        selects two (0-1) VRAM pages at c000-dfff.
205205
206206f004    UNKNOWN
207207
r3289r3290
234234Some additional palette effects are provided for background.
235235Sprite palette 15's transparent color (c5fe-c5ff) is the global
236236background intensity.
237Background Intensity is encoded in the same way of colors,and
237Background intensity is encoded in the same way of colors,and
238238affects the intensity of each color component (BGR).
239239The least significant nibble of c5ff is unknown,it assumes value
2402400xf occasionaly when the other nibbles are changed.The only
r3289r3290
314314#include "sound/2203intf.h"
315315
316316
317extern WRITE8_HANDLER( psychic5_paged_ram_w );
318extern WRITE8_HANDLER( psychic5_vram_page_select_w );
319extern WRITE8_HANDLER( psychic5_title_screen_w );
317WRITE8_HANDLER( psychic5_paged_ram_w );
318WRITE8_HANDLER( psychic5_vram_page_select_w );
319WRITE8_HANDLER( psychic5_title_screen_w );
320320
321extern READ8_HANDLER( psychic5_paged_ram_r );
322extern READ8_HANDLER( psychic5_vram_page_select_r );
321READ8_HANDLER( psychic5_paged_ram_r );
322READ8_HANDLER( psychic5_vram_page_select_r );
323323
324extern MACHINE_RESET( psychic5 );
324VIDEO_START( psychic5 );
325VIDEO_RESET( psychic5 );
326VIDEO_UPDATE( psychic5 );
325327
326extern VIDEO_START( psychic5 );
327extern VIDEO_UPDATE( psychic5 );
328328
329static int psychic5_bank_latch = 0x0;
329extern UINT8 *bombsa_paletteram;
330WRITE8_HANDLER( bombsa_paged_ram_w );
331WRITE8_HANDLER( bombsa_unknown_w );
330332
333VIDEO_START( bombsa );
334VIDEO_RESET( bombsa );
335VIDEO_UPDATE( bombsa );
331336
337
338static UINT8 psychic5_bank_latch;
339
340static MACHINE_RESET( psychic5 )
341{
342   psychic5_bank_latch = 0xff;
343   flip_screen_set(0);
344}
345
346/***************************************************************************
347
348  Interrupt(s)
349
350***************************************************************************/
351
352static INTERRUPT_GEN( psychic5_interrupt )
353{
354   if (cpu_getiloops() == 0)
355      cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7);      /* RST 10h */
356   else
357      cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf);      /* RST 08h */
358}
359
360
361/***************************************************************************
362
363  Memory Handler(s)
364
365***************************************************************************/
366
332367static READ8_HANDLER( psychic5_bankselect_r )
333368{
334369   return psychic5_bank_latch;
r3289r3290
339374   UINT8 *RAM = memory_region(machine, "main");
340375   int bankaddress;
341376
342   if (data != psychic5_bank_latch)
377   if (psychic5_bank_latch != data)
343378   {
344379      psychic5_bank_latch = data;
345380      bankaddress = 0x10000 + ((data & 3) * 0x4000);
r3289r3290
347382   }
348383}
349384
385static WRITE8_HANDLER( bombsa_bankselect_w )
386{
387   UINT8 *RAM = memory_region(machine, "main");
388   int bankaddress;
389
390   if (psychic5_bank_latch != data)
391   {
392      psychic5_bank_latch = data;
393      bankaddress = 0x10000 + ((data & 7) * 0x4000);
394      memory_set_bankptr(1, &RAM[bankaddress]);    /* Select 8 banks of 16k */
395   }
396}
397
350398static WRITE8_HANDLER( psychic5_coin_counter_w )
351399{
352400   coin_counter_w(0, data & 0x01);
r3289r3290
359407   }
360408}
361409
362static INTERRUPT_GEN( psychic5_interrupt )
410static WRITE8_HANDLER( bombsa_flipscreen_w )
363411{
364   if (cpu_getiloops() == 0)
365      cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xd7);      /* RST 10h */
366   else
367         cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xcf);      /* RST 08h */
412   // bit 7 toggles flip screen
413   if (data & 0x80)
414   {
415      flip_screen_set(!flip_screen_get());
416   }
368417}
369418
370419
371static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
372   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
373   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1)
374   AM_RANGE(0xc000, 0xdfff) AM_READ(psychic5_paged_ram_r)
375   AM_RANGE(0xe000, 0xefff) AM_READ(SMH_RAM)
376   AM_RANGE(0xf000, 0xf000) AM_READ(SMH_RAM)
377   AM_RANGE(0xf001, 0xf001) AM_READ(SMH_NOP)   // ???
378   AM_RANGE(0xf002, 0xf002) AM_READ(psychic5_bankselect_r)
379   AM_RANGE(0xf003, 0xf003) AM_READ(psychic5_vram_page_select_r)
380   AM_RANGE(0xf004, 0xf004) AM_READ(SMH_NOP)   // ???
381   AM_RANGE(0xf005, 0xf005) AM_READ(SMH_NOP)   // ???
382   AM_RANGE(0xf006, 0xf1ff) AM_READ(SMH_NOP)
383   AM_RANGE(0xf200, 0xf7ff) AM_READ(SMH_RAM)
384   AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM)
385ADDRESS_MAP_END
420/***************************************************************************
386421
387static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
388   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
389   AM_RANGE(0x8000, 0xbfff) AM_WRITE(SMH_BANK1)
390   AM_RANGE(0xc000, 0xdfff) AM_WRITE(psychic5_paged_ram_w)
391   AM_RANGE(0xe000, 0xefff) AM_WRITE(SMH_RAM)
392   AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch_w)
393   AM_RANGE(0xf001, 0xf001) AM_WRITE(psychic5_coin_counter_w)
394   AM_RANGE(0xf002, 0xf002) AM_WRITE(psychic5_bankselect_w)
395   AM_RANGE(0xf003, 0xf003) AM_WRITE(psychic5_vram_page_select_w)
396   AM_RANGE(0xf004, 0xf004) AM_WRITE(SMH_NOP)   // ???
397   AM_RANGE(0xf005, 0xf005) AM_WRITE(psychic5_title_screen_w)
398   AM_RANGE(0xf006, 0xf1ff) AM_WRITE(SMH_NOP)
399   AM_RANGE(0xf200, 0xf7ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
400   AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM)
422  Memory Map(s)
423
424***************************************************************************/
425
426static ADDRESS_MAP_START( psychic5_main_map, ADDRESS_SPACE_PROGRAM, 8 )
427   AM_RANGE(0x0000, 0x7fff) AM_ROM
428   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1)
429   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(psychic5_paged_ram_r, psychic5_paged_ram_w)
430   AM_RANGE(0xe000, 0xefff) AM_RAM
431   AM_RANGE(0xf000, 0xf000) AM_RAM_WRITE(soundlatch_w)
432   AM_RANGE(0xf001, 0xf001) AM_READWRITE(SMH_NOP, psychic5_coin_counter_w)
433   AM_RANGE(0xf002, 0xf002) AM_READWRITE(psychic5_bankselect_r, psychic5_bankselect_w)
434   AM_RANGE(0xf003, 0xf003) AM_READWRITE(psychic5_vram_page_select_r, psychic5_vram_page_select_w)
435   AM_RANGE(0xf004, 0xf004) AM_NOP   // ???
436   AM_RANGE(0xf005, 0xf005) AM_READWRITE(SMH_NOP, psychic5_title_screen_w)
437   AM_RANGE(0xf006, 0xf1ff) AM_NOP
438   AM_RANGE(0xf200, 0xf7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
439   AM_RANGE(0xf800, 0xffff) AM_RAM
401440ADDRESS_MAP_END
402441
403static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
404   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
405   AM_RANGE(0xc000, 0xc7ff) AM_READ(SMH_RAM)
442static ADDRESS_MAP_START( psychic5_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
443   AM_RANGE(0x0000, 0x7fff) AM_ROM
444   AM_RANGE(0xc000, 0xc7ff) AM_RAM
406445   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
407446ADDRESS_MAP_END
408447
409static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
410   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
411   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM)
412ADDRESS_MAP_END
413
414static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
448static ADDRESS_MAP_START( psychic5_soundport_map, ADDRESS_SPACE_IO, 8 )
415449   ADDRESS_MAP_GLOBAL_MASK(0xff)
416450   AM_RANGE(0x00, 0x00) AM_WRITE(ym2203_control_port_0_w)
417451   AM_RANGE(0x01, 0x01) AM_WRITE(ym2203_write_port_0_w)
r3289r3290
420454ADDRESS_MAP_END
421455
422456
457static ADDRESS_MAP_START( bombsa_main_map, ADDRESS_SPACE_PROGRAM, 8 )
458   AM_RANGE(0x0000, 0x7fff) AM_ROM
459   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(1)
460   AM_RANGE(0xc000, 0xcfff) AM_RAM
461
462   /* ports look like the other games */
463   AM_RANGE(0xd000, 0xd000) AM_WRITE(soundlatch_w) // confirmed
464   AM_RANGE(0xd001, 0xd001) AM_WRITE(bombsa_flipscreen_w)
465   AM_RANGE(0xd002, 0xd002) AM_READWRITE(psychic5_bankselect_r, bombsa_bankselect_w)
466   AM_RANGE(0xd003, 0xd003) AM_READWRITE(psychic5_vram_page_select_r, psychic5_vram_page_select_w)
467   AM_RANGE(0xd005, 0xd005) AM_WRITE(bombsa_unknown_w) // ?
468
469   AM_RANGE(0xd000, 0xd1ff) AM_RAM
470   AM_RANGE(0xd200, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
471   AM_RANGE(0xd800, 0xdfff) AM_RAM
472
473   AM_RANGE(0xe000, 0xffff) AM_READWRITE(psychic5_paged_ram_r, bombsa_paged_ram_w)
474ADDRESS_MAP_END
475
476static ADDRESS_MAP_START( bombsa_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
477   AM_RANGE(0x0000, 0xbfff) AM_ROM
478   AM_RANGE(0xc000, 0xc7ff) AM_RAM
479   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
480   AM_RANGE(0xf000, 0xf000) AM_WRITEONLY                        // Is this a confirm of some sort?
481ADDRESS_MAP_END
482
483static ADDRESS_MAP_START( bombsa_soundport_map, ADDRESS_SPACE_IO, 8 )
484   ADDRESS_MAP_GLOBAL_MASK(0xff)
485   AM_RANGE(0x00, 0x00) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w)
486   AM_RANGE(0x01, 0x01) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w)
487   AM_RANGE(0x80, 0x80) AM_READWRITE(ym2203_status_port_1_r, ym2203_control_port_1_w)
488   AM_RANGE(0x81, 0x81) AM_READWRITE(ym2203_read_port_1_r, ym2203_write_port_1_w)
489ADDRESS_MAP_END
490
491
423492static INPUT_PORTS_START( psychic5 )
424    PORT_START("IN0")
425    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
426    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
427    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
428    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
429    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
430    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
431    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
432    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
493   PORT_START("SYSTEM")   /* system control */
494   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
495   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
496   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
497   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
498   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
499   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
500   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
501   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
433502
434    PORT_START("P1")      /* player 1 controls */
435    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
436    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
437    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
438    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
439    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
440    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
441    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
442    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
503   PORT_START("P1")      /* player 1 controls */
504   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
505   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
506   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
507   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
508   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
509   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
510   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
511   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
443512
444    PORT_START("P2")      /* player 2 controls */
445    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
446    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
447    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
448    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
449    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
450    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
451    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
452    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
513   PORT_START("P2")      /* player 2 controls */
514   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
515   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
516   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
517   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
518   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
519   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
520   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
521   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
453522
454    PORT_START("DSW0")
455    PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
456    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
457    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
458    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
459    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
460    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
461    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
462    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
463    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
464    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) )
465    PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
466    PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
467    PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
468    PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
469    PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
470    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
471    PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
472    PORT_DIPSETTING(    0x20, DEF_STR( On ) )
473    PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
474    PORT_DIPSETTING(    0x80, "2" )
475    PORT_DIPSETTING(    0xc0, "3" )
476    PORT_DIPSETTING(    0x40, "4" )
477    PORT_DIPSETTING(    0x00, "5" )
523   PORT_START("DSW1")
524   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
525   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
526   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
527   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) )
528   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
529   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
530   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
531   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
532   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
533   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) )
534   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
535   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
536   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
537   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
538   PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
539   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
540   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
541   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
542   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
543   PORT_DIPSETTING(    0x80, "2" )
544   PORT_DIPSETTING(    0xc0, "3" )
545   PORT_DIPSETTING(    0x40, "4" )
546   PORT_DIPSETTING(    0x00, "5" )
478547
479    PORT_START("DSW1")
480    PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat)")
481    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
482    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
483    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
484    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
485    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
486    PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
487    PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
488    PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
489    PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )
490    PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
491    PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
492    PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
493    PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
494    PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
495    PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
496    PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
497    PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
498    PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
499    PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )
500    PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
501    PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
502    PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
503    PORT_DIPSETTING(    0x10, DEF_STR( 1C_4C ) )
548   PORT_START("DSW2")
549   PORT_DIPNAME( 0x01, 0x01, "Invulnerability (Cheat)" )
550   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
551   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
552   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) )
553   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
554   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
555   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
556   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
557   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
558   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )
559   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
560   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) )
561   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
562   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
563   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
564   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) )
565   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
566   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
567   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
568   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_1C ) )
569   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
570   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
571   PORT_DIPSETTING(    0x14, DEF_STR( 1C_3C ) )
572   PORT_DIPSETTING(    0x10, DEF_STR( 1C_4C ) )
504573INPUT_PORTS_END
505574
575static INPUT_PORTS_START( bombsa )
576   PORT_START("SYSTEM")   /* system control */
577   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
578   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
579   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
580   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
581   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
582   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
583   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
584   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
506585
586   PORT_START("P1")       /* player 1 control */
587   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
588   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
589   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
590   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
591   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
592   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
593   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
594   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
507595
596   PORT_START("P2")      /* player 2 control */
597   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
598   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
599   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
600   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
601   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
602   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
603   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
604   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
605
606   PORT_START("DSW1")
607   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:8" )         // Coin_B
608   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:7" )
609   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:6" )         // Coin_B
610   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:5" )         // Coin_B
611   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:4" )
612   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:3" )
613   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW1:1,2")
614   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
615   PORT_DIPSETTING(    0x40, "2 Coins 1 Credit/4 Coins 3 Credits" )
616   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
617   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
618
619   PORT_START("DSW2")
620   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:8" )
621   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:7" )
622   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:6" )
623   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:5" )
624   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:4" )
625   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:3" )
626   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:2" )
627   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:1" )         // flip screen ?
628INPUT_PORTS_END
629
630
631
508632static const gfx_layout charlayout =
509633{
510634   8,8,    /* 8x8 characters */
r3289r3290
533657   GFXDECODE_ENTRY( "gfx3", 0, charlayout,   32*16, 16 )
534658GFXDECODE_END
535659
660static GFXDECODE_START( bombsa )
661   GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 32*16, 16 )
662   GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0*16,  16 )
663   GFXDECODE_ENTRY( "gfx3", 0, charlayout,   16*16, 16 )
664GFXDECODE_END
536665
537666
667
538668static void irqhandler(running_machine *machine, int irq)
539669{
540670   cpunum_set_input_line(machine, 1,0,irq ? ASSERT_LINE : CLEAR_LINE);
r3289r3290
553683static MACHINE_DRIVER_START( psychic5 )
554684
555685   /* basic machine hardware */
556   MDRV_CPU_ADD("main", Z80, 6000000)
557   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
686   MDRV_CPU_ADD("main", Z80, XTAL_12MHz/2)
687   MDRV_CPU_PROGRAM_MAP(psychic5_main_map,0)
558688   MDRV_CPU_VBLANK_INT_HACK(psychic5_interrupt,2)
559689
560   MDRV_CPU_ADD("audio", Z80, 6000000)
561   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
562   MDRV_CPU_IO_MAP(sound_io_map,0)
690   MDRV_CPU_ADD("audio", Z80, XTAL_12MHz/2)
691   MDRV_CPU_PROGRAM_MAP(psychic5_sound_map,0)
692   MDRV_CPU_IO_MAP(psychic5_soundport_map,0)
563693
564   MDRV_INTERLEAVE(10)      /* Allow time for 2nd cpu to interleave*/
694   MDRV_INTERLEAVE(10)      /* Allow time for 2nd cpu to interleave */
565695   MDRV_MACHINE_RESET(psychic5)
566696
567697   /* video hardware */
r3289r3290
577707   MDRV_PALETTE_LENGTH(768)
578708
579709   MDRV_VIDEO_START(psychic5)
710   MDRV_VIDEO_RESET(psychic5)
580711   MDRV_VIDEO_UPDATE(psychic5)
581712
582713   /* sound hardware */
583714   MDRV_SPEAKER_STANDARD_MONO("mono")
584715
585   MDRV_SOUND_ADD("ym1", YM2203, 6000000/4)
716   MDRV_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8)
586717   MDRV_SOUND_CONFIG(ym2203_config)
587718   MDRV_SOUND_ROUTE(0, "mono", 0.15)
588719   MDRV_SOUND_ROUTE(1, "mono", 0.15)
589720   MDRV_SOUND_ROUTE(2, "mono", 0.15)
590721   MDRV_SOUND_ROUTE(3, "mono", 0.50)
591722
592   MDRV_SOUND_ADD("ym2", YM2203, 6000000/4)
723   MDRV_SOUND_ADD("ym2", YM2203, XTAL_12MHz/8)
593724   MDRV_SOUND_ROUTE(0, "mono", 0.15)
594725   MDRV_SOUND_ROUTE(1, "mono", 0.15)
595726   MDRV_SOUND_ROUTE(2, "mono", 0.15)
596727   MDRV_SOUND_ROUTE(3, "mono", 0.50)
597728MACHINE_DRIVER_END
598729
730static MACHINE_DRIVER_START( bombsa )
599731
732   /* basic machine hardware */
733   MDRV_CPU_ADD("main", Z80, XTAL_12MHz/2 ) /* 6 MHz */
734   MDRV_CPU_PROGRAM_MAP(bombsa_main_map,0)
735   MDRV_CPU_VBLANK_INT_HACK(psychic5_interrupt,2)
736
737   MDRV_CPU_ADD("audio", Z80, XTAL_5MHz )
738   MDRV_CPU_PROGRAM_MAP(bombsa_sound_map,0)
739   MDRV_CPU_IO_MAP(bombsa_soundport_map,0)
740
741   MDRV_INTERLEAVE(10)
742   MDRV_MACHINE_RESET(psychic5)
743
744   /* video hardware */
745   MDRV_SCREEN_ADD("main", RASTER)
746   MDRV_SCREEN_REFRESH_RATE(54)            /* Guru says : VSync - 54Hz . HSync - 15.25kHz */
747   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
748   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
749   MDRV_SCREEN_SIZE(64*8, 32*8)
750   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
751
752   MDRV_GFXDECODE(bombsa)
753   MDRV_PALETTE_LENGTH(768)
754
755   MDRV_VIDEO_START(bombsa)
756   MDRV_VIDEO_RESET(bombsa)
757   MDRV_VIDEO_UPDATE(bombsa)
758
759   /* sound hardware */
760   MDRV_SPEAKER_STANDARD_MONO("mono")
761
762   MDRV_SOUND_ADD("ym1", YM2203, XTAL_12MHz/8)
763   MDRV_SOUND_CONFIG(ym2203_config)
764   MDRV_SOUND_ROUTE(0, "mono", 0.30)
765   MDRV_SOUND_ROUTE(1, "mono", 0.30)
766   MDRV_SOUND_ROUTE(2, "mono", 0.30)
767   MDRV_SOUND_ROUTE(3, "mono", 1.0)
768
769   MDRV_SOUND_ADD("ym2", YM2203, XTAL_12MHz/8)
770   MDRV_SOUND_ROUTE(0, "mono", 0.30)
771   MDRV_SOUND_ROUTE(1, "mono", 0.30)
772   MDRV_SOUND_ROUTE(2, "mono", 0.30)
773   MDRV_SOUND_ROUTE(3, "mono", 1.0)
774MACHINE_DRIVER_END
775
776
600777/***************************************************************************
601778
602779  Game driver(s)
r3289r3290
604781***************************************************************************/
605782
606783ROM_START( psychic5 )
607   ROM_REGION( 0x20000, "main", 0 )             /* 2*64K for main CPU, Z80 */
784   ROM_REGION( 0x20000, "main", 0 )                /* Main CPU */
608785   ROM_LOAD( "p5d",          0x00000, 0x08000, CRC(90259249) SHA1(ac2d8dd95f6c04b6ad726136931e37dcd537e977) )
609786   ROM_LOAD( "p5e",          0x10000, 0x10000, CRC(72298f34) SHA1(725be2fbf5f3622f646c0fb8e6677cbddf0b1fc2) )
610787
611   ROM_REGION( 0x10000, "audio", 0 )             /*64K for 2nd z80 CPU*/
788   ROM_REGION( 0x10000, "audio", 0 )                /* Sound CPU */
612789   ROM_LOAD( "p5a",          0x00000, 0x08000, CRC(50060ecd) SHA1(e6051fb4a1fa9429cfb6084e8a5dfe994a08280b) )
613790
614   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE )
615   ROM_LOAD( "p5b",          0x00000, 0x10000, CRC(7e3f87d4) SHA1(b8e7fa3f96d2e3937e4cb530f105bb84d5743b43) )   /* sprite tiles */
791   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE )   /* sprite tiles */
792   ROM_LOAD( "p5b",          0x00000, 0x10000, CRC(7e3f87d4) SHA1(b8e7fa3f96d2e3937e4cb530f105bb84d5743b43) )
616793   ROM_LOAD( "p5c",          0x10000, 0x10000, CRC(8710fedb) SHA1(c7e8dc6b733e4ecce37d56fc429c00ade8736ff3) )
617794
618   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
619   ROM_LOAD( "p5g",          0x00000, 0x10000, CRC(f9262f32) SHA1(bae2dc77be7024bd85f213e4da746c5903db6ea5) )   /* background tiles */
795   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )   /* background tiles */
796   ROM_LOAD( "p5g",          0x00000, 0x10000, CRC(f9262f32) SHA1(bae2dc77be7024bd85f213e4da746c5903db6ea5) )
620797   ROM_LOAD( "p5h",          0x10000, 0x10000, CRC(c411171a) SHA1(d5893563715ba231e42b084b88f5176bb94a4da9) )
621798
622   ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE )
623   ROM_LOAD( "p5f",          0x00000, 0x08000, CRC(04d7e21c) SHA1(6046c506bdedc233e3730f90c7897e847bec8758) )   /* foreground tiles */
799   ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE )   /* foreground tiles */
800   ROM_LOAD( "p5f",          0x00000, 0x08000, CRC(04d7e21c) SHA1(6046c506bdedc233e3730f90c7897e847bec8758) )
624801ROM_END
625802
626803
804/*
805Bombs Away
806Jaleco, 1988
627807
808PCB Layout
809----------
810
811BB-8744
812|------------------------------------------|
813|         1      Z80(1)          4         |
814|         6116      5MHz                  |-|
815|VOL      YM2203                 5        | |
816|4558     YM2203      Z80(2)              | |
817|4558 YM3014                     6        | |
818|     YM3014                              | |
819|J          6116                6264      | |
820|A                                        |-|
821|M                                         |
822|M                                         |
823|A                                        |-|
824|                                         | |
825|                                         | |
826|                2   62256                | |
827| DSW1                                    | |
828|                3   62256                | |
829| DSW2    82S137                          |-|
830|                                          |
831|------------------------------------------|
832Notes:
833      Z80(1) clock - 5.000MHz
834      Z80(2) clock - 6.000MHz [12/2]
835      YM2203 clock - 1.500MHz [12/8, both]
836      VSync - 54Hz
837      HSync - 15.25kHz
838
839
840BB-8745
841|--------------------------------|
842|                                |
843|                      |-----|  |-|
844|                      |N8633|  | |
845|                      |-S   |  | |
846|                      |-----|  | |
847|  82S123                       | |
848|              |-----|          | |
849|              |N8633|          |-|
850|              |-V   |           |
851|2018          |     |           |
852|2018        7 |6116 |    12MHz |-|
853|              |-----|          | |
854|      |-----|                  | |
855|      |N8633|                  | |
856|      |-V64 |                  | |
857|      |     |                  | |
858| 9  8 |6264 |                  |-|
859|      |-----|                   |
860|--------------------------------|
861Notes:
862      3 soldered-in 'modules' are located on this PCB.
863      N-8633-V 6-7 TOYOCOM
864      N-8633-V64 6-7 TOYOCOM
865      N-8633-S 6-7 TOYOCOM
866      The 2 larger ones have 62 pins, 31 pins on each side of a small PCB. The PCB contains some
867      surface mounted logic chips and some surface mounted RAM.
868      The smaller module has 40 pins, 20 pins on each side of a small PCB. The PCB contains only
869      logic on both sides.
870*/
871
872ROM_START( bombsa )
873   ROM_REGION( 0x30000, "main", 0 )               /* Main CPU */
874   ROM_LOAD( "4.7a",         0x00000, 0x08000, CRC(0191f6a7) SHA1(10a0434abbf4be068751e65c81b1a211729e3742) )
875   /* these fail their self-test... should be checked on real hw (hold start1+start2 on boot) */
876   ROM_LOAD( "5.7c",         0x10000, 0x08000, BAD_DUMP CRC(095c451a) SHA1(892ca84376f89640ad4d28f1e548c26bc8f72c0e) ) // contains palettes etc. but fails rom check??
877   ROM_LOAD( "6.7d",         0x20000, 0x10000, BAD_DUMP CRC(89f9dc0f) SHA1(5cf6a7aade3d56bc229d3771bc4141ad0c0e8da2) )
878
879   ROM_REGION( 0x10000, "audio", 0 )               /* Sound CPU */
880   ROM_LOAD( "1.3a",         0x00000, 0x08000, CRC(92801404) SHA1(c4ff47989d355b18a909eaa88f138e2f68178ecc) )
881
882   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE )   /* sprite tiles */
883   ROM_LOAD( "2.4p",         0x00000, 0x10000, CRC(bd972ff4) SHA1(63bfb455bc0ae1d31e6f1066864ec0c8d2d0cf99) )
884   ROM_LOAD( "3.4s",         0x10000, 0x10000, CRC(9a8a8a97) SHA1(13328631202c196c9d8791cc6063048eb6be0472) )
885
886   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )   /* background tiles */
887   /* some corrupt 'blank' characters, should also be checked with a redump */
888   ROM_LOAD( "8.2l",         0x00000, 0x10000, BAD_DUMP CRC(3391c769) SHA1(7ae7575ac81d6e0d915c279c1f57a9bc6d096bd6) )
889   ROM_LOAD( "9.2m",         0x10000, 0x10000, BAD_DUMP CRC(5b315976) SHA1(d17cc1926f926bdd88b66ea6af88dac30880e7d4) )
890
891   ROM_REGION( 0x08000, "gfx3", ROMREGION_DISPOSE )   /* foreground tiles */
892   ROM_LOAD( "7.4f",         0x00000, 0x08000, CRC(400114b9) SHA1(db2f3ba05a2005ae0e0e7d19c8739353032cbeab) )
893
894   ROM_REGION( 0x08000, "proms", ROMREGION_DISPOSE )   /* Proms */
895   ROM_LOAD( "82s131.7l",    0x000, 0x200, CRC(6a7d13c0) SHA1(2a835a4ac1acb7663d0b915d0339af9800284da6) )
896   ROM_LOAD( "82s137.3t",    0x200, 0x400, CRC(59e44236) SHA1(f53d99694fa5acd7cc51dd78e09f0d2ef730e7a4) )
897ROM_END
898
899
628900GAME( 1987, psychic5, 0, psychic5, psychic5, 0, ROT270, "Jaleco", "Psychic 5", 0 )
901GAME( 1988, bombsa,   0, bombsa,   bombsa,   0, ROT270, "Jaleco", "Bombs Away", GAME_NOT_WORKING )
src/mame/drivers/meritm.c
r3289r3290
12691269   ROM_LOAD( "sc3981-0a.u51",  0x000, 0x117, CRC(4fc750d0) SHA1(d09ff7a8c66aeb5c49e9fec84bd1521e3f5d8d0a) )
12701270ROM_END
12711271
1272ROM_START( megat5 ) /* U32 is a bad dump, the other 3 roms look to be ok */
1272ROM_START( megat5 ) /* Dallas DS1204V security key at U5 labeled 9255-60-01 U5-B-RO1 C1998 MII */
12731273   ROM_REGION( 0x400000, "main", 0 )
1274   ROM_LOAD( "megat5.u32",         0x000000, 0x80000, BAD_DUMP CRC(89932443) SHA1(68d2fbf2a5050fc5371595a105fe06f4276b0b67) )
1274   ROM_LOAD( "9255-60-01_u32-r0",  0x000000, 0x80000, BAD_DUMP CRC(89932443) SHA1(68d2fbf2a5050fc5371595a105fe06f4276b0b67) ) /* U32 is a bad dump, the other 3 roms look to be ok */
12751275   ROM_RELOAD(                     0x080000, 0x80000)
1276   ROM_LOAD( "megat5.u36",         0x100000, 0x80000, BAD_DUMP CRC(0bed9e27) SHA1(1414385ce562b127e1ddeccc20ea4ff2a7098b7e) )
1276   ROM_LOAD( "qs9255-05_u36-r0",   0x100000, 0x80000, BAD_DUMP CRC(0bed9e27) SHA1(1414385ce562b127e1ddeccc20ea4ff2a7098b7e) )
12771277   ROM_RELOAD(                     0x180000, 0x80000)
1278   ROM_LOAD( "megat5.u37",         0x200000, 0x80000, BAD_DUMP CRC(b713a1c5) SHA1(d6ccba2ea90fd0e2ecf15249514231eed54000c1) )
1278   ROM_LOAD( "qs9255-05_u37-r0",   0x200000, 0x80000, BAD_DUMP CRC(b713a1c5) SHA1(d6ccba2ea90fd0e2ecf15249514231eed54000c1) )
12791279   ROM_RELOAD(                     0x280000, 0x80000)
12801280   ROM_LOAD( "9255-60-01_u38-r0c", 0x300000, 0x80000, BAD_DUMP CRC(018e36c7) SHA1(8e9b457238a40b10d59887d13bac9c0a05c73614) ) /* Location U38, 07/10/1997 16:27:51 */
12811281   ROM_RELOAD(                     0x380000, 0x80000)
src/mame/drivers/harddriv.c
r3289r3290
17661766   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
17671767   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
17681768
1769   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
1769   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
17701770   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
17711771   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
17721772   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
18011801   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
18021802   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
18031803
1804   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
1804   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
18051805   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
18061806   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
18071807   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
18361836   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
18371837   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
18381838
1839   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
1839   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
18401840   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
18411841   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
18421842   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
18711871   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
18721872   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
18731873
1874   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
1874   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
18751875   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
18761876   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
18771877   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
19061906   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
19071907   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
19081908
1909   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
1909   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
19101910   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
19111911   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
19121912   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
19411941   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
19421942   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
19431943
1944   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
1944   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
19451945   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
19461946   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
19471947   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
19761976   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
19771977   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
19781978
1979   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
1979   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
19801980   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
19811981   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
19821982   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
20112011   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
20122012   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
20132013
2014   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
2014   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
20152015   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
20162016   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
20172017   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
20462046   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
20472047   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
20482048
2049   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
2049   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
20502050   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
20512051   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
20522052   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
20812081   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
20822082   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
20832083
2084   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
2084   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
20852085   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
20862086   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
20872087   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
r3289r3290
21162116   ROM_LOAD16_BYTE( "136070-2120.9h",  0x040000, 0x010000, CRC(55a30976) SHA1(045a04d3d24e783a6a643cab08e8974ee5dc2128) )
21172117   ROM_LOAD16_BYTE( "136070-2117.9k",  0x040001, 0x010000, CRC(d4a9696d) SHA1(574e5f3758ac2e18423ae350e8509aa135ca6da0) )
21182118
2119   ROM_REGION( 0x100000, "adpcm", 0 )   /* 256k for ADPCM samples */
2119   ROM_REGION( 0x40000, "adpcm", 0 )   /* 256k for ADPCM samples */
21202120   ROM_LOAD( "136070-2124.1fh", 0x000000, 0x010000, CRC(4dc14fe8) SHA1(c7cc00715f6687ced9d69ec793d6e9d4bc1b5287) )
21212121   ROM_LOAD( "136070-2125.1ef", 0x010000, 0x010000, CRC(cbdabbcc) SHA1(4d102a5677d96e68d27c1960dc3a237ae6751c2f) )
21222122   ROM_LOAD( "136070-2126.1de", 0x020000, 0x010000, CRC(b973d9d1) SHA1(a74a3c981497a9c5557f793d49381a9b776cb025) )
src/mame/drivers/funworld.c
r3289r3290
2929    * Pool 10 (italian, set 1),                         C.M.C.,             1996.
3030    * Pool 10 (italian, set 2),                         C.M.C.,             1996.
3131    * Pool 10 (italian, set 3),                         C.M.C.,             1996.
32    * Pool 10 (italian, set 4),                         C.M.C.,             1997.
3233    * Tortuga Family (italian),                         C.M.C.,             1997.
3334    * Pot Game (italian),                               C.M.C.,             1996.
3435    * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
r3289r3290
407408    ---------------------------------------------------
408409
409410
411
410412    Jolly Card (austrian, Funworld, bootleg)
411413    ----------------------------------------
412414
r3289r3290
421423    - 1x Crystal : 16.000 MHz
422424
423425
426
424427    Jolly Card (other)
425428    ------------------
426429
r3289r3290
435438    - 1x Crystal : 16.000 MHz
436439
437440
441
438442    Jolly Card (italian, blue Tab board, encrypted)
439443    -----------------------------------------------
440444
r3289r3290
456460    - 1x trimmer (volume)(missing)
457461
458462
463
459464    Big Deal (hungarian)
460465    ------------------
461466
r3289r3290
465470    - 1x Crystal 16.000 MHz
466471
467472
473
468474    Magic Card II (bulgarian)
469475    ---------------------------------
470476
r3289r3290
476482    - 2x HY18CV85 (electrically-erasable PLD)
477483
478484
485
479486    Cuore Uno (italian)
480487    -----------------------------------
481488
r3289r3290
495502    - 1x battery
496503
497504
505
498506    Elephant Family (italian, old)
499507    -----------------------------
500508
r3289r3290
514522    - 1x battery
515523
516524
525
517526    Pool 10 (italian)
518527    -----------------
519528
r3289r3290
535544    - 1x battery
536545
537546
547    Connector, DIPs and instructions,
548    copied from an original sheet...
549
550              Components |  | solder
551    ---------------------|--|-----------------
552                     gnd |01| gnd
553                     gnd |02| gnd
554                      +5 |03| +5
555                      +5 |04| +5
556                         |06|
557                     +12 |07| +5
558                         |08| contatore out
559            motor hopper |09| contatore in
560                   audio |10| audio
561               sw hopper |11| gnd
562                   rosso |12| verde
563                     blu |13| sync
564                     gnd |14| statistic
565              manegement |15|
566                  coin 1 |16| coin 2
567               sw ticket |17| motor ticket
568                  hold 3 |18| lamp hold 3
569                  hold 4 |19| lamp hold 4
570                  hold 2 |20| lamp hold 2
571                  hold 1 |21| lamp hold 1
572                  hold 5 |22| lamp hold 5
573                   start |23| lamp hold start
574                  cancel |24| lamp hold cancel
575                      nc |25| +5 lamp
576    ric. ticket + hopper |26| +12 lamp
577                     gnd |27| gnd
578                     gnd |28| gnd
579
580
581    DIPS
582                          1    2   3   4   5   6   7   8
583                         on
584                         off
585    ticket + hopper           on  on
586    hopper                    on  off
587    ticket                    off on
588    no ticket - no hopper     off off
589    1 coin 1 credit                   off off
590    1 coin 5 credits                  off on
591    1 coin 10 credits                 on  off
592    1 coin 50 credits                 on  on
593    five of kind yes                          off
594    five of kind no                           on
595    royal flush yes                               off
596    royal flush no                                on
597    in test                                           on
598    in game                                           off
599
600
601    Instructions:
602
603    STATISTICS = show in and out credits
604    MANEGEMENT = It's the general statistic. It shows in and out credits.
605
606    To cancel statistics press CANCEL for 5 seconds.
607    To change max and min value for play connect to GND the manegement pin,
608    at the same time press toghether HOLD 2 + HOLD 4 for some seconds.
609
610    The following menu will show up:
611
612    HOLD 1 = modify max value for play 1 to 10.
613    HOLD 2 = modify min value foe play 1 to 5.
614    Press start to exit from programming mode.
615
616    To unlock PCB from a possible lock:
617    connect GND to pins component15 and solder14 for 5 seconds
618
619    NB. Use lamps by 12V 0,15W
620    Memory version: V16
621
622
623
538624    Tortuga Family (italian) & Pot Game (italian)
539625    ---------------------------------------------
540626
r3289r3290
555641    - 1x battery
556642
557643
644
558645    Royal Card (set 1)
559646    ------------------
560647
r3289r3290
579666    - 1x trimmer (volume)
580667
581668
669
582670    Royal Card (set 2)
583671    ------------------
584672
r3289r3290
597685    - 1x trimmer (volume)
598686
599687
688
600689    Royal Card (set 3, encrypted)
601690    -----------------------------
602691
r3289r3290
619708    - 2x 27256 - gfx - "2.bin", "3.bin"
620709
621710
711
622712    Mongolfier New
623713    --------------
624714
r3289r3290
642732    - 1x green led
643733
644734
735
645736    Soccer New (italian)
646737    --------------------
647738
r3289r3290
666757    - 1x green led
667758
668759
760
669761    Saloon (France, encrypted)
670762    --------------------------
671763
r3289r3290
872964    - Added new clone: Pool 10 (italian, set 3).
873965    - Updated technical notes.
874966
967    [2008/09/12]
968    - Added new clone: Pool 10 (italian, set 4).
969    - Improved lamps layout for all games.
970    - Added Pool 10 pinout and DIP switches info.
971    - Updated technical notes.
875972
973
876974    *** TO DO ***
877975
878976    - Figure out the royalcdc, jokercrd and saloon encryption.
r3289r3290
19922090   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
19932091
19942092   ROM_REGION( 0x0600, "plds", 0 )
1995   ROM_LOAD( "palce16v8h_p10.u5",  0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */
1996   ROM_LOAD( "gal20v8b_p10.u22", 0x0200, 0x0157, NO_DUMP ) /* GAL is read protected */
1997   ROM_LOAD( "gal20v8b_p10.u23", 0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */
2093   ROM_LOAD( "palce16v8h_p10.u5", 0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */
2094   ROM_LOAD( "gal20v8b_p10.u22",  0x0200, 0x0157, NO_DUMP ) /* GAL is read protected */
2095   ROM_LOAD( "gal20v8b_p10.u23",  0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */
19982096ROM_END
19992097
20002098ROM_START( pool10b )   /* this set should be the parent */
r3289r3290
20282126   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
20292127
20302128   ROM_REGION( 0x0600, "plds", 0 )
2031   ROM_LOAD( "palce16v8h_p10.u5",  0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */
2032   ROM_LOAD( "gal20v8b_p10.u22", 0x0200, 0x0157, NO_DUMP ) /* GAL is read protected */
2033   ROM_LOAD( "gal20v8b_p10.u23", 0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */
2129   ROM_LOAD( "palce16v8h_p10.u5", 0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */
2130   ROM_LOAD( "gal20v8b_p10.u22",  0x0200, 0x0157, NO_DUMP ) /* GAL is read protected */
2131   ROM_LOAD( "gal20v8b_p10.u23",  0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */
20342132ROM_END
20352133
2134ROM_START( pool10d )
2135   ROM_REGION( 0x18000, "main", 0 )
2136   ROM_LOAD( "3.50.u2", 0x8000, 0x10000, CRC(4c68e1f4) SHA1(bbab63a18e0c041ce519daa32e12dd1b6a672dce) )
2137
2138   ROM_REGION( 0x10000, "gfx1", ROMREGION_DISPOSE )
2139   ROM_LOAD( "2.u21", 0x0000, 0x8000, CRC(99c8c074) SHA1(f8082b08e895cbcd028a2b7cd961a7a2c8b2762c) )
2140   ROM_LOAD( "1.u20", 0x8000, 0x8000, CRC(9abedd0c) SHA1(f184a82e8ec2387069d631bcb77e890acd44b3f5) )
2141
2142   ROM_REGION( 0x0200, "proms", 0 )
2143   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
2144
2145   ROM_REGION( 0x0600, "plds", 0 )
2146   ROM_LOAD( "palce16v8h_p10.u5", 0x0000, 0x0117, NO_DUMP ) /* PAL is read protected */
2147   ROM_LOAD( "gal20v8b_p10.u22",  0x0200, 0x0157, NO_DUMP ) /* GAL is read protected */
2148   ROM_LOAD( "gal20v8b_p10.u23",  0x0400, 0x0157, NO_DUMP ) /* GAL is read protected */
2149ROM_END
2150
20362151ROM_START( tortufam )
20372152   ROM_REGION( 0x10000, "main", 0 )
20382153   ROM_LOAD( "tortu.a.u2", 0x8000, 0x8000, CRC(6e112184) SHA1(283ac534fc1cb33d11bbdf3447630333f2fc957f) )
r3289r3290
25172632GAME( 1996, pool10,   0,        cuoreuno, pool10,   funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 1)",                        0 )
25182633GAME( 1996, pool10b,  pool10,   cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 2)",                        0 )
25192634GAME( 1996, pool10c,  pool10,   cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 3)",                        0 )
2635GAME( 1997, pool10d,  pool10,   cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 4)",                        0 )
25202636GAME( 1997, tortufam, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Tortuga Family (italian)",                        0 )
25212637GAME( 1996, potgame,  0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pot Game (italian)",                              0 )
25222638GAME( 1991, royalcrd, 0,        royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Royal Card (austrian, set 1)",                    0 )
src/mame/drivers/galaxi.c
r3289r3290
3232- Fixed the 3rd background offset to Galaxi.
3333- Remapped inputs to match the standard poker games.
3434
35[12/09/2008] (Roberto Fresca)
3536
37- Added lamps support to magjoker & galaxi.
38
39
3640***************************************************************************/
3741
3842#include "driver.h"
3943#include "sound/okim6295.h"
44#include "galaxi.lh"
4045
4146/***************************************************************************
4247                                Video Hardware
r3289r3290
177182{
178183   if ( ACCESSING_BITS_0_7 )
179184   {
180      set_led_status(0, data & 0x0001);   // hold 1
181      set_led_status(1, data & 0x0002);   // hold 2
182      set_led_status(2, data & 0x0004);   // hold 3
183      set_led_status(3, data & 0x0008);   // hold 4
184      set_led_status(4, data & 0x0010);   // hold 5
185      set_led_status(5, data & 0x0020);   // start
186      set_led_status(6, data & 0x0020);   // payout
187      set_led_status(7, data & 0x0020);   // hopper
185   /*
186        - Lbits -
187        7654 3210
188        =========
189        ---- ---x  Hold1 lamp.
190        ---- --x-  Hold2 lamp.
191        ---- -x--  Hold3 lamp.
192        ---- x---  Hold4 lamp.
193        ---x ----  Hold5 lamp.
194        --x- ----  Start lamp.
195        -x-- ----  Payout.
196
197    */
198      output_set_lamp_value(1, (data & 1));         /* Lamp 1 - HOLD 1 */
199      output_set_lamp_value(2, (data >> 1) & 1);      /* Lamp 2 - HOLD 2 */
200      output_set_lamp_value(3, (data >> 2) & 1);      /* Lamp 3 - HOLD 3 */
201      output_set_lamp_value(4, (data >> 3) & 1);      /* Lamp 4 - HOLD 4 */
202      output_set_lamp_value(5, (data >> 4) & 1);      /* Lamp 5 - HOLD 5 */
203      output_set_lamp_value(6, (data >> 5) & 1);      /* Lamp 6 - START  */
188204   }
189205   if ( ACCESSING_BITS_8_15 )
190206   {
r3289r3290
393409                               Game Drivers
394410***************************************************************************/
395411
396GAME( 2000, galaxi,   0,  galaxi,   galaxi,   0, ROT0, "B.R.L.", "Galaxi (v2.0)",               0 )
397GAME( 2000, magjoker, 0,  magjoker, magjoker, 0, ROT0, "B.R.L.", "Magic Joker (v1.25.10.2000)", 0 )
412/*     YEAR  NAME      PARENT  MACHINE   INPUT     INIT  ROT    COMPANY   FULLNAME                      FLAGS  LAYOUT  */
413GAMEL( 2000, galaxi,   0,      galaxi,   galaxi,   0,    ROT0, "B.R.L.", "Galaxi (v2.0)",               0,     layout_galaxi )
414GAMEL( 2000, magjoker, 0,      magjoker, magjoker, 0,    ROT0, "B.R.L.", "Magic Joker (v1.25.10.2000)", 0,     layout_galaxi )
src/mame/drivers/gottlieb.c
r3289r3290
680680      bitmap_t *dummy;
681681
682682      /* set the "disc ready" bit, which basically indicates whether or not we have a proper video frame */
683      if (laserdisc_get_video(laserdisc, &dummy) == 0)
683      if (!laserdisc_get_video(laserdisc, &dummy))
684684         laserdisc_status &= ~0x20;
685685      else
686686         laserdisc_status |= 0x20;
src/mame/drivers/arkanoid.c
r3289r3290
869869
870870ROM_START( arkatour )
871871   ROM_REGION( 0x10000, "main", 0 )
872   ROM_LOAD( "t_ark1.bin",   0x0000, 0x8000, CRC(e3b8faf5) SHA1(4c09478fa41881fa89ee6afb676aeb780f17ac2e) )
873   ROM_LOAD( "t_ark2.bin",   0x8000, 0x8000, CRC(326aca4d) SHA1(5a194b7a0361236d471b24905dc6434372f81252) )
872   ROM_LOAD( "a75-27.17",   0x0000, 0x8000, CRC(e3b8faf5) SHA1(4c09478fa41881fa89ee6afb676aeb780f17ac2e) )
873   ROM_LOAD( "a75-28.18",   0x8000, 0x8000, CRC(326aca4d) SHA1(5a194b7a0361236d471b24905dc6434372f81252) )
874874
875875   ROM_REGION( 0x0800, "mcu", 0 )   /* 2k for the microcontroller */
876   ROM_LOAD( "arkatour.uc",  0x0000, 0x0800, BAD_DUMP CRC(d3249559) SHA1(b1542764450016614e9e03cedd6a2f1e59961789)  )
876   ROM_LOAD( "a75-32.14",  0x0000, 0x0800, BAD_DUMP CRC(d3249559) SHA1(b1542764450016614e9e03cedd6a2f1e59961789)  )
877877
878878   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
879   ROM_LOAD( "t_ark3.bin",   0x00000, 0x8000, CRC(5ddea3cf) SHA1(58f16515898b7cc2697bf7663a60d9ca0db6da95) )
880   ROM_LOAD( "t_ark4.bin",   0x08000, 0x8000, CRC(5fcf2e85) SHA1(f721f0afb0550cc64bff26681856a7576398d9b5) )
881   ROM_LOAD( "t_ark5.bin",   0x10000, 0x8000, CRC(7b76b192) SHA1(a68aa08717646a6c322cf3455df07f50df9e9f33) )
879   ROM_LOAD( "a75-29.64",   0x00000, 0x8000, CRC(5ddea3cf) SHA1(58f16515898b7cc2697bf7663a60d9ca0db6da95) )
880   ROM_LOAD( "a75-30.63",   0x08000, 0x8000, CRC(5fcf2e85) SHA1(f721f0afb0550cc64bff26681856a7576398d9b5) )
881   ROM_LOAD( "a75-31.62",   0x10000, 0x8000, CRC(7b76b192) SHA1(a68aa08717646a6c322cf3455df07f50df9e9f33) )
882882
883883   ROM_REGION( 0x0600, "proms", 0 )
884   ROM_LOAD( "07.bpr",       0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
885   ROM_LOAD( "08.bpr",       0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
886   ROM_LOAD( "09.bpr",       0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
884   ROM_LOAD( "a75-33.24",    0x0000, 0x0200, CRC(b4bf3c81) SHA1(519188937ac9728c653fabac877e37dc43c3f71a) )   /* red component */
885   ROM_LOAD( "a75-34.23",    0x0200, 0x0200, CRC(de85a803) SHA1(325214995996de36a0470fbfc00e4e393c0b17ad) )   /* green component */
886   ROM_LOAD( "a75-35.35",    0x0400, 0x0200, CRC(38acfd3b) SHA1(2841e9db047aa039eff8567a518b6250b355507b) )   /* blue component */
887887ROM_END
888888
889889ROM_START( arknoidj )
src/mame/drivers/cubeqst.c
r3289r3290
55    driver by Phil Bennett
66
77    TODO:
8       * Emulate D8478 laserdisc interface MCU
98       * Accurate video timings
109        - Derive from PROMs
1110       * More accurate line fill circuitry emulation
r3289r3290
6160static UINT8 reset_latch;
6261
6362static int disk_on;
64static int ldp_command_flag;
6563static const device_config *laserdisc;
6664
6765/*************************************
r3289r3290
222220
223221static WRITE16_HANDLER( laserdisc_w )
224222{
225   ldp_command_flag = 1;
226223   laserdisc_data_w(laserdisc, data & 0xff);
227224}
228225
229/* Called by the player emulation to acknowledge the 68000 command */
230void ldp_ack_callback(void)
231{
232   ldp_command_flag = 0;
233}
234
235226/*
236227    D0: Command acknowledge
237228    D1: Seek status (0 = searching, 1 = ready)
238229*/
239230static READ16_HANDLER( laserdisc_r )
240231{
232   int ldp_command_flag = (laserdisc_line_r(laserdisc, LASERDISC_LINE_READY) == ASSERT_LINE) ? 0 : 1;
241233   int ldp_seek_status = (laserdisc_line_r(laserdisc, LASERDISC_LINE_STATUS) == ASSERT_LINE) ? 1 : 0;
242234
243235   return (ldp_seek_status << 1) | ldp_command_flag;
r3289r3290
444436static MACHINE_START( cubeqst )
445437{
446438   laserdisc = device_list_find_by_tag(machine->config->devicelist, LASERDISC, "laserdisc");
447   simutrek_set_cmd_ack_callback(laserdisc, ldp_ack_callback);
448439}
449440
450441static MACHINE_RESET( cubeqst )
451442{
452443   reset_latch = 0;
453444
454   /* Do this until we sort out the laserdisc interface properly */
455   ldp_command_flag = 0;
456
457445   /* Auxillary CPUs are held in reset */
458446   cpunum_set_input_line(machine, SOUND_CPU, INPUT_LINE_RESET, ASSERT_LINE);
459447   cpunum_set_input_line(machine, ROTATE_CPU, INPUT_LINE_RESET, ASSERT_LINE);
r3289r3290
558546   MDRV_CPU_PROGRAM_MAP(line_sound_map, 0)
559547   MDRV_CPU_CONFIG(snd_config)
560548
561#if 0
562   MDRV_CPU_ADD("ldp_cpu", I8048, XTAL_10MHz / 2)
563   MDRV_CPU_PROGRAM_MAP(ldp_mem, 0)
564   MDRV_CPU_IO_MAP(ldp_io, 0)
565#endif
566
567549   MDRV_INTERLEAVE(700)
568550
569551   MDRV_MACHINE_START(cubeqst)
r3289r3290
580562   MDRV_LASERDISC_OVERLAY(cubeqst, CUBEQST_HBLANK, CUBEQST_VCOUNT, BITMAP_FORMAT_INDEXED16)
581563   MDRV_LASERDISC_OVERLAY_CLIP(0, 320-1, 0, 256-8)
582564   MDRV_LASERDISC_OVERLAY_POSITION(0.002, -0.018)
565   MDRV_LASERDISC_OVERLAY_SCALE(1.0, 1.030)
583566
584567   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
585568
r3289r3290
658641   ROMX_LOAD( "mother_sounds_82s129.9e",  0x4, 0x100, CRC(598687e7) SHA1(c5045ddaab7123ff0a4c8f4c2489f9d70b63fc76), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(7))
659642   ROMX_LOAD( "mother_sounds_82s129.8e",  0x4, 0x100, CRC(68de17ed) SHA1(efefcb4ccdd012b767c4765304c6022b0c091066), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(7))
660643
661    ROM_REGION( 0x10000, "ldp_cpu", 0)
662    ROM_LOAD( "laser_player_interface_d8748_a308.bin", 0x0000, 0x0400, CRC(eed3e728) SHA1(1eb3467f1c41553375b2c21952cd593b167f5416) )
663
664644   ROM_REGION16_BE( 0x1000, "soundproms", 0)
665645   ROMX_LOAD( "mother_sounds_82s185.17f", 0x0, 0x800, CRC(0f49d40e) SHA1(40340833ab27ccb5b60baf44ad01930f204f5318), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) )
666646   ROMX_LOAD( "mother_sounds_82s185.19f", 0x0, 0x800, CRC(a041ce92) SHA1(9bc92992de22b830e479933c50650c7dc23f5713), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) )
src/tools/chdman.c
r3289r3290
1515#include "bitmap.h"
1616#include "md5.h"
1717#include "sha1.h"
18#include "vbiparse.h"
1819#include <stdarg.h>
1920#include <stdio.h>
2021#include <time.h>
r3289r3290
8485***************************************************************************/
8586
8687/*-------------------------------------------------
87    print_big_int - 64-bit int printing with commas
88    print_big_int - 64-bit int printing with
89    commas
8890-------------------------------------------------*/
8991
9092static void print_big_int(UINT64 intvalue, char *output)
r3289r3290
105107
106108
107109/*-------------------------------------------------
108    big_int_string - return a string for a big int
110    big_int_string - return a string for a big
111    integer
109112-------------------------------------------------*/
110113
111114static char *big_int_string(UINT64 intvalue)
r3289r3290
162165   printf("   or: chdman -merge parent.chd diff.chd output.chd\n");
163166   printf("   or: chdman -diff parent.chd compare.chd diff.chd\n");
164167   printf("   or: chdman -setchs inout.chd cylinders heads sectors\n");
168   printf("   or: chdman -fixavdata inout.chd\n");
165169   return 1;
166170}
167171
r3289r3290
755759   const char *inputfile, *outputfile;
756760   bitmap_t *fullbitmap = NULL;
757761   const avi_movie_info *info;
762   UINT8 *ldframedata = NULL;
758763   const chd_header *header;
759764   chd_file *chd = NULL;
760765   avi_file *avi = NULL;
r3289r3290
838843      numframes *= 2;
839844   }
840845
846   /* allocate space for the frame data */
847   if (height == 524/2 || height == 624/2)
848   {
849      ldframedata = malloc(numframes * VBI_PACKED_BYTES);
850      if (ldframedata == NULL)
851      {
852         fprintf(stderr, "Out of memory allocating frame metadata\n");
853         err = CHDERR_OUT_OF_MEMORY;
854         goto cleanup;
855      }
856      memset(ldframedata, 0, numframes * VBI_PACKED_BYTES);
857   }
858
841859   /* determine the number of bytes per frame */
842860   max_samples_per_frame = ((UINT64)rate * 1000000 + fps_times_1million - 1) / fps_times_1million;
843861   bytes_per_frame = 12 + channels * max_samples_per_frame * 2 + width * height * 2;
r3289r3290
920938         err = CHDERR_COMPRESSION_ERROR;
921939      }
922940
941      /* update metadata for this frame */
942      if (ldframedata != NULL)
943      {
944         /* parse the data and pack it */
945         vbi_metadata vbi;
946         vbi_parse_all((const UINT16 *)avconfig.video->base, avconfig.video->rowpixels, avconfig.video->width, 8, &vbi);
947         vbi_metadata_pack(&ldframedata[framenum * VBI_PACKED_BYTES], framenum, &vbi);
948      }
949
923950      /* configure the compressor for this frame */
924951      chd_codec_config(chd, AV_CODEC_COMPRESS_CONFIG, &avconfig);
925952
r3289r3290
929956         goto cleanup;
930957   }
931958
959   /* write the final metadata */
960   if (ldframedata != NULL)
961   {
962      err = chd_set_metadata(chd, AV_LD_METADATA_TAG, 0, ldframedata, numframes * VBI_PACKED_BYTES);
963      if (err != CHDERR_NONE)
964      {
965         fprintf(stderr, "Error adding AVLD metadata: %s\n", chd_error_string(err));
966         goto cleanup;
967      }
968   }
969
932970   /* finish compression */
933971   err = chd_compress_finish(chd);
934972   if (err != CHDERR_NONE)
r3289r3290
947985         free(avconfig.audio[chnum]);
948986   if (fullbitmap != NULL)
949987      bitmap_free(fullbitmap);
988   if (ldframedata != NULL)
989      free(ldframedata);
950990   if (err != CHDERR_NONE)
951991      osd_rmfile(outputfile);
952992   return (err != CHDERR_NONE);
r3289r3290
14661506   numframes = MIN(totalframes - firstframe, numframes);
14671507
14681508   /* allocate a video buffer */
1469   fullbitmap = bitmap_alloc(width, height * (interlaced ? 2 : 1), BITMAP_FORMAT_YUY16);
1509   fullbitmap = bitmap_alloc(width, height, BITMAP_FORMAT_YUY16);
14701510   if (fullbitmap ==  NULL)
14711511   {
14721512      fprintf(stderr, "Out of memory allocating temporary bitmap\n");
r3289r3290
17241764
17251765
17261766/*-------------------------------------------------
1767    do_fixavdata - fix the AV metadata for an
1768    A/V file
1769-------------------------------------------------*/
1770
1771static int do_fixavdata(int argc, char *argv[], int param)
1772{
1773   int fps, fpsfrac, width, height, interlaced, channels, rate;
1774   av_codec_decompress_config avconfig = { 0 };
1775   bitmap_t *fullbitmap = NULL;
1776   const char *inputfile;
1777   UINT8 *vbidata = NULL;
1778   int writeable = FALSE;
1779   chd_file *chd = NULL;
1780   bitmap_t fakebitmap;
1781   char metadata[256];
1782   chd_header header;
1783   UINT32 actlength;
1784   UINT32 framenum;
1785   chd_error err;
1786   int fixframes = 0;
1787   int fixes = 0;
1788
1789   /* require 3 args total */
1790   if (argc != 3)
1791      return usage();
1792
1793   /* extract the data */
1794   inputfile = argv[2];
1795
1796   /* print some info */
1797   printf("Input file:   %s\n", inputfile);
1798
1799   /* get the header */
1800   err = chd_open(inputfile, CHD_OPEN_READ, NULL, &chd);
1801   if (err != CHDERR_NONE)
1802   {
1803      fprintf(stderr, "Error opening CHD file '%s': %s\n", inputfile, chd_error_string(err));
1804      goto cleanup;
1805   }
1806   header = *chd_get_header(chd);
1807
1808   /* get the metadata */
1809   err = chd_get_metadata(chd, AV_METADATA_TAG, 0, metadata, sizeof(metadata), NULL, NULL);
1810   if (err != CHDERR_NONE)
1811   {
1812      fprintf(stderr, "Error getting A/V metadata: %s\n", chd_error_string(err));
1813      goto cleanup;
1814   }
1815
1816   /* extract the info */
1817   if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7)
1818   {
1819      fprintf(stderr, "Improperly formatted metadata\n");
1820      err = CHDERR_INVALID_METADATA;
1821      goto cleanup;
1822   }
1823
1824   /* allocate space for the frame data */
1825   if ((height != 524/2 && height != 624/2) || !interlaced)
1826   {
1827      fprintf(stderr, "This file does not need VBI metadata\n");
1828      err = CHDERR_INVALID_METADATA;
1829      goto cleanup;
1830   }
1831
1832   /* allocate a video buffer */
1833   fullbitmap = bitmap_alloc(width, height, BITMAP_FORMAT_YUY16);
1834   if (fullbitmap ==  NULL)
1835   {
1836      fprintf(stderr, "Out of memory allocating temporary bitmap\n");
1837      err = CHDERR_OUT_OF_MEMORY;
1838      goto cleanup;
1839   }
1840   avconfig.video = &fakebitmap;
1841
1842   /* allocate memory for VBI data */
1843   vbidata = malloc(header.totalhunks * VBI_PACKED_BYTES);
1844   if (vbidata == NULL)
1845   {
1846      fprintf(stderr, "Out of memory allocating VBI data\n");
1847      err = CHDERR_OUT_OF_MEMORY;
1848      goto cleanup;
1849   }
1850
1851   /* read the metadata */
1852   err = chd_get_metadata(chd, AV_LD_METADATA_TAG, 0, vbidata, header.totalhunks * VBI_PACKED_BYTES, &actlength, NULL);
1853   if (err != CHDERR_NONE)
1854   {
1855      fprintf(stderr, "Error getting VBI metadata: %s\n", chd_error_string(err));
1856      memset(vbidata, 0, header.totalhunks * VBI_PACKED_BYTES);
1857      fixes++;
1858   }
1859   if (actlength != header.totalhunks * VBI_PACKED_BYTES)
1860   {
1861      fprintf(stderr, "VBI metadata incorrect size\n");
1862      memset(vbidata, 0, header.totalhunks * VBI_PACKED_BYTES);
1863      fixes++;
1864   }
1865
1866   /* loop over hunks, reading */
1867   for (framenum = 0; framenum < header.totalhunks; framenum++)
1868   {
1869      vbi_metadata origvbi;
1870      vbi_metadata vbi;
1871      UINT32 vbiframe;
1872
1873      /* progress */
1874      progress(framenum == 0, "Processing hunk %d/%d...  \r", framenum, header.totalhunks);
1875
1876      /* set up the fake bitmap for this frame */
1877      *avconfig.video = *fullbitmap;
1878
1879      /* configure the decompressor for this frame */
1880      chd_codec_config(chd, AV_CODEC_DECOMPRESS_CONFIG, &avconfig);
1881
1882      /* read the hunk into the buffers */
1883      err = chd_read(chd, framenum, NULL);
1884      if (err != CHDERR_NONE)
1885      {
1886         fprintf(stderr, "Error reading hunk %d from CHD file: %s\n", framenum, chd_error_string(err));
1887         goto cleanup;
1888      }
1889
1890      /* unpack the current data for this frame */
1891      vbi_metadata_unpack(&origvbi, &vbiframe, &vbidata[framenum * VBI_PACKED_BYTES]);
1892
1893      /* parse the video data */
1894      vbi_parse_all((const UINT16 *)avconfig.video->base, avconfig.video->rowpixels, avconfig.video->width, 8, &vbi);
1895
1896      /* verify the data */
1897      if (vbiframe != 0 || origvbi.white != 0 || origvbi.line16 != 0 || origvbi.line17 != 0 || origvbi.line18 != 0 || origvbi.line1718 != 0)
1898      {
1899         int errors = 0;
1900
1901         if (vbiframe != framenum)
1902         {
1903            fprintf(stderr, "%d:Frame mismatch in VBI data (%d, should be %d)\n", framenum, vbiframe, framenum);
1904            errors++;
1905         }
1906         if (vbi.white != origvbi.white)
1907         {
1908            fprintf(stderr, "%d:White flag mismatch in VBI data (%d, should be %d)\n", framenum, origvbi.white, vbi.white);
1909            errors++;
1910         }
1911         if (vbi.line16 != origvbi.line16)
1912         {
1913            fprintf(stderr, "%d:Line 16 mismatch in VBI data (%06X, should be %06X)\n", framenum, origvbi.line16, vbi.line16);
1914            errors++;
1915         }
1916         if (vbi.line17 != origvbi.line17)
1917         {
1918            fprintf(stderr, "%d:Line 17 mismatch in VBI data (%06X, should be %06X)\n", framenum, origvbi.line17, vbi.line17);
1919            errors++;
1920         }
1921         if (vbi.line18 != origvbi.line18)
1922         {
1923            fprintf(stderr, "%d:Line 18 mismatch in VBI data (%06X, should be %06X)\n", framenum, origvbi.line18, vbi.line18);
1924            errors++;
1925         }
1926         if (vbi.line1718 != origvbi.line1718)
1927         {
1928            fprintf(stderr, "%d:Line 17/18 mismatch in VBI data (%06X, should be %06X)\n", framenum, origvbi.line1718, vbi.line1718);
1929            errors++;
1930         }
1931         fixes += errors;
1932         fixframes += (errors != 0);
1933      }
1934
1935      /* pack the new data */
1936      vbi_metadata_pack(&vbidata[framenum * VBI_PACKED_BYTES], framenum, &vbi);
1937   }
1938   progress(TRUE, "Processing complete!                                     \n");
1939
1940   /* print final results */
1941   if (fixes == 0)
1942      printf("\nNo fixes required\n");
1943   else
1944      printf("\nFound %d errors on %d frames\n", fixes, fixframes);
1945
1946   /* close the drive */
1947   chd_close(chd);
1948   chd = NULL;
1949
1950   /* apply fixes */
1951   if (fixes > 0)
1952   {
1953      /* mark the CHD writeable */
1954      header.flags |= CHDFLAGS_IS_WRITEABLE;
1955      err = chd_set_header(inputfile, &header);
1956      if (err != CHDERR_NONE)
1957         fprintf(stderr, "Error writing new header: %s\n", chd_error_string(err));
1958      header.flags &= ~CHDFLAGS_IS_WRITEABLE;
1959      writeable = TRUE;
1960
1961      /* open the file */
1962      err = chd_open(inputfile, CHD_OPEN_READWRITE, NULL, &chd);
1963      if (err != CHDERR_NONE)
1964      {
1965         fprintf(stderr, "Error opening CHD file '%s': %s\n", inputfile, chd_error_string(err));
1966         goto cleanup;
1967      }
1968
1969      /* write new metadata */
1970      err = chd_set_metadata(chd, AV_LD_METADATA_TAG, 0, vbidata, header.totalhunks * VBI_PACKED_BYTES);
1971      if (err != CHDERR_NONE)
1972      {
1973         fprintf(stderr, "Error adding AVLD metadata: %s\n", chd_error_string(err));
1974         goto cleanup;
1975      }
1976      else
1977         printf("Updated metadata written successfully\n");
1978
1979      /* allow cleanup code to close the file and revert the header */
1980   }
1981
1982cleanup:
1983   /* clean up our mess */
1984   if (fullbitmap != NULL)
1985      bitmap_free(fullbitmap);
1986   if (vbidata != NULL)
1987      free(vbidata);
1988   if (chd != NULL)
1989      chd_close(chd);
1990   if (writeable)
1991      chd_set_header(inputfile, &header);
1992   return (err != CHDERR_NONE);
1993}
1994
1995
1996/*-------------------------------------------------
17271997    do_info - dump the header information from
17281998    a drive image
17291999-------------------------------------------------*/
r3289r3290
25352805      { "-info",         do_info, 0 },
25362806      { "-merge",         do_merge_update_chomp, OPERATION_MERGE },
25372807      { "-diff",         do_diff, 0 },
2538      { "-setchs",      do_setchs, 0 }
2808      { "-setchs",      do_setchs, 0 },
2809      { "-fixavdata",      do_fixavdata, 0 }
25392810   };
25402811   extern char build_version[];
25412812   int i;
src/emu/debug/debugcpu.c
r3289r3290
120120static UINT64 get_logunmap(void *ref);
121121static UINT64 get_beamx(void *ref);
122122static UINT64 get_beamy(void *ref);
123static UINT64 get_frame(void *ref);
123124static void set_tempvar(void *ref, UINT64 value);
124125static void set_logunmap(void *ref, UINT64 value);
125126static UINT64 get_current_pc(void *ref);
r3289r3290
200201   symtable_add_register(global_symtable, "logunmapi", (void *)ADDRESS_SPACE_IO, get_logunmap, set_logunmap);
201202   symtable_add_register(global_symtable, "beamx", NULL, get_beamx, NULL);
202203   symtable_add_register(global_symtable, "beamy", NULL, get_beamy, NULL);
204   symtable_add_register(global_symtable, "frame", NULL, get_frame, NULL);
203205
204206   /* add the temporary variables to the global symbol table */
205207   for (regnum = 0; regnum < NUM_TEMP_VARIABLES; regnum++)
r3289r3290
28162818
28172819
28182820/*-------------------------------------------------
2821    get_frame - get current frame number
2822-------------------------------------------------*/
2823
2824static UINT64 get_frame(void *ref)
2825{
2826   UINT64 ret = 0;
2827   const device_config *screen = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, 0);
2828
2829   if (screen != NULL)
2830      ret = video_screen_get_frame_number(screen);
2831
2832   return ret;
2833}
2834
2835
2836/*-------------------------------------------------
28192837    set_logunmap - setter callback for the logumap
28202838    symbols
28212839-------------------------------------------------*/
src/emu/cpu/mcs48/mcs48.c
r3289r3290
11141114      case CPUINFO_STR_CORE_CREDITS:                     strcpy(info->s, "Copyright Mirko Buffoni\nBased on the original work Copyright Dan Boris"); break;
11151115
11161116      case CPUINFO_STR_FLAGS:
1117         sprintf(info->s, "%c %c%c%c%c%c%c%c%c",
1118            mcs48.a11        ? 'M':'.',
1117         sprintf(info->s, "%c%c %c%c%c%c%c%c%c%c",
1118            mcs48.irq_state ? 'I':'.',
1119            mcs48.a11       ? 'M':'.',
11191120            PSW & 0x80 ? 'C':'.',
1120            PSW & 0x40 ? 'a':'.',
1121            PSW & 0x40 ? 'A':'.',
11211122            PSW & 0x20 ? 'F':'.',
11221123            PSW & 0x10 ? 'B':'.',
11231124            PSW & 0x08 ? '?':'.',
src/emu/cpu/mcs48/mcs48dsm.c
r3289r3290
278278         cp++;
279279         switch (*cp++)
280280         {
281            case 'A': sprintf(num,"$%04X",a); break;
282            case 'J': sprintf(num,"$%04X",((pc+1) & 0xf00) | a); break;
281            case 'A': sprintf(num,"$%03X",a); break;
282            case 'J': sprintf(num,"$%03X",((pc+1) & 0xf00) | a); break;
283283            case 'B': sprintf(num,"%d",b); break;
284284            case 'D': sprintf(num,"%d",d); break;
285285            case 'X': sprintf(num,"%X",d); break;
src/emu/memory.c
r3289r3290
861861   map = malloc_or_die(sizeof(*map));
862862   memset(map, 0, sizeof(*map));
863863
864   /* append the internal CPU map (first so it takes priority) */
865   if (internal_map != NULL)
866      address_map_detokenize(map, driver, internal_map);
867
864868   /* construct the standard map */
865869   if (config->cpu[cpunum].address_map[spacenum][0] != NULL)
866870      address_map_detokenize(map, driver, config->cpu[cpunum].address_map[spacenum][0]);
867871   if (config->cpu[cpunum].address_map[spacenum][1] != NULL)
868872      address_map_detokenize(map, driver, config->cpu[cpunum].address_map[spacenum][1]);
869873
870   /* append the internal CPU map (last so it can be overridden) */
871   if (internal_map != NULL)
872      address_map_detokenize(map, driver, internal_map);
873
874874   return map;
875875}
876876
r3289r3290
16751675         for (entrynum = 0; entrynum < ENTRY_COUNT; entrynum++)
16761676         {
16771677            space->read.handlers[entrynum].handler.generic = get_static_handler(space->dbits, 0, spacenum, entrynum);
1678            space->read.handlers[entrynum].object = machine;
16781679            space->write.handlers[entrynum].handler.generic = get_static_handler(space->dbits, 1, spacenum, entrynum);
1680            space->write.handlers[entrynum].object = machine;
16791681         }
16801682
16811683         /* make sure we fix up the mask for the unmap and watchpoint handlers */
src/emu/emu.mak
r3289r3290
165165   $(EMUMACHINE)/tmp68301.o \
166166   $(EMUMACHINE)/upd4701.o \
167167   $(EMUMACHINE)/wd33c93.o \
168   $(EMUMACHINE)/x2212.o \
168169   $(EMUMACHINE)/x76f041.o \
169170   $(EMUMACHINE)/x76f100.o \
170171   $(EMUMACHINE)/z80ctc.o \
src/emu/machine/ldpr8210.c
r3289r3290
77    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
10**************************************************************************
11
12    Still to do:
13
14        * add overlay properly (need capture)
15        * implement SLOW TRG
16        * figure out Simutrek without jump hack
17        * figure out serial protocol issues (current hack works nicely)
18        * determine actual slow/fast speeds
19
1020*************************************************************************/
1121
1222#include "ldcore.h"
r3289r3290
1828    DEBUGGING
1929***************************************************************************/
2030
21#define EMULATE_PR8210_ROM         0
31#define LOG_VBLANK_VBI            0
32#define LOG_SERIAL               0
33#define LOG_SIMUTREK            0
2234
23#define PRINTF_COMMANDS            1
24#define CMDPRINTF(x)            do { if (PRINTF_COMMANDS) mame_printf_debug x; } while (0)
2535
2636
27
2837/***************************************************************************
2938    CONSTANTS
3039***************************************************************************/
3140
32/* Player-specific states */
33enum
34{
35   LDSTATE_STEPPING_BY_PARAMETER = LDSTATE_OTHER,
36   LDSTATE_STEPPING_BY_PARAMETER_PAUSED
37};
38
3941/* Pioneer PR-8210 specific information */
40#define PR8210_SCAN_SPEED         (2000 / 30)         /* 2000 frames/second */
41#define PR8210_SCAN_DURATION      (10)            /* scan for 10 vsyncs each time */
42#define PR8210_SLOW_SPEED         (5)               /* 1/5x normal speed */
43#define PR8210_FAST_SPEED         (3)               /* 3x normal speed */
44#define PR8210_JUMP_REV_SPEED      (15)            /* 15x normal speed */
45#define PR8210_SEEK_FAST_SPEED      (1000)            /* 1000x normal speed */
42#define PR8210_SCAN_SPEED            (2000 / 30)         /* 2000 frames/second */
43#define PR8210_SEEK_FAST_SPEED         (4000 / 30)         /* 4000 frames/second */
4644
47/* Us vs. Them requires at least this much "non-video" time in order to work */
48#define PR8210_MINIMUM_SEEK_TIME   ATTOTIME_IN_MSEC(150)
45/* serial timing, mostly from the service manual, derived from the XTAL */
46#define PR8210_SERIAL_CLOCK            XTAL_455kHz
47#define PR8210_0_BIT_TIME            ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 512)
48#define PR8210_1_BIT_TIME            ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 1024)
49#define PR8210_MIDPOINT_TIME         ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 600)
50#define PR8210_MAX_WORD_TIME         ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 11520)
51#define PR8210_REJECT_DUPLICATE_TIME   ATTOTIME_IN_HZ(PR8210_SERIAL_CLOCK / 11520 / 4)
4952
5053
5154
r3289r3290
5356    TYPE DEFINITIONS
5457***************************************************************************/
5558
59/* PIA data */
60typedef struct _pioneer_pia pioneer_pia;
61struct _pioneer_pia
62{
63   UINT8            frame[7];            /* (20-26) 7 characters for the chapter/frame */
64   UINT8            text[15];            /* (22-30) 15 characters for the display */
65   UINT8            control;            /* (40) control lines */
66   UINT8            latchdisplay;         /*   flag: set if the display was latched */
67   UINT8            portb;               /* (60) port B value (LEDs) */
68   UINT8            display;            /* (80) display enable */
69   UINT8            porta;               /* (A0) port A value (from serial decoder) */
70   UINT8            vbi1;               /* (C0) VBI decoding state 1 */
71   UINT8            vbi2;               /* (E0) VBI decoding state 2 */
72};
73
74
75/* Simutrek-specific data */
76typedef struct _simutrek_data simutrek_data;
77struct _simutrek_data
78{
79   int               cpunum;               /* CPU index of the 8748 */
80   UINT8            audio_squelch;         /* audio squelch value */
81   UINT8            data;               /* parallel data for simutrek */
82   UINT8            data_ready;            /* ready flag for simutrek data */
83   UINT8            port2;               /* 8748 port 2 state */
84   UINT8            jumphack;
85};
86
87
5688/* player-specific data */
5789struct _ldplayer_data
5890{
59   /* general modes and states */
60   UINT8            audio1disable;         /* explicit disable for audio 1 */
61   UINT8            audio2disable;         /* explicit disable for audio 2 */
62   UINT8            framedisplay;         /* frame display */
63   INT32            parameter;            /* parameter for numbers */
64
6591   /* serial/command interface processing */
66   UINT8            lastcommand;         /* last command byte received */
67   UINT8            seekstate;            /* state of the seek command */
92   UINT8            lastcommand;         /* last command seen */
6893   UINT16            accumulator;         /* bit accumulator */
94   attotime         lastcommandtime;      /* time of the last command */
6995   attotime         lastbittime;         /* time of last bit received */
7096   attotime         firstbittime;         /* time of first bit in command */
7197
72   /* Simutrek-specific data */
73   UINT8            cmdcnt;               /* counter for multi-byte command */
74   UINT8            cmdbytes[3];         /* storage for multi-byte command */
75   void            (*cmd_ack_callback)(void); /* callback to clear game command write flag */
76
7798   /* low-level emulation data */
78   int               cpunum;
79   UINT8             pia[0x100];
80   UINT8            vsync;
81   UINT8             porta;
82   UINT8             portb;
83   UINT8             pia_porta;
84   UINT8             pia_portb;
99   int               cpunum;               /* CPU index of the 8049 */
100   attotime         slowtrg;            /* time of the last SLOW TRG */
101   pioneer_pia         pia;               /* PIA state */
102   UINT8            vsync;               /* live VSYNC state */
103   UINT8             port1;               /* 8049 port 1 state */
104   UINT8             port2;               /* 8049 port 2 state */
105
106   /* Simutrek-specific data */
107   simutrek_data      simutrek;            /* Simutrek-specific data */
85108};
86109
87110
r3289r3290
91114***************************************************************************/
92115
93116static void pr8210_init(laserdisc_state *ld);
94static void pr8210_soft_reset(laserdisc_state *ld);
95static void pr8210_update_squelch(laserdisc_state *ld);
96static int pr8210_switch_state(laserdisc_state *ld, UINT8 newstate, INT32 stateparam);
97static INT32 pr8210_hle_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
98#if (EMULATE_PR8210_ROM)
99static void pr8210_vsync(laserdisc_state *ld);
117static void pr8210_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
100118static INT32 pr8210_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
101#else
102static void pr8210_hle_command(laserdisc_state *ld);
103#endif
119static void pr8210_overlay(laserdisc_state *ld, bitmap_t *bitmap);
104120static void pr8210_control_w(laserdisc_state *ld, UINT8 prev, UINT8 data);
121static TIMER_CALLBACK( vsync_off );
122static TIMER_CALLBACK( vbi_data_fetch );
123static READ8_HANDLER( pr8210_pia_r );
124static WRITE8_HANDLER( pr8210_pia_w );
125static READ8_HANDLER( pr8210_bus_r );
126static WRITE8_HANDLER( pr8210_port1_w );
127static WRITE8_HANDLER( pr8210_port2_w );
128static READ8_HANDLER( pr8210_t0_r );
129static READ8_HANDLER( pr8210_t1_r );
105130
106131static void simutrek_init(laserdisc_state *ld);
132static void simutrek_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
133static INT32 simutrek_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
134static UINT8 simutrek_ready_r(laserdisc_state *ld);
107135static UINT8 simutrek_status_r(laserdisc_state *ld);
108136static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data);
137static TIMER_CALLBACK( simutrek_latched_data_w );
138static READ8_HANDLER( simutrek_port2_r );
139static WRITE8_HANDLER( simutrek_port2_w );
140static READ8_HANDLER( simutrek_data_r );
141static READ8_HANDLER( simutrek_t0_r );
109142
110143
111144
112145/***************************************************************************
113    ROM AND MACHINE INTERFACES
146    INLINE FUNCTIONS
114147***************************************************************************/
115148
116MACHINE_DRIVER_EXTERN( pr8210 );
149/*-------------------------------------------------
150    find_pr8210 - find our device; assumes there
151    is only one
152-------------------------------------------------*/
117153
118#if EMULATE_PR8210_ROM
154INLINE laserdisc_state *find_pr8210(running_machine *machine)
155{
156   return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC));
157}
158
159
160/*-------------------------------------------------
161    update_video_squelch - update the state of
162    the video squelch
163-------------------------------------------------*/
164
165INLINE void update_video_squelch(laserdisc_state *ld)
166{
167   ldplayer_data *player = ld->player;
168   ldcore_set_video_squelch(ld, (player->port1 & 0x20) != 0);
169}
170
171
172/*-------------------------------------------------
173    update_audio_squelch - update the state of
174    the audio squelch
175-------------------------------------------------*/
176
177INLINE void update_audio_squelch(laserdisc_state *ld)
178{
179   ldplayer_data *player = ld->player;
180   if (player->simutrek.cpunum == -1)
181      ldcore_set_audio_squelch(ld, (player->port1 & 0x40) || !(player->pia.portb & 0x01), (player->port1 & 0x40) || !(player->pia.portb & 0x02));
182   else
183      ldcore_set_audio_squelch(ld, player->simutrek.audio_squelch, player->simutrek.audio_squelch);
184}
185
186
187
188/***************************************************************************
189    PR-8210 ROM AND MACHINE INTERFACES
190***************************************************************************/
191
192static ADDRESS_MAP_START( pr8210_portmap, ADDRESS_SPACE_IO, 8 )
193   AM_RANGE(0x00, 0xff) AM_READWRITE(pr8210_pia_r, pr8210_pia_w)
194   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(pr8210_bus_r)
195   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(pr8210_port1_w)
196   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(pr8210_port2_w)
197   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(pr8210_t0_r)
198   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(pr8210_t1_r)
199ADDRESS_MAP_END
200
201
202static MACHINE_DRIVER_START( pr8210 )
203   MDRV_CPU_ADD("pr8210", I8049, XTAL_4_41MHz)
204   MDRV_CPU_IO_MAP(pr8210_portmap,0)
205MACHINE_DRIVER_END
206
207
119208ROM_START( pr8210 )
120209   ROM_REGION( 0x800, "pr8210", ROMREGION_LOADBYNAME )
121210   ROM_LOAD( "pr-8210_mcu_ud6005a.bin", 0x000, 0x800, CRC(120fa83b) SHA1(b514326ca1f52d6d89056868f9d17eabd4e3f31d) )
122211ROM_END
123#endif
124212
125213
126214
127215/***************************************************************************
128    INTERFACES
216    PR-8210 PLAYER INTERFACE
129217***************************************************************************/
130218
131219const ldplayer_interface pr8210_interface =
r3289r3290
133221   LASERDISC_TYPE_PIONEER_PR8210,            /* type of the player */
134222   sizeof(ldplayer_data),                  /* size of the state */
135223   "Pioneer PR-8210",                     /* name of the player */
136#if EMULATE_PR8210_ROM
137224   rom_pr8210,                           /* pointer to ROM region information */
138225   machine_config_pr8210,                  /* pointer to machine configuration */
139226   pr8210_init,                        /* initialization callback */
140227   pr8210_vsync,                        /* vsync callback */
141228   pr8210_update,                        /* update callback */
142#else
143   NULL,                              /* pointer to ROM region information */
144   NULL,                              /* pointer to machine configuration */
145   pr8210_init,                        /* initialization callback */
146   NULL,                              /* vsync callback */
147   pr8210_hle_update,                     /* update callback */
148#endif
229   pr8210_overlay,                        /* overlay callback */
149230   NULL,                              /* parallel data write */
150231   {                                 /* single line write: */
151232      NULL,                           /*    LASERDISC_LINE_ENTER */
r3289r3290
161242};
162243
163244
164const ldplayer_interface simutrek_interface =
165{
166   LASERDISC_TYPE_SIMUTREK_SPECIAL,         /* type of the player */
167   sizeof(ldplayer_data),                  /* size of the state */
168   "Simutrek Modified PR-8210",            /* name of the player */
169   NULL,                              /* pointer to ROM region information */
170   NULL,                              /* pointer to machine configuration */
171   simutrek_init,                        /* initialization callback */
172   NULL,                              /* vsync callback */
173   pr8210_hle_update,                     /* update callback */
174   simutrek_data_w,                     /* parallel data write */
175   {                                 /* single line write: */
176      NULL,                           /*    LASERDISC_LINE_ENTER */
177      NULL                           /*    LASERDISC_LINE_CONTROL */
178   },
179   NULL,                              /* parallel data read */
180   {                                 /* single line read: */
181      NULL,                           /*    LASERDISC_LINE_READY */
182      simutrek_status_r,                  /*    LASERDISC_LINE_STATUS */
183      NULL,                           /*    LASERDISC_LINE_COMMAND */
184      NULL,                           /*    LASERDISC_LINE_DATA_AVAIL */
185   }
186};
187245
188
189
190246/***************************************************************************
191    INLINE FUNCTIONS
192***************************************************************************/
193
194/*-------------------------------------------------
195    requires_state_save - returns TRUE if the
196    given state will return to the previous
197    state when done
198-------------------------------------------------*/
199
200INLINE int requires_state_save(UINT8 state)
201{
202   return (state == LDSTATE_SCANNING);
203}
204
205
206/*-------------------------------------------------
207    requires_state_save - returns TRUE if the
208    given state will return to the previous
209    state when done
210-------------------------------------------------*/
211
212INLINE void update_audio_squelch(laserdisc_state *ld)
213{
214   ldplayer_data *player = ld->player;
215   ldcore_set_audio_squelch(ld, (player->porta & 0x40) || !(player->pia_portb & 0x01), (player->porta & 0x40) || !(player->pia_portb & 0x02));
216}
217
218
219
220
221/***************************************************************************
222247    PIONEER PR-8210 IMPLEMENTATION
223248***************************************************************************/
224249
r3289r3290
230255static void pr8210_init(laserdisc_state *ld)
231256{
232257   astring *tempstring = astring_alloc();
258   attotime curtime = timer_get_time();
259   ldplayer_data *player = ld->player;
233260
234261   /* find our CPU */
235262   astring_printf(tempstring, "%s:%s", ld->device->tag, "pr8210");
236   ld->player->cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring));
263   player->cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring));
237264   astring_free(tempstring);
238265
239266   /* do a soft reset */
240   pr8210_soft_reset(ld);
241}
242
243
244/*-------------------------------------------------
245    pr8210_soft_reset - Pioneer PR-8210-specific
246    soft reset
247-------------------------------------------------*/
248
249static void pr8210_soft_reset(laserdisc_state *ld)
250{
251   ldplayer_data *player = ld->player;
252   attotime curtime = timer_get_time();
253
254   ld->state.state = LDSTATE_NONE;
255   ld->state.substate = 0;
256   ld->state.param = 0;
257   ld->state.endtime = curtime;
258
259   player->audio1disable = 0;
260   player->audio2disable = 0;
261   player->parameter = 0;
262
263267   player->lastcommand = 0;
264   player->seekstate = 0;
265268   player->accumulator = 0;
269   player->lastcommandtime = curtime;
266270   player->firstbittime = curtime;
267271   player->lastbittime = curtime;
272   player->slowtrg = curtime;
268273
269   pr8210_switch_state(ld, LDSTATE_PARKED, 0);
274   /* we don't have the Simutrek player overrides */
275   player->simutrek.cpunum = -1;
276   player->simutrek.audio_squelch = FALSE;
270277}
271278
272279
273280/*-------------------------------------------------
274    pr8210_update_squelch - update the squelch
275    settings based on the current state
281    pr8210_vsync - VSYNC callback, called at the
282    start of the blanking period
276283-------------------------------------------------*/
277284
278static void pr8210_update_squelch(laserdisc_state *ld)
285static void pr8210_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
279286{
280287   ldplayer_data *player = ld->player;
281288
282   switch (ld->state.state)
289   /* logging */
290   if (LOG_VBLANK_VBI)
283291   {
284      /* video on, audio on */
285      case LDSTATE_PLAYING:
286         ldcore_set_audio_squelch(ld, player->audio1disable, player->audio2disable);
287         ldcore_set_video_squelch(ld, FALSE);
288         break;
289
290      /* video on, audio off */
291      case LDSTATE_PAUSING:
292      case LDSTATE_PAUSED:
293      case LDSTATE_PLAYING_SLOW_REVERSE:
294      case LDSTATE_PLAYING_SLOW_FORWARD:
295      case LDSTATE_PLAYING_FAST_REVERSE:
296      case LDSTATE_PLAYING_FAST_FORWARD:
297      case LDSTATE_STEPPING_REVERSE:
298      case LDSTATE_STEPPING_FORWARD:
299      case LDSTATE_SCANNING:
300         ldcore_set_audio_squelch(ld, TRUE, TRUE);
301         ldcore_set_video_squelch(ld, FALSE);
302         break;
303
304      /* video off, audio off */
305      case LDSTATE_NONE:
306      case LDSTATE_EJECTED:
307      case LDSTATE_EJECTING:
308      case LDSTATE_PARKED:
309      case LDSTATE_LOADING:
310      case LDSTATE_SPINUP:
311      case LDSTATE_SEEKING:
312         ldcore_set_audio_squelch(ld, TRUE, TRUE);
313         ldcore_set_video_squelch(ld, TRUE);
314         break;
315
316      /* Simutrek: stepping by parameter with explicit audio squelch controls */
317      case LDSTATE_STEPPING_BY_PARAMETER:
318      case LDSTATE_STEPPING_BY_PARAMETER_PAUSED:
319         ldcore_set_video_squelch(ld, FALSE);
320         break;
292      if ((vbi->line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
293         printf("%3d:VSYNC(%d,%05d)\n", video_screen_get_vpos(ld->screen), fieldnum, VBI_CAV_PICTURE(vbi->line1718));
294      else
295         printf("%3d:VSYNC(%d)\n", video_screen_get_vpos(ld->screen), fieldnum);
321296   }
322}
323297
298   /* signal VSYNC and set a timer to turn it off */
299   player->vsync = TRUE;
300   timer_set(attotime_mul(video_screen_get_scan_period(ld->screen), 4), ld, 0, vsync_off);
324301
325/*-------------------------------------------------
326    pr8210_switch_state - attempt to switch states
327    if appropriate, and ensure the squelch values
328    are correct
329-------------------------------------------------*/
330
331static int pr8210_switch_state(laserdisc_state *ld, UINT8 newstate, INT32 parameter)
332{
333   attotime curtime = timer_get_time();
334
335   /* if this is the same state, ignore */
336   if (ld->state.state == newstate)
337      return TRUE;
338
339   /* if we're in a timed state, we ignore changes until the time elapses */
340   if (attotime_compare(curtime, ld->state.endtime) < 0)
341      return FALSE;
342
343   /* if moving to a state that requires it, save the old state */
344   if (requires_state_save(newstate) && !requires_state_save(ld->state.state))
345      ld->savestate = ld->state;
346
347   /* set up appropriate squelch and timing */
348   ld->state.state = newstate;
349   ld->state.substate = 0;
350   ld->state.param = parameter;
351   ld->state.endtime = curtime;
352   pr8210_update_squelch(ld);
353
354   /* if we're switching to a timed state, set the appropriate timer */
355   switch (ld->state.state)
356   {
357      case LDSTATE_EJECTING:
358         ld->state.endtime = attotime_add(curtime, GENERIC_EJECT_TIME);
359         break;
360
361      case LDSTATE_LOADING:
362         ld->state.endtime = attotime_add(curtime, GENERIC_LOAD_TIME);
363         break;
364
365      case LDSTATE_SPINUP:
366         ld->state.endtime = attotime_add(curtime, GENERIC_SPINUP_TIME);
367         break;
368
369      case LDSTATE_SEEKING:
370         ld->state.endtime = attotime_add(curtime, PR8210_MINIMUM_SEEK_TIME);
371         break;
372   }
373   return TRUE;
302   /* also set a timer to fetch the VBI data when it is ready */
303   timer_set(video_screen_get_time_until_pos(ld->screen, 19*2, 0), ld, 0, vbi_data_fetch);
374304}
375305
376306
377307/*-------------------------------------------------
378    pr8210_vsync - Start of VSYNC callback
308    pr8210_update - update callback, called on
309    the first visible line of the frame
379310-------------------------------------------------*/
380311
381#if (EMULATE_PR8210_ROM)
382static TIMER_CALLBACK( vsync_off )
383{
384   ldplayer_data *player = ptr;
385   player->vsync = FALSE;
386}
387
388static void pr8210_vsync(laserdisc_state *ld)
389{
390   ldplayer_data *player = ld->player;
391   player->vsync = TRUE;
392   timer_set(attotime_mul(video_screen_get_scan_period(ld->screen), 4), player, 0, vsync_off);
393}
394#endif
395
396
397/*-------------------------------------------------
398    pr8210_update - Pioneer PR-8210-specific
399    update callback when using a ROM
400-------------------------------------------------*/
401
402#if (EMULATE_PR8210_ROM)
403
404312static INT32 pr8210_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
405313{
406314   ldplayer_data *player = ld->player;
407   UINT8 focus_on = !(player->porta & 0x08);
408   UINT8 laser_on = !(player->portb & 0x01);
409   UINT8 spdl_on = !(player->porta & 0x10);
410   INT32 advanceby = 0;
411   int frame, chapter;
315   UINT8 spdl_on = !(player->port1 & 0x10);
412316
413   /* update PIA registers based on vbi code */
414   frame = frame_from_metadata(vbi);
415   chapter = chapter_from_metadata(vbi);
416   if (focus_on && laser_on && !(player->pia[0x80] & 1))
417   {
418      if (frame == FRAME_LEAD_IN)
419         player->pia[0xc0] = 0x10; /* or 0x12 */
420      else if (frame == FRAME_LEAD_OUT)
421         player->pia[0xc0] = 0x11;
422      else if (frame != FRAME_NOT_PRESENT)
423      {
424         player->pia[0xc0] = 0x02;   /* bit 0x02 must be set for forward scanning to work */
425         player->pia[0x22] = 0xf0 | ((frame / 10000) % 10);
426         player->pia[0x23] = 0xf0 | ((frame / 1000) % 10);
427         player->pia[0x24] = 0xf0 | ((frame / 100) % 10);
428         player->pia[0x25] = 0xf0 | ((frame / 10) % 10);
429         player->pia[0x26] = 0xf0 | ((frame / 1) % 10);
430printf("Frame:%05d\n", frame);
431      }
432      else if (chapter != CHAPTER_NOT_PRESENT)
433      {
434         player->pia[0xc0] = 0x13;
435         player->pia[0x20] = 0xf0 | ((chapter / 10) % 10);
436         player->pia[0x21] = 0xf0 | ((chapter / 1) % 10);
437      }
438//      else
439//          player->pia[0xc0] = 0x00;
440   }
441   player->pia[0xc0] |= 12;//4;//fieldnum << 2;
317   /* logging */
318   if (LOG_VBLANK_VBI)
319      printf("%3d:Update(%d)\n", video_screen_get_vpos(ld->screen), fieldnum);
442320
443   if (spdl_on)
444      advanceby = fieldnum;
445
446321   /* update overlay */
447   if ((player->pia[0x80] & 1) || player->framedisplay)
322   if (player->pia.display || player->pia.latchdisplay)
448323   {
449324      char buffer[16] = { 0 };
450325      int i;
451326      for (i = 0; i < 15; i++)
452327      {
453         UINT8 c = player->pia[0x22 + i];
328         UINT8 c = player->pia.text[i];
454329         if (c >= 0xf0 && c <= 0xf9)
455330            c = '0' + (c - 0xf0);
456331         else if (c < 0x20 || c > 0x7f)
r3289r3290
459334      }
460335      popmessage("%s", buffer);
461336   }
462   player->framedisplay = 0;
337   else
338      popmessage(NULL);
339   player->pia.latchdisplay = 0;
463340
464if (advanceby != 0)
465   printf("Advancing by %d\n", advanceby);
466   return advanceby;
341   /* if the spindle is on, we advance by 1 track after completing field #1 */
342   return (spdl_on) ? fieldnum : 0;
467343}
468#endif
469344
470345
471346/*-------------------------------------------------
472    pr8210_hle_update - Pioneer PR-8210-specific
473    update callback when using HLE
347    pr8210_overlay - overlay callback, called
348    during frame processing in update to overlay
349    player data
474350-------------------------------------------------*/
475351
476static INT32 pr8210_hle_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
352void pr8210_overlay(laserdisc_state *ld, bitmap_t *bitmap)
477353{
478   ldplayer_state newstate;
479   INT32 advanceby = 0;
480   int frame;
481
482   /* handle things based on the state */
483   switch (ld->state.state)
484   {
485      case LDSTATE_EJECTING:
486      case LDSTATE_EJECTED:
487      case LDSTATE_PARKED:
488      case LDSTATE_LOADING:
489      case LDSTATE_SPINUP:
490      case LDSTATE_PAUSING:
491      case LDSTATE_PAUSED:
492      case LDSTATE_PLAYING:
493      case LDSTATE_PLAYING_SLOW_REVERSE:
494      case LDSTATE_PLAYING_SLOW_FORWARD:
495      case LDSTATE_PLAYING_FAST_REVERSE:
496      case LDSTATE_PLAYING_FAST_FORWARD:
497      case LDSTATE_STEPPING_REVERSE:
498      case LDSTATE_STEPPING_FORWARD:
499      case LDSTATE_SCANNING:
500         /* generic behaviors are appropriate for all of these commands */
501         advanceby = ldcore_generic_update(ld, vbi, fieldnum, curtime, &newstate);
502         pr8210_switch_state(ld, newstate.state, newstate.param);
503         break;
504
505      case LDSTATE_SEEKING:
506         /* if we're in the final state, look for a matching frame and pause there */
507         frame = frame_from_metadata(vbi);
508         if (ld->state.substate == 3 && is_start_of_frame(vbi) && frame == ld->state.param)
509            pr8210_switch_state(ld, LDSTATE_PAUSED, fieldnum);
510
511         /* otherwise, if we got frame data from the VBI, update our seeking logic */
512         else if (ld->state.substate < 3 && frame != FRAME_NOT_PRESENT)
513         {
514            static const INT32 seekspeed[] = { -PR8210_SEEK_FAST_SPEED, PR8210_SEEK_FAST_SPEED, -PR8210_JUMP_REV_SPEED };
515            INT32 curseekspeed = seekspeed[ld->state.substate];
516            INT32 delta = (ld->state.param - 1) - frame;
517
518            if ((curseekspeed < 0 && delta <= 0) || (curseekspeed > 0 && delta >= 0))
519               advanceby = curseekspeed;
520            else
521               ld->state.substate++;
522         }
523
524         /* otherwise, keep advancing until we know what's up */
525         else if (fieldnum == 1)
526            advanceby = 1;
527         break;
528
529      case LDSTATE_STEPPING_BY_PARAMETER:
530         /* advance after the second field of each frame */
531         if (fieldnum == 1)
532         {
533            /* note that we switch directly to PAUSED as we are not looking for frames */
534            advanceby = ld->state.param;
535            pr8210_switch_state(ld, LDSTATE_STEPPING_BY_PARAMETER_PAUSED, 0);
536         }
537         break;
538
539      case LDSTATE_STEPPING_BY_PARAMETER_PAUSED:
540         /* generic pause behavior */
541         ld->state.state = LDSTATE_PAUSED;
542         advanceby = ldcore_generic_update(ld, vbi, fieldnum, curtime, &newstate);
543         if (newstate.state != LDSTATE_PAUSED)
544            pr8210_switch_state(ld, newstate.state, newstate.param);
545         else
546            ld->state.state = LDSTATE_STEPPING_BY_PARAMETER_PAUSED;
547         break;
548   }
549
550   return advanceby;
354//  ldplayer_data *player = ld->player;
551355}
552356
553357
554
555358/*-------------------------------------------------
556    pr8210_hle_command - Pioneer PR-8210-specific
557    command processing
558-------------------------------------------------*/
559
560#if (!EMULATE_PR8210_ROM)
561static void pr8210_hle_command(laserdisc_state *ld)
562{
563   ldplayer_data *player = ld->player;
564   UINT8 cmd = player->lastcommand;
565
566   switch (cmd)
567   {
568      case 0x00:   CMDPRINTF(("pr8210: EOC\n"));
569         /* EOC marker - can be safely ignored */
570         break;
571
572      case 0x01:   CMDPRINTF(("pr8210: 0\n"));
573         player->parameter = (player->parameter == -1) ? 0 : (player->parameter * 10 + 0);
574         break;
575
576      case 0x02:   CMDPRINTF(("pr8210: Slow reverse\n"));
577         pr8210_switch_state(ld, LDSTATE_PLAYING_SLOW_REVERSE, PR8210_SLOW_SPEED);
578         break;
579
580      case 0x03:   CMDPRINTF(("pr8210: 8\n"));
581         player->parameter = (player->parameter == -1) ? 8 : (player->parameter * 10 + 8);
582         break;
583
584      case 0x04:   CMDPRINTF(("pr8210: Step forward\n"));
585         pr8210_switch_state(ld, LDSTATE_STEPPING_FORWARD, 0);
586         break;
587
588      case 0x05:   CMDPRINTF(("pr8210: 4\n"));
589         player->parameter = (player->parameter == -1) ? 4 : (player->parameter * 10 + 4);
590         break;
591
592      case 0x06 :   CMDPRINTF(("pr8210: Chapter\n"));
593         /* chapter -- not implemented */
594         break;
595
596      case 0x08:   CMDPRINTF(("pr8210: Scan forward\n"));
597         if (ld->state.state != LDSTATE_SCANNING)
598            pr8210_switch_state(ld, LDSTATE_SCANNING, SCANNING_PARAM(PR8210_SCAN_SPEED, PR8210_SCAN_DURATION));
599         else
600            ld->state.substate = 0;
601         break;
602
603      case 0x09:   CMDPRINTF(("pr8210: 2\n"));
604         player->parameter = (player->parameter == -1) ? 2 : (player->parameter * 10 + 2);
605         break;
606
607      case 0x0a:   CMDPRINTF(("pr8210: Pause\n"));
608         pr8210_switch_state(ld, LDSTATE_PAUSING, 0);
609         break;
610
611      case 0x0b :   CMDPRINTF(("pr8210: Frame\n"));
612         /* frame -- not implemented */
613         break;
614
615      case 0x0c:   CMDPRINTF(("pr8210: Fast reverse\n"));
616         pr8210_switch_state(ld, LDSTATE_PLAYING_FAST_REVERSE, PR8210_FAST_SPEED);
617         break;
618
619      case 0x0d:   CMDPRINTF(("pr8210: 6\n"));
620         player->parameter = (player->parameter == -1) ? 6 : (player->parameter * 10 + 6);
621         break;
622
623      case 0x0e:   CMDPRINTF(("pr8210: Ch1 toggle\n"));
624         player->audio1disable = !player->audio1disable;
625         pr8210_update_squelch(ld);
626         break;
627
628      case 0x10:   CMDPRINTF(("pr8210: Fast forward\n"));
629         pr8210_switch_state(ld, LDSTATE_PLAYING_FAST_FORWARD, PR8210_FAST_SPEED);
630         break;
631
632      case 0x11:   CMDPRINTF(("pr8210: 1\n"));
633         player->parameter = (player->parameter == -1) ? 1 : (player->parameter * 10 + 1);
634         break;
635
636      case 0x12:   CMDPRINTF(("pr8210: Step reverse\n"));
637         pr8210_switch_state(ld, LDSTATE_STEPPING_REVERSE, 0);
638         break;
639
640      case 0x13:   CMDPRINTF(("pr8210: 9\n"));
641         player->parameter = (player->parameter == -1) ? 9 : (player->parameter * 10 + 9);
642         break;
643
644      case 0x14:  CMDPRINTF(("pr8210: Play\n"));
645         if (ld->state.state == LDSTATE_EJECTED)
646            pr8210_switch_state(ld, LDSTATE_LOADING, 0);
647         else if (ld->state.state == LDSTATE_PARKED)
648            pr8210_switch_state(ld, LDSTATE_SPINUP, 0);
649         else
650            pr8210_switch_state(ld, LDSTATE_PLAYING, 0);
651         break;
652
653      case 0x15:   CMDPRINTF(("pr8210: 5\n"));
654         player->parameter = (player->parameter == -1) ? 5 : (player->parameter * 10 + 5);
655         break;
656
657      case 0x16:   CMDPRINTF(("pr8210: Ch2 toggle\n"));
658         player->audio2disable = !player->audio2disable;
659         pr8210_update_squelch(ld);
660         break;
661
662      case 0x18:   CMDPRINTF(("pr8210: Slow forward\n"));
663         pr8210_switch_state(ld, LDSTATE_PLAYING_SLOW_FORWARD, PR8210_SLOW_SPEED);
664         break;
665
666      case 0x19:   CMDPRINTF(("pr8210: 3\n"));
667         player->parameter = (player->parameter == -1) ? 3 : (player->parameter * 10 + 3);
668         break;
669
670      case 0x1a:   CMDPRINTF(("pr8210: Seek\n"));
671         if (player->seekstate)
672         {
673            /* we're ready to seek */
674            CMDPRINTF(("pr8210: Seeking to frame %d\n", player->parameter));
675            pr8210_switch_state(ld, LDSTATE_SEEKING, player->parameter);
676         }
677         else
678         {
679            /* waiting for digits indicating position */
680            player->parameter = 0;
681         }
682         player->seekstate ^= 1;
683         break;
684
685      case 0x1c:   CMDPRINTF(("pr8210: Scan reverse\n"));
686         if (ld->state.state != LDSTATE_SCANNING)
687            pr8210_switch_state(ld, LDSTATE_SCANNING, SCANNING_PARAM(-PR8210_SCAN_SPEED, PR8210_SCAN_DURATION));
688         else
689            ld->state.substate = 0;
690         break;
691
692      case 0x1d:   CMDPRINTF(("pr8210: 7\n"));
693         player->parameter = (player->parameter == -1) ? 7 : (player->parameter * 10 + 7);
694         break;
695
696      case 0x1e:   CMDPRINTF(("pr8210: Reject\n"));
697         pr8210_switch_state(ld, LDSTATE_EJECTING, 0);
698         break;
699
700      default:   CMDPRINTF(("pr8210: Unknown command %02X\n", cmd));
701         break;
702   }
703}
704#endif
705
706
707/*-------------------------------------------------
708359    pr8210_control_w - write callback when the
709360    CONTROL line is toggled
710361-------------------------------------------------*/
r3289r3290
713364{
714365   ldplayer_data *player = ld->player;
715366
716   if (data == ASSERT_LINE)
367   /* handle rising edge */
368   if (prev != ASSERT_LINE && data == ASSERT_LINE)
717369   {
718370      attotime curtime = timer_get_time();
719371      attotime delta;
720372      int longpulse;
721373
722      /* if we timed out, reset the accumulator */
374      /* if we timed out since the first bit, reset the accumulator */
723375      delta = attotime_sub(curtime, player->firstbittime);
724      if (delta.attoseconds > ATTOTIME_IN_USEC(25320).attoseconds)
376      if (attotime_compare(delta, PR8210_MAX_WORD_TIME) > 0)
725377      {
726378         player->firstbittime = curtime;
727379         player->accumulator = 0x5555;
728//          printf("Reset accumulator\n");
380         if (LOG_SERIAL)
381            printf("Reset accumulator\n");
729382      }
730383
731384      /* get the time difference from the last assert */
r3289r3290
734387      player->lastbittime = curtime;
735388
736389      /* 0 bit delta is 1.05 msec, 1 bit delta is 2.11 msec */
737      longpulse = (delta.attoseconds < ATTOTIME_IN_USEC(1500).attoseconds) ? 0 : 1;
390      longpulse = (attotime_compare(delta, PR8210_MIDPOINT_TIME) < 0) ? 0 : 1;
738391      player->accumulator = (player->accumulator << 1) | longpulse;
739392
740#if 0
393      /* log the deltas for debugging */
394      if (LOG_SERIAL)
741395      {
742396         int usecdiff = (int)(delta.attoseconds / ATTOSECONDS_IN_USEC(1));
743397         printf("bitdelta = %5d (%d) - accum = %04X\n", usecdiff, longpulse, player->accumulator);
744398      }
745#endif
746399
747400      /* if we have a complete command, signal it */
748401      /* a complete command is 0,0,1 followed by 5 bits, followed by 0,0 */
749402      if ((player->accumulator & 0x383) == 0x80)
750403      {
751404         UINT8 newcommand = (player->accumulator >> 2) & 0x1f;
405         attotime rejectuntil;
752406
753//printf("New command = %02X (last=%02X)\n", newcommand, player->lastcommand);
407         /* data is stored to the PIA in bit-reverse order */
408         player->pia.porta = BITSWAP8(newcommand, 0,1,2,3,4,5,6,7);
754409
755#if EMULATE_PR8210_ROM
756         printf("Command = %02X\n", newcommand);
757//          player->pia_porta = BITSWAP8(newcommand, 4,3,2,1,0,5,6,7);
758         player->pia_porta = BITSWAP8(newcommand, 0,1,2,3,4,5,6,7);
759#else
760         /* if we got a double command, act on it */
761         if (newcommand == player->lastcommand)
410         /* the MCU logic requires a 0 to execute many commands; however, nobody
411               consistently sends a 0, whereas they do tend to send duplicate commands...
412               if we assume that each duplicate causes a 0, we get the correct results */
413         rejectuntil = attotime_add(player->lastcommandtime, PR8210_REJECT_DUPLICATE_TIME);
414         player->lastcommandtime = curtime;
415         if (player->pia.porta == player->lastcommand && attotime_compare(curtime, rejectuntil) < 0)
416            player->pia.porta = 0x00;
417         else
418            player->lastcommand = player->pia.porta;
419
420         /* log the command and wait for a keypress */
421         if (LOG_SERIAL)
762422         {
763            pr8210_hle_command(ld);
764            player->lastcommand = 0;
423            printf("--- Command = %02X\n", player->pia.porta >> 3);
424            while (input_code_pressed(KEYCODE_ENTER)) ;
425            while (!input_code_pressed(KEYCODE_ENTER)) ;
765426         }
766         else
767            player->lastcommand = newcommand;
768#endif
427
428         /* reset the first bit time so that the accumulator clears on the next write */
429         player->firstbittime = attotime_sub(curtime, PR8210_MAX_WORD_TIME);
769430      }
770431   }
771432}
772433
773434
774
775/***************************************************************************
776    SIMUTREK MODIFIED PR-8210 PLAYER IMPLEMENTATION
777***************************************************************************/
778
779435/*-------------------------------------------------
780
781    Command Set:
782
783    FX XX XX  : Seek to frame XXXXX
784    01-19     : Skip forward 1-19 frames
785    99-81     : Skip back 1-19 frames
786    5a        : Toggle frame display
787
436    vsync_off - timer callback to clear the VSYNC
437    flag
788438-------------------------------------------------*/
789439
790/*-------------------------------------------------
791    simutrek_init - Simutrek-specific
792    initialization
793-------------------------------------------------*/
794
795static void simutrek_init(laserdisc_state *ld)
440static TIMER_CALLBACK( vsync_off )
796441{
797   /* do a soft reset */
798   pr8210_soft_reset(ld);
442   laserdisc_state *ld = ptr;
443   ld->player->vsync = FALSE;
799444}
800445
801446
802447/*-------------------------------------------------
803    simutrek_status_r - Simutrek-specific
804    command processing
448    vbi_data_fetch - timer callback to update the
449    VBI data in the PIA as soon as it is ready;
450    this must happy early in the frame because
451    the player logic relies on fetching it here
805452-------------------------------------------------*/
806453
807static UINT8 simutrek_status_r(laserdisc_state *ld)
454static TIMER_CALLBACK( vbi_data_fetch )
808455{
809   return (ld->state.state != LDSTATE_SEEKING) ? ASSERT_LINE : CLEAR_LINE;
456   laserdisc_state *ld = ptr;
457   ldplayer_data *player = ld->player;
458   UINT8 focus_on = !(player->port1 & 0x08);
459   UINT8 laser_on = !(player->port2 & 0x01);
460   UINT32 line16 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE16);
461   UINT32 line1718 = laserdisc_get_field_code(ld->device, LASERDISC_CODE_LINE1718);
462
463   /* logging */
464   if (LOG_VBLANK_VBI)
465   {
466      if ((line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
467         printf("%3d:VBI(%05d)\n", video_screen_get_vpos(ld->screen), VBI_CAV_PICTURE(line1718));
468      else
469         printf("%3d:VBI()\n", video_screen_get_vpos(ld->screen));
470   }
471
472   /* update PIA registers based on vbi code */
473   player->pia.vbi1 = 0xff;
474   player->pia.vbi2 = 0xff;
475   if (focus_on && laser_on)
476   {
477      if (line1718 == VBI_CODE_LEADIN)
478         player->pia.vbi1 &= ~0x01;
479      if (line1718 == VBI_CODE_LEADOUT)
480         player->pia.vbi1 &= ~0x02;
481      if (line16 == VBI_CODE_STOP)
482         player->pia.vbi1 &= ~0x04;
483      /* unsure what this bit means: player->pia.vbi1 &= ~0x08; */
484      if ((line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
485      {
486         player->pia.vbi1 &= ~0x10;
487         player->pia.frame[2] = 0xf0 | ((line1718 >> 16) & 0x07);
488         player->pia.frame[3] = 0xf0 | ((line1718 >> 12) & 0x0f);
489         player->pia.frame[4] = 0xf0 | ((line1718 >>  8) & 0x0f);
490         player->pia.frame[5] = 0xf0 | ((line1718 >>  4) & 0x0f);
491         player->pia.frame[6] = 0xf0 | ((line1718 >>  0) & 0x0f);
492      }
493      if ((line1718 & VBI_MASK_CHAPTER) == VBI_CODE_CHAPTER)
494      {
495         player->pia.vbi2 &= ~0x01;
496         player->pia.frame[0] = 0xf0 | ((line1718 >> 16) & 0x07);
497         player->pia.frame[1] = 0xf0 | ((line1718 >> 12) & 0x0f);
498      }
499   }
810500}
811501
812502
813503/*-------------------------------------------------
814    simutrek_data_w - Simutrek-specific
815    data processing
504    pr8210_pia_r - handle reads from the mystery
505    Pioneer PIA
816506-------------------------------------------------*/
817507
818static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
508static READ8_HANDLER( pr8210_pia_r )
819509{
510   laserdisc_state *ld = find_pr8210(machine);
820511   ldplayer_data *player = ld->player;
512   UINT8 result = 0xff;
821513
822   /* Acknowledge every command byte */
823   if (player->cmd_ack_callback != NULL)
824      (*player->cmd_ack_callback)();
825
826   /* Is this byte part of a multi-byte seek command? */
827   if (player->cmdcnt > 0)
514   switch (offset)
828515   {
829      CMDPRINTF(("Simutrek: Seek to frame byte %d of 3\n", player->cmdcnt + 1));
830      player->cmdbytes[player->cmdcnt++] = data;
516      /* (20-26) 7 characters for the chapter/frame */
517      case 0x20:   case 0x21:
518      case 0x22:   case 0x23:   case 0x24:   case 0x25:   case 0x26:
519         result = player->pia.frame[offset - 0x20];
520         break;
831521
832      if (player->cmdcnt == 3)
833      {
834         player->parameter = ((player->cmdbytes[0] & 0xf) * 10000) +
835                        ((player->cmdbytes[1] >> 4)  * 1000) +
836                        ((player->cmdbytes[1] & 0xf) * 100) +
837                        ((player->cmdbytes[2] >> 4)  * 10) +
838                        (player->cmdbytes[2] & 0xf);
522      /* (A0) port A value (from serial decoder) */
523      case 0xa0:
524         result = player->pia.porta;
525         break;
839526
840         CMDPRINTF(("Simutrek: Seek to frame %d\n", player->parameter));
527      /* (C0) VBI decoding state 1 */
528      case 0xc0:
529         if (LOG_VBLANK_VBI)
530            printf("%3d:PIA(C0)\n", video_screen_get_vpos(ld->screen));
531         result = player->pia.vbi1;
532         break;
841533
842         pr8210_switch_state(ld, LDSTATE_SEEKING, player->parameter);
843         player->cmdcnt = 0;
844      }
534      /* (E0) VBI decoding state 2 */
535      case 0xe0:
536         if (LOG_VBLANK_VBI)
537            printf("%3d:PIA(E0)\n", video_screen_get_vpos(ld->screen));
538         result = player->pia.vbi2;
539         break;
540
541      default:
542         mame_printf_debug("%03X:Unknown PR-8210 PIA read from offset %02X\n", activecpu_get_pc(), offset);
543         break;
845544   }
846   else if (data == 0)
847   {
848      CMDPRINTF(("Simutrek: 0 ?\n"));
849   }
850   else if ((data & 0xf0) == 0xf0)
851   {
852      CMDPRINTF(("Simutrek: Seek to frame byte 1 of 3\n"));
853      player->cmdbytes[player->cmdcnt++] = data;
854   }
855   else if (data >= 1 && data <= 0x19)
856   {
857      int count = ((data >> 4) * 10) + (data & 0xf);
858      CMDPRINTF(("Simutrek: Step forwards by %d frame(s)\n", count));
859      pr8210_switch_state(ld, LDSTATE_STEPPING_BY_PARAMETER, count);
860   }
861   else if (data >= 0x81 && data <= 0x99)
862   {
863      int count = (((data >> 4) * 10) + (data & 0xf)) - 100;
864      CMDPRINTF(("Simutrek: Step backwards by %d frame(s)\n", count));
865      pr8210_switch_state(ld, LDSTATE_STEPPING_BY_PARAMETER, count);
866   }
867   else if (data == 0x5a)
868   {
869      CMDPRINTF(("Simutrek: Frame window toggle\n"));
870      player->framedisplay ^= 1;
871   }
872   else
873   {
874      CMDPRINTF(("Simutrek: Unknown command (%.2x)\n", data));
875   }
545   return result;
876546}
877547
878548
879549/*-------------------------------------------------
880    simutrek_set_audio_squelch - Simutrek-specific
881    command to enable/disable audio squelch
550    pr8210_pia_w - handle writes to the mystery
551    Pioneer PIA
882552-------------------------------------------------*/
883553
884void simutrek_set_audio_squelch(const device_config *device, int state)
554static WRITE8_HANDLER( pr8210_pia_w )
885555{
886   laserdisc_state *ld = ldcore_get_safe_token(device);
887   int squelch = (state == 0);
888   if (squelch)
889      ldcore_set_audio_squelch(ld, squelch, squelch);
890   else
891      ldcore_set_audio_squelch(ld, squelch, squelch);
892}
893
894
895/*-------------------------------------------------
896    simutrek_set_audio_squelch - Simutrek-specific
897    command to set callback function for
898    player/interface command acknowledge
899-------------------------------------------------*/
900
901void simutrek_set_cmd_ack_callback(const device_config *device, void (*callback)(void))
902{
903   laserdisc_state *ld = ldcore_get_safe_token(device);
556   laserdisc_state *ld = find_pr8210(machine);
904557   ldplayer_data *player = ld->player;
558   UINT8 value;
905559
906   player->cmd_ack_callback = callback;
907}
560   switch (offset)
561   {
562      /* (22-30) 15 characters for the display */
563      case 0x22:   case 0x23:   case 0x24:   case 0x25:   case 0x26:
564      case 0x27:   case 0x28:   case 0x29:   case 0x2a:   case 0x2b:
565      case 0x2c:   case 0x2d:   case 0x2e:   case 0x2f:   case 0x30:
566         player->pia.text[offset - 0x22] = data;
567         break;
908568
569      /* (40) control lines */
570      case 0x40:
909571
572         /* toggle bit 0 to latch chapter number into display area */
573         if (!(data & 0x01) && (player->pia.control & 0x01))
574         {
575            memcpy(&player->pia.text[0], &player->pia.frame[0], 2);
576            memset(&player->pia.text[3], 0, 10);
577            player->pia.latchdisplay = 1;
578         }
910579
911/***************************************************************************
912    RE-IMPLEMENTATION USING ACTUAL ROMS
913***************************************************************************/
580         /* toggle bit 1 to latch frame number into display area */
581         if (!(data & 0x02) && (player->pia.control & 0x02))
582         {
583            memcpy(&player->pia.text[0], &player->pia.frame[2], 5);
584            memset(&player->pia.text[5], 0, 10);
585            player->pia.latchdisplay = 1;
586         }
587         player->pia.control = data;
588         break;
914589
915/*************************************
916 *
917 *  Test PR-8210 ROM emulation
918 *
919 *************************************/
590      /* (60) port B value (LEDs) */
591      case 0x60:
920592
921static laserdisc_state *find_pr8210(running_machine *machine)
922{
923   return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC));
924}
593         /* these 4 are direct-connect */
594         output_set_value("pr8210_audio1", (data & 0x01) != 0);
595         output_set_value("pr8210_audio2", (data & 0x02) != 0);
596         output_set_value("pr8210_clv", (data & 0x04) != 0);
597         output_set_value("pr8210_cav", (data & 0x08) != 0);
925598
599         /* remaining 3 bits select one of 5 LEDs via a mux */
600         value = ((data & 0x40) >> 6) | ((data & 0x20) >> 4) | ((data & 0x10) >> 2);
601         output_set_value("pr8210_srev", (value == 0));
602         output_set_value("pr8210_sfwd", (value == 1));
603         output_set_value("pr8210_play", (value == 2));
604         output_set_value("pr8210_step", (value == 3));
605         output_set_value("pr8210_pause", (value == 4));
926606
927static READ8_HANDLER( pr8210_pia_r )
928{
929   laserdisc_state *ld = find_pr8210(machine);
930   ldplayer_data *player = ld->player;
931   UINT8 result = player->pia[offset];
932   switch (offset)
933   {
934      case 0x22:
935      case 0x23:
936      case 0x24:
937      case 0x25:
938      case 0x26:
939      case 0x27:
940      case 0xc0:
941      case 0xe0:
607         player->pia.portb = data;
608         update_audio_squelch(ld);
942609         break;
943610
944      case 0xa0:
945//          printf("%03X:pia_r(%02X) = %02X\n", activecpu_get_pc(), offset, player->pia_porta);
946         result = player->pia_porta;
947//          player->pia_porta = 0;
611      /* (80) display enable */
612      case 0x80:
613         player->pia.display = data & 0x01;
948614         break;
949615
616      /* no other writes known */
950617      default:
951         printf("%03X:pia_r(%02X)\n", activecpu_get_pc(), offset);
618         mame_printf_debug("%03X:Unknown PR-8210 PIA write to offset %02X = %02X\n", activecpu_get_pc(), offset, data);
952619         break;
953620   }
954   return result;
955621}
956622
957static WRITE8_HANDLER( pr8210_pia_w )
958{
959   /*
960       $22-26 (R) = read and copied to memory $23-27
961       $23 (R) = something compared against $F4
962       $22-26 (W) = SRCH. text
963       $27-2B (W) = FRAME/CHAP. text
964       $2C-30 (W) = frame or chapter number
965       $40 (W) = $CF at initialization, tracked by ($78)
966       $60 (W) = port B output, tracked by ($77)
967           $80 = n/c
968           $40 = (out) LED3
969           $20 = (out) LED2
970           $10 = (out) LED1
971                    123 -> LHL = Play
972                        -> HLL = Slow fwd
973                        -> LLL = Slow rev
974                        -> HHL = Still
975                        -> LLH = Pause
976                        -> HHH = all off
977           $08 = (out) CAV LED
978           $04 = (out) CLV LED
979           $02 = (out) A2 LED/AUDIO 2
980           $01 = (out) A1 LED/AUDIO 1
981       $80 (W) = 0 or 1
982       $A0 (R) = port A input
983       $C0 (R) = stored to ($2E)
984       $E0 (R) = stored to ($2F)
985    */
986   laserdisc_state *ld = find_pr8210(machine);
987   ldplayer_data *player = ld->player;
988   if (player->pia[offset] != data)
989   {
990      switch (offset)
991      {
992         case 0x40:
993            if (!(data & 0x02) && (player->pia[offset] & 0x02))
994               player->framedisplay = 1;
995            printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data);
996            break;
997623
998         case 0x60:
999            printf("%03X:pia_w(%02X) = %02X (PORT B LEDS:", activecpu_get_pc(), offset, data);
1000            output_set_value("pr8210_audio1", (data & 0x01) != 0);
1001            output_set_value("pr8210_audio2", (data & 0x02) != 0);
1002            output_set_value("pr8210_clv", (data & 0x04) != 0);
1003            output_set_value("pr8210_cav", (data & 0x08) != 0);
1004            output_set_value("pr8210_led1", (data & 0x10) == 0);
1005            output_set_value("pr8210_led2", (data & 0x20) == 0);
1006            output_set_value("pr8210_led3", (data & 0x40) == 0);
1007            if (!(data & 0x80)) printf(" ???");
1008            printf(")\n");
1009            player->pia_portb = data;
1010            update_audio_squelch(ld);
1011            break;
624/*-------------------------------------------------
625    pr8210_bus_r - handle reads from the 8049 BUS
626    input, which is enabled via the PIA above
627-------------------------------------------------*/
1012628
1013         default:
1014            printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data);
1015            break;
1016      }
1017      player->pia[offset] = data;
1018   }
1019}
1020
1021629static READ8_HANDLER( pr8210_bus_r )
1022630{
1023631   /*
r3289r3290
1033641   laserdisc_state *ld = find_pr8210(machine);
1034642   ldplayer_data *player = ld->player;
1035643   slider_position sliderpos = ldcore_get_slider_position(ld);
1036   UINT8 focus_on = !(player->porta & 0x08);
1037   UINT8 spdl_on = !(player->porta & 0x10);
644   UINT8 focus_on = !(player->port1 & 0x08);
645   UINT8 spdl_on = !(player->port1 & 0x10);
1038646   UINT8 result = 0x00;
1039647
1040648   /* bus bit 6: slider position limit detector, inside and outside */
r3289r3290
1053661   if (!spdl_on)
1054662      result |= 0x02;
1055663
664   /* bus bit 0: SLOW TIMER OUT */
665//  if (attotime_compare(attotime_sub(timer_get_time(), player->slowtrg),
666
1056667   /* loop at beginning waits for $40=0, $02=1 */
1057668   return result;
1058669}
1059670
1060static WRITE8_HANDLER( pr8210_porta_w )
671
672/*-------------------------------------------------
673    pr8210_port1_w - handle writes to the 8049
674    port #1
675-------------------------------------------------*/
676
677static WRITE8_HANDLER( pr8210_port1_w )
1061678{
1062679   /*
1063680       $80 = (out) SCAN C (F/R)
r3289r3290
1071688    */
1072689   laserdisc_state *ld = find_pr8210(machine);
1073690   ldplayer_data *player = ld->player;
1074   if ((data & 0xfe) != (player->porta & 0xfe))
1075   {
1076      int direction = (data & 0x80) ? 1 : -1;
691   UINT8 prev = player->port1;
692   int direction;
1077693
1078      printf("%03X:porta_w = %02X", activecpu_get_pc(), data);
1079      if (!(data & 0x01) && (player->porta & 0x01))
1080         ldcore_advance_slider(ld, direction);
1081      if (!(data & 0x02))
1082         printf(" SCAN:%c:%c", (data & 0x80) ? 'F' : 'R', (data & 0x04) ? 'L' : 'H');
1083      if (!(data & 0x08)) printf(" /FOCUSON");
1084      if (!(data & 0x10)) printf(" /SPDLON");
1085      if (data & 0x20) printf(" VIDEOSQ");
1086      if (data & 0x40) printf(" AUDIOSQ");
1087      printf("\n");
1088      player->porta = data;
694   /* set the new value */
695   player->port1 = data;
1089696
1090      ldcore_set_video_squelch(ld, (data & 0x20) != 0);
1091      update_audio_squelch(ld);
1092      if (!(data & 0x02))
697   /* bit 7 selects the direction of slider movement for JUMP TRG and scanning */
698   direction = (data & 0x80) ? 1 : -1;
699
700   /* on the falling edge of bit 0, jump one track in either direction */
701   if (!(data & 0x01) && (prev & 0x01))
702   {
703      /* special override for the Simutrek, which takes over control of this is some situations */
704      if (player->simutrek.cpunum == -1 || (player->simutrek.port2 & 0x04) != 0 || player->simutrek.jumphack)
1093705      {
1094         int delta = (data & 0x04) ? PR8210_SCAN_SPEED : PR8210_SEEK_FAST_SPEED;
1095         ldcore_set_slider_speed(ld, delta * direction);
706         if (LOG_SIMUTREK)
707            printf("%3d:JUMP TRG\n", video_screen_get_vpos(ld->screen));
708         ldcore_advance_slider(ld, direction);
709         player->simutrek.jumphack = 0;
1096710      }
1097      else
1098         ldcore_set_slider_speed(ld, 0);
711      else if (LOG_SIMUTREK)
712         printf("%3d:Skipped JUMP TRG\n", video_screen_get_vpos(ld->screen));
1099713   }
714
715   /* bit 1 low enables scanning */
716   if (!(data & 0x02))
717   {
718      /* bit 2 selects the speed */
719      int delta = (data & 0x04) ? PR8210_SCAN_SPEED : PR8210_SEEK_FAST_SPEED;
720      ldcore_set_slider_speed(ld, delta * direction);
721   }
722
723   /* bit 1 high stops scanning */
724   else
725      ldcore_set_slider_speed(ld, 0);
726
727   /* video squelch is controlled by bit 5 */
728   update_video_squelch(ld);
729
730   /* audio squelch is controlled by bit 6 */
731   update_audio_squelch(ld);
1100732}
1101733
1102static WRITE8_HANDLER( pr8210_portb_w )
734
735/*-------------------------------------------------
736    pr8210_port2_w - handle writes to the 8049
737    port #2
738-------------------------------------------------*/
739
740static WRITE8_HANDLER( pr8210_port2_w )
1103741{
1104742   /*
1105743       $80 = (out) /CS on PIA
r3289r3290
1113751    */
1114752   laserdisc_state *ld = find_pr8210(machine);
1115753   ldplayer_data *player = ld->player;
1116   cpunum_set_input_line(machine, player->cpunum, 0, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
1117   if ((data & 0x7f) != (player->portb & 0x7f))
1118   {
1119      printf("%03X:portb_w = %02X", activecpu_get_pc(), data);
1120      if (!(data & 0x01)) printf(" LASERON");
1121      if (!(data & 0x02)) printf(" ???");
1122      if (!(data & 0x04)) printf(" TP1");
1123      if (!(data & 0x08)) printf(" TP2");
1124      output_set_value("pr8210_standby", !(data & 0x10));
1125      if (!(data & 0x20)) printf(" SLOWTRG");
1126      if (!(data & 0x40)) printf(" IRQGEN");
1127//      if (data & 0x80) printf(" PIASEL");
1128      printf("\n");
1129      player->portb = data;
1130   }
754   UINT8 prev = player->port2;
755
756   /* set the new value */
757   player->port2 = data;
758
759   /* on the falling edge of bit 5, start the slow timer */
760   if (!(data & 0x20) && (prev & 0x20))
761      player->slowtrg = timer_get_time();
762
763   /* bit 6 when low triggers an IRQ on the MCU */
764   cpunum_set_input_line(machine, player->cpunum, MCS48_INPUT_IRQ, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
765
766   /* standby LED is set accordingl to bit 4 */
767   output_set_value("pr8210_standby", (data & 0x10) != 0);
1131768}
1132769
1133770
771/*-------------------------------------------------
772    pr8210_t0_r - return the state of the 8049
773    T0 input (connected to VSYNC)
774-------------------------------------------------*/
775
1134776static READ8_HANDLER( pr8210_t0_r )
1135777{
1136778   /* returns VSYNC state */
r3289r3290
1139781}
1140782
1141783
784/*-------------------------------------------------
785    pr8210_t1_r - return the state of the 8049
786    T1 input (pulled high)
787-------------------------------------------------*/
788
1142789static READ8_HANDLER( pr8210_t1_r )
1143790{
1144   /* must return 1 or else it tries to jump to an external ROM */
1145791   return 1;
1146792}
1147793
1148794
1149static ADDRESS_MAP_START( pr8210_map, ADDRESS_SPACE_PROGRAM, 8 )
1150   AM_RANGE(0x000, 0x7ff) AM_ROM
1151ADDRESS_MAP_END
1152795
796/***************************************************************************
797    SIMUTREK ROM AND MACHINE INTERFACES
798***************************************************************************/
1153799
1154static ADDRESS_MAP_START( pr8210_portmap, ADDRESS_SPACE_IO, 8 )
1155   AM_RANGE(0x00, 0xff) AM_READWRITE(pr8210_pia_r, pr8210_pia_w)
1156   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(pr8210_bus_r)
1157   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(pr8210_porta_w)
1158   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(pr8210_portb_w)
1159   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(pr8210_t0_r)
1160   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(pr8210_t1_r)
800static ADDRESS_MAP_START( simutrek_portmap, ADDRESS_SPACE_IO, 8 )
801   AM_RANGE(0x00, 0xff) AM_READ(simutrek_data_r)
802   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(simutrek_port2_r, simutrek_port2_w)
803   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(simutrek_t0_r)
1161804ADDRESS_MAP_END
1162805
1163806
1164MACHINE_DRIVER_START( pr8210 )
1165   MDRV_CPU_ADD("pr8210", I8049, XTAL_4_41MHz)
1166   MDRV_CPU_PROGRAM_MAP(pr8210_map,0)
1167   MDRV_CPU_IO_MAP(pr8210_portmap,0)
807MACHINE_DRIVER_START( simutrek )
808   MDRV_CPU_ADD("simutrek", I8748, XTAL_6MHz)
809   MDRV_CPU_IO_MAP(simutrek_portmap,0)
810
811   MDRV_IMPORT_FROM(pr8210)
1168812MACHINE_DRIVER_END
813
814
815ROM_START( simutrek )
816   ROM_REGION( 0x800, "pr8210", ROMREGION_LOADBYNAME )
817   ROM_LOAD( "pr-8210_mcu_ud6005a.bin", 0x000, 0x800, CRC(120fa83b) SHA1(b514326ca1f52d6d89056868f9d17eabd4e3f31d) )
818
819   ROM_REGION( 0x400, "simutrek", ROMREGION_LOADBYNAME)
820   ROM_LOAD( "laser_player_interface_d8748_a308.bin", 0x0000, 0x0400, CRC(eed3e728) SHA1(1eb3467f1c41553375b2c21952cd593b167f5416) )
821ROM_END
822
823
824
825/***************************************************************************
826    SIMUTREK PLAYER INTERFACE
827***************************************************************************/
828
829const ldplayer_interface simutrek_interface =
830{
831   LASERDISC_TYPE_SIMUTREK_SPECIAL,         /* type of the player */
832   sizeof(ldplayer_data),                  /* size of the state */
833   "Simutrek Modified PR-8210",            /* name of the player */
834   rom_simutrek,                        /* pointer to ROM region information */
835   machine_config_simutrek,               /* pointer to machine configuration */
836   simutrek_init,                        /* initialization callback */
837   simutrek_vsync,                        /* vsync callback */
838   simutrek_update,                     /* update callback */
839   pr8210_overlay,                        /* overlay callback */
840   simutrek_data_w,                     /* parallel data write */
841   {                                 /* single line write: */
842      NULL,                           /*    LASERDISC_LINE_ENTER */
843      NULL                           /*    LASERDISC_LINE_CONTROL */
844   },
845   NULL,                              /* parallel data read */
846   {                                 /* single line read: */
847      simutrek_ready_r,                  /*    LASERDISC_LINE_READY */
848      simutrek_status_r,                  /*    LASERDISC_LINE_STATUS */
849      NULL,                           /*    LASERDISC_LINE_COMMAND */
850      NULL,                           /*    LASERDISC_LINE_DATA_AVAIL */
851   }
852};
853
854
855
856/***************************************************************************
857    SIMUTREK IMPLEMENTATION
858***************************************************************************/
859
860/*-------------------------------------------------
861    simutrek_set_audio_squelch - Simutrek-specific
862    command to enable/disable audio squelch
863-------------------------------------------------*/
864
865void simutrek_set_audio_squelch(const device_config *device, int state)
866{
867   laserdisc_state *ld = ldcore_get_safe_token(device);
868   ldplayer_data *player = ld->player;
869   player->simutrek.audio_squelch = (state == 0);
870   update_audio_squelch(ld);
871}
872
873
874/*-------------------------------------------------
875    simutrek_init - Simutrek-specific
876    initialization
877-------------------------------------------------*/
878
879static void simutrek_init(laserdisc_state *ld)
880{
881   astring *tempstring = astring_alloc();
882
883   /* standard PR-8210 initialization */
884   pr8210_init(ld);
885
886   /* find the Simutrek CPU */
887   astring_printf(tempstring, "%s:%s", ld->device->tag, "simutrek");
888   ld->player->simutrek.cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring));
889   astring_free(tempstring);
890}
891
892
893/*-------------------------------------------------
894    simutrek_vsync - VSYNC callback, called at the
895    start of the blanking period
896-------------------------------------------------*/
897
898static TIMER_CALLBACK( irq_off )
899{
900   laserdisc_state *ld = ptr;
901   ldplayer_data *player = ld->player;
902   cpunum_set_input_line(ld->device->machine, player->simutrek.cpunum, MCS48_INPUT_IRQ, CLEAR_LINE);
903   if (LOG_SIMUTREK)
904      printf("%3d:**** Simutrek IRQ clear\n", video_screen_get_vpos(ld->screen));
905}
906
907static void simutrek_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
908{
909   ldplayer_data *player = ld->player;
910
911   if (LOG_SIMUTREK)
912      printf("%3d:VSYNC(%d)\n", video_screen_get_vpos(ld->screen), fieldnum);
913   pr8210_vsync(ld, vbi, fieldnum, curtime);
914
915   if (player->simutrek.data_ready)
916   {
917      if (LOG_SIMUTREK)
918         printf("%3d:VSYNC IRQ\n", video_screen_get_vpos(ld->screen));
919      cpunum_set_input_line(ld->device->machine, player->simutrek.cpunum, MCS48_INPUT_IRQ, ASSERT_LINE);
920      timer_set(video_screen_get_scan_period(ld->screen), ld, 0, irq_off);
921   }
922}
923
924
925/*-------------------------------------------------
926    simutrek_update - update callback, called on
927    the first visible line of the frame
928-------------------------------------------------*/
929
930static INT32 simutrek_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
931{
932   return pr8210_update(ld, vbi, fieldnum, curtime);
933}
934
935
936/*-------------------------------------------------
937    simutrek_ready_r - read callback when the
938    READY line is read
939-------------------------------------------------*/
940
941static UINT8 simutrek_ready_r(laserdisc_state *ld)
942{
943   return !ld->player->simutrek.data_ready;
944}
945
946
947/*-------------------------------------------------
948    simutrek_status_r - read callback when the
949    STATUS line is read
950-------------------------------------------------*/
951
952static UINT8 simutrek_status_r(laserdisc_state *ld)
953{
954   return ((ld->player->simutrek.port2 & 0x03) == 0x03) ? ASSERT_LINE : CLEAR_LINE;
955}
956
957
958/*-------------------------------------------------
959    simutrek_data_w - write callback when the
960    parallel data port is written to
961-------------------------------------------------*/
962
963static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
964{
965   timer_call_after_resynch(ld, data, simutrek_latched_data_w);
966   if (LOG_SIMUTREK)
967      printf("%03d:**** Simutrek Command = %02X\n", video_screen_get_vpos(ld->screen), data);
968}
969
970
971/*-------------------------------------------------
972    simutrek_latched_data_w - deferred write
973    callback for when data is written
974-------------------------------------------------*/
975
976static TIMER_CALLBACK( simutrek_latched_data_w )
977{
978   laserdisc_state *ld = ptr;
979   ldplayer_data *player = ld->player;
980
981   /* store the data and set the ready flag */
982   player->simutrek.data = param;
983   player->simutrek.data_ready = TRUE;
984}
985
986
987/*-------------------------------------------------
988    simutrek_port2_r - handle reads from the 8748
989    port #2
990-------------------------------------------------*/
991
992static READ8_HANDLER( simutrek_port2_r )
993{
994   laserdisc_state *ld = find_pr8210(machine);
995   ldplayer_data *player = ld->player;
996
997   /* bit $80 is the pr8210 video squelch */
998   return (player->port1 & 0x20) ? 0x00 : 0x80;
999}
1000
1001
1002/*-------------------------------------------------
1003    simutrek_port2_w - handle writes to the 8748
1004    port #2
1005-------------------------------------------------*/
1006
1007static WRITE8_HANDLER( simutrek_port2_w )
1008{
1009   laserdisc_state *ld = find_pr8210(machine);
1010   ldplayer_data *player = ld->player;
1011   UINT8 prev = player->simutrek.port2;
1012
1013   /* update stat */
1014   player->simutrek.port2 = data;
1015
1016   /* bit $20 goes to the serial line */
1017   if ((data ^ prev) & 0x20)
1018      pr8210_control_w(ld, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
1019
1020   /* bit $10 goes to JUMP TRG */
1021   /* bit $08 controls direction */
1022   if (!(data & 0x10) && (prev & 0x10))
1023   {
1024      int direction = (data & 0x08) ? 1 : -1;
1025      if (LOG_SIMUTREK)
1026         printf("%3d:JUMP TRG (Simutrek PC=%03X)\n", video_screen_get_vpos(ld->screen), activecpu_get_pc());
1027      ldcore_advance_slider(ld, direction);
1028   }
1029
1030   /* bit $04 controls who owns the JUMP TRG command */
1031   if (!(data & 0x04) && (prev & 0x04))
1032      player->simutrek.jumphack = 1;
1033
1034   /* bits $03 control something (status?) */
1035   if (LOG_SIMUTREK && ((data ^ prev) & 0x03))
1036      printf("Simutrek Status = %d\n", data & 0x03);
1037}
1038
1039
1040/*-------------------------------------------------
1041    simutrek_data_r - handle external 8748 data
1042    reads
1043-------------------------------------------------*/
1044
1045static READ8_HANDLER( simutrek_data_r )
1046{
1047   laserdisc_state *ld = find_pr8210(machine);
1048   ldplayer_data *player = ld->player;
1049
1050   /* acknowledge the read and clear the data ready flag */
1051   player->simutrek.data_ready = FALSE;
1052   return player->simutrek.data;
1053}
1054
1055
1056/*-------------------------------------------------
1057    simutrek_t0_r - return the status of the
1058    8748 T0 input
1059-------------------------------------------------*/
1060
1061static READ8_HANDLER( simutrek_t0_r )
1062{
1063   /* return 1 if data is waiting from main CPU */
1064   laserdisc_state *ld = find_pr8210(machine);
1065   return ld->player->simutrek.data_ready;
1066}
src/emu/machine/laserdsc.c
r3289r3290
10861086    video frame
10871087-------------------------------------------------*/
10881088
1089UINT32 laserdisc_get_video(const device_config *device, bitmap_t **bitmap)
1089int laserdisc_get_video(const device_config *device, bitmap_t **bitmap)
10901090{
10911091   laserdisc_state *ld = get_safe_token(device);
10921092   int frameindex;
r3289r3290
11001100   if (!video_active(ld) || ld->videofields[frameindex] < 2)
11011101   {
11021102      *bitmap = ld->emptyframe;
1103      return 0;
1103      return FALSE;
11041104   }
11051105   else
11061106   {
11071107      *bitmap = ld->videovisframe[frameindex];
1108      return ld->videoframenum[frameindex];
1108      return TRUE;
11091109   }
11101110}
11111111
src/emu/machine/laserdsc.h
r3289r3290
129129   \
130130   MDRV_SCREEN_ADD(_tag, RASTER) \
131131   MDRV_SCREEN_FORMAT(_overlayformat) \
132   MDRV_SCREEN_RAW_PARAMS(XTAL_14_31818MHz*2, 910, 0, 704, 525, 0, 480) \
132   MDRV_SCREEN_RAW_PARAMS(XTAL_14_31818MHz*2, 910, 0, 704, 525, 44, 524) \
133133
134134/* not correct yet; fix me... */
135135#define MDRV_LASERDISC_SCREEN_ADD_PAL(_tag, _format) \
r3289r3290
157157
158158/* ----- core control and status ----- */
159159
160/* get a bitmap for the current frame (and the frame number) */
161UINT32 laserdisc_get_video(const device_config *device, bitmap_t **bitmap);
160/* get a bitmap for the current frame; return TRUE if valid or FALSE if video off */
161int laserdisc_get_video(const device_config *device, bitmap_t **bitmap);
162162
163163/* return the raw philips or white flag codes */
164164UINT32 laserdisc_get_field_code(const device_config *device, UINT8 code);
r3289r3290
189189/* control the audio squelch of the Simutrek modified players */
190190void simutrek_set_audio_squelch(const device_config *device, int state);
191191
192/* set the callback */
193void simutrek_set_cmd_ack_callback(const device_config *device, void (*callback)(void));
194192
195193
196
197194/* ----- video interface ----- */
198195
199196/* enable/disable the video */
src/emu/machine/ldcore.c
r3289r3290
2323    DEBUGGING
2424***************************************************************************/
2525
26#define LOG_POSITION(x)            /*printf x*/
26#define LOG_SLIDER               0
2727
2828
2929
r3289r3290
4242    TYPE DEFINITIONS
4343***************************************************************************/
4444
45/* video frame data */
46typedef struct _frame_data frame_data;
47struct _frame_data
48{
49   bitmap_t *         bitmap;               /* cached bitmap */
50   bitmap_t *         visbitmap;            /* wrapper around bitmap with only visible lines */
51   UINT8            numfields;            /* number of fields in this frame */
52   INT32            lastfield;            /* last absolute field number */
53};
54
55
4556/* core-specific data */
4657struct _ldcore_data
4758{
r3289r3290
5162
5263   /* disc parameters */
5364   chd_file *         disc;               /* handle to the disc itself */
65   UINT8 *            vbidata;            /* pointer to precomputed VBI data */
5466   int               width;               /* width of video */
5567   int               height;               /* height of video */
5668   UINT32            fps_times_1million;      /* frame rate of video */
5769   int               samplerate;            /* audio samplerate */
58   UINT8            readpending;         /* true if a read is pending */
70   chd_error         readresult;            /* result of the most recent read */
5971   UINT32            chdtracks;            /* number of tracks in the CHD */
6072   av_codec_decompress_config avconfig;      /* decompression configuration */
6173
r3289r3290
6981   attotime         sliderupdate;         /* time of last slider update */
7082
7183   /* video data */
72   bitmap_t *         videoframe[3];         /* currently cached frames */
73   bitmap_t *         videovisframe[3];      /* wrapper around videoframe with only visible lines */
74   UINT8            videofields[3];         /* number of fields in each frame */
75   UINT32            videoframenum[3];      /* frame number contained in each frame */
84   frame_data         frame[3];            /* circular list of frames */
7685   UINT8            videoindex;            /* index of the current video buffer */
7786   bitmap_t         videotarget;         /* fake target bitmap for decompression */
7887   bitmap_t *         emptyframe;            /* blank frame */
r3289r3290
8897
8998   /* metadata */
9099   vbi_metadata      metadata[2];         /* metadata parsed from the stream, for each field */
91   int               last_frame;            /* last seen frame number */
92   int               last_chapter;         /* last seen chapter number */
93100
94101   /* I/O data */
95102   UINT8            datain;               /* current input data value */
r3289r3290
122129***************************************************************************/
123130
124131/* generic helper functions */
132static TIMER_CALLBACK( perform_player_update );
125133static void read_track_data(laserdisc_state *ld);
126134static void process_track_data(const device_config *device);
127static void fake_metadata(UINT32 track, UINT8 which, vbi_metadata *metadata);
128135//static void render_display(UINT16 *videodata, UINT32 rowpixels, UINT32 width, int frame);
129136static void *custom_start(int clock, const custom_sound_interface *config);
130137static void custom_stream_callback(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
r3289r3290
377384   /* update current track based on slider speed */
378385   update_slider_pos(ldcore, curtime);
379386
380   /* on rising edge, call the player-specific VSYNC function */
387   /* on rising edge, process previously-read frame and inform the player */
381388   if (vblank_state)
382389   {
390      /* call the player's VSYNC callback */
383391      if (ldcore->intf.vsync != NULL)
384         (*ldcore->intf.vsync)(ld);
385      return;
392         (*ldcore->intf.vsync)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime);
393
394      /* set a timer to begin fetching the next frame just before the VBI data would be fetched */
395      timer_set(video_screen_get_time_until_pos(screen, 16*2, 0), ld, 0, perform_player_update);
386396   }
397}
387398
388   /* on falling edge, do the bulk of the processing */
399
400/*-------------------------------------------------
401    vblank_state_changed - called on each state
402    change of the VBLANK signal
403-------------------------------------------------*/
404
405static TIMER_CALLBACK( perform_player_update )
406{
407   laserdisc_state *ld = ptr;
408   ldcore_data *ldcore = ld->core;
409   attotime curtime = timer_get_time();
410
389411   /* wait for previous read and decode to finish */
390   process_track_data(device);
412   process_track_data(ld->device);
391413
414   /* update current track based on slider speed */
415   update_slider_pos(ldcore, curtime);
416
392417   /* update the state */
393418   if (ldcore->intf.update != NULL)
394419      add_and_clamp_track(ldcore, (*ldcore->intf.update)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime));
r3289r3290
501526
502527/*-------------------------------------------------
503528    laserdisc_get_video - return the current
504    video frame
529    video frame; return TRUE if valid or FALSE
530    if video off
505531-------------------------------------------------*/
506532
507UINT32 laserdisc_get_video(const device_config *device, bitmap_t **bitmap)
533int laserdisc_get_video(const device_config *device, bitmap_t **bitmap)
508534{
509535   laserdisc_state *ld = get_safe_token(device);
510536   ldcore_data *ldcore = ld->core;
511   int frameindex;
537   frame_data *frame;
512538
513539   /* determine the most recent live set of frames */
514   frameindex = ldcore->videoindex;
515   if (ldcore->videofields[frameindex] < 2)
516      frameindex = (frameindex + ARRAY_LENGTH(ldcore->videofields) - 1) % ARRAY_LENGTH(ldcore->videofields);
540   frame = &ldcore->frame[ldcore->videoindex];
541   if (frame->numfields < 2)
542      frame = &ldcore->frame[(ldcore->videoindex + ARRAY_LENGTH(ldcore->frame) - 1) % ARRAY_LENGTH(ldcore->frame)];
517543
518544   /* if no video present, return the empty frame */
519   if (ldcore->videosquelch || ldcore->videofields[frameindex] < 2)
545   if (ldcore->videosquelch || frame->numfields < 2)
520546   {
521547      *bitmap = ldcore->emptyframe;
522      return 0;
548      return FALSE;
523549   }
524550   else
525551   {
526      *bitmap = ldcore->videovisframe[frameindex];
527      return ldcore->videoframenum[frameindex];
552      *bitmap = frame->visbitmap;
553      return TRUE;
528554   }
529555}
530556
r3289r3290
538564{
539565   laserdisc_state *ld = get_safe_token(device);
540566   ldcore_data *ldcore = ld->core;
541   int field = ldcore->fieldnum ^ 1;
567   int field = ldcore->fieldnum;
542568
543   /* if no video present, return */
544   if (ldcore->videosquelch)
545      return 0;
546
547569   switch (code)
548570   {
549571      case LASERDISC_CODE_WHITE_FLAG:
r3289r3290
557579
558580      case LASERDISC_CODE_LINE18:
559581         return ldcore->metadata[field].line18;
582
583      case LASERDISC_CODE_LINE1718:
584         return ldcore->metadata[field].line1718;
560585   }
561586
562587   return 0;
r3289r3290
626651   else
627652      ldcore->attospertrack = -attotime_to_attoseconds(attotime_div(vsyncperiod, -tracks_per_vsync));
628653
629printf("Slider speed = %d\n", tracks_per_vsync);
654   if (LOG_SLIDER)
655      printf("Slider speed = %d\n", tracks_per_vsync);
630656}
631657
632658
r3289r3290
641667
642668   update_slider_pos(ldcore, timer_get_time());
643669   add_and_clamp_track(ldcore, numtracks);
644printf("Advance by %d\n", numtracks);
670   if (LOG_SLIDER)
671      printf("Advance by %d\n", numtracks);
645672}
646673
647674
r3289r3290
861888   ldcore_data *ldcore = ld->core;
862889   UINT32 tracknum = ldcore->curtrack;
863890   UINT32 fieldnum = ldcore->fieldnum;
864   chd_error err;
891   frame_data *frame;
892   UINT32 vbiframe;
893   UINT32 readhunk;
894   INT32 chdtrack;
865895
866   /* if the previous field had the white flag, force the new field to pair with it */
867   if (ldcore->metadata[fieldnum ^ 1].white)
868      ldcore->videofields[ldcore->videoindex] = 1;
896   /* if the previous field had a frame number, and the new field immediately follows it,
897       force the new field to pair with the previous one */
898   frame = &ldcore->frame[ldcore->videoindex];
899   if ((ldcore->metadata[fieldnum ^ 1].line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE && (tracknum * 2 + fieldnum == frame->lastfield + 1))
900      frame->numfields = 1;
869901
902   /* otherwise, keep the frames in sync with the absolute field numbers */
903   else if (frame->numfields == 2 && fieldnum != 0)
904      frame->numfields--;
905
870906   /* if we already have both fields on the current videoindex, advance */
871   if (ldcore->videofields[ldcore->videoindex] >= 2)
907   else if (frame->numfields >= 2)
872908   {
873      ldcore->videoindex = (ldcore->videoindex + 1) % ARRAY_LENGTH(ldcore->videofields);
874      ldcore->videofields[ldcore->videoindex] = 0;
909      ldcore->videoindex = (ldcore->videoindex + 1) % ARRAY_LENGTH(ldcore->frame);
910      frame = &ldcore->frame[ldcore->videoindex];
911      frame->numfields = 0;
875912   }
876913
914   /* if we're squelched, reset the frame counter */
915   if (ldcore->videosquelch)
916      frame->numfields = 0;
917
918   /* remember the last field number */
919   frame->lastfield = tracknum * 2 + fieldnum;
920
877921   /* set the video target information */
878   ldcore->videotarget = *ldcore->videoframe[ldcore->videoindex];
922   ldcore->videotarget = *frame->bitmap;
879923   ldcore->videotarget.base = BITMAP_ADDR16(&ldcore->videotarget, fieldnum, 0);
880924   ldcore->videotarget.height /= 2;
881925   ldcore->videotarget.rowpixels *= 2;
r3289r3290
900944   ldcore->avconfig.actsamples = &ldcore->audiocursamples;
901945   ldcore->audiocursamples = 0;
902946
947   /* compute the chdhunk number we are going to read */
948   chdtrack = tracknum - 1 - VIRTUAL_LEAD_IN_TRACKS;
949   chdtrack = MAX(chdtrack, 0);
950   chdtrack = MIN(chdtrack, ldcore->chdtracks - 1);
951   readhunk = chdtrack * 2 + fieldnum;
952
953   /* set the VBI data for the new field from our precomputed data */
954   if (ldcore->vbidata != NULL)
955      vbi_metadata_unpack(&ldcore->metadata[fieldnum], &vbiframe, &ldcore->vbidata[readhunk * VBI_PACKED_BYTES]);
956
903957   /* configure the codec and then read */
904   if (ldcore->disc != NULL)
958   ldcore->readresult = CHDERR_FILE_NOT_FOUND;
959   if (ldcore->disc != NULL && !ldcore->videosquelch)
905960   {
906      err = chd_codec_config(ldcore->disc, AV_CODEC_DECOMPRESS_CONFIG, &ldcore->avconfig);
907      if (err == CHDERR_NONE)
908      {
909         INT32 chdtrack = tracknum - 1 - VIRTUAL_LEAD_IN_TRACKS;
910
911         /* clamp the track */
912         chdtrack = MAX(chdtrack, 0);
913         chdtrack = MIN(chdtrack, ldcore->chdtracks - 1);
914         err = chd_read_async(ldcore->disc, chdtrack * 2 + fieldnum, NULL);
915         ldcore->readpending = TRUE;
916      }
961      ldcore->readresult = chd_codec_config(ldcore->disc, AV_CODEC_DECOMPRESS_CONFIG, &ldcore->avconfig);
962      if (ldcore->readresult == CHDERR_NONE)
963         ldcore->readresult = chd_read_async(ldcore->disc, readhunk, NULL);
917964   }
918965}
919966
r3289r3290
927974{
928975   laserdisc_state *ld = get_safe_token(device);
929976   ldcore_data *ldcore = ld->core;
930   UINT32 tracknum = ldcore->curtrack;
931   UINT32 fieldnum = ldcore->fieldnum;
932   int frame, chapter;
933   chd_error chderr;
934977
935978   /* wait for the async operation to complete */
936   if (ldcore->disc != NULL && ldcore->readpending)
937   {
938      /* complete the async operation */
939      chderr = chd_async_complete(ldcore->disc);
940      if (chderr != CHDERR_NONE && chderr != CHDERR_NO_ASYNC_OPERATION)
941         ldcore->avconfig.video = NULL;
942   }
943   ldcore->readpending = FALSE;
979   if (ldcore->readresult == CHDERR_OPERATION_PENDING)
980      ldcore->readresult = chd_async_complete(ldcore->disc);
944981
945   /* parse the metadata */
946   if (ldcore->disc != NULL && ldcore->avconfig.video != NULL)
947      vbi_parse_all((const UINT16 *)ldcore->avconfig.video->base, ldcore->avconfig.video->rowpixels, ldcore->avconfig.video->width, 8, &ldcore->metadata[fieldnum]);
948   else
949      fake_metadata(tracknum, fieldnum, &ldcore->metadata[fieldnum]);
950//  printf("Track %5d: Metadata = %d %08X %08X %08X %08X\n", tracknum, ldcore->metadata[fieldnum].white, ldcore->metadata[fieldnum].line16, ldcore->metadata[fieldnum].line17, ldcore->metadata[fieldnum].line18, ldcore->metadata[fieldnum].line1718);
982   /* remove the video if we had an error */
983   if (ldcore->readresult != CHDERR_NONE)
984      ldcore->avconfig.video = NULL;
951985
952   /* update the last seen frame and chapter */
953   frame = frame_from_metadata(&ldcore->metadata[fieldnum]);
954   if (frame >= 1 && frame < 99999)
955      ldcore->last_frame = frame;
956   chapter = chapter_from_metadata(&ldcore->metadata[fieldnum]);
957   if (chapter != -1)
958      ldcore->last_chapter = chapter;
986   /* count the field as read if we are successful */
987   if (ldcore->avconfig.video != NULL)
988      ldcore->frame[ldcore->videoindex].numfields++;
959989
960990   /* render the display if present */
961991//  if (ldcore->display && ldcore->avconfig.video != NULL)
962992//      render_display((UINT16 *)ldcore->avconfig.video->base, ldcore->avconfig.video->rowpixels, ldcore->avconfig.video->width, ldcore->last_frame);
963993
964   /* update video field */
965   if (ldcore->avconfig.video != NULL)
966   {
967      ldcore->videofields[ldcore->videoindex]++;
968      ldcore->videoframenum[ldcore->videoindex] = ldcore->last_frame;
969   }
970
971994   /* pass the audio to the callback */
972995   if (ldcore->config.audio != NULL)
973996      (*ldcore->config.audio)(device, ldcore->samplerate, ldcore->audiocursamples, ldcore->avconfig.audio[0], ldcore->avconfig.audio[1]);
r3289r3290
10001023
10011024
10021025/*-------------------------------------------------
1003    fake_metadata - fake metadata when there's
1004    no disc present
1005-------------------------------------------------*/
1006
1007static void fake_metadata(UINT32 track, UINT8 which, vbi_metadata *metadata)
1008{
1009   if (which == 0)
1010   {
1011      metadata->white = 1;
1012      metadata->line16 = 0;
1013      metadata->line17 = metadata->line18 = 0xf80000 |
1014            (((track / 10000) % 10) << 16) |
1015            (((track / 1000) % 10) << 12) |
1016            (((track / 100) % 10) << 8) |
1017            (((track / 10) % 10) << 4) |
1018            (((track / 1) % 10) << 0);
1019   }
1020   else
1021      memset(metadata, 0, sizeof(*metadata));
1022}
1023
1024
1025/*-------------------------------------------------
10261026    render_display - draw the frame display
10271027-------------------------------------------------*/
10281028
r3289r3290
13211321   const device_config *laserdisc = device_list_first(screen->machine->config->devicelist, LASERDISC);
13221322   if (laserdisc != NULL)
13231323   {
1324      const rectangle *visarea = video_screen_get_visible_area(screen);
13241325      laserdisc_state *ld = laserdisc->token;
13251326      ldcore_data *ldcore = ld->core;
13261327      bitmap_t *overbitmap = ldcore->overbitmap[ldcore->overindex];
r3289r3290
13351336         clip.min_x = 0;
13361337         clip.max_x = ldcore->config.overwidth - 1;
13371338         clip.min_y = cliprect->min_y * overbitmap->height / bitmap->height;
1339         if (cliprect->min_y == visarea->min_y)
1340            clip.min_y = MIN(clip.min_y, ldcore->config.overclip.min_y);
13381341         clip.max_y = (cliprect->max_y + 1) * overbitmap->height / bitmap->height - 1;
13391342         (*ldcore->config.overupdate)(screen, overbitmap, &clip);
13401343      }
13411344
13421345      /* if this is the last update, do the rendering */
1343      if (cliprect->max_y == video_screen_get_visible_area(screen)->max_y)
1346      if (cliprect->max_y == visarea->max_y)
13441347      {
13451348         float x0, y0, x1, y1;
13461349
r3289r3290
14431446   ldcore->maxtrack = VIRTUAL_LEAD_IN_TRACKS + MAX_TOTAL_TRACKS + VIRTUAL_LEAD_OUT_TRACKS;
14441447   if (ldcore->disc != NULL)
14451448   {
1449      UINT32 totalhunks = chd_get_header(ldcore->disc)->totalhunks;
14461450      int fps, fpsfrac, interlaced, channels;
14471451      char metadata[256];
1452      UINT32 vbilength;
14481453
14491454      /* require the A/V codec */
14501455      if (chd_get_header(ldcore->disc)->compression != CHDCOMPRESSION_AV)
r3289r3290
14661471         fatalerror("Laserdisc video must be interlaced!");
14671472
14681473      /* determine the maximum track and allocate a frame buffer */
1469      ldcore->chdtracks = chd_get_header(ldcore->disc)->totalhunks / 2;
1474      ldcore->chdtracks = totalhunks / 2;
1475
1476      /* allocate memory for the precomputed per-frame metadata */
1477      ldcore->vbidata = auto_malloc(totalhunks * VBI_PACKED_BYTES);
1478      err = chd_get_metadata(ldcore->disc, AV_LD_METADATA_TAG, 0, ldcore->vbidata, totalhunks * VBI_PACKED_BYTES, &vbilength, NULL);
1479      if (err != CHDERR_NONE || vbilength != totalhunks * VBI_PACKED_BYTES)
1480         fatalerror("Precomputed VBI metadata missing or incorrect size");
14701481   }
14711482   ldcore->maxtrack = MAX(ldcore->maxtrack, VIRTUAL_LEAD_IN_TRACKS + VIRTUAL_LEAD_OUT_TRACKS + ldcore->chdtracks);
14721483}
r3289r3290
14871498   video_screen_register_vblank_callback(ld->screen, vblank_state_changed, (void *)device);
14881499
14891500   /* allocate video frames */
1490   for (index = 0; index < ARRAY_LENGTH(ldcore->videofields); index++)
1501   for (index = 0; index < ARRAY_LENGTH(ldcore->frame); index++)
14911502   {
1503      frame_data *frame = &ldcore->frame[index];
1504
14921505      /* first allocate a YUY16 bitmap at 2x the height */
1493      ldcore->videoframe[index] = auto_bitmap_alloc(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
1494      fillbitmap_yuy16(ldcore->videoframe[index], 40, 109, 240);
1506      frame->bitmap = auto_bitmap_alloc(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
1507      fillbitmap_yuy16(frame->bitmap, 40, 109, 240);
14951508
14961509      /* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */
1497      ldcore->videovisframe[index] = auto_malloc(sizeof(*ldcore->videovisframe[index]));
1498      *ldcore->videovisframe[index] = *ldcore->videoframe[index];
1499      ldcore->videovisframe[index]->base = BITMAP_ADDR16(ldcore->videovisframe[index], 44, ldcore->videoframe[index]->width * 8 / 720);
1500      ldcore->videovisframe[index]->height -= 44;
1501      ldcore->videovisframe[index]->width -= 2 * ldcore->videoframe[index]->width * 8 / 720;
1510      frame->visbitmap = auto_malloc(sizeof(*frame->visbitmap));
1511      *frame->visbitmap = *frame->bitmap;
1512      frame->visbitmap->base = BITMAP_ADDR16(frame->visbitmap, 44, frame->bitmap->width * 8 / 720);
1513      frame->visbitmap->height -= 44;
1514      frame->visbitmap->width -= 2 * frame->bitmap->width * 8 / 720;
15021515   }
15031516
15041517   /* allocate an empty frame of the same size */
r3289r3290
16741687   ldcore->attospertrack = 0;
16751688   ldcore->sliderupdate = curtime;
16761689
1677   /* reset metadata */
1678   ldcore->last_frame = 0;
1679   ldcore->last_chapter = 0;
1680
16811690   /* reset the I/O lines */
16821691   for (line = 0; line < LASERDISC_INPUT_LINES; line++)
16831692      ldcore->linein[line] = CLEAR_LINE;
src/emu/machine/ldcore.h
r3289r3290
134134
135135/* player-specific callbacks */
136136typedef void (*laserdisc_init_func)(laserdisc_state *ld);
137typedef void (*laserdisc_vsync_func)(laserdisc_state *ld);
137typedef 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);
139typedef void (*laserdisc_overlay_func)(laserdisc_state *ld, bitmap_t *bitmap);
139140typedef void (*laserdisc_w_func)(laserdisc_state *ld, UINT8 prev, UINT8 new);
140141typedef UINT8 (*laserdisc_r_func)(laserdisc_state *ld);
141142
r3289r3290
151152   const machine_config_token *machine_config;      /* pointer to machine configuration */
152153   laserdisc_init_func      init;               /* initialization callback */
153154   laserdisc_vsync_func   vsync;               /* vsync begin callback */
154   laserdisc_update_func   update;               /* update callback (vblank end) */
155   laserdisc_update_func   update;               /* update callback (line 16) */
156   laserdisc_overlay_func   overlay;            /* overlay callback */
155157   laserdisc_w_func      writedata;            /* parallel data write */
156158   laserdisc_w_func      writeline[LASERDISC_INPUT_LINES]; /* single line write */
157159   laserdisc_r_func      readdata;            /* parallel data read */
r3289r3290
234236
235237INLINE int frame_from_metadata(const vbi_metadata *metadata)
236238{
237   UINT32 data;
238
239   if ((metadata->line1718 & 0xf80000) == 0xf80000)
240      data = metadata->line1718 & 0x7ffff;
241   else if (metadata->line1718 == 0x88ffff)
239   if ((metadata->line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
240      return VBI_CAV_PICTURE(metadata->line1718);
241   else if (metadata->line1718 == VBI_CODE_LEADIN)
242242      return FRAME_LEAD_IN;
243   else if (metadata->line1718 == 0x80eeee)
243   else if (metadata->line1718 == VBI_CODE_LEADOUT)
244244      return FRAME_LEAD_OUT;
245   else
246      return FRAME_NOT_PRESENT;
247
248   return (((data >> 16) & 0x0f) * 10000) + (((data >> 12) & 0x0f) * 1000) + (((data >> 8) & 0x0f) * 100) + (((data >> 4) & 0x0f) * 10) + (data & 0x0f);
245   return FRAME_NOT_PRESENT;
249246}
250247
251248
r3289r3290
257254
258255INLINE int chapter_from_metadata(const vbi_metadata *metadata)
259256{
260   UINT32 data;
261
262257   if ((metadata->line1718 & 0xf00fff) == 0x800ddd)
263      data = metadata->line1718 & 0x7f000;
264   else if (metadata->line1718 == 0x88ffff)
258      return VBI_CHAPTER(metadata->line1718);
259   else if (metadata->line1718 == VBI_CODE_LEADIN)
265260      return CHAPTER_LEAD_IN;
266   else if (metadata->line1718 == 0x80eeee)
261   else if (metadata->line1718 == VBI_CODE_LEADOUT)
267262      return CHAPTER_LEAD_OUT;
268   else
269      return CHAPTER_NOT_PRESENT;
270
271   return (((data >> 16) & 0x0f) * 10) + ((data >> 12) & 0x0f);
263   return CHAPTER_NOT_PRESENT;
272264}
273265
274266
src/emu/machine/x2212.c
r0r3290
1/*
2 * Xicor X2212
3 *
4 * 256 x 4 bit Nonvolatile Static RAM
5 *
6 */
7
8#include "driver.h"
9#include "machine/x2212.h"
10
11#define SIZE_DATA ( 0x100 )
12
13typedef struct
14{
15   UINT8 *sram;
16   UINT8 *e2prom;
17   UINT8 *default_data;
18   int store;
19   int array_recall;
20} x2212_state;
21
22/*-------------------------------------------------
23    get_safe_token - makes sure that the passed
24    in device is, in fact, an X2212
25-------------------------------------------------*/
26
27INLINE x2212_state *get_safe_token(const device_config *device)
28{
29   assert(device != NULL);
30   assert(device->token != NULL);
31   assert(device->type == X2212);
32
33   return (x2212_state *)device->token;
34}
35
36void x2212_write( const device_config *device, int offset, int data )
37{
38   x2212_state *c = get_safe_token(device);
39
40   c->sram[ offset ] = data;
41}
42
43
44int x2212_read( const device_config *device, int offset )
45{
46   x2212_state *c = get_safe_token(device);
47
48   return c->sram[ offset ];
49}
50
51void x2212_store( const device_config *device, int store )
52{
53   x2212_state *c = get_safe_token(device);
54
55   if( !store && c->store )
56   {
57      memcpy( c->e2prom, c->sram, SIZE_DATA );
58   }
59
60   c->store = store;
61}
62
63void x2212_array_recall( const device_config *device, int array_recall )
64{
65   x2212_state *c = get_safe_token(device);
66
67   if( !array_recall && c->array_recall )
68   {
69      memcpy( c->sram, c->e2prom, SIZE_DATA );
70   }
71
72   c->array_recall = array_recall;
73}
74
75/*-------------------------------------------------
76    device start callback
77-------------------------------------------------*/
78
79static DEVICE_START(x2212)
80{
81   x2212_state *c = get_safe_token(device);
82   const x2212_config *config;
83   char unique_tag[50];
84
85   /* validate some basic stuff */
86   assert(device != NULL);
87//  assert(device->static_config != NULL);
88   assert(device->inline_config == NULL);
89   assert(device->machine != NULL);
90   assert(device->machine->config != NULL);
91
92   c->sram = auto_malloc( SIZE_DATA );
93   c->e2prom = auto_malloc( SIZE_DATA );
94   c->store = 1;
95   c->array_recall = 1;
96
97   config = device->static_config;
98   if( config != NULL && config->data != NULL )
99   {
100      c->default_data = memory_region( device->machine, config->data );
101   }
102
103   /* create the name for save states */
104   assert( strlen( device->tag ) < 30 );
105   state_save_combine_module_and_tag( unique_tag, "x2212", device->tag );
106
107   state_save_register_item_pointer( unique_tag, 0, c->sram, SIZE_DATA );
108   state_save_register_item_pointer( unique_tag, 0, c->e2prom, SIZE_DATA );
109   state_save_register_item( unique_tag, 0, c->store );
110   state_save_register_item( unique_tag, 0, c->array_recall );
111
112   return DEVICE_START_OK;
113}
114
115/*-------------------------------------------------
116    device reset callback
117-------------------------------------------------*/
118
119static DEVICE_RESET(x2212)
120{
121}
122
123static DEVICE_NVRAM(x2212)
124{
125   x2212_state *c = get_safe_token(device);
126
127   if( read_or_write )
128   {
129      mame_fwrite( file, c->sram, SIZE_DATA );
130   }
131   else
132   {
133      if( file )
134      {
135         mame_fread( file, c->e2prom, SIZE_DATA );
136      }
137      else
138      {
139         if( c->default_data != NULL )
140         {
141            memcpy( c->e2prom, c->default_data, SIZE_DATA );
142         }
143         else
144         {
145            memset( c->e2prom, 0xff, SIZE_DATA );
146         }
147      }
148
149      memcpy( c->sram, c->e2prom, SIZE_DATA );
150   }
151}
152
153/*-------------------------------------------------
154    device set info callback
155-------------------------------------------------*/
156
157static DEVICE_SET_INFO(x2212)
158{
159   switch (state)
160   {
161      /* no parameters to set */
162   }
163}
164
165/*-------------------------------------------------
166    device get info callback
167-------------------------------------------------*/
168
169DEVICE_GET_INFO(x2212)
170{
171   switch (state)
172   {
173      /* --- the following bits of info are returned as 64-bit signed integers --- */
174      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(x2212_state); break;
175      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = 0; break; // sizeof(x2212_config)
176      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL; break;
177
178      /* --- the following bits of info are returned as pointers to data or functions --- */
179      case DEVINFO_FCT_SET_INFO:            info->set_info = DEVICE_SET_INFO_NAME(x2212); break;
180      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(x2212); break;
181      case DEVINFO_FCT_STOP:               /* nothing */ break;
182      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(x2212); break;
183      case DEVINFO_FCT_NVRAM:               info->nvram = DEVICE_NVRAM_NAME(x2212); break;
184
185      /* --- the following bits of info are returned as NULL-terminated strings --- */
186      case DEVINFO_STR_NAME:               info->s = "X2212"; break;
187      case DEVINFO_STR_FAMILY:            info->s = "EEPROM"; break;
188      case DEVINFO_STR_VERSION:            info->s = "1.0"; break;
189      case DEVINFO_STR_SOURCE_FILE:         info->s = __FILE__; break;
190      case DEVINFO_STR_CREDITS:            info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
191   }
192}
src/emu/machine/x2212.h
r0r3290
1/*
2 * Xicor X2212
3 *
4 * 256 x 4 bit Nonvolatile Static RAM
5 *
6 */
7
8#if !defined( X2212_H )
9#define X2212_H ( 1 )
10
11typedef struct _x2212_config x2212_config;
12struct _x2212_config
13{
14   const char *data;
15};
16
17#define X2212 DEVICE_GET_INFO_NAME(x2212)
18DEVICE_GET_INFO(x2212);
19
20extern void x2212_write( const device_config *device, int offset, int data );
21extern int x2212_read( const device_config *device, int offset );
22extern void x2212_store( const device_config *device, int store );
23extern void x2212_array_recall( const device_config *device, int array_recall );
24
25#endif
src/emu/machine/ldv1000.c
r3289r3290
104104   ldv1000_init,                        /* initialization callback */
105105   NULL,                              /* vsync callback */
106106   ldv1000_update,                        /* update callback */
107   NULL,                              /* overlay callback */
107108   ldv1000_data_w,                        /* parallel data write */
108109   {                                 /* single line write: */
109110      NULL,                           /*    LASERDISC_LINE_ENTER */
src/emu/sound/sound.mak
r3289r3290
310310SOUNDDEFS += -DHAS_NAMCO_CUS30=$(if $(filter NAMCO_CUS30,$(SOUNDS)),1,0)
311311SOUNDDEFS += -DHAS_NAMCO_52XX=$(if $(filter NAMCO_52XX,$(SOUNDS)),1,0)
312312SOUNDDEFS += -DHAS_NAMCO_63701X=$(if $(filter NAMCO_63701X,$(SOUNDS)),1,0)
313SOUNDDEFS += -DHAS_NAMCONA=$(if $(filter NAMCONA,$(SOUNDS)),1,0)
314313SOUNDDEFS += -DHAS_C140=$(if $(filter C140,$(SOUNDS)),1,0)
315314SOUNDDEFS += -DHAS_C352=$(if $(filter C352,$(SOUNDS)),1,0)
316315
r3289r3290
326325SOUNDOBJS += $(SOUNDOBJ)/n63701x.o
327326endif
328327
329ifneq ($(filter NAMCONA,$(SOUNDS)),)
330SOUNDOBJS += $(SOUNDOBJ)/namcona.o
331endif
332
333328ifneq ($(filter C140,$(SOUNDS)),)
334329SOUNDOBJS += $(SOUNDOBJ)/c140.o
335330endif
src/emu/sndintrf.c
r3289r3290
105105void namco_cus30_get_info(void *token, UINT32 state, sndinfo *info);
106106void namco_52xx_get_info(void *token, UINT32 state, sndinfo *info);
107107void namco_63701x_get_info(void *token, UINT32 state, sndinfo *info);
108void namcona_get_info(void *token, UINT32 state, sndinfo *info);
109108void snkwave_get_info(void *token, UINT32 state, sndinfo *info);
110109void tms36xx_get_info(void *token, UINT32 state, sndinfo *info);
111110void tms3615_get_info(void *token, UINT32 state, sndinfo *info);
r3289r3290
289288#if (HAS_NAMCO_63701X)
290289   { SOUND_NAMCO_63701X, namco_63701x_get_info },
291290#endif
292#if (HAS_NAMCONA)
293   { SOUND_NAMCONA, namcona_get_info },
294#endif
295291#if (HAS_SNKWAVE)
296292   { SOUND_SNKWAVE, snkwave_get_info },
297293#endif
src/emu/sndintrf.h
r3289r3290
6969   SOUND_NAMCO_CUS30,
7070   SOUND_NAMCO_52XX,
7171   SOUND_NAMCO_63701X,
72   SOUND_NAMCONA,
7372   SOUND_SNKWAVE,
7473   SOUND_TMS36XX,
7574   SOUND_TMS3615,
src/emu/drivers/xtal.h
r3289r3290
8686   XTAL_13_3MHz        = 13300000,      /* BMC bowling */
8787   XTAL_13_33056MHz    = 13330560,      /* Taito L */
8888   XTAL_13_4MHz      = 13400000,      /* TNK3, Ikari Warriors h/w */
89   XTAL_13_4952MHz      = 13495200,      /* Used on Shadow Force pcb and maybe other Technos pcbs? */
8990   XTAL_14MHz         = 14000000,
9091   XTAL_14_31818MHz     = 14318180,      /* Extremely common, used on 100's of PCBs */
9192   XTAL_14_705882MHz     = 14705882,      /* Aleck64 */
src/emu/romload.c
r3289r3290
631631      }
632632
633633   /* if the region is load by name, load the ROM from there */
634   if (regiontag != NULL)
634   if (romdata->file == NULL && regiontag != NULL)
635635   {
636636      astring *fname = astring_assemble_3(astring_alloc(), regiontag, PATH_SEPARATOR, ROM_GETNAME(romp));
637637      if (has_crc)
src/lib/util/chd.h
r3289r3290
130130#define AV_METADATA_TAG            0x41564156   /* 'AVAV' */
131131#define AV_METADATA_FORMAT         "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d"
132132
133/* A/V laserdisc frame metadata */
134#define AV_LD_METADATA_TAG         0x41564C44   /* 'AVLD' */
135
133136/* CHD open values */
134137#define CHD_OPEN_READ            1
135138#define CHD_OPEN_READWRITE         2
src/lib/util/vbiparse.c
r3289r3290
318318   else
319319   {
320320      /* if both are frame numbers, and one is not valid BCD, pick the other */
321      if ((vbi->line17 & 0xf80000) == 0xf80000 && (vbi->line18 & 0xf80000) == 0xf80000)
321      if ((vbi->line17 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE && (vbi->line18 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
322322      {
323323         if ((vbi->line17 & 0xf000) > 0x9000 || (vbi->line17 & 0xf00) > 0x900 || (vbi->line17 & 0xf0) > 0x90 || (vbi->line17 & 0xf) > 0x9)
324324            vbi->line1718 = vbi->line18;
r3289r3290
332332            vbi->line1718 = (vbi->line1718 << 1) | ((bits[0][bitnum] > bits[1][bitnum]) ? (bits[0][bitnum] & 1) : (bits[1][bitnum] & 1));
333333   }
334334}
335
336
337/*-------------------------------------------------
338    vbi_metadata_pack - pack the VBI data down
339    into a smaller form for storage
340-------------------------------------------------*/
341
342void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi)
343{
344   dest[0] = framenum >> 16;
345   dest[1] = framenum >> 8;
346   dest[2] = framenum >> 0;
347   dest[3] = vbi->white;
348   dest[4] = vbi->line16 >> 16;
349   dest[5] = vbi->line16 >> 8;
350   dest[6] = vbi->line16 >> 0;
351   dest[7] = vbi->line17 >> 16;
352   dest[8] = vbi->line17 >> 8;
353   dest[9] = vbi->line17 >> 0;
354   dest[10] = vbi->line18 >> 16;
355   dest[11] = vbi->line18 >> 8;
356   dest[12] = vbi->line18 >> 0;
357   dest[13] = vbi->line1718 >> 16;
358   dest[14] = vbi->line1718 >> 8;
359   dest[15] = vbi->line1718 >> 0;
360}
361
362
363/*-------------------------------------------------
364    vbi_metadata_unpack - unpack the VBI data
365    from a smaller form into the full structure
366-------------------------------------------------*/
367
368void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source)
369{
370   *framenum = (source[0] << 16) | (source[1] << 8) | source[2];
371   vbi->white = source[3];
372   vbi->line16 = (source[4] << 16) | (source[5] << 8) | source[6];
373   vbi->line17 = (source[7] << 16) | (source[8] << 8) | source[9];
374   vbi->line18 = (source[10] << 16) | (source[11] << 8) | source[12];
375   vbi->line1718 = (source[13] << 16) | (source[14] << 8) | source[15];
376}
377
src/lib/util/vbiparse.h
r3289r3290
1616
1717
1818/***************************************************************************
19    CONSTANTS
20***************************************************************************/
21
22/* size of packed VBI data */
23#define VBI_PACKED_BYTES      16
24
25/* these codes are full 24-bit codes with no parameter data */
26#define VBI_CODE_LEADIN         0x88ffff
27#define VBI_CODE_LEADOUT      0x80eeee
28#define VBI_CODE_STOP         0x82cfff
29#define VBI_CODE_CLV         0x87ffff
30
31/* these codes require a mask because some bits are parameters */
32#define VBI_MASK_CAV_PICTURE   0xf00000
33#define VBI_CODE_CAV_PICTURE   0xf00000
34#define VBI_MASK_CHAPTER      0xf00fff
35#define VBI_CODE_CHAPTER      0x800ddd
36#define VBI_MASK_CLV_TIME      0xf0ff00
37#define VBI_CODE_CLV_TIME      0xf0dd00
38#define VBI_MASK_STATUS_CX_ON   0xfff000
39#define VBI_CODE_STATUS_CX_ON   0x8dc000
40#define VBI_MASK_STATUS_CX_OFF   0xfff000
41#define VBI_CODE_STATUS_CX_OFF   0x8bc000
42#define VBI_MASK_USER         0xf0f000
43#define VBI_CODE_USER         0x80d000
44#define VBI_MASK_CLV_PICTURE   0xf0f000
45#define VBI_CODE_CLV_PICTURE   0x80e000
46
47
48
49/***************************************************************************
50    MACROS
51***************************************************************************/
52
53#define VBI_CAV_PICTURE(x)      (((((x) >> 16) & 0x07) * 10000) + ((((x) >> 12) & 0x0f) * 1000) + ((((x) >> 8) & 0x0f) * 100) + ((((x) >> 4) & 0x0f) * 10) + ((((x) >> 0) & 0x0f) * 1))
54#define VBI_CHAPTER(x)         (((((x) >> 16) & 0x07) * 10) + ((((x) >> 12) & 0x0f) * 1))
55
56
57
58/***************************************************************************
1959    TYPE DEFINITIONS
2060***************************************************************************/
2161
r3289r3290
4484/* parse everything from a video frame */
4585void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi);
4686
87/* pack the VBI data down into a smaller form for storage */
88void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi);
4789
90/* unpack the VBI data from a smaller form into the full structure */
91void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source);
92
93
4894#endif /* __VBIPARSE_H__ */
src/mess/mess.mak
r3289r3290
270270#SOUNDS += NAMCO_CUS30
271271#SOUNDS += NAMCO_52XX
272272#SOUNDS += NAMCO_63701X
273#SOUNDS += NAMCONA
274273#SOUNDS += SNKWAVE
275274#SOUNDS += C140
276275#SOUNDS += C352
r3289r3290
331330SOUNDS += SID6581
332331SOUNDS += SID8580
333332SOUNDS += SP0256
333#SOUNDS += NAMCONA
334334
335335
336336#-------------------------------------------------
src/ldplayer/ldplayer.c
r3289r3290
2929{
3030   CMD_SCAN_REVERSE,
3131   CMD_STEP_REVERSE,
32   CMD_SLOW_REVERSE,
33   CMD_FAST_REVERSE,
3234   CMD_SCAN_FORWARD,
3335   CMD_STEP_FORWARD,
36   CMD_SLOW_FORWARD,
37   CMD_FAST_FORWARD,
3438   CMD_PLAY,
3539   CMD_PAUSE,
36   CMD_DISPLAY_ON,
37   CMD_DISPLAY_OFF,
40   CMD_FRAME_TOGGLE,
41   CMD_CHAPTER_TOGGLE,
42   CMD_CH1_TOGGLE,
43   CMD_CH2_TOGGLE,
3844   CMD_0,
3945   CMD_1,
4046   CMD_2,
r3289r3290
6066
6167static input_port_value last_controls;
6268static UINT8 playing;
63static UINT8 displaying;
6469
6570static emu_timer *pr8210_bit_timer;
6671static UINT32 pr8210_command_buffer_in, pr8210_command_buffer_out;
r3289r3290
8186   input_port_value controls = input_port_read(laserdisc->machine, "controls");
8287    int number;
8388
84   /* scan/step backwards */
85   if (playing)
86   {
87      if (controls & 0x01)
88         (*execute_command)(laserdisc, CMD_SCAN_REVERSE);
89   }
90   else
91   {
92      if (!(last_controls & 0x01) && (controls & 0x01))
93         (*execute_command)(laserdisc, CMD_STEP_REVERSE);
94   }
89   /* step backwards */
90   if (!(last_controls & 0x01) && (controls & 0x01))
91      (*execute_command)(laserdisc, CMD_STEP_REVERSE);
9592
96   /* scan/step forwards */
97   if (playing)
98   {
99      if (controls & 0x02)
100         (*execute_command)(laserdisc, CMD_SCAN_FORWARD);
101   }
102   else
103   {
104      if (!(last_controls & 0x02) && (controls & 0x02))
105         (*execute_command)(laserdisc, CMD_STEP_FORWARD);
106   }
93   /* step forwards */
94   if (!(last_controls & 0x02) && (controls & 0x02))
95      (*execute_command)(laserdisc, CMD_STEP_FORWARD);
10796
97   /* scan backwards */
98   if (controls & 0x04)
99      (*execute_command)(laserdisc, CMD_SCAN_REVERSE);
100
101   /* scan forwards */
102   if (controls & 0x08)
103      (*execute_command)(laserdisc, CMD_SCAN_FORWARD);
104
105   /* slow backwards */
106   if (!(last_controls & 0x10) && (controls & 0x10))
107      (*execute_command)(laserdisc, CMD_SLOW_REVERSE);
108
109   /* slow forwards */
110   if (!(last_controls & 0x20) && (controls & 0x20))
111      (*execute_command)(laserdisc, CMD_SLOW_FORWARD);
112
113   /* fast backwards */
114   if (controls & 0x40)
115      (*execute_command)(laserdisc, CMD_FAST_REVERSE);
116
117   /* fast forwards */
118   if (controls & 0x80)
119      (*execute_command)(laserdisc, CMD_FAST_FORWARD);
120
108121   /* play/pause */
109   if (!(last_controls & 0x10) && (controls & 0x10))
122   if (!(last_controls & 0x100) && (controls & 0x100))
110123   {
111124      playing = !playing;
112125      (*execute_command)(laserdisc, playing ? CMD_PLAY : CMD_PAUSE);
113126   }
114127
115   /* toggle display */
116   if (!(last_controls & 0x20) && (controls & 0x20))
117   {
118      displaying = !displaying;
119      (*execute_command)(laserdisc, displaying ? CMD_DISPLAY_ON : CMD_DISPLAY_OFF);
120   }
128   /* toggle frame display */
129   if (!(last_controls & 0x200) && (controls & 0x200))
130      (*execute_command)(laserdisc, CMD_FRAME_TOGGLE);
121131
132   /* toggle chapter display */
133   if (!(last_controls & 0x400) && (controls & 0x400))
134      (*execute_command)(laserdisc, CMD_CHAPTER_TOGGLE);
135
136   /* toggle left channel */
137   if (!(last_controls & 0x800) && (controls & 0x800))
138      (*execute_command)(laserdisc, CMD_CH1_TOGGLE);
139
140   /* toggle right channel */
141   if (!(last_controls & 0x1000) && (controls & 0x1000))
142      (*execute_command)(laserdisc, CMD_CH2_TOGGLE);
143
122144   /* numbers */
123145   for (number = 0; number < 10; number++)
124      if (!(last_controls & (0x100 << number)) && (controls & (0x100 << number)))
146      if (!(last_controls & (0x10000 << number)) && (controls & (0x10000 << number)))
125147         (*execute_command)(laserdisc, CMD_0 + number);
126148
127149   /* enter */
128   if (!(last_controls & 0x40000) && (controls & 0x40000))
150   if (!(last_controls & 0x4000000) && (controls & 0x4000000))
129151      (*execute_command)(laserdisc, CMD_SEARCH);
130152
131153   last_controls = controls;
r3289r3290
162184   /* start playing */
163185   (*execute_command)(laserdisc, CMD_PLAY);
164186   playing = TRUE;
165   displaying = FALSE;
166187}
167188
168189
r3289r3290
186207INLINE void pr8210_add_command(UINT8 command)
187208{
188209   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = (command & 0x1f) | 0x20;
189   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = (command & 0x1f) | 0x20;
190210   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = 0x00 | 0x20;
191211}
192212
r3289r3290
252272   switch (command)
253273   {
254274      case CMD_SCAN_REVERSE:
255         if (pr8210_command_buffer_in == pr8210_command_buffer_out)
275         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
276            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
256277         {
257278            pr8210_add_command(0x1c);
258279            playing = TRUE;
r3289r3290
264285         playing = FALSE;
265286         break;
266287
288      case CMD_SLOW_REVERSE:
289         pr8210_add_command(0x02);
290         playing = TRUE;
291         break;
292
293      case CMD_FAST_REVERSE:
294         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
295            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
296         {
297            pr8210_add_command(0x0c);
298            playing = TRUE;
299         }
300         break;
301
267302      case CMD_SCAN_FORWARD:
268         if (pr8210_command_buffer_in == pr8210_command_buffer_out)
303         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
304            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
269305         {
270306            pr8210_add_command(0x08);
271307            playing = TRUE;
r3289r3290
277313         playing = FALSE;
278314         break;
279315
316      case CMD_SLOW_FORWARD:
317         pr8210_add_command(0x18);
318         playing = TRUE;
319         break;
320
321      case CMD_FAST_FORWARD:
322         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
323            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
324         {
325            pr8210_add_command(0x10);
326            playing = TRUE;
327         }
328         break;
329
280330      case CMD_PLAY:
281331         pr8210_add_command(0x14);
282332         playing = TRUE;
r3289r3290
287337         playing = FALSE;
288338         break;
289339
290      case CMD_DISPLAY_ON:
291      case CMD_DISPLAY_OFF:
340      case CMD_FRAME_TOGGLE:
292341         pr8210_add_command(0x0b);
293342         break;
294343
344      case CMD_CHAPTER_TOGGLE:
345         pr8210_add_command(0x06);
346         break;
347
348      case CMD_CH1_TOGGLE:
349         pr8210_add_command(0x0e);
350         break;
351
352      case CMD_CH2_TOGGLE:
353         pr8210_add_command(0x16);
354         break;
355
295356      case CMD_0:
296357      case CMD_1:
297358      case CMD_2:
r3289r3290
355416         playing = FALSE;
356417         break;
357418
358      case CMD_DISPLAY_ON:
359         laserdisc_data_w(laserdisc, digits[1]);
419      case CMD_FRAME_TOGGLE:
360420         laserdisc_data_w(laserdisc, 0xf1);
361421         break;
362422
363      case CMD_DISPLAY_OFF:
364         laserdisc_data_w(laserdisc, digits[0]);
365         laserdisc_data_w(laserdisc, 0xf1);
366         break;
367
368423      case CMD_0:
369424      case CMD_1:
370425      case CMD_2:
r3289r3290
395450
396451static INPUT_PORTS_START( ldplayer )
397452   PORT_START("controls")
398   PORT_BIT( 0x00001, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
399   PORT_BIT( 0x00002, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
400   PORT_BIT( 0x00004, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
401   PORT_BIT( 0x00008, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
402   PORT_BIT( 0x00010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE)
403   PORT_BIT( 0x00020, IP_ACTIVE_HIGH, IPT_BUTTON2 )
404   PORT_BIT( 0x00100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_0)
405   PORT_BIT( 0x00200, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_1)
406   PORT_BIT( 0x00400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_2)
407   PORT_BIT( 0x00800, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_3)
408   PORT_BIT( 0x01000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_4)
409   PORT_BIT( 0x02000, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_5_PAD) PORT_CODE(KEYCODE_5)
410   PORT_BIT( 0x04000, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_6)
411   PORT_BIT( 0x08000, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_7)
412   PORT_BIT( 0x10000, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_8)
413   PORT_BIT( 0x20000, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_9)
414   PORT_BIT( 0x40000, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_ENTER)
453   PORT_BIT( 0x0000001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Step reverse") PORT_CODE(KEYCODE_LEFT)
454   PORT_BIT( 0x0000002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Step forward") PORT_CODE(KEYCODE_RIGHT)
455   PORT_BIT( 0x0000004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Scan reverse") PORT_CODE(KEYCODE_UP)
456   PORT_BIT( 0x0000008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Scan forward") PORT_CODE(KEYCODE_DOWN)
457   PORT_BIT( 0x0000010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Slow reverse") PORT_CODE(KEYCODE_OPENBRACE)
458   PORT_BIT( 0x0000020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Slow forward") PORT_CODE(KEYCODE_CLOSEBRACE)
459   PORT_BIT( 0x0000040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Fast reverse") PORT_CODE(KEYCODE_COMMA)
460   PORT_BIT( 0x0000080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Fast forward") PORT_CODE(KEYCODE_STOP)
461   PORT_BIT( 0x0000100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Play/Pause") PORT_CODE(KEYCODE_SPACE)
462   PORT_BIT( 0x0000200, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Toggle frame display") PORT_CODE(KEYCODE_F)
463   PORT_BIT( 0x0000400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Toggle chapter display") PORT_CODE(KEYCODE_C)
464   PORT_BIT( 0x0000800, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Toggle left channel") PORT_CODE(KEYCODE_L)
465   PORT_BIT( 0x0001000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Toggle right channel") PORT_CODE(KEYCODE_R)
466   PORT_BIT( 0x0010000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("0") PORT_PLAYER(2) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_0)
467   PORT_BIT( 0x0020000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("1") PORT_PLAYER(2) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_1)
468   PORT_BIT( 0x0040000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("2") PORT_PLAYER(2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_2)
469   PORT_BIT( 0x0080000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("3") PORT_PLAYER(2) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_3)
470   PORT_BIT( 0x0100000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("4") PORT_PLAYER(2) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_4)
471   PORT_BIT( 0x0200000, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("5") PORT_PLAYER(2) PORT_CODE(KEYCODE_5_PAD) PORT_CODE(KEYCODE_5)
472   PORT_BIT( 0x0400000, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("6") PORT_PLAYER(2) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_6)
473   PORT_BIT( 0x0800000, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("7") PORT_PLAYER(2) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_7)
474   PORT_BIT( 0x1000000, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("8") PORT_PLAYER(2) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_8)
475   PORT_BIT( 0x2000000, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("9") PORT_PLAYER(2) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_9)
476   PORT_BIT( 0x4000000, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Enter") PORT_PLAYER(2) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_ENTER)
415477INPUT_PORTS_END
416478
417479
docs/messnew.txt
r3289r3290
1414- PK-8020 Korvet (not working) [Miodrag Milanovic]
1515- Kramer MC [Miodrag Milanovic]
1616
17
18
1719System Driver Changes:
1820----------------------
1921
r3289r3290
155157
156158Source Changes:
157159----------------
158- The core is based on MAME 0.127u3.  This incorporates all features of the
160- The core is based on MAME 0.127u4.  This incorporates all features of the
159161  update to this core.  [MAME team]
160162
161163- Refactored ZIP path code out of src/mess/image.c, made more testable.  [Nate

Previous 15994 Revisions Next


© 1998-2018 The MESS Team